@astryxdesign/core 0.1.8 → 0.1.9-canary.02ef052
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 +58 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +240 -53
- package/dist/Avatar/AvatarStatusDot.d.ts +35 -5
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusDot.js +144 -19
- package/dist/AvatarGroup/AvatarGroup.d.ts +7 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +58 -6
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -0
- package/dist/Banner/Banner.d.ts +9 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +33 -4
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts +31 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +215 -6
- package/dist/Breadcrumbs/index.d.ts +6 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +10 -1
- package/dist/Button/Button.d.ts +8 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +33 -4
- 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 +80 -11
- package/dist/Calendar/dayCellUtils.d.ts +4 -4
- package/dist/Calendar/dayCellUtils.js +3 -3
- package/dist/Calendar/styles.d.ts +30 -31
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +30 -31
- 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 +46 -16
- 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 +36 -4
- 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 +4 -2
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +4 -4
- 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 +27 -11
- 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/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.js +5 -5
- 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/Citation/Citation.d.ts +22 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -6
- 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 +22 -9
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +3 -1
- package/dist/CommandPalette/CommandPalette.d.ts +2 -2
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +45 -4
- 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/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +14 -5
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +3 -1
- package/dist/DateInput/DateInput.d.ts +56 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +59 -21
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts +10 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +23 -20
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +33 -19
- 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/DropdownMenu.d.ts +6 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +22 -5
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -2
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +5 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +5 -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/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +104 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +427 -0
- package/dist/DropdownMenu/index.d.ts +10 -0
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +13 -0
- package/dist/DropdownMenu/menuItemHover.d.ts +23 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemHover.js +33 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts +8 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemRoles.js +10 -1
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +21 -6
- package/dist/Field/Field.d.ts +3 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +6 -4
- package/dist/Field/FieldLabel.d.ts +1 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +43 -16
- package/dist/Field/inputStyles.stylex.d.ts +1 -0
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +1 -0
- package/dist/FieldStatus/FieldStatus.d.ts +18 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +60 -6
- package/dist/FileInput/FileInput.d.ts +10 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +54 -35
- 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 +17 -6
- package/dist/Icon/Icon.d.ts +22 -3
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +19 -3
- 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/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +19 -13
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -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 +9 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +104 -50
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +16 -0
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
- package/dist/NumberInput/NumberInput.d.ts +10 -2
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +22 -17
- 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/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -3
- 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/PowerSearch.d.ts +9 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +2 -0
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/RadioList/RadioList.d.ts +2 -2
- package/dist/RadioList/RadioListItem.js +4 -4
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -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 +8 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +65 -19
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +16 -0
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +5 -5
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +13 -10
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +21 -8
- package/dist/SideNav/SideNavItem.d.ts +1 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +12 -10
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +106 -36
- package/dist/Stack/stack.stylex.d.ts +9 -9
- package/dist/Switch/Switch.d.ts +8 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +160 -91
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +33 -6
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- 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/groupedRows/useTableGroupedRows.js +15 -11
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +36 -26
- 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 +7 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -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 +105 -12
- 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/types.d.ts +32 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -3
- package/dist/TextArea/TextArea.d.ts +10 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +18 -19
- package/dist/TextInput/TextInput.d.ts +10 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -17
- 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 +10 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +32 -21
- 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/Token/Token.d.ts +30 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +17 -2
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts +10 -3
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +20 -6
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +17 -1
- 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 +3 -0
- package/dist/TreeList/TreeListBranches.d.ts +5 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +18 -10
- package/dist/TreeList/TreeListItem.d.ts +8 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +59 -21
- 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/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +20 -11
- package/dist/Typeahead/Typeahead.d.ts +9 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -1
- package/dist/Typeahead/TypeaheadItem.d.ts +1 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +20 -10
- package/dist/astryx.css +61 -39
- package/dist/astryx.umd.js +53 -53
- 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 +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/isRtlElement.d.ts +18 -0
- package/dist/hooks/isRtlElement.d.ts.map +1 -0
- package/dist/hooks/isRtlElement.js +27 -0
- 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/useGridFocus.d.ts +6 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +12 -9
- package/dist/hooks/useInputStatusIcon.d.ts +38 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -0
- package/dist/hooks/useInputStatusIcon.js +158 -0
- package/dist/hooks/useListFocus.d.ts +39 -1
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +54 -9
- 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/InternationalizationContext.d.ts +1 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -0
- package/dist/i18n/InternationalizationProvider.d.ts +8 -1
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +5 -1
- package/dist/i18n/getLocaleDirection.d.ts +18 -0
- package/dist/i18n/getLocaleDirection.d.ts.map +1 -0
- package/dist/i18n/getLocaleDirection.js +29 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +7 -1
- package/dist/i18n/resolve.d.ts.map +1 -1
- package/dist/i18n/resolve.js +7 -18
- package/dist/i18n/useDirection.d.ts +2 -0
- package/dist/i18n/useDirection.d.ts.map +1 -0
- package/dist/i18n/useDirection.js +27 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +2 -7
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +13 -0
- 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 +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -2
- package/dist/utils/plainDate.d.ts +30 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +65 -3
- package/dist/utils/rtlStyles.d.ts +24 -0
- package/dist/utils/rtlStyles.d.ts.map +1 -0
- package/dist/utils/rtlStyles.js +27 -0
- package/dist/utils/types.d.ts +13 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/locales/en.json +104 -0
- package/locales/fr-FR.json +14 -0
- package/locales/pseudo.json +78 -0
- package/package.json +6 -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 +64 -5
- package/src/Avatar/Avatar.test.tsx +374 -1
- package/src/Avatar/Avatar.tsx +367 -69
- package/src/Avatar/AvatarStatusDot.doc.mjs +23 -12
- package/src/Avatar/AvatarStatusDot.test.tsx +284 -0
- package/src/Avatar/AvatarStatusDot.tsx +180 -21
- package/src/AvatarGroup/AvatarGroup.doc.mjs +2 -0
- package/src/AvatarGroup/AvatarGroup.test.tsx +141 -1
- package/src/AvatarGroup/AvatarGroup.tsx +58 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -0
- package/src/Banner/Banner.doc.mjs +9 -0
- package/src/Banner/Banner.test.tsx +30 -0
- package/src/Banner/Banner.tsx +53 -9
- 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 +335 -2
- package/src/Breadcrumbs/index.ts +31 -0
- package/src/Button/Button.doc.mjs +9 -4
- package/src/Button/Button.test.tsx +49 -0
- package/src/Button/Button.tsx +27 -3
- 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 +362 -19
- package/src/Calendar/Calendar.tsx +111 -32
- package/src/Calendar/dayCellUtils.test.ts +23 -18
- package/src/Calendar/dayCellUtils.ts +3 -3
- package/src/Calendar/styles.ts +33 -39
- 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 +59 -10
- 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 +51 -5
- package/src/Chat/ChatContext.tsx +37 -10
- package/src/Chat/ChatDictationButton.tsx +11 -2
- package/src/Chat/ChatLayout.tsx +7 -5
- 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 +33 -5
- 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 +4 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +6 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +32 -1
- package/src/CheckboxInput/CheckboxInput.tsx +5 -5
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -0
- 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/Citation/Citation.doc.mjs +4 -3
- package/src/Citation/Citation.test.tsx +97 -0
- package/src/Citation/Citation.tsx +43 -11
- 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 +45 -10
- package/src/Collapsible/Collapsible.doc.mjs +1 -0
- package/src/Collapsible/Collapsible.test.tsx +7 -0
- package/src/Collapsible/Collapsible.tsx +16 -6
- package/src/CommandPalette/CommandPalette.doc.mjs +1 -0
- package/src/CommandPalette/CommandPalette.test.tsx +95 -1
- package/src/CommandPalette/CommandPalette.tsx +44 -3
- 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/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +235 -0
- package/src/ContextMenu/ContextMenu.tsx +13 -11
- package/src/ContextMenu/index.ts +5 -0
- package/src/DateInput/DateInput.doc.mjs +41 -0
- package/src/DateInput/DateInput.test.tsx +338 -0
- package/src/DateInput/DateInput.tsx +119 -32
- package/src/DateInput/index.ts +1 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
- package/src/DateRangeInput/DateRangeInput.test.tsx +140 -0
- package/src/DateRangeInput/DateRangeInput.tsx +42 -30
- package/src/DateTimeInput/DateTimeInput.doc.mjs +22 -1
- package/src/DateTimeInput/DateTimeInput.test.tsx +147 -0
- package/src/DateTimeInput/DateTimeInput.tsx +58 -41
- 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 +229 -0
- package/src/DropdownMenu/DropdownMenu.tsx +31 -12
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +9 -4
- package/src/DropdownMenu/DropdownMenuItem.tsx +9 -3
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +1 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +88 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +635 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +553 -0
- package/src/DropdownMenu/index.ts +16 -0
- package/src/DropdownMenu/menuItemHover.ts +39 -0
- package/src/DropdownMenu/menuItemRoles.ts +9 -0
- package/src/DropdownMenu/renderDropdownItems.tsx +29 -15
- package/src/Field/Field.test.tsx +57 -12
- package/src/Field/Field.tsx +20 -14
- package/src/Field/FieldLabel.tsx +9 -1
- package/src/Field/inputStyles.stylex.ts +2 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +17 -5
- package/src/FieldStatus/FieldStatus.test.tsx +150 -40
- package/src/FieldStatus/FieldStatus.tsx +69 -5
- package/src/FileInput/FileInput.doc.mjs +23 -2
- package/src/FileInput/FileInput.test.tsx +135 -12
- package/src/FileInput/FileInput.tsx +65 -51
- 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 +39 -5
- package/src/Icon/Icon.doc.mjs +16 -2
- package/src/Icon/Icon.test.tsx +89 -0
- package/src/Icon/Icon.tsx +58 -5
- 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/Lightbox/Lightbox.tsx +15 -7
- package/src/List/List.test.tsx +9 -8
- package/src/Markdown/Markdown.test.tsx +21 -0
- package/src/Markdown/Markdown.tsx +4 -0
- 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 +24 -2
- package/src/MultiSelector/MultiSelector.test.tsx +498 -3
- package/src/MultiSelector/MultiSelector.tsx +149 -65
- package/src/MultiSelector/hooks.ts +17 -0
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +21 -0
- package/src/NumberInput/NumberInput.test.tsx +82 -7
- package/src/NumberInput/NumberInput.tsx +36 -28
- 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/Pagination/Pagination.tsx +11 -3
- package/src/Popover/Popover.tsx +7 -4
- package/src/Popover/usePopover.tsx +9 -13
- package/src/PowerSearch/PowerSearch.doc.mjs +29 -0
- package/src/PowerSearch/PowerSearch.test.tsx +43 -0
- package/src/PowerSearch/PowerSearch.tsx +10 -1
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +67 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -1
- package/src/PowerSearch/usePowerSearchSource.ts +1 -2
- package/src/RadioList/RadioList.doc.mjs +6 -0
- package/src/RadioList/RadioList.tsx +2 -2
- package/src/RadioList/RadioListItem.tsx +4 -4
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -0
- 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.doc.mjs +15 -0
- package/src/Selector/Selector.test.tsx +417 -0
- package/src/Selector/Selector.tsx +86 -21
- package/src/Selector/hooks.ts +17 -0
- package/src/SideNav/SideNav.test.tsx +119 -3
- package/src/SideNav/SideNav.tsx +1 -8
- package/src/SideNav/SideNavCollapseButton.tsx +15 -8
- package/src/SideNav/SideNavHeading.tsx +24 -8
- package/src/SideNav/SideNavItem.tsx +10 -4
- package/src/Slider/Slider.doc.mjs +6 -0
- package/src/Slider/Slider.test.tsx +314 -13
- package/src/Slider/Slider.tsx +117 -28
- package/src/Switch/Switch.doc.mjs +142 -42
- package/src/Switch/Switch.test.tsx +54 -1
- package/src/Switch/Switch.tsx +90 -33
- package/src/TabList/Tab.tsx +2 -2
- package/src/TabList/TabMenu.tsx +2 -2
- package/src/Table/BaseTable.tsx +37 -7
- package/src/Table/Table.doc.mjs +11 -0
- package/src/Table/Table.test.tsx +85 -0
- package/src/Table/TableCell.tsx +3 -3
- package/src/Table/TableHeaderCell.tsx +3 -3
- package/src/Table/index.ts +5 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +15 -8
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +24 -17
- 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 +77 -3
- package/src/Table/plugins/selection/useTableSelection.tsx +22 -1
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -1
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +135 -3
- package/src/Table/plugins/tree/useTableTreeData.tsx +139 -8
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +104 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +46 -2
- package/src/Table/types.ts +33 -0
- 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.doc.mjs +21 -0
- package/src/TextArea/TextArea.test.tsx +32 -1
- package/src/TextArea/TextArea.tsx +27 -26
- package/src/TextInput/TextInput.doc.mjs +21 -0
- package/src/TextInput/TextInput.test.tsx +150 -0
- package/src/TextInput/TextInput.tsx +28 -25
- package/src/Thumbnail/Thumbnail.doc.mjs +19 -10
- package/src/Thumbnail/Thumbnail.test.tsx +98 -7
- package/src/Thumbnail/Thumbnail.tsx +142 -42
- package/src/Thumbnail/thumbnail.markers.stylex.ts +12 -0
- package/src/TimeInput/TimeInput.doc.mjs +21 -0
- package/src/TimeInput/TimeInput.test.tsx +99 -1
- package/src/TimeInput/TimeInput.tsx +43 -31
- 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/Token/Token.test.tsx +21 -15
- package/src/Token/Token.tsx +31 -14
- package/src/Token/index.ts +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +38 -2
- package/src/Tokenizer/Tokenizer.test.tsx +206 -2
- package/src/Tokenizer/Tokenizer.tsx +30 -6
- package/src/Tooltip/Tooltip.test.tsx +46 -0
- package/src/Tooltip/useTooltip.tsx +20 -0
- 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 +28 -0
- package/src/TreeList/TreeList.test.tsx +272 -0
- package/src/TreeList/TreeList.tsx +23 -2
- package/src/TreeList/TreeListBranches.tsx +24 -8
- package/src/TreeList/TreeListItem.tsx +84 -22
- package/src/TreeList/TreeListTypes.ts +27 -1
- package/src/TreeList/index.ts +2 -2
- package/src/Typeahead/BaseTypeahead.tsx +30 -15
- package/src/Typeahead/Typeahead.doc.mjs +13 -0
- package/src/Typeahead/Typeahead.test.tsx +50 -0
- package/src/Typeahead/Typeahead.tsx +11 -1
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/__tests__/inputWidthContract.test.tsx +62 -0
- package/src/authoring/doc.ts +1 -3
- package/src/doc-mjs.d.ts +19 -0
- 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 +8 -0
- package/src/hooks/isRtlElement.ts +27 -0
- package/src/hooks/useDevWarning.test.tsx +45 -0
- package/src/hooks/useDevWarning.ts +54 -0
- package/src/hooks/useGridFocus.doc.mjs +3 -3
- package/src/hooks/useGridFocus.test.tsx +41 -0
- package/src/hooks/useGridFocus.ts +21 -10
- package/src/hooks/useInputStatusIcon.test.tsx +162 -0
- package/src/hooks/useInputStatusIcon.tsx +224 -0
- package/src/hooks/useListFocus.doc.mjs +25 -3
- package/src/hooks/useListFocus.test.tsx +153 -1
- package/src/hooks/useListFocus.ts +102 -9
- package/src/hooks/useOverflow.test.ts +96 -4
- package/src/hooks/useOverflow.ts +74 -33
- package/src/i18n/InternationalizationContext.ts +4 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +99 -2
- package/src/i18n/InternationalizationProvider.tsx +12 -2
- package/src/i18n/__tests__/getLocaleDirection.test.ts +40 -0
- package/src/i18n/__tests__/useDirection.test.tsx +66 -0
- package/src/i18n/getLocaleDirection.ts +29 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/resolve.ts +9 -21
- package/src/i18n/useDirection.ts +29 -0
- package/src/reset.css +0 -26
- package/src/reset.test.ts +60 -0
- package/src/theme/Theme.tsx +11 -14
- package/src/theme/derivedVarRegistry.test.ts +1 -0
- package/src/theme/derivedVarRegistry.ts +6 -0
- package/src/theme/generateThemeRules.test.ts +107 -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 +8 -0
- package/src/utils/plainDate.test.ts +46 -6
- package/src/utils/plainDate.ts +69 -3
- package/src/utils/rtlStyles.ts +27 -0
- package/src/utils/types.ts +14 -0
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
DATE_FORMAT_WITH_WEEKDAY,
|
|
58
58
|
DATE_FORMAT_MONTH_YEAR,
|
|
59
59
|
} from '../utils/plainDate';
|
|
60
|
-
import {mergeProps, composeEventHandlers} from '../utils';
|
|
60
|
+
import {mergeProps, composeEventHandlers, rtlStyles} from '../utils';
|
|
61
61
|
import {
|
|
62
62
|
computeDayCellState,
|
|
63
63
|
computeRangeRounding,
|
|
@@ -411,8 +411,16 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
411
411
|
} else {
|
|
412
412
|
// Range mode
|
|
413
413
|
if (rangeSelectionStart === null) {
|
|
414
|
-
// First click - start the range
|
|
414
|
+
// First click - start the range. Nothing else about this pick is
|
|
415
|
+
// perceivable non-visually (WCAG 1.3.1) — the grid doesn't move, so
|
|
416
|
+
// the month-change announcement stays silent — so speak the range
|
|
417
|
+
// progress through the same polite live region.
|
|
415
418
|
setRangeSelectionStart(iso);
|
|
419
|
+
announce(
|
|
420
|
+
t('@astryx.calendar.rangeStartAnnounce', {
|
|
421
|
+
date: plainDateFormat(date, DATE_FORMAT_WITH_WEEKDAY),
|
|
422
|
+
}),
|
|
423
|
+
);
|
|
416
424
|
} else {
|
|
417
425
|
// Second click - complete the range
|
|
418
426
|
const startPd = plainDateFromISO(rangeSelectionStart);
|
|
@@ -432,10 +440,24 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
432
440
|
setInternalValue(range);
|
|
433
441
|
setRangeSelectionStart(null);
|
|
434
442
|
(onChange as CalendarRangeProps['onChange'])?.(range);
|
|
443
|
+
// Completed-range announcement, in chronological order (matches the
|
|
444
|
+
// swapped {start, end} above even for a reverse pick).
|
|
445
|
+
announce(
|
|
446
|
+
t('@astryx.calendar.rangeCompleteAnnounce', {
|
|
447
|
+
start: plainDateFormat(
|
|
448
|
+
plainDateFromISO(start),
|
|
449
|
+
DATE_FORMAT_WITH_WEEKDAY,
|
|
450
|
+
),
|
|
451
|
+
end: plainDateFormat(
|
|
452
|
+
plainDateFromISO(end),
|
|
453
|
+
DATE_FORMAT_WITH_WEEKDAY,
|
|
454
|
+
),
|
|
455
|
+
}),
|
|
456
|
+
);
|
|
435
457
|
}
|
|
436
458
|
}
|
|
437
459
|
},
|
|
438
|
-
[mode, onChange, rangeSelectionStart],
|
|
460
|
+
[mode, onChange, rangeSelectionStart, announce, t],
|
|
439
461
|
);
|
|
440
462
|
|
|
441
463
|
return (
|
|
@@ -452,13 +474,17 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
452
474
|
{/* Header with navigation */}
|
|
453
475
|
<div {...stylex.props(calendarStyles.header)}>
|
|
454
476
|
<Button
|
|
477
|
+
{...themeProps('calendar-nav', {
|
|
478
|
+
nav: 'prev',
|
|
479
|
+
disabled: !canNavigatePrevious ? 'disabled' : null,
|
|
480
|
+
})}
|
|
455
481
|
label={t('@astryx.calendar.previousMonth')}
|
|
456
482
|
variant="ghost"
|
|
457
483
|
icon={
|
|
458
484
|
// Wrapper span (not Icon props): Icon's string mode clobbers
|
|
459
485
|
// caller classNames, so the RTL mirror must live on its own
|
|
460
486
|
// element.
|
|
461
|
-
<span {...stylex.props(calendarStyles.navIcon)}>
|
|
487
|
+
<span {...stylex.props(calendarStyles.navIcon, rtlStyles.mirror)}>
|
|
462
488
|
<Icon icon="chevronLeft" size="sm" color="inherit" />
|
|
463
489
|
</span>
|
|
464
490
|
}
|
|
@@ -472,10 +498,14 @@ export function Calendar({ref, ...props}: CalendarProps) {
|
|
|
472
498
|
</span>
|
|
473
499
|
|
|
474
500
|
<Button
|
|
501
|
+
{...themeProps('calendar-nav', {
|
|
502
|
+
nav: 'next',
|
|
503
|
+
disabled: !canNavigateNext ? 'disabled' : null,
|
|
504
|
+
})}
|
|
475
505
|
label={t('@astryx.calendar.nextMonth')}
|
|
476
506
|
variant="ghost"
|
|
477
507
|
icon={
|
|
478
|
-
<span {...stylex.props(calendarStyles.navIcon)}>
|
|
508
|
+
<span {...stylex.props(calendarStyles.navIcon, rtlStyles.mirror)}>
|
|
479
509
|
<Icon icon="chevronRight" size="sm" color="inherit" />
|
|
480
510
|
</span>
|
|
481
511
|
}
|
|
@@ -782,6 +812,9 @@ function MonthGrid({
|
|
|
782
812
|
ref={gridRef}
|
|
783
813
|
role="grid"
|
|
784
814
|
aria-label={monthLabel}
|
|
815
|
+
// APG grid pattern: a range selection holds multiple selected cells,
|
|
816
|
+
// so the grid must advertise multi-selectability.
|
|
817
|
+
aria-multiselectable={mode === 'range' ? true : undefined}
|
|
785
818
|
onKeyDown={handleGridKeyDown}
|
|
786
819
|
onFocus={handleGridFocus}
|
|
787
820
|
{...stylex.props(
|
|
@@ -856,6 +889,7 @@ function MonthGrid({
|
|
|
856
889
|
isDisabled={isDateDisabled(day.date)}
|
|
857
890
|
neighbors={neighbors}
|
|
858
891
|
isTabbable={day.iso === seedTabbableIso}
|
|
892
|
+
isRangeSelectionInProgress={rangeSelectionStart !== null}
|
|
859
893
|
onDayClick={onDayClick}
|
|
860
894
|
onDayHover={onDayHover}
|
|
861
895
|
/>
|
|
@@ -897,6 +931,13 @@ interface DayCellProps {
|
|
|
897
931
|
* existing `tabindex="0"` and repairs/moves it on navigation and focus.
|
|
898
932
|
*/
|
|
899
933
|
isTabbable: boolean;
|
|
934
|
+
/**
|
|
935
|
+
* Whether a range selection is mid-flight (first pick made, awaiting the
|
|
936
|
+
* second). Disambiguates the accessible name of the picked day: mid-flight
|
|
937
|
+
* it is only the "range start", while a completed one-day range is both
|
|
938
|
+
* "range start and range end" (rangeStart === rangeEnd in both cases).
|
|
939
|
+
*/
|
|
940
|
+
isRangeSelectionInProgress: boolean;
|
|
900
941
|
onDayClick: (date: PlainDate) => void;
|
|
901
942
|
onDayHover: (date: PlainDate | null) => void;
|
|
902
943
|
}
|
|
@@ -915,9 +956,11 @@ function DayCell({
|
|
|
915
956
|
isDisabled,
|
|
916
957
|
neighbors,
|
|
917
958
|
isTabbable: isTabbableDay,
|
|
959
|
+
isRangeSelectionInProgress,
|
|
918
960
|
onDayClick,
|
|
919
961
|
onDayHover,
|
|
920
962
|
}: DayCellProps) {
|
|
963
|
+
const t = useTranslator();
|
|
921
964
|
const {date, isOutside, dayNumber} = day;
|
|
922
965
|
|
|
923
966
|
if (isOutside && !hasOutsideDays) {
|
|
@@ -941,6 +984,43 @@ function DayCell({
|
|
|
941
984
|
});
|
|
942
985
|
|
|
943
986
|
const endpoint = isEndpoint(state);
|
|
987
|
+
|
|
988
|
+
// The day's focus-ring treatment, derived once so the reflected `marker`
|
|
989
|
+
// theme state and the StyleX ring styles below share a single source of
|
|
990
|
+
// truth. `state.isSelected` is single-select only, so a range endpoint that
|
|
991
|
+
// is today still qualifies for the today-in-range ring (unchanged prior
|
|
992
|
+
// behavior).
|
|
993
|
+
const showsTodayRing = state.isToday && !state.isSelected && !state.isInRange;
|
|
994
|
+
const showsTodayInRangeRing =
|
|
995
|
+
state.isToday && !state.isSelected && state.isInRange;
|
|
996
|
+
const markerState: 'today-only' | 'today-in-range' | null = showsTodayRing
|
|
997
|
+
? 'today-only'
|
|
998
|
+
: showsTodayInRangeRing
|
|
999
|
+
? 'today-in-range'
|
|
1000
|
+
: null;
|
|
1001
|
+
|
|
1002
|
+
// Accessible name for the day button. Roving focus lands on the <button>,
|
|
1003
|
+
// not the role="gridcell" wrapper that carries aria-selected — and
|
|
1004
|
+
// aria-selected is invalid on role="button" — so the selection/range state
|
|
1005
|
+
// must be encoded into the button's name (WCAG 4.1.2). Localized via ICU
|
|
1006
|
+
// params rather than string concatenation. A mid-flight first pick (where
|
|
1007
|
+
// rangeStart === rangeEnd) reads as "range start" only; a completed one-day
|
|
1008
|
+
// range reads as both start and end.
|
|
1009
|
+
const dateLabel = plainDateFormat(date, DATE_FORMAT_WITH_WEEKDAY);
|
|
1010
|
+
const dayLabel = state.isSelected
|
|
1011
|
+
? t('@astryx.calendar.daySelected', {date: dateLabel})
|
|
1012
|
+
: state.isRangeStart && state.isRangeEnd
|
|
1013
|
+
? isRangeSelectionInProgress
|
|
1014
|
+
? t('@astryx.calendar.dayRangeStart', {date: dateLabel})
|
|
1015
|
+
: t('@astryx.calendar.dayRangeStartAndEnd', {date: dateLabel})
|
|
1016
|
+
: state.isRangeStart
|
|
1017
|
+
? t('@astryx.calendar.dayRangeStart', {date: dateLabel})
|
|
1018
|
+
: state.isRangeEnd
|
|
1019
|
+
? t('@astryx.calendar.dayRangeEnd', {date: dateLabel})
|
|
1020
|
+
: state.isInRange
|
|
1021
|
+
? t('@astryx.calendar.dayInRange', {date: dateLabel})
|
|
1022
|
+
: dateLabel;
|
|
1023
|
+
|
|
944
1024
|
const rangeRounding = computeRangeRounding(state, {
|
|
945
1025
|
prevInRange: neighbors.prevInRange,
|
|
946
1026
|
nextInRange: neighbors.nextInRange,
|
|
@@ -961,16 +1041,16 @@ function DayCell({
|
|
|
961
1041
|
{...stylex.props(
|
|
962
1042
|
dayCellStyles.rangeBg,
|
|
963
1043
|
dayCellTheme.rangeBg,
|
|
964
|
-
rangeRounding.
|
|
965
|
-
rangeRounding.
|
|
966
|
-
state.isRangeStart && dayCellStyles.
|
|
1044
|
+
rangeRounding.roundStart && dayCellStyles.rangeBgRadiusStart,
|
|
1045
|
+
rangeRounding.roundEnd && dayCellStyles.rangeBgRadiusEnd,
|
|
1046
|
+
state.isRangeStart && dayCellStyles.rangeInsetStart,
|
|
967
1047
|
state.isRangeStart &&
|
|
968
|
-
rangeRounding.
|
|
969
|
-
dayCellStyles.
|
|
970
|
-
state.isRangeEnd && dayCellStyles.
|
|
1048
|
+
rangeRounding.roundEnd &&
|
|
1049
|
+
dayCellStyles.rangeInsetEnd,
|
|
1050
|
+
state.isRangeEnd && dayCellStyles.rangeInsetEnd,
|
|
971
1051
|
state.isRangeStart &&
|
|
972
|
-
rangeRounding.
|
|
973
|
-
dayCellStyles.
|
|
1052
|
+
rangeRounding.roundStart &&
|
|
1053
|
+
dayCellStyles.rangeInsetStart,
|
|
974
1054
|
)}
|
|
975
1055
|
/>
|
|
976
1056
|
)}
|
|
@@ -981,8 +1061,8 @@ function DayCell({
|
|
|
981
1061
|
{...stylex.props(
|
|
982
1062
|
dayCellStyles.previewBg,
|
|
983
1063
|
dayCellTheme.previewBg,
|
|
984
|
-
previewRounding.
|
|
985
|
-
previewRounding.
|
|
1064
|
+
previewRounding.roundStart && dayCellStyles.previewBgRadiusStart,
|
|
1065
|
+
previewRounding.roundEnd && dayCellStyles.previewBgRadiusEnd,
|
|
986
1066
|
state.isPreviewStart && dayCellStyles.previewStart,
|
|
987
1067
|
state.isPreviewEnd && dayCellStyles.previewEnd,
|
|
988
1068
|
)}
|
|
@@ -993,7 +1073,7 @@ function DayCell({
|
|
|
993
1073
|
<button
|
|
994
1074
|
type="button"
|
|
995
1075
|
data-date={day.iso}
|
|
996
|
-
aria-label={
|
|
1076
|
+
aria-label={dayLabel}
|
|
997
1077
|
aria-disabled={state.effectivelyDisabled || undefined}
|
|
998
1078
|
// Mark today's cell programmatically (APG date-picker pattern), not just
|
|
999
1079
|
// visually, so screen-reader users can identify the current date.
|
|
@@ -1010,28 +1090,27 @@ function DayCell({
|
|
|
1010
1090
|
today: state.isToday ? 'today' : null,
|
|
1011
1091
|
disabled: state.effectivelyDisabled ? 'disabled' : null,
|
|
1012
1092
|
'in-range': state.isInRange ? 'in-range' : null,
|
|
1093
|
+
// `marker` reflects the day's *actual* focus-ring treatment as a
|
|
1094
|
+
// single compound state, so a theme can target exactly the states
|
|
1095
|
+
// the ring is drawn under without needing `:not()` in the theme
|
|
1096
|
+
// key. It is null unless a ring is shown:
|
|
1097
|
+
// 'today-only' → today, not single-selected, not in a range
|
|
1098
|
+
// 'today-in-range' → today, not single-selected, inside a range
|
|
1099
|
+
// `isSelected` here is single-select only (see computeDayCellState),
|
|
1100
|
+
// so a today range endpoint still shows the today-in-range ring —
|
|
1101
|
+
// `marker` mirrors the StyleX conditions below exactly, preserving
|
|
1102
|
+
// the default rendering.
|
|
1103
|
+
marker: markerState,
|
|
1013
1104
|
}),
|
|
1014
1105
|
stylex.props(
|
|
1015
1106
|
dayCellStyles.day,
|
|
1016
1107
|
dayCellTheme.day,
|
|
1017
1108
|
isOutside && dayCellStyles.dayOutside,
|
|
1018
1109
|
isOutside && dayCellTheme.dayOutside,
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
state.isToday &&
|
|
1024
|
-
!state.isSelected &&
|
|
1025
|
-
!state.isInRange &&
|
|
1026
|
-
dayCellTheme.dayToday,
|
|
1027
|
-
state.isToday &&
|
|
1028
|
-
!state.isSelected &&
|
|
1029
|
-
state.isInRange &&
|
|
1030
|
-
dayCellStyles.dayTodayInRange,
|
|
1031
|
-
state.isToday &&
|
|
1032
|
-
!state.isSelected &&
|
|
1033
|
-
state.isInRange &&
|
|
1034
|
-
dayCellTheme.dayTodayInRange,
|
|
1110
|
+
showsTodayRing && dayCellStyles.dayToday,
|
|
1111
|
+
showsTodayRing && dayCellTheme.dayToday,
|
|
1112
|
+
showsTodayInRangeRing && dayCellStyles.dayTodayInRange,
|
|
1113
|
+
showsTodayInRangeRing && dayCellTheme.dayTodayInRange,
|
|
1035
1114
|
endpoint && dayCellStyles.daySelected,
|
|
1036
1115
|
endpoint && dayCellTheme.daySelected,
|
|
1037
1116
|
state.effectivelyDisabled && dayCellStyles.dayDisabled,
|
|
@@ -45,6 +45,11 @@ describe('computeDayCellState', () => {
|
|
|
45
45
|
expect(state.isToday).toBe(false);
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
+
it('does not identify an outside day as today', () => {
|
|
49
|
+
const state = computeDayCellState(makeInput({isOutside: true}));
|
|
50
|
+
expect(state.isToday).toBe(false);
|
|
51
|
+
});
|
|
52
|
+
|
|
48
53
|
it('identifies selected day in single mode', () => {
|
|
49
54
|
const state = computeDayCellState(
|
|
50
55
|
makeInput({selectedDate: plainDateFromISO('2024-03-15')}),
|
|
@@ -176,8 +181,8 @@ describe('computeRangeRounding', () => {
|
|
|
176
181
|
}),
|
|
177
182
|
);
|
|
178
183
|
const rounding = computeRangeRounding(state);
|
|
179
|
-
expect(rounding.
|
|
180
|
-
expect(rounding.
|
|
184
|
+
expect(rounding.roundStart).toBe(true);
|
|
185
|
+
expect(rounding.roundEnd).toBe(false);
|
|
181
186
|
});
|
|
182
187
|
|
|
183
188
|
it('rounds left at first column even without range start', () => {
|
|
@@ -191,7 +196,7 @@ describe('computeRangeRounding', () => {
|
|
|
191
196
|
}),
|
|
192
197
|
);
|
|
193
198
|
const rounding = computeRangeRounding(state);
|
|
194
|
-
expect(rounding.
|
|
199
|
+
expect(rounding.roundStart).toBe(true);
|
|
195
200
|
});
|
|
196
201
|
|
|
197
202
|
it('rounds right at last column', () => {
|
|
@@ -205,7 +210,7 @@ describe('computeRangeRounding', () => {
|
|
|
205
210
|
}),
|
|
206
211
|
);
|
|
207
212
|
const rounding = computeRangeRounding(state);
|
|
208
|
-
expect(rounding.
|
|
213
|
+
expect(rounding.roundEnd).toBe(true);
|
|
209
214
|
});
|
|
210
215
|
|
|
211
216
|
// #2715 follow-up: cap the highlight where the range meets a disabled or
|
|
@@ -225,8 +230,8 @@ describe('computeRangeRounding', () => {
|
|
|
225
230
|
prevInRange: true,
|
|
226
231
|
nextInRange: false,
|
|
227
232
|
});
|
|
228
|
-
expect(rounding.
|
|
229
|
-
expect(rounding.
|
|
233
|
+
expect(rounding.roundStart).toBe(false);
|
|
234
|
+
expect(rounding.roundEnd).toBe(true);
|
|
230
235
|
});
|
|
231
236
|
|
|
232
237
|
it('caps the left edge when the previous day breaks the range', () => {
|
|
@@ -243,8 +248,8 @@ describe('computeRangeRounding', () => {
|
|
|
243
248
|
prevInRange: false,
|
|
244
249
|
nextInRange: true,
|
|
245
250
|
});
|
|
246
|
-
expect(rounding.
|
|
247
|
-
expect(rounding.
|
|
251
|
+
expect(rounding.roundStart).toBe(true);
|
|
252
|
+
expect(rounding.roundEnd).toBe(false);
|
|
248
253
|
});
|
|
249
254
|
|
|
250
255
|
it('does not cap a mid-range day when both neighbours continue the range', () => {
|
|
@@ -261,8 +266,8 @@ describe('computeRangeRounding', () => {
|
|
|
261
266
|
prevInRange: true,
|
|
262
267
|
nextInRange: true,
|
|
263
268
|
});
|
|
264
|
-
expect(rounding.
|
|
265
|
-
expect(rounding.
|
|
269
|
+
expect(rounding.roundStart).toBe(false);
|
|
270
|
+
expect(rounding.roundEnd).toBe(false);
|
|
266
271
|
});
|
|
267
272
|
});
|
|
268
273
|
|
|
@@ -308,8 +313,8 @@ describe('computePreviewRounding', () => {
|
|
|
308
313
|
}),
|
|
309
314
|
);
|
|
310
315
|
const rounding = computePreviewRounding(state);
|
|
311
|
-
expect(rounding.
|
|
312
|
-
expect(rounding.
|
|
316
|
+
expect(rounding.roundStart).toBe(true);
|
|
317
|
+
expect(rounding.roundEnd).toBe(false);
|
|
313
318
|
});
|
|
314
319
|
|
|
315
320
|
// #2715: the hover preview needs the same disabled/outside caps as the
|
|
@@ -327,8 +332,8 @@ describe('computePreviewRounding', () => {
|
|
|
327
332
|
prevInPreview: true,
|
|
328
333
|
nextInPreview: false,
|
|
329
334
|
});
|
|
330
|
-
expect(rounding.
|
|
331
|
-
expect(rounding.
|
|
335
|
+
expect(rounding.roundStart).toBe(false);
|
|
336
|
+
expect(rounding.roundEnd).toBe(true);
|
|
332
337
|
});
|
|
333
338
|
|
|
334
339
|
it('caps the left edge when the previous day breaks the preview run', () => {
|
|
@@ -344,8 +349,8 @@ describe('computePreviewRounding', () => {
|
|
|
344
349
|
prevInPreview: false,
|
|
345
350
|
nextInPreview: true,
|
|
346
351
|
});
|
|
347
|
-
expect(rounding.
|
|
348
|
-
expect(rounding.
|
|
352
|
+
expect(rounding.roundStart).toBe(true);
|
|
353
|
+
expect(rounding.roundEnd).toBe(false);
|
|
349
354
|
});
|
|
350
355
|
|
|
351
356
|
it('does not cap a mid-preview day when both neighbours continue', () => {
|
|
@@ -361,8 +366,8 @@ describe('computePreviewRounding', () => {
|
|
|
361
366
|
prevInPreview: true,
|
|
362
367
|
nextInPreview: true,
|
|
363
368
|
});
|
|
364
|
-
expect(rounding.
|
|
365
|
-
expect(rounding.
|
|
369
|
+
expect(rounding.roundStart).toBe(false);
|
|
370
|
+
expect(rounding.roundEnd).toBe(false);
|
|
366
371
|
});
|
|
367
372
|
});
|
|
368
373
|
|
|
@@ -56,7 +56,7 @@ export function computeDayCellState(input: DayCellStateInput): DayCellState {
|
|
|
56
56
|
|
|
57
57
|
return {
|
|
58
58
|
effectivelyDisabled: isDisabled || isOutside,
|
|
59
|
-
isToday: plainDateIsEqual(date, today),
|
|
59
|
+
isToday: !isOutside && plainDateIsEqual(date, today),
|
|
60
60
|
isSelected: !!(
|
|
61
61
|
!isOutside &&
|
|
62
62
|
mode === 'single' &&
|
|
@@ -123,8 +123,8 @@ function computeHighlightRounding(input: {
|
|
|
123
123
|
const nextBreaks =
|
|
124
124
|
input.nextContinues !== undefined ? !input.nextContinues : false;
|
|
125
125
|
return {
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
roundStart: input.isStart || input.isFirstColumn || prevBreaks,
|
|
127
|
+
roundEnd: input.isEnd || input.isLastColumn || nextBreaks,
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
|
package/src/Calendar/styles.ts
CHANGED
|
@@ -65,18 +65,12 @@ export const calendarStyles = stylex.create({
|
|
|
65
65
|
borderWidth: 0,
|
|
66
66
|
},
|
|
67
67
|
/**
|
|
68
|
-
* Wrapper for the month nav chevrons.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* Keyed on the dir attribute (dir="rtl"), same as MobileNav's drawer
|
|
72
|
-
* transform — bare CSS `direction: rtl` alone won't trigger it.
|
|
68
|
+
* Wrapper for the month nav chevrons. RTL mirroring is applied by
|
|
69
|
+
* composing the shared `rtlStyles.mirror` transform onto this wrapper
|
|
70
|
+
* at the call site (see Calendar.tsx).
|
|
73
71
|
*/
|
|
74
72
|
navIcon: {
|
|
75
73
|
display: 'inline-flex',
|
|
76
|
-
transform: {
|
|
77
|
-
default: null,
|
|
78
|
-
':is([dir="rtl"] *)': 'scaleX(-1)',
|
|
79
|
-
},
|
|
80
74
|
},
|
|
81
75
|
});
|
|
82
76
|
|
|
@@ -145,24 +139,24 @@ export const dayCellStyles = stylex.create({
|
|
|
145
139
|
position: 'absolute',
|
|
146
140
|
top: '2px',
|
|
147
141
|
bottom: '2px',
|
|
148
|
-
|
|
149
|
-
|
|
142
|
+
insetInlineStart: 0,
|
|
143
|
+
insetInlineEnd: 0,
|
|
150
144
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
rangeBgRadiusStart: {
|
|
146
|
+
insetInlineStart: '2px',
|
|
147
|
+
borderStartStartRadius: radiusVars['--radius-full'],
|
|
148
|
+
borderEndStartRadius: radiusVars['--radius-full'],
|
|
155
149
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
150
|
+
rangeBgRadiusEnd: {
|
|
151
|
+
insetInlineEnd: '2px',
|
|
152
|
+
borderStartEndRadius: radiusVars['--radius-full'],
|
|
153
|
+
borderEndEndRadius: radiusVars['--radius-full'],
|
|
160
154
|
},
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
rangeInsetStart: {
|
|
156
|
+
insetInlineStart: '2px',
|
|
163
157
|
},
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
rangeInsetEnd: {
|
|
159
|
+
insetInlineEnd: '2px',
|
|
166
160
|
},
|
|
167
161
|
|
|
168
162
|
// Preview background - structural positioning
|
|
@@ -170,28 +164,28 @@ export const dayCellStyles = stylex.create({
|
|
|
170
164
|
position: 'absolute',
|
|
171
165
|
top: '2px',
|
|
172
166
|
bottom: '2px',
|
|
173
|
-
|
|
174
|
-
|
|
167
|
+
insetInlineStart: 0,
|
|
168
|
+
insetInlineEnd: 0,
|
|
175
169
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
170
|
+
previewBgRadiusStart: {
|
|
171
|
+
insetInlineStart: '2px',
|
|
172
|
+
borderStartStartRadius: radiusVars['--radius-full'],
|
|
173
|
+
borderEndStartRadius: radiusVars['--radius-full'],
|
|
180
174
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
175
|
+
previewBgRadiusEnd: {
|
|
176
|
+
insetInlineEnd: '2px',
|
|
177
|
+
borderStartEndRadius: radiusVars['--radius-full'],
|
|
178
|
+
borderEndEndRadius: radiusVars['--radius-full'],
|
|
185
179
|
},
|
|
186
180
|
previewStart: {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
181
|
+
insetInlineStart: '2px',
|
|
182
|
+
borderStartStartRadius: radiusVars['--radius-full'],
|
|
183
|
+
borderEndStartRadius: radiusVars['--radius-full'],
|
|
190
184
|
},
|
|
191
185
|
previewEnd: {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
186
|
+
insetInlineEnd: '2px',
|
|
187
|
+
borderStartEndRadius: radiusVars['--radius-full'],
|
|
188
|
+
borderEndEndRadius: radiusVars['--radius-full'],
|
|
195
189
|
},
|
|
196
190
|
|
|
197
191
|
// Day button - structural
|
package/src/Card/Card.doc.mjs
CHANGED
|
@@ -67,6 +67,13 @@ export const docs = {
|
|
|
67
67
|
'Background color variant. `default` uses the standard card background. `transparent` drops the background entirely. `muted` uses the muted background for de-emphasised cards. The non-semantic variants use the corresponding `--color-background-<name>` token.',
|
|
68
68
|
default: "'default'",
|
|
69
69
|
},
|
|
70
|
+
{
|
|
71
|
+
name: 'elevation',
|
|
72
|
+
type: "'none' | 'low' | 'med' | 'high'",
|
|
73
|
+
description:
|
|
74
|
+
'Resting shadow depth. `none` is flat; `low`/`med`/`high` map to the shadow token scale. Raise a card only when it needs to float above surrounding content.',
|
|
75
|
+
default: "'none'",
|
|
76
|
+
},
|
|
70
77
|
],
|
|
71
78
|
playground: {
|
|
72
79
|
defaults: {
|
|
@@ -127,6 +134,7 @@ export const docsZh = {
|
|
|
127
134
|
{name: 'minHeight', type: 'SizeValue', description: '卡片最小高度。'},
|
|
128
135
|
{name: 'children', type: 'ReactNode', description: '在卡片内部渲染的内容。'},
|
|
129
136
|
{name: 'padding', type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10', description: '使用间距比例的内边距。', default: '4'},
|
|
137
|
+
{name: 'elevation', type: "'none' | 'low' | 'med' | 'high'", description: '静止阴影深度。`none` 为扁平;`low`/`med`/`high` 对应阴影令牌比例。', default: "'none'"},
|
|
130
138
|
],
|
|
131
139
|
theming: {
|
|
132
140
|
container: true,
|
|
@@ -170,5 +178,6 @@ export const docsDense = {
|
|
|
170
178
|
children: 'content inside card',
|
|
171
179
|
padding: 'internal padding via spacing scale',
|
|
172
180
|
variant: 'background color variant; `default` = standard card bg, `transparent` = no background at all, `muted` = muted bg for de-emphasised cards; non-semantic variants use the corresponding `--color-background-<name>` token',
|
|
181
|
+
elevation: 'resting shadow depth: none (flat) | low | med | high (shadow token scale). Raise only to float above content.',
|
|
173
182
|
},
|
|
174
183
|
};
|
package/src/Card/Card.test.tsx
CHANGED
|
@@ -17,11 +17,29 @@ describe('Card', () => {
|
|
|
17
17
|
});
|
|
18
18
|
|
|
19
19
|
it('renders transparent variant with variant class', () => {
|
|
20
|
-
const {container} = render(
|
|
21
|
-
<Card variant="transparent">Content</Card>,
|
|
22
|
-
);
|
|
20
|
+
const {container} = render(<Card variant="transparent">Content</Card>);
|
|
23
21
|
const root = container.firstElementChild!;
|
|
24
22
|
expect(root.className).toContain('astryx-card');
|
|
25
23
|
expect(root.className).toContain('transparent');
|
|
26
24
|
});
|
|
25
|
+
|
|
26
|
+
it('applies a distinct class for each elevation level', () => {
|
|
27
|
+
const classFor = (elevation: 'none' | 'low' | 'med' | 'high') => {
|
|
28
|
+
const {container} = render(<Card elevation={elevation}>C</Card>);
|
|
29
|
+
return container.firstElementChild!.className;
|
|
30
|
+
};
|
|
31
|
+
const none = classFor('none');
|
|
32
|
+
const low = classFor('low');
|
|
33
|
+
const med = classFor('med');
|
|
34
|
+
const high = classFor('high');
|
|
35
|
+
expect(new Set([none, low, med, high]).size).toBe(4);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('defaults to flat (elevation none) — same class as explicit none', () => {
|
|
39
|
+
const {container: defaultContainer} = render(<Card>C</Card>);
|
|
40
|
+
const {container: noneContainer} = render(<Card elevation="none">C</Card>);
|
|
41
|
+
expect(defaultContainer.firstElementChild!.className).toBe(
|
|
42
|
+
noneContainer.firstElementChild!.className,
|
|
43
|
+
);
|
|
44
|
+
});
|
|
27
45
|
});
|
package/src/Card/Card.tsx
CHANGED
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
import type {ReactNode} from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
borderVars,
|
|
22
|
+
colorVars,
|
|
23
|
+
radiusVars,
|
|
24
|
+
shadowVars,
|
|
25
|
+
} from '../theme/tokens.stylex';
|
|
21
26
|
import {container} from '../Layout/container.stylex';
|
|
22
27
|
import type {SpacingToken} from '../Layout/container.stylex';
|
|
23
28
|
import {
|
|
@@ -27,7 +32,7 @@ import {
|
|
|
27
32
|
containerPaddingBlockEndVarStyles,
|
|
28
33
|
spacingStepToToken,
|
|
29
34
|
} from '../Layout/padding.stylex';
|
|
30
|
-
import type {SizeValue, SpacingStep} from '../utils/types';
|
|
35
|
+
import type {Elevation, SizeValue, SpacingStep} from '../utils/types';
|
|
31
36
|
import {mergeProps} from '../utils';
|
|
32
37
|
import type {BaseProps} from '../BaseProps';
|
|
33
38
|
import {themeProps} from '../utils/themeProps';
|
|
@@ -73,6 +78,13 @@ const styles = stylex.create({
|
|
|
73
78
|
'--_card-radius': radiusVars['--radius-container'],
|
|
74
79
|
borderRadius: 'var(--_card-radius)',
|
|
75
80
|
overflow: 'clip',
|
|
81
|
+
// Resting elevation is set via --_card-elevation (see elevationStyles).
|
|
82
|
+
// The shadow list also reads --_card-ring so composing surfaces — e.g.
|
|
83
|
+
// SelectableCard's inset selection ring — can layer their own shadow
|
|
84
|
+
// alongside elevation instead of clobbering the single box-shadow property.
|
|
85
|
+
// Unset vars fall back to a transparent no-op shadow.
|
|
86
|
+
boxShadow:
|
|
87
|
+
'var(--_card-ring, 0 0 transparent), var(--_card-elevation, 0 0 transparent)',
|
|
76
88
|
},
|
|
77
89
|
// The border is drawn *inside* the padding — its width is subtracted from
|
|
78
90
|
// each side — so total inset (border + padding) equals the padding token
|
|
@@ -135,6 +147,18 @@ const variantStyles = stylex.create({
|
|
|
135
147
|
},
|
|
136
148
|
});
|
|
137
149
|
|
|
150
|
+
// Elevation → shadow-token map. Sets the private --_card-elevation variable
|
|
151
|
+
// (not box-shadow directly) so it composes with --_card-ring in the shadow
|
|
152
|
+
// list above — a selection ring and a resting elevation coexist without one
|
|
153
|
+
// overwriting the other. 'none' is a transparent no-op (not the CSS literal
|
|
154
|
+
// `none`, which would be invalid inside the comma-separated shadow list).
|
|
155
|
+
const elevationStyles = stylex.create({
|
|
156
|
+
none: {'--_card-elevation': '0 0 transparent'},
|
|
157
|
+
low: {'--_card-elevation': shadowVars['--shadow-low']},
|
|
158
|
+
med: {'--_card-elevation': shadowVars['--shadow-med']},
|
|
159
|
+
high: {'--_card-elevation': shadowVars['--shadow-high']},
|
|
160
|
+
});
|
|
161
|
+
|
|
138
162
|
// Dynamic styles for sizing props
|
|
139
163
|
const dynamicStyles = stylex.create({
|
|
140
164
|
sizing: (
|
|
@@ -208,6 +232,13 @@ export interface CardProps extends BaseProps<HTMLDivElement> {
|
|
|
208
232
|
* @default 'default'
|
|
209
233
|
*/
|
|
210
234
|
variant?: CardVariant;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Resting elevation — the shadow depth the card sits at.
|
|
238
|
+
* `none` is flat; `low`/`med`/`high` map to the shadow token scale.
|
|
239
|
+
* @default 'none'
|
|
240
|
+
*/
|
|
241
|
+
elevation?: Elevation;
|
|
211
242
|
}
|
|
212
243
|
|
|
213
244
|
/**
|
|
@@ -252,6 +283,7 @@ export function Card({
|
|
|
252
283
|
children,
|
|
253
284
|
padding,
|
|
254
285
|
variant = 'default',
|
|
286
|
+
elevation = 'none',
|
|
255
287
|
xstyle,
|
|
256
288
|
className,
|
|
257
289
|
style,
|
|
@@ -274,6 +306,7 @@ export function Card({
|
|
|
274
306
|
stylex.props(
|
|
275
307
|
styles.card,
|
|
276
308
|
variantStyles[variant],
|
|
309
|
+
elevationStyles[elevation],
|
|
277
310
|
hasFixedHeight && styles.scrollable,
|
|
278
311
|
dynamicStyles.sizing(
|
|
279
312
|
width ?? null,
|
|
@@ -91,6 +91,7 @@ export const docsDense = {
|
|
|
91
91
|
{guidance: true, description: 'Enable scroll-snap when each item should land precisely at the start edge: gallery, product list.'},
|
|
92
92
|
{guidance: true, description: 'Always provide an aria-label describing what the carousel contains: "Featured products", "Team members".'},
|
|
93
93
|
{guidance: true, description: 'Use consistent gap + item width so the carousel looks intentional, not like content overflowing by accident.'},
|
|
94
|
+
{guidance: true, description: 'Trust built-in navigation: trackpad users swipe horizontally, mouse users hold Shift + wheel to move through items.'},
|
|
94
95
|
{guidance: false, description: 'Use a carousel for content every user must see. Not everyone scrolls horizontally, so put critical content above the fold.'},
|
|
95
96
|
{guidance: false, description: 'Auto-advance items. Let the user scroll at their own pace.'},
|
|
96
97
|
{guidance: false, description: 'Nest carousels. A carousel inside a carousel is confusing and breaks keyboard navigation.'},
|