@astryxdesign/core 0.1.9 → 0.2.0-canary.0e01213
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 +107 -0
- package/dist/Avatar/Avatar.d.ts +42 -3
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +190 -59
- package/dist/Avatar/AvatarStatusDot.d.ts +6 -4
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- 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 +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +7 -2
- package/dist/Banner/Banner.js +2 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -4
- package/dist/Breadcrumbs/index.d.ts +1 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +2 -1
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +6 -4
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +50 -9
- package/dist/Calendar/dayCellUtils.d.ts +4 -4
- package/dist/Calendar/dayCellUtils.js +2 -2
- 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.js +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +22 -12
- package/dist/Center/Center.d.ts +20 -3
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +10 -2
- package/dist/Chat/ChatComposerInput.js +1 -1
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +3 -1
- package/dist/Chat/ChatLayout.d.ts +7 -0
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +16 -5
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +8 -8
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +10 -3
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +6 -6
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +19 -4
- 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/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +16 -10
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +3 -1
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +42 -3
- package/dist/CommandPalette/CommandPaletteItem.js +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +23 -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 +10 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +33 -19
- 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 +23 -18
- package/dist/Divider/Divider.d.ts +2 -2
- package/dist/Divider/Divider.d.ts.map +1 -1
- package/dist/Divider/Divider.js +13 -0
- 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 +18 -12
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +42 -64
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +5 -2
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +8 -11
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +3 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +10 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +104 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +435 -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 +24 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemHover.js +34 -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 +27 -10
- package/dist/Field/Field.d.ts +3 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +4 -1
- package/dist/Field/FieldLabel.d.ts +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +9 -5
- 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 +10 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +51 -5
- package/dist/FileInput/FileInput.d.ts +10 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +93 -65
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +3 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -4
- package/dist/Icon/Icon.d.ts +15 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +19 -3
- package/dist/Item/Item.d.ts +16 -3
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +31 -6
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +10 -2
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +34 -15
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +6 -3
- package/dist/List/ListItem.d.ts +11 -1
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +2 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -0
- package/dist/MetadataList/MetadataList.d.ts +1 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +4 -2
- package/dist/MultiSelector/MultiSelector.d.ts +9 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +87 -45
- 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.js +2 -2
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -3
- 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/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +6 -1
- package/dist/RadioList/RadioList.d.ts +2 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +5 -5
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +49 -19
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +5 -3
- package/dist/Selector/Selector.d.ts +8 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +72 -19
- 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/SideNavItem.d.ts +1 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +12 -10
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +2 -2
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +87 -34
- package/dist/Spinner/Spinner.d.ts +3 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +11 -2
- package/dist/Switch/Switch.d.ts +8 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +171 -91
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts +2 -11
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +5 -9
- package/dist/TabList/TabListContext.d.ts +0 -5
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +0 -5
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +30 -4
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- 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 +18 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +58 -30
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +3 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +15 -7
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +11 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +65 -25
- package/dist/Table/types.d.ts +32 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Text/Text.d.ts +10 -1
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +25 -2
- package/dist/Text/index.d.ts +2 -2
- package/dist/Text/index.d.ts.map +1 -1
- package/dist/TextArea/TextArea.d.ts +10 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +119 -52
- 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.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +51 -45
- package/dist/TimeInput/TimeInput.d.ts +10 -2
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +17 -17
- package/dist/Timestamp/Timestamp.d.ts +31 -3
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +48 -77
- package/dist/Timestamp/formatInstant.d.ts +41 -0
- package/dist/Timestamp/formatInstant.d.ts.map +1 -0
- package/dist/Timestamp/formatInstant.js +177 -0
- package/dist/Timestamp/index.d.ts +1 -0
- package/dist/Timestamp/index.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.d.ts +56 -0
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -0
- package/dist/Timestamp/tooltipEntries.js +163 -0
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +61 -9
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +3 -1
- package/dist/Token/Token.d.ts +34 -4
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +85 -45
- package/dist/Token/TokenLink.d.ts +62 -0
- package/dist/Token/TokenLink.d.ts.map +1 -0
- package/dist/Token/TokenLink.js +76 -0
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts +9 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +4 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +17 -1
- package/dist/TopNav/TopNavItem.d.ts +3 -1
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +30 -3
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +9 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +8 -6
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +32 -14
- package/dist/Typeahead/BaseTypeahead.d.ts +9 -0
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +22 -11
- package/dist/Typeahead/Typeahead.d.ts +9 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +11 -2
- 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 +115 -35
- package/dist/astryx.umd.js +51 -51
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/containerReveal.pool.stylex.d.ts +281 -0
- package/dist/hooks/containerReveal.pool.stylex.d.ts.map +1 -0
- package/dist/hooks/containerReveal.pool.stylex.js +281 -0
- package/dist/hooks/index.d.ts +4 -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/useAnnounce.d.ts +3 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +39 -1
- package/dist/hooks/useContainerReveal.d.ts +83 -0
- package/dist/hooks/useContainerReveal.d.ts.map +1 -0
- package/dist/hooks/useContainerReveal.js +123 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +52 -11
- 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/useHotkeys.d.ts +9 -0
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +9 -0
- package/dist/hooks/useInputStatusIcon.d.ts +38 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -0
- package/dist/hooks/useInputStatusIcon.js +169 -0
- package/dist/hooks/useKeyboardHint.d.ts +1 -1
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +4 -2
- 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/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/useDirection.d.ts +2 -0
- package/dist/i18n/useDirection.d.ts.map +1 -0
- package/dist/i18n/useDirection.js +27 -0
- package/dist/theme/defineTheme.d.ts +6 -0
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +13 -0
- package/dist/theme/expandColorScale.d.ts +19 -2
- package/dist/theme/expandColorScale.d.ts.map +1 -1
- package/dist/theme/expandColorScale.js +38 -10
- package/dist/theme/index.d.ts +3 -3
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/types.d.ts +39 -2
- package/dist/theme/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/plainDate.d.ts +17 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +23 -4
- 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/locales/en.json +120 -0
- package/locales/pseudo.json +90 -0
- package/package.json +8 -3
- package/src/Avatar/Avatar.doc.mjs +50 -3
- package/src/Avatar/Avatar.test.tsx +218 -0
- package/src/Avatar/Avatar.tsx +285 -79
- package/src/Avatar/AvatarStatusDot.doc.mjs +4 -4
- package/src/Avatar/AvatarStatusDot.tsx +6 -4
- package/src/AvatarGroup/AvatarGroup.doc.mjs +2 -0
- package/src/AvatarGroup/AvatarGroup.test.tsx +162 -2
- package/src/AvatarGroup/AvatarGroup.tsx +58 -3
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +5 -2
- package/src/Banner/Banner.tsx +6 -6
- package/src/Breadcrumbs/BreadcrumbItem.tsx +10 -10
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +52 -1
- package/src/Breadcrumbs/index.ts +4 -0
- package/src/Button/Button.doc.mjs +0 -4
- package/src/Button/Button.test.tsx +16 -0
- package/src/Button/Button.tsx +6 -4
- package/src/Calendar/Calendar.test.tsx +170 -20
- package/src/Calendar/Calendar.tsx +73 -16
- package/src/Calendar/dayCellUtils.test.ts +18 -18
- package/src/Calendar/dayCellUtils.ts +2 -2
- package/src/Calendar/styles.ts +33 -39
- package/src/Card/Card.tsx +1 -1
- package/src/Carousel/Carousel.tsx +25 -6
- package/src/Center/Center.doc.mjs +38 -0
- package/src/Center/Center.test.tsx +75 -0
- package/src/Center/Center.tsx +37 -2
- package/src/Chat/ChatComposer.doc.mjs +2 -2
- package/src/Chat/ChatComposerInput.doc.mjs +1 -1
- package/src/Chat/ChatComposerInput.tsx +2 -2
- package/src/Chat/ChatDictationButton.tsx +7 -1
- package/src/Chat/ChatLayout.test.tsx +57 -0
- package/src/Chat/ChatLayout.tsx +26 -5
- package/src/Chat/ChatMessageBubble.tsx +15 -10
- package/src/Chat/ChatSystemMessage.test.tsx +5 -0
- package/src/Chat/ChatToolCalls.tsx +9 -2
- package/src/Chat/useTriggerMenu.tsx +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +6 -0
- package/src/CheckboxInput/CheckboxInput.test.tsx +23 -0
- package/src/CheckboxInput/CheckboxInput.tsx +21 -6
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -0
- package/src/CheckboxList/CheckboxList.test.tsx +94 -3
- package/src/CheckboxList/CheckboxListItem.tsx +17 -10
- 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/CodeBlock/CodeBlock.test.tsx +17 -0
- package/src/CodeBlock/CodeBlock.tsx +38 -11
- 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.test.tsx +95 -1
- package/src/CommandPalette/CommandPalette.tsx +41 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +59 -2
- package/src/ContextMenu/ContextMenu.tsx +22 -11
- package/src/ContextMenu/index.ts +5 -0
- package/src/DateInput/DateInput.doc.mjs +25 -0
- package/src/DateInput/DateInput.test.tsx +230 -0
- package/src/DateInput/DateInput.tsx +51 -29
- 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 +112 -0
- package/src/DateTimeInput/DateTimeInput.tsx +44 -39
- package/src/Divider/Divider.test.tsx +32 -8
- package/src/Divider/Divider.tsx +14 -1
- package/src/DropdownMenu/DropdownMenu.doc.mjs +5 -2
- package/src/DropdownMenu/DropdownMenu.test.tsx +95 -0
- package/src/DropdownMenu/DropdownMenu.tsx +31 -12
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +49 -66
- package/src/DropdownMenu/DropdownMenuItem.tsx +9 -3
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +4 -12
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +9 -10
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +19 -4
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +84 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +88 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +680 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +569 -0
- package/src/DropdownMenu/index.ts +16 -0
- package/src/DropdownMenu/menuItemHover.ts +40 -0
- package/src/DropdownMenu/menuItemRoles.ts +9 -0
- package/src/DropdownMenu/renderDropdownItems.tsx +40 -14
- package/src/Field/Field.doc.mjs +4 -0
- package/src/Field/Field.tsx +14 -9
- package/src/Field/FieldLabel.test.tsx +25 -0
- package/src/Field/FieldLabel.tsx +12 -3
- package/src/Field/inputStyles.stylex.ts +2 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +1 -0
- package/src/FieldStatus/FieldStatus.test.tsx +133 -0
- package/src/FieldStatus/FieldStatus.tsx +61 -4
- package/src/FileInput/FileInput.doc.mjs +23 -2
- package/src/FileInput/FileInput.test.tsx +104 -13
- package/src/FileInput/FileInput.tsx +106 -79
- package/src/Heading/Heading.tsx +2 -1
- package/src/HoverCard/useHoverCard.tsx +15 -3
- package/src/Icon/Icon.doc.mjs +13 -0
- package/src/Icon/Icon.test.tsx +89 -0
- package/src/Icon/Icon.tsx +51 -3
- package/src/Item/Item.doc.mjs +5 -0
- package/src/Item/Item.test.tsx +88 -0
- package/src/Item/Item.tsx +57 -11
- package/src/Layer/layerAnimations.stylex.ts +23 -0
- package/src/Lightbox/Lightbox.test.tsx +33 -0
- package/src/Lightbox/Lightbox.tsx +30 -10
- package/src/List/List.test.tsx +17 -29
- package/src/List/List.tsx +6 -1
- package/src/List/ListItem.doc.mjs +12 -0
- package/src/List/ListItem.tsx +13 -0
- package/src/Markdown/Markdown.test.tsx +21 -0
- package/src/Markdown/Markdown.tsx +4 -0
- package/src/MetadataList/MetadataList.test.tsx +24 -0
- package/src/MetadataList/MetadataList.tsx +6 -2
- package/src/MultiSelector/MultiSelector.doc.mjs +20 -0
- package/src/MultiSelector/MultiSelector.test.tsx +436 -0
- package/src/MultiSelector/MultiSelector.tsx +133 -67
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
- package/src/NumberInput/NumberInput.doc.mjs +21 -0
- package/src/NumberInput/NumberInput.test.tsx +71 -0
- package/src/NumberInput/NumberInput.tsx +35 -26
- package/src/Outline/Outline.test.tsx +12 -12
- package/src/Outline/Outline.tsx +2 -2
- package/src/Pagination/Pagination.tsx +11 -3
- package/src/PowerSearch/PowerSearch.doc.mjs +15 -0
- package/src/PowerSearch/PowerSearch.test.tsx +23 -0
- package/src/PowerSearch/PowerSearch.tsx +10 -1
- package/src/ProgressBar/ProgressBar.test.tsx +34 -0
- package/src/ProgressBar/ProgressBar.tsx +16 -1
- package/src/RadioList/RadioList.doc.mjs +6 -0
- package/src/RadioList/RadioList.test.tsx +26 -4
- package/src/RadioList/RadioList.tsx +2 -2
- package/src/RadioList/RadioListItem.tsx +12 -5
- package/src/Resizable/ResizeHandle.test.tsx +94 -0
- package/src/Resizable/ResizeHandle.tsx +70 -20
- package/src/SegmentedControl/SegmentedControl.test.tsx +28 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +22 -2
- package/src/Selector/Selector.doc.mjs +15 -0
- package/src/Selector/Selector.test.tsx +400 -0
- package/src/Selector/Selector.tsx +95 -23
- package/src/SideNav/SideNav.tsx +1 -8
- package/src/SideNav/SideNavCollapseButton.tsx +9 -7
- package/src/SideNav/SideNavItem.tsx +5 -3
- package/src/Skeleton/Skeleton.test.tsx +16 -0
- package/src/Skeleton/Skeleton.tsx +13 -1
- package/src/Slider/Slider.doc.mjs +6 -0
- package/src/Slider/Slider.test.tsx +240 -12
- package/src/Slider/Slider.tsx +96 -23
- package/src/Spinner/Spinner.test.tsx +10 -8
- package/src/Spinner/Spinner.tsx +15 -5
- package/src/Switch/Switch.doc.mjs +142 -42
- package/src/Switch/Switch.test.tsx +111 -0
- package/src/Switch/Switch.tsx +149 -32
- package/src/TabList/Tab.tsx +2 -2
- package/src/TabList/TabList.doc.mjs +0 -6
- package/src/TabList/TabList.test.tsx +3 -15
- package/src/TabList/TabList.tsx +6 -17
- package/src/TabList/TabListContext.ts +0 -6
- package/src/TabList/TabMenu.tsx +2 -2
- package/src/Table/BaseTable.tsx +34 -2
- 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/plugins/groupedRows/useTableGroupedRows.tsx +9 -6
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +19 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +48 -21
- package/src/Table/plugins/selection/useTableSelection.test.tsx +61 -3
- package/src/Table/plugins/selection/useTableSelection.tsx +3 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +38 -9
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +161 -2
- package/src/Table/plugins/tree/useTableTreeData.tsx +71 -14
- package/src/Table/types.ts +33 -0
- package/src/Table/useTableRowExpansion.doc.mjs +55 -2
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/Table/useTableTreeData.doc.mjs +9 -0
- package/src/Text/Heading.doc.mjs +3 -3
- package/src/Text/Text.doc.mjs +1 -1
- package/src/Text/Text.test.tsx +42 -0
- package/src/Text/Text.tsx +25 -1
- package/src/Text/index.ts +2 -6
- package/src/TextArea/TextArea.doc.mjs +23 -2
- package/src/TextArea/TextArea.test.tsx +132 -4
- package/src/TextArea/TextArea.tsx +161 -67
- 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 +1 -1
- package/src/Thumbnail/Thumbnail.test.tsx +24 -1
- package/src/Thumbnail/Thumbnail.tsx +28 -35
- package/src/TimeInput/TimeInput.doc.mjs +21 -0
- package/src/TimeInput/TimeInput.test.tsx +23 -0
- package/src/TimeInput/TimeInput.tsx +24 -25
- package/src/Timestamp/Timestamp.doc.mjs +32 -6
- package/src/Timestamp/Timestamp.test.tsx +371 -0
- package/src/Timestamp/Timestamp.tsx +96 -93
- package/src/Timestamp/formatInstant.ts +218 -0
- package/src/Timestamp/index.ts +4 -0
- package/src/Timestamp/tooltipEntries.test.ts +552 -0
- package/src/Timestamp/tooltipEntries.ts +210 -0
- package/src/Toast/ToastViewport.test.tsx +218 -8
- package/src/Toast/ToastViewport.tsx +71 -12
- package/src/ToggleButton/ToggleButton.test.tsx +24 -0
- package/src/ToggleButton/ToggleButton.tsx +19 -1
- package/src/Token/Token.test.tsx +166 -15
- package/src/Token/Token.tsx +104 -47
- package/src/Token/TokenLink.tsx +107 -0
- package/src/Token/index.ts +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +23 -1
- package/src/Tokenizer/Tokenizer.test.tsx +23 -0
- package/src/Tokenizer/Tokenizer.tsx +14 -2
- package/src/Tooltip/Tooltip.test.tsx +46 -0
- package/src/Tooltip/useTooltip.tsx +20 -0
- package/src/TopNav/TopNav.test.tsx +93 -2
- package/src/TopNav/TopNavItem.doc.mjs +3 -3
- package/src/TopNav/TopNavItem.tsx +35 -6
- package/src/TopNav/TopNavMegaMenu.tsx +26 -2
- package/src/TopNav/TopNavMegaMenuFeaturedCard.doc.mjs +1 -1
- package/src/TreeList/TreeList.doc.mjs +6 -0
- package/src/TreeList/TreeList.test.tsx +50 -10
- package/src/TreeList/TreeList.tsx +5 -0
- package/src/TreeList/TreeListBranches.tsx +8 -6
- package/src/TreeList/TreeListItem.tsx +33 -11
- package/src/Typeahead/BaseTypeahead.tsx +42 -15
- package/src/Typeahead/Typeahead.doc.mjs +13 -0
- package/src/Typeahead/Typeahead.test.tsx +112 -0
- package/src/Typeahead/Typeahead.tsx +17 -1
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/__tests__/babelPluginAddExtensions.test.ts +190 -0
- package/src/__tests__/forcedColors.ts +60 -0
- package/src/__tests__/inputWidthContract.test.tsx +62 -0
- package/src/doc-mjs.d.ts +19 -0
- package/src/hooks/containerReveal.pool.stylex.ts +464 -0
- package/src/hooks/index.ts +13 -0
- package/src/hooks/isRtlElement.ts +27 -0
- package/src/hooks/useAnnounce.test.tsx +75 -2
- package/src/hooks/useAnnounce.ts +47 -1
- package/src/hooks/useContainerReveal.test.tsx +116 -0
- package/src/hooks/useContainerReveal.ts +180 -0
- package/src/hooks/useFocusTrap.test.tsx +104 -0
- package/src/hooks/useFocusTrap.ts +61 -12
- 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/useHotkeys.ts +9 -0
- package/src/hooks/useInputStatusIcon.test.tsx +221 -0
- package/src/hooks/useInputStatusIcon.tsx +235 -0
- package/src/hooks/useKeyboardHint.test.tsx +22 -0
- package/src/hooks/useKeyboardHint.tsx +6 -2
- 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/i18n/InternationalizationContext.ts +4 -0
- 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/useDirection.ts +29 -0
- package/src/reset.css +0 -26
- package/src/reset.test.ts +60 -0
- package/src/theme/defineTheme.ts +6 -0
- package/src/theme/derivedVarRegistry.test.ts +1 -0
- package/src/theme/derivedVarRegistry.ts +6 -0
- package/src/theme/expandColorScale.test.ts +144 -0
- package/src/theme/expandColorScale.ts +53 -15
- package/src/theme/generateThemeRules.test.ts +42 -0
- package/src/theme/index.ts +4 -8
- package/src/theme/types.ts +43 -13
- package/src/utils/index.ts +2 -0
- package/src/utils/plainDate.test.ts +24 -6
- package/src/utils/plainDate.ts +18 -4
- package/src/utils/rtlStyles.ts +27 -0
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts +0 -9
- package/dist/Thumbnail/thumbnail.markers.stylex.d.ts.map +0 -1
- package/dist/Thumbnail/thumbnail.markers.stylex.js +0 -14
- package/src/Thumbnail/thumbnail.markers.stylex.ts +0 -12
|
@@ -28,6 +28,7 @@ import { useSize } from "../SizeContext/SizeContext.js";
|
|
|
28
28
|
import { Spinner } from "../Spinner/index.js";
|
|
29
29
|
import { Calendar } from "../Calendar/index.js";
|
|
30
30
|
import { useCalendarConstraints } from "../Calendar/hooks/index.js";
|
|
31
|
+
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
31
32
|
import { usePopover } from "../Popover/index.js";
|
|
32
33
|
import { useTooltip } from "../Tooltip/index.js";
|
|
33
34
|
import { getInputARIA, parseDateInput } from "../utils/index.js";
|
|
@@ -101,6 +102,7 @@ export function DateInput({
|
|
|
101
102
|
placeholder: placeholderFromProps,
|
|
102
103
|
size: sizeProp,
|
|
103
104
|
status,
|
|
105
|
+
statusVariant = 'attached',
|
|
104
106
|
labelTooltip,
|
|
105
107
|
hasClear = false,
|
|
106
108
|
numberOfMonths = 1,
|
|
@@ -144,18 +146,6 @@ export function DateInput({
|
|
|
144
146
|
isEnabled: showsDisabledMessage
|
|
145
147
|
});
|
|
146
148
|
|
|
147
|
-
// Status icon mapping
|
|
148
|
-
const statusIconMap = {
|
|
149
|
-
warning: 'warning',
|
|
150
|
-
error: 'error',
|
|
151
|
-
success: 'success'
|
|
152
|
-
};
|
|
153
|
-
const statusIconColorMap = {
|
|
154
|
-
warning: 'warning',
|
|
155
|
-
error: 'error',
|
|
156
|
-
success: 'success'
|
|
157
|
-
};
|
|
158
|
-
|
|
159
149
|
// Constraint checking for text input validation (reuses calendar logic)
|
|
160
150
|
const {
|
|
161
151
|
isDateDisabled
|
|
@@ -164,10 +154,21 @@ export function DateInput({
|
|
|
164
154
|
max,
|
|
165
155
|
dateConstraints
|
|
166
156
|
});
|
|
157
|
+
const {
|
|
158
|
+
statusIcon,
|
|
159
|
+
describedBy: statusTooltipDescribedBy
|
|
160
|
+
} = useInputStatusIcon({
|
|
161
|
+
status,
|
|
162
|
+
statusVariant,
|
|
163
|
+
isInGroup: !!inputGroup
|
|
164
|
+
});
|
|
167
165
|
const {
|
|
168
166
|
ariaLabelledBy,
|
|
169
167
|
ariaDescribedBy
|
|
170
|
-
} = getInputARIA(inputLabelID, [description ? descriptionID : null, status?.message ? statusMessageID : null,
|
|
168
|
+
} = getInputARIA(inputLabelID, [description ? descriptionID : null, statusVariant !== 'tooltip' && status?.message ? statusMessageID : null,
|
|
169
|
+
// The tooltip variant renders no message box; describe the input by the
|
|
170
|
+
// tooltip's content instead so the status is still announced.
|
|
171
|
+
statusTooltipDescribedBy, showsDisabledMessage ? disabledMessageTooltip.describedBy : null], inputGroup);
|
|
171
172
|
|
|
172
173
|
// Pending input while user is typing (null = show formatted value)
|
|
173
174
|
const [pendingInput, setPendingInput] = useState(null);
|
|
@@ -330,7 +331,7 @@ export function DateInput({
|
|
|
330
331
|
...mergeProps(themeProps('date-input', {
|
|
331
332
|
size,
|
|
332
333
|
status: status?.type ?? null
|
|
333
|
-
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isEffectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
334
|
+
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isEffectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && !isEffectivelyDisabled && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
334
335
|
children: [inputGroup && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
335
336
|
id: inputLabelID,
|
|
336
337
|
children: label
|
|
@@ -351,6 +352,16 @@ export function DateInput({
|
|
|
351
352
|
icon: "calendar",
|
|
352
353
|
size: "sm",
|
|
353
354
|
color: "secondary"
|
|
355
|
+
// Stable theme target on the toggle glyph itself, so a theme can
|
|
356
|
+
// restyle just this icon (color, size, hover) — and each open/closed
|
|
357
|
+
// state — via `defineTheme`. Same-element rules in @layer astryx-theme
|
|
358
|
+
// win over the icon's own base color/size, which a button-level target
|
|
359
|
+
// could not reach. Reflects the popover's open/closed state as a
|
|
360
|
+
// `data-state` attribute.
|
|
361
|
+
,
|
|
362
|
+
...themeProps('date-input-toggle-icon', {
|
|
363
|
+
state: popover.isOpen ? 'expanded' : 'collapsed'
|
|
364
|
+
})
|
|
354
365
|
})
|
|
355
366
|
}), /*#__PURE__*/_jsx("input", {
|
|
356
367
|
ref: mergeRefs(ref, inputRef),
|
|
@@ -413,14 +424,16 @@ export function DateInput({
|
|
|
413
424
|
icon: "close",
|
|
414
425
|
size: "sm",
|
|
415
426
|
color: "secondary"
|
|
427
|
+
// Stable theme target on the clear glyph itself, so a theme can
|
|
428
|
+
// restyle just this icon (color, size, hover) via `defineTheme`.
|
|
429
|
+
// Same-element rules in @layer astryx-theme win over the icon's own
|
|
430
|
+
// base color/size, which a button-level target could not reach.
|
|
431
|
+
,
|
|
432
|
+
...themeProps('date-input-clear-icon')
|
|
416
433
|
})
|
|
417
434
|
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
418
435
|
size: "sm"
|
|
419
|
-
}),
|
|
420
|
-
icon: statusIconMap[status.type],
|
|
421
|
-
size: "md",
|
|
422
|
-
color: statusIconColorMap[status.type]
|
|
423
|
-
}), popover.render(/*#__PURE__*/_jsx(Calendar, {
|
|
436
|
+
}), statusIcon, popover.render(/*#__PURE__*/_jsx(Calendar, {
|
|
424
437
|
handleRef: calendarRef,
|
|
425
438
|
mode: "single",
|
|
426
439
|
value: optimisticValue,
|
|
@@ -451,6 +464,7 @@ export function DateInput({
|
|
|
451
464
|
message: status.message,
|
|
452
465
|
messageID: status.message ? statusMessageID : undefined
|
|
453
466
|
} : undefined,
|
|
467
|
+
statusVariant: statusVariant,
|
|
454
468
|
labelTooltip: labelTooltip,
|
|
455
469
|
width: width,
|
|
456
470
|
children: inputWrapper
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InputStatus } from '../Field';
|
|
1
|
+
import { type InputStatus, type FieldStatusVariant } from '../Field';
|
|
2
2
|
import { type ISODateString, type DateRange } from '../Calendar';
|
|
3
3
|
import type { BaseProps } from '../BaseProps';
|
|
4
4
|
import type { SizeValue } from '../utils/types';
|
|
@@ -116,6 +116,14 @@ export interface DateRangeInputProps extends Omit<BaseProps, 'onChange' | 'defau
|
|
|
116
116
|
* Status indicator for the input.
|
|
117
117
|
*/
|
|
118
118
|
status?: InputStatus;
|
|
119
|
+
/**
|
|
120
|
+
* How the status message is placed relative to the input.
|
|
121
|
+
* - 'attached': message overlaps directly below the input (bordered treatment)
|
|
122
|
+
* - 'detached': message floats below as a separate element with spacing
|
|
123
|
+
* - 'tooltip': no message box; the status icon becomes a focusable info-tip button that reveals the message on hover, keyboard focus, or tap
|
|
124
|
+
* @default 'attached'
|
|
125
|
+
*/
|
|
126
|
+
statusVariant?: FieldStatusVariant;
|
|
119
127
|
/**
|
|
120
128
|
* Width of the field. Numbers are treated as pixels, strings are used as-is
|
|
121
129
|
* (e.g. `'100%'`). Sizes the whole field (label, control, and status) so they
|
|
@@ -148,7 +156,7 @@ export interface DateRangeInputProps extends Omit<BaseProps, 'onChange' | 'defau
|
|
|
148
156
|
* />
|
|
149
157
|
* ```
|
|
150
158
|
*/
|
|
151
|
-
export declare function DateRangeInput({ label, isLabelHidden, description, isOptional, isRequired, isDisabled, disabledMessage, value, onChange, changeAction, isLoading, min, max, dateConstraints, presets, hasClear, placeholder: placeholderFromProps, size: sizeProp, status, labelTooltip, numberOfMonths, width, xstyle, className, style, ref, ...rest }: DateRangeInputProps): import("react").JSX.Element;
|
|
159
|
+
export declare function DateRangeInput({ label, isLabelHidden, description, isOptional, isRequired, isDisabled, disabledMessage, value, onChange, changeAction, isLoading, min, max, dateConstraints, presets, hasClear, placeholder: placeholderFromProps, size: sizeProp, status, statusVariant, labelTooltip, numberOfMonths, width, xstyle, className, style, ref, ...rest }: DateRangeInputProps): import("react").JSX.Element;
|
|
152
160
|
export declare namespace DateRangeInput {
|
|
153
161
|
var displayName: string;
|
|
154
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../src/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAEL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAW,KAAK,aAAa,EAAE,KAAK,SAAS,EAAC,M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from "../Popover/index.js";
|
|
|
28
28
|
import { useTooltip } from "../Tooltip/index.js";
|
|
29
29
|
import { mergeProps } from "../utils/index.js";
|
|
30
30
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
31
|
+
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
31
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
32
33
|
import { useTranslator } from "../i18n/index.js";
|
|
33
34
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -104,6 +105,7 @@ export function DateRangeInput({
|
|
|
104
105
|
placeholder: placeholderFromProps,
|
|
105
106
|
size: sizeProp,
|
|
106
107
|
status,
|
|
108
|
+
statusVariant = 'attached',
|
|
107
109
|
labelTooltip,
|
|
108
110
|
numberOfMonths = 2,
|
|
109
111
|
width,
|
|
@@ -138,17 +140,17 @@ export function DateRangeInput({
|
|
|
138
140
|
focusTrigger: 'always',
|
|
139
141
|
isEnabled: showsDisabledMessage
|
|
140
142
|
});
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
const {
|
|
144
|
+
statusIcon,
|
|
145
|
+
describedBy: statusTooltipDescribedBy
|
|
146
|
+
} = useInputStatusIcon({
|
|
147
|
+
status,
|
|
148
|
+
statusVariant
|
|
149
|
+
});
|
|
150
|
+
const ariaDescribedBy = [description ? descriptionID : null, statusVariant !== 'tooltip' && status?.message ? statusMessageID : null,
|
|
151
|
+
// The tooltip variant renders no message box; describe the input by the
|
|
152
|
+
// tooltip's content instead so the status is still announced.
|
|
153
|
+
statusTooltipDescribedBy, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined;
|
|
152
154
|
const displayValue = useMemo(() => formatRangeDisplay(optimisticValue), [optimisticValue]);
|
|
153
155
|
const popover = usePopover({
|
|
154
156
|
dialogLabel: t('@astryx.dateRangeInput.dialogLabel'),
|
|
@@ -202,6 +204,7 @@ export function DateRangeInput({
|
|
|
202
204
|
message: status.message,
|
|
203
205
|
messageID: status.message ? statusMessageID : undefined
|
|
204
206
|
} : undefined,
|
|
207
|
+
statusVariant: statusVariant,
|
|
205
208
|
labelTooltip: labelTooltip,
|
|
206
209
|
width: width,
|
|
207
210
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
@@ -216,7 +219,7 @@ export function DateRangeInput({
|
|
|
216
219
|
...mergeProps(themeProps('date-range-input', {
|
|
217
220
|
size,
|
|
218
221
|
status: status?.type ?? null
|
|
219
|
-
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isEffectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
|
|
222
|
+
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isEffectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && !isEffectivelyDisabled && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
|
|
220
223
|
children: [/*#__PURE__*/_jsx("button", {
|
|
221
224
|
type: "button",
|
|
222
225
|
onClick: handleToggle,
|
|
@@ -234,7 +237,10 @@ export function DateRangeInput({
|
|
|
234
237
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
235
238
|
icon: "calendar",
|
|
236
239
|
size: "sm",
|
|
237
|
-
color: "secondary"
|
|
240
|
+
color: "secondary",
|
|
241
|
+
...themeProps('date-range-input-toggle-icon', {
|
|
242
|
+
state: popover.isOpen ? 'expanded' : 'collapsed'
|
|
243
|
+
})
|
|
238
244
|
})
|
|
239
245
|
}), /*#__PURE__*/_jsx("button", {
|
|
240
246
|
ref: ref,
|
|
@@ -282,15 +288,12 @@ export function DateRangeInput({
|
|
|
282
288
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
283
289
|
icon: "close",
|
|
284
290
|
size: "sm",
|
|
285
|
-
color: "secondary"
|
|
291
|
+
color: "secondary",
|
|
292
|
+
...themeProps('date-range-input-clear-icon')
|
|
286
293
|
})
|
|
287
294
|
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
288
295
|
size: "sm"
|
|
289
|
-
}),
|
|
290
|
-
icon: statusIconMap[status.type],
|
|
291
|
-
size: "md",
|
|
292
|
-
color: statusIconColorMap[status.type]
|
|
293
|
-
})]
|
|
296
|
+
}), statusIcon]
|
|
294
297
|
}), popover.render(/*#__PURE__*/_jsxs("div", {
|
|
295
298
|
...{
|
|
296
299
|
className: "x78zum5"
|
|
@@ -299,7 +302,7 @@ export function DateRangeInput({
|
|
|
299
302
|
role: "group",
|
|
300
303
|
"aria-label": t('@astryx.dateRangeInput.presetDateRanges'),
|
|
301
304
|
...{
|
|
302
|
-
className: "x78zum5 xdt5ytf xzye2dw x1b2ylru
|
|
305
|
+
className: "x78zum5 xdt5ytf xzye2dw x1b2ylru xw8tdv1 x18b5jzi xl0t3rv x1d77m7x"
|
|
303
306
|
},
|
|
304
307
|
children: presets.map(preset => {
|
|
305
308
|
const presetRange = preset.getRange();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAEL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AA6BlB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAK9C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG;IACvC,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;CACvC,CAAC;AA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I,EACR,EAAE,kBAAkB,+BAmnBpB;yBAnpBe,aAAa"}
|
|
@@ -28,6 +28,7 @@ import { useCalendarConstraints } from "../Calendar/hooks/index.js";
|
|
|
28
28
|
import { usePopover } from "../Popover/index.js";
|
|
29
29
|
import { useTooltip } from "../Tooltip/index.js";
|
|
30
30
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
31
|
+
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
31
32
|
import { parseDateInput, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, mergeProps, mergeRefs } from "../utils/index.js";
|
|
32
33
|
import { plainDateFromISO, plainDateToISO, plainDateFormat, DATE_FORMAT_LONG } from "../utils/plainDate.js";
|
|
33
34
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
@@ -181,17 +182,19 @@ export function DateTimeInput({
|
|
|
181
182
|
focusTrigger: 'always',
|
|
182
183
|
isEnabled: showsDisabledMessage
|
|
183
184
|
});
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
|
|
186
|
+
// DateTimeInput fixes its status presentation to the detached message box,
|
|
187
|
+
// so the shared helper suppresses the on-field icon (the message box carries
|
|
188
|
+
// its own leading glyph). Routed through the helper for consistency with the
|
|
189
|
+
// rest of the bordered input family.
|
|
190
|
+
const {
|
|
191
|
+
statusIcon,
|
|
192
|
+
describedBy: statusTooltipDescribedBy
|
|
193
|
+
} = useInputStatusIcon({
|
|
194
|
+
status,
|
|
195
|
+
statusVariant: 'detached'
|
|
196
|
+
});
|
|
197
|
+
const ariaDescribedBy = [description ? descriptionID : null, status?.message ? statusMessageID : null, statusTooltipDescribedBy, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined;
|
|
195
198
|
|
|
196
199
|
// Split min/max and current value
|
|
197
200
|
const minParts = useMemo(() => splitDateTime(min), [min]);
|
|
@@ -496,7 +499,10 @@ export function DateTimeInput({
|
|
|
496
499
|
}), stylex.props(styles.row, xstyle), className, style),
|
|
497
500
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
498
501
|
ref: popover.triggerRef,
|
|
499
|
-
...
|
|
502
|
+
...mergeProps(themeProps('date-time-input-date-segment', {
|
|
503
|
+
size,
|
|
504
|
+
status: status?.type ?? null
|
|
505
|
+
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], styles.dateWrapper, isEffectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && !isEffectivelyDisabled && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type])),
|
|
500
506
|
children: [/*#__PURE__*/_jsx("button", {
|
|
501
507
|
type: "button",
|
|
502
508
|
onClick: handleCalendarToggle,
|
|
@@ -578,16 +584,15 @@ export function DateTimeInput({
|
|
|
578
584
|
})
|
|
579
585
|
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
580
586
|
size: "sm"
|
|
581
|
-
}),
|
|
582
|
-
icon: statusIconMap[status.type],
|
|
583
|
-
size: "md",
|
|
584
|
-
color: statusIconColorMap[status.type]
|
|
585
|
-
})]
|
|
587
|
+
}), statusIcon]
|
|
586
588
|
}), /*#__PURE__*/_jsxs("div", {
|
|
587
589
|
ref: timeContainerRef,
|
|
588
590
|
onClick: handleTimeWrapperClick,
|
|
589
591
|
onMouseUp: handleTimeWrapperMouseUp,
|
|
590
|
-
...
|
|
592
|
+
...mergeProps(themeProps('date-time-input-time-segment', {
|
|
593
|
+
size,
|
|
594
|
+
status: status?.type ?? null
|
|
595
|
+
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], styles.timeWrapper, isEffectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && !isEffectivelyDisabled && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type])),
|
|
591
596
|
children: [/*#__PURE__*/_jsx("div", {
|
|
592
597
|
...{
|
|
593
598
|
className: "x78zum5 x6s0dn4 xl56j7k x2lah0s"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - /apps/storybook/stories/Divider.stories.tsx
|
|
11
11
|
* - /packages/cli/templates/blocks/components/Divider/ (showcase blocks)
|
|
12
12
|
*/
|
|
13
|
-
import type
|
|
13
|
+
import { type ReactNode } from 'react';
|
|
14
14
|
import type { BaseProps } from '../BaseProps';
|
|
15
15
|
/**
|
|
16
16
|
* Extensible variant map for Divider.
|
|
@@ -71,7 +71,7 @@ export interface DividerProps extends BaseProps<HTMLDivElement> {
|
|
|
71
71
|
* <Divider label="or" />
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
|
-
export declare function Divider({ orientation, label, variant, isFullBleed, xstyle, className, style, ref, ...props }: DividerProps): import("react").JSX.Element;
|
|
74
|
+
export declare function Divider({ orientation, label, variant, isFullBleed, xstyle, className, style, ref, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...props }: DividerProps): import("react").JSX.Element;
|
|
75
75
|
export declare namespace Divider {
|
|
76
76
|
var displayName: string;
|
|
77
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../src/Divider/Divider.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../src/Divider/Divider.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAY5C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,IAAI,CAAC;IACb,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC7D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IAExC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAiED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,EACtB,WAA0B,EAC1B,KAAK,EACL,OAAkB,EAClB,WAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,cAAc,EACjC,GAAG,KAAK,EACT,EAAE,YAAY,+BA0Dd;yBAtEe,OAAO"}
|
package/dist/Divider/Divider.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* - /apps/storybook/stories/Divider.stories.tsx
|
|
15
15
|
* - /packages/cli/templates/blocks/components/Divider/ (showcase blocks)
|
|
16
16
|
*/
|
|
17
|
+
import { useId } from 'react';
|
|
17
18
|
import * as stylex from '@stylexjs/stylex';
|
|
18
19
|
import "../theme/tokens.stylex.js";
|
|
19
20
|
import { colorVars, spacingVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
|
|
@@ -110,14 +111,25 @@ export function Divider({
|
|
|
110
111
|
className,
|
|
111
112
|
style,
|
|
112
113
|
ref,
|
|
114
|
+
'aria-label': ariaLabel,
|
|
115
|
+
'aria-labelledby': ariaLabelledBy,
|
|
113
116
|
...props
|
|
114
117
|
}) {
|
|
115
118
|
const isHorizontal = orientation === 'horizontal';
|
|
119
|
+
const labelId = useId();
|
|
120
|
+
|
|
121
|
+
// A separator does not derive its accessible name from its content, so the
|
|
122
|
+
// rendered label must be referenced explicitly via aria-labelledby to be
|
|
123
|
+
// exposed as the separator's name (WCAG 1.3.1). An explicit aria-label or
|
|
124
|
+
// aria-labelledby from the consumer takes precedence.
|
|
125
|
+
const resolvedLabelledBy = ariaLabelledBy ?? (label && ariaLabel == null ? labelId : undefined);
|
|
116
126
|
return /*#__PURE__*/_jsxs("div", {
|
|
117
127
|
ref: ref,
|
|
118
128
|
...props,
|
|
119
129
|
role: "separator",
|
|
120
130
|
"aria-orientation": orientation,
|
|
131
|
+
"aria-label": ariaLabel,
|
|
132
|
+
"aria-labelledby": resolvedLabelledBy,
|
|
121
133
|
...mergeProps(themeProps('divider', {
|
|
122
134
|
variant,
|
|
123
135
|
orientation
|
|
@@ -125,6 +137,7 @@ export function Divider({
|
|
|
125
137
|
children: [/*#__PURE__*/_jsx("div", {
|
|
126
138
|
...stylex.props(isHorizontal ? lineStyles.horizontalLine : lineStyles.verticalLine, lineStyles[variant])
|
|
127
139
|
}), label && /*#__PURE__*/_jsx("div", {
|
|
140
|
+
id: labelId,
|
|
128
141
|
...{
|
|
129
142
|
0: {
|
|
130
143
|
className: "x2lah0s xrrkdod x141an7d x1ltkj2j xv1l7n4"
|
|
@@ -27,6 +27,12 @@ export interface DropdownMenuItemData {
|
|
|
27
27
|
onClick?: () => void;
|
|
28
28
|
isDisabled?: boolean;
|
|
29
29
|
icon?: ReactNode | IconType;
|
|
30
|
+
/**
|
|
31
|
+
* Nested submenu entries. When present, this row becomes a submenu (a
|
|
32
|
+
* flyout revealing `items`) instead of a leaf action — no separate item
|
|
33
|
+
* "type" is needed. Data-mode parity for the compound DropdownMenuSubMenu API.
|
|
34
|
+
*/
|
|
35
|
+
items?: DropdownMenuOption[];
|
|
30
36
|
}
|
|
31
37
|
export interface DropdownMenuDivider {
|
|
32
38
|
type: 'divider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAS,KAAK,WAAW,EAAC,MAAM,WAAW,CAAC;AAEnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAetC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAQtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyC5C,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,oBAAoB,EAAE,CAAC;CAC/B;AAED,MAAM,MAAM,kBAAkB,GAC5B,oBAAoB,GAAG,mBAAmB,GAAG,mBAAmB,CAAC;AAMnE,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAEnE,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,qBAAsB,SAAQ,qBAAqB;IAC3D,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AA+BpD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,gBAAgB,EAC5B,YAAY,EACZ,SAAS,EACT,OAAO,EACP,UAAiB,EACjB,SAAmB,EACnB,SAAS,EACT,KAAK,EACL,MAAM,EACN,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAqRnB;yBAlSe,YAAY"}
|
|
@@ -27,7 +27,7 @@ import { usePopover } from "../Popover/usePopover.js";
|
|
|
27
27
|
import { Button } from "../Button/index.js";
|
|
28
28
|
import { Icon } from "../Icon/index.js";
|
|
29
29
|
import { renderDropdownItems } from "./renderDropdownItems.js";
|
|
30
|
-
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR } from "./menuItemRoles.js";
|
|
30
|
+
import { MENU_ITEM_ROLES, MENU_ITEM_SELECTOR, MENU_BOUNDARY_SELECTOR } from "./menuItemRoles.js";
|
|
31
31
|
import { DropdownMenuContext } from "./DropdownMenuContext.js";
|
|
32
32
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
33
33
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
@@ -134,6 +134,14 @@ export function DropdownMenu({
|
|
|
134
134
|
};
|
|
135
135
|
const items = ('items' in props ? props.items : undefined) ?? [];
|
|
136
136
|
const children = props.children;
|
|
137
|
+
|
|
138
|
+
// Extract BaseProps pass-throughs (aria-*, id, event handlers) from the
|
|
139
|
+
// discriminated-union rest bag so they can be forwarded to the menu element.
|
|
140
|
+
const {
|
|
141
|
+
items: _items,
|
|
142
|
+
children: _children,
|
|
143
|
+
...rest
|
|
144
|
+
} = props;
|
|
137
145
|
const menuId = useId();
|
|
138
146
|
const menuSize = button.size ?? 'md';
|
|
139
147
|
const buttonRef = useRef(null);
|
|
@@ -195,16 +203,19 @@ export function DropdownMenu({
|
|
|
195
203
|
listRef,
|
|
196
204
|
handleKeyDown: listNavKeyDown,
|
|
197
205
|
focusFirst,
|
|
198
|
-
focusItem
|
|
206
|
+
focusItem,
|
|
207
|
+
ownsEvent,
|
|
208
|
+
getItems: getMenuItems
|
|
199
209
|
} = useListFocus({
|
|
200
210
|
itemSelector: MENU_ITEM_SELECTOR,
|
|
211
|
+
boundarySelector: MENU_BOUNDARY_SELECTOR,
|
|
201
212
|
wrap: false,
|
|
202
213
|
onEscape: closeMenu
|
|
203
214
|
});
|
|
204
215
|
|
|
205
216
|
// First-character typeahead over the (enabled) menu items — jump to the next
|
|
206
|
-
// item whose label starts with the typed text (menus-11).
|
|
207
|
-
|
|
217
|
+
// item whose label starts with the typed text (menus-11). Reuses the hook's
|
|
218
|
+
// scoped item collection so an inline submenu flyout's items aren't swept in.
|
|
208
219
|
const typeahead = useTypeahead({
|
|
209
220
|
getItemLabels: () => getMenuItems().map(el => el.textContent),
|
|
210
221
|
onMatch: focusItem,
|
|
@@ -225,6 +236,11 @@ export function DropdownMenu({
|
|
|
225
236
|
|
|
226
237
|
// Extend useListFocus with Enter/Space activation + typeahead
|
|
227
238
|
const listKeyDown = useCallback(e => {
|
|
239
|
+
// A submenu flyout renders inline inside this menu; its key events bubble
|
|
240
|
+
// up here. Let that level own them — only handle events from this level.
|
|
241
|
+
if (!ownsEvent(e)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
228
244
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
229
245
|
e.preventDefault();
|
|
230
246
|
const focused = document.activeElement;
|
|
@@ -248,7 +264,7 @@ export function DropdownMenu({
|
|
|
248
264
|
return;
|
|
249
265
|
}
|
|
250
266
|
listNavKeyDown(e);
|
|
251
|
-
}, [listNavKeyDown, closeMenu, typeahead]);
|
|
267
|
+
}, [listNavKeyDown, closeMenu, typeahead, ownsEvent]);
|
|
252
268
|
const openAndFocus = useCallback(() => {
|
|
253
269
|
popover.show();
|
|
254
270
|
requestAnimationFrame(() => focusFirst());
|
|
@@ -323,6 +339,7 @@ export function DropdownMenu({
|
|
|
323
339
|
"aria-controls": menuId,
|
|
324
340
|
"data-testid": testId
|
|
325
341
|
}), popover.render(/*#__PURE__*/_jsx("div", {
|
|
342
|
+
...rest,
|
|
326
343
|
ref: listRef,
|
|
327
344
|
id: menuId,
|
|
328
345
|
role: "menu"
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file DropdownMenuCheckboxItem.tsx
|
|
3
|
-
* @input React, stylex, Item +
|
|
3
|
+
* @input React, stylex, Item + CheckboxInput + DropdownMenu context + tokens from core
|
|
4
4
|
* @output DropdownMenuCheckboxItem — a standalone checkable menu item.
|
|
5
5
|
* @position Sub-component; used inside DropdownMenu.
|
|
6
6
|
*
|
|
7
7
|
* A menu item that toggles an independent boolean (role="menuitemcheckbox").
|
|
8
|
-
* Unlike CheckboxInput, there is no nested native <input
|
|
9
|
-
* the role and aria-checked, per the
|
|
10
|
-
* Keyboard navigation (arrows/typeahead) and
|
|
11
|
-
* the parent DropdownMenu's useListFocus +
|
|
12
|
-
* menuitemcheckbox alongside plain menuitem rows.
|
|
8
|
+
* Unlike CheckboxInput, there is no nested native <input> that participates in
|
|
9
|
+
* accessibility: the row itself owns the role and aria-checked, per the
|
|
10
|
+
* WAI-ARIA menuitemcheckbox pattern. Keyboard navigation (arrows/typeahead) and
|
|
11
|
+
* Enter/Space activation come from the parent DropdownMenu's useListFocus +
|
|
12
|
+
* activation path, which matches menuitemcheckbox alongside plain menuitem rows.
|
|
13
13
|
*
|
|
14
|
-
* The
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
14
|
+
* The checkbox visual composes the real CheckboxInput primitive so its checkmark
|
|
15
|
+
* matches CheckboxListItem and picks up the standard `checkbox` theming slots.
|
|
16
|
+
* It is purely decorative: the composed control is wrapped in an element that is
|
|
17
|
+
* both `aria-hidden` and `inert`, so it contributes nothing to the row's
|
|
18
|
+
* accessible name, and its native <input> and sr-only label stay out of the tab
|
|
19
|
+
* order and the accessibility tree while pointer clicks fall through to the row
|
|
20
|
+
* — the same shim MultiSelector uses. The row owns the checked state and
|
|
21
|
+
* accessible name. The control size is derived from the menu's item size (a
|
|
22
|
+
* `sm` menu gets the compact control; `md`/`lg` get the standard one) and it
|
|
23
|
+
* swaps to the inline-end of the row on coarse-pointer (touch) devices via CSS
|
|
24
|
+
* `order`, so it lands where selection toggles are conventionally placed on
|
|
25
|
+
* mobile.
|
|
20
26
|
*/
|
|
21
27
|
import { type ReactNode } from 'react';
|
|
22
28
|
import { type IconType } from '../Icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"DropdownMenuCheckboxItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuCheckboxItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAOtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsC5C,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,SAAS,EACT,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,UAAU,CAClD;IACC;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,UAAkB,EAClB,gBAAwB,EACxB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,6BAA6B,+BA6D/B;yBA1Ee,wBAAwB"}
|