feat: add MultiSelect composition#677
Draft
isaquebock wants to merge 1 commit into
Draft
Conversation
New `inputs/multi-select` composition aligned with Figma `3899:29362`: - root `MultiSelect` plus four sub-components — `MultiSelectTrigger`, `MultiSelectContent`, `MultiSelectGroup`, `MultiSelectOption` - multi-only API: no `multiple` prop, `modelValue: unknown[]` defaulting to `[]`, `displayValue: (value: unknown[]) => string` - option indicator is the existing `Checkbox` component (decorative, `aria-hidden`, `tabindex=-1`); semantics live on `role=option` + `aria-selected` - panel is `role=listbox` with `aria-multiselectable=true`; Enter / Space toggles without closing, Escape and Tab close - popover rendered via native primitives only — `<Teleport>` to body plus `getBoundingClientRect` + fixed positioning + `popup-scale-in/out` semantic animations (no `floating-ui` runtime) - `#search` and `#footer` slots on `<MultiSelectContent>` are optional and ungated by props - styling sits inline on each root `class` with `data-*` variants, in line with `.claude/rules/styling.md` - Storybook: Default, Sizes, WithGroups, WithSearchAndFooter, WithOptionExtras, LongList, Filled, Invalid, Disabled — every story binds `args` so controls drive the component - five new webkit exports: `./multi-select`, `./multi-select-trigger`, `./multi-select-content`, `./multi-select-group`, `./multi-select-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
inputs/multi-selectcomposition aligned with Figma3899:29362(options panel) and reusing the InputText / Select trigger visuals.MultiSelectplus four sub-components:MultiSelectTrigger,MultiSelectContent,MultiSelectGroup,MultiSelectOption.multipleprop,modelValue: unknown[]defaulting to[],displayValue: (value: unknown[]) => string. The option indicator is the existing webkitCheckbox; semantics ride onrole="option"+aria-selected. Content isrole="listbox"witharia-multiselectable="true".Enter/Spacetoggle without closing the panel;EscapeandTabclose it.<Teleport>to body plusgetBoundingClientRect+ fixed positioning + thepopup-scale-in/outsemantic animations. No@floating-uiruntime.#searchand#footerslots on<MultiSelectContent>are optional and ungated by props (presence drives rendering).classwithdata-*variants, per.claude/rules/styling.md.Default,Sizes,WithGroups,WithSearchAndFooter,WithOptionExtras,LongList,Filled,Invalid,Disabled— every story bindsargsso controls drive the component../multi-select,./multi-select-trigger,./multi-select-content,./multi-select-group,./multi-select-option.Pending follow-ups (tracked, not in this PR)
var(--bg-surface-raised)is used onMultiSelectContentmatching the existingSelectContentprecedent but is not yet catalogued in.claude/docs/DESIGN.md. Decide whether to catalog the token or migrate both panels tovar(--bg-surface)+var(--shadow-xs).multi-select.figma.tsyet — theselectfamily has no Code Connect precedent. Adopt Code Connect forSelectfirst, then mirror.Test plan
pnpm webkit:lint && pnpm webkit:type-check && pnpm webkit:type-coveragepnpm --filter storybook buildSpace/Enter/ArrowDown, navigate withArrow*/Home/End, toggle withEnter/Spacewithout closing, close withEscape.<div role="listbox" aria-multiselectable="true">; selected option hasaria-selected="true"and an internal<Checkbox aria-hidden="true">.