@astryxdesign/core 0.7.2-canary.fe2c655 → 0.7.2
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/CHANGELOG.md +156 -2
- package/README.md +4 -4
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +40 -1
- package/dist/AspectRatio/AspectRatio.d.ts +6 -8
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +44 -3
- 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/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +5 -2
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +1 -0
- package/dist/CheckboxInput/CheckboxInput.d.ts +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +3 -1
- 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/CheckboxList/CheckboxListItem.d.ts +9 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +4 -2
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +37 -5
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +5 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +84 -113
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +21 -0
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts +5 -3
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuDivider.js +7 -3
- 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/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +15 -4
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +24 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +46 -0
- 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/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +4 -10
- package/dist/Field/Field.d.ts +1 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +8 -4
- 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/Grid/GridSpan.d.ts.map +1 -1
- package/dist/Grid/GridSpan.js +1 -0
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +4 -2
- package/dist/Item/Item.d.ts +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +19 -4
- package/dist/List/List.d.ts +46 -19
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +28 -10
- package/dist/List/ListContext.d.ts +8 -3
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +7 -2
- package/dist/List/ListItem.d.ts +13 -5
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +21 -8
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.d.ts.map +1 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +8 -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/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +5 -1
- package/dist/MetadataList/MetadataListContext.d.ts +1 -1
- package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.d.ts +9 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +30 -3
- 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/RadioList/RadioList.d.ts +1 -1
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +6 -2
- package/dist/RadioList/RadioListItem.d.ts +9 -1
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +2 -0
- package/dist/SideNav/SideNavItem.d.ts +8 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +76 -10
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +4 -2
- package/dist/ToggleButton/ToggleButton.d.ts +3 -2
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +12 -1
- package/dist/Token/Token.js +1 -1
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +5 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +5 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +2 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +57 -9
- package/dist/astryx.css +27 -4
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +18 -13
- package/dist/reset.a11y.chromium.spec.js +50 -1
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +15 -9
- package/docs.mjs +4 -4
- package/package.json +4 -4
- package/scripts/agent-doc-state.mjs +66 -6
- package/scripts/postinstall.mjs +44 -3
- package/src/AppShell/AppShell.tsx +45 -1
- package/src/AspectRatio/AspectRatio.test.tsx +44 -43
- package/src/AspectRatio/AspectRatio.tsx +38 -18
- package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +157 -0
- package/src/Avatar/Avatar.doc.mjs +5 -3
- package/src/Avatar/Avatar.tsx +11 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +3 -2
- package/src/AvatarGroup/AvatarGroupOverflow.test.tsx +24 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +4 -1
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +30 -1
- package/src/Card/Card.doc.mjs +1 -1
- 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/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +3 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +34 -0
- package/src/CheckboxInput/CheckboxInput.tsx +3 -1
- package/src/CheckboxList/CheckboxList.fr10.test.tsx +29 -2
- package/src/CheckboxList/CheckboxList.test.tsx +22 -0
- package/src/CheckboxList/CheckboxList.tsx +4 -1
- package/src/CheckboxList/CheckboxListItem.doc.mjs +16 -0
- package/src/CheckboxList/CheckboxListItem.tsx +10 -0
- package/src/Code/Code.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +2 -0
- package/src/CommandPalette/CommandPaletteInput.test.tsx +53 -4
- package/src/CommandPalette/CommandPaletteInput.tsx +33 -3
- package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +335 -0
- package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +292 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +2 -3
- package/src/ContextMenu/ContextMenu.test.tsx +12 -2
- package/src/ContextMenu/ContextMenu.tsx +4 -1
- package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +438 -0
- package/src/Dialog/Dialog.test.tsx +46 -0
- package/src/Dialog/Dialog.tsx +20 -7
- package/src/Dialog/__tests__/Dialog.a11y.known-failures.ts +0 -14
- package/src/Drawer/Drawer.doc.mjs +1 -0
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +57 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +79 -6
- package/src/DropdownMenu/DropdownMenu.tsx +88 -144
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuContext.tsx +24 -0
- package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuDivider.spec.md +192 -0
- package/src/DropdownMenu/DropdownMenuDivider.tsx +9 -5
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +169 -10
- package/src/DropdownMenu/DropdownMenuGroup.tsx +6 -4
- package/src/DropdownMenu/DropdownMenuLazySheet.test.tsx +126 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +185 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +17 -3
- package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +280 -0
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +334 -0
- package/src/DropdownMenu/__tests__/warmMenuBottomSheet.tsx +43 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +71 -0
- package/src/DropdownMenu/menuRegionStops.ts +167 -0
- package/src/EmptyState/EmptyState.doc.mjs +3 -2
- package/src/EmptyState/EmptyState.spec.md +189 -0
- package/src/EmptyState/EmptyState.test.tsx +74 -3
- package/src/EmptyState/EmptyState.tsx +4 -8
- package/src/Field/Field.doc.mjs +14 -8
- package/src/Field/Field.spec.md +217 -0
- package/src/Field/Field.test.tsx +60 -2
- package/src/Field/Field.tsx +17 -8
- 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 +4 -1
- package/src/Heading/Heading.test.tsx +57 -0
- package/src/Heading/Heading.tsx +6 -2
- package/src/Icon/Icon.doc.mjs +36 -0
- package/src/Indicator/Indicator.doc.mjs +3 -3
- package/src/Item/Item.doc.mjs +12 -8
- package/src/Item/Item.test.tsx +61 -0
- package/src/Item/Item.tsx +40 -4
- package/src/Layout/LayoutHeader.doc.mjs +5 -0
- package/src/List/List.doc.mjs +14 -1
- package/src/List/List.spec.md +129 -77
- package/src/List/List.test.tsx +163 -94
- package/src/List/List.tsx +74 -18
- package/src/List/ListContext.tsx +9 -3
- package/src/List/ListItem.doc.mjs +16 -0
- package/src/List/ListItem.tsx +56 -27
- package/src/List/index.ts +1 -1
- package/src/Markdown/Markdown.tsx +14 -1
- package/src/Markdown/parser.ts +8 -2
- package/src/Markdown/plugins/headingLinks.ts +9 -1
- package/src/MetadataList/MetadataList.doc.mjs +3 -3
- package/src/MetadataList/MetadataList.test.tsx +38 -0
- package/src/MetadataList/MetadataList.tsx +8 -1
- package/src/MetadataList/MetadataListContext.tsx +1 -1
- package/src/MobileNav/MobileNav.tsx +30 -3
- package/src/MobileNav/MobileNavCloseEdgeCases.test.tsx +173 -15
- package/src/MoreMenu/MoreMenu.test.tsx +5 -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/ProgressBar/ProgressBar.doc.mjs +1 -0
- package/src/RadioList/RadioList.fr10.test.tsx +45 -2
- package/src/RadioList/RadioList.test.tsx +22 -0
- package/src/RadioList/RadioList.tsx +4 -1
- package/src/RadioList/RadioListItem.doc.mjs +16 -0
- package/src/RadioList/RadioListItem.tsx +10 -1
- package/src/Resizable/useResizable.doc.mjs +2 -0
- package/src/ScrollableArea/ScrollableArea.doc.mjs +1 -1
- package/src/SideNav/SideNav.spec.md +227 -0
- package/src/SideNav/SideNav.test.tsx +220 -0
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +99 -17
- package/src/Slider/Slider.spec.md +39 -18
- package/src/Spinner/Spinner.doc.mjs +1 -1
- package/src/TabList/TabList.spec.md +57 -44
- package/src/Table/Table.spec.md +6 -1
- package/src/Table/plugins/activation/useTableActivation.spec.md +254 -0
- package/src/Text/Text.test.tsx +57 -0
- package/src/Text/Text.tsx +6 -2
- package/src/TimeInput/TimeInput.fr10.test.tsx +15 -0
- package/src/Timestamp/Timestamp.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButton.test.tsx +95 -0
- package/src/ToggleButton/ToggleButton.tsx +12 -1
- package/src/ToggleButton/ToggleButtonGroup.doc.mjs +4 -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 +47 -0
- package/src/TopNav/TopNavMegaMenu.tsx +9 -3
- package/src/TopNav/TopNavMenu.test.tsx +46 -1
- package/src/TopNav/TopNavMenu.tsx +13 -3
- package/src/TreeList/TreeList.doc.mjs +1 -0
- package/src/TreeList/TreeList.test.tsx +327 -6
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListBranches.tsx +6 -0
- package/src/TreeList/TreeListItem.tsx +88 -13
- package/src/docPropLiterals.test.ts +36 -10
- package/src/hooks/useMenuHover.ts +18 -13
- package/src/postinstall.test.mjs +79 -0
- package/src/reset.a11y.chromium.spec.ts +52 -1
- package/src/reset.css +9 -29
- package/src/reset.test.ts +11 -0
- package/src/theme/derivedVarRegistry.test.ts +7 -0
- package/src/unicodePropertyEscapes.source-build.test.mjs +69 -0
- package/src/utils/plainDate.test.ts +37 -1
- package/src/utils/plainDate.ts +15 -5
|
@@ -32,6 +32,27 @@ import { createLayerScopedContext } from "../Layer/layerScopedContext.js";
|
|
|
32
32
|
* @internal
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Whether the root menu of this layer tree is open; internal companion to
|
|
37
|
+
* `DropdownMenuContext`, on its own unexported context so the public
|
|
38
|
+
* `DropdownMenuContextValue` surface stays unchanged. A sub-menu's hover
|
|
39
|
+
* intent must die with the menu: a hover-open scheduled on its trigger
|
|
40
|
+
* before the menu closed from elsewhere would otherwise fire into the
|
|
41
|
+
* hidden menu and reopen the flyout behind it (#6893). `null` means no
|
|
42
|
+
* signal, treated as open, matching providers that have no state to give.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export const DropdownMenuRootOpenContext = createLayerScopedContext(null);
|
|
46
|
+
DropdownMenuRootOpenContext.displayName = 'DropdownMenuRootOpenContext';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether the root menu backing these compound items is open. True when no
|
|
50
|
+
* provider gave a signal.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export function useDropdownMenuRootOpen() {
|
|
54
|
+
return use(DropdownMenuRootOpenContext) !== false;
|
|
55
|
+
}
|
|
35
56
|
export const DropdownMenuContext = createLayerScopedContext(null);
|
|
36
57
|
DropdownMenuContext.displayName = 'DropdownMenuContext';
|
|
37
58
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseProps } from '../BaseProps';
|
|
2
|
-
export interface DropdownMenuDividerProps extends
|
|
2
|
+
export interface DropdownMenuDividerProps extends Omit<BaseProps<HTMLDivElement>, 'role' | 'aria-orientation'> {
|
|
3
3
|
/** Ref forwarded to the separator element. */
|
|
4
4
|
ref?: React.Ref<HTMLDivElement>;
|
|
5
5
|
}
|
|
@@ -7,7 +7,9 @@ export interface DropdownMenuDividerProps extends Pick<BaseProps, 'xstyle' | 'cl
|
|
|
7
7
|
* A horizontal rule separating groups of menu rows.
|
|
8
8
|
*
|
|
9
9
|
* Renders `role="separator"`, so it is never a stop in the menu's arrow-key
|
|
10
|
-
* order. Equivalent to `{type: 'divider'}` in the `items` data API.
|
|
10
|
+
* order. Equivalent to `{type: 'divider'}` in the `items` data API. Host
|
|
11
|
+
* attributes (`id`, `data-*`, `aria-*`) and DOM handlers reach the separator;
|
|
12
|
+
* its role and orientation stay component-owned.
|
|
11
13
|
*
|
|
12
14
|
* @example
|
|
13
15
|
* ```
|
|
@@ -18,7 +20,7 @@ export interface DropdownMenuDividerProps extends Pick<BaseProps, 'xstyle' | 'cl
|
|
|
18
20
|
* </DropdownMenu>
|
|
19
21
|
* ```
|
|
20
22
|
*/
|
|
21
|
-
export declare function DropdownMenuDivider({ xstyle, className, style, ref, }: DropdownMenuDividerProps): import("react").JSX.Element;
|
|
23
|
+
export declare function DropdownMenuDivider({ xstyle, className, style, ref, ...rest }: DropdownMenuDividerProps): import("react").JSX.Element;
|
|
22
24
|
export declare namespace DropdownMenuDivider {
|
|
23
25
|
var displayName: string;
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuDivider.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuDivider.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,
|
|
1
|
+
{"version":3,"file":"DropdownMenuDivider.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuDivider.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAW5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,cAAc,CAAC,EACzB,MAAM,GAAG,kBAAkB,CAC5B;IACC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,wBAAwB,+BAY1B;yBAlBe,mBAAmB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DropdownMenuDivider.tsx
|
|
7
|
-
* @input Uses Divider, spacing tokens, themeProps
|
|
7
|
+
* @input Uses Divider, spacing tokens, themeProps; forwards host props to Divider
|
|
8
8
|
* @output Exports DropdownMenuDivider component and DropdownMenuDividerProps
|
|
9
9
|
* @position Sub-component; used inside DropdownMenu
|
|
10
10
|
*
|
|
@@ -39,7 +39,9 @@ const THEME_CLASS_NAME = themeProps('dropdown-menu-divider').className;
|
|
|
39
39
|
* A horizontal rule separating groups of menu rows.
|
|
40
40
|
*
|
|
41
41
|
* Renders `role="separator"`, so it is never a stop in the menu's arrow-key
|
|
42
|
-
* order. Equivalent to `{type: 'divider'}` in the `items` data API.
|
|
42
|
+
* order. Equivalent to `{type: 'divider'}` in the `items` data API. Host
|
|
43
|
+
* attributes (`id`, `data-*`, `aria-*`) and DOM handlers reach the separator;
|
|
44
|
+
* its role and orientation stay component-owned.
|
|
43
45
|
*
|
|
44
46
|
* @example
|
|
45
47
|
* ```
|
|
@@ -54,9 +56,11 @@ export function DropdownMenuDivider({
|
|
|
54
56
|
xstyle,
|
|
55
57
|
className,
|
|
56
58
|
style,
|
|
57
|
-
ref
|
|
59
|
+
ref,
|
|
60
|
+
...rest
|
|
58
61
|
}) {
|
|
59
62
|
return /*#__PURE__*/_jsx(Divider, {
|
|
63
|
+
...rest,
|
|
60
64
|
ref: ref,
|
|
61
65
|
xstyle: [styles.divider, xstyle],
|
|
62
66
|
className: className ? `${THEME_CLASS_NAME} ${className}` : THEME_CLASS_NAME,
|
|
@@ -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
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AA0B5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AA0B5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4J5C,MAAM,MAAM,+BAA+B,GACzC,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAErC,UAAU,4BAA6B,SAAQ,IAAI,CACjD,SAAS,EACT,MAAM,GAAG,UAAU,CACpB;IACC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,+BAA+B,CAAC;IAC/C,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,CA4kBX;yBA9kBe,mBAAmB"}
|
|
@@ -71,7 +71,7 @@ import { composeEventHandlers, mergeProps, rtlStyles } from "../utils/index.js";
|
|
|
71
71
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
72
72
|
import { themeProps } from "../utils/themeProps.js";
|
|
73
73
|
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR, MENU_BOUNDARY_SELECTOR, activateMenuItem } from "./menuItemRoles.js";
|
|
74
|
-
import { DropdownMenuContext, useDropdownMenuContext } from "./DropdownMenuContext.js";
|
|
74
|
+
import { DropdownMenuContext, DropdownMenuRootOpenContext, useDropdownMenuContext, useDropdownMenuRootOpen } from "./DropdownMenuContext.js";
|
|
75
75
|
import { focusMenuItemOnHover } from "./menuItemHover.js";
|
|
76
76
|
import { DropdownMenuItem } from "./DropdownMenuItem.js";
|
|
77
77
|
import { useTranslator } from "../i18n/index.js";
|
|
@@ -280,7 +280,11 @@ export function DropdownMenuSubMenu(props) {
|
|
|
280
280
|
// Hover intent and the shared hover→click guard only: this level owns its own
|
|
281
281
|
// click handling, roving focus and typeahead. popover="manual", so the
|
|
282
282
|
// invoker wiring other consumers need does not apply. A drill-in row has no
|
|
283
|
-
// hover: a finger drives it, and a press opens it.
|
|
283
|
+
// hover: a finger drives it, and a press opens it. Hover is also gated on
|
|
284
|
+
// the root menu being open, so a hover-open scheduled before the menu
|
|
285
|
+
// closed from elsewhere is cancelled instead of firing into the hidden
|
|
286
|
+
// menu (#6893).
|
|
287
|
+
const isRootMenuOpen = useDropdownMenuRootOpen();
|
|
284
288
|
const {
|
|
285
289
|
triggerProps,
|
|
286
290
|
contentProps,
|
|
@@ -289,7 +293,7 @@ export function DropdownMenuSubMenu(props) {
|
|
|
289
293
|
show: showLayer,
|
|
290
294
|
hide: hideLayer,
|
|
291
295
|
isOpen: isFlyoutOpen,
|
|
292
|
-
isEnabled: canOpen && !isDrillIn,
|
|
296
|
+
isEnabled: canOpen && !isDrillIn && isRootMenuOpen,
|
|
293
297
|
// The safe triangle toward the flyout's near edge is built from the
|
|
294
298
|
// flyout this component renders, not the hook's own list ref.
|
|
295
299
|
flyoutRef: menuRef
|
|
@@ -565,7 +569,7 @@ export function DropdownMenuSubMenu(props) {
|
|
|
565
569
|
});
|
|
566
570
|
const resolvedMenuWidth = menuWidth ? resolveMenuWidth(menuWidth, layerViewportInset.maxInlineSizeFallback) : null;
|
|
567
571
|
const popoverXstyle = resolvedMenuWidth ? resolvedMenuWidth.property === 'inlineSize' ? flyoutStyles.popoverCustomIntrinsicWidth(resolvedMenuWidth.value) : flyoutStyles.popoverCustomWidth(resolvedMenuWidth.value) : flyoutStyles.popover;
|
|
568
|
-
const
|
|
572
|
+
const nestedRows = /*#__PURE__*/_jsxs(DropdownMenuContext, {
|
|
569
573
|
value: nestedMenuContext,
|
|
570
574
|
children: [isDrillIn && /*#__PURE__*/_jsx(DropdownMenuItem, {
|
|
571
575
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
@@ -581,6 +585,13 @@ export function DropdownMenuSubMenu(props) {
|
|
|
581
585
|
})
|
|
582
586
|
}), children]
|
|
583
587
|
});
|
|
588
|
+
// Nested rows live in this level's flyout, a layer of their own where the
|
|
589
|
+
// layer-scoped signal resets; re-provide it so their pending hover intent
|
|
590
|
+
// dies with the root menu too.
|
|
591
|
+
const nestedContent = /*#__PURE__*/_jsx(DropdownMenuRootOpenContext, {
|
|
592
|
+
value: isRootMenuOpen,
|
|
593
|
+
children: nestedRows
|
|
594
|
+
});
|
|
584
595
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
585
596
|
children: [/*#__PURE__*/_jsx(Item
|
|
586
597
|
// Host attributes and handlers first: the row's role, tab stop, popup
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file lazyMenuBottomSheet.ts
|
|
3
|
+
* @input Uses React lazy and Suspense, useIsHydrating, MenuBottomSheet, and
|
|
4
|
+
* MenuBottomSheetActionList
|
|
5
|
+
* @output Exports MenuBottomSheet and MenuBottomSheetActionList wrappers that
|
|
6
|
+
* load the touch sheet on first render
|
|
7
|
+
* @position Internal to DropdownMenu
|
|
8
|
+
*
|
|
9
|
+
* The touch sheet (BottomSheet, its gestures, and the touch action list) only
|
|
10
|
+
* renders for the bottom-sheet presentation. Loading it on demand keeps it out
|
|
11
|
+
* of pages whose dropdowns only open as anchored popovers. Each wrapper keeps
|
|
12
|
+
* the wrapped component's props and renders nothing until its module loads.
|
|
13
|
+
*
|
|
14
|
+
* Neither wrapper renders on the server or in the render that hydrates server
|
|
15
|
+
* HTML (spec:AST-013 FR9): a lazy component that has not loaded yet would
|
|
16
|
+
* leave server markup incomplete and abort hydration. The closed sheet has no
|
|
17
|
+
* visible markup, so it first renders right after hydration.
|
|
18
|
+
*/
|
|
19
|
+
import { type ComponentProps, type ReactElement } from 'react';
|
|
20
|
+
import type { MenuBottomSheet as EagerMenuBottomSheet } from './MenuBottomSheet';
|
|
21
|
+
import type { MenuBottomSheetActionList as EagerMenuBottomSheetActionList } from './MenuBottomSheetActionList';
|
|
22
|
+
export declare function MenuBottomSheet(props: ComponentProps<typeof EagerMenuBottomSheet>): ReactElement | null;
|
|
23
|
+
export declare function MenuBottomSheetActionList(props: ComponentProps<typeof EagerMenuBottomSheetActionList>): ReactElement | null;
|
|
24
|
+
//# sourceMappingURL=lazyMenuBottomSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazyMenuBottomSheet.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/lazyMenuBottomSheet.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,eAAe,IAAI,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAC/E,OAAO,KAAK,EAAC,yBAAyB,IAAI,8BAA8B,EAAC,MAAM,6BAA6B,CAAC;AAc7G,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,CAAC,OAAO,oBAAoB,CAAC,GACjD,YAAY,GAAG,IAAI,CASrB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,cAAc,CAAC,OAAO,8BAA8B,CAAC,GAC3D,YAAY,GAAG,IAAI,CASrB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file lazyMenuBottomSheet.ts
|
|
7
|
+
* @input Uses React lazy and Suspense, useIsHydrating, MenuBottomSheet, and
|
|
8
|
+
* MenuBottomSheetActionList
|
|
9
|
+
* @output Exports MenuBottomSheet and MenuBottomSheetActionList wrappers that
|
|
10
|
+
* load the touch sheet on first render
|
|
11
|
+
* @position Internal to DropdownMenu
|
|
12
|
+
*
|
|
13
|
+
* The touch sheet (BottomSheet, its gestures, and the touch action list) only
|
|
14
|
+
* renders for the bottom-sheet presentation. Loading it on demand keeps it out
|
|
15
|
+
* of pages whose dropdowns only open as anchored popovers. Each wrapper keeps
|
|
16
|
+
* the wrapped component's props and renders nothing until its module loads.
|
|
17
|
+
*
|
|
18
|
+
* Neither wrapper renders on the server or in the render that hydrates server
|
|
19
|
+
* HTML (spec:AST-013 FR9): a lazy component that has not loaded yet would
|
|
20
|
+
* leave server markup incomplete and abort hydration. The closed sheet has no
|
|
21
|
+
* visible markup, so it first renders right after hydration.
|
|
22
|
+
*/
|
|
23
|
+
import { createElement, lazy, Suspense } from 'react';
|
|
24
|
+
import { useIsHydrating } from "../hooks/useIsHydrating.js";
|
|
25
|
+
const LazyMenuBottomSheet = /*#__PURE__*/lazy(async () => import("./MenuBottomSheet.js").then(module => ({
|
|
26
|
+
default: module.MenuBottomSheet
|
|
27
|
+
})));
|
|
28
|
+
const LazyMenuBottomSheetActionList = /*#__PURE__*/lazy(async () => import("./MenuBottomSheetActionList.js").then(module => ({
|
|
29
|
+
default: module.MenuBottomSheetActionList
|
|
30
|
+
})));
|
|
31
|
+
export function MenuBottomSheet(props) {
|
|
32
|
+
if (useIsHydrating()) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return /*#__PURE__*/createElement(Suspense, {
|
|
36
|
+
fallback: null
|
|
37
|
+
}, /*#__PURE__*/createElement(LazyMenuBottomSheet, props));
|
|
38
|
+
}
|
|
39
|
+
export function MenuBottomSheetActionList(props) {
|
|
40
|
+
if (useIsHydrating()) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/createElement(Suspense, {
|
|
44
|
+
fallback: null
|
|
45
|
+
}, /*#__PURE__*/createElement(LazyMenuBottomSheetActionList, props));
|
|
46
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAgB,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../src/EmptyState/EmptyState.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAgB,MAAM,OAAO,CAAC;AAQpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA4D5C,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAChE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAgB,EAChB,SAAiB,EACjB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BAoDjB;yBAhEe,UAAU"}
|
|
@@ -18,7 +18,7 @@ import { createElement } from 'react';
|
|
|
18
18
|
import * as stylex from '@stylexjs/stylex';
|
|
19
19
|
import "../theme/tokens.stylex.js";
|
|
20
20
|
import { colorVars, spacingVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
21
|
-
import { mergeProps } from "../utils/index.js";
|
|
21
|
+
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
22
22
|
import { themeProps } from "../utils/themeProps.js";
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
const styles = {
|
|
@@ -82,7 +82,7 @@ export function EmptyState({
|
|
|
82
82
|
...mergeProps(themeProps('empty-state', {
|
|
83
83
|
variant: isCompact ? 'compact' : null
|
|
84
84
|
}), stylex.props(styles.container, isCompact && styles.containerCompact, xstyle), className, style),
|
|
85
|
-
children: [icon
|
|
85
|
+
children: [isRenderable(icon) && /*#__PURE__*/_jsx("div", {
|
|
86
86
|
"aria-hidden": "true",
|
|
87
87
|
children: icon
|
|
88
88
|
}), /*#__PURE__*/_jsxs("div", {
|
|
@@ -98,13 +98,7 @@ export function EmptyState({
|
|
|
98
98
|
1: {
|
|
99
99
|
className: "x1ghz6dp xjb2p0i x2mo6ok xf74fhv x1tgivj0 xcr08ib"
|
|
100
100
|
}
|
|
101
|
-
}[!!isCompact << 0]), title), description
|
|
102
|
-
/*#__PURE__*/
|
|
103
|
-
// Rendered as <div> (not <p>): description accepts ReactNode and a
|
|
104
|
-
// <p> cannot legally contain block children, which causes hydration
|
|
105
|
-
// mismatches. The StyleX style sets margin: 0, so appearance is
|
|
106
|
-
// unchanged.
|
|
107
|
-
_jsx("div", {
|
|
101
|
+
}[!!isCompact << 0]), title), isRenderable(description) && /*#__PURE__*/_jsx("div", {
|
|
108
102
|
...mergeProps(themeProps('empty-state-description', {
|
|
109
103
|
variant: isCompact ? 'compact' : null
|
|
110
104
|
}), {
|
|
@@ -117,7 +111,7 @@ export function EmptyState({
|
|
|
117
111
|
}[!!isCompact << 0]),
|
|
118
112
|
children: description
|
|
119
113
|
})]
|
|
120
|
-
}), actions
|
|
114
|
+
}), isRenderable(actions) && /*#__PURE__*/_jsx("div", {
|
|
121
115
|
...{
|
|
122
116
|
0: {
|
|
123
117
|
className: "x78zum5 x1q0g3np x6s0dn4 x1txdalj xcsaf9d"
|
package/dist/Field/Field.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Field.tsx
|
|
3
|
-
* @input Uses React,
|
|
3
|
+
* @input Uses React, StyleX, BaseProps, FieldLabel/FieldStatus, FormLayoutContext, Text, VisuallyHidden, theme/status utilities
|
|
4
4
|
* @output Exports Field component, FieldProps
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by Field.test.tsx
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAM,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/Field/Field.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAM,MAAM,OAAO,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAGnE,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AA+DtC,YAAY,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,CACX;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,OAAO,EACP,OAAO,EACP,YAAoB,EACpB,aAAa,EACb,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAAS,EACT,MAAM,EACN,YAAY,EACZ,aAA0B,EAC1B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,UAAU,+BA0HZ;yBAhJe,KAAK"}
|
package/dist/Field/Field.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Field.tsx
|
|
7
|
-
* @input Uses React,
|
|
7
|
+
* @input Uses React, StyleX, BaseProps, FieldLabel/FieldStatus, FormLayoutContext, Text, VisuallyHidden, theme/status utilities
|
|
8
8
|
* @output Exports Field component, FieldProps
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by Field.test.tsx
|
|
10
10
|
*
|
|
@@ -26,6 +26,7 @@ import { mergeProps } from "../utils/index.js";
|
|
|
26
26
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
27
27
|
import { FormLayoutContext } from "../FormLayout/FormLayoutContext.js";
|
|
28
28
|
import { Text } from "../Text/index.js";
|
|
29
|
+
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
29
30
|
import { themeProps } from "../utils/themeProps.js";
|
|
30
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
32
|
const styles = {
|
|
@@ -140,10 +141,10 @@ export function Field({
|
|
|
140
141
|
if (isHorizontalLabels) {
|
|
141
142
|
return /*#__PURE__*/_jsxs("div", {
|
|
142
143
|
ref: ref,
|
|
144
|
+
...props,
|
|
143
145
|
...mergeProps(themeProps('field', {
|
|
144
146
|
layout: 'horizontal-labels'
|
|
145
147
|
}), stylex.props(styles.horizontalLabels, xstyle), className, style),
|
|
146
|
-
...props,
|
|
147
148
|
children: [/*#__PURE__*/_jsx("div", {
|
|
148
149
|
...{
|
|
149
150
|
className: "x1enrzb7"
|
|
@@ -153,12 +154,15 @@ export function Field({
|
|
|
153
154
|
...{
|
|
154
155
|
className: "x78zum5 xdt5ytf xc8icb0 x19nvjgn xlumz0n x1qs65gq"
|
|
155
156
|
},
|
|
156
|
-
children: [description && /*#__PURE__*/_jsx(
|
|
157
|
+
children: [description && (isLabelHidden ? /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
158
|
+
id: resolvedDescriptionID,
|
|
159
|
+
children: description
|
|
160
|
+
}) : /*#__PURE__*/_jsx(Text, {
|
|
157
161
|
type: "supporting",
|
|
158
162
|
display: "block",
|
|
159
163
|
id: resolvedDescriptionID,
|
|
160
164
|
children: description
|
|
161
|
-
}), children, statusNode]
|
|
165
|
+
})), children, statusNode]
|
|
162
166
|
})]
|
|
163
167
|
});
|
|
164
168
|
}
|
|
@@ -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
|
/**
|