@astryxdesign/core 0.1.8 → 0.1.9
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 +100 -0
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +6 -2
- package/dist/AppShell/AppShellMobileContext.d.ts +8 -0
- package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
- package/dist/Avatar/Avatar.d.ts +18 -2
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +63 -7
- package/dist/Avatar/AvatarStatusDot.d.ts +33 -5
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusDot.js +144 -19
- package/dist/Banner/Banner.d.ts +9 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +31 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +31 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +208 -6
- package/dist/Breadcrumbs/index.d.ts +5 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +9 -1
- package/dist/Button/Button.d.ts +8 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +31 -2
- package/dist/ButtonGroup/ButtonGroup.d.ts +9 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +30 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +30 -2
- package/dist/Calendar/dayCellUtils.js +1 -1
- package/dist/Card/Card.d.ts +8 -2
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +28 -2
- package/dist/Carousel/Carousel.d.ts +4 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +24 -4
- package/dist/Chat/ChatComposer.d.ts +8 -0
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +46 -7
- package/dist/Chat/ChatComposerDrawer.d.ts +2 -0
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +11 -1
- package/dist/Chat/ChatComposerInput.d.ts +20 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +35 -3
- package/dist/Chat/ChatContext.d.ts +33 -0
- package/dist/Chat/ChatContext.d.ts.map +1 -1
- package/dist/Chat/ChatContext.js +16 -2
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +1 -1
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +4 -4
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +7 -1
- package/dist/Chat/ChatToolCalls.d.ts +5 -1
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +18 -9
- package/dist/Chat/index.d.ts +2 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +2 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +22 -8
- package/dist/Chat/useSpeechRecognition.d.ts +0 -1
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +1 -1
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +1 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts +20 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +11 -1
- package/dist/ClickableCard/ClickableCard.d.ts +9 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +5 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +8 -1
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +3 -1
- package/dist/CommandPalette/CommandPaletteGroup.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteGroup.js +9 -2
- package/dist/CommandPalette/CommandPaletteInput.d.ts +7 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +6 -1
- package/dist/DateInput/DateInput.d.ts +47 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +26 -2
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +10 -1
- package/dist/Dialog/Dialog.d.ts +3 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +57 -6
- package/dist/Dialog/DialogContext.d.ts +7 -0
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogContext.js +2 -2
- package/dist/Dialog/DialogHeader.d.ts +5 -2
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +6 -1
- package/dist/Divider/Divider.js +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +1 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +1 -2
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +2 -3
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +42 -15
- package/dist/FieldStatus/FieldStatus.d.ts +8 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +22 -4
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +10 -2
- package/dist/HoverCard/HoverCard.d.ts +9 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -0
- package/dist/HoverCard/useHoverCard.d.ts +8 -0
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +7 -2
- package/dist/Icon/Icon.d.ts +7 -2
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Item/Item.d.ts +6 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +22 -1
- package/dist/Layer/useLayer.d.ts +6 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +2 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +6 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -0
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +39 -12
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +16 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/Outline/Outline.d.ts +0 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +0 -1
- package/dist/OverflowList/OverflowList.d.ts +20 -3
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +29 -4
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +3 -2
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +3 -9
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.d.ts +9 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +16 -13
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +4 -2
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +16 -0
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +21 -8
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +19 -2
- package/dist/Stack/stack.stylex.d.ts +9 -9
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +3 -2
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/index.d.ts +3 -0
- package/dist/Table/plugins/rowStatus/index.d.ts.map +1 -0
- package/dist/Table/plugins/rowStatus/index.js +3 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts +60 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -0
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +145 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts +13 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +4 -1
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +16 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +87 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +6 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeState.js +22 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -3
- package/dist/Thumbnail/Thumbnail.d.ts +26 -5
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +97 -54
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts +9 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts.map +1 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.js +14 -0
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +15 -4
- package/dist/Timestamp/Timestamp.d.ts +3 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +8 -6
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +2 -5
- package/dist/ToggleButton/ToggleButtonGroup.d.ts +0 -1
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +16 -4
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +18 -8
- package/dist/TopNav/TopNavMegaMenu.js +10 -4
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts +9 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +8 -1
- package/dist/TopNav/TopNavMenu.d.ts +2 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +68 -6
- package/dist/TreeList/TreeList.d.ts +12 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +2 -0
- package/dist/TreeList/TreeListBranches.d.ts +5 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +10 -4
- package/dist/TreeList/TreeListItem.d.ts +8 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +27 -7
- package/dist/TreeList/TreeListTypes.d.ts +25 -1
- package/dist/TreeList/TreeListTypes.d.ts.map +1 -1
- package/dist/TreeList/index.d.ts +2 -2
- package/dist/TreeList/index.d.ts.map +1 -1
- package/dist/astryx.css +28 -18
- package/dist/astryx.umd.js +51 -51
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts.map +1 -1
- package/dist/docs-types.d.ts +8 -0
- package/dist/docs-types.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.d.ts +47 -0
- package/dist/hooks/computeOverflow.d.ts.map +1 -0
- package/dist/hooks/computeOverflow.js +213 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/useDevWarning.d.ts +18 -0
- package/dist/hooks/useDevWarning.d.ts.map +1 -0
- package/dist/hooks/useDevWarning.js +49 -0
- package/dist/hooks/useOverflow.d.ts +19 -0
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +36 -25
- package/dist/i18n/resolve.d.ts.map +1 -1
- package/dist/i18n/resolve.js +7 -18
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +2 -7
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +51 -0
- package/dist/theme/hct.d.ts +0 -1
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +2 -1
- package/dist/utils/devWarning.d.ts +42 -0
- package/dist/utils/devWarning.d.ts.map +1 -0
- package/dist/utils/devWarning.js +88 -0
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +3 -2
- package/dist/utils/plainDate.d.ts +30 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +53 -0
- package/dist/utils/types.d.ts +13 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/locales/en.json +24 -0
- package/locales/fr-FR.json +14 -0
- package/locales/pseudo.json +18 -0
- package/package.json +1 -1
- package/src/AppShell/AppShell.tsx +6 -0
- package/src/AppShell/AppShellMobileContext.tsx +8 -0
- package/src/AppShell/useAppShellMobile.doc.mjs +8 -0
- package/src/Avatar/Avatar.doc.mjs +15 -3
- package/src/Avatar/Avatar.test.tsx +156 -1
- package/src/Avatar/Avatar.tsx +96 -4
- package/src/Avatar/AvatarStatusDot.doc.mjs +23 -12
- package/src/Avatar/AvatarStatusDot.test.tsx +284 -0
- package/src/Avatar/AvatarStatusDot.tsx +178 -21
- package/src/Banner/Banner.doc.mjs +9 -0
- package/src/Banner/Banner.test.tsx +30 -0
- package/src/Banner/Banner.tsx +47 -3
- package/src/Breadcrumbs/BreadcrumbItem.doc.mjs +26 -0
- package/src/Breadcrumbs/BreadcrumbItem.tsx +333 -14
- package/src/Breadcrumbs/Breadcrumbs.doc.mjs +2 -0
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +284 -2
- package/src/Breadcrumbs/index.ts +27 -0
- package/src/Button/Button.doc.mjs +9 -0
- package/src/Button/Button.test.tsx +49 -0
- package/src/Button/Button.tsx +25 -1
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -0
- package/src/ButtonGroup/ButtonGroup.test.tsx +37 -0
- package/src/ButtonGroup/ButtonGroup.tsx +32 -0
- package/src/Calendar/Calendar.doc.mjs +12 -1
- package/src/Calendar/Calendar.test.tsx +193 -0
- package/src/Calendar/Calendar.tsx +38 -16
- package/src/Calendar/dayCellUtils.test.ts +5 -0
- package/src/Calendar/dayCellUtils.ts +1 -1
- package/src/Card/Card.doc.mjs +9 -0
- package/src/Card/Card.test.tsx +21 -3
- package/src/Card/Card.tsx +35 -2
- package/src/Carousel/Carousel.doc.mjs +1 -0
- package/src/Carousel/Carousel.test.tsx +53 -0
- package/src/Carousel/Carousel.tsx +34 -4
- package/src/Chat/ChatComposer.doc.mjs +12 -3
- package/src/Chat/ChatComposer.test.tsx +115 -0
- package/src/Chat/ChatComposer.tsx +73 -9
- package/src/Chat/ChatComposerDrawer.test.tsx +61 -0
- package/src/Chat/ChatComposerDrawer.tsx +11 -1
- package/src/Chat/ChatComposerInput.doc.mjs +7 -0
- package/src/Chat/ChatComposerInput.test.tsx +103 -0
- package/src/Chat/ChatComposerInput.tsx +49 -3
- package/src/Chat/ChatContext.tsx +37 -10
- package/src/Chat/ChatDictationButton.tsx +4 -1
- package/src/Chat/ChatLayout.tsx +3 -1
- package/src/Chat/ChatLayoutScrollButton.tsx +7 -2
- package/src/Chat/ChatMessageMetadata.tsx +1 -2
- package/src/Chat/ChatSendButton.tsx +11 -1
- package/src/Chat/ChatToolCalls.test.tsx +64 -0
- package/src/Chat/ChatToolCalls.tsx +25 -4
- package/src/Chat/index.ts +5 -1
- package/src/Chat/useChatStreamScroll.test.tsx +49 -0
- package/src/Chat/useChatStreamScroll.ts +27 -10
- package/src/Chat/useSpeechRecognition.ts +1 -1
- package/src/Chat/useTriggerMenu.tsx +3 -1
- package/src/CheckboxInput/CheckboxInput.test.tsx +32 -1
- package/src/CheckboxInput/CheckboxInput.tsx +1 -1
- package/src/CheckboxList/CheckboxList.test.tsx +81 -3
- package/src/CheckboxList/CheckboxListItem.doc.mjs +33 -5
- package/src/CheckboxList/CheckboxListItem.tsx +41 -5
- package/src/ClickableCard/ClickableCard.doc.mjs +2 -0
- package/src/ClickableCard/ClickableCard.test.tsx +34 -0
- package/src/ClickableCard/ClickableCard.tsx +13 -3
- package/src/CodeBlock/CodeBlock.test.tsx +56 -0
- package/src/CodeBlock/CodeBlock.tsx +9 -1
- package/src/CommandPalette/CommandPalette.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.tsx +3 -1
- package/src/CommandPalette/CommandPaletteGroup.test.tsx +71 -0
- package/src/CommandPalette/CommandPaletteGroup.tsx +12 -1
- package/src/CommandPalette/CommandPaletteInput.doc.mjs +26 -9
- package/src/CommandPalette/CommandPaletteInput.test.tsx +34 -0
- package/src/CommandPalette/CommandPaletteInput.tsx +11 -0
- package/src/ContextMenu/ContextMenu.test.tsx +193 -0
- package/src/DateInput/DateInput.doc.mjs +16 -0
- package/src/DateInput/DateInput.test.tsx +108 -0
- package/src/DateInput/DateInput.tsx +68 -3
- package/src/DateInput/index.ts +1 -0
- package/src/DateTimeInput/DateTimeInput.test.tsx +35 -0
- package/src/DateTimeInput/DateTimeInput.tsx +14 -2
- package/src/Dialog/Dialog.doc.mjs +2 -2
- package/src/Dialog/Dialog.test.tsx +77 -4
- package/src/Dialog/Dialog.tsx +89 -5
- package/src/Dialog/DialogContext.ts +9 -2
- package/src/Dialog/DialogHeader.doc.mjs +2 -2
- package/src/Dialog/DialogHeader.tsx +9 -2
- package/src/Divider/Divider.tsx +2 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +169 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +1 -2
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +1 -2
- package/src/Field/Field.test.tsx +57 -12
- package/src/Field/Field.tsx +6 -5
- package/src/Field/FieldLabel.tsx +8 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +17 -5
- package/src/FieldStatus/FieldStatus.test.tsx +78 -40
- package/src/FieldStatus/FieldStatus.tsx +22 -4
- package/src/FileInput/FileInput.test.tsx +52 -3
- package/src/FileInput/FileInput.tsx +13 -2
- package/src/HoverCard/HoverCard.doc.mjs +13 -0
- package/src/HoverCard/HoverCard.test.tsx +21 -2
- package/src/HoverCard/HoverCard.tsx +11 -0
- package/src/HoverCard/useHoverCard.doc.mjs +2 -0
- package/src/HoverCard/useHoverCard.tsx +24 -2
- package/src/Icon/Icon.doc.mjs +3 -2
- package/src/Icon/Icon.tsx +7 -2
- package/src/IconButton/IconButton.doc.mjs +8 -0
- package/src/IconButton/IconButton.test.tsx +15 -18
- package/src/Item/Item.test.tsx +40 -18
- package/src/Item/Item.tsx +38 -2
- package/src/Layer/useLayer.tsx +8 -0
- package/src/List/List.test.tsx +9 -8
- package/src/MobileNav/MobileNav.tsx +12 -1
- package/src/MobileNav/MobileNavToggle.test.tsx +116 -0
- package/src/MobileNav/MobileNavToggle.tsx +9 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +4 -2
- package/src/MultiSelector/MultiSelector.test.tsx +172 -3
- package/src/MultiSelector/MultiSelector.tsx +55 -12
- package/src/MultiSelector/hooks.ts +17 -0
- package/src/NumberInput/NumberInput.test.tsx +11 -7
- package/src/NumberInput/NumberInput.tsx +1 -2
- package/src/Outline/Outline.tsx +0 -1
- package/src/OverflowList/OverflowList.doc.mjs +39 -6
- package/src/OverflowList/OverflowList.test.tsx +111 -0
- package/src/OverflowList/OverflowList.tsx +48 -8
- package/src/Popover/Popover.tsx +7 -4
- package/src/Popover/usePopover.tsx +9 -13
- package/src/PowerSearch/PowerSearch.doc.mjs +14 -0
- package/src/PowerSearch/PowerSearch.test.tsx +20 -0
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +67 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
- package/src/PowerSearch/usePowerSearchSource.ts +1 -2
- package/src/SelectableCard/SelectableCard.doc.mjs +2 -0
- package/src/SelectableCard/SelectableCard.test.tsx +46 -4
- package/src/SelectableCard/SelectableCard.tsx +29 -16
- package/src/Selector/Selector.test.tsx +69 -0
- package/src/Selector/Selector.tsx +5 -1
- package/src/Selector/hooks.ts +17 -0
- package/src/SideNav/SideNav.test.tsx +119 -3
- package/src/SideNav/SideNavCollapseButton.tsx +6 -1
- package/src/SideNav/SideNavHeading.tsx +24 -8
- package/src/SideNav/SideNavItem.tsx +5 -1
- package/src/Slider/Slider.test.tsx +75 -2
- package/src/Slider/Slider.tsx +21 -5
- package/src/Switch/Switch.test.tsx +32 -1
- package/src/Table/BaseTable.tsx +3 -5
- package/src/Table/index.ts +5 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +6 -2
- package/src/Table/plugins/rowStatus/index.ts +7 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +138 -0
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +189 -0
- package/src/Table/plugins/selection/useTableSelection.test.tsx +16 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +19 -1
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +135 -3
- package/src/Table/plugins/tree/useTableTreeData.tsx +128 -1
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +104 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +46 -2
- package/src/Table/useBaseTablePlugins.ts +10 -6
- package/src/Table/useTableRowStatus.doc.mjs +30 -0
- package/src/Table/useTableSelection.doc.mjs +65 -14
- package/src/Table/useTableTreeData.doc.mjs +29 -0
- package/src/Table/useTableTreeState.doc.mjs +2 -2
- package/src/TextArea/TextArea.test.tsx +9 -1
- package/src/Thumbnail/Thumbnail.doc.mjs +19 -10
- package/src/Thumbnail/Thumbnail.test.tsx +98 -7
- package/src/Thumbnail/Thumbnail.tsx +141 -41
- package/src/Thumbnail/thumbnail.markers.stylex.ts +12 -0
- package/src/TimeInput/TimeInput.test.tsx +76 -1
- package/src/TimeInput/TimeInput.tsx +19 -6
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +32 -0
- package/src/Timestamp/Timestamp.tsx +28 -8
- package/src/Toast/useToast.tsx +7 -8
- package/src/ToggleButton/ToggleButtonGroup.tsx +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +15 -1
- package/src/Tokenizer/Tokenizer.test.tsx +183 -2
- package/src/Tokenizer/Tokenizer.tsx +16 -4
- package/src/TopNav/TopNav.test.tsx +125 -1
- package/src/TopNav/TopNavHeading.tsx +24 -8
- package/src/TopNav/TopNavMegaMenu.test.tsx +149 -1
- package/src/TopNav/TopNavMegaMenu.tsx +10 -4
- package/src/TopNav/TopNavMegaMenuFeaturedCard.doc.mjs +3 -3
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +19 -2
- package/src/TopNav/TopNavMenu.test.tsx +118 -4
- package/src/TopNav/TopNavMenu.tsx +83 -5
- package/src/TreeList/TreeList.doc.mjs +22 -0
- package/src/TreeList/TreeList.test.tsx +232 -0
- package/src/TreeList/TreeList.tsx +18 -2
- package/src/TreeList/TreeListBranches.tsx +16 -2
- package/src/TreeList/TreeListItem.tsx +51 -11
- package/src/TreeList/TreeListTypes.ts +27 -1
- package/src/TreeList/index.ts +2 -2
- package/src/authoring/doc.ts +1 -3
- package/src/docs-types.ts +5 -0
- package/src/hooks/computeOverflow.test.ts +422 -0
- package/src/hooks/computeOverflow.ts +290 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useDevWarning.test.tsx +45 -0
- package/src/hooks/useDevWarning.ts +54 -0
- package/src/hooks/useOverflow.test.ts +96 -4
- package/src/hooks/useOverflow.ts +74 -33
- package/src/i18n/InternationalizationProvider.doc.mjs +99 -2
- package/src/i18n/resolve.ts +9 -21
- package/src/theme/Theme.tsx +11 -14
- package/src/theme/generateThemeRules.test.ts +65 -0
- package/src/theme/generateThemeRules.ts +56 -0
- package/src/theme/hct.ts +1 -1
- package/src/theme/syntax/defineSyntaxTheme.ts +5 -6
- package/src/utils/devWarning.test.ts +56 -0
- package/src/utils/devWarning.ts +102 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/plainDate.test.ts +22 -0
- package/src/utils/plainDate.ts +61 -0
- package/src/utils/types.ts +14 -0
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file BreadcrumbItem.tsx
|
|
7
|
-
* @input Uses React use/useRef/useEffect, stylex, theme tokens, BreadcrumbContext
|
|
7
|
+
* @input Uses React use/useRef/useEffect, stylex, theme tokens, BreadcrumbContext,
|
|
8
|
+
* and (for the menu trigger) usePopover + the shared DropdownMenu item API
|
|
9
|
+
* (renderDropdownItems, DropdownMenuContext, MENU_ITEM_SELECTOR, useListFocus)
|
|
8
10
|
* @output Exports BreadcrumbItem component and BreadcrumbItemProps
|
|
9
11
|
* @position Individual breadcrumb item; used inside Breadcrumbs
|
|
10
12
|
*
|
|
13
|
+
* A `menu` prop turns the item's link-styled button into a menu trigger whose
|
|
14
|
+
* popover reuses DropdownMenu's item pipeline — the same wiring ContextMenu
|
|
15
|
+
* uses — so menu-item definitions are portable across the menu family.
|
|
16
|
+
*
|
|
11
17
|
* SYNC: When modified, update these files to stay in sync:
|
|
12
18
|
* - /packages/core/src/Breadcrumbs/Breadcrumbs.doc.mjs
|
|
13
19
|
* - /packages/core/src/Breadcrumbs/Breadcrumbs.test.tsx
|
|
@@ -15,14 +21,22 @@
|
|
|
15
21
|
* - /apps/storybook/stories/Breadcrumbs.stories.tsx
|
|
16
22
|
* - /packages/cli/templates/blocks/components/Breadcrumbs/ (showcase blocks)
|
|
17
23
|
*/
|
|
18
|
-
import React, { use, useRef, useEffect } from 'react';
|
|
24
|
+
import React, { use, useCallback, useId, useMemo, useRef, useEffect } from 'react';
|
|
19
25
|
import * as stylex from '@stylexjs/stylex';
|
|
20
26
|
import "../theme/tokens.stylex.js";
|
|
21
|
-
import { colorVars, spacingVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
27
|
+
import { colorVars, spacingVars, typeScaleVars, radiusVars } from "../theme/tokens.stylex.js";
|
|
22
28
|
import { BreadcrumbContext } from "./Breadcrumbs.js";
|
|
23
29
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
24
30
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
25
31
|
import { themeProps } from "../utils/themeProps.js";
|
|
32
|
+
import { getIcon } from "../Icon/globalIconRegistry.js";
|
|
33
|
+
import { usePopover } from "../Popover/usePopover.js";
|
|
34
|
+
import { useListFocus } from "../hooks/useListFocus.js";
|
|
35
|
+
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
36
|
+
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
37
|
+
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
38
|
+
import { DropdownMenuContext } from "../DropdownMenu/DropdownMenuContext.js";
|
|
39
|
+
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR } from "../DropdownMenu/menuItemRoles.js";
|
|
26
40
|
|
|
27
41
|
// =============================================================================
|
|
28
42
|
// Props
|
|
@@ -52,6 +66,13 @@ const itemStyles = {
|
|
|
52
66
|
$$css: true
|
|
53
67
|
}
|
|
54
68
|
};
|
|
69
|
+
const menuStyles = {
|
|
70
|
+
popover: {
|
|
71
|
+
k7Eaqz: "x5w4yej",
|
|
72
|
+
kqGvvJ: "xsq74q5",
|
|
73
|
+
$$css: true
|
|
74
|
+
}
|
|
75
|
+
};
|
|
55
76
|
|
|
56
77
|
// =============================================================================
|
|
57
78
|
// Component
|
|
@@ -79,6 +100,8 @@ export function BreadcrumbItem({
|
|
|
79
100
|
onClick,
|
|
80
101
|
isCurrent: isCurrentProp,
|
|
81
102
|
startIcon,
|
|
103
|
+
menu,
|
|
104
|
+
menuSize,
|
|
82
105
|
xstyle,
|
|
83
106
|
className,
|
|
84
107
|
style,
|
|
@@ -95,6 +118,21 @@ export function BreadcrumbItem({
|
|
|
95
118
|
const contentRef = useRef(null);
|
|
96
119
|
const isCurrent = isCurrentProp === true;
|
|
97
120
|
const isAutoCandidate = isCurrentProp == null;
|
|
121
|
+
const hasMenu = menu != null;
|
|
122
|
+
const resolvedMenuSize = menuSize ?? (isSupporting ? 'sm' : 'md');
|
|
123
|
+
|
|
124
|
+
// `menu` owns the click interaction; a label can't both navigate/act and
|
|
125
|
+
// open a menu on the same activation. Warn once so the (ignored) href/onClick
|
|
126
|
+
// don't silently disappear on the consumer.
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
if (process.env.NODE_ENV !== 'production' && hasMenu) {
|
|
129
|
+
if (href != null) {
|
|
130
|
+
console.warn('BreadcrumbItem: `menu` and `href` are mutually exclusive; `menu` ' + 'takes precedence and `href` is ignored.');
|
|
131
|
+
} else if (onClick != null) {
|
|
132
|
+
console.warn('BreadcrumbItem: `menu` and `onClick` are mutually exclusive; ' + '`menu` takes precedence and `onClick` is ignored.');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}, [hasMenu, href, onClick]);
|
|
98
136
|
|
|
99
137
|
// Auto-detect: if no sibling has aria-current="page" and this is the last
|
|
100
138
|
// non-separator item, set aria-current on our content element.
|
|
@@ -152,7 +190,19 @@ export function BreadcrumbItem({
|
|
|
152
190
|
className: "x11ke7fs x6s0dn4 xv1l7n4 xu0wf1k x87ps6o"
|
|
153
191
|
},
|
|
154
192
|
children: ctx.separator
|
|
155
|
-
}),
|
|
193
|
+
}), hasMenu ?
|
|
194
|
+
/*#__PURE__*/
|
|
195
|
+
// A current crumb can also open a sibling menu — the trigger keeps
|
|
196
|
+
// both aria-current="page" and aria-haspopup="menu".
|
|
197
|
+
_jsx(BreadcrumbMenuTrigger, {
|
|
198
|
+
ref: contentRef,
|
|
199
|
+
menu: menu,
|
|
200
|
+
menuSize: resolvedMenuSize,
|
|
201
|
+
isSupporting: isSupporting,
|
|
202
|
+
isCurrent: true,
|
|
203
|
+
label: children,
|
|
204
|
+
children: content
|
|
205
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
156
206
|
...{
|
|
157
207
|
0: {
|
|
158
208
|
className: "x78zum5 x6s0dn4 xzye2dw x1pd3egz x1tgivj0"
|
|
@@ -180,7 +230,14 @@ export function BreadcrumbItem({
|
|
|
180
230
|
className: "x11ke7fs x6s0dn4 xv1l7n4 xu0wf1k x87ps6o"
|
|
181
231
|
},
|
|
182
232
|
children: ctx.separator
|
|
183
|
-
}),
|
|
233
|
+
}), hasMenu ? /*#__PURE__*/_jsx(BreadcrumbMenuTrigger, {
|
|
234
|
+
ref: contentRef,
|
|
235
|
+
menu: menu,
|
|
236
|
+
menuSize: resolvedMenuSize,
|
|
237
|
+
isSupporting: isSupporting,
|
|
238
|
+
label: children,
|
|
239
|
+
children: content
|
|
240
|
+
}) : href != null ? /*#__PURE__*/_jsx(LinkComponent, {
|
|
184
241
|
ref: contentRef,
|
|
185
242
|
href: href,
|
|
186
243
|
onClick: onClick,
|
|
@@ -220,4 +277,149 @@ export function BreadcrumbItem({
|
|
|
220
277
|
})]
|
|
221
278
|
});
|
|
222
279
|
}
|
|
223
|
-
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
280
|
+
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
281
|
+
|
|
282
|
+
// =============================================================================
|
|
283
|
+
// Menu trigger
|
|
284
|
+
// =============================================================================
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The link-styled `<button>` trigger + its `role="menu"` popover. Reuses the
|
|
288
|
+
* DropdownMenu item pipeline (`renderDropdownItems` for arrays, the item
|
|
289
|
+
* components for children) inside a `useListFocus` container that provides
|
|
290
|
+
* `DropdownMenuContext` — the same wiring ContextMenu uses — so menu-item
|
|
291
|
+
* definitions are portable into a breadcrumb with no rewrite.
|
|
292
|
+
*/
|
|
293
|
+
function BreadcrumbMenuTrigger({
|
|
294
|
+
ref,
|
|
295
|
+
children,
|
|
296
|
+
label,
|
|
297
|
+
menu,
|
|
298
|
+
menuSize,
|
|
299
|
+
isSupporting,
|
|
300
|
+
isCurrent = false
|
|
301
|
+
}) {
|
|
302
|
+
const menuId = useId();
|
|
303
|
+
const buttonRef = useRef(null);
|
|
304
|
+
const popover = usePopover({
|
|
305
|
+
onHide: useCallback(() => {
|
|
306
|
+
buttonRef.current?.focus();
|
|
307
|
+
}, []),
|
|
308
|
+
hasLightDismiss: true,
|
|
309
|
+
hasCloseButton: false,
|
|
310
|
+
hasAutoFocus: false,
|
|
311
|
+
// The popup's own role="menu" is the exposed semantics; a modal dialog
|
|
312
|
+
// wrapper would announce an unnamed dialog around the menu.
|
|
313
|
+
role: 'none'
|
|
314
|
+
});
|
|
315
|
+
const closeMenu = useCallback(() => {
|
|
316
|
+
popover.hide();
|
|
317
|
+
}, [popover]);
|
|
318
|
+
const {
|
|
319
|
+
listRef,
|
|
320
|
+
handleKeyDown: listNavKeyDown,
|
|
321
|
+
focusFirst,
|
|
322
|
+
focusItem
|
|
323
|
+
} = useListFocus({
|
|
324
|
+
itemSelector: MENU_ITEM_SELECTOR,
|
|
325
|
+
wrap: false,
|
|
326
|
+
onEscape: closeMenu
|
|
327
|
+
});
|
|
328
|
+
const getMenuItems = useCallback(() => listRef.current ? Array.from(listRef.current.querySelectorAll(MENU_ITEM_SELECTOR)) : [], [listRef]);
|
|
329
|
+
const typeahead = useTypeahead({
|
|
330
|
+
getItemLabels: () => getMenuItems().map(el => el.textContent),
|
|
331
|
+
onMatch: focusItem,
|
|
332
|
+
getCurrentIndex: () => getMenuItems().findIndex(el => el === document.activeElement || el.contains(document.activeElement))
|
|
333
|
+
});
|
|
334
|
+
const listKeyDown = useCallback(e => {
|
|
335
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
336
|
+
e.preventDefault();
|
|
337
|
+
const focused = document.activeElement;
|
|
338
|
+
if (focused && MENU_ITEM_ROLES.has(focused.getAttribute('role') ?? '')) {
|
|
339
|
+
focused.click();
|
|
340
|
+
}
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
// APG menu-button pattern: Tab closes the menu (items are tabIndex={-1}).
|
|
344
|
+
if (e.key === 'Tab') {
|
|
345
|
+
closeMenu();
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (typeahead.onKeyDown(e)) {
|
|
349
|
+
e.preventDefault();
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
listNavKeyDown(e);
|
|
353
|
+
}, [listNavKeyDown, closeMenu, typeahead]);
|
|
354
|
+
const openAndFocus = useCallback(() => {
|
|
355
|
+
popover.show();
|
|
356
|
+
requestAnimationFrame(() => focusFirst());
|
|
357
|
+
}, [popover, focusFirst]);
|
|
358
|
+
const handleClick = useCallback(() => {
|
|
359
|
+
if (popover.isOpen) {
|
|
360
|
+
popover.hide();
|
|
361
|
+
} else {
|
|
362
|
+
openAndFocus();
|
|
363
|
+
}
|
|
364
|
+
}, [popover, openAndFocus]);
|
|
365
|
+
const handleKeyDown = useCallback(e => {
|
|
366
|
+
if (!popover.isOpen) {
|
|
367
|
+
if (e.key === 'ArrowDown' || e.key === 'Enter' || e.key === ' ') {
|
|
368
|
+
e.preventDefault();
|
|
369
|
+
openAndFocus();
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}, [popover.isOpen, openAndFocus]);
|
|
373
|
+
const contextValue = useMemo(() => ({
|
|
374
|
+
closeMenu,
|
|
375
|
+
menuSize
|
|
376
|
+
}), [closeMenu, menuSize]);
|
|
377
|
+
const menuContent = Array.isArray(menu) ? renderDropdownItems(menu) : menu;
|
|
378
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
379
|
+
children: [/*#__PURE__*/_jsxs("button", {
|
|
380
|
+
ref: mergeRefs(ref, buttonRef, popover.triggerRef),
|
|
381
|
+
type: "button",
|
|
382
|
+
onClick: handleClick,
|
|
383
|
+
onKeyDown: handleKeyDown,
|
|
384
|
+
...mergeProps(themeProps('breadcrumb-item-menu-trigger'), {
|
|
385
|
+
...popover.triggerProps,
|
|
386
|
+
'aria-haspopup': 'menu',
|
|
387
|
+
'aria-controls': menuId,
|
|
388
|
+
'aria-current': isCurrent ? 'page' : undefined
|
|
389
|
+
}),
|
|
390
|
+
...{
|
|
391
|
+
0: {
|
|
392
|
+
className: "x78zum5 x6s0dn4 xzye2dw xu0wf1k x1hl2dhg x4ohgrr x1ypdohk x1717udv x1ghz6dp xln7xf2 xv1l7n4"
|
|
393
|
+
},
|
|
394
|
+
1: {
|
|
395
|
+
className: "x78zum5 x6s0dn4 xzye2dw xu0wf1k x1hl2dhg x4ohgrr x1ypdohk x1717udv x1ghz6dp xln7xf2 xv1l7n4"
|
|
396
|
+
}
|
|
397
|
+
}[!!isSupporting << 0],
|
|
398
|
+
children: [children, /*#__PURE__*/_jsx("span", {
|
|
399
|
+
"aria-hidden": "true",
|
|
400
|
+
...{
|
|
401
|
+
className: "x78zum5 x6s0dn4 x2lah0s x141an7d"
|
|
402
|
+
},
|
|
403
|
+
children: getIcon('chevronDown')
|
|
404
|
+
})]
|
|
405
|
+
}), popover.render(/*#__PURE__*/_jsx("div", {
|
|
406
|
+
ref: listRef,
|
|
407
|
+
id: menuId,
|
|
408
|
+
role: "menu",
|
|
409
|
+
"aria-label": typeof label === 'string' ? label : undefined,
|
|
410
|
+
onKeyDown: listKeyDown,
|
|
411
|
+
...mergeProps(themeProps('breadcrumb-menu'), {
|
|
412
|
+
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xuyqlj2 x1odjw0f x1fcsqxe xgory14 x9epnlk x1n97fys x87ps6o"
|
|
413
|
+
}),
|
|
414
|
+
children: /*#__PURE__*/_jsx(DropdownMenuContext, {
|
|
415
|
+
value: contextValue,
|
|
416
|
+
children: menuContent
|
|
417
|
+
})
|
|
418
|
+
}), {
|
|
419
|
+
placement: 'below',
|
|
420
|
+
alignment: 'start',
|
|
421
|
+
xstyle: [menuStyles.popover, layerAnimations.below]
|
|
422
|
+
})]
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
BreadcrumbMenuTrigger.displayName = 'BreadcrumbMenuTrigger';
|
|
@@ -5,4 +5,9 @@ export { Breadcrumbs } from './Breadcrumbs';
|
|
|
5
5
|
export type { BreadcrumbsProps, BreadcrumbsVariant, BreadcrumbsVariantMap, } from './Breadcrumbs';
|
|
6
6
|
export { BreadcrumbItem } from './BreadcrumbItem';
|
|
7
7
|
export type { BreadcrumbItemProps } from './BreadcrumbItem';
|
|
8
|
+
export { DropdownMenuItem as BreadcrumbMenuItem, type DropdownMenuItemProps as BreadcrumbMenuItemProps, } from '../DropdownMenu/DropdownMenuItem';
|
|
9
|
+
export { DropdownMenuCheckboxItem as BreadcrumbMenuCheckboxItem, type DropdownMenuCheckboxItemProps as BreadcrumbMenuCheckboxItemProps, } from '../DropdownMenu/DropdownMenuCheckboxItem';
|
|
10
|
+
export { DropdownMenuRadioGroup as BreadcrumbMenuRadioGroup, type DropdownMenuRadioGroupProps as BreadcrumbMenuRadioGroupProps, } from '../DropdownMenu/DropdownMenuRadioGroup';
|
|
11
|
+
export { DropdownMenuRadioItem as BreadcrumbMenuRadioItem, type DropdownMenuRadioItemProps as BreadcrumbMenuRadioItemProps, } from '../DropdownMenu/DropdownMenuRadioItem';
|
|
12
|
+
export type { DropdownMenuOption as BreadcrumbMenuOption, DropdownMenuItemData as BreadcrumbMenuItemData, DropdownMenuDivider as BreadcrumbMenuDivider, DropdownMenuSection as BreadcrumbMenuSection, } from '../DropdownMenu/DropdownMenu';
|
|
8
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/index.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/index.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,YAAY,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAM1D,OAAO,EACL,gBAAgB,IAAI,kBAAkB,EACtC,KAAK,qBAAqB,IAAI,uBAAuB,GACtD,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,wBAAwB,IAAI,0BAA0B,EACtD,KAAK,6BAA6B,IAAI,+BAA+B,GACtE,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,sBAAsB,IAAI,wBAAwB,EAClD,KAAK,2BAA2B,IAAI,6BAA6B,GAClE,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,qBAAqB,IAAI,uBAAuB,EAChD,KAAK,0BAA0B,IAAI,4BAA4B,GAChE,MAAM,uCAAuC,CAAC;AAC/C,YAAY,EACV,kBAAkB,IAAI,oBAAoB,EAC1C,oBAAoB,IAAI,sBAAsB,EAC9C,mBAAmB,IAAI,qBAAqB,EAC5C,mBAAmB,IAAI,qBAAqB,GAC7C,MAAM,8BAA8B,CAAC"}
|
|
@@ -6,4 +6,12 @@
|
|
|
6
6
|
* @file Breadcrumbs component barrel export
|
|
7
7
|
*/
|
|
8
8
|
export { Breadcrumbs } from "./Breadcrumbs.js";
|
|
9
|
-
export { BreadcrumbItem } from "./BreadcrumbItem.js";
|
|
9
|
+
export { BreadcrumbItem } from "./BreadcrumbItem.js";
|
|
10
|
+
// The breadcrumb `menu` prop reuses the DropdownMenu item API, so the item
|
|
11
|
+
// components are re-exported under `Breadcrumb*` aliases for family coherence
|
|
12
|
+
// and discoverability (mirroring ContextMenu). A consumer's existing
|
|
13
|
+
// DropdownMenu item definitions are portable into a breadcrumb menu verbatim.
|
|
14
|
+
export { DropdownMenuItem as BreadcrumbMenuItem } from "../DropdownMenu/DropdownMenuItem.js";
|
|
15
|
+
export { DropdownMenuCheckboxItem as BreadcrumbMenuCheckboxItem } from "../DropdownMenu/DropdownMenuCheckboxItem.js";
|
|
16
|
+
export { DropdownMenuRadioGroup as BreadcrumbMenuRadioGroup } from "../DropdownMenu/DropdownMenuRadioGroup.js";
|
|
17
|
+
export { DropdownMenuRadioItem as BreadcrumbMenuRadioItem } from "../DropdownMenu/DropdownMenuRadioItem.js";
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { type ReactNode } from 'react';
|
|
17
17
|
import type { BaseProps } from '../BaseProps';
|
|
18
|
-
import type { SizeValue } from '../utils/types';
|
|
18
|
+
import type { Elevation, SizeValue } from '../utils/types';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import type { LinkComponentType } from '../Link/types';
|
|
21
21
|
declare const sizeStyles: Readonly<{
|
|
@@ -84,6 +84,12 @@ export interface ButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
84
84
|
* @default 'md'
|
|
85
85
|
*/
|
|
86
86
|
size?: ButtonSize;
|
|
87
|
+
/**
|
|
88
|
+
* Resting elevation — the shadow depth the button sits at. Use for floating
|
|
89
|
+
* buttons (FABs) that hover above content. `none` is the default flat button.
|
|
90
|
+
* @default 'none'
|
|
91
|
+
*/
|
|
92
|
+
elevation?: Elevation;
|
|
87
93
|
/**
|
|
88
94
|
* Whether the button is disabled.
|
|
89
95
|
* @default false
|
|
@@ -193,7 +199,7 @@ export interface ButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
193
199
|
* <Button label="Open in new tab" href="https://example.com" target="_blank" rel="noopener noreferrer" />
|
|
194
200
|
* ```
|
|
195
201
|
*/
|
|
196
|
-
export declare function Button({ label, variant, size: sizeProp, type, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, width, children, endContent, tooltip, href, as, target, rel, xstyle, className, style, ref, ...props }: ButtonProps): ReactNode;
|
|
202
|
+
export declare function Button({ label, variant, size: sizeProp, type, isDisabled, isLoading, isInterruptible, clickAction, icon, isIconOnly, width, elevation, children, endContent, tooltip, href, as, target, rel, xstyle, className, style, ref, ...props }: ButtonProps): ReactNode;
|
|
197
203
|
export declare namespace Button {
|
|
198
204
|
var displayName: string;
|
|
199
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAwB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAsB3C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AA+FrD,QAAA,MAAM,UAAU;;;;;;;;;;EAUd,CAAC;AAkHH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,EAAE,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AAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAqJD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,KAAK,EACL,SAAkB,EAClB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CA0OzB;yBAnQe,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -21,7 +21,7 @@ import { useRef, useTransition } from 'react';
|
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import { useTooltip } from "../Tooltip/useTooltip.js";
|
|
23
23
|
import "../theme/tokens.stylex.js";
|
|
24
|
-
import { colorVars, sizeVars, spacingVars, radiusVars, borderVars, durationVars, easeVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
24
|
+
import { colorVars, sizeVars, spacingVars, radiusVars, borderVars, durationVars, easeVars, fontWeightVars, typeScaleVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
25
25
|
import { Spinner } from "../Spinner/index.js";
|
|
26
26
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
27
27
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
@@ -150,6 +150,30 @@ const iconSizeStyles = {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Resting elevation for floating buttons (e.g. a FAB). `none` is the default
|
|
155
|
+
* flat button; `low`/`med`/`high` map to the shadow token scale. 'none' stays
|
|
156
|
+
* a literal so it never conflicts with a variant's background layering.
|
|
157
|
+
*/
|
|
158
|
+
const elevationStyles = {
|
|
159
|
+
none: {
|
|
160
|
+
kGVxlE: "x1gnnqk1",
|
|
161
|
+
$$css: true
|
|
162
|
+
},
|
|
163
|
+
low: {
|
|
164
|
+
kGVxlE: "x1i5ehqx",
|
|
165
|
+
$$css: true
|
|
166
|
+
},
|
|
167
|
+
med: {
|
|
168
|
+
kGVxlE: "x14hfi27",
|
|
169
|
+
$$css: true
|
|
170
|
+
},
|
|
171
|
+
high: {
|
|
172
|
+
kGVxlE: "x1kcpxr7",
|
|
173
|
+
$$css: true
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
153
177
|
/**
|
|
154
178
|
* Variant styles using backgroundImage for layered colors
|
|
155
179
|
* Pseudo-classes are nested within properties per StyleX recommendation
|
|
@@ -338,6 +362,7 @@ export function Button({
|
|
|
338
362
|
icon,
|
|
339
363
|
isIconOnly = false,
|
|
340
364
|
width,
|
|
365
|
+
elevation = 'none',
|
|
341
366
|
children,
|
|
342
367
|
endContent,
|
|
343
368
|
tooltip,
|
|
@@ -430,7 +455,10 @@ export function Button({
|
|
|
430
455
|
} : null;
|
|
431
456
|
|
|
432
457
|
// Shared StyleX props for both button and link rendering
|
|
433
|
-
const sharedStylexProps = stylex.props(styles.base, sizeStyles[size], variants[variant], isIconOnly && styles.iconOnly, buttonDisabled && styles.disabled, useAriaDisabled && styles.ariaDisabled, renderAsLink && styles.link, !buttonGroup && styles.pressable, buttonGroup && (buttonGroup.orientation === 'horizontal' ? groupStyles.horizontal : groupStyles.vertical), buttonGroup && (variant === 'primary' || variant === 'destructive') && (buttonGroup.orientation === 'horizontal' ? groupStyles.onSolidHorizontal : groupStyles.onSolidVertical),
|
|
458
|
+
const sharedStylexProps = stylex.props(styles.base, sizeStyles[size], variants[variant], isIconOnly && styles.iconOnly, buttonDisabled && styles.disabled, useAriaDisabled && styles.ariaDisabled, renderAsLink && styles.link, !buttonGroup && styles.pressable, buttonGroup && (buttonGroup.orientation === 'horizontal' ? groupStyles.horizontal : groupStyles.vertical), buttonGroup && (variant === 'primary' || variant === 'destructive') && (buttonGroup.orientation === 'horizontal' ? groupStyles.onSolidHorizontal : groupStyles.onSolidVertical),
|
|
459
|
+
// Standalone floating buttons only — a grouped button's elevation is owned
|
|
460
|
+
// by the ButtonGroup so the shared surface lifts as one unit.
|
|
461
|
+
!buttonGroup && elevationStyles[elevation], width != null && dynamicStyles.width(width), xstyle);
|
|
434
462
|
const sharedMergedProps = mergeProps(themeProps('button', {
|
|
435
463
|
variant,
|
|
436
464
|
size
|
|
@@ -505,6 +533,7 @@ export function Button({
|
|
|
505
533
|
...ariaLabelProp,
|
|
506
534
|
...describedByProp,
|
|
507
535
|
...edgeCompAttr,
|
|
536
|
+
"aria-busy": isLoadingState || undefined,
|
|
508
537
|
onClick: handleClick,
|
|
509
538
|
children: buttonContent
|
|
510
539
|
});
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type ReactNode } from 'react';
|
|
20
20
|
import type { ButtonSize } from '../Button';
|
|
21
|
+
import type { Elevation } from '../utils/types';
|
|
21
22
|
import type { BaseProps } from '../BaseProps';
|
|
22
23
|
import type { ButtonGroupOrientation } from './ButtonGroupContext';
|
|
23
24
|
export interface ButtonGroupProps extends BaseProps<HTMLDivElement> {
|
|
@@ -42,6 +43,13 @@ export interface ButtonGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
42
43
|
* @default 'md'
|
|
43
44
|
*/
|
|
44
45
|
size?: ButtonSize;
|
|
46
|
+
/**
|
|
47
|
+
* Resting elevation for the group. The connected buttons share one surface,
|
|
48
|
+
* so the shadow sits on the group and lifts them together. Use for a floating
|
|
49
|
+
* group of actions above content.
|
|
50
|
+
* @default 'none'
|
|
51
|
+
*/
|
|
52
|
+
elevation?: Elevation;
|
|
45
53
|
/**
|
|
46
54
|
* Whether all buttons in the group are disabled.
|
|
47
55
|
* @default false
|
|
@@ -82,7 +90,7 @@ export interface ButtonGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
82
90
|
* </ButtonGroup>
|
|
83
91
|
* ```
|
|
84
92
|
*/
|
|
85
|
-
export declare function ButtonGroup({ children, label, orientation, size: sizeProp, isDisabled, xstyle, className, style, ref, 'data-testid': testId, onKeyDown, ...props }: ButtonGroupProps): ReactNode;
|
|
93
|
+
export declare function ButtonGroup({ children, label, orientation, size: sizeProp, isDisabled, elevation, xstyle, className, style, ref, 'data-testid': testId, onKeyDown, ...props }: ButtonGroupProps): ReactNode;
|
|
86
94
|
export declare namespace ButtonGroup {
|
|
87
95
|
var displayName: string;
|
|
88
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../../src/ButtonGroup/ButtonGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAE1C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,sBAAsB,CAAC;AAOjE,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEhC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAErC;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,WAA0B,EAC1B,IAAI,EAAE,QAAQ,EACd,UAAkB,EAClB,SAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,SAAS,CAwC9B;yBAtDe,WAAW"}
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { useMemo } from 'react';
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
|
+
import "../theme/tokens.stylex.js";
|
|
26
|
+
import { radiusVars, shadowVars } from "../theme/tokens.stylex.js";
|
|
25
27
|
import { SizeProvider, useSize } from "../SizeContext/SizeContext.js";
|
|
26
28
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
27
29
|
import { mergeProps, mergeRefs, composeEventHandlers } from "../utils/index.js";
|
|
@@ -48,6 +50,32 @@ const styles = {
|
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
// Resting elevation for the whole group — the connected buttons share one
|
|
54
|
+
// surface, so the shadow sits on the group wrapper and lifts them as a unit.
|
|
55
|
+
// The wrapper takes the element radius so the shadow follows the group's
|
|
56
|
+
// rounded outer corners rather than a bare rectangle. 'none' is the default.
|
|
57
|
+
const elevationStyles = {
|
|
58
|
+
none: {
|
|
59
|
+
kGVxlE: "x1gnnqk1",
|
|
60
|
+
$$css: true
|
|
61
|
+
},
|
|
62
|
+
low: {
|
|
63
|
+
kGVxlE: "x1i5ehqx",
|
|
64
|
+
kaIpWk: "xh6dtrn",
|
|
65
|
+
$$css: true
|
|
66
|
+
},
|
|
67
|
+
med: {
|
|
68
|
+
kGVxlE: "x14hfi27",
|
|
69
|
+
kaIpWk: "xh6dtrn",
|
|
70
|
+
$$css: true
|
|
71
|
+
},
|
|
72
|
+
high: {
|
|
73
|
+
kGVxlE: "x1kcpxr7",
|
|
74
|
+
kaIpWk: "xh6dtrn",
|
|
75
|
+
$$css: true
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
51
79
|
// =============================================================================
|
|
52
80
|
// Component
|
|
53
81
|
// =============================================================================
|
|
@@ -88,6 +116,7 @@ export function ButtonGroup({
|
|
|
88
116
|
orientation = 'horizontal',
|
|
89
117
|
size: sizeProp,
|
|
90
118
|
isDisabled = false,
|
|
119
|
+
elevation = 'none',
|
|
91
120
|
xstyle,
|
|
92
121
|
className,
|
|
93
122
|
style,
|
|
@@ -118,7 +147,7 @@ export function ButtonGroup({
|
|
|
118
147
|
...mergeProps(themeProps('button-group', {
|
|
119
148
|
size,
|
|
120
149
|
orientation
|
|
121
|
-
}), stylex.props(styles.group, orientation === 'vertical' && styles.vertical, xstyle), className, style),
|
|
150
|
+
}), stylex.props(styles.group, orientation === 'vertical' && styles.vertical, elevationStyles[elevation], xstyle), className, style),
|
|
122
151
|
role: "group",
|
|
123
152
|
"aria-label": label,
|
|
124
153
|
onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../../src/Calendar/Calendar.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA8C5C,YAAY,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACV,MAAM,oBAAoB,CAAC;AAK5B,+CAA+C;AAE/C,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,UAAU,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAID,UAAU,iBAAkB,SAAQ,IAAI,CACtC,SAAS,CAAC,cAAc,CAAC,EACzB,UAAU,GAAG,cAAc,CAC5B;IACC,kDAAkD;IAClD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC,qDAAqD;IACrD,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACtC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,aAAa,CAAC;IAEpB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,aAAa,CAAC;IAEpB;;;OAGG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAEzD;;;OAGG;IACH,SAA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AAQ,CAAC;IAEhB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,aAAa,CAAC;IAEtB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,KAAK,IAAI,CAAC;CAC9D;AAED,UAAU,kBAAmB,SAAQ,iBAAiB;IACpD,qBAAqB;IACrB,IAAI,EAAE,OAAO,CAAC;IAEd,0BAA0B;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAMrE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,EAAC,GAAG,EAAE,GAAG,KAAK,EAAC,EAAE,aAAa,+BAyUtD;yBAzUe,QAAQ"}
|
|
@@ -271,6 +271,10 @@ export function Calendar({
|
|
|
271
271
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
272
272
|
...stylex.props(calendarStyles.header),
|
|
273
273
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
274
|
+
...themeProps('calendar-nav', {
|
|
275
|
+
nav: 'prev',
|
|
276
|
+
disabled: !canNavigatePrevious ? 'disabled' : null
|
|
277
|
+
}),
|
|
274
278
|
label: t('@astryx.calendar.previousMonth'),
|
|
275
279
|
variant: "ghost",
|
|
276
280
|
icon:
|
|
@@ -293,6 +297,10 @@ export function Calendar({
|
|
|
293
297
|
...stylex.props(calendarStyles.monthYearLabel),
|
|
294
298
|
children: monthYearLabel
|
|
295
299
|
}), /*#__PURE__*/_jsx(Button, {
|
|
300
|
+
...themeProps('calendar-nav', {
|
|
301
|
+
nav: 'next',
|
|
302
|
+
disabled: !canNavigateNext ? 'disabled' : null
|
|
303
|
+
}),
|
|
296
304
|
label: t('@astryx.calendar.nextMonth'),
|
|
297
305
|
variant: "ghost",
|
|
298
306
|
icon: /*#__PURE__*/_jsx("span", {
|
|
@@ -662,6 +670,15 @@ function DayCell({
|
|
|
662
670
|
isOutside
|
|
663
671
|
});
|
|
664
672
|
const endpoint = isEndpoint(state);
|
|
673
|
+
|
|
674
|
+
// The day's focus-ring treatment, derived once so the reflected `marker`
|
|
675
|
+
// theme state and the StyleX ring styles below share a single source of
|
|
676
|
+
// truth. `state.isSelected` is single-select only, so a range endpoint that
|
|
677
|
+
// is today still qualifies for the today-in-range ring (unchanged prior
|
|
678
|
+
// behavior).
|
|
679
|
+
const showsTodayRing = state.isToday && !state.isSelected && !state.isInRange;
|
|
680
|
+
const showsTodayInRangeRing = state.isToday && !state.isSelected && state.isInRange;
|
|
681
|
+
const markerState = showsTodayRing ? 'today-only' : showsTodayInRangeRing ? 'today-in-range' : null;
|
|
665
682
|
const rangeRounding = computeRangeRounding(state, {
|
|
666
683
|
prevInRange: neighbors.prevInRange,
|
|
667
684
|
nextInRange: neighbors.nextInRange
|
|
@@ -698,8 +715,19 @@ function DayCell({
|
|
|
698
715
|
selected: endpoint ? 'selected' : null,
|
|
699
716
|
today: state.isToday ? 'today' : null,
|
|
700
717
|
disabled: state.effectivelyDisabled ? 'disabled' : null,
|
|
701
|
-
'in-range': state.isInRange ? 'in-range' : null
|
|
702
|
-
|
|
718
|
+
'in-range': state.isInRange ? 'in-range' : null,
|
|
719
|
+
// `marker` reflects the day's *actual* focus-ring treatment as a
|
|
720
|
+
// single compound state, so a theme can target exactly the states
|
|
721
|
+
// the ring is drawn under without needing `:not()` in the theme
|
|
722
|
+
// key. It is null unless a ring is shown:
|
|
723
|
+
// 'today-only' → today, not single-selected, not in a range
|
|
724
|
+
// 'today-in-range' → today, not single-selected, inside a range
|
|
725
|
+
// `isSelected` here is single-select only (see computeDayCellState),
|
|
726
|
+
// so a today range endpoint still shows the today-in-range ring —
|
|
727
|
+
// `marker` mirrors the StyleX conditions below exactly, preserving
|
|
728
|
+
// the default rendering.
|
|
729
|
+
marker: markerState
|
|
730
|
+
}), stylex.props(dayCellStyles.day, dayCellTheme.day, isOutside && dayCellStyles.dayOutside, isOutside && dayCellTheme.dayOutside, showsTodayRing && dayCellStyles.dayToday, showsTodayRing && dayCellTheme.dayToday, showsTodayInRangeRing && dayCellStyles.dayTodayInRange, showsTodayInRangeRing && dayCellTheme.dayTodayInRange, endpoint && dayCellStyles.daySelected, endpoint && dayCellTheme.daySelected, state.effectivelyDisabled && dayCellStyles.dayDisabled, state.effectivelyDisabled && dayCellTheme.dayDisabled)),
|
|
703
731
|
children: dayNumber
|
|
704
732
|
})]
|
|
705
733
|
});
|
|
@@ -25,7 +25,7 @@ export function computeDayCellState(input) {
|
|
|
25
25
|
} = input;
|
|
26
26
|
return {
|
|
27
27
|
effectivelyDisabled: isDisabled || isOutside,
|
|
28
|
-
isToday: plainDateIsEqual(date, today),
|
|
28
|
+
isToday: !isOutside && plainDateIsEqual(date, today),
|
|
29
29
|
isSelected: !!(!isOutside && mode === 'single' && selectedDate && plainDateIsEqual(date, selectedDate)),
|
|
30
30
|
isInRange: !!(!isOutside && mode === 'range' && rangeStart && rangeEnd && plainDateIsInRange(date, [rangeStart, rangeEnd])),
|
|
31
31
|
isRangeStart: !!(!isOutside && mode === 'range' && rangeStart && plainDateIsEqual(date, rangeStart)),
|
package/dist/Card/Card.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - /packages/cli/templates/blocks/components/Card/ (showcase blocks)
|
|
12
12
|
*/
|
|
13
13
|
import type { ReactNode } from 'react';
|
|
14
|
-
import type { SizeValue, SpacingStep } from '../utils/types';
|
|
14
|
+
import type { Elevation, SizeValue, SpacingStep } from '../utils/types';
|
|
15
15
|
import type { BaseProps } from '../BaseProps';
|
|
16
16
|
/**
|
|
17
17
|
* Background color variant for Card.
|
|
@@ -78,6 +78,12 @@ export interface CardProps extends BaseProps<HTMLDivElement> {
|
|
|
78
78
|
* @default 'default'
|
|
79
79
|
*/
|
|
80
80
|
variant?: CardVariant;
|
|
81
|
+
/**
|
|
82
|
+
* Resting elevation — the shadow depth the card sits at.
|
|
83
|
+
* `none` is flat; `low`/`med`/`high` map to the shadow token scale.
|
|
84
|
+
* @default 'none'
|
|
85
|
+
*/
|
|
86
|
+
elevation?: Elevation;
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
89
|
* A card container with border and themed styling.
|
|
@@ -113,7 +119,7 @@ export interface CardProps extends BaseProps<HTMLDivElement> {
|
|
|
113
119
|
* </Card>
|
|
114
120
|
* ```
|
|
115
121
|
*/
|
|
116
|
-
export declare function Card({ width, height, maxWidth, minHeight, children, padding, variant, xstyle, className, style, ref, ...props }: CardProps): import("react").JSX.Element;
|
|
122
|
+
export declare function Card({ width, height, maxWidth, minHeight, children, padding, variant, elevation, xstyle, className, style, ref, ...props }: CardProps): import("react").JSX.Element;
|
|
117
123
|
export declare namespace Card {
|
|
118
124
|
var displayName: string;
|
|
119
125
|
}
|
package/dist/Card/Card.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../src/Card/Card.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAiBrC,OAAO,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAO5C;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAC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