Repository navigation
feat(DropdownMenuRadioGroup): title — a radio set with its own heading is one named group #7541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
3ad4e2a
0add099
7f842b6
cd79fa4
43989aa
8e83453
7fb6b84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@astryxdesign/cli': patch | ||
| --- | ||
|
|
||
| [docs] The "DropdownMenuGroup — Selectable rows" block titles its radio set with the set's own `title` instead of wrapping it in a `DropdownMenuGroup`, so the menu exposes one group named "Model" rather than two nested groups with the same name. | ||
|
|
||
| @vjeux |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `DropdownMenuRadioGroup` (also exported as `ContextMenuRadioGroup`) takes a `title`: a visible heading above its radios, drawn like a `DropdownMenuGroup` heading, that names the group. With a title, `label` is optional, and the title names the group so the name always holds the visible heading: a caller's `aria-labelledby` is read after it, and `label` or a caller's `aria-label` is ignored, with a development warning when it differs from the title's text. A `title` that renders no text counts as no title. Give a menu section that holds one radio set this title instead of wrapping the set in a `DropdownMenuGroup`: the menu then exposes one group named by its heading rather than two nested groups with the same name. Without `title` nothing changes. | ||
|
|
||
| @vjeux |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,8 +99,13 @@ export const docs = { | |
| name: 'label', | ||
| type: 'string', | ||
| description: | ||
| 'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required even when aria-labelledby (via base props) points to visible text; that visible reference becomes the computed name while label remains the fallback.', | ||
| required: true, | ||
| 'Accessible name for the group, applied as aria-label so screen readers announce the radios as a named set, e.g. "Sort by". Required unless title is given. An aria-labelledby passed through base props that points at visible text becomes the computed name, while label remains the fallback. With a title, the title names the group instead, so the name holds the visible heading; label (or an aria-label passed through base props) is then ignored, with a development warning when it differs from the text of the title. Without a title, an aria-label passed through base props names the group when label is omitted.', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This description now makes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now says There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now says There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This now says |
||
| }, | ||
| { | ||
| name: 'title', | ||
| type: 'ReactNode', | ||
| description: | ||
| 'A visible heading above the radios, with the same treatment as a DropdownMenuGroup heading, that names the group through aria-labelledby; an aria-labelledby passed through base props is read after it. With a title, label is optional. A title that renders no text (true, an empty fragment, a component that returns null) counts as no title: no heading shows and the group is named as without one. Give a menu section that holds one radio set this title instead of wrapping the set in a DropdownMenuGroup, so the set is one group with one name rather than two nested groups with the same name.', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not blocking: |
||
| }, | ||
| { | ||
| name: 'hasCloseOnSelect', | ||
|
|
@@ -132,7 +137,9 @@ export const docsZh = { | |
| value: '组中当前选中的值。尚无选中项时传 undefined。', | ||
| onChange: '所选值变化时触发的回调。', | ||
| label: | ||
| '组的无障碍名称,作为 aria-label 应用。即使 aria-labelledby(通过基础属性)指向可见文本,label 仍然必需并作为后备名称。', | ||
| '组的无障碍名称,作为 aria-label 应用,以便屏幕阅读器将单选项作为命名集合朗读,例如“Sort by”。未提供 title 时必需。通过基础属性传入、指向可见文本的 aria-labelledby 会成为计算出的名称,label 作为后备名称。提供 title 时改由 title 命名该组,使名称始终包含可见标题;此时 label(或通过基础属性传入的 aria-label)会被忽略,若其与 title 的文本不同,开发环境会发出警告。未提供 title 且省略 label 时,通过基础属性传入的 aria-label 为该组命名。', | ||
| title: | ||
| '显示在单选项上方的可见标题,样式与 DropdownMenuGroup 的标题相同,并通过 aria-labelledby 为该组命名;通过基础属性传入的 aria-labelledby 会接在其后。提供 title 时 label 可省略。不渲染任何文本的 title(true、空 Fragment、返回 null 的组件)视为未提供:不显示标题,组按未提供 title 时的方式命名。菜单中只包含一组单选项的分区应使用此标题,而不是用 DropdownMenuGroup 包裹该组,这样该组只是一个具有一个名称的组。', | ||
| hasCloseOnSelect: '选择某值是否关闭菜单。默认关闭。', | ||
| ref: '转发到 role="group" 根元素的 ref。', | ||
| children: '组成该组的 DropdownMenuRadioItem。', | ||
|
|
@@ -147,7 +154,10 @@ export const docsDense = { | |
| propDescriptions: { | ||
| value: 'selected value (undefined = none)', | ||
| onChange: 'fired when selected value changes', | ||
| label: 'accessible group name (applied as aria-label); required', | ||
| label: | ||
| 'accessible group name (applied as aria-label); required unless title is given', | ||
| title: | ||
| 'visible heading (DropdownMenuGroup treatment) that names the group via aria-labelledby; use it instead of a DropdownMenuGroup around one radio set', | ||
| hasCloseOnSelect: 'close menu on select (default true)', | ||
| ref: 'forwarded to the role="group" root', | ||
| children: 'the DropdownMenuRadioItems', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wording ("radio set", twice) makes
astryx search "icon set"match this template too: 367 matches instead of 366, with this template the only new result.packages/cli/test/__golden__/no-icon-set/search-icon-set.jsonstill records 366, soexperimental-isolation.test.mjsfails its two "search icon set" cases (CItest-node (1/4)). Runningvitest run packages/cli/test/experimental-isolation.test.mjs --updateon the branch and committing the golden, after checking its diff changes only the count, fixes it.