@astryxdesign/core 0.4.7 → 0.5.0-canary.009bcb3
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 +161 -1
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +45 -20
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -2
- package/dist/AspectRatio/AspectRatio.d.ts +24 -0
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +23 -4
- package/dist/Avatar/Avatar.d.ts +25 -1
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +58 -19
- package/dist/Avatar/index.d.ts +2 -2
- package/dist/Avatar/index.d.ts.map +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +9 -2
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +8 -4
- package/dist/AvatarGroup/AvatarGroupContext.d.ts +2 -1
- package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +10 -6
- package/dist/Banner/Banner.d.ts +49 -15
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +62 -20
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +17 -4
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +3 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -10
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +11 -6
- package/dist/ButtonGroup/ButtonGroup.d.ts +5 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +26 -7
- package/dist/Calendar/Calendar.d.ts +7 -3
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +21 -23
- package/dist/Calendar/getInitialFocusDate.d.ts +46 -0
- package/dist/Calendar/getInitialFocusDate.d.ts.map +1 -0
- package/dist/Calendar/getInitialFocusDate.js +62 -0
- package/dist/Calendar/styles.d.ts +5 -14
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +15 -15
- package/dist/Card/Card.d.ts +12 -12
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +17 -9
- package/dist/Card/index.d.ts +35 -1
- package/dist/Card/index.d.ts.map +1 -1
- package/dist/Card/index.js +21 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +3 -3
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -3
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +3 -3
- package/dist/Chat/ChatMessageList.d.ts +22 -3
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +6 -3
- package/dist/Chat/ChatTokenizedText.d.ts +2 -0
- package/dist/Chat/ChatTokenizedText.d.ts.map +1 -1
- package/dist/Chat/ChatTokenizedText.js +11 -6
- package/dist/Chat/useChatComposerTokens.js +1 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +10 -3
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +15 -4
- package/dist/CodeBlock/highlightRanges.js +1 -1
- package/dist/CodeBlock/highlightStyles.js +13 -13
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +3 -2
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +3 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +1 -3
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +4 -3
- package/dist/DateInput/DateInput.d.ts +43 -0
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +22 -2
- package/dist/DateInput/NativeDateField.d.ts +10 -0
- package/dist/DateInput/NativeDateField.d.ts.map +1 -0
- package/dist/DateInput/NativeDateField.js +494 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +82 -23
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/DateInput/nativeDateSegments.d.ts +22 -0
- package/dist/DateInput/nativeDateSegments.d.ts.map +1 -0
- package/dist/DateInput/nativeDateSegments.js +111 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts +4 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts +21 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +406 -12
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.d.ts.map +1 -1
- package/dist/Dialog/Dialog.d.ts +21 -1
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +110 -58
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +4 -13
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +6 -5
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +9 -1
- package/dist/Field/InputClearButton.d.ts +9 -3
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +14 -3
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +3 -2
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +6 -3
- package/dist/HoverCard/HoverCard.d.ts +6 -0
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +104 -3
- package/dist/HoverCard/useHoverCard.d.ts +19 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +74 -26
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +2 -19
- package/dist/Layer/LayerDepthContext.d.ts +52 -0
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -0
- package/dist/Layer/LayerDepthContext.js +66 -0
- package/dist/Layer/gestureCounter.d.ts +8 -0
- package/dist/Layer/gestureCounter.d.ts.map +1 -0
- package/dist/Layer/gestureCounter.js +53 -0
- package/dist/Layer/index.d.ts +3 -0
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +4 -0
- package/dist/Layer/layerStack.d.ts +98 -0
- package/dist/Layer/layerStack.d.ts.map +1 -0
- package/dist/Layer/layerStack.js +306 -0
- package/dist/Layer/useLayer.d.ts +23 -13
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +128 -8
- package/dist/Layer/useLayerDismissal.d.ts +93 -0
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -0
- package/dist/Layer/useLayerDismissal.js +91 -0
- package/dist/Lightbox/Lightbox.d.ts +1 -0
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +103 -81
- package/dist/List/List.d.ts +1 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +15 -4
- package/dist/Markdown/Markdown.d.ts +1 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +20 -7
- package/dist/Markdown/index.d.ts +1 -1
- package/dist/Markdown/index.d.ts.map +1 -1
- package/dist/Markdown/parser.d.ts +38 -1
- package/dist/Markdown/parser.d.ts.map +1 -1
- package/dist/Markdown/parser.js +182 -32
- package/dist/MetadataList/MetadataListItem.d.ts +1 -1
- package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListItem.js +4 -1
- package/dist/MobileNav/MobileNav.d.ts +6 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +61 -36
- package/dist/MultiSelector/MultiSelector.d.ts +32 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +73 -15
- package/dist/MultiSelector/hooks.d.ts +7 -1
- package/dist/MultiSelector/hooks.d.ts.map +1 -1
- package/dist/MultiSelector/hooks.js +3 -2
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/NavIcon/NavIcon.d.ts.map +1 -1
- package/dist/NavIcon/NavIcon.js +5 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts +1 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +9 -5
- package/dist/NumberInput/NumberInput.d.ts +6 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +54 -104
- package/dist/NumberInput/numberInputCommit.d.ts +34 -0
- package/dist/NumberInput/numberInputCommit.d.ts.map +1 -0
- package/dist/NumberInput/numberInputCommit.js +71 -0
- package/dist/NumberInput/numberParser.d.ts +64 -0
- package/dist/NumberInput/numberParser.d.ts.map +1 -0
- package/dist/NumberInput/numberParser.js +350 -0
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +3 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +3 -2
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +3 -2
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +1 -9
- package/dist/Popover/usePopover.d.ts +7 -41
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +40 -21
- package/dist/PowerSearch/PowerSearch.d.ts +8 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +19 -6
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +3 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +28 -6
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +3 -1
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +110 -27
- package/dist/PowerSearch/types.d.ts +2 -0
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts +6 -1
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +14 -5
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +18 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +3 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +3 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +12 -3
- package/dist/Selector/Selector.d.ts +18 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +91 -18
- package/dist/Selector/hooks.d.ts +7 -1
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +3 -2
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +4 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +8 -7
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +4 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +37 -5
- package/dist/Spinner/Spinner.d.ts +3 -3
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +130 -78
- package/dist/StatusDot/StatusDot.d.ts.map +1 -1
- package/dist/StatusDot/StatusDot.js +6 -1
- package/dist/Stepper/Step.d.ts +140 -0
- package/dist/Stepper/Step.d.ts.map +1 -0
- package/dist/Stepper/Step.js +1045 -0
- package/dist/Stepper/StepStatus.d.ts +24 -0
- package/dist/Stepper/StepStatus.d.ts.map +1 -0
- package/dist/Stepper/StepStatus.js +1 -0
- package/dist/Stepper/Stepper.d.ts +93 -0
- package/dist/Stepper/Stepper.d.ts.map +1 -0
- package/dist/Stepper/Stepper.js +184 -0
- package/dist/Stepper/StepperContext.d.ts +41 -0
- package/dist/Stepper/StepperContext.d.ts.map +1 -0
- package/dist/Stepper/StepperContext.js +34 -0
- package/dist/Stepper/index.d.ts +8 -0
- package/dist/Stepper/index.d.ts.map +1 -0
- package/dist/Stepper/index.js +7 -0
- package/dist/Stepper/stepper.stylex.d.ts +15 -0
- package/dist/Stepper/stepper.stylex.d.ts.map +1 -0
- package/dist/Stepper/stepper.stylex.js +20 -0
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +8 -3
- package/dist/TabList/Tab.d.ts +15 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +32 -7
- package/dist/TabList/TabList.d.ts +46 -7
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +353 -23
- package/dist/TabList/TabListContext.d.ts +11 -1
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +11 -2
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +3 -2
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.d.ts.map +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +10 -2
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -6
- package/dist/Table/TableRow.d.ts +16 -5
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +16 -5
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +73 -4
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +26 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +54 -11
- package/dist/Table/plugins/pagination/useTablePagination.d.ts +3 -0
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +21 -4
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +10 -3
- package/dist/Table/plugins/selection/useTableSelection.d.ts +16 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +43 -5
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +3 -4
- package/dist/Table/types.d.ts +22 -4
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -0
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +6 -3
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +16 -10
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +3 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +3 -2
- package/dist/Timestamp/Timestamp.d.ts +1 -1
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +15 -21
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +22 -7
- package/dist/Toast/ToastViewport.d.ts +1 -0
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +71 -18
- package/dist/Token/Token.d.ts +1 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +20 -9
- package/dist/Token/TokenLink.d.ts +1 -1
- package/dist/Token/TokenLink.d.ts.map +1 -1
- package/dist/Token/TokenLink.js +7 -4
- package/dist/Tokenizer/Tokenizer.d.ts +14 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +33 -21
- package/dist/Tooltip/Tooltip.d.ts +5 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +5 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +39 -24
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +5 -4
- package/dist/TopNav/TopNavMegaMenu.d.ts +1 -1
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +31 -11
- package/dist/TopNav/TopNavMenu.d.ts +1 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +22 -7
- package/dist/TreeList/TreeList.d.ts +1 -1
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +7 -2
- package/dist/Typeahead/BaseTypeahead.d.ts +35 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +119 -37
- package/dist/Typeahead/Typeahead.d.ts +8 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +5 -2
- package/dist/Typeahead/TypeaheadItem.d.ts +1 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +7 -2
- package/dist/astryx.css +113 -11
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts +7 -4
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +60 -95
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +3 -18
- package/dist/hooks/useMergedRefs.d.ts +18 -0
- package/dist/hooks/useMergedRefs.d.ts.map +1 -0
- package/dist/hooks/useMergedRefs.js +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +46 -10
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +24 -4
- package/dist/theme/generateThemeRules.d.ts +21 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +26 -0
- package/dist/theme/syntax/tokens.d.ts +1 -1
- package/dist/theme/syntax/tokens.d.ts.map +1 -1
- package/dist/theme/syntax/tokens.js +5 -2
- package/dist/utils/groupItems.d.ts +5 -1
- package/dist/utils/groupItems.d.ts.map +1 -1
- package/dist/utils/groupItems.js +9 -9
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/isApplePlatform.d.ts +18 -0
- package/dist/utils/isApplePlatform.d.ts.map +1 -0
- package/dist/utils/isApplePlatform.js +37 -0
- package/dist/utils/sharedResizeObserver.d.ts.map +1 -1
- package/dist/utils/sharedResizeObserver.js +10 -1
- package/dist/utils/timeParser.d.ts +1 -1
- package/dist/utils/timeParser.d.ts.map +1 -1
- package/dist/utils/timeParser.js +26 -12
- package/locales/af-ZA.json +6 -6
- package/locales/ar-SA.json +6 -6
- package/locales/ca-ES.json +5 -5
- package/locales/cs-CZ.json +6 -6
- package/locales/da-DK.json +6 -6
- package/locales/de-DE.json +6 -6
- package/locales/el-GR.json +6 -6
- package/locales/en.json +163 -11
- package/locales/es-ES.json +5 -5
- package/locales/fi-FI.json +6 -6
- package/locales/fr-FR.json +6 -6
- package/locales/he-IL.json +6 -6
- package/locales/hu-HU.json +6 -6
- package/locales/it-IT.json +6 -6
- package/locales/ja-JP.json +6 -6
- package/locales/ko-KR.json +6 -6
- package/locales/nl-NL.json +6 -6
- package/locales/no-NO.json +6 -6
- package/locales/pl-PL.json +6 -6
- package/locales/pseudo.json +114 -0
- package/locales/pt-BR.json +6 -6
- package/locales/pt-PT.json +6 -6
- package/locales/ro-RO.json +6 -6
- package/locales/ru-RU.json +6 -6
- package/locales/sr-SP.json +6 -6
- package/locales/sv-SE.json +6 -6
- package/locales/tr-TR.json +6 -6
- package/locales/uk-UA.json +6 -6
- package/locales/vi-VN.json +6 -6
- package/locales/zh-CN.json +6 -6
- package/locales/zh-TW.json +6 -6
- package/package.json +8 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +114 -30
- package/src/AlertDialog/AlertDialog.test.tsx +211 -2
- package/src/AlertDialog/AlertDialog.tsx +62 -20
- package/src/AppShell/AppShell.tsx +3 -2
- package/src/AspectRatio/AspectRatio.doc.mjs +6 -3
- package/src/AspectRatio/AspectRatio.test.tsx +57 -10
- package/src/AspectRatio/AspectRatio.tsx +40 -1
- package/src/Avatar/Avatar.doc.mjs +14 -3
- package/src/Avatar/Avatar.test.tsx +97 -0
- package/src/Avatar/Avatar.tsx +125 -52
- package/src/Avatar/index.ts +2 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +8 -2
- package/src/AvatarGroup/AvatarGroup.test.tsx +24 -0
- package/src/AvatarGroup/AvatarGroup.tsx +15 -6
- package/src/AvatarGroup/AvatarGroupContext.ts +5 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +10 -4
- package/src/Banner/Banner.doc.mjs +22 -11
- package/src/Banner/Banner.test.tsx +177 -25
- package/src/Banner/Banner.tsx +93 -27
- package/src/BottomSheet/BottomSheet.test.tsx +123 -0
- package/src/BottomSheet/BottomSheet.tsx +17 -4
- package/src/BottomSheet/BottomSheetSwitcher.tsx +3 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +9 -5
- package/src/Button/Button.doc.mjs +24 -1
- package/src/Button/Button.test.tsx +32 -4
- package/src/Button/Button.tsx +12 -5
- package/src/ButtonGroup/ButtonGroup.doc.mjs +10 -1
- package/src/ButtonGroup/ButtonGroup.test.tsx +404 -1
- package/src/ButtonGroup/ButtonGroup.tsx +23 -5
- package/src/Calendar/Calendar.doc.mjs +7 -6
- package/src/Calendar/Calendar.test.tsx +143 -0
- package/src/Calendar/Calendar.tsx +30 -26
- package/src/Calendar/getInitialFocusDate.test.ts +94 -0
- package/src/Calendar/getInitialFocusDate.ts +93 -0
- package/src/Calendar/styles.ts +49 -31
- package/src/Card/Card.doc.mjs +10 -7
- package/src/Card/Card.test.tsx +113 -19
- package/src/Card/Card.tsx +67 -89
- package/src/Card/index.ts +36 -1
- package/src/Carousel/Carousel.tsx +3 -2
- package/src/Chat/ChatComposerInput.tsx +5 -1
- package/src/Chat/ChatLayout.tsx +3 -2
- package/src/Chat/ChatMessageList.doc.mjs +9 -1
- package/src/Chat/ChatMessageList.test.tsx +46 -0
- package/src/Chat/ChatMessageList.tsx +28 -4
- package/src/Chat/ChatTokenizedText.tsx +17 -10
- package/src/Chat/useChatComposerTokens.ts +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +2 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +15 -0
- package/src/CheckboxInput/CheckboxInput.tsx +8 -2
- package/src/ClickableCard/ClickableCard.tsx +3 -2
- package/src/CodeBlock/CodeBlock.doc.mjs +16 -4
- package/src/CodeBlock/CodeBlock.test.tsx +37 -0
- package/src/CodeBlock/CodeBlock.tsx +20 -4
- package/src/CodeBlock/highlightRanges.ts +1 -1
- package/src/CodeBlock/highlightStyles.ts +13 -13
- package/src/CommandPalette/CommandPaletteInput.tsx +3 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +3 -2
- package/src/ComplexSelector/ComplexSelector.test.tsx +32 -0
- package/src/ComplexSelector/ComplexSelector.tsx +1 -3
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -0
- package/src/ContextMenu/ContextMenu.tsx +4 -3
- package/src/DateInput/DateInput.doc.mjs +16 -0
- package/src/DateInput/DateInput.tsx +55 -2
- package/src/DateInput/DateInputTouch.test.tsx +146 -32
- package/src/DateInput/NativeDateField.test.tsx +635 -0
- package/src/DateInput/NativeDateField.tsx +641 -0
- package/src/DateInput/TouchDateField.tsx +108 -24
- package/src/DateInput/index.ts +1 -0
- package/src/DateInput/nativeDateSegments.ts +127 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +2 -2
- package/src/DateRangeInput/DateRangeInput.test.tsx +22 -0
- package/src/DateRangeInput/DateRangeInput.tsx +4 -2
- package/src/DateTimeInput/DateTimeInput.doc.mjs +18 -0
- package/src/DateTimeInput/DateTimeInput.test.tsx +1088 -0
- package/src/DateTimeInput/DateTimeInput.tsx +556 -24
- package/src/DateTimeInput/index.ts +1 -0
- package/src/Dialog/Dialog.doc.mjs +8 -3
- package/src/Dialog/Dialog.test.tsx +429 -2
- package/src/Dialog/Dialog.tsx +133 -58
- package/src/DropdownMenu/DropdownMenu.doc.mjs +6 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +44 -10
- package/src/DropdownMenu/DropdownMenu.tsx +4 -13
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +8 -5
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +8 -11
- package/src/Field/Field.doc.mjs +13 -2
- package/src/Field/FieldLabel.test.tsx +29 -0
- package/src/Field/FieldLabel.tsx +7 -0
- package/src/Field/InputClearButton.test.tsx +15 -1
- package/src/Field/InputClearButton.tsx +28 -4
- package/src/FileInput/FileInput.tsx +3 -2
- package/src/Heading/Heading.test.tsx +23 -1
- package/src/Heading/Heading.tsx +6 -3
- package/src/HoverCard/HoverCard.doc.mjs +13 -2
- package/src/HoverCard/HoverCard.test.tsx +154 -4
- package/src/HoverCard/HoverCard.tsx +143 -3
- package/src/HoverCard/useHoverCard.tsx +104 -33
- package/src/Indicator/CheckboxIndicator.tsx +14 -8
- package/src/Indicator/Indicator.doc.mjs +2 -0
- package/src/Item/Item.tsx +5 -4
- package/src/Kbd/Kbd.tsx +2 -19
- package/src/Layer/LayerDepthContext.tsx +62 -0
- package/src/Layer/gestureCounter.ts +57 -0
- package/src/Layer/index.ts +9 -0
- package/src/Layer/layerDismissalFamilies.test.tsx +359 -0
- package/src/Layer/layerDismissalInvariants.test.tsx +417 -0
- package/src/Layer/layerStack.ts +362 -0
- package/src/Layer/useLayer.test.tsx +324 -15
- package/src/Layer/useLayer.tsx +164 -8
- package/src/Layer/useLayerDismissal.test.tsx +469 -0
- package/src/Layer/useLayerDismissal.ts +173 -0
- package/src/Layout/Layout.doc.mjs +2 -2
- package/src/Layout/__tests__/edgeCompensation.test.tsx +1 -1
- package/src/Lightbox/Lightbox.doc.mjs +12 -0
- package/src/Lightbox/Lightbox.tsx +124 -102
- package/src/Link/Link.doc.mjs +39 -0
- package/src/List/List.test.tsx +38 -0
- package/src/List/List.tsx +8 -1
- package/src/Markdown/Markdown.doc.mjs +5 -0
- package/src/Markdown/Markdown.test.tsx +37 -0
- package/src/Markdown/Markdown.tsx +16 -5
- package/src/Markdown/incremental.test.ts +16 -2
- package/src/Markdown/index.ts +1 -0
- package/src/Markdown/parser.perf.test.ts +96 -1
- package/src/Markdown/parser.test.ts +178 -2
- package/src/Markdown/parser.ts +253 -32
- package/src/MetadataList/MetadataList.test.tsx +75 -2
- package/src/MetadataList/MetadataListItem.tsx +5 -2
- package/src/MobileNav/MobileNav.tsx +62 -36
- package/src/MoreMenu/MoreMenu.doc.mjs +7 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +49 -1
- package/src/MultiSelector/MultiSelector.test.tsx +311 -0
- package/src/MultiSelector/MultiSelector.tsx +151 -15
- package/src/MultiSelector/hooks.ts +9 -2
- package/src/MultiSelector/index.ts +1 -0
- package/src/NavIcon/NavIcon.doc.mjs +8 -2
- package/src/NavIcon/NavIcon.test.tsx +9 -0
- package/src/NavIcon/NavIcon.tsx +5 -1
- package/src/NavMenu/NavHeadingMenu.test.tsx +30 -0
- package/src/NavMenu/NavHeadingMenu.tsx +9 -5
- package/src/NumberInput/NumberInput.doc.mjs +31 -7
- package/src/NumberInput/NumberInput.test.tsx +436 -8
- package/src/NumberInput/NumberInput.tsx +62 -114
- package/src/NumberInput/numberInputCommit.test.ts +72 -0
- package/src/NumberInput/numberInputCommit.ts +103 -0
- package/src/NumberInput/numberParser.docblock.test.ts +234 -0
- package/src/NumberInput/numberParser.test.ts +222 -0
- package/src/NumberInput/numberParser.ts +403 -0
- package/src/Outline/Outline.tsx +3 -2
- package/src/OverflowList/OverflowList.tsx +3 -2
- package/src/Overlay/Overlay.tsx +3 -2
- package/src/Pagination/Pagination.test.tsx +3 -2
- package/src/Popover/Popover.test.tsx +14 -0
- package/src/Popover/Popover.tsx +1 -9
- package/src/Popover/usePopover.tsx +57 -32
- package/src/PowerSearch/PowerSearch.doc.mjs +160 -28
- package/src/PowerSearch/PowerSearch.test.tsx +240 -1
- package/src/PowerSearch/PowerSearch.tsx +34 -5
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +288 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +29 -2
- package/src/PowerSearch/PowerSearchValueEditor.test.tsx +111 -1
- package/src/PowerSearch/PowerSearchValueEditor.tsx +124 -10
- package/src/PowerSearch/types.ts +2 -0
- package/src/PowerSearch/usePowerSearchSource.test.ts +82 -2
- package/src/PowerSearch/usePowerSearchSource.ts +13 -3
- package/src/ProgressBar/ProgressBar.doc.mjs +42 -6
- package/src/ProgressBar/ProgressBar.test.tsx +24 -0
- package/src/ProgressBar/ProgressBar.tsx +28 -8
- package/src/Resizable/ResizeHandle.tsx +3 -2
- package/src/SegmentedControl/SegmentedControl.tsx +3 -2
- package/src/SelectableCard/SelectableCard.doc.mjs +3 -0
- package/src/SelectableCard/SelectableCard.tsx +19 -2
- package/src/Selector/Selector.doc.mjs +26 -1
- package/src/Selector/Selector.test.tsx +346 -1
- package/src/Selector/Selector.tsx +148 -21
- package/src/Selector/hooks.ts +17 -2
- package/src/SideNav/SideNav.doc.mjs +6 -6
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavHeading.tsx +12 -12
- package/src/SideNav/SideNavItem.tsx +4 -2
- package/src/Slider/Slider.test.tsx +106 -1
- package/src/Slider/Slider.tsx +55 -3
- package/src/Spinner/Spinner.test.tsx +147 -1
- package/src/Spinner/Spinner.tsx +120 -101
- package/src/StatusDot/StatusDot.doc.mjs +8 -2
- package/src/StatusDot/StatusDot.test.tsx +9 -0
- package/src/StatusDot/StatusDot.tsx +7 -1
- package/src/Stepper/Step.doc.mjs +98 -0
- package/src/Stepper/Step.tsx +1638 -0
- package/src/Stepper/StepStatus.ts +26 -0
- package/src/Stepper/Stepper.doc.mjs +370 -0
- package/src/Stepper/Stepper.test.tsx +1024 -0
- package/src/Stepper/Stepper.tsx +258 -0
- package/src/Stepper/StepperContext.ts +71 -0
- package/src/Stepper/index.ts +18 -0
- package/src/Stepper/stepper.stylex.ts +19 -0
- package/src/Switch/Switch.doc.mjs +2 -0
- package/src/Switch/Switch.test.tsx +10 -0
- package/src/Switch/Switch.tsx +6 -2
- package/src/TabList/Tab.doc.mjs +13 -1
- package/src/TabList/Tab.tsx +67 -7
- package/src/TabList/TabList.doc.mjs +22 -6
- package/src/TabList/TabList.test.tsx +559 -0
- package/src/TabList/TabList.tsx +490 -22
- package/src/TabList/TabListContext.ts +13 -2
- package/src/TabList/TabMenu.tsx +3 -2
- package/src/TabList/index.ts +6 -2
- package/src/Table/BaseTable.tsx +12 -4
- package/src/Table/Table.doc.mjs +9 -2
- package/src/Table/Table.test.tsx +132 -14
- package/src/Table/Table.tsx +3 -8
- package/src/Table/TableBody.doc.mjs +40 -0
- package/src/Table/TableFooter.doc.mjs +40 -0
- package/src/Table/TableHeader.doc.mjs +40 -0
- package/src/Table/TableRow.tsx +16 -5
- package/src/Table/plugins/filtering/useTableFiltering.test.tsx +44 -6
- package/src/Table/plugins/filtering/useTableFiltering.tsx +100 -4
- package/src/Table/plugins/groupedRows/useTableGroupedRows-perf.test.tsx +112 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +100 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +67 -12
- package/src/Table/plugins/pagination/useTablePagination.test.tsx +34 -4
- package/src/Table/plugins/pagination/useTablePagination.tsx +35 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -2
- package/src/Table/plugins/rowStatus/useTableRowStatus.test.tsx +13 -7
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +12 -3
- package/src/Table/plugins/selection/useTableSelection.test.tsx +138 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +63 -7
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -2
- package/src/Table/types.ts +22 -4
- package/src/Table/useBaseTablePlugins.ts +5 -0
- package/src/Table/useTableGroupedRows.doc.mjs +5 -4
- package/src/Table/useTablePagination.doc.mjs +7 -0
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/Table/useTableSelection.doc.mjs +31 -0
- package/src/Text/Text.test.tsx +67 -1
- package/src/Text/Text.tsx +6 -3
- package/src/TextArea/TextArea.doc.mjs +12 -2
- package/src/TextArea/TextArea.test.tsx +11 -0
- package/src/TextArea/TextArea.tsx +37 -24
- package/src/TextInput/TextInput.doc.mjs +10 -0
- package/src/TextInput/TextInput.tsx +3 -2
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
- package/src/TimeInput/TimeInput.tsx +2 -2
- package/src/Timestamp/Timestamp.test.tsx +58 -0
- package/src/Timestamp/Timestamp.tsx +12 -10
- package/src/Toast/Toast.doc.mjs +26 -12
- package/src/Toast/Toast.tsx +28 -4
- package/src/Toast/ToastViewport.test.tsx +536 -8
- package/src/Toast/ToastViewport.tsx +81 -12
- package/src/Token/Token.test.tsx +95 -0
- package/src/Token/Token.tsx +15 -10
- package/src/Token/TokenLink.tsx +14 -5
- package/src/Tokenizer/Tokenizer.doc.mjs +43 -3
- package/src/Tokenizer/Tokenizer.test.tsx +161 -0
- package/src/Tokenizer/Tokenizer.tsx +53 -24
- package/src/Toolbar/Toolbar.doc.mjs +5 -0
- package/src/Tooltip/Tooltip.doc.mjs +5 -0
- package/src/Tooltip/Tooltip.test.tsx +32 -0
- package/src/Tooltip/Tooltip.tsx +5 -0
- package/src/Tooltip/useTooltip.tsx +47 -24
- package/src/TopNav/TopNavHeading.tsx +5 -4
- package/src/TopNav/TopNavMegaMenu.test.tsx +104 -0
- package/src/TopNav/TopNavMegaMenu.tsx +47 -5
- package/src/TopNav/TopNavMenu.test.tsx +133 -1
- package/src/TopNav/TopNavMenu.tsx +38 -7
- package/src/TreeList/TreeList.test.tsx +49 -0
- package/src/TreeList/TreeList.tsx +7 -2
- package/src/Typeahead/BaseTypeahead.doc.mjs +24 -0
- package/src/Typeahead/BaseTypeahead.tsx +181 -39
- package/src/Typeahead/Typeahead.doc.mjs +11 -0
- package/src/Typeahead/Typeahead.test.tsx +203 -0
- package/src/Typeahead/Typeahead.tsx +12 -2
- package/src/Typeahead/TypeaheadItem.test.tsx +43 -0
- package/src/Typeahead/TypeaheadItem.tsx +8 -1
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useAnnounce.doc.mjs +96 -0
- package/src/hooks/useContainerReveal.doc.mjs +2 -2
- package/src/hooks/useDevWarning.doc.mjs +96 -0
- package/src/hooks/useFocusTrap.test.tsx +14 -0
- package/src/hooks/useFocusTrap.ts +62 -111
- package/src/hooks/useFocusTrapEscapeShim.test.tsx +165 -0
- package/src/hooks/useHotkeys.ts +3 -18
- package/src/hooks/useIndicatorFocusRing.doc.mjs +104 -0
- package/src/hooks/useInputStatusIcon.doc.mjs +142 -0
- package/src/hooks/useInteractiveRole.doc.mjs +119 -0
- package/src/hooks/useLongPress.doc.mjs +123 -0
- package/src/hooks/useMergedRefs.doc.mjs +79 -0
- package/src/hooks/useMergedRefs.test.tsx +62 -0
- package/src/hooks/useMergedRefs.ts +36 -0
- package/src/hooks/useTypeahead.doc.mjs +153 -0
- package/src/index.ts +1 -0
- package/src/raw-import.d.ts +14 -0
- package/src/theme/MediaTheme.doc.mjs +5 -5
- package/src/theme/Theme.test.tsx +104 -2
- package/src/theme/Theme.tsx +49 -14
- package/src/theme/defineTheme.test.ts +23 -0
- package/src/theme/derivedVarRegistry.test.ts +26 -3
- package/src/theme/derivedVarRegistry.ts +23 -4
- package/src/theme/generateThemeRules.test.ts +99 -1
- package/src/theme/generateThemeRules.ts +28 -0
- package/src/theme/syntax/tokens.ts +5 -2
- package/src/utils/groupItems.ts +12 -6
- package/src/utils/index.ts +1 -1
- package/src/utils/isApplePlatform.test.ts +61 -0
- package/src/utils/isApplePlatform.ts +37 -0
- package/src/utils/sharedResizeObserver.ts +10 -2
- package/src/utils/timeParser.test.ts +6 -1
- package/src/utils/timeParser.ts +35 -13
- package/src/__tests__/inputWidthContract.test.tsx +0 -69
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* - /apps/storybook/stories/DateTimeInput.stories.tsx (storybook stories)
|
|
16
16
|
* - /packages/cli/assets/templates/blocks/components/DateTimeInput/ (showcase blocks)
|
|
17
17
|
*/
|
|
18
|
-
import { use, useId, useState, useCallback, useRef, useMemo, useOptimistic, useTransition } from 'react';
|
|
18
|
+
import { use, useId, useState, useCallback, useEffect, useRef, useMemo, useOptimistic, useTransition } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import "../theme/tokens.stylex.js";
|
|
21
|
-
import { colorVars, sizeVars, radiusVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
21
|
+
import { colorVars, sizeVars, radiusVars, spacingVars, typographyVars, typeScaleVars, fontWeightVars } from "../theme/tokens.stylex.js";
|
|
22
22
|
import { Field, InputClearButton, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
|
|
23
23
|
import { Icon } from "../Icon/index.js";
|
|
24
24
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
@@ -29,7 +29,7 @@ import { usePopover } from "../Popover/index.js";
|
|
|
29
29
|
import { useTooltip } from "../Tooltip/index.js";
|
|
30
30
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
31
31
|
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
32
|
-
import { parseDateInput, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, isImeKeyEvent, mergeProps,
|
|
32
|
+
import { parseDateInput, parseISOTime, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, isImeKeyEvent, mergeProps, isFocusDetached } from "../utils/index.js";
|
|
33
33
|
import { plainDateFromISO, plainDateToISO, plainDateFormat, DATE_FORMAT_LONG } from "../utils/plainDate.js";
|
|
34
34
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
35
35
|
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
@@ -37,8 +37,14 @@ import { useSize } from "../SizeContext/SizeContext.js";
|
|
|
37
37
|
import { themeProps } from "../utils/themeProps.js";
|
|
38
38
|
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
39
39
|
import { useTranslator, InternationalizationContext } from "../i18n/index.js";
|
|
40
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
40
41
|
|
|
41
42
|
/** Supported minute increments for arrow-key stepping of the time field. */
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Supported minute cadences for the preset-time dropdown. Every value divides
|
|
46
|
+
* an hour evenly, so each option lands on a round clock time.
|
|
47
|
+
*/
|
|
42
48
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
43
49
|
const styles = {
|
|
44
50
|
row: {
|
|
@@ -72,6 +78,51 @@ const styles = {
|
|
|
72
78
|
kUk6DE: "x98rzlu",
|
|
73
79
|
kCS8Yb: "x1r8uery",
|
|
74
80
|
$$css: true
|
|
81
|
+
},
|
|
82
|
+
timeOption: {
|
|
83
|
+
kB7OPa: "x9f619",
|
|
84
|
+
k1xSpc: "x78zum5",
|
|
85
|
+
kGNEyG: "x6s0dn4",
|
|
86
|
+
kzqmXN: "xh8yej3",
|
|
87
|
+
k8WAf4: "x1vofgu7",
|
|
88
|
+
kg3NbH: "xf314gf",
|
|
89
|
+
kaIpWk: "xh6dtrn",
|
|
90
|
+
kkrTdU: "x1ypdohk x16khyan",
|
|
91
|
+
k9WMMc: "x1yc453h",
|
|
92
|
+
kMv6JI: "x9ynric",
|
|
93
|
+
kGuDYH: "xjm74w1",
|
|
94
|
+
kLWn49: "xw6l6zx",
|
|
95
|
+
kMwMTN: "x1tgivj0",
|
|
96
|
+
kWkggS: "xjbqb8w",
|
|
97
|
+
$$css: true
|
|
98
|
+
},
|
|
99
|
+
timeOptionHighlighted: {
|
|
100
|
+
kWkggS: "x1lmrjuc",
|
|
101
|
+
$$css: true
|
|
102
|
+
},
|
|
103
|
+
timeOptionSelected: {
|
|
104
|
+
k63SB2: "x1e4wzip",
|
|
105
|
+
$$css: true
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Size-specific padding for the preset-time options, so an `sm` field gets a
|
|
111
|
+
* compact list. Matches DropdownMenuItem / Selector / BaseTypeahead.
|
|
112
|
+
*/
|
|
113
|
+
const timeOptionSizeStyles = {
|
|
114
|
+
sm: {
|
|
115
|
+
k8WAf4: "xu0wf1k",
|
|
116
|
+
kg3NbH: "xf314gf",
|
|
117
|
+
$$css: true
|
|
118
|
+
},
|
|
119
|
+
md: {
|
|
120
|
+
k8WAf4: "x1vofgu7",
|
|
121
|
+
$$css: true
|
|
122
|
+
},
|
|
123
|
+
lg: {
|
|
124
|
+
k8WAf4: "xce4md1",
|
|
125
|
+
$$css: true
|
|
75
126
|
}
|
|
76
127
|
};
|
|
77
128
|
const sizeStyles = {
|
|
@@ -113,6 +164,7 @@ function combineDateTime(date, time) {
|
|
|
113
164
|
}
|
|
114
165
|
return `${date}T${time}`;
|
|
115
166
|
}
|
|
167
|
+
const MINUTES_PER_DAY = 24 * 60;
|
|
116
168
|
function getDefaultTime(hasSeconds) {
|
|
117
169
|
const now = new Date();
|
|
118
170
|
return formatISOTime({
|
|
@@ -154,6 +206,7 @@ export function DateTimeInput({
|
|
|
154
206
|
hasSeconds = false,
|
|
155
207
|
hourFormat = '12h',
|
|
156
208
|
timeIncrement = 1,
|
|
209
|
+
timeOptionInterval,
|
|
157
210
|
hasClear = false,
|
|
158
211
|
placeholder: placeholderFromProps,
|
|
159
212
|
timePlaceholder: timePlaceholderFromProps,
|
|
@@ -300,6 +353,42 @@ export function DateTimeInput({
|
|
|
300
353
|
return timePlaceholder;
|
|
301
354
|
}, [isTimeFocused, timeDisplayValue, hourFormat, timePlaceholder, t]);
|
|
302
355
|
|
|
356
|
+
// The time field's own accessible name. The option list is named from this
|
|
357
|
+
// rather than from `label`, so a consumer-supplied timeLabel renames both
|
|
358
|
+
// together instead of leaving the list announcing the old name.
|
|
359
|
+
const resolvedTimeLabel = timeLabel ?? t('@astryx.dateTimeInput.timeSuffix', {
|
|
360
|
+
label
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// --- Preset time options (#2727) ---
|
|
364
|
+
// Opt-in: without timeOptionInterval the time field keeps exactly the
|
|
365
|
+
// semantics it shipped with — a plain text input, no combobox role, no
|
|
366
|
+
// second listbox in the accessibility tree.
|
|
367
|
+
const hasTimeOptions = timeOptionInterval !== undefined;
|
|
368
|
+
const timeOptions = useMemo(() => {
|
|
369
|
+
if (timeOptionInterval === undefined) {
|
|
370
|
+
return [];
|
|
371
|
+
}
|
|
372
|
+
const options = [];
|
|
373
|
+
for (let minutes = 0; minutes < MINUTES_PER_DAY; minutes += timeOptionInterval) {
|
|
374
|
+
const time = formatISOTime({
|
|
375
|
+
hour: Math.floor(minutes / 60),
|
|
376
|
+
minute: minutes % 60,
|
|
377
|
+
second: 0
|
|
378
|
+
}, hasSeconds);
|
|
379
|
+
// The same bound the typed path enforces, so the list can never offer a
|
|
380
|
+
// time that typing the identical string would reject.
|
|
381
|
+
if (!isTimeInRange(time, timeMin, timeMax)) {
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
options.push({
|
|
385
|
+
time,
|
|
386
|
+
label: formatDisplayTime(time, hasSeconds)
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
return options;
|
|
390
|
+
}, [timeOptionInterval, hasSeconds, timeMin, timeMax, formatDisplayTime]);
|
|
391
|
+
|
|
303
392
|
// --- Unified change handler ---
|
|
304
393
|
const fireChange = useCallback(newValue => {
|
|
305
394
|
if (isBusy) {
|
|
@@ -436,6 +525,179 @@ export function DateTimeInput({
|
|
|
436
525
|
}
|
|
437
526
|
}, [popover, commitDatePendingInput, isEffectivelyDisabled]);
|
|
438
527
|
|
|
528
|
+
// --- Time-option popover (#2727) ---
|
|
529
|
+
const timeListboxId = useId();
|
|
530
|
+
const [highlightedTimeIndex, setHighlightedTimeIndex] = useState(-1);
|
|
531
|
+
|
|
532
|
+
// With popover="auto", showing the popover between pointerdown and
|
|
533
|
+
// pointerup/click lets the browser's light-dismiss treat that same click as
|
|
534
|
+
// "outside" and close it again. Defer the show past the click, as
|
|
535
|
+
// BaseTypeahead does for the same reason.
|
|
536
|
+
const timePointerActiveRef = useRef(false);
|
|
537
|
+
|
|
538
|
+
// Whether the highlight is still the one typing derived, or the user has
|
|
539
|
+
// since moved it themselves. Enter honours typed text only in the former
|
|
540
|
+
// case — otherwise the field would commit something other than the option
|
|
541
|
+
// it is showing as active.
|
|
542
|
+
const timeHighlightFollowsTypingRef = useRef(true);
|
|
543
|
+
const markTimePointerActive = useCallback(() => {
|
|
544
|
+
timePointerActiveRef.current = true;
|
|
545
|
+
document.addEventListener('click', () => {
|
|
546
|
+
timePointerActiveRef.current = false;
|
|
547
|
+
}, {
|
|
548
|
+
once: true
|
|
549
|
+
});
|
|
550
|
+
}, []);
|
|
551
|
+
const timePopover = usePopover({
|
|
552
|
+
hasLightDismiss: true,
|
|
553
|
+
hasCloseButton: false,
|
|
554
|
+
hasAutoFocus: false,
|
|
555
|
+
// The popup's own role="listbox" carries the semantics; the input keeps
|
|
556
|
+
// DOM focus, so announcing a dialog here would misrepresent it.
|
|
557
|
+
role: 'none',
|
|
558
|
+
onHide: () => setHighlightedTimeIndex(-1)
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
// Anchor the list to the time wrapper, not the date input the field's own
|
|
562
|
+
// trigger ref points at.
|
|
563
|
+
useEffect(() => {
|
|
564
|
+
if (!hasTimeOptions) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
const el = timeContainerRef.current;
|
|
568
|
+
if (el) {
|
|
569
|
+
timePopover.triggerRef(el);
|
|
570
|
+
}
|
|
571
|
+
return () => {
|
|
572
|
+
timePopover.triggerRef(null);
|
|
573
|
+
};
|
|
574
|
+
}, [timePopover, hasTimeOptions]);
|
|
575
|
+
const timeOptionId = useCallback(index => `${timeListboxId}-option-${index}`, [timeListboxId]);
|
|
576
|
+
|
|
577
|
+
// A field can go disabled or busy while its list is open — a changeAction
|
|
578
|
+
// starting elsewhere in the form is enough. Leave it up and the dropdown
|
|
579
|
+
// hangs over a control that no longer accepts input.
|
|
580
|
+
// The same applies to a list that empties after it opened, which a narrowing
|
|
581
|
+
// min/max window does. An open-but-empty list gates the keyboard switch off,
|
|
582
|
+
// so the arrows quietly fall back to stepping the value instead.
|
|
583
|
+
useEffect(() => {
|
|
584
|
+
if (timePopover.isOpen && (isEffectivelyDisabled || timeOptions.length === 0)) {
|
|
585
|
+
timePopover.hide();
|
|
586
|
+
}
|
|
587
|
+
}, [isEffectivelyDisabled, timeOptions.length, timePopover]);
|
|
588
|
+
|
|
589
|
+
// The option list can shrink under an open popover — min/max tighten when
|
|
590
|
+
// the date moves onto a boundary day, or the cadence prop changes. A stale
|
|
591
|
+
// index past the new end shows no highlight at all and makes the arrow keys
|
|
592
|
+
// look dead until the user walks it back into range.
|
|
593
|
+
// Clamped as it is read rather than synced through an effect: no extra
|
|
594
|
+
// render, and the index can never point past the end even for the paint
|
|
595
|
+
// where the list shrank.
|
|
596
|
+
const activeTimeIndex = highlightedTimeIndex > timeOptions.length - 1 ? timeOptions.length - 1 : highlightedTimeIndex;
|
|
597
|
+
|
|
598
|
+
// Keep the active option visible. The listbox is a fixed-height scroll
|
|
599
|
+
// container, so without this a list opens at midnight with the highlight far
|
|
600
|
+
// below the fold, and keyboard navigation walks off-screen. Mirrors
|
|
601
|
+
// BaseTypeahead's scrollIntoView({block: 'nearest'}).
|
|
602
|
+
useEffect(() => {
|
|
603
|
+
if (!timePopover.isOpen || activeTimeIndex < 0 || activeTimeIndex >= timeOptions.length) {
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
document.getElementById(timeOptionId(activeTimeIndex))?.scrollIntoView?.({
|
|
607
|
+
block: 'nearest'
|
|
608
|
+
});
|
|
609
|
+
}, [timePopover.isOpen, activeTimeIndex, timeOptionId, timeOptions.length]);
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* The selected time in the same shape the options carry. splitDateTime slices
|
|
613
|
+
* whatever follows the `T`, so a caller passing `14:00:00` with hasSeconds
|
|
614
|
+
* off leaves `"14:00:00"` against options of `"14:00"` — comparing raw would
|
|
615
|
+
* mark nothing selected, silently.
|
|
616
|
+
*/
|
|
617
|
+
const selectedOptionTime = useMemo(() => {
|
|
618
|
+
if (!valueParts.time) {
|
|
619
|
+
return undefined;
|
|
620
|
+
}
|
|
621
|
+
const parsed = parseISOTime(valueParts.time);
|
|
622
|
+
return parsed ? formatISOTime(parsed, hasSeconds) : undefined;
|
|
623
|
+
}, [valueParts.time, hasSeconds]);
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Index of the option at or immediately before `time`, so opening on a value
|
|
627
|
+
* that is not itself an option (13:07 in a 15-minute list) still lands the
|
|
628
|
+
* highlight somewhere sensible instead of nowhere.
|
|
629
|
+
*/
|
|
630
|
+
const closestOptionIndex = useCallback(time => {
|
|
631
|
+
if (timeOptions.length === 0) {
|
|
632
|
+
return -1;
|
|
633
|
+
}
|
|
634
|
+
// No time yet — the state a field lands in once a date is picked. The
|
|
635
|
+
// list still opens on the first option, per the APG listbox pattern;
|
|
636
|
+
// leaving it inactive made ArrowUp and Enter do nothing at all.
|
|
637
|
+
if (!time) {
|
|
638
|
+
return 0;
|
|
639
|
+
}
|
|
640
|
+
let candidate = -1;
|
|
641
|
+
for (let i = 0; i < timeOptions.length; i++) {
|
|
642
|
+
if (timeOptions[i].time <= time) {
|
|
643
|
+
candidate = i;
|
|
644
|
+
} else {
|
|
645
|
+
break;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
// A value below every option (min pushes the list past it) still gets the
|
|
649
|
+
// first option rather than an empty highlight.
|
|
650
|
+
return candidate === -1 ? 0 : candidate;
|
|
651
|
+
}, [timeOptions]);
|
|
652
|
+
const showTimeOptions = useCallback(() => {
|
|
653
|
+
if (!hasTimeOptions || isEffectivelyDisabled || timePopover.isOpen ||
|
|
654
|
+
// A min/max window narrower than the cadence survives no option at all.
|
|
655
|
+
// Opening on that would show an empty panel with nothing to pick.
|
|
656
|
+
timeOptions.length === 0) {
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
setHighlightedTimeIndex(closestOptionIndex(selectedOptionTime));
|
|
660
|
+
// useInputContainer routes wrapper clicks through input.click() once the
|
|
661
|
+
// input advertises a popup, and a programmatic click does not focus. The
|
|
662
|
+
// input must hold DOM focus or aria-activedescendant announces nothing.
|
|
663
|
+
timeInputRef.current?.focus();
|
|
664
|
+
if (timePointerActiveRef.current) {
|
|
665
|
+
document.addEventListener('click', () => requestAnimationFrame(() => timePopover.show({
|
|
666
|
+
skipAutoFocus: true
|
|
667
|
+
})), {
|
|
668
|
+
once: true
|
|
669
|
+
});
|
|
670
|
+
} else {
|
|
671
|
+
timePopover.show({
|
|
672
|
+
skipAutoFocus: true
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
}, [hasTimeOptions, isEffectivelyDisabled, timePopover, timeOptions.length, closestOptionIndex, selectedOptionTime]);
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* The single commit path for a time chosen from the list. Deliberately the
|
|
679
|
+
* same shape as the typed path: same range check, same date requirement, so
|
|
680
|
+
* picking 9:00 AM and typing "9:00 AM" are indistinguishable downstream.
|
|
681
|
+
*/
|
|
682
|
+
const commitTimeOption = useCallback(time => {
|
|
683
|
+
if (isEffectivelyDisabled || !isTimeInRange(time, timeMin, timeMax)) {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
setTimePendingInput(null);
|
|
687
|
+
// Compared against the normalised time, the same one the selected marker
|
|
688
|
+
// uses. Comparing the raw value instead made clicking the option that
|
|
689
|
+
// renders as selected emit a change, whenever the value carried seconds
|
|
690
|
+
// the field does not display.
|
|
691
|
+
if (time !== selectedOptionTime && valueParts.date) {
|
|
692
|
+
const combined = combineDateTime(valueParts.date, time);
|
|
693
|
+
if (combined) {
|
|
694
|
+
fireChange(combined);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
timePopover.hide();
|
|
698
|
+
timeInputRef.current?.focus();
|
|
699
|
+
}, [isEffectivelyDisabled, timeMin, timeMax, selectedOptionTime, valueParts.date, fireChange, timePopover]);
|
|
700
|
+
|
|
439
701
|
// --- Time handlers ---
|
|
440
702
|
const handleTimeInputChange = useCallback(e => {
|
|
441
703
|
// With a disabledMessage the input drops `disabled` for focusability, so
|
|
@@ -446,6 +708,14 @@ export function DateTimeInput({
|
|
|
446
708
|
const text = e.target.value;
|
|
447
709
|
setTimePendingInput(text);
|
|
448
710
|
const parsed = parseTimeInput(text, hasSeconds);
|
|
711
|
+
|
|
712
|
+
// Typing narrows nothing — free-form entry is the contract, and a time
|
|
713
|
+
// between two options must stay reachable. The list instead follows the
|
|
714
|
+
// typed value so Enter lands somewhere the user expects.
|
|
715
|
+
if (timePopover.isOpen && parsed) {
|
|
716
|
+
timeHighlightFollowsTypingRef.current = true;
|
|
717
|
+
setHighlightedTimeIndex(closestOptionIndex(parsed));
|
|
718
|
+
}
|
|
449
719
|
if (parsed && isTimeInRange(parsed, timeMin, timeMax) && parsed !== valueParts.time) {
|
|
450
720
|
if (valueParts.date) {
|
|
451
721
|
const combined = combineDateTime(valueParts.date, parsed);
|
|
@@ -454,7 +724,7 @@ export function DateTimeInput({
|
|
|
454
724
|
}
|
|
455
725
|
}
|
|
456
726
|
}
|
|
457
|
-
}, [hasSeconds, timeMin, timeMax, valueParts.time, valueParts.date, fireChange, isEffectivelyDisabled]);
|
|
727
|
+
}, [hasSeconds, timeMin, timeMax, valueParts.time, valueParts.date, fireChange, isEffectivelyDisabled, timePopover.isOpen, closestOptionIndex]);
|
|
458
728
|
const handleTimeFocus = useCallback(() => {
|
|
459
729
|
// A disabled/busy input stays focusable (via aria-disabled) so its reason
|
|
460
730
|
// is discoverable, but it must not present editing affordances — keep the
|
|
@@ -464,8 +734,20 @@ export function DateTimeInput({
|
|
|
464
734
|
}
|
|
465
735
|
setIsTimeFocused(true);
|
|
466
736
|
}, [isEffectivelyDisabled]);
|
|
467
|
-
const handleTimeBlur = useCallback(
|
|
737
|
+
const handleTimeBlur = useCallback(e => {
|
|
468
738
|
setIsTimeFocused(false);
|
|
739
|
+
|
|
740
|
+
// Native light dismiss only fires on outside clicks and Escape, so a focus
|
|
741
|
+
// move that is neither — Tab handled elsewhere, or a programmatic focus —
|
|
742
|
+
// would strand the listbox open in the top layer. Focus landing inside the
|
|
743
|
+
// field or the popup itself is not a leave. Mirrors BaseTypeahead.
|
|
744
|
+
if (timePopover.isOpen) {
|
|
745
|
+
const next = e.relatedTarget;
|
|
746
|
+
const popoverEl = next ? document.getElementById(timePopover.id) : null;
|
|
747
|
+
if (!next || !(timeContainerRef.current?.contains(next) || popoverEl?.contains(next))) {
|
|
748
|
+
timePopover.hide();
|
|
749
|
+
}
|
|
750
|
+
}
|
|
469
751
|
if (timePendingInput === null) {
|
|
470
752
|
return;
|
|
471
753
|
}
|
|
@@ -484,7 +766,7 @@ export function DateTimeInput({
|
|
|
484
766
|
}
|
|
485
767
|
}
|
|
486
768
|
setTimePendingInput(null);
|
|
487
|
-
}, [timePendingInput, hasSeconds, timeMin, timeMax, valueParts, fireChange]);
|
|
769
|
+
}, [timePendingInput, hasSeconds, timeMin, timeMax, valueParts, fireChange, timePopover]);
|
|
488
770
|
const handleTimeKeyDown = useCallback(e => {
|
|
489
771
|
// ArrowUp/ArrowDown step the time and preventDefault; an IME candidate
|
|
490
772
|
// window uses those same arrows to navigate candidates, so guard the
|
|
@@ -493,6 +775,72 @@ export function DateTimeInput({
|
|
|
493
775
|
if (isImeKeyEvent(e.nativeEvent)) {
|
|
494
776
|
return;
|
|
495
777
|
}
|
|
778
|
+
|
|
779
|
+
// The dropdown claims the arrow keys only while it is open. Closed, they
|
|
780
|
+
// keep stepping the value by timeIncrement exactly as they always have —
|
|
781
|
+
// that behaviour is documented and tested, so the list borrows Alt+Arrow
|
|
782
|
+
// Down (the APG "open without moving" binding) to open instead.
|
|
783
|
+
if (hasTimeOptions && !isEffectivelyDisabled) {
|
|
784
|
+
if (e.key === 'Escape' && timePopover.isOpen) {
|
|
785
|
+
e.preventDefault();
|
|
786
|
+
timePopover.hide();
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
if (e.key === 'ArrowDown' && e.altKey) {
|
|
790
|
+
e.preventDefault();
|
|
791
|
+
// A keyboard open is never mid-click, so clear the deferral flag. A
|
|
792
|
+
// press that ended without a click would otherwise leave it set and
|
|
793
|
+
// hold every later open hostage to the next click anywhere.
|
|
794
|
+
timePointerActiveRef.current = false;
|
|
795
|
+
showTimeOptions();
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
if (timePopover.isOpen && timeOptions.length > 0) {
|
|
799
|
+
switch (e.key) {
|
|
800
|
+
case 'ArrowDown':
|
|
801
|
+
e.preventDefault();
|
|
802
|
+
timeHighlightFollowsTypingRef.current = false;
|
|
803
|
+
setHighlightedTimeIndex(activeTimeIndex < timeOptions.length - 1 ? activeTimeIndex + 1 : activeTimeIndex);
|
|
804
|
+
return;
|
|
805
|
+
case 'ArrowUp':
|
|
806
|
+
e.preventDefault();
|
|
807
|
+
timeHighlightFollowsTypingRef.current = false;
|
|
808
|
+
setHighlightedTimeIndex(activeTimeIndex > 0 ? activeTimeIndex - 1 : activeTimeIndex);
|
|
809
|
+
return;
|
|
810
|
+
case 'Home':
|
|
811
|
+
e.preventDefault();
|
|
812
|
+
timeHighlightFollowsTypingRef.current = false;
|
|
813
|
+
setHighlightedTimeIndex(0);
|
|
814
|
+
return;
|
|
815
|
+
case 'End':
|
|
816
|
+
e.preventDefault();
|
|
817
|
+
timeHighlightFollowsTypingRef.current = false;
|
|
818
|
+
setHighlightedTimeIndex(timeOptions.length - 1);
|
|
819
|
+
return;
|
|
820
|
+
case 'Enter':
|
|
821
|
+
{
|
|
822
|
+
e.preventDefault();
|
|
823
|
+
// Typed text wins over the highlight. The highlight only tracks
|
|
824
|
+
// the option at or before what was typed, so committing it here
|
|
825
|
+
// would round 1:07 PM down to 1:00 PM and discard the entry.
|
|
826
|
+
const typed = timeHighlightFollowsTypingRef.current && timePendingInput !== null ? parseTimeInput(timePendingInput, hasSeconds) : null;
|
|
827
|
+
const option = timeOptions[activeTimeIndex];
|
|
828
|
+
if (typed) {
|
|
829
|
+
commitTimeOption(typed);
|
|
830
|
+
} else if (option) {
|
|
831
|
+
commitTimeOption(option.time);
|
|
832
|
+
}
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
case 'Tab':
|
|
836
|
+
// Let focus leave; blur commits any typed text as usual.
|
|
837
|
+
timePopover.hide();
|
|
838
|
+
return;
|
|
839
|
+
default:
|
|
840
|
+
break;
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
496
844
|
if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
|
|
497
845
|
e.preventDefault();
|
|
498
846
|
let currentTime = valueParts.time;
|
|
@@ -516,7 +864,7 @@ export function DateTimeInput({
|
|
|
516
864
|
}
|
|
517
865
|
}
|
|
518
866
|
}
|
|
519
|
-
}, [valueParts, hasSeconds, timeIncrement, timeMin, timeMax, fireChange, announce, formatDisplayTime]);
|
|
867
|
+
}, [valueParts, hasSeconds, timeIncrement, timeMin, timeMax, fireChange, announce, formatDisplayTime, hasTimeOptions, isEffectivelyDisabled, timePopover, timeOptions, activeTimeIndex, timePendingInput, showTimeOptions, commitTimeOption]);
|
|
520
868
|
|
|
521
869
|
// --- Clear ---
|
|
522
870
|
const handleClear = useCallback(() => {
|
|
@@ -586,7 +934,7 @@ export function DateTimeInput({
|
|
|
586
934
|
})
|
|
587
935
|
})
|
|
588
936
|
}), /*#__PURE__*/_jsx("input", {
|
|
589
|
-
ref:
|
|
937
|
+
ref: useMergedRefs(ref, dateInputRef),
|
|
590
938
|
id: dateInputId,
|
|
591
939
|
type: "text",
|
|
592
940
|
role: "combobox",
|
|
@@ -643,7 +991,12 @@ export function DateTimeInput({
|
|
|
643
991
|
}), /*#__PURE__*/_jsxs("div", {
|
|
644
992
|
ref: timeContainerRef,
|
|
645
993
|
onClick: handleTimeWrapperClick,
|
|
646
|
-
onMouseUp: handleTimeWrapperMouseUp
|
|
994
|
+
onMouseUp: handleTimeWrapperMouseUp
|
|
995
|
+
// On the wrapper, not just the input: clicking the clock icon or the
|
|
996
|
+
// padding is routed to the input as a synthetic click, which would
|
|
997
|
+
// otherwise open the list mid-gesture and let light dismiss eat it.
|
|
998
|
+
,
|
|
999
|
+
onPointerDown: hasTimeOptions ? markTimePointerActive : undefined,
|
|
647
1000
|
...mergeProps(themeProps('date-time-input-time-segment', {
|
|
648
1001
|
size,
|
|
649
1002
|
status: status?.type ?? null
|
|
@@ -672,7 +1025,17 @@ export function DateTimeInput({
|
|
|
672
1025
|
onFocus: handleTimeFocus,
|
|
673
1026
|
onBlur: handleTimeBlur,
|
|
674
1027
|
onKeyDown: handleTimeKeyDown,
|
|
1028
|
+
onClick: hasTimeOptions ? showTimeOptions : undefined,
|
|
1029
|
+
onPointerDown: hasTimeOptions ? markTimePointerActive : undefined,
|
|
675
1030
|
placeholder: resolvedTimePlaceholder
|
|
1031
|
+
// Combobox semantics appear only with the dropdown opted in, so a
|
|
1032
|
+
// field without it keeps a single combobox on the date half.
|
|
1033
|
+
,
|
|
1034
|
+
role: hasTimeOptions ? 'combobox' : undefined,
|
|
1035
|
+
"aria-expanded": hasTimeOptions ? timePopover.isOpen : undefined,
|
|
1036
|
+
"aria-controls": hasTimeOptions && timePopover.isOpen ? timeListboxId : undefined,
|
|
1037
|
+
"aria-autocomplete": hasTimeOptions ? 'list' : undefined,
|
|
1038
|
+
"aria-activedescendant": hasTimeOptions && timePopover.isOpen && activeTimeIndex >= 0 && activeTimeIndex < timeOptions.length ? timeOptionId(activeTimeIndex) : undefined
|
|
676
1039
|
// With a disabledMessage the input keeps focusability via
|
|
677
1040
|
// aria-disabled so the reason is focus-discoverable; typing is
|
|
678
1041
|
// blocked with readOnly and the mutation guards.
|
|
@@ -680,9 +1043,7 @@ export function DateTimeInput({
|
|
|
680
1043
|
disabled: isEffectivelyDisabled && !showsDisabledMessage,
|
|
681
1044
|
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
682
1045
|
readOnly: showsDisabledMessage || undefined,
|
|
683
|
-
"aria-label":
|
|
684
|
-
label
|
|
685
|
-
}),
|
|
1046
|
+
"aria-label": resolvedTimeLabel,
|
|
686
1047
|
"aria-describedby": ariaDescribedBy,
|
|
687
1048
|
"aria-required": isEffectivelyRequired ? 'true' : undefined,
|
|
688
1049
|
"aria-invalid": status?.type === 'error' || !isTimeInputValid ? 'true' : undefined,
|
|
@@ -721,6 +1082,39 @@ export function DateTimeInput({
|
|
|
721
1082
|
}), {
|
|
722
1083
|
placement: 'below',
|
|
723
1084
|
alignment: 'start'
|
|
1085
|
+
}), hasTimeOptions && timePopover.render(
|
|
1086
|
+
// The layer renders its children open or closed, so mount the list
|
|
1087
|
+
// only while it is open — a 5-minute cadence is 288 nodes that would
|
|
1088
|
+
// otherwise sit in the DOM of every opted-in field for its lifetime.
|
|
1089
|
+
!timePopover.isOpen ? null : /*#__PURE__*/_jsx("div", {
|
|
1090
|
+
id: timeListboxId,
|
|
1091
|
+
role: "listbox",
|
|
1092
|
+
"aria-label": t('@astryx.dateTimeInput.timeOptionsLabel', {
|
|
1093
|
+
label: resolvedTimeLabel
|
|
1094
|
+
}),
|
|
1095
|
+
...mergeProps(themeProps('date-time-input-time-listbox'), {
|
|
1096
|
+
className: "x9f619 xuyqlj2 x1odjw0f x9epnlk xrzjruh"
|
|
1097
|
+
}),
|
|
1098
|
+
children: timeOptions.map((option, index) => {
|
|
1099
|
+
const isSelected = option.time === selectedOptionTime;
|
|
1100
|
+
return /*#__PURE__*/_jsx("div", {
|
|
1101
|
+
id: timeOptionId(index),
|
|
1102
|
+
role: "option",
|
|
1103
|
+
"aria-selected": isSelected,
|
|
1104
|
+
tabIndex: -1
|
|
1105
|
+
// Pointer-down commit: the input must not lose focus to the
|
|
1106
|
+
// option, or blur would fire its own commit first.
|
|
1107
|
+
,
|
|
1108
|
+
onPointerDown: e => e.preventDefault(),
|
|
1109
|
+
onClick: () => commitTimeOption(option.time),
|
|
1110
|
+
onMouseEnter: () => setHighlightedTimeIndex(index),
|
|
1111
|
+
...mergeProps(themeProps('date-time-input-time-option'), stylex.props(styles.timeOption, timeOptionSizeStyles[size], index === activeTimeIndex && styles.timeOptionHighlighted, isSelected && styles.timeOptionSelected)),
|
|
1112
|
+
children: option.label
|
|
1113
|
+
}, option.time);
|
|
1114
|
+
})
|
|
1115
|
+
}), {
|
|
1116
|
+
placement: 'below',
|
|
1117
|
+
alignment: 'start'
|
|
724
1118
|
}), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
725
1119
|
});
|
|
726
1120
|
}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @position Package entry point for DateTimeInput
|
|
6
6
|
*/
|
|
7
7
|
export { DateTimeInput } from './DateTimeInput';
|
|
8
|
-
export type { DateTimeInputProps, DateTimeInputSize, DateTimeInputHourFormat, DateTimeInputTimeIncrement, DateTimeInputStatus, DateTimeInputStatusType, ISODateTimeString, } from './DateTimeInput';
|
|
8
|
+
export type { DateTimeInputProps, DateTimeInputSize, DateTimeInputHourFormat, DateTimeInputTimeIncrement, DateTimeInputTimeOptionInterval, DateTimeInputStatus, DateTimeInputStatusType, ISODateTimeString, } from './DateTimeInput';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* @output Exports Dialog component, DialogProps, DialogVariant, DialogPurpose types
|
|
5
5
|
* @position Core implementation; consumed by index.ts, tested by Dialog.test.tsx
|
|
6
6
|
*
|
|
7
|
+
* The standard variant treats `width` as the preferred surface width, then
|
|
8
|
+
* clamps it to the dynamic viewport with spacing-token gutters so narrow
|
|
9
|
+
* viewports keep content and controls on screen without changing the public API.
|
|
10
|
+
* Fullscreen dialogs add safe-area protection to the default padding fallback
|
|
11
|
+
* while preserving explicit prop/theme padding overrides, and fade in without
|
|
12
|
+
* the centered-dialog translate/scale motion.
|
|
13
|
+
*
|
|
7
14
|
* SYNC: When modified, update these files to stay in sync:
|
|
8
15
|
* - /packages/core/src/Dialog/Dialog.doc.mjs (props table, features, implementation notes)
|
|
9
16
|
* - /packages/core/src/Dialog/Dialog.test.tsx (tests for new/changed behavior)
|
|
@@ -47,6 +54,19 @@ export interface DialogPosition extends DialogBlockPosition {
|
|
|
47
54
|
/** Logical inline-end offset (`inset-inline-end`); mirrors under RTL. */
|
|
48
55
|
end?: number | string;
|
|
49
56
|
}
|
|
57
|
+
/** @internal Verified by Dialog.test.tsx; not re-exported from the package entry point. */
|
|
58
|
+
export declare const dialogFullscreenSafeAreaPaddingContract: {
|
|
59
|
+
readonly blockStart: string;
|
|
60
|
+
readonly blockEnd: string;
|
|
61
|
+
readonly inlineStart: {
|
|
62
|
+
readonly ltr: string;
|
|
63
|
+
readonly rtl: string;
|
|
64
|
+
};
|
|
65
|
+
readonly inlineEnd: {
|
|
66
|
+
readonly ltr: string;
|
|
67
|
+
readonly rtl: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
50
70
|
/**
|
|
51
71
|
* Map a {@link DialogPosition} to resolved CSS offsets. Logical `start`/`end`
|
|
52
72
|
* become `inset-inline-*` (mirror under RTL); each unset offset falls back to
|
|
@@ -99,7 +119,7 @@ export interface DialogProps extends BaseProps<HTMLDialogElement> {
|
|
|
99
119
|
* The actual height will be the height of its content.
|
|
100
120
|
* Numbers are treated as pixels, strings are used as-is.
|
|
101
121
|
* Ignored when variant is 'fullscreen'.
|
|
102
|
-
* @default '
|
|
122
|
+
* @default '75dvh'
|
|
103
123
|
*/
|
|
104
124
|
maxHeight?: number | string;
|
|
105
125
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAuB5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAuB9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,4EAA4E;AAC5E,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAe,SAAQ,mBAAmB;IACzD,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,yEAAyE;IACzE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAuBD,2FAA2F;AAC3F,eAAO,MAAM,uCAAuC;;;;;;;;;;;CAW1C,CAAC;AAkJX;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,cAAc;;;;;EAUpE;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IAC/D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;;;OAOG;IACH,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAmB,EACnB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCAiTb;yBAjUe,MAAM"}
|