diff --git a/.changeset/salty-meals-bet.md b/.changeset/salty-meals-bet.md new file mode 100644 index 000000000..4ce28df81 --- /dev/null +++ b/.changeset/salty-meals-bet.md @@ -0,0 +1,7 @@ +--- +"@commercetools/nimbus": minor +"@commercetools/nimbus-i18n": minor +--- + +Update Combobox to new context-based architecture and add missing features, +update i18n strings. diff --git a/.claude/agents/nimbus-researcher.md b/.claude/agents/nimbus-researcher.md index 861fbaf59..65a93b3b5 100644 --- a/.claude/agents/nimbus-researcher.md +++ b/.claude/agents/nimbus-researcher.md @@ -1,6 +1,6 @@ --- name: nimbus-researcher -description: Use this agent when you need to gather information, find documentation, explore technical concepts, or research solutions to problems. This includes searching for library documentation, API references, best practices, code examples, or general web information. The agent will use context7 for library documentation and web search for broader research needs.\n\nExamples:\n\nContext: User needs to understand how to implement a specific React Aria pattern\nuser: "How do I implement an accessible combobox with React Aria?"\nassistant: "I'll use the research-analyst agent to find the React Aria documentation for combobox implementation."\n\nSince the user needs documentation about a library feature, use the research-analyst agent to search context7 for React Aria combobox documentation.\n\n\n\nContext: User wants to understand a technical concept before implementation\nuser: "What are the best practices for implementing compound components in React?"\nassistant: "Let me use the research-analyst agent to research compound component patterns and best practices."\n\nThe user needs research on design patterns and best practices, so the research-analyst agent should gather this information from various sources.\n\n\n\nContext: User encounters an error and needs to understand the cause\nuser: "I'm getting a 'Cannot read properties of undefined' error in my Chakra UI recipe"\nassistant: "I'll use the research-analyst agent to research this error in the context of Chakra UI recipes."\n\nDebugging requires understanding the error context, so use the research-analyst agent to find relevant documentation and solutions.\n\n +description: Use this agent when you need to gather information, find documentation, explore technical concepts, or research solutions to problems. This includes searching for library documentation, API references, best practices, code examples, or general web information. The agent will use the react-aria-docs mcp for react-aria specific documentation and research needs. The agent will use context7 for library documentation and web search for broader research needs. \n\nExamples:\n\nContext: User needs to understand how to implement a specific React Aria pattern\nuser: "How do I implement an accessible combobox with React Aria?"\nassistant: "I'll use the research-analyst agent to find the React Aria documentation for combobox implementation."\n\nSince the user needs documentation about a library feature, use the research-analyst agent to search react-aria-docs and context7 for React Aria combobox documentation.\n\n\n\nContext: User wants to understand a technical concept before implementation\nuser: "What are the best practices for implementing compound components in React?"\nassistant: "Let me use the research-analyst agent to research compound component patterns and best practices."\n\nThe user needs research on design patterns and best practices, so the research-analyst agent should gather this information from various sources.\n\n\n\nContext: User encounters an error and needs to understand the cause\nuser: "I'm getting a 'Cannot read properties of undefined' error in my Chakra UI recipe"\nassistant: "I'll use the research-analyst agent to research this error in the context of Chakra UI recipes."\n\nDebugging requires understanding the error context, so use the research-analyst agent to find relevant documentation and solutions.\n\n model: sonnet --- @@ -34,6 +34,9 @@ You will: - Use `mcp__context7__resolve-library-id` to search for specific library documentation +- Prefer `mcp__react-aria-docs__list_pages`, + `mcp__react-aria-docs__get_page_info`, and `mcp__react-aria-docs__get_page` + when searching for react-aria library documentation - Focus on official documentation for React Aria, Chakra UI, React, TypeScript, and related libraries - Look for code examples, API references, and implementation patterns diff --git a/.mcp.json b/.mcp.json index acc321c29..6bbb83b9f 100644 --- a/.mcp.json +++ b/.mcp.json @@ -15,6 +15,12 @@ "time-mcp": { "command": "npx", "args": ["-y", "time-mcp"] + }, + "react-aria-docs": { + "type": "stdio", + "command": "npx", + "args": ["@react-spectrum/mcp", "react-aria"], + "env": {} } } } diff --git a/apps/docs/package.json b/apps/docs/package.json index 224d2f671..7858e486c 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -43,6 +43,7 @@ "react-dom": "catalog:react", "react-intl": "catalog:react", "react-live": "^4.1.7", + "react-stately": "catalog:react", "react-router": "^7.12.0", "react-router-dom": "^7.11.0", "react-syntax-highlighter": "^15.6.6", @@ -52,6 +53,7 @@ "remark-mark-highlight": "^0.1.1", "slug": "^11.0.1", "to-vfile": "^8.0.0", + "use-debounce": "^10.0.0", "vite-plugin-markdown": "^2.2.0", "vite-tsconfig-paths": "^5.1.3", "zod": "^4.1.12" diff --git a/apps/docs/src/components/document-renderer/components/live-code-editor/live-code-editor.tsx b/apps/docs/src/components/document-renderer/components/live-code-editor/live-code-editor.tsx index 8a462ab08..940f5a60b 100644 --- a/apps/docs/src/components/document-renderer/components/live-code-editor/live-code-editor.tsx +++ b/apps/docs/src/components/document-renderer/components/live-code-editor/live-code-editor.tsx @@ -13,6 +13,8 @@ import { getLocalTimeZone, today, } from "@internationalized/date"; +import { useAsyncList } from "react-stately"; +import { useDebouncedCallback } from "use-debounce"; const baseHooks = { useState, @@ -33,6 +35,8 @@ const scope = { parseZonedDateTime, getLocalTimeZone, today, + useAsyncList, + useDebouncedCallback, }; const removeImportStatements = (code: string) => { diff --git a/packages/nimbus/package.json b/packages/nimbus/package.json index 742dd571d..871102996 100644 --- a/packages/nimbus/package.json +++ b/packages/nimbus/package.json @@ -59,7 +59,8 @@ "react-aria-components": "catalog:react", "react-hotkeys-hook": "^5.2.1", "react-stately": "catalog:react", - "react-use": "^17.5.1" + "react-use": "^17.5.1", + "use-debounce": "^10.0.0" }, "devDependencies": { "@chakra-ui/cli": "catalog:react", @@ -68,6 +69,7 @@ "@commercetools/nimbus-tokens": "workspace:^", "@internationalized/date": "catalog:react", "@react-aria/optimize-locales-plugin": "catalog:react", + "@react-types/shared": "catalog:tooling", "@storybook/addon-a11y": "catalog:tooling", "@storybook/addon-docs": "catalog:tooling", "@storybook/addon-vitest": "catalog:tooling", diff --git a/packages/nimbus/src/components/calendar/components/calendar.header.tsx b/packages/nimbus/src/components/calendar/components/calendar.header.tsx index 5993dc62b..89d8aacc1 100644 --- a/packages/nimbus/src/components/calendar/components/calendar.header.tsx +++ b/packages/nimbus/src/components/calendar/components/calendar.header.tsx @@ -32,7 +32,6 @@ export const CalendarHeader = () => { - {/* @ts-expect-error - custom-context will add aria-label via the "slot" prop */} { aria-hidden="true" slot={showRangeLabel ? "monthRange" : "month"} /> - {/* @ts-expect-error - custom-context will add aria-label via the "slot" prop */} { - {/* @ts-expect-error - custom-context will add aria-label via the "slot" prop */} { aria-hidden="true" slot="year" /> - {/* @ts-expect-error - custom-context will add aria-label via the "slot" prop */}