@astryxdesign/core 0.7.2-canary.55d8dff → 0.7.2-canary.577a62e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +8 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +4 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +1 -0
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +6 -2
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +2 -103
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts +6 -4
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.js +4 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/menuRegionStops.d.ts +38 -0
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRegionStops.js +131 -0
- package/dist/FormLayout/FormLayout.d.ts +5 -4
- package/dist/FormLayout/FormLayout.d.ts.map +1 -1
- package/dist/FormLayout/FormLayout.js +1 -1
- package/dist/FormLayout/FormLayoutContext.d.ts +3 -3
- package/dist/FormLayout/FormLayoutContext.js +3 -3
- package/dist/Grid/Grid.d.ts +8 -7
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -4
- package/dist/Grid/GridSpan.d.ts +1 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +8 -2
- package/dist/Markdown/plugins/headingLinks.d.ts.map +1 -1
- package/dist/Markdown/plugins/headingLinks.js +9 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +5 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +45 -11
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +6 -2
- package/dist/Token/Token.js +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +2 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +2 -0
- package/dist/astryx.css +1 -1
- package/dist/reset.a11y.chromium.spec.js +50 -1
- package/docs.mjs +4 -4
- package/package.json +3 -3
- package/scripts/agent-doc-state.mjs +29 -7
- package/scripts/postinstall.mjs +43 -2
- package/src/Avatar/Avatar.tsx +11 -2
- package/src/AvatarGroup/AvatarGroupOverflow.test.tsx +24 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -0
- package/src/Chat/ChatLayoutScrollButton.test.tsx +13 -0
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +64 -19
- package/src/CheckboxList/CheckboxList.fr10.test.tsx +29 -2
- package/src/CheckboxList/CheckboxList.tsx +4 -1
- package/src/ContextMenu/ContextMenu.test.tsx +12 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +3 -4
- package/src/DropdownMenu/DropdownMenu.tsx +7 -134
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +169 -10
- package/src/DropdownMenu/DropdownMenuGroup.tsx +6 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +334 -0
- package/src/DropdownMenu/menuRegionStops.ts +167 -0
- package/src/Field/FieldLabel.doc.mjs +133 -26
- package/src/Field/FieldLabel.spec.md +172 -0
- package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +296 -0
- package/src/FormLayout/FormLayout.doc.mjs +6 -3
- package/src/FormLayout/FormLayout.spec.md +192 -0
- package/src/FormLayout/FormLayout.test.tsx +15 -0
- package/src/FormLayout/FormLayout.tsx +7 -6
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Grid/Grid.doc.mjs +7 -1
- package/src/Grid/Grid.spec.md +93 -113
- package/src/Grid/Grid.test.tsx +22 -0
- package/src/Grid/Grid.tsx +10 -9
- package/src/Grid/GridSpan.doc.mjs +3 -3
- package/src/Grid/GridSpan.tsx +1 -1
- package/src/Indicator/Indicator.doc.mjs +3 -3
- package/src/Markdown/parser.ts +8 -2
- package/src/Markdown/plugins/headingLinks.ts +9 -1
- package/src/PowerSearch/PowerSearch.test.tsx +62 -0
- package/src/PowerSearch/PowerSearch.tsx +9 -0
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +71 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +45 -0
- package/src/Resizable/useResizable.doc.mjs +0 -1
- package/src/SideNav/SideNav.spec.md +227 -0
- package/src/SideNav/SideNav.test.tsx +41 -0
- package/src/SideNav/SideNavItem.tsx +5 -2
- package/src/Table/Table.spec.md +6 -1
- package/src/Table/plugins/activation/useTableActivation.spec.md +254 -0
- package/src/Token/Token.tsx +1 -1
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +86 -0
- package/src/Toolbar/Toolbar.test.tsx +0 -8
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +163 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.renders.tsx +63 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.states.ts +142 -0
- package/src/Toolbar/__tests__/Toolbar.a11y.test.tsx +126 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +25 -0
- package/src/TopNav/TopNavMegaMenu.tsx +2 -0
- package/src/TopNav/TopNavMenu.test.tsx +27 -1
- package/src/TopNav/TopNavMenu.tsx +2 -0
- package/src/postinstall.test.mjs +33 -0
- package/src/reset.a11y.chromium.spec.ts +52 -1
- package/src/reset.css +9 -0
- package/src/reset.test.ts +11 -0
- package/src/unicodePropertyEscapes.source-build.test.mjs +69 -0
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@ Core UI components, theme system, and utilities for the Astryx design system. Fo
|
|
|
6
6
|
>
|
|
7
7
|
> ```bash
|
|
8
8
|
> npm install -D @astryxdesign/cli # or: pnpm add -D / yarn add -D / bun add -d
|
|
9
|
-
> npx
|
|
9
|
+
> npx @astryxdesign/cli init # the CLI you just installed
|
|
10
10
|
> ```
|
|
11
11
|
>
|
|
12
|
-
> `init` writes the Astryx component index into your `AGENTS.md`/`CLAUDE.md` so your agent discovers components, templates, and design tokens instead of guessing. Need a single command without installing?
|
|
12
|
+
> `init` writes the Astryx component index into your `AGENTS.md`/`CLAUDE.md` so your agent discovers components, templates, and design tokens instead of guessing. Need a single command without installing? The same scoped command works: `npx @astryxdesign/cli <cmd>`. Always use the scoped name: the unscoped `astryx` resolves to an unrelated npm package until `@astryxdesign/cli` is a dependency. See [XDS CLI](#xds-cli).
|
|
13
13
|
|
|
14
14
|
## Component Docs
|
|
15
15
|
|
|
@@ -21,7 +21,7 @@ npx @astryxdesign/cli component Button # full docs for a component
|
|
|
21
21
|
npx @astryxdesign/cli component --list # list all components
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
> Use the scoped `@astryxdesign/cli
|
|
24
|
+
> Use the scoped `@astryxdesign/cli`: it runs with or without installing, while the unscoped `astryx` resolves to an unrelated npm package until the CLI is a dependency.
|
|
25
25
|
|
|
26
26
|
## Page Layouts
|
|
27
27
|
|
|
@@ -57,7 +57,7 @@ astryx discover # discover external Astryx packages
|
|
|
57
57
|
astryx gap-report # report a missing capability
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
>
|
|
60
|
+
> Run these as `npx @astryxdesign/cli …`, or `pnpm exec astryx …` (or your package manager's equivalent) once the CLI is installed.
|
|
61
61
|
|
|
62
62
|
## Related Packages
|
|
63
63
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAqB3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AA4BrD;;;;;;GAMG;AACH,KAAK,eAAe,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEzD;;GAEG;AACH,KAAK,iBAAiB,GACpB,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAgBpD;AASD,eAAO,MAAM,WAAW;;;;;;;;;;EAUtB,CAAC;AA8IH,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5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AAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAChD;AAsJD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,WAAW,EACX,IAAI,EACJ,IAAW,EACX,KAAgB,EAChB,GAAG,EACH,MAAM,EACN,OAAc,EACd,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAyVb;yBA7We,MAAM"}
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -232,8 +232,15 @@ const groupDynamicStyles = {
|
|
|
232
232
|
/**
|
|
233
233
|
* A character that can stand for a word in initials: a letter, a digit, or an
|
|
234
234
|
* emoji. Punctuation and other symbols, such as `(`, `"` or `-`, cannot.
|
|
235
|
+
*
|
|
236
|
+
* Built at runtime, not written as a literal: for targets without property
|
|
237
|
+
* escapes, or when no browserslist is set, Babel's
|
|
238
|
+
* transform-unicode-property-regex rewrites a `\p{…}` literal, and the copy
|
|
239
|
+
* bundled with Next.js lacks the Unicode data it needs, so a source build fails
|
|
240
|
+
* with "Unknown property". A literal is safe once Next's bundled Babel ships
|
|
241
|
+
* that data.
|
|
235
242
|
*/
|
|
236
|
-
const INITIAL_CHARACTER =
|
|
243
|
+
const INITIAL_CHARACTER = new RegExp('[\\p{L}\\p{N}\\p{Extended_Pictographic}\\p{Regional_Indicator}]', 'u');
|
|
237
244
|
|
|
238
245
|
/**
|
|
239
246
|
* The first character of a word that can stand for it in initials, skipping
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA8ED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AA8ED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG,SAAS,CAuEtC;yBAhFe,mBAAmB"}
|
|
@@ -142,7 +142,10 @@ export function AvatarGroupOverflow({
|
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
144
|
return /*#__PURE__*/_jsx("span", {
|
|
145
|
-
ref: ref
|
|
145
|
+
ref: ref
|
|
146
|
+
// Before the caller's props so a caller-supplied role still wins.
|
|
147
|
+
,
|
|
148
|
+
role: "img",
|
|
146
149
|
...rest,
|
|
147
150
|
"aria-label": label,
|
|
148
151
|
...mergeProps(themeProps('avatar-group-overflow', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatLayoutScrollButton.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatLayoutScrollButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAS5C,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CACvD,SAAS,CAAC,cAAc,CAAC,EACzB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,qCAAqC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;
|
|
1
|
+
{"version":3,"file":"ChatLayoutScrollButton.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatLayoutScrollButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAS5C,MAAM,WAAW,2BAA4B,SAAQ,IAAI,CACvD,SAAS,CAAC,cAAc,CAAC,EACzB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,qCAAqC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qBAAqB;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAuED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,GAAG,EACH,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,2BAA2B,qBAwC7B;yBAjDe,sBAAsB"}
|
|
@@ -89,6 +89,7 @@ export function ChatLayoutScrollButton({
|
|
|
89
89
|
...mergeProps(stylex.props(styles.wrapper, xstyle), className, style),
|
|
90
90
|
...rest,
|
|
91
91
|
children: /*#__PURE__*/_jsx("div", {
|
|
92
|
+
inert: !isVisible,
|
|
92
93
|
...mergeProps(themeProps('chat-layout-scroll-button'), {
|
|
93
94
|
0: {
|
|
94
95
|
className: "xawy1a7 xb3r6kr xjspbzw x1prclbq x14hfi27 x1ueg155 xrgg2z9 xlr8y92 x2rcmwa x12w9bfk xg01cxk x47corl xlshs6z x1jys5uj"
|
|
@@ -115,7 +115,7 @@ export interface CheckboxListProps extends Omit<FieldInputBaseProps<HTMLDivEleme
|
|
|
115
115
|
* </CheckboxList>
|
|
116
116
|
* ```
|
|
117
117
|
*/
|
|
118
|
-
export declare function CheckboxList({ label, isLabelHidden, description, status, value, onChange, changeAction, density, hasDividers, isDisabled, disabledMessage, isReadOnly, children, ref, width, containerXstyle, containerClassName, containerStyle, controlXstyle, controlClassName, controlStyle, 'aria-describedby': ariaDescribedByProp, ...restProps }: CheckboxListProps): import("react").JSX.Element;
|
|
118
|
+
export declare function CheckboxList({ label, isLabelHidden, description, status, value, onChange, changeAction, density, hasDividers, isDisabled, disabledMessage, isReadOnly, children, ref, width, containerXstyle, containerClassName, containerStyle, controlXstyle, controlClassName, controlStyle, 'aria-labelledby': ariaLabelledByProp, 'aria-describedby': ariaDescribedByProp, ...restProps }: CheckboxListProps): import("react").JSX.Element;
|
|
119
119
|
export declare namespace CheckboxList {
|
|
120
120
|
var displayName: string;
|
|
121
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxList.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"CheckboxList.d.ts","sourceRoot":"","sources":["../../src/CheckboxList/CheckboxList.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAarD,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAC7C,mBAAmB,CAAC,cAAc,CA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,kBAAkB,EACrC,kBAAkB,EAAE,mBAAmB,EACvC,GAAG,SAAS,EACb,EAAE,iBAAiB,+BA2InB;yBApKe,YAAY"}
|
|
@@ -24,6 +24,7 @@ import { useTooltip } from "../Tooltip/index.js";
|
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
25
|
import { mergeProps } from "../utils/index.js";
|
|
26
26
|
import { themeProps } from "../utils/themeProps.js";
|
|
27
|
+
import { joinAriaIDs } from "../utils/inputAria.js";
|
|
27
28
|
import { CheckboxListContext } from "./CheckboxListContext.js";
|
|
28
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
30
|
const EMPTY_ARRAY = [];
|
|
@@ -67,6 +68,7 @@ export function CheckboxList({
|
|
|
67
68
|
controlXstyle,
|
|
68
69
|
controlClassName,
|
|
69
70
|
controlStyle,
|
|
71
|
+
'aria-labelledby': ariaLabelledByProp,
|
|
70
72
|
'aria-describedby': ariaDescribedByProp,
|
|
71
73
|
...restProps
|
|
72
74
|
}) {
|
|
@@ -152,8 +154,10 @@ export function CheckboxList({
|
|
|
152
154
|
// internally by isEnabled, so attaching unconditionally is safe.
|
|
153
155
|
ref: useMergedRefs(ref, disabledMessageTooltip.ref),
|
|
154
156
|
...mergeProps(stylex.props(controlXstyle), controlClassName, controlStyle),
|
|
155
|
-
role: "group"
|
|
156
|
-
|
|
157
|
+
role: "group"
|
|
158
|
+
// A caller aria-labelledby names the group together with its label.
|
|
159
|
+
,
|
|
160
|
+
"aria-labelledby": joinAriaIDs(labelID, ariaLabelledByProp),
|
|
157
161
|
"aria-describedby": [ariaDescribedByProp, description ? descriptionID : null, status?.message ? statusMessageID : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined,
|
|
158
162
|
children: /*#__PURE__*/_jsx(List, {
|
|
159
163
|
density: density,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../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,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AAksCpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA4CpD;yBA5Ce,YAAY"}
|
|
@@ -51,7 +51,7 @@ import { useFocusReturnVisibility } from "../hooks/useFocusReturnVisibility.js";
|
|
|
51
51
|
import { focusForLastInput } from "../utils/focusReturn.js";
|
|
52
52
|
import { useMenuOverflow } from "./useMenuOverflow.js";
|
|
53
53
|
import { MenuRegionsContext } from "./menuRegionsContext.js";
|
|
54
|
-
import {
|
|
54
|
+
import { moveRegionsTab } from "./menuRegionStops.js";
|
|
55
55
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
56
56
|
import { useMenuDrillIn } from "./useMenuDrillIn.js";
|
|
57
57
|
import { resolveMenuWidth } from "./menuWidth.js";
|
|
@@ -76,80 +76,6 @@ const MENU_BLOCK_CAP = '300px';
|
|
|
76
76
|
const MENU_MAX_BLOCK_SIZE = `min(${MENU_BLOCK_CAP}, ${layerViewportInset.maxBlockSize})`;
|
|
77
77
|
const MENU_MAX_BLOCK_SIZE_FALLBACK = `min(${MENU_BLOCK_CAP}, ${layerViewportInset.maxBlockSizeFallback})`;
|
|
78
78
|
const MENU_TRIGGER_OPEN_BACKGROUND = `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* The elements Tab reaches inside a header or footer region, in order. Hidden
|
|
82
|
-
* controls (`hidden`, `display: none`, `visibility: hidden`, inert or
|
|
83
|
-
* aria-hidden subtrees) are not reachable, judged by the popover focus trap's
|
|
84
|
-
* own test so the two never disagree about where Tab can go.
|
|
85
|
-
*/
|
|
86
|
-
/**
|
|
87
|
-
* Collapse each named radio group to the one Tab stop a browser gives it: the
|
|
88
|
-
* focused radio, else the checked one, else the first radio moving forward or
|
|
89
|
-
* the last moving backward. The stop takes the group's first position.
|
|
90
|
-
*/
|
|
91
|
-
function collapseRadioGroups(elements, active, isBackward) {
|
|
92
|
-
const groups = new Map();
|
|
93
|
-
const groupKey = el => el instanceof HTMLInputElement && el.getAttribute('type') === 'radio' && el.name !== '' ? `${el.form?.id ?? ''}\u0000${el.name}` : null;
|
|
94
|
-
for (const el of elements) {
|
|
95
|
-
const key = groupKey(el);
|
|
96
|
-
if (key != null) {
|
|
97
|
-
const members = groups.get(key) ?? [];
|
|
98
|
-
members.push(el);
|
|
99
|
-
groups.set(key, members);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const placed = new Set();
|
|
103
|
-
const result = [];
|
|
104
|
-
for (const el of elements) {
|
|
105
|
-
const key = groupKey(el);
|
|
106
|
-
if (key == null) {
|
|
107
|
-
result.push(el);
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (placed.has(key)) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
placed.add(key);
|
|
114
|
-
const members = groups.get(key) ?? [];
|
|
115
|
-
const stop = members.find(radio => radio === active) ?? members.find(radio => radio.checked) ?? (isBackward ? members[members.length - 1] : members[0]);
|
|
116
|
-
result.push(stop);
|
|
117
|
-
}
|
|
118
|
-
return result;
|
|
119
|
-
}
|
|
120
|
-
function tabbablesIn(region) {
|
|
121
|
-
if (region == null) {
|
|
122
|
-
return [];
|
|
123
|
-
}
|
|
124
|
-
return getFocusableElements(region).filter(element => element.tabIndex >= 0 && !isInsideHiddenWrapper(element, region));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Whether a `display: none` ancestor between the element and its region hides
|
|
129
|
-
* it — a control in a wrapper hidden at some widths, say. The trap's test reads
|
|
130
|
-
* only the element's own display.
|
|
131
|
-
*/
|
|
132
|
-
function isInsideHiddenWrapper(element, region) {
|
|
133
|
-
if (typeof window === 'undefined' || !window.getComputedStyle) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
for (let node = element.parentElement; node != null && node !== region.parentElement; node = node.parentElement) {
|
|
137
|
-
if (window.getComputedStyle(node).display === 'none') {
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Move focus to a Tab stop in the dialog. Reports whether focus actually
|
|
146
|
-
* arrived, so a caller can fall back to the menu instead of stranding focus on
|
|
147
|
-
* the page.
|
|
148
|
-
*/
|
|
149
|
-
function focusRegionControl(element) {
|
|
150
|
-
element.focus();
|
|
151
|
-
return element.ownerDocument.activeElement === element;
|
|
152
|
-
}
|
|
153
79
|
const _temp = {
|
|
154
80
|
kzqmXN: "x1uyokj7",
|
|
155
81
|
"$$css": true
|
|
@@ -957,34 +883,7 @@ function DropdownMenuPopover({
|
|
|
957
883
|
// popover's own focus trap, which listens on the document, never reads it a
|
|
958
884
|
// second time.
|
|
959
885
|
const moveDialogTab = useCallback((e, isFromFlyout = false) => {
|
|
960
|
-
|
|
961
|
-
if (menu == null) {
|
|
962
|
-
return;
|
|
963
|
-
}
|
|
964
|
-
e.preventDefault();
|
|
965
|
-
e.stopPropagation();
|
|
966
|
-
// A named radio group is one stop, as the browser's own Tab order has it.
|
|
967
|
-
const cycle = collapseRadioGroups([...tabbablesIn(headerRef.current), menu, ...tabbablesIn(footerRef.current)], document.activeElement, e.shiftKey);
|
|
968
|
-
if (cycle.length === 1) {
|
|
969
|
-
// Nothing else to reach: focus stays in the menu. From a flyout that
|
|
970
|
-
// has just closed itself, that is the menu's own stop.
|
|
971
|
-
if (isFromFlyout) {
|
|
972
|
-
menu.focus();
|
|
973
|
-
}
|
|
974
|
-
return;
|
|
975
|
-
}
|
|
976
|
-
const active = document.activeElement;
|
|
977
|
-
const menuIndex = cycle.indexOf(menu);
|
|
978
|
-
// A row, or a row of an open flyout, counts as the menu's stop.
|
|
979
|
-
let index = menu.contains(active) ? menuIndex : cycle.findIndex(el => el === active || el.contains(active));
|
|
980
|
-
if (index < 0) {
|
|
981
|
-
index = menuIndex;
|
|
982
|
-
}
|
|
983
|
-
const step = e.shiftKey ? -1 : 1;
|
|
984
|
-
const next = cycle[(index + step + cycle.length) % cycle.length];
|
|
985
|
-
if (!focusRegionControl(next)) {
|
|
986
|
-
menu.focus();
|
|
987
|
-
}
|
|
886
|
+
moveRegionsTab(e, listRef.current, headerRef.current, footerRef.current, isFromFlyout);
|
|
988
887
|
}, [listRef]);
|
|
989
888
|
|
|
990
889
|
// Extend useListFocus with Enter/Space activation + typeahead
|
|
@@ -35,7 +35,7 @@ export interface DropdownMenuCheckboxItemProps extends Omit<BaseProps, 'onChange
|
|
|
35
35
|
description?: ReactNode;
|
|
36
36
|
/**
|
|
37
37
|
* Icon to display before the label. Accepts a semantic icon name (see
|
|
38
|
-
* `
|
|
38
|
+
* `astryx docs icons`) or a rendered node.
|
|
39
39
|
*/
|
|
40
40
|
icon?: ReactNode | IconType;
|
|
41
41
|
/**
|
|
@@ -23,7 +23,8 @@ import type { BaseProps } from '../BaseProps';
|
|
|
23
23
|
export interface DropdownMenuGroupProps extends Pick<BaseProps, 'xstyle' | 'className' | 'style'> {
|
|
24
24
|
/**
|
|
25
25
|
* Heading shown above the group's rows and used as the group's accessible
|
|
26
|
-
* name (`aria-labelledby`). Omit it for an unnamed group.
|
|
26
|
+
* name (`aria-labelledby`). Omit it for an unnamed group. Keep this content
|
|
27
|
+
* non-interactive; controls belong in DropdownMenu's `header` or `footer`.
|
|
27
28
|
*/
|
|
28
29
|
title?: ReactNode;
|
|
29
30
|
/** The rows of the group: menu items, selectable items, sub-menus. */
|
|
@@ -34,9 +35,10 @@ export interface DropdownMenuGroupProps extends Pick<BaseProps, 'xstyle' | 'clas
|
|
|
34
35
|
/**
|
|
35
36
|
* A titled group of menu rows.
|
|
36
37
|
*
|
|
37
|
-
* Renders `role="group"` named by its heading. The heading is
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Renders `role="group"` named by its heading. The heading is not a
|
|
39
|
+
* `menuitem`, so arrow-key navigation and typeahead skip it. Keep heading
|
|
40
|
+
* content non-interactive; place controls in DropdownMenu's `header` or
|
|
41
|
+
* `footer`. The compound peer of
|
|
40
42
|
* `{type: 'section', title, items}` in the `items` data API.
|
|
41
43
|
*
|
|
42
44
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC
|
|
1
|
+
{"version":3,"file":"DropdownMenuGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mDAAmD;IACnD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE,sBAAsB,+BAuBxB;yBA9Be,iBAAiB"}
|
|
@@ -32,9 +32,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
32
32
|
/**
|
|
33
33
|
* A titled group of menu rows.
|
|
34
34
|
*
|
|
35
|
-
* Renders `role="group"` named by its heading. The heading is
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* Renders `role="group"` named by its heading. The heading is not a
|
|
36
|
+
* `menuitem`, so arrow-key navigation and typeahead skip it. Keep heading
|
|
37
|
+
* content non-interactive; place controls in DropdownMenu's `header` or
|
|
38
|
+
* `footer`. The compound peer of
|
|
38
39
|
* `{type: 'section', title, items}` in the `items` data API.
|
|
39
40
|
*
|
|
40
41
|
* @example
|
|
@@ -35,7 +35,7 @@ export interface DropdownMenuRadioItemProps extends Omit<BaseProps, 'role' | 'ar
|
|
|
35
35
|
description?: ReactNode;
|
|
36
36
|
/**
|
|
37
37
|
* Icon to display before the label. Accepts a semantic icon name (see
|
|
38
|
-
* `
|
|
38
|
+
* `astryx docs icons`) or a rendered node.
|
|
39
39
|
*/
|
|
40
40
|
icon?: ReactNode | IconType;
|
|
41
41
|
/**
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file menuRegionStops.ts
|
|
3
|
+
* @input The focus trap's own reachability test (getFocusableElements)
|
|
4
|
+
* @output `tabbablesIn`, `focusRegionControl`, `moveRegionsTab`: the Tab stops
|
|
5
|
+
* of a header or footer region and the walk through a menu with regions,
|
|
6
|
+
* with a named radio group as one stop
|
|
7
|
+
* @position Internal; DropdownMenu's walk through its header and footer, in a
|
|
8
|
+
* module of its own so another menu level with regions can share it.
|
|
9
|
+
*
|
|
10
|
+
* A menu with a header or footer is a dialog: Tab and Shift+Tab walk the
|
|
11
|
+
* header's controls, the menu as one stop, then the footer's controls, and
|
|
12
|
+
* wrap at either end.
|
|
13
|
+
*/
|
|
14
|
+
import type React from 'react';
|
|
15
|
+
/**
|
|
16
|
+
* The elements Tab reaches inside a header or footer region, in order. Hidden
|
|
17
|
+
* controls (`hidden`, `display: none`, `visibility: hidden`, inert or
|
|
18
|
+
* aria-hidden subtrees) are not reachable, judged by the popover focus trap's
|
|
19
|
+
* own test so the two never disagree about where Tab can go.
|
|
20
|
+
*/
|
|
21
|
+
export declare function tabbablesIn(region: HTMLElement | null): HTMLElement[];
|
|
22
|
+
/**
|
|
23
|
+
* Move focus to a Tab stop in the dialog. Reports whether focus actually
|
|
24
|
+
* arrived, so a caller can fall back to the menu instead of stranding focus on
|
|
25
|
+
* the page.
|
|
26
|
+
*/
|
|
27
|
+
export declare function focusRegionControl(element: HTMLElement): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Handle Tab in a menu with a header or footer: move to the next stop of the
|
|
30
|
+
* header's controls, the menu as one stop, then the footer's controls,
|
|
31
|
+
* wrapping at either end. The key is handled in full, so a document-level
|
|
32
|
+
* focus trap never reads it a second time. A row, or a row of an open
|
|
33
|
+
* flyout below this menu, counts as the menu's stop; with no other stop,
|
|
34
|
+
* focus stays in the menu (`isFromFlyout`: a flyout that has just closed
|
|
35
|
+
* itself hands the focus back to the menu's own stop).
|
|
36
|
+
*/
|
|
37
|
+
export declare function moveRegionsTab(event: React.KeyboardEvent, menu: HTMLElement | null, header: HTMLElement | null, footer: HTMLElement | null, isFromFlyout?: boolean): void;
|
|
38
|
+
//# sourceMappingURL=menuRegionStops.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menuRegionStops.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/menuRegionStops.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,WAAW,EAAE,CAOrE;AAyED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAGhE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,CAAC,aAAa,EAC1B,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,YAAY,UAAQ,GACnB,IAAI,CAmCN"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file menuRegionStops.ts
|
|
7
|
+
* @input The focus trap's own reachability test (getFocusableElements)
|
|
8
|
+
* @output `tabbablesIn`, `focusRegionControl`, `moveRegionsTab`: the Tab stops
|
|
9
|
+
* of a header or footer region and the walk through a menu with regions,
|
|
10
|
+
* with a named radio group as one stop
|
|
11
|
+
* @position Internal; DropdownMenu's walk through its header and footer, in a
|
|
12
|
+
* module of its own so another menu level with regions can share it.
|
|
13
|
+
*
|
|
14
|
+
* A menu with a header or footer is a dialog: Tab and Shift+Tab walk the
|
|
15
|
+
* header's controls, the menu as one stop, then the footer's controls, and
|
|
16
|
+
* wrap at either end.
|
|
17
|
+
*/
|
|
18
|
+
import { getFocusableElements } from "../hooks/useFocusTrap.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The elements Tab reaches inside a header or footer region, in order. Hidden
|
|
22
|
+
* controls (`hidden`, `display: none`, `visibility: hidden`, inert or
|
|
23
|
+
* aria-hidden subtrees) are not reachable, judged by the popover focus trap's
|
|
24
|
+
* own test so the two never disagree about where Tab can go.
|
|
25
|
+
*/
|
|
26
|
+
export function tabbablesIn(region) {
|
|
27
|
+
if (region == null) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return getFocusableElements(region).filter(element => element.tabIndex >= 0 && !isInsideHiddenWrapper(element, region));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Whether a `display: none` ancestor between the element and its region hides
|
|
35
|
+
* it — a control in a wrapper hidden at some widths, say. The trap's test reads
|
|
36
|
+
* only the element's own display.
|
|
37
|
+
*/
|
|
38
|
+
function isInsideHiddenWrapper(element, region) {
|
|
39
|
+
if (typeof window === 'undefined' || !window.getComputedStyle) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
for (let node = element.parentElement; node != null && node !== region.parentElement; node = node.parentElement) {
|
|
43
|
+
if (window.getComputedStyle(node).display === 'none') {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Collapse each named radio group to the one Tab stop a browser gives it: the
|
|
52
|
+
* focused radio, else the checked one, else the first radio moving forward or
|
|
53
|
+
* the last moving backward. The stop takes the group's first position.
|
|
54
|
+
*/
|
|
55
|
+
function collapseRadioGroups(elements, active, isBackward) {
|
|
56
|
+
const groups = new Map();
|
|
57
|
+
const groupKey = el => el instanceof HTMLInputElement && el.getAttribute('type') === 'radio' && el.name !== '' ? `${el.form?.id ?? ''}\u0000${el.name}` : null;
|
|
58
|
+
for (const el of elements) {
|
|
59
|
+
const key = groupKey(el);
|
|
60
|
+
if (key != null) {
|
|
61
|
+
const members = groups.get(key) ?? [];
|
|
62
|
+
members.push(el);
|
|
63
|
+
groups.set(key, members);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const placed = new Set();
|
|
67
|
+
const result = [];
|
|
68
|
+
for (const el of elements) {
|
|
69
|
+
const key = groupKey(el);
|
|
70
|
+
if (key == null) {
|
|
71
|
+
result.push(el);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (placed.has(key)) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
placed.add(key);
|
|
78
|
+
const members = groups.get(key) ?? [];
|
|
79
|
+
const stop = members.find(radio => radio === active) ?? members.find(radio => radio.checked) ?? (isBackward ? members[members.length - 1] : members[0]);
|
|
80
|
+
result.push(stop);
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Move focus to a Tab stop in the dialog. Reports whether focus actually
|
|
87
|
+
* arrived, so a caller can fall back to the menu instead of stranding focus on
|
|
88
|
+
* the page.
|
|
89
|
+
*/
|
|
90
|
+
export function focusRegionControl(element) {
|
|
91
|
+
element.focus();
|
|
92
|
+
return element.ownerDocument.activeElement === element;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Handle Tab in a menu with a header or footer: move to the next stop of the
|
|
97
|
+
* header's controls, the menu as one stop, then the footer's controls,
|
|
98
|
+
* wrapping at either end. The key is handled in full, so a document-level
|
|
99
|
+
* focus trap never reads it a second time. A row, or a row of an open
|
|
100
|
+
* flyout below this menu, counts as the menu's stop; with no other stop,
|
|
101
|
+
* focus stays in the menu (`isFromFlyout`: a flyout that has just closed
|
|
102
|
+
* itself hands the focus back to the menu's own stop).
|
|
103
|
+
*/
|
|
104
|
+
export function moveRegionsTab(event, menu, header, footer, isFromFlyout = false) {
|
|
105
|
+
if (menu == null) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
event.preventDefault();
|
|
109
|
+
event.stopPropagation();
|
|
110
|
+
const active = document.activeElement;
|
|
111
|
+
// A named radio group is one stop, as the browser's own Tab order has it.
|
|
112
|
+
const cycle = collapseRadioGroups([...tabbablesIn(header), menu, ...tabbablesIn(footer)], active, event.shiftKey);
|
|
113
|
+
if (cycle.length === 1) {
|
|
114
|
+
// Nothing else to reach: focus stays in the menu. From a flyout that has
|
|
115
|
+
// just closed itself, that is the menu's own stop.
|
|
116
|
+
if (isFromFlyout) {
|
|
117
|
+
menu.focus();
|
|
118
|
+
}
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const menuIndex = cycle.indexOf(menu);
|
|
122
|
+
let index = menu.contains(active) ? menuIndex : cycle.findIndex(element => element === active || element.contains(active));
|
|
123
|
+
if (index < 0) {
|
|
124
|
+
index = menuIndex;
|
|
125
|
+
}
|
|
126
|
+
const step = event.shiftKey ? -1 : 1;
|
|
127
|
+
const next = cycle[(index + step + cycle.length) % cycle.length];
|
|
128
|
+
if (!focusRegionControl(next)) {
|
|
129
|
+
menu.focus();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -28,10 +28,11 @@ export interface FormLayoutProps extends BaseProps<HTMLDivElement> {
|
|
|
28
28
|
* Direction of field arrangement.
|
|
29
29
|
*
|
|
30
30
|
* - `'vertical'` — Fields stack top-to-bottom (default). Most common.
|
|
31
|
-
* - `'horizontal'` — Fields
|
|
32
|
-
*
|
|
33
|
-
* - `'horizontal-labels'` — CSS Grid with labels
|
|
34
|
-
* Collapses to vertical when the
|
|
31
|
+
* - `'horizontal'` — Fields occupy one `1fr` CSS Grid track per child in
|
|
32
|
+
* logical inline order.
|
|
33
|
+
* - `'horizontal-labels'` — CSS Grid with labels beside their inputs on the
|
|
34
|
+
* inline-start side. Collapses to vertical when the viewport is narrow
|
|
35
|
+
* (≤480px).
|
|
35
36
|
*
|
|
36
37
|
* @default 'vertical'
|
|
37
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormLayout.d.ts","sourceRoot":"","sources":["../../src/FormLayout/FormLayout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AA2C7B,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB
|
|
1
|
+
{"version":3,"file":"FormLayout.d.ts","sourceRoot":"","sources":["../../src/FormLayout/FormLayout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AA2C7B,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAEhC;;;;;;;;;;;;;;;;;OAiBG;IACH,kBAAkB,CAAC,EAAE,eAAe,CAAC;CACtC;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BA0BjB;yBAnCe,UAAU"}
|
|
@@ -105,10 +105,10 @@ export function FormLayout({
|
|
|
105
105
|
value: contextValue,
|
|
106
106
|
children: /*#__PURE__*/_jsx("div", {
|
|
107
107
|
ref: ref,
|
|
108
|
+
...props,
|
|
108
109
|
...mergeProps(themeProps('form-layout', {
|
|
109
110
|
direction
|
|
110
111
|
}), stylex.props(styles.base, direction === 'horizontal' && styles.horizontal, direction === 'horizontal-labels' && styles.horizontalLabels, xstyle), className, style),
|
|
111
|
-
...props,
|
|
112
112
|
children: children
|
|
113
113
|
})
|
|
114
114
|
});
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Direction of form field arrangement.
|
|
3
3
|
*
|
|
4
4
|
* - `'vertical'` — Fields stack top-to-bottom (default). Most common.
|
|
5
|
-
* - `'horizontal'` — Fields
|
|
6
|
-
* - `'horizontal-labels'` — Fields stack vertically
|
|
7
|
-
*
|
|
5
|
+
* - `'horizontal'` — Fields occupy one `1fr` grid track per child in logical inline order.
|
|
6
|
+
* - `'horizontal-labels'` — Fields stack vertically while labels sit beside
|
|
7
|
+
* their inputs on the inline-start side (settings/admin panel pattern).
|
|
8
8
|
*/
|
|
9
9
|
export type FormLayoutDirection = 'vertical' | 'horizontal' | 'horizontal-labels';
|
|
10
10
|
/**
|
|
@@ -19,9 +19,9 @@ import { createLayerScopedContext as createContext } from "../Layer/layerScopedC
|
|
|
19
19
|
* Direction of form field arrangement.
|
|
20
20
|
*
|
|
21
21
|
* - `'vertical'` — Fields stack top-to-bottom (default). Most common.
|
|
22
|
-
* - `'horizontal'` — Fields
|
|
23
|
-
* - `'horizontal-labels'` — Fields stack vertically
|
|
24
|
-
*
|
|
22
|
+
* - `'horizontal'` — Fields occupy one `1fr` grid track per child in logical inline order.
|
|
23
|
+
* - `'horizontal-labels'` — Fields stack vertically while labels sit beside
|
|
24
|
+
* their inputs on the inline-start side (settings/admin panel pattern).
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
/**
|
package/dist/Grid/Grid.d.ts
CHANGED
|
@@ -21,13 +21,14 @@ export type GridAlignment = 'start' | 'center' | 'end' | 'stretch';
|
|
|
21
21
|
/**
|
|
22
22
|
* Column configuration for Grid.
|
|
23
23
|
*
|
|
24
|
-
* A number means exactly N
|
|
25
|
-
* `columns={4}` on a phone renders four narrow tracks.
|
|
24
|
+
* A number means exactly N `1fr` tracks at every width; it never reflows, so
|
|
25
|
+
* `columns={4}` on a phone renders four narrow tracks. A child's minimum
|
|
26
|
+
* content can widen its track beyond an equal fraction. For columns that reflow
|
|
26
27
|
* on small screens, use the object form: `{minWidth: 240, max: 4}` renders at
|
|
27
28
|
* most four columns, each at least 240px, and fewer when the container is
|
|
28
29
|
* narrower.
|
|
29
30
|
*
|
|
30
|
-
* - `number` — exactly N
|
|
31
|
+
* - `number` — exactly N `1fr` tracks (e.g. `columns={3}`); never reflows
|
|
31
32
|
* - `object` — responsive columns based on minimum child width:
|
|
32
33
|
* - `minWidth` — minimum width (px) for each column track
|
|
33
34
|
* - `repeat` — `'fill'` (default) preserves empty tracks for consistent widths;
|
|
@@ -46,10 +47,10 @@ export interface GridProps extends BaseProps<HTMLDivElement> {
|
|
|
46
47
|
/** Ref forwarded to the root element */
|
|
47
48
|
ref?: React.Ref<HTMLDivElement>;
|
|
48
49
|
/**
|
|
49
|
-
* Column configuration. A number
|
|
50
|
-
* reflows;
|
|
51
|
-
* `{minWidth, max}`.
|
|
52
|
-
* - `number` — exactly N
|
|
50
|
+
* Column configuration. A number creates exactly N `1fr` tracks and never
|
|
51
|
+
* reflows; a child's minimum content may widen its track. For columns that
|
|
52
|
+
* reflow on small screens, use `{minWidth, max}`.
|
|
53
|
+
* - `number` — exactly N `1fr` tracks at every width
|
|
53
54
|
* - `{minWidth, max?, repeat?}` — responsive columns with a px floor and an
|
|
54
55
|
* optional cap
|
|
55
56
|
*
|