feat(react-headless-components-preview): add Combobox component and stories#36114
Open
dmytrokirpa wants to merge 3 commits into
Open
feat(react-headless-components-preview): add Combobox component and stories#36114dmytrokirpa wants to merge 3 commits into
dmytrokirpa wants to merge 3 commits into
Conversation
|
Pull request demo site: URL |
edf6790 to
1dab2d3
Compare
…tories Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tories Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4547588 to
2e230cf
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new headless Combobox surface to @fluentui/react-headless-components-preview, including Storybook stories, unit tests, Cypress coverage, and a new ./combobox subpath export. It also reuses the headless Dropdown’s Listbox/Option/OptionGroup implementations via re-exports to keep behavior consistent across headless selection components.
Changes:
- Added headless
Comboboximplementation (state, render, context values) plus Jest + Cypress tests. - Added Storybook stories and styling for common scenarios (default, controlled, freeform, grouped, multiselect, disabled, controlled open).
- Wired
./comboboxexport + API report, and registered Combobox in the bundle-size fixture.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-components/react-headless-components-preview/stories/src/Dropdown/DropdownBestPractices.md | Adds placeholder Best Practices doc for Dropdown stories/docs. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/index.stories.tsx | Registers Combobox Storybook entry and story exports. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxMultiselect.stories.tsx | Adds multiselect Combobox story. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxGrouped.stories.tsx | Adds grouped options Combobox story. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxFreeform.stories.tsx | Adds freeform input Combobox story. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxDisabled.stories.tsx | Adds disabled Combobox story. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxDescription.md | Adds component-level Storybook description text. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxDefault.stories.tsx | Adds default Combobox story with clear + expand icons. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxControllingOpenAndClose.stories.tsx | Adds controlled open/close story for Combobox. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/ComboboxControlled.stories.tsx | Adds fully controlled selection/value story. |
| packages/react-components/react-headless-components-preview/stories/src/Combobox/combobox.module.css | Adds story styling for the headless Combobox examples. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/useComboboxContextValues.ts | Adapts useComboboxContextValues from @fluentui/react-combobox for headless state typing. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/useCombobox.ts | Implements headless Combobox state using shared popup/listbox plumbing. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/renderCombobox.tsx | Adds default renderer for headless Combobox + providers. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/index.ts | Exposes Combobox API and re-exports Dropdown Listbox/Option/OptionGroup. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/Combobox.types.ts | Defines headless Combobox public types and data attributes. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/Combobox.tsx | Adds headless Combobox component entrypoint. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/Combobox.test.tsx | Adds Jest conformance + basic behavior assertions. |
| packages/react-components/react-headless-components-preview/library/src/components/Combobox/Combobox.cy.tsx | Adds Cypress coverage for key interactions and variants. |
| packages/react-components/react-headless-components-preview/library/src/combobox.ts | Adds ./combobox subpath entry re-exporting the Combobox surface. |
| packages/react-components/react-headless-components-preview/library/package.json | Adds exports["./combobox"] mapping. |
| packages/react-components/react-headless-components-preview/library/etc/combobox.api.md | Adds API Extractor report for ./combobox. |
| packages/react-components/react-headless-components-preview/library/bundle-size/AllComponents.fixture.js | Registers combobox export in bundle-size fixture. |
| change/@fluentui-react-headless-components-preview-0ee0a685-d92f-4953-a5bd-8813ad8abc16.json | Adds Beachball change entry for the new Combobox export. |
| }, | ||
| listbox: open || hasFocus ? listbox : undefined, | ||
| clearIcon: slot.optional(mergedProps.clearIcon, { | ||
| defaultProps: { 'aria-hidden': 'true' }, |
| id="combobox" | ||
| placeholder="Select an animal" | ||
| clearable | ||
| clearIcon={{ id: 'clear-icon', children: 'X', 'aria-label': 'Clear selection' }} |
Comment on lines
+34
to
+42
| > | ||
| {options.map(option => ( | ||
| <Option | ||
| className={styles.option} | ||
| key={option} | ||
| checkIcon={{ className: styles.checkIcon, children: <CheckmarkRegular /> }} | ||
| disabled={option === 'Ferret'} | ||
| > | ||
| {option} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@fluentui/react-headless-components-preview../comboboxsubpath export and registers the package in the bundle-size fixture.Listbox,Option, andOptionGroupwith the headless Dropdown by re-exporting from../Dropdown/....