Skip to content

[DS 2.0] Mark the current choice in Menu and move selected list entries to ui/bg/selected - #139

Open
librowski wants to merge 1 commit into
ds2-tokens-refreshfrom
ds2-menu-item-selected
Open

librowski wants to merge 1 commit into
ds2-tokens-refreshfrom
ds2-menu-item-selected

Conversation

@librowski

Copy link
Copy Markdown
Collaborator

Change

Design answer to the "selected in lists" questions (DR-029/030/036): a new ui/bg/selected role (brand fill subtle, same in both themes) with selected-hover, menu items with Selected / Selected+Hover states, selects sharing the same item styling. The role landed in the 14.09 export (#138, this PR's base).

  • list-item.module.css (shared by MenuItem and SelectOption): selected background → ui/bg/selected, hovered or highlighted selected → ui/bg/selected-hover, text → ui/text/default instead of on-accent white. The dark-theme override of the old solid acc1-500 fill goes away, the token carries the theme. New public property --wb-public-list-item-background-color-selected-hover.
  • Menu: items accept selected. When any item defines it, the popup renders a Base UI RadioGroup and the items become RadioItems (menuitemradio, aria-checked, data-checked, closeOnClick). Menus without a selection are unchanged.
  • Select options already expose data-selected, so they pick up the new colors without code changes; SelectOption stays because both components already share one stylesheet.
  • SDK: the language menu marks the current language.
  • Docs: Menu page describes selected with an example; the props table picks up the JSDoc.

Verification

ui typecheck, eslint, stylelint, menu.spec.tsx (radio group, aria-checked, data-checked), build with check:built-css; sdk typecheck and language selector spec (3 tests); docs typecheck. Changesets: ui minor, sdk patch.

@librowski
librowski added this pull request to stack #143 September 14, 2026 10:59
@librowski
librowski marked this pull request as ready for review September 14, 2026 13:15
@librowski
librowski force-pushed the ds2-menu-item-selected branch from 51412dd to 294fd7f Compare September 14, 2026 19:54
Comment thread packages/ui/src/components/menu/menu.tsx
Comment thread packages/ui/src/components/menu/menu.spec.tsx
A menu whose items define selected renders them as a Base UI radio group,
so the current entry carries menuitemradio and aria-checked. Selected list
entries (menu radio items and Select options) move from the solid accent
fill to the ui/bg/selected role with default text and a selected-hover
state. The language menu marks the current language.
@librowski
librowski force-pushed the ds2-menu-item-selected branch from 294fd7f to 7e8c791 Compare September 15, 2026 08:54
@librowski
librowski removed this pull request from stack #143 September 15, 2026 09:00
@librowski
librowski added this pull request to stack #151 September 15, 2026 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants