MultiSelect expose menuItemVariant='checkmark' and default to it (WEB-1201)
Version: 0.7.0 · Type: ✨ Feature
Problem
SearchableOptionItem already implements three menu-item styles — 'checkmark' | 'checkmark-right' | 'checkbox' — where 'checkmark' renders the check on the left (and moves to the right when the item has a leading icon). But MultiSelect.menuItemVariant narrowed the union via Extract to 'checkmark-right' | 'checkbox', which excluded 'checkmark' from the public API. As a result, multi-select could not show a left-aligned checkmark on items. Per the design conclusion, checkmark / checkbox are left-aligned by default, yet MultiSelect defaulted to the right-aligned checkmark-right.
Changed Files
packages/design/src/components/Select/MultiSelect.tsxpackages/design/src/components/Select/SelectDesignSpec.mdpackages/design/src/components/Select/__tests__/MultiSelect.test.tsx
Changes
- Widen the
Extractunion ofMultiSelect.menuItemVariantfrom'checkmark-right' | 'checkbox'to'checkmark' | 'checkmark-right' | 'checkbox', and document the indicator position of each value in JSDoc. No rendering change —MultiSelectalready forwardsmenuItemVariantstraight toSearchableOptionItem'svariant. - Change the default
menuItemVariantfrom'checkmark-right'to'checkmark'(left-aligned check), matching the design default. Behavior change: callers that relied on the implicit right-aligned checkmark must now passmenuItemVariant="checkmark-right"explicitly (no usage in this repo, so no regression). - Sync the prop value list and default in
SelectDesignSpec.md. - Add unit tests: the default (
checkmark) shows the check on the left without an icon, leaves the left slot empty when unselected, and moves the check to the right when a leadingiconis present. - Rework the "Menu Item Variants" section in
select.mdxinto a variant × icon matrix, and update the Props table type and default (see design-site docs).