Skip to content

Commit ae02b91

Browse files
authored
[all-components] Rename loop to loopFocus (#3186)
1 parent f432162 commit ae02b91

File tree

30 files changed

+130
-130
lines changed

30 files changed

+130
-130
lines changed

docs/reference/generated/accordion-root.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
"description": "Allows the browser’s built-in page search to find and expand the panel contents.\n\nOverrides the `keepMounted` prop and uses `hidden=\"until-found\"`\nto hide the element without removing it from the DOM.",
2424
"detailedType": "boolean | undefined"
2525
},
26+
"loopFocus": {
27+
"type": "boolean",
28+
"default": "true",
29+
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
30+
"detailedType": "boolean | undefined"
31+
},
2632
"multiple": {
2733
"type": "boolean",
2834
"default": "true",
@@ -35,12 +41,6 @@
3541
"description": "Whether the component should ignore user interaction.",
3642
"detailedType": "boolean | undefined"
3743
},
38-
"loop": {
39-
"type": "boolean",
40-
"default": "true",
41-
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
42-
"detailedType": "boolean | undefined"
43-
},
4444
"orientation": {
4545
"type": "Orientation",
4646
"default": "'vertical'",

docs/reference/generated/context-menu-root.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
"description": "When in a submenu, determines whether pressing the Escape key\ncloses the entire menu, or only the current child menu.",
3030
"detailedType": "boolean | undefined"
3131
},
32+
"loopFocus": {
33+
"type": "boolean",
34+
"default": "true",
35+
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
36+
"detailedType": "boolean | undefined"
37+
},
3238
"onOpenChangeComplete": {
3339
"type": "((open: boolean) => void)",
3440
"description": "Event handler called after any animations complete when the menu is closed.",
@@ -40,12 +46,6 @@
4046
"description": "Whether the component should ignore user interaction.",
4147
"detailedType": "boolean | undefined"
4248
},
43-
"loop": {
44-
"type": "boolean",
45-
"default": "true",
46-
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
47-
"detailedType": "boolean | undefined"
48-
},
4949
"orientation": {
5050
"type": "Menu.Root.Orientation",
5151
"default": "'vertical'",

docs/reference/generated/menu-root.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
"description": "When in a submenu, determines whether pressing the Escape key\ncloses the entire menu, or only the current child menu.",
3030
"detailedType": "boolean | undefined"
3131
},
32+
"loopFocus": {
33+
"type": "boolean",
34+
"default": "true",
35+
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
36+
"detailedType": "boolean | undefined"
37+
},
3238
"modal": {
3339
"type": "boolean",
3440
"default": "true",
@@ -63,12 +69,6 @@
6369
"description": "How long to wait before closing the menu that was opened on hover.\nSpecified in milliseconds.\n\nRequires the `openOnHover` prop.",
6470
"detailedType": "number | undefined"
6571
},
66-
"loop": {
67-
"type": "boolean",
68-
"default": "true",
69-
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
70-
"detailedType": "boolean | undefined"
71-
},
7272
"orientation": {
7373
"type": "Menu.Root.Orientation",
7474
"default": "'vertical'",

docs/reference/generated/menu-submenu-root.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
"description": "When in a submenu, determines whether pressing the Escape key\ncloses the entire menu, or only the current child menu.",
3030
"detailedType": "boolean | undefined"
3131
},
32+
"loopFocus": {
33+
"type": "boolean",
34+
"default": "true",
35+
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
36+
"detailedType": "boolean | undefined"
37+
},
3238
"onOpenChangeComplete": {
3339
"type": "((open: boolean) => void)",
3440
"description": "Event handler called after any animations complete when the menu is closed.",
@@ -58,12 +64,6 @@
5864
"description": "How long to wait before closing the menu that was opened on hover.\nSpecified in milliseconds.\n\nRequires the `openOnHover` prop.",
5965
"detailedType": "number | undefined"
6066
},
61-
"loop": {
62-
"type": "boolean",
63-
"default": "true",
64-
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
65-
"detailedType": "boolean | undefined"
66-
},
6767
"orientation": {
6868
"type": "Menu.Root.Orientation",
6969
"default": "'vertical'",

docs/reference/generated/menubar.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
"name": "Menubar",
33
"description": "The container for menus.",
44
"props": {
5+
"loopFocus": {
6+
"type": "boolean",
7+
"default": "true",
8+
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
9+
"detailedType": "boolean | undefined"
10+
},
511
"modal": {
612
"type": "boolean",
713
"default": "true",
@@ -14,12 +20,6 @@
1420
"description": "Whether the whole menubar is disabled.",
1521
"detailedType": "boolean | undefined"
1622
},
17-
"loop": {
18-
"type": "boolean",
19-
"default": "true",
20-
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
21-
"detailedType": "boolean | undefined"
22-
},
2323
"orientation": {
2424
"type": "Menu.Root.Orientation",
2525
"default": "'horizontal'",

docs/reference/generated/tabs-list.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"description": "Whether to automatically change the active tab on arrow key focus.\nOtherwise, tabs will be activated using Enter or Spacebar key press.",
99
"detailedType": "boolean | undefined"
1010
},
11-
"loop": {
11+
"loopFocus": {
1212
"type": "boolean",
1313
"default": "true",
1414
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",

docs/reference/generated/toggle-group.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"description": "Callback fired when the pressed states of the toggle group changes.",
1818
"detailedType": "| ((\n groupValue: any[],\n eventDetails: Toggle.Group.ChangeEventDetails,\n ) => void)\n| undefined"
1919
},
20+
"loopFocus": {
21+
"type": "boolean",
22+
"default": "true",
23+
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
24+
"detailedType": "boolean | undefined"
25+
},
2026
"multiple": {
2127
"type": "boolean",
2228
"default": "false",
@@ -29,12 +35,6 @@
2935
"description": "Whether the toggle group should ignore user interaction.",
3036
"detailedType": "boolean | undefined"
3137
},
32-
"loop": {
33-
"type": "boolean",
34-
"default": "true",
35-
"description": "Whether to loop keyboard focus back to the first item\nwhen the end of the list is reached while using the arrow keys.",
36-
"detailedType": "boolean | undefined"
37-
},
3838
"orientation": {
3939
"type": "Orientation",
4040
"default": "'horizontal'",

docs/reference/generated/toolbar-root.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "ToolbarRoot",
33
"description": "A container for grouping a set of controls, such as buttons, toggle groups, or menus.\nRenders a `<div>` element.",
44
"props": {
5-
"disabled": {
5+
"loopFocus": {
66
"type": "boolean",
7+
"default": "true",
8+
"description": "If `true`, using keyboard navigation will wrap focus to the other end of the toolbar once the end is reached.",
79
"detailedType": "boolean | undefined"
810
},
9-
"loop": {
11+
"disabled": {
1012
"type": "boolean",
11-
"default": "true",
12-
"description": "If `true`, using keyboard navigation will wrap focus to the other end of the toolbar once the end is reached.",
1313
"detailedType": "boolean | undefined"
1414
},
1515
"orientation": {

docs/scripts/generateLlmTxt/__snapshots__/mdxToMarkdown.test.mjs.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,9 +494,9 @@ Renders a \`<div>\` element.
494494
| value | \`any[]\` | - | The controlled value of the item(s) that should be expanded.To render an uncontrolled accordion, use the \`defaultValue\` prop instead. |
495495
| onValueChange | \`((value: any[], eventDetails: Accordion.Root.ChangeEventDetails) => void)\` | - | Event handler called when an accordion item is expanded or collapsed.&#xA;Provides the new value as an argument. |
496496
| hiddenUntilFound | \`boolean\` | \`false\` | Allows the browser’s built-in page search to find and expand the panel contents.Overrides the \`keepMounted\` prop and uses \`hidden="until-found"\`&#xA;to hide the element without removing it from the DOM. |
497+
| loopFocus | \`boolean\` | \`true\` | Whether to loop keyboard focus back to the first item&#xA;when the end of the list is reached while using the arrow keys. |
497498
| multiple | \`boolean\` | \`true\` | Whether multiple items can be open at the same time. |
498499
| disabled | \`boolean\` | \`false\` | Whether the component should ignore user interaction. |
499-
| loop | \`boolean\` | \`true\` | Whether to loop keyboard focus back to the first item&#xA;when the end of the list is reached while using the arrow keys. |
500500
| orientation | \`Orientation\` | \`'vertical'\` | The visual orientation of the accordion.&#xA;Controls whether roving focus uses left/right or up/down arrow keys. |
501501
| className | \`string \\| ((state: Accordion.Root.State) => string \\| undefined)\` | - | CSS class applied to the element, or a function that&#xA;returns a class based on the component’s state. |
502502
| style | \`CSSProperties \\| ((state: Accordion.Root.State) => CSSProperties \\| undefined)\` | - | - |

docs/src/app/(private)/experiments/menubar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import classes from './menubar.module.css';
1212

1313
interface Settings {
1414
modal: boolean;
15-
loop: boolean;
15+
loopFocus: boolean;
1616
orientation: 'horizontal' | 'vertical';
1717
}
1818

@@ -32,7 +32,7 @@ export default function MenubarExperiment() {
3232
<h1>Menubar</h1>
3333
<Menubar
3434
className={classes.Root}
35-
loop={settings.loop}
35+
loopFocus={settings.loopFocus}
3636
orientation={settings.orientation}
3737
modal={settings.modal}
3838
>
@@ -188,9 +188,9 @@ export default function MenubarExperiment() {
188188
}
189189

190190
export const settingsMetadata: SettingsMetadata<Settings> = {
191-
loop: {
191+
loopFocus: {
192192
type: 'boolean',
193-
label: 'Loop',
193+
label: 'Focus loop',
194194
default: true,
195195
},
196196
modal: {

0 commit comments

Comments
 (0)