@astryxdesign/core 0.7.1 → 0.7.2-canary.020e1fe
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/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/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +5 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +38 -14
- 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/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/Drawer/Drawer.d.ts +191 -0
- package/dist/Drawer/Drawer.d.ts.map +1 -0
- package/dist/Drawer/Drawer.js +382 -0
- package/dist/Drawer/DrawerHeader.d.ts +85 -0
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -0
- package/dist/Drawer/DrawerHeader.js +134 -0
- package/dist/Drawer/index.d.ts +11 -0
- package/dist/Drawer/index.d.ts.map +1 -0
- package/dist/Drawer/index.js +11 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts +42 -0
- package/dist/Drawer/useDrawerDialogPresence.d.ts.map +1 -0
- package/dist/Drawer/useDrawerDialogPresence.js +236 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +83 -11
- 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/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +19 -8
- 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/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/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/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -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/Layer/layerViewportInset.stylex.d.ts +6 -2
- package/dist/Layer/layerViewportInset.stylex.d.ts.map +1 -1
- package/dist/Layer/layerViewportInset.stylex.js +6 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +13 -7
- package/dist/Layer/useLayerDismissal.d.ts +1 -1
- package/dist/Layer/useLayerDismissal.js +1 -1
- package/dist/Layout/container.stylex.d.ts +5 -5
- package/dist/Layout/container.stylex.js +4 -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/plugins/frontmatter.d.ts.map +1 -1
- package/dist/Markdown/plugins/frontmatter.js +7 -3
- 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/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +22 -8
- package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +100 -2
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +3 -1
- package/dist/Pagination/Pagination.d.ts +8 -5
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +21 -8
- package/dist/Popover/Popover.js +2 -2
- package/dist/PowerSearch/PowerSearch.js +1 -1
- 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/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +6 -2
- package/dist/SideNav/SideNavItem.d.ts +8 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +71 -9
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +13 -1
- package/dist/TabList/TabMenu.d.ts +2 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +6 -3
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +4 -2
- package/dist/Text/useTruncation.d.ts +7 -5
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +16 -5
- 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/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +11 -0
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +3 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +3 -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/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -0
- package/dist/astryx.css +47 -13
- package/dist/hooks/useEntryAnimation.d.ts +2 -1
- package/dist/hooks/useEntryAnimation.d.ts.map +1 -1
- package/dist/hooks/useEntryAnimation.js +14 -12
- package/dist/hooks/useIsHydrating.d.ts +6 -0
- package/dist/hooks/useIsHydrating.d.ts.map +1 -0
- package/dist/hooks/useIsHydrating.js +30 -0
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +18 -13
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +112 -1
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +112 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +0 -3
- package/dist/utils/focusOutline.stylex.d.ts +4 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +4 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +15 -9
- package/dist/utils/sharedMutationObserver.d.ts +21 -0
- package/dist/utils/sharedMutationObserver.d.ts.map +1 -0
- package/dist/utils/sharedMutationObserver.js +69 -0
- package/locales/en.json +444 -0
- package/locales/pseudo.json +333 -0
- package/package.json +9 -4
- package/scripts/agent-doc-state.mjs +38 -0
- package/scripts/postinstall.mjs +1 -1
- 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/AvatarGroup/AvatarGroup.doc.mjs +3 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +4 -1
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +30 -1
- package/src/Button/Button.doc.mjs +2 -2
- package/src/Button/Button.test.tsx +155 -9
- package/src/Button/Button.tsx +39 -16
- package/src/Button/__tests__/Button.a11y.known-failures.ts +1 -62
- package/src/Button/__tests__/Button.a11y.states.ts +0 -10
- package/src/Card/Card.doc.mjs +1 -1
- 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.test.tsx +22 -0
- 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.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 +473 -0
- package/src/Drawer/Drawer.spec.md +357 -0
- package/src/Drawer/Drawer.test.tsx +1300 -0
- package/src/Drawer/Drawer.tsx +613 -0
- package/src/Drawer/DrawerDirection.test.tsx +127 -0
- package/src/Drawer/DrawerHeader.doc.mjs +293 -0
- package/src/Drawer/DrawerHeader.test.tsx +102 -0
- package/src/Drawer/DrawerHeader.tsx +235 -0
- package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +401 -0
- package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +297 -0
- package/src/Drawer/index.ts +13 -0
- package/src/Drawer/useDrawerDialogPresence.ts +284 -0
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +57 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +79 -18
- package/src/DropdownMenu/DropdownMenu.tsx +83 -12
- 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/DropdownMenuSubMenu.test.tsx +185 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +19 -5
- 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__/Menu.a11y.chromium.spec.ts +145 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.known-failures.ts +26 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.renders.tsx +65 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.states.ts +138 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.test.tsx +136 -0
- package/src/DropdownMenu/__tests__/warmMenuBottomSheet.tsx +43 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +71 -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/Grid/GridSpan.tsx +3 -0
- package/src/Heading/Heading.test.tsx +57 -0
- package/src/Heading/Heading.tsx +6 -2
- package/src/HoverCard/HoverCard.test.tsx +58 -0
- package/src/HoverCard/useHoverCard.tsx +10 -2
- package/src/Icon/Icon.doc.mjs +36 -0
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/IconButton/IconButton.test.tsx +3 -1
- package/src/Item/Item.doc.mjs +12 -8
- package/src/Item/Item.spec.md +226 -0
- package/src/Item/Item.test.tsx +61 -0
- package/src/Item/Item.tsx +40 -4
- package/src/Layer/layerViewportInset.source-build.test.mjs +90 -0
- package/src/Layer/layerViewportInset.stylex.ts +6 -2
- package/src/Layer/layerViewportInset.test.ts +1 -0
- package/src/Layer/useLayer.tsx +24 -13
- package/src/Layer/useLayerDismissal.ts +1 -1
- package/src/Layout/LayoutHeader.doc.mjs +5 -0
- package/src/Layout/container.stylex.ts +6 -6
- 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 +24 -5
- package/src/List/ListItem.tsx +56 -27
- package/src/List/index.ts +1 -1
- package/src/Markdown/Markdown.tsx +14 -1
- package/src/Markdown/plugins/frontmatter.test.tsx +25 -0
- package/src/Markdown/plugins/frontmatter.ts +7 -3
- 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/MultiSelector/MultiSelector.test.tsx +159 -0
- package/src/MultiSelector/MultiSelector.tsx +40 -7
- package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +112 -2
- package/src/MultiSelector/hooks.ts +3 -1
- package/src/MultiSelector/useMultiCombobox.doc.mjs +267 -0
- package/src/Pagination/Pagination.doc.mjs +7 -7
- package/src/Pagination/Pagination.spec.md +9 -9
- package/src/Pagination/Pagination.test.tsx +242 -0
- package/src/Pagination/Pagination.tsx +27 -11
- package/src/Popover/Popover.test.tsx +2 -2
- package/src/Popover/Popover.tsx +4 -4
- package/src/PowerSearch/PowerSearch.test.tsx +85 -0
- package/src/PowerSearch/PowerSearch.tsx +2 -2
- 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/Selector/hooks.ts +6 -2
- package/src/Selector/useCombobox.doc.mjs +237 -0
- package/src/SideNav/SideNav.spec.md +227 -0
- package/src/SideNav/SideNav.test.tsx +179 -0
- package/src/SideNav/SideNavItem.doc.mjs +2 -2
- package/src/SideNav/SideNavItem.tsx +96 -17
- package/src/Slider/Slider.spec.md +39 -18
- package/src/Spinner/Spinner.doc.mjs +1 -1
- package/src/Switch/Switch.test.tsx +49 -0
- package/src/Switch/Switch.tsx +11 -0
- package/src/TabList/TabList.spec.md +57 -44
- package/src/TabList/TabList.test.tsx +67 -0
- package/src/TabList/TabMenu.doc.mjs +4 -3
- package/src/TabList/TabMenu.tsx +7 -4
- package/src/Text/Text.test.tsx +57 -0
- package/src/Text/Text.tsx +6 -2
- package/src/Text/useTruncation.test.tsx +69 -0
- package/src/Text/useTruncation.ts +16 -5
- 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/Tokenizer/Tokenizer.test.tsx +54 -1
- 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/Tooltip/Tooltip.test.tsx +31 -0
- package/src/Tooltip/useTooltip.test.tsx +13 -0
- package/src/Tooltip/useTooltip.tsx +11 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +22 -0
- package/src/TopNav/TopNavMegaMenu.tsx +7 -3
- package/src/TopNav/TopNavMenu.test.tsx +19 -0
- package/src/TopNav/TopNavMenu.tsx +11 -3
- package/src/TreeList/TreeList.doc.mjs +1 -0
- package/src/TreeList/TreeList.spec.md +29 -17
- 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/Typeahead/BaseTypeahead.tsx +26 -0
- package/src/Typeahead/Typeahead.test.tsx +260 -2
- package/src/docPropLiterals.test.ts +36 -10
- package/src/hooks/useEntryAnimation.doc.mjs +4 -4
- package/src/hooks/useEntryAnimation.ssr.test.tsx +143 -0
- package/src/hooks/useEntryAnimation.ts +15 -16
- package/src/hooks/useIsHydrating.test.tsx +70 -0
- package/src/hooks/useIsHydrating.ts +31 -0
- package/src/hooks/useMenuHover.ts +18 -13
- package/src/i18n/InternationalizationProvider.doc.mjs +8 -0
- package/src/i18n/InternationalizationProvider.spec.md +252 -0
- package/src/i18n/__tests__/InternationalizationProvider.test.tsx +128 -0
- package/src/i18n/generated-locales/en.generated.ts +121 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +121 -0
- package/src/i18n/useTranslator.test.tsx +37 -0
- package/src/index.ts +1 -0
- package/src/postinstall.test.mjs +46 -0
- package/src/reset.css +0 -29
- package/src/theme/derivedVarRegistry.test.ts +7 -3
- package/src/theme/derivedVarRegistry.ts +0 -3
- package/src/utils/focusOutline.stylex.ts +4 -0
- package/src/utils/plainDate.test.ts +37 -1
- package/src/utils/plainDate.ts +15 -5
- package/src/utils/sharedMutationObserver.test.ts +53 -0
- package/src/utils/sharedMutationObserver.ts +78 -0
package/dist/Heading/Heading.js
CHANGED
|
@@ -105,9 +105,11 @@ export function Heading({
|
|
|
105
105
|
// the closed built-in StyleX maps with an unknown name.
|
|
106
106
|
const builtinType = type && isBuiltinHeadingType(type) ? type : undefined;
|
|
107
107
|
|
|
108
|
-
// Truncation detection
|
|
108
|
+
// Truncation detection. Only the tooltip reads the measured overflow, so
|
|
109
|
+
// with the tooltip off the text is clipped by CSS alone and nothing is
|
|
110
|
+
// measured or observed.
|
|
109
111
|
const truncation = useTruncation({
|
|
110
|
-
maxLines
|
|
112
|
+
maxLines: hasTruncateTooltip === false ? 0 : maxLines
|
|
111
113
|
});
|
|
112
114
|
|
|
113
115
|
// Tooltip for truncated text
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mB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AKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,GAAG,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAE9B;;;OAGG;IACH,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEtC;;;;OAIG;IACH,cAAc,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IAEzC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;;OAOG;IACH,eAAe,EAAE,CACf,QAAQ,EAAE,SAAS,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,KAC5C,SAAS,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CAyc5E"}
|
|
@@ -145,6 +145,14 @@ export function useHoverCard(options = {}) {
|
|
|
145
145
|
isHoveringContentRef.current = false;
|
|
146
146
|
hideLayer();
|
|
147
147
|
}, [clearTimeouts, hideLayer]);
|
|
148
|
+
|
|
149
|
+
// The imperative hide. A card closed while the pointer rests on it unmounts
|
|
150
|
+
// without a mouseleave, so the content-hover latch is cleared here; left set,
|
|
151
|
+
// it would keep the trigger's next hover-open from closing on leave.
|
|
152
|
+
const hide = useCallback(() => {
|
|
153
|
+
isHoveringContentRef.current = false;
|
|
154
|
+
hideLayer();
|
|
155
|
+
}, [hideLayer]);
|
|
148
156
|
const {
|
|
149
157
|
isTouchPointerRef,
|
|
150
158
|
isTouchInteraction,
|
|
@@ -291,7 +299,7 @@ export function useHoverCard(options = {}) {
|
|
|
291
299
|
// clear it.
|
|
292
300
|
const card = typeof document === 'undefined' ? null : document.getElementById(layerId);
|
|
293
301
|
const hadFocus = card?.contains(document.activeElement) ?? false;
|
|
294
|
-
|
|
302
|
+
hide();
|
|
295
303
|
if (hadFocus) {
|
|
296
304
|
isEscapeDismissingRef.current = true;
|
|
297
305
|
triggerRef.current?.focus();
|
|
@@ -448,6 +456,6 @@ export function useHoverCard(options = {}) {
|
|
|
448
456
|
isOpen: isLayerOpen,
|
|
449
457
|
renderHoverCard,
|
|
450
458
|
show: showLayer,
|
|
451
|
-
hide
|
|
459
|
+
hide
|
|
452
460
|
};
|
|
453
461
|
}
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { type ReactNode } from 'react';
|
|
24
24
|
import type { BaseProps } from '../BaseProps';
|
|
25
|
-
export type ItemAlign = 'center' | 'start';
|
|
25
|
+
export type ItemAlign = 'center' | 'start' | 'first-line';
|
|
26
26
|
export type ItemDensity = 'compact' | 'balanced' | 'spacious';
|
|
27
27
|
/**
|
|
28
28
|
* How a swipe action looks: ordinary, the one you mean, the dangerous one.
|
|
@@ -111,7 +111,11 @@ export interface ItemProps extends BaseProps<HTMLElement> {
|
|
|
111
111
|
*/
|
|
112
112
|
endContent?: ReactNode;
|
|
113
113
|
/**
|
|
114
|
-
* Vertical alignment of the start/end content slots.
|
|
114
|
+
* Vertical alignment of the start/end content slots. `center` centers each
|
|
115
|
+
* slot on the whole text block; `start` lines up slot tops with the text's
|
|
116
|
+
* top; `first-line` centers each slot on the label's first line, so a small
|
|
117
|
+
* mark (a status dot, a radio, a timestamp) stays level with the first line
|
|
118
|
+
* of a wrapped label. A slot taller than that line moves the text down.
|
|
115
119
|
* @default 'center'
|
|
116
120
|
*/
|
|
117
121
|
align?: ItemAlign;
|
package/dist/Item/Item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyB5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1E,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,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,KAAK,IAAI,CAAC;IAE5C;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAErD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAEhC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA+OD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,EACnB,EAAE,EAAE,SAAiB,EACrB,MAAM,EACN,YAAY,EACZ,KAAK,EACL,WAAW,EACX,UAAU,EACV,KAAgB,EAChB,OAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,MAAkB,EAClB,OAAO,EACP,cAAc,EACd,IAAI,EACJ,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,YAAY,EACjB,aAAqB,EACrB,UAAkB,EAClB,UAAkB,EAClB,YAAY,EACZ,aAAwB,EACxB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,SAAS,EACb,EAAE,SAAS,+BA8UX;yBA1We,IAAI"}
|
package/dist/Item/Item.js
CHANGED
|
@@ -108,6 +108,10 @@ const styles = {
|
|
|
108
108
|
kGNEyG: "x1cy8zhl",
|
|
109
109
|
$$css: true
|
|
110
110
|
},
|
|
111
|
+
alignFirstLine: {
|
|
112
|
+
kGNEyG: "x1pha0wt",
|
|
113
|
+
$$css: true
|
|
114
|
+
},
|
|
111
115
|
interactive: {
|
|
112
116
|
kkrTdU: "x1ypdohk x16khyan",
|
|
113
117
|
k1ekBW: "x15406qy",
|
|
@@ -359,8 +363,13 @@ export function Item({
|
|
|
359
363
|
const innerContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
360
364
|
children: [marker, startContent != null && /*#__PURE__*/_jsx("span", {
|
|
361
365
|
...{
|
|
362
|
-
|
|
363
|
-
|
|
366
|
+
0: {
|
|
367
|
+
className: "x3psx0u x78zum5"
|
|
368
|
+
},
|
|
369
|
+
1: {
|
|
370
|
+
className: "x3psx0u x78zum5 x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp"
|
|
371
|
+
}
|
|
372
|
+
}[!!(align === 'first-line') << 0],
|
|
364
373
|
children: startContent
|
|
365
374
|
}), hasParentRole || isDelegate ?
|
|
366
375
|
/*#__PURE__*/
|
|
@@ -444,10 +453,16 @@ export function Item({
|
|
|
444
453
|
0: {
|
|
445
454
|
className: "x3psx0u x78zum5 xvc5jky"
|
|
446
455
|
},
|
|
456
|
+
2: {
|
|
457
|
+
className: "x3psx0u x78zum5 xvc5jky x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp"
|
|
458
|
+
},
|
|
447
459
|
1: {
|
|
448
460
|
className: "x3psx0u x78zum5 xvc5jky xbyyjgo"
|
|
461
|
+
},
|
|
462
|
+
3: {
|
|
463
|
+
className: "x3psx0u x78zum5 xvc5jky x6s0dn4 x4jt1l0 xk9ib7f x1xb3ux x1899uy6 x1xcinxp xbyyjgo"
|
|
449
464
|
}
|
|
450
|
-
}[!!isDisabled << 0],
|
|
465
|
+
}[!!(align === 'first-line') << 1 | !!isDisabled << 0],
|
|
451
466
|
children: endContent
|
|
452
467
|
})]
|
|
453
468
|
});
|
|
@@ -494,7 +509,7 @@ export function Item({
|
|
|
494
509
|
...mergeProps(themeProps('item', {
|
|
495
510
|
density,
|
|
496
511
|
align
|
|
497
|
-
}), focusOutlineProps.focusWithin(styles.root, densityStyles[density], align === 'start' && styles.alignStart, isInteractive && styles.interactive, isInteractive && interactionOverlayStyles.backgroundColor, isLinkRoot && styles.linkRoot, isHighlighted && styles.highlighted, isSelected && styles.selected, isDisabled && !hasParentRole && styles.disabled, hasSwipe && styles.swipeRoot, xstyle), className, style),
|
|
512
|
+
}), focusOutlineProps.focusWithin(styles.root, densityStyles[density], align === 'start' && styles.alignStart, align === 'first-line' && styles.alignFirstLine, isInteractive && styles.interactive, isInteractive && interactionOverlayStyles.backgroundColor, isLinkRoot && styles.linkRoot, isHighlighted && styles.highlighted, isSelected && styles.selected, isDisabled && !hasParentRole && styles.disabled, hasSwipe && styles.swipeRoot, xstyle), className, style),
|
|
498
513
|
role: role,
|
|
499
514
|
onClick: rootOnClick,
|
|
500
515
|
children: [/*#__PURE__*/_jsx(ItemDescriptionContext, {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The viewport gutter and the caps derived from it. Every value has an
|
|
3
|
-
* `env()`-less fallback for engines without safe-area support; pair them
|
|
4
|
-
* `stylex.firstThatWorks(cap
|
|
3
|
+
* `env()`-less fallback for engines without safe-area support; pair them as
|
|
4
|
+
* `stylex.firstThatWorks(`calc(${cap})`, `calc(${capFallback})`)`. Pass
|
|
5
|
+
* each inside a `calc()` (or another function), never as a bare reference: a
|
|
6
|
+
* constant reference compiles to a `var()`, and `firstThatWorks` folds two
|
|
7
|
+
* `var()` arguments into one `var(cap, capFallback)` whose constant is never
|
|
8
|
+
* inlined, so every engine would take the fallback.
|
|
5
9
|
*/
|
|
6
10
|
export declare const layerViewportInset: {
|
|
7
11
|
/** Gutter from the block-start viewport edge. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layerViewportInset.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerViewportInset.stylex.ts"],"names":[],"mappings":"AAwDA
|
|
1
|
+
{"version":3,"file":"layerViewportInset.stylex.d.ts","sourceRoot":"","sources":["../../src/Layer/layerViewportInset.stylex.ts"],"names":[],"mappings":"AAwDA;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB;IAC7B,iDAAiD;;IAEjD,+CAA+C;;IAE/C,+CAA+C;;IAE/C,gFAAgF;;;;;;IAMhF,iFAAiF;;;IAGjF,gFAAgF;;;CAGhF,CAAC"}
|
|
@@ -54,8 +54,12 @@ const GUTTER_BLOCK = `calc(max(${SPACING}, env(safe-area-inset-top, 0px), env(sa
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* The viewport gutter and the caps derived from it. Every value has an
|
|
57
|
-
* `env()`-less fallback for engines without safe-area support; pair them
|
|
58
|
-
* `stylex.firstThatWorks(cap
|
|
57
|
+
* `env()`-less fallback for engines without safe-area support; pair them as
|
|
58
|
+
* `stylex.firstThatWorks(`calc(${cap})`, `calc(${capFallback})`)`. Pass
|
|
59
|
+
* each inside a `calc()` (or another function), never as a bare reference: a
|
|
60
|
+
* constant reference compiles to a `var()`, and `firstThatWorks` folds two
|
|
61
|
+
* `var()` arguments into one `var(cap, capFallback)` whose constant is never
|
|
62
|
+
* inlined, so every engine would take the fallback.
|
|
59
63
|
*/
|
|
60
64
|
export const layerViewportInset = {
|
|
61
65
|
gutterBlockStart: "calc(max(var(--spacing-4), env(safe-area-inset-top, 0px)) + var(--astryx-layer-inset-block-start, 0px))",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources":["../../src/Layer/useLayer.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLayer.d.ts","sourceRoot":"","sources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B,wBAAwB,CAAC"}
|
package/dist/Layer/useLayer.js
CHANGED
|
@@ -104,24 +104,24 @@ const styles = {
|
|
|
104
104
|
},
|
|
105
105
|
viewportFit: {
|
|
106
106
|
kB7OPa: "x9f619",
|
|
107
|
-
ks0D6T: "
|
|
108
|
-
kskxy: "
|
|
107
|
+
ks0D6T: "xc0b1yq",
|
|
108
|
+
kskxy: "x3v4n1",
|
|
109
109
|
$$css: true
|
|
110
110
|
},
|
|
111
111
|
gutterInlineEnd: {
|
|
112
|
-
k71WvV: "
|
|
112
|
+
k71WvV: "x144kxal",
|
|
113
113
|
$$css: true
|
|
114
114
|
},
|
|
115
115
|
gutterInlineStart: {
|
|
116
|
-
keTefX: "
|
|
116
|
+
keTefX: "xpdk1p0",
|
|
117
117
|
$$css: true
|
|
118
118
|
},
|
|
119
119
|
gutterBlockEnd: {
|
|
120
|
-
k1K539: "
|
|
120
|
+
k1K539: "x3z50q0",
|
|
121
121
|
$$css: true
|
|
122
122
|
},
|
|
123
123
|
gutterBlockStart: {
|
|
124
|
-
keoZOQ: "
|
|
124
|
+
keoZOQ: "x1j6tnbc",
|
|
125
125
|
$$css: true
|
|
126
126
|
}
|
|
127
127
|
};
|
|
@@ -464,8 +464,14 @@ function useLayerImplementation(options) {
|
|
|
464
464
|
// hosted away from its trigger then still takes its sequential focus
|
|
465
465
|
// order (and its popover nesting) from the trigger rather than from
|
|
466
466
|
// its own DOM position. Browsers without the option ignore it.
|
|
467
|
+
// `source` is declared as an `HTMLElement`. A caller-rendered icon
|
|
468
|
+
// trigger is an `SVGElement`, whose dictionary conversion throws
|
|
469
|
+
// before the popover opens. Omitting the option for it still anchors
|
|
470
|
+
// the layer, because positioning reads the anchor-name pair, and only
|
|
471
|
+
// gives up the invoker's focus order.
|
|
472
|
+
const trigger = triggerRef.current instanceof HTMLElement ? triggerRef.current : undefined;
|
|
467
473
|
popover.showPopover({
|
|
468
|
-
source:
|
|
474
|
+
source: trigger
|
|
469
475
|
});
|
|
470
476
|
});
|
|
471
477
|
} else {
|
|
@@ -68,7 +68,7 @@ export interface UseLayerDismissalReturn {
|
|
|
68
68
|
* routes each Escape press to the top-most REGISTERED layer, so one press
|
|
69
69
|
* dismisses exactly one of them. Dialog (and what is built on it, including
|
|
70
70
|
* CommandPalette), Popover and the menus built on it, ContextMenu, Tooltip,
|
|
71
|
-
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
71
|
+
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
72
72
|
* `Drawer` register today.
|
|
73
73
|
*
|
|
74
74
|
* `DropdownMenuSubMenu` and `PowerSearchEditPopover` still run their own Escape
|
|
@@ -25,7 +25,7 @@ import { isTextComposing, isTopmostLayer, registerLayer } from "./layerStack.js"
|
|
|
25
25
|
* routes each Escape press to the top-most REGISTERED layer, so one press
|
|
26
26
|
* dismisses exactly one of them. Dialog (and what is built on it, including
|
|
27
27
|
* CommandPalette), Popover and the menus built on it, ContextMenu, Tooltip,
|
|
28
|
-
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
28
|
+
* HoverCard, Lightbox, MobileNav, BottomSheet, BottomSheetSwitcher and
|
|
29
29
|
* `Drawer` register today.
|
|
30
30
|
*
|
|
31
31
|
* `DropdownMenuSubMenu` and `PowerSearchEditPopover` still run their own Escape
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @file container.stylex.ts
|
|
3
3
|
* @input Uses @stylexjs/stylex, spacing from theme
|
|
4
4
|
* @output StyleX utility for layout container styling
|
|
5
|
-
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
6
|
-
*
|
|
5
|
+
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
6
|
+
* Drawer
|
|
7
7
|
*
|
|
8
8
|
* ## Public API for themes
|
|
9
9
|
*
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* --astryx-card-padding-block-end
|
|
18
18
|
*
|
|
19
19
|
* Read order per level: `var(--astryx-…, <next level>)`, terminating at
|
|
20
|
-
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
20
|
+
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
21
21
|
* drawer.
|
|
22
22
|
*
|
|
23
23
|
* ```ts
|
|
@@ -221,8 +221,8 @@ export interface ContainerOptions {
|
|
|
221
221
|
* This allows themes to override container padding via component-specific
|
|
222
222
|
* public CSS custom properties without touching internal vars.
|
|
223
223
|
*
|
|
224
|
-
* Used by Card, Section, Dialog, BottomSheet, and
|
|
225
|
-
*
|
|
224
|
+
* Used by Card, Section, Dialog, BottomSheet, and Drawer when no explicit
|
|
225
|
+
* padding prop is provided.
|
|
226
226
|
* @default undefined (uses explicit spacing token values)
|
|
227
227
|
*/
|
|
228
228
|
useThemeDefault?: ContainerComponent;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @file container.stylex.ts
|
|
5
5
|
* @input Uses @stylexjs/stylex, spacing from theme
|
|
6
6
|
* @output StyleX utility for layout container styling
|
|
7
|
-
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
8
|
-
*
|
|
7
|
+
* @position Layout utility; used by Card, Section, Dialog, BottomSheet, and
|
|
8
|
+
* Drawer
|
|
9
9
|
*
|
|
10
10
|
* ## Public API for themes
|
|
11
11
|
*
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* --astryx-card-padding-block-end
|
|
20
20
|
*
|
|
21
21
|
* Read order per level: `var(--astryx-…, <next level>)`, terminating at
|
|
22
|
-
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
22
|
+
* `--spacing-4`. Same pattern for section, dialog, bottom-sheet, and
|
|
23
23
|
* drawer.
|
|
24
24
|
*
|
|
25
25
|
* ```ts
|
|
@@ -133,7 +133,7 @@ const bottomSheetInlineEnd = `var(--astryx-bottom-sheet-padding-inline-end, ${bo
|
|
|
133
133
|
const bottomSheetBlockStart = `var(--astryx-bottom-sheet-padding-block-start, ${bottomSheetShorthand})`;
|
|
134
134
|
const bottomSheetBlockEnd = `var(--astryx-bottom-sheet-padding-block-end, ${bottomSheetShorthand})`;
|
|
135
135
|
|
|
136
|
-
// Drawer
|
|
136
|
+
// Drawer padding chains: --astryx-* then the next specificity level,
|
|
137
137
|
// terminating at --spacing-4 like Dialog. Built as chained const strings (no
|
|
138
138
|
// function calls) so StyleX can statically analyze them; see naming.ts for the
|
|
139
139
|
// prefix policy.
|
package/dist/List/List.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file List.tsx
|
|
3
|
-
* @input Uses React, ReactNode, StyleXStyles, theme tokens,
|
|
4
|
-
* with
|
|
5
|
-
* @output Exports List component, ListProps, ListDensity, ListStyle
|
|
3
|
+
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useDevWarning,
|
|
4
|
+
* and ListContext with the row edge treatment
|
|
5
|
+
* @output Exports List component, ListProps, ListDensity, ListEdge, ListStyle
|
|
6
|
+
* types
|
|
6
7
|
* @position Core implementation; consumed by index.ts, tested by List.test.tsx
|
|
7
8
|
*
|
|
8
9
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -14,8 +15,8 @@
|
|
|
14
15
|
*/
|
|
15
16
|
import { type ReactNode } from 'react';
|
|
16
17
|
import type { BaseProps } from '../BaseProps';
|
|
17
|
-
import { type ListDensity, type ListMarkerStyle } from './ListContext';
|
|
18
|
-
export { type ListDensity, type ListMarkerStyle as ListStyle, } from './ListContext';
|
|
18
|
+
import { type ListDensity, type ListEdge, type ListMarkerStyle } from './ListContext';
|
|
19
|
+
export { type ListDensity, type ListEdge, type ListMarkerStyle as ListStyle, } from './ListContext';
|
|
19
20
|
export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement> {
|
|
20
21
|
/** Ref forwarded to the root element */
|
|
21
22
|
ref?: React.Ref<HTMLUListElement | HTMLOListElement>;
|
|
@@ -37,16 +38,38 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
37
38
|
*/
|
|
38
39
|
hasDividers?: boolean;
|
|
39
40
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
41
|
+
* Where each row's text, dividers, and hover and selection backgrounds sit,
|
|
42
|
+
* relative to the list's edges and the container around it.
|
|
43
|
+
* - 'padded': text sits inside each row's padding, so it starts a little in
|
|
44
|
+
* from a heading above the list and backgrounds have room around it
|
|
45
|
+
* - 'flush': rows drop their side padding, so text starts on the heading's
|
|
46
|
+
* line and dividers and backgrounds stop at the row's content, with no
|
|
47
|
+
* room beyond it on either side. Works anywhere. Suits static rows
|
|
48
|
+
* - 'outset': text sits on the heading's line, and dividers and backgrounds
|
|
49
|
+
* reach a little past it into the container's padding. Suits interactive
|
|
50
|
+
* rows in a container
|
|
51
|
+
* - 'bleed': text sits on the heading's line, and dividers and backgrounds
|
|
52
|
+
* reach the container's edges with square corners, like Table rows in a
|
|
53
|
+
* Card
|
|
54
|
+
*
|
|
55
|
+
* A row's first content is what lines up with the heading: its marker,
|
|
56
|
+
* icon, or avatar when it has one, otherwise its label. 'outset' and
|
|
57
|
+
* 'bleed' reach into the padding of the nearest container that shares its
|
|
58
|
+
* padding: a Card, Section, Dialog, or BottomSheet, or a transparent
|
|
59
|
+
* container such as a Layout region with explicit padding or a padded
|
|
60
|
+
* ScrollableArea. Place the List directly in that container's padding:
|
|
61
|
+
* padding that Stack, Center, or your own styles add in between is not
|
|
62
|
+
* counted. Drawers and the automatic padding of LayoutContent and
|
|
63
|
+
* LayoutPanel aren't supported yet. With no such container, including in a Popover, they look
|
|
64
|
+
* like 'padded'. In a container with less padding than the rows' own, text
|
|
65
|
+
* starts a little after the heading's line. A theme's inline padding on `item` replaces the row
|
|
66
|
+
* padding of every value, including the zero padding of 'flush'.
|
|
67
|
+
* @default 'padded'
|
|
68
|
+
*/
|
|
69
|
+
edge?: ListEdge;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Use `edge="outset"`, which this sets. Still works; `edge`
|
|
72
|
+
* wins when both are set. `astryx upgrade` rewrites existing usage.
|
|
50
73
|
*/
|
|
51
74
|
edgeCompensation?: 'inline';
|
|
52
75
|
/**
|
|
@@ -77,9 +100,10 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
77
100
|
* Renders semantic `<ul>` or `<ol>` elements with configurable density,
|
|
78
101
|
* dividers, marker styles, and an optional header.
|
|
79
102
|
*
|
|
80
|
-
* Set `
|
|
81
|
-
*
|
|
82
|
-
*
|
|
103
|
+
* Set `edge` to choose where row text, dividers, and backgrounds sit: inside
|
|
104
|
+
* each row's padding (`padded`, the default), at the list's edges (`flush`),
|
|
105
|
+
* on a heading's line with backgrounds reaching into the container's padding
|
|
106
|
+
* (`outset`), or reaching the container's edges like Table rows (`bleed`).
|
|
83
107
|
*
|
|
84
108
|
* @example
|
|
85
109
|
* ```
|
|
@@ -91,9 +115,12 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
91
115
|
* <ListItem label="First step" />
|
|
92
116
|
* <ListItem label="Second step" />
|
|
93
117
|
* </List>
|
|
118
|
+
* <List edge="flush" hasDividers>
|
|
119
|
+
* <ListItem label="Solstice Mug" description="Ceramic, 12 oz" />
|
|
120
|
+
* </List>
|
|
94
121
|
* ```
|
|
95
122
|
*/
|
|
96
|
-
export declare function List({ children, density, hasDividers, edgeCompensation, header, listStyle, start, xstyle, className, style, 'data-testid': testId, ref, ...props }: ListProps): import("react").JSX.Element;
|
|
123
|
+
export declare function List({ children, density, hasDividers, edge: edgeProp, edgeCompensation, header, listStyle, start, xstyle, className, style, 'data-testid': testId, ref, ...props }: ListProps): import("react").JSX.Element;
|
|
97
124
|
export declare namespace List {
|
|
98
125
|
var displayName: string;
|
|
99
126
|
}
|
package/dist/List/List.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/List/List.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/List/List.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAiB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,eAAe,IAAI,SAAS,GAClC,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,SAAU,SAAQ,SAAS,CAC1C,gBAAgB,GAAG,gBAAgB,CACpC;IACC,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC;IACrD;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;;OAIG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAyDD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,OAAoB,EACpB,WAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,gBAAgB,EAChB,MAAM,EACN,SAAkB,EAClB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BAwEX;yBAvFe,IAAI"}
|
package/dist/List/List.js
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file List.tsx
|
|
7
|
-
* @input Uses React, ReactNode, StyleXStyles, theme tokens,
|
|
8
|
-
* with
|
|
9
|
-
* @output Exports List component, ListProps, ListDensity, ListStyle
|
|
7
|
+
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useDevWarning,
|
|
8
|
+
* and ListContext with the row edge treatment
|
|
9
|
+
* @output Exports List component, ListProps, ListDensity, ListEdge, ListStyle
|
|
10
|
+
* types
|
|
10
11
|
* @position Core implementation; consumed by index.ts, tested by List.test.tsx
|
|
11
12
|
*
|
|
12
13
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -23,6 +24,7 @@ import { spacingVars } from "../theme/tokens.stylex.js";
|
|
|
23
24
|
import { ListContext } from "./ListContext.js";
|
|
24
25
|
import { mergeProps } from "../utils/index.js";
|
|
25
26
|
import { themeProps } from "../utils/themeProps.js";
|
|
27
|
+
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
26
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
29
|
// =============================================================================
|
|
28
30
|
// Styles
|
|
@@ -39,6 +41,12 @@ const styles = {
|
|
|
39
41
|
kXHlph: "x101abm8",
|
|
40
42
|
$$css: true
|
|
41
43
|
},
|
|
44
|
+
reachesContainerPadding: {
|
|
45
|
+
keTefX: "xojxgvx",
|
|
46
|
+
k71WvV: "x1fcf3bl",
|
|
47
|
+
kzqmXN: "xx6qvi6",
|
|
48
|
+
$$css: true
|
|
49
|
+
},
|
|
42
50
|
withDividers: {
|
|
43
51
|
kOIVth: "xxhr3t",
|
|
44
52
|
$$css: true
|
|
@@ -68,9 +76,10 @@ const dynamicStyles = {
|
|
|
68
76
|
* Renders semantic `<ul>` or `<ol>` elements with configurable density,
|
|
69
77
|
* dividers, marker styles, and an optional header.
|
|
70
78
|
*
|
|
71
|
-
* Set `
|
|
72
|
-
*
|
|
73
|
-
*
|
|
79
|
+
* Set `edge` to choose where row text, dividers, and backgrounds sit: inside
|
|
80
|
+
* each row's padding (`padded`, the default), at the list's edges (`flush`),
|
|
81
|
+
* on a heading's line with backgrounds reaching into the container's padding
|
|
82
|
+
* (`outset`), or reaching the container's edges like Table rows (`bleed`).
|
|
74
83
|
*
|
|
75
84
|
* @example
|
|
76
85
|
* ```
|
|
@@ -82,12 +91,16 @@ const dynamicStyles = {
|
|
|
82
91
|
* <ListItem label="First step" />
|
|
83
92
|
* <ListItem label="Second step" />
|
|
84
93
|
* </List>
|
|
94
|
+
* <List edge="flush" hasDividers>
|
|
95
|
+
* <ListItem label="Solstice Mug" description="Ceramic, 12 oz" />
|
|
96
|
+
* </List>
|
|
85
97
|
* ```
|
|
86
98
|
*/
|
|
87
99
|
export function List({
|
|
88
100
|
children,
|
|
89
101
|
density = 'balanced',
|
|
90
102
|
hasDividers = false,
|
|
103
|
+
edge: edgeProp,
|
|
91
104
|
edgeCompensation,
|
|
92
105
|
header,
|
|
93
106
|
listStyle = 'none',
|
|
@@ -102,12 +115,17 @@ export function List({
|
|
|
102
115
|
const headerId = useId();
|
|
103
116
|
const isOrdered = listStyle === 'decimal';
|
|
104
117
|
const Tag = isOrdered ? 'ol' : 'ul';
|
|
118
|
+
// Plain use of the deprecated prop is reported by its @deprecated type;
|
|
119
|
+
// development warns only when the two names conflict (spec:AST-017 FR29).
|
|
120
|
+
useDevWarning('List', '`edge` and the deprecated `edgeCompensation` are both set; `edge` wins. ' + 'Remove `edgeCompensation`. `astryx upgrade` rewrites existing usage.', edgeProp != null && edgeCompensation != null);
|
|
121
|
+
const edge = edgeProp ?? (edgeCompensation === 'inline' ? 'outset' : 'padded');
|
|
122
|
+
const reachesContainerPadding = edge === 'outset' || edge === 'bleed';
|
|
105
123
|
const contextValue = useMemo(() => ({
|
|
106
124
|
density,
|
|
107
125
|
hasDividers,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), [density, hasDividers,
|
|
126
|
+
edge,
|
|
127
|
+
listStyle
|
|
128
|
+
}), [density, hasDividers, edge, listStyle]);
|
|
111
129
|
const listElement = /*#__PURE__*/_jsx(Tag, {
|
|
112
130
|
ref: ref
|
|
113
131
|
// Consumer props first: everything the component sets for itself below
|
|
@@ -134,7 +152,7 @@ export function List({
|
|
|
134
152
|
...mergeProps(themeProps('list', {
|
|
135
153
|
density,
|
|
136
154
|
listStyle
|
|
137
|
-
}), stylex.props(styles.list, hasDividers && styles.withDividers, listStyle !== 'none' && (start != null && start !== 1 ? dynamicStyles.counterStart(start - 1) : styles.withCounter), xstyle), className, style),
|
|
155
|
+
}), stylex.props(styles.list, hasDividers && styles.withDividers, reachesContainerPadding && styles.reachesContainerPadding, listStyle !== 'none' && (start != null && start !== 1 ? dynamicStyles.counterStart(start - 1) : styles.withCounter), xstyle), className, style),
|
|
138
156
|
children: children
|
|
139
157
|
});
|
|
140
158
|
if (header == null) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file ListContext.tsx
|
|
3
3
|
* @input Layer-scoped React context
|
|
4
|
-
* @output Exports ListContext for sharing density, dividers,
|
|
5
|
-
* and
|
|
4
|
+
* @output Exports ListContext for sharing density, dividers, the row edge
|
|
5
|
+
* treatment, and marker style between List and ListItem, and
|
|
6
6
|
* ListMarkerScope, which sets the marker for the items inside it, or a
|
|
7
7
|
* task item's checkbox in its place
|
|
8
8
|
* @position Internal context; consumed by List.tsx and ListItem.tsx
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
import { type ReactNode } from 'react';
|
|
11
11
|
export type ListDensity = 'compact' | 'balanced' | 'spacious';
|
|
12
12
|
export type ListMarkerStyle = 'none' | 'disc' | 'decimal' | 'circle';
|
|
13
|
+
/**
|
|
14
|
+
* Where each row's content and its lines and backgrounds sit relative to the
|
|
15
|
+
* list's edges and the padding of the container around the list.
|
|
16
|
+
*/
|
|
17
|
+
export type ListEdge = 'padded' | 'flush' | 'outset' | 'bleed';
|
|
13
18
|
/**
|
|
14
19
|
* Every marker ListItem draws: the public styles, and the square, letter,
|
|
15
20
|
* and roman markers Markdown's nested lists use (spec:AST-061 DEC-6).
|
|
@@ -24,8 +29,8 @@ export interface ListTaskMarker {
|
|
|
24
29
|
export interface ListContextValue {
|
|
25
30
|
density: ListDensity;
|
|
26
31
|
hasDividers: boolean;
|
|
32
|
+
edge: ListEdge;
|
|
27
33
|
listStyle: ListMarkerStyle;
|
|
28
|
-
edgeCompensation?: 'inline';
|
|
29
34
|
/**
|
|
30
35
|
* The marker items draw instead of the one `listStyle` names, set by
|
|
31
36
|
* ListMarkerScope; internal. Ignored when `listStyle` is `'none'`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListContext.d.ts","sourceRoot":"","sources":["../../src/List/ListContext.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAe,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGnD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAC9D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,UAAU,GACpB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,CAAC;AAE3E,gFAAgF;AAChF,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,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E,UAAU,CAAC;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B,GAAG,SAAS,CAWZ"}
|
package/dist/List/ListContext.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ListContext.tsx
|
|
7
7
|
* @input Layer-scoped React context
|
|
8
|
-
* @output Exports ListContext for sharing density, dividers,
|
|
9
|
-
* and
|
|
8
|
+
* @output Exports ListContext for sharing density, dividers, the row edge
|
|
9
|
+
* treatment, and marker style between List and ListItem, and
|
|
10
10
|
* ListMarkerScope, which sets the marker for the items inside it, or a
|
|
11
11
|
* task item's checkbox in its place
|
|
12
12
|
* @position Internal context; consumed by List.tsx and ListItem.tsx
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
import { use, useMemo } from 'react';
|
|
15
15
|
import { createLayerScopedContext as createContext } from "../Layer/layerScopedContext.js";
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Where each row's content and its lines and backgrounds sit relative to the
|
|
19
|
+
* list's edges and the padding of the container around the list.
|
|
20
|
+
*/
|
|
21
|
+
|
|
17
22
|
/**
|
|
18
23
|
* Every marker ListItem draws: the public styles, and the square, letter,
|
|
19
24
|
* and roman markers Markdown's nested lists use (spec:AST-061 DEC-6).
|