@astryxdesign/core 0.3.0 → 0.4.0-canary.058f476
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 +156 -0
- package/dist/AlertDialog/AlertDialog.d.ts +10 -2
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +22 -3
- package/dist/AppShell/AppShell.d.ts +2 -2
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +40 -9
- package/dist/AspectRatio/AspectRatio.d.ts +13 -0
- package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/dist/AspectRatio/AspectRatio.js +10 -2
- package/dist/AspectRatio/index.d.ts.map +1 -1
- package/dist/AspectRatio/index.js +1 -2
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +33 -20
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +2 -3
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +1 -2
- package/dist/Badge/index.d.ts.map +1 -1
- package/dist/Badge/index.js +1 -2
- package/dist/Banner/Banner.d.ts +3 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -17
- package/dist/Blockquote/Blockquote.d.ts.map +1 -1
- package/dist/Blockquote/Blockquote.js +1 -2
- package/dist/Blockquote/index.d.ts.map +1 -1
- package/dist/Blockquote/index.js +1 -2
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +21 -8
- package/dist/Breadcrumbs/index.d.ts +2 -1
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +1 -0
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +12 -16
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +2 -1
- package/dist/Calendar/styles.d.ts +0 -2
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +0 -2
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +1 -2
- package/dist/Card/index.d.ts.map +1 -1
- package/dist/Card/index.js +1 -2
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +8 -12
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +1 -2
- package/dist/Center/index.d.ts.map +1 -1
- package/dist/Center/index.js +1 -2
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +2 -1
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +3 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +4 -3
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +17 -17
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +2 -6
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +36 -125
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +3 -11
- package/dist/Code/Code.d.ts.map +1 -1
- package/dist/Code/Code.js +1 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +84 -67
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +35 -15
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +5 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +6 -3
- package/dist/CommandPalette/CommandPaletteList.js +1 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts +1 -1
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +32 -31
- package/dist/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +1 -1
- package/dist/ContextMenu/index.d.ts +2 -1
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +1 -0
- package/dist/DateInput/DateInput.d.ts +9 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +47 -33
- package/dist/DateRangeInput/DateRangeInput.d.ts +9 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +55 -32
- package/dist/DateTimeInput/DateTimeInput.d.ts +9 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +54 -30
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +4 -4
- package/dist/DropdownMenu/DropdownMenu.d.ts +33 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +62 -20
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +8 -11
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +32 -31
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts +25 -0
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuDivider.js +66 -0
- package/dist/DropdownMenu/DropdownMenuItem.d.ts +15 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +20 -8
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +10 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +5 -5
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +24 -67
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -8
- package/dist/DropdownMenu/index.d.ts +2 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +4 -0
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +35 -27
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +9 -5
- package/dist/Field/InputClearButton.d.ts +16 -3
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +15 -4
- package/dist/Field/PanelSearchInput.d.ts +81 -0
- package/dist/Field/PanelSearchInput.d.ts.map +1 -0
- package/dist/Field/PanelSearchInput.js +151 -0
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +21 -10
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +1 -2
- package/dist/Grid/index.d.ts.map +1 -1
- package/dist/Grid/index.js +1 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +3 -19
- package/dist/Icon/globalIconRegistry.d.ts +5 -4
- package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
- package/dist/Icon/globalIconRegistry.js +5 -4
- package/dist/Indicator/CheckIndicator.d.ts +25 -0
- package/dist/Indicator/CheckIndicator.d.ts.map +1 -0
- package/dist/Indicator/CheckIndicator.js +155 -0
- package/dist/Indicator/CheckboxIndicator.d.ts +22 -0
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -0
- package/dist/Indicator/CheckboxIndicator.js +173 -0
- package/dist/Indicator/RadioIndicator.d.ts +23 -0
- package/dist/Indicator/RadioIndicator.d.ts.map +1 -0
- package/dist/Indicator/RadioIndicator.js +137 -0
- package/dist/Indicator/index.d.ts +24 -0
- package/dist/Indicator/index.d.ts.map +1 -0
- package/dist/Indicator/index.js +26 -0
- package/dist/Indicator/indicator.markers.stylex.d.ts +16 -0
- package/dist/Indicator/indicator.markers.stylex.d.ts.map +1 -0
- package/dist/Indicator/indicator.markers.stylex.js +21 -0
- package/dist/Indicator/indicatorRegistry.d.ts +71 -0
- package/dist/Indicator/indicatorRegistry.d.ts.map +1 -0
- package/dist/Indicator/indicatorRegistry.js +93 -0
- package/dist/Indicator/types.d.ts +177 -0
- package/dist/Indicator/types.d.ts.map +1 -0
- package/dist/Indicator/types.js +1 -0
- package/dist/Indicator/useIndicator.d.ts +18 -0
- package/dist/Indicator/useIndicator.d.ts.map +1 -0
- package/dist/Indicator/useIndicator.js +30 -0
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -8
- package/dist/Layer/useLayer.d.ts +14 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +25 -2
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +80 -103
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +4 -5
- package/dist/MobileNav/MobileNav.js +8 -8
- package/dist/MoreMenu/MoreMenu.d.ts +14 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -0
- package/dist/MultiSelector/MultiSelector.d.ts +8 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +205 -170
- package/dist/NumberInput/NumberInput.d.ts +27 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +230 -42
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +2 -3
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +61 -63
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -8
- package/dist/Popover/usePopover.d.ts +15 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +14 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +7 -0
- package/dist/ProgressBar/ProgressBar.d.ts +11 -4
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +95 -6
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +29 -84
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +2 -3
- package/dist/Section/Section.d.ts.map +1 -1
- package/dist/Section/Section.js +1 -2
- package/dist/Section/index.d.ts.map +1 -1
- package/dist/Section/index.js +1 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -3
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +3 -11
- package/dist/Selector/Selector.d.ts +12 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +293 -183
- package/dist/Selector/hooks.d.ts +18 -6
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +57 -40
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +1 -1
- package/dist/SideNav/SideNavCollapseButton.d.ts +1 -1
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +29 -14
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +56 -20
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +28 -22
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +1 -2
- package/dist/Skeleton/index.d.ts.map +1 -1
- package/dist/Skeleton/index.js +1 -2
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +2 -6
- package/dist/Stack/stack.stylex.d.ts +3 -3
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +14 -13
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -3
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +41 -19
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +8 -0
- package/dist/Table/TableRow.d.ts +1 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +4 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +22 -18
- package/dist/Table/plugins/rowExpansion/index.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/index.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/index.js +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +41 -76
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +94 -345
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +23 -4
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +29 -33
- package/dist/Table/tableContextMenu.d.ts.map +1 -1
- package/dist/Table/tableContextMenu.js +2 -1
- package/dist/Table/types.d.ts +11 -0
- package/dist/Table/types.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 +16 -6
- package/dist/TextInput/TextInput.d.ts +10 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +13 -19
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +32 -26
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +14 -17
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -3
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +16 -34
- package/dist/Timestamp/formatInstant.d.ts +11 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +3 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +20 -11
- 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 +3 -19
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +6 -5
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +54 -16
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +3 -9
- package/dist/TopNav/TopNavMegaMenu.d.ts +7 -0
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +146 -60
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +22 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +83 -38
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +13 -0
- package/dist/TreeList/TreeListBranches.d.ts +1 -1
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +14 -4
- package/dist/TreeList/TreeListItem.d.ts +11 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +57 -30
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +16 -8
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -2
- package/dist/VisuallyHidden/index.d.ts.map +1 -1
- package/dist/VisuallyHidden/index.js +1 -2
- package/dist/astryx.css +86 -96
- package/dist/astryx.umd.js +56 -56
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/containerReveal.stylex.d.ts +61 -0
- package/dist/hooks/containerReveal.stylex.d.ts.map +1 -0
- package/dist/hooks/containerReveal.stylex.js +63 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useClipboard.d.ts +59 -0
- package/dist/hooks/useClipboard.d.ts.map +1 -0
- package/dist/hooks/useClipboard.js +106 -0
- package/dist/hooks/useContainerReveal.d.ts +14 -8
- package/dist/hooks/useContainerReveal.d.ts.map +1 -1
- package/dist/hooks/useContainerReveal.js +28 -69
- package/dist/hooks/useIndicatorFocusRing.d.ts +28 -0
- package/dist/hooks/useIndicatorFocusRing.d.ts.map +1 -0
- package/dist/hooks/useIndicatorFocusRing.js +96 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +17 -4
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +12 -2
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +33 -18
- package/dist/hooks/useStreamingText.d.ts +18 -3
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +47 -7
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +9 -3
- package/dist/hooks/useTypeahead.d.ts +3 -2
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.js +19 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/defineTheme.d.ts +18 -2
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +10 -1
- package/dist/theme/derivedVarRegistry.d.ts +8 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +14 -13
- package/dist/theme/expandColorScale.d.ts +3 -1
- package/dist/theme/expandColorScale.d.ts.map +1 -1
- package/dist/theme/expandColorScale.js +17 -7
- package/dist/theme/expandTypeScale.d.ts.map +1 -1
- package/dist/theme/expandTypeScale.js +17 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +11 -0
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/tokens.stylex.d.ts +12 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +23 -0
- package/dist/utils/focusOutline.stylex.d.ts +122 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -0
- package/dist/utils/focusOutline.stylex.js +143 -0
- package/dist/utils/focusReturn.d.ts +24 -0
- package/dist/utils/focusReturn.d.ts.map +1 -0
- package/dist/utils/focusReturn.js +29 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -1
- package/dist/utils/interactionModality.d.ts +34 -0
- package/dist/utils/interactionModality.d.ts.map +1 -0
- package/dist/utils/interactionModality.js +70 -0
- package/dist/utils/mergeRefs.d.ts.map +1 -1
- package/dist/utils/mergeRefs.js +7 -5
- package/dist/utils/rtlStyles.d.ts +2 -2
- package/dist/utils/rtlStyles.js +2 -2
- package/dist/utils/themeProps.d.ts +20 -1
- package/dist/utils/themeProps.d.ts.map +1 -1
- package/dist/utils/themeProps.js +8 -2
- package/locales/en.json +52 -0
- package/locales/pseudo.json +39 -0
- package/package.json +8 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +16 -3
- package/src/AlertDialog/AlertDialog.test.tsx +208 -1
- package/src/AlertDialog/AlertDialog.tsx +21 -3
- package/src/AppShell/AppShell.doc.mjs +14 -0
- package/src/AppShell/AppShell.test.tsx +139 -0
- package/src/AppShell/AppShell.tsx +32 -22
- package/src/AspectRatio/AspectRatio.doc.mjs +27 -3
- package/src/AspectRatio/AspectRatio.test.tsx +30 -0
- package/src/AspectRatio/AspectRatio.tsx +13 -2
- package/src/AspectRatio/index.ts +0 -2
- package/src/Avatar/Avatar.doc.mjs +2 -13
- package/src/Avatar/Avatar.test.tsx +33 -8
- package/src/Avatar/Avatar.tsx +52 -50
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +2 -9
- package/src/Badge/Badge.tsx +0 -2
- package/src/Badge/index.ts +0 -2
- package/src/Banner/Banner.test.tsx +58 -1
- package/src/Banner/Banner.tsx +33 -11
- package/src/Blockquote/Blockquote.tsx +0 -2
- package/src/Blockquote/index.ts +0 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +16 -6
- package/src/Breadcrumbs/index.ts +5 -1
- package/src/Button/Button.doc.mjs +2 -2
- package/src/Button/Button.tsx +22 -41
- package/src/Calendar/Calendar.tsx +2 -1
- package/src/Calendar/styles.ts +0 -8
- package/src/Card/Card.tsx +0 -2
- package/src/Card/index.ts +0 -2
- package/src/Carousel/Carousel.doc.mjs +3 -0
- package/src/Carousel/Carousel.tsx +10 -6
- package/src/Center/Center.tsx +0 -2
- package/src/Center/index.ts +0 -2
- package/src/Chat/Chat.doc.mjs +2 -0
- package/src/Chat/ChatDictationButton.tsx +7 -1
- package/src/Chat/ChatLayoutScrollButton.test.tsx +22 -0
- package/src/Chat/ChatLayoutScrollButton.tsx +8 -1
- package/src/Chat/ChatSendButton.tsx +2 -3
- package/src/Chat/ChatToolCalls.test.tsx +35 -0
- package/src/Chat/ChatToolCalls.tsx +36 -16
- package/src/Chat/useTriggerMenu.tsx +2 -5
- package/src/CheckboxInput/CheckboxInput.doc.mjs +4 -2
- package/src/CheckboxInput/CheckboxInput.test.tsx +120 -0
- package/src/CheckboxInput/CheckboxInput.tsx +45 -202
- package/src/ClickableCard/ClickableCard.tsx +6 -11
- package/src/Code/Code.tsx +0 -2
- package/src/CodeBlock/CodeBlock.doc.mjs +3 -0
- package/src/CodeBlock/CodeBlock.test.tsx +91 -0
- package/src/CodeBlock/CodeBlock.tsx +57 -80
- package/src/Collapsible/Collapsible.tsx +22 -18
- package/src/CommandPalette/CommandPalette.test.tsx +83 -0
- package/src/CommandPalette/CommandPalette.tsx +5 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +7 -4
- package/src/CommandPalette/CommandPaletteList.tsx +2 -2
- package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
- package/src/ComplexSelector/ComplexSelector.test.tsx +73 -0
- package/src/ComplexSelector/ComplexSelector.tsx +41 -28
- package/src/ContextMenu/ContextMenu.doc.mjs +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +41 -0
- package/src/ContextMenu/ContextMenu.tsx +3 -3
- package/src/ContextMenu/index.ts +5 -1
- package/src/DateInput/DateInput.doc.mjs +18 -3
- package/src/DateInput/DateInput.test.tsx +112 -11
- package/src/DateInput/DateInput.tsx +44 -25
- package/src/DateRangeInput/DateRangeInput.doc.mjs +10 -2
- package/src/DateRangeInput/DateRangeInput.test.tsx +110 -14
- package/src/DateRangeInput/DateRangeInput.tsx +27 -21
- package/src/DateTimeInput/DateTimeInput.doc.mjs +16 -2
- package/src/DateTimeInput/DateTimeInput.test.tsx +154 -1
- package/src/DateTimeInput/DateTimeInput.tsx +58 -17
- package/src/Dialog/Dialog.tsx +2 -9
- package/src/DropdownMenu/DropdownMenu.doc.mjs +5 -9
- package/src/DropdownMenu/DropdownMenu.test.tsx +534 -4
- package/src/DropdownMenu/DropdownMenu.tsx +113 -52
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +27 -30
- package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +34 -0
- package/src/DropdownMenu/DropdownMenuDivider.tsx +81 -0
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +39 -4
- package/src/DropdownMenu/DropdownMenuItem.tsx +48 -10
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +2 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +30 -76
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +25 -19
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +44 -14
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +1 -5
- package/src/DropdownMenu/index.ts +8 -1
- package/src/DropdownMenu/renderDropdownItems.tsx +33 -34
- package/src/EmptyState/EmptyState.doc.mjs +4 -0
- package/src/EmptyState/EmptyState.test.tsx +62 -0
- package/src/EmptyState/EmptyState.tsx +16 -6
- package/src/Field/Field.doc.mjs +1 -0
- package/src/Field/InputClearButton.test.tsx +117 -0
- package/src/Field/InputClearButton.tsx +30 -3
- package/src/Field/PanelSearchInput.tsx +271 -0
- package/src/FileInput/FileInput.tsx +21 -8
- package/src/Grid/Grid.tsx +0 -2
- package/src/Grid/index.ts +0 -2
- package/src/HoverCard/useHoverCard.tsx +2 -23
- package/src/Icon/Icon.doc.mjs +2 -1
- package/src/Icon/globalIconRegistry.tsx +5 -4
- package/src/Indicator/CheckIndicator.tsx +174 -0
- package/src/Indicator/CheckboxIndicator.tsx +257 -0
- package/src/Indicator/Indicator.doc.mjs +344 -0
- package/src/Indicator/Indicator.test.tsx +393 -0
- package/src/Indicator/RadioIndicator.tsx +206 -0
- package/src/Indicator/index.ts +46 -0
- package/src/Indicator/indicator.markers.stylex.ts +19 -0
- package/src/Indicator/indicatorRegistry.test.tsx +106 -0
- package/src/Indicator/indicatorRegistry.ts +120 -0
- package/src/Indicator/types.ts +197 -0
- package/src/Indicator/useIndicator.ts +39 -0
- package/src/Item/Item.doc.mjs +1 -1
- package/src/Item/Item.tsx +7 -14
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Layer/useLayer.test.tsx +85 -0
- package/src/Layer/useLayer.tsx +39 -1
- package/src/Lightbox/Lightbox.doc.mjs +1 -1
- package/src/Lightbox/Lightbox.tsx +45 -49
- package/src/Link/Link.tsx +4 -11
- package/src/MobileNav/MobileNav.tsx +3 -3
- package/src/MoreMenu/MoreMenu.doc.mjs +31 -0
- package/src/MoreMenu/MoreMenu.test.tsx +68 -1
- package/src/MoreMenu/MoreMenu.tsx +19 -0
- package/src/MultiSelector/MultiSelector.doc.mjs +18 -1
- package/src/MultiSelector/MultiSelector.test.tsx +387 -18
- package/src/MultiSelector/MultiSelector.tsx +267 -220
- package/src/NumberInput/NumberInput.doc.mjs +265 -50
- package/src/NumberInput/NumberInput.test.tsx +726 -21
- package/src/NumberInput/NumberInput.tsx +353 -59
- package/src/Outline/Outline.tsx +2 -5
- package/src/Pagination/Pagination.doc.mjs +1 -1
- package/src/Pagination/Pagination.test.tsx +22 -7
- package/src/Pagination/Pagination.tsx +38 -35
- package/src/Popover/Popover.doc.mjs +2 -0
- package/src/Popover/Popover.tsx +6 -7
- package/src/Popover/usePopover.tsx +37 -4
- package/src/PowerSearch/PowerSearch.tsx +1 -1
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +42 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +7 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +27 -5
- package/src/ProgressBar/ProgressBar.test.tsx +224 -1
- package/src/ProgressBar/ProgressBar.tsx +126 -30
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioListItem.tsx +31 -130
- package/src/Resizable/ResizeHandle.tsx +2 -9
- package/src/Section/Section.tsx +0 -2
- package/src/Section/index.ts +0 -2
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -9
- package/src/SelectableCard/SelectableCard.tsx +4 -9
- package/src/Selector/Selector.doc.mjs +17 -4
- package/src/Selector/Selector.test.tsx +1394 -100
- package/src/Selector/Selector.tsx +355 -212
- package/src/Selector/hooks.ts +77 -50
- package/src/SideNav/SideNav.test.tsx +46 -0
- package/src/SideNav/SideNav.tsx +1 -0
- package/src/SideNav/SideNavCollapseButton.tsx +15 -10
- package/src/SideNav/SideNavHeading.tsx +48 -10
- package/src/SideNav/SideNavItem.tsx +20 -12
- package/src/Skeleton/Skeleton.tsx +0 -2
- package/src/Skeleton/index.ts +0 -2
- package/src/Slider/Slider.tsx +2 -11
- package/src/Stack/Stack.doc.mjs +110 -0
- package/src/StatusDot/StatusDot.doc.mjs +12 -3
- package/src/Switch/Switch.test.tsx +32 -0
- package/src/Switch/Switch.tsx +18 -10
- package/src/TabList/Tab.tsx +2 -9
- package/src/TabList/TabMenu.tsx +14 -21
- package/src/Table/BaseTable.tsx +11 -0
- package/src/Table/Table.test.tsx +31 -0
- package/src/Table/TableRow.tsx +6 -0
- package/src/Table/index.ts +1 -4
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +30 -14
- package/src/Table/plugins/rowExpansion/index.ts +1 -4
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +125 -175
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +115 -458
- package/src/Table/plugins/sortable/useTableSortable.tsx +2 -6
- package/src/Table/plugins/tree/useTableTreeData.tsx +43 -24
- package/src/Table/tableContextMenu.test.tsx +27 -0
- package/src/Table/tableContextMenu.tsx +1 -0
- package/src/Table/types.ts +11 -0
- package/src/Table/useTableGroupedRows.doc.mjs +1 -1
- package/src/Table/useTableRowExpansion.doc.mjs +43 -66
- package/src/TextArea/TextArea.doc.mjs +42 -2
- package/src/TextArea/TextArea.test.tsx +219 -0
- package/src/TextArea/TextArea.tsx +34 -7
- package/src/TextInput/TextInput.doc.mjs +18 -2
- package/src/TextInput/TextInput.test.tsx +189 -0
- package/src/TextInput/TextInput.tsx +25 -31
- package/src/Thumbnail/Thumbnail.tsx +2 -9
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.test.tsx +84 -3
- package/src/TimeInput/TimeInput.tsx +26 -28
- package/src/Timestamp/Timestamp.doc.mjs +4 -3
- package/src/Timestamp/Timestamp.test.tsx +91 -14
- package/src/Timestamp/Timestamp.tsx +14 -2
- package/src/Timestamp/TimestampHoverCard.tsx +13 -35
- package/src/Timestamp/formatInstant.ts +16 -1
- package/src/Token/Token.tsx +5 -28
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.test.tsx +45 -3
- package/src/Tokenizer/Tokenizer.tsx +10 -2
- package/src/Tooltip/useTooltip.tsx +2 -23
- package/src/TopNav/TopNav.tsx +1 -3
- package/src/TopNav/TopNavHeading.tsx +42 -13
- package/src/TopNav/TopNavItem.tsx +3 -21
- package/src/TopNav/TopNavMegaMenu.doc.mjs +5 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +433 -33
- package/src/TopNav/TopNavMegaMenu.tsx +118 -53
- package/src/TopNav/TopNavMegaMenuItem.tsx +2 -9
- package/src/TopNav/TopNavMenu.tsx +34 -37
- package/src/TreeList/TreeList.doc.mjs +5 -0
- package/src/TreeList/TreeList.test.tsx +208 -8
- package/src/TreeList/TreeList.tsx +22 -0
- package/src/TreeList/TreeListBranches.tsx +25 -2
- package/src/TreeList/TreeListItem.tsx +89 -52
- package/src/Typeahead/BaseTypeahead.tsx +19 -6
- package/src/Typeahead/Typeahead.doc.mjs +1 -0
- package/src/Typeahead/Typeahead.test.tsx +76 -3
- package/src/VisuallyHidden/VisuallyHidden.tsx +0 -2
- package/src/VisuallyHidden/index.ts +0 -2
- package/src/hooks/containerReveal.stylex.ts +102 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useClipboard.doc.mjs +87 -0
- package/src/hooks/useClipboard.test.tsx +151 -0
- package/src/hooks/useClipboard.ts +135 -0
- package/src/hooks/useContainerReveal.doc.mjs +7 -7
- package/src/hooks/useContainerReveal.test.tsx +42 -62
- package/src/hooks/useContainerReveal.ts +36 -91
- package/src/hooks/useImageMode.test.ts +1 -1
- package/src/hooks/useIndicatorFocusRing.tsx +120 -0
- package/src/hooks/useInputStatusIcon.tsx +8 -8
- package/src/hooks/useLongPress.test.tsx +18 -0
- package/src/hooks/useLongPress.ts +12 -2
- package/src/hooks/useScrollLock.test.ts +72 -0
- package/src/hooks/useScrollLock.ts +51 -19
- package/src/hooks/useStreamingText.test.ts +46 -1
- package/src/hooks/useStreamingText.ts +49 -7
- package/src/hooks/useTreeFocus.test.tsx +50 -0
- package/src/hooks/useTreeFocus.ts +14 -3
- package/src/hooks/useTypeahead.test.tsx +150 -0
- package/src/hooks/useTypeahead.ts +24 -9
- package/src/i18n/InternationalizationProvider.doc.mjs +7 -2
- package/src/index.ts +1 -0
- package/src/serverSafeComponents.test.ts +665 -0
- package/src/theme/defineTheme.ts +27 -0
- package/src/theme/derivedVarRegistry.test.ts +21 -1
- package/src/theme/derivedVarRegistry.ts +19 -6
- package/src/theme/expandColorScale.test.ts +14 -0
- package/src/theme/expandColorScale.ts +24 -9
- package/src/theme/expandTypeScale.test.ts +43 -0
- package/src/theme/expandTypeScale.ts +17 -0
- package/src/theme/generateThemeRules.test.ts +78 -20
- package/src/theme/generateThemeRules.ts +11 -0
- package/src/theme/index.ts +15 -0
- package/src/theme/tokens.stylex.ts +18 -0
- package/src/theme/tokens.test.ts +37 -0
- package/src/utils/focusOutline.stylex.ts +177 -0
- package/src/utils/focusReturn.test.ts +42 -0
- package/src/utils/focusReturn.ts +31 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/interactionModality.ts +74 -0
- package/src/utils/mergeRefs.test.ts +48 -0
- package/src/utils/mergeRefs.ts +12 -6
- package/src/utils/rtlStyles.ts +2 -2
- package/src/utils/themeProps.ts +26 -4
- package/dist/CheckboxInput/checkbox.markers.stylex.d.ts +0 -9
- package/dist/CheckboxInput/checkbox.markers.stylex.d.ts.map +0 -1
- package/dist/CheckboxInput/checkbox.markers.stylex.js +0 -14
- package/dist/RadioList/radio.markers.stylex.d.ts +0 -7
- package/dist/RadioList/radio.markers.stylex.d.ts.map +0 -1
- package/dist/RadioList/radio.markers.stylex.js +0 -12
- package/dist/hooks/containerReveal.pool.stylex.d.ts +0 -303
- package/dist/hooks/containerReveal.pool.stylex.d.ts.map +0 -1
- package/dist/hooks/containerReveal.pool.stylex.js +0 -292
- package/src/CheckboxInput/checkbox.markers.stylex.ts +0 -12
- package/src/RadioList/radio.markers.stylex.ts +0 -10
- package/src/hooks/containerReveal.pool.stylex.ts +0 -571
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Selector.tsx
|
|
7
|
-
* @input Uses React, StyleX, usePopover, useTooltip, Icon, InputGroupContext
|
|
7
|
+
* @input Uses React, StyleX, usePopover, useTooltip, Icon, InputGroupContext,
|
|
8
|
+
* and Selector positioning hooks
|
|
8
9
|
* @output Exports Selector component
|
|
9
10
|
* @position Core implementation; consumed by index.ts
|
|
10
11
|
*
|
|
@@ -20,25 +21,29 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
20
21
|
import { usePopover } from "../Popover/usePopover.js";
|
|
21
22
|
import { useTooltip } from "../Tooltip/index.js";
|
|
22
23
|
import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
23
|
-
import {
|
|
24
|
+
import { useIndicator } from "../Indicator/index.js";
|
|
25
|
+
import { Field, InputClearButton, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputWrapperStyles } from "../Field/index.js";
|
|
24
26
|
import { Divider } from "../Divider/index.js";
|
|
25
27
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
26
28
|
import { Spinner } from "../Spinner/index.js";
|
|
27
|
-
import {
|
|
29
|
+
import { PanelSearchInput } from "../Field/PanelSearchInput.js";
|
|
28
30
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
29
31
|
import "../theme/tokens.stylex.js";
|
|
30
32
|
import { colorVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, fontWeightVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
|
|
31
33
|
import { isOptionData, isDivider, isSection, normalizeOption, getSelectableOptions } from "./utils.js";
|
|
32
34
|
import { useCombobox, useSelectedItemOffset } from "./hooks.js";
|
|
35
|
+
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
33
36
|
import { SelectorOption } from "./SelectorOption.js";
|
|
34
37
|
import { getInputARIA, mergeProps } from "../utils/index.js";
|
|
35
38
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
36
39
|
import { themeProps } from "../utils/themeProps.js";
|
|
40
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
41
|
+
import { stableClassName } from "../naming.js";
|
|
37
42
|
import { groupStyles } from "../InputGroup/groupStyles.js";
|
|
38
43
|
import { useInputGroup } from "../InputGroup/InputGroupContext.js";
|
|
39
44
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
40
45
|
import { useTranslator } from "../i18n/index.js";
|
|
41
|
-
import { jsx as _jsx,
|
|
46
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
47
|
const styles = {
|
|
43
48
|
triggerContainer: {
|
|
44
49
|
kVAEAm: "x1n2onr6",
|
|
@@ -60,6 +65,21 @@ const styles = {
|
|
|
60
65
|
kMwMTN: "xv1l7n4",
|
|
61
66
|
$$css: true
|
|
62
67
|
},
|
|
68
|
+
triggerIcon: {
|
|
69
|
+
kmuXW: "x2lah0s",
|
|
70
|
+
$$css: true
|
|
71
|
+
},
|
|
72
|
+
triggerIconRotation: {
|
|
73
|
+
k1ekBW: "x11xpdln",
|
|
74
|
+
kIyJzY: "xuedmi6",
|
|
75
|
+
kAMwcw: "xlr8y92",
|
|
76
|
+
k3nNDw: "x1g0ag68",
|
|
77
|
+
$$css: true
|
|
78
|
+
},
|
|
79
|
+
triggerIconOpen: {
|
|
80
|
+
k3aq6I: "x19jd1h0",
|
|
81
|
+
$$css: true
|
|
82
|
+
},
|
|
63
83
|
triggerGhost: {
|
|
64
84
|
kzqmXN: "x14atkfc",
|
|
65
85
|
kMzoRj: "xc342km",
|
|
@@ -67,8 +87,6 @@ const styles = {
|
|
|
67
87
|
kKwaWg: "x1ilzqfv xq8i9tn",
|
|
68
88
|
kGVxlE: "x1gnnqk1 x1irk71m x15ysqaf",
|
|
69
89
|
k63SB2: "x1e4wzip",
|
|
70
|
-
kI3sdo: "x1a2a7pz x1irc7jg",
|
|
71
|
-
kInvED: "x1wfwxd8 xscfbxq",
|
|
72
90
|
k1ekBW: "xrafxwg",
|
|
73
91
|
k3aq6I: "x3oybdh xk4oym4",
|
|
74
92
|
$$css: true
|
|
@@ -78,12 +96,26 @@ const styles = {
|
|
|
78
96
|
k3aq6I: "x1c071of x1pdlv7q",
|
|
79
97
|
$$css: true
|
|
80
98
|
},
|
|
81
|
-
|
|
82
|
-
|
|
99
|
+
statusButton: {
|
|
100
|
+
k1xSpc: "x78zum5",
|
|
101
|
+
kGNEyG: "x6s0dn4",
|
|
102
|
+
kjj79g: "xl56j7k",
|
|
103
|
+
kmVPX3: "x1717udv",
|
|
104
|
+
kogj98: "x1ghz6dp",
|
|
105
|
+
kMzoRj: "xc342km",
|
|
106
|
+
ksu8eU: "xng3xce",
|
|
107
|
+
kWkggS: "xjbqb8w",
|
|
108
|
+
kMwMTN: "x1heor9g",
|
|
109
|
+
kkrTdU: "x1ypdohk",
|
|
110
|
+
kaIpWk: "xh6dtrn",
|
|
83
111
|
$$css: true
|
|
84
112
|
},
|
|
85
|
-
|
|
86
|
-
|
|
113
|
+
searchRowInput: {
|
|
114
|
+
kg3NbH: "x2hg6jq",
|
|
115
|
+
$$css: true
|
|
116
|
+
},
|
|
117
|
+
popover: {
|
|
118
|
+
k7Eaqz: "xrzjruh",
|
|
87
119
|
$$css: true
|
|
88
120
|
},
|
|
89
121
|
divider: {
|
|
@@ -249,6 +281,7 @@ export function Selector(props) {
|
|
|
249
281
|
startIcon,
|
|
250
282
|
htmlName,
|
|
251
283
|
renderOption,
|
|
284
|
+
indicatorPosition = 'end',
|
|
252
285
|
hasSearch = false,
|
|
253
286
|
searchPlaceholder: searchPlaceholderFromProps,
|
|
254
287
|
placement,
|
|
@@ -275,16 +308,20 @@ export function Selector(props) {
|
|
|
275
308
|
const statusMessageId = useId();
|
|
276
309
|
const inputLabelId = useId();
|
|
277
310
|
const searchId = useId();
|
|
311
|
+
// Measure from the same outer control that usePopover anchors to; using the
|
|
312
|
+
// shorter inner button makes every size's selected row land too low.
|
|
313
|
+
const anchorRef = useRef(null);
|
|
278
314
|
const triggerRef = useRef(null);
|
|
279
315
|
const searchRef = useRef(null);
|
|
280
316
|
const inputGroup = useInputGroup();
|
|
281
317
|
const [searchQuery, setSearchQuery] = useState('');
|
|
282
|
-
// A typed query shows
|
|
318
|
+
// A typed query shows the search row's clear (✕) button, which becomes
|
|
283
319
|
// the next tab stop after the search input.
|
|
284
320
|
const hasQuery = searchQuery.length > 0;
|
|
285
321
|
const [, startTransition] = useTransition();
|
|
286
322
|
const [optimisticValue, setOptimisticValue] = useOptimistic(normalizedValue);
|
|
287
323
|
const isBusy = isLoading || optimisticValue !== normalizedValue;
|
|
324
|
+
const announce = useAnnounce();
|
|
288
325
|
|
|
289
326
|
// Disabled-reason tooltip. Disabled controls swallow pointer events, so the
|
|
290
327
|
// tooltip listeners attach to the trigger container (which already exists)
|
|
@@ -325,15 +362,15 @@ export function Selector(props) {
|
|
|
325
362
|
// Ref for listbox to measure selected item position
|
|
326
363
|
const listboxRef = useRef(null);
|
|
327
364
|
|
|
328
|
-
//
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
|
|
332
|
-
const announce = useAnnounce();
|
|
365
|
+
// Typeahead is defined below (it needs the popover), but closing and clearing
|
|
366
|
+
// must drop its pending buffer — otherwise a stale prefix survives the reset
|
|
367
|
+
// window and poisons the next keystroke ("Dog" then "c" would search "dc").
|
|
368
|
+
const resetTypeaheadRef = useRef(() => {});
|
|
333
369
|
|
|
334
370
|
// Layer for dropdown positioning
|
|
335
371
|
const handleLayerHide = useCallback(() => {
|
|
336
372
|
setSearchQuery('');
|
|
373
|
+
resetTypeaheadRef.current();
|
|
337
374
|
// Clear any lingering result count when the popover closes so stale status
|
|
338
375
|
// text does not linger in the a11y tree.
|
|
339
376
|
announce('');
|
|
@@ -346,7 +383,10 @@ export function Selector(props) {
|
|
|
346
383
|
hasAutoFocus: false,
|
|
347
384
|
// The popup's own role="listbox" is the exposed semantics; the trigger
|
|
348
385
|
// keeps DOM focus, so wrapping it in a modal dialog would misrepresent it.
|
|
349
|
-
role: 'none'
|
|
386
|
+
role: 'none',
|
|
387
|
+
// The theme target belongs on the SURFACE that paints the popup, which
|
|
388
|
+
// `usePopover` owns — not on the scrolling list inside it.
|
|
389
|
+
surfaceTarget: 'selector-popup'
|
|
350
390
|
});
|
|
351
391
|
|
|
352
392
|
// Open dropdown on mount when isDefaultOpen is true
|
|
@@ -384,7 +424,7 @@ export function Selector(props) {
|
|
|
384
424
|
selectedItemIndex,
|
|
385
425
|
listboxId,
|
|
386
426
|
listboxRef,
|
|
387
|
-
|
|
427
|
+
anchorRef
|
|
388
428
|
});
|
|
389
429
|
const selectedItemOffset = shouldOverlaySelectedItem ? rawOffset : 0;
|
|
390
430
|
const isPositioned = shouldOverlaySelectedItem ? rawIsPositioned : true;
|
|
@@ -396,6 +436,7 @@ export function Selector(props) {
|
|
|
396
436
|
// Clear the current value. Shared by the clear button and the keyboard
|
|
397
437
|
// Delete/Backspace path so clearing is reachable without a mouse.
|
|
398
438
|
const clearValue = useCallback(() => {
|
|
439
|
+
resetTypeaheadRef.current();
|
|
399
440
|
onChange?.(null);
|
|
400
441
|
if (changeAction) {
|
|
401
442
|
startTransition(async () => {
|
|
@@ -405,10 +446,25 @@ export function Selector(props) {
|
|
|
405
446
|
}
|
|
406
447
|
}, [onChange, changeAction, startTransition, setOptimisticValue]);
|
|
407
448
|
|
|
408
|
-
//
|
|
449
|
+
// Type-to-find appends to the query rather than replacing it: characters
|
|
450
|
+
// typed before focus reaches the search input must not be dropped.
|
|
451
|
+
const appendSearchQuery = useCallback(char => {
|
|
452
|
+
setSearchQuery(query => query + char);
|
|
453
|
+
}, []);
|
|
454
|
+
const commitValue = useCallback(newValue => {
|
|
455
|
+
onChange?.(newValue);
|
|
456
|
+
if (changeAction) {
|
|
457
|
+
startTransition(async () => {
|
|
458
|
+
setOptimisticValue(newValue);
|
|
459
|
+
await changeAction(newValue);
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}, [onChange, changeAction, startTransition, setOptimisticValue]);
|
|
463
|
+
|
|
464
|
+
// Selector behavior (keyboard nav, selection)
|
|
409
465
|
const {
|
|
410
466
|
highlightedIndex,
|
|
411
|
-
setHighlightedIndex
|
|
467
|
+
setHighlightedIndex,
|
|
412
468
|
getItemId,
|
|
413
469
|
onTriggerClick,
|
|
414
470
|
onKeyDown,
|
|
@@ -416,7 +472,11 @@ export function Selector(props) {
|
|
|
416
472
|
onItemMouseEnter
|
|
417
473
|
} = useCombobox({
|
|
418
474
|
selectableItems: filteredItems,
|
|
419
|
-
value:
|
|
475
|
+
// The optimistic value, not the raw prop: with a pending changeAction the
|
|
476
|
+
// prop still holds the old selection, so the popup would open with the
|
|
477
|
+
// highlight on it and Delete/Backspace could clear a value the action has
|
|
478
|
+
// already replaced.
|
|
479
|
+
value: optimisticValue,
|
|
420
480
|
isDisabled,
|
|
421
481
|
isOpen: popover.isOpen,
|
|
422
482
|
hasSearch,
|
|
@@ -424,24 +484,56 @@ export function Selector(props) {
|
|
|
424
484
|
popover.show();
|
|
425
485
|
if (hasSearch) {
|
|
426
486
|
requestAnimationFrame(() => {
|
|
427
|
-
searchRef.current
|
|
487
|
+
const input = searchRef.current;
|
|
488
|
+
if (input) {
|
|
489
|
+
input.focus();
|
|
490
|
+
// When typing seeded the query, place the caret after it so the
|
|
491
|
+
// user keeps typing where they left off.
|
|
492
|
+
input.setSelectionRange(input.value.length, input.value.length);
|
|
493
|
+
}
|
|
428
494
|
});
|
|
429
495
|
}
|
|
430
496
|
}, [popover, hasSearch]),
|
|
431
497
|
onClose: popover.hide,
|
|
432
|
-
onSelect:
|
|
433
|
-
onChange?.(newValue);
|
|
434
|
-
if (changeAction) {
|
|
435
|
-
startTransition(async () => {
|
|
436
|
-
setOptimisticValue(newValue);
|
|
437
|
-
await changeAction(newValue);
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
}, [onChange, changeAction, startTransition, setOptimisticValue]),
|
|
498
|
+
onSelect: commitValue,
|
|
441
499
|
onClear: hasClear ? clearValue : undefined,
|
|
500
|
+
onSearchSeed: appendSearchQuery,
|
|
442
501
|
listboxId
|
|
443
502
|
});
|
|
444
503
|
|
|
504
|
+
// Type-to-select, shared with the other collections (menus, listboxes).
|
|
505
|
+
// Open, it walks the highlight — aria-activedescendant announces each match.
|
|
506
|
+
// Closed, it commits the match like a native select, which changes the value
|
|
507
|
+
// without opening the popup or moving focus, so nothing else would prompt
|
|
508
|
+
// assistive tech to re-read the trigger: announce it explicitly.
|
|
509
|
+
const typeahead = useTypeahead({
|
|
510
|
+
getItemLabels: () => selectableItems.map(item => item.label ?? item.value),
|
|
511
|
+
isDisabled: index => selectableItems[index]?.disabled === true,
|
|
512
|
+
// Cycle onward from the highlight when open, from the committed selection
|
|
513
|
+
// when closed — the optimistic one, so a pending changeAction cannot strand
|
|
514
|
+
// cycling on the first match. -1 means nothing is selected or highlighted,
|
|
515
|
+
// which the hook reads as "search from the top".
|
|
516
|
+
getCurrentIndex: () => popover.isOpen ? highlightedIndex : selectedItemIndex,
|
|
517
|
+
onMatch: index => {
|
|
518
|
+
const item = selectableItems[index];
|
|
519
|
+
if (popover.isOpen) {
|
|
520
|
+
setHighlightedIndex(index);
|
|
521
|
+
} else if (item.value !== optimisticValue) {
|
|
522
|
+
commitValue(item.value);
|
|
523
|
+
announce(item.label ?? item.value);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
resetTypeaheadRef.current = typeahead.reset;
|
|
528
|
+
const handleTriggerKeyDown = useCallback(e => {
|
|
529
|
+
// With hasSearch the query input owns typing, so type-to-select is off.
|
|
530
|
+
if (!isDisabled && !hasSearch && typeahead.onKeyDown(e)) {
|
|
531
|
+
e.preventDefault();
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
onKeyDown(e);
|
|
535
|
+
}, [isDisabled, hasSearch, typeahead, onKeyDown]);
|
|
536
|
+
|
|
445
537
|
// Keep the highlighted option visible during keyboard navigation. The
|
|
446
538
|
// listbox is a fixed-height scroll container, so without this the virtual
|
|
447
539
|
// cursor walks off-screen once navigation passes the visible window. Mirrors
|
|
@@ -466,13 +558,39 @@ export function Selector(props) {
|
|
|
466
558
|
if (!hasSearch) {
|
|
467
559
|
return null;
|
|
468
560
|
}
|
|
469
|
-
return /*#__PURE__*/_jsx(
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
561
|
+
return /*#__PURE__*/_jsx(PanelSearchInput, {
|
|
562
|
+
ref: searchRef,
|
|
563
|
+
id: searchId
|
|
564
|
+
// The search row is the panel's header: a magnifier, a borderless
|
|
565
|
+
// input, and the shared clear (✕) button. It deliberately does NOT
|
|
566
|
+
// render a bordered TextInput — the popup is already a bordered
|
|
567
|
+
// surface, and a field inside it drew a second box within that box.
|
|
568
|
+
,
|
|
569
|
+
label: t('@astryx.selector.searchOptions')
|
|
570
|
+
// Same accessible name the TextInput's built-in clear produced
|
|
571
|
+
// ("Clear Search options"), so the affordance keeps its name while its
|
|
572
|
+
// chrome changes.
|
|
573
|
+
,
|
|
574
|
+
clearLabel: t('@astryx.textInput.clearLabel', {
|
|
575
|
+
label: t('@astryx.selector.searchOptions')
|
|
576
|
+
}),
|
|
577
|
+
...themeProps('selector-search'),
|
|
578
|
+
xstyle: variant !== 'ghost' && styles.searchRowInput
|
|
579
|
+
// When hasSearch is set, focus moves into this input on open, so it —
|
|
580
|
+
// not the trigger — must be the combobox that reports the highlighted
|
|
581
|
+
// option via aria-activedescendant (comboboxes-4). A bare searchbox
|
|
582
|
+
// left the highlight silent to screen readers.
|
|
583
|
+
,
|
|
584
|
+
role: "combobox",
|
|
585
|
+
"aria-expanded": popover.isOpen,
|
|
586
|
+
"aria-controls": listboxId,
|
|
587
|
+
"aria-autocomplete": "list",
|
|
588
|
+
"aria-activedescendant": popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
|
|
589
|
+
value: searchQuery,
|
|
590
|
+
onValueChange: handleSearchChange,
|
|
591
|
+
onContainerKeyDown: e => {
|
|
592
|
+
// The clear (✕) button lives inside the row, after the input in DOM
|
|
593
|
+
// order. When it is focused and the user tabs forward there is
|
|
476
594
|
// nothing else in the popup, so dismiss it (Shift+Tab returns to the
|
|
477
595
|
// input natively). Key events originating on the input are handled on
|
|
478
596
|
// the input below; ignore them here so we don't double-dismiss.
|
|
@@ -483,63 +601,70 @@ export function Selector(props) {
|
|
|
483
601
|
onKeyDown(e);
|
|
484
602
|
}
|
|
485
603
|
},
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
//
|
|
490
|
-
//
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
width: "100%"
|
|
504
|
-
// When hasSearch is set, focus moves into this input on open, so it —
|
|
505
|
-
// not the trigger — must be the combobox that reports the highlighted
|
|
506
|
-
// option via aria-activedescendant (comboboxes-4). A bare searchbox
|
|
507
|
-
// left the highlight silent to screen readers. role + aria-* pass
|
|
508
|
-
// through to the underlying <input> via BaseProps.
|
|
509
|
-
,
|
|
510
|
-
role: "combobox",
|
|
511
|
-
"aria-expanded": popover.isOpen,
|
|
512
|
-
"aria-controls": listboxId,
|
|
513
|
-
"aria-autocomplete": "list",
|
|
514
|
-
"aria-activedescendant": popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
|
|
515
|
-
value: searchQuery,
|
|
516
|
-
onChange: handleSearchChange,
|
|
517
|
-
onKeyDown: e => {
|
|
518
|
-
// Arrow keys navigate options; Enter selects; Escape closes.
|
|
519
|
-
// Home/End are left to the input for caret movement (APG editable
|
|
520
|
-
// combobox); PageUp/PageDown are the sanctioned substitute for
|
|
521
|
-
// jumping to the first/last option.
|
|
522
|
-
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'PageUp' || e.key === 'PageDown' || e.key === 'Enter' || e.key === 'Escape') {
|
|
523
|
-
onKeyDown(e);
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
// Tab: when a query is showing the clear (✕) button, forward-tab
|
|
527
|
-
// moves focus to it (keeping the popup open) so the affordance is
|
|
528
|
-
// keyboard-reachable. Every other Tab dismisses the popup as usual.
|
|
529
|
-
if (e.key === 'Tab' && (e.shiftKey || !hasQuery)) {
|
|
530
|
-
onKeyDown(e);
|
|
531
|
-
}
|
|
532
|
-
},
|
|
533
|
-
placeholder: searchPlaceholder
|
|
534
|
-
})
|
|
604
|
+
onKeyDown: e => {
|
|
605
|
+
// Arrow keys navigate options; Enter selects; Escape closes.
|
|
606
|
+
// Home/End are left to the input for caret movement (APG editable
|
|
607
|
+
// combobox); PageUp/PageDown are the sanctioned substitute for
|
|
608
|
+
// jumping to the first/last option.
|
|
609
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'PageUp' || e.key === 'PageDown' || e.key === 'Enter' || e.key === 'Escape') {
|
|
610
|
+
onKeyDown(e);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
// Tab: when a query is showing the clear (✕) button, forward-tab
|
|
614
|
+
// moves focus to it (keeping the popup open) so the affordance is
|
|
615
|
+
// keyboard-reachable. Every other Tab dismisses the popup as usual.
|
|
616
|
+
if (e.key === 'Tab' && (e.shiftKey || !hasQuery)) {
|
|
617
|
+
onKeyDown(e);
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
placeholder: searchPlaceholder
|
|
535
621
|
});
|
|
536
|
-
}, [hasSearch, searchId, listboxId, searchQuery, hasQuery, searchPlaceholder, handleSearchChange, onKeyDown, popover.isOpen, highlightedIndex, getItemId, t]);
|
|
622
|
+
}, [hasSearch, searchId, listboxId, searchQuery, hasQuery, searchPlaceholder, handleSearchChange, onKeyDown, popover.isOpen, highlightedIndex, getItemId, variant, t]);
|
|
623
|
+
|
|
624
|
+
// The single-selection mark, resolved from the theme once per render. A
|
|
625
|
+
// theme that maps `check` to another indicator (a radio, say) changes every
|
|
626
|
+
// selected-option mark in the app through this one lookup.
|
|
627
|
+
const SelectionMark = useIndicator('check');
|
|
537
628
|
|
|
538
629
|
// Render an individual item
|
|
539
630
|
const renderItem = useCallback((item, flatIndex) => {
|
|
540
631
|
const isHighlighted = flatIndex === highlightedIndex;
|
|
541
632
|
const isSelected = item.value === normalizedValue;
|
|
542
|
-
|
|
633
|
+
|
|
634
|
+
/*
|
|
635
|
+
* Rendered UNCONDITIONALLY, with the state passed down: the default
|
|
636
|
+
* check draws nothing when unchecked, but a theme that replaces the
|
|
637
|
+
* `check` indicator with a radio needs the unselected state to draw
|
|
638
|
+
* its empty circle. `{isSelected && …}` would make that impossible.
|
|
639
|
+
*
|
|
640
|
+
* `selector-check` stays the stable target for the mark's position
|
|
641
|
+
* in the row; the indicator owns what the mark looks like.
|
|
642
|
+
*/
|
|
643
|
+
const mark = /*#__PURE__*/_jsx("span", {
|
|
644
|
+
...{
|
|
645
|
+
className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s xgomdpo"
|
|
646
|
+
},
|
|
647
|
+
children: /*#__PURE__*/_jsx(SelectionMark, {
|
|
648
|
+
state: isSelected ? 'checked' : 'unchecked',
|
|
649
|
+
size: "sm",
|
|
650
|
+
isDisabled: item.disabled ?? false,
|
|
651
|
+
...themeProps('selector-check')
|
|
652
|
+
})
|
|
653
|
+
});
|
|
654
|
+
const optionContent = /*#__PURE__*/_jsx("span", {
|
|
655
|
+
...{
|
|
656
|
+
className: "x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli"
|
|
657
|
+
},
|
|
658
|
+
children: renderOption ? renderOption(item) : /*#__PURE__*/_jsx(DefaultOption, {
|
|
659
|
+
option: item
|
|
660
|
+
})
|
|
661
|
+
});
|
|
662
|
+
const content = indicatorPosition === 'start' ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
663
|
+
children: [mark, optionContent]
|
|
664
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
665
|
+
children: [optionContent, mark]
|
|
666
|
+
});
|
|
667
|
+
return /*#__PURE__*/_jsx("div", {
|
|
543
668
|
id: getItemId(flatIndex),
|
|
544
669
|
role: "option",
|
|
545
670
|
"aria-selected": isSelected,
|
|
@@ -547,20 +672,9 @@ export function Selector(props) {
|
|
|
547
672
|
onClick: () => onItemSelect(item),
|
|
548
673
|
onMouseEnter: () => onItemMouseEnter(item, flatIndex),
|
|
549
674
|
...stylex.props(styles.item, itemSizeStyles[size], isHighlighted && styles.itemHighlighted, isSelected && styles.itemSelected, item.disabled && styles.itemDisabled),
|
|
550
|
-
children:
|
|
551
|
-
...{
|
|
552
|
-
className: "x78zum5 x6s0dn4 x1txdalj x98rzlu xeuugli"
|
|
553
|
-
},
|
|
554
|
-
children: renderOption ? renderOption(item) : /*#__PURE__*/_jsx(DefaultOption, {
|
|
555
|
-
option: item
|
|
556
|
-
})
|
|
557
|
-
}), isSelected && /*#__PURE__*/_jsx(Icon, {
|
|
558
|
-
icon: "check",
|
|
559
|
-
size: "sm",
|
|
560
|
-
color: "accent"
|
|
561
|
-
})]
|
|
675
|
+
children: content
|
|
562
676
|
}, item.value);
|
|
563
|
-
}, [renderOption, highlightedIndex, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter]);
|
|
677
|
+
}, [renderOption, indicatorPosition, highlightedIndex, size, normalizedValue, getItemId, onItemSelect, onItemMouseEnter, SelectionMark]);
|
|
564
678
|
|
|
565
679
|
// Render all options (handling sections/dividers)
|
|
566
680
|
const renderOptions = useCallback(() => {
|
|
@@ -574,9 +688,9 @@ export function Selector(props) {
|
|
|
574
688
|
// result-count live region instead.
|
|
575
689
|
return [/*#__PURE__*/_jsx("div", {
|
|
576
690
|
role: "presentation",
|
|
577
|
-
...{
|
|
691
|
+
...mergeProps(themeProps('selector-empty-state'), {
|
|
578
692
|
className: "x1b2ylru x2b8uid xv1l7n4 x9ynric xcr08ib"
|
|
579
|
-
},
|
|
693
|
+
}),
|
|
580
694
|
children: "No results found"
|
|
581
695
|
}, "empty")];
|
|
582
696
|
}
|
|
@@ -608,16 +722,21 @@ export function Selector(props) {
|
|
|
608
722
|
if (sectionItems.length === 0) {
|
|
609
723
|
continue;
|
|
610
724
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
elements.push(/*#__PURE__*/_jsx("div", {
|
|
725
|
+
// The heading lives INSIDE the group and is aria-hidden: the group
|
|
726
|
+
// already carries the title as its accessible name, so exposing the
|
|
727
|
+
// text again would announce it twice. This also keeps role="listbox"'s
|
|
728
|
+
// children to option/group only — the old labeled Divider sat in the
|
|
729
|
+
// listbox as a stray role="separator".
|
|
730
|
+
elements.push(/*#__PURE__*/_jsxs("div", {
|
|
618
731
|
role: "group",
|
|
619
732
|
"aria-label": option.title,
|
|
620
|
-
children:
|
|
733
|
+
children: [option.title && /*#__PURE__*/_jsx("div", {
|
|
734
|
+
"aria-hidden": "true",
|
|
735
|
+
...mergeProps(themeProps('selector-section-heading'), {
|
|
736
|
+
className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
|
|
737
|
+
}),
|
|
738
|
+
children: option.title
|
|
739
|
+
}), sectionItems]
|
|
621
740
|
}, `section-${i}`));
|
|
622
741
|
} else if (isOptionData(option)) {
|
|
623
742
|
const normalized = normalizeOption(option);
|
|
@@ -638,6 +757,7 @@ export function Selector(props) {
|
|
|
638
757
|
const selectorContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
639
758
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
640
759
|
ref: el => {
|
|
760
|
+
anchorRef.current = el;
|
|
641
761
|
popover.triggerRef(el);
|
|
642
762
|
// Anchor + hover/focus listeners for the disabled-message tooltip.
|
|
643
763
|
// Handlers are gated internally by isEnabled, and anchor names
|
|
@@ -649,8 +769,9 @@ export function Selector(props) {
|
|
|
649
769
|
...mergeProps(themeProps('selector', {
|
|
650
770
|
variant,
|
|
651
771
|
size,
|
|
652
|
-
status: status?.type ?? null
|
|
653
|
-
|
|
772
|
+
status: status?.type ?? null,
|
|
773
|
+
disabled: isDisabled ? 'disabled' : null
|
|
774
|
+
}), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, variant === 'ghost' && focusOutlineStyles.focusWithin, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, !selectedItem && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
654
775
|
children: [startIcon && renderIconSlot(startIcon, {
|
|
655
776
|
size: 'sm',
|
|
656
777
|
color: 'secondary'
|
|
@@ -682,7 +803,7 @@ export function Selector(props) {
|
|
|
682
803
|
,
|
|
683
804
|
disabled: isDisabled && !showsDisabledMessage,
|
|
684
805
|
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
685
|
-
onKeyDown:
|
|
806
|
+
onKeyDown: handleTriggerKeyDown,
|
|
686
807
|
tabIndex: isDisabled && !showsDisabledMessage ? -1 : 0,
|
|
687
808
|
...{
|
|
688
809
|
className: "x78zum5 x6s0dn4 x1qughib x1txdalj x1iyjqo2 xs83m0k x1r8uery xeuugli x1717udv x1ghz6dp xc342km xng3xce xjbqb8w xjb2p0i x1qlqyl8 x15bjb6t x1heor9g x1ypdohk x1a2a7pz"
|
|
@@ -703,84 +824,63 @@ export function Selector(props) {
|
|
|
703
824
|
disabled: isDisabled
|
|
704
825
|
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
705
826
|
size: "sm"
|
|
706
|
-
}), hasClear && value != null && !isDisabled && /*#__PURE__*/_jsx(
|
|
707
|
-
|
|
708
|
-
onClick: handleClear,
|
|
709
|
-
"aria-label": t('@astryx.selector.clearLabel', {
|
|
827
|
+
}), hasClear && value != null && !isDisabled && /*#__PURE__*/_jsx(InputClearButton, {
|
|
828
|
+
label: t('@astryx.selector.clearLabel', {
|
|
710
829
|
label
|
|
711
830
|
}),
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
831
|
+
onClick: handleClear,
|
|
832
|
+
iconClassName: stableClassName('selector-clear-icon')
|
|
833
|
+
}), showStatusIcon ? showStatusTooltip ? /*#__PURE__*/_jsx("button", {
|
|
834
|
+
ref: statusTooltip.ref,
|
|
835
|
+
type: "button",
|
|
836
|
+
"aria-label": t(STATUS_BUTTON_LABEL_KEY[status.type]),
|
|
837
|
+
"aria-describedby": statusTooltip.describedBy,
|
|
838
|
+
onClick: e => e.stopPropagation(),
|
|
839
|
+
...stylex.props(focusOutlineStyles.focusVisible, styles.statusButton),
|
|
715
840
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
716
|
-
icon: "close",
|
|
717
|
-
size: "sm",
|
|
718
|
-
color: "secondary"
|
|
719
|
-
// Stable theme target on the clear glyph itself, so a theme can
|
|
720
|
-
// restyle just this icon (color, size, hover) via `defineTheme`.
|
|
721
|
-
// Same-element rules in @layer astryx-theme win over the icon's
|
|
722
|
-
// own base color/size, which a button-level target could not
|
|
723
|
-
// reach.
|
|
724
|
-
,
|
|
725
|
-
...themeProps('selector-clear-icon')
|
|
726
|
-
})
|
|
727
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
728
|
-
...{
|
|
729
|
-
0: {
|
|
730
|
-
className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike"
|
|
731
|
-
},
|
|
732
|
-
2: {
|
|
733
|
-
className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0"
|
|
734
|
-
},
|
|
735
|
-
1: {
|
|
736
|
-
className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike xq2gx43"
|
|
737
|
-
},
|
|
738
|
-
3: {
|
|
739
|
-
className: "x2lah0s x78zum5 x6s0dn4 xl56j7k x1kky2od xlup9mm x11xpdln xuedmi6 xlr8y92 x1g0ag68 xv9yike x19jd1h0 xq2gx43"
|
|
740
|
-
}
|
|
741
|
-
}[!!(!showStatusIcon && popover.isOpen) << 1 | !!showStatusIcon << 0],
|
|
742
|
-
children: showStatusIcon ? showStatusTooltip ? /*#__PURE__*/_jsx("button", {
|
|
743
|
-
ref: statusTooltip.ref,
|
|
744
|
-
type: "button",
|
|
745
|
-
"aria-label": t(STATUS_BUTTON_LABEL_KEY[status.type]),
|
|
746
|
-
"aria-describedby": statusTooltip.describedBy,
|
|
747
|
-
onClick: e => e.stopPropagation(),
|
|
748
|
-
...{
|
|
749
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
|
|
750
|
-
},
|
|
751
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
752
|
-
icon: STATUS_ICON_MAP[status.type],
|
|
753
|
-
size: "sm",
|
|
754
|
-
color: STATUS_ICON_COLOR_MAP[status.type]
|
|
755
|
-
})
|
|
756
|
-
}) : /*#__PURE__*/_jsx(Icon, {
|
|
757
841
|
icon: STATUS_ICON_MAP[status.type],
|
|
758
842
|
size: "sm",
|
|
759
|
-
color: STATUS_ICON_COLOR_MAP[status.type]
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
843
|
+
color: STATUS_ICON_COLOR_MAP[status.type],
|
|
844
|
+
xstyle: styles.triggerIcon
|
|
845
|
+
})
|
|
846
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
|
847
|
+
icon: STATUS_ICON_MAP[status.type],
|
|
848
|
+
size: "sm",
|
|
849
|
+
color: STATUS_ICON_COLOR_MAP[status.type],
|
|
850
|
+
xstyle: styles.triggerIcon
|
|
851
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
|
852
|
+
icon: "chevronDown",
|
|
853
|
+
size: "sm",
|
|
854
|
+
color: "secondary"
|
|
855
|
+
// The rotation rides on the glyph, alongside the box and color
|
|
856
|
+
// the wrapper used to provide, so one element carries the mark,
|
|
857
|
+
// its open/closed transform, and the theme target.
|
|
858
|
+
,
|
|
859
|
+
xstyle: [styles.triggerIcon, styles.triggerIconRotation, popover.isOpen && styles.triggerIconOpen]
|
|
860
|
+
// Stable theme target on the chevron glyph itself, so a theme can
|
|
861
|
+
// restyle just this icon (color, size, hover) — and its
|
|
862
|
+
// open/closed state — via `defineTheme`. Same-element rules in
|
|
863
|
+
// @layer astryx-theme win over the icon's own base color/size,
|
|
864
|
+
// which a button-level target could not reach.
|
|
865
|
+
,
|
|
866
|
+
...themeProps('selector-indicator-icon', {
|
|
867
|
+
state: popover.isOpen ? 'expanded' : 'collapsed'
|
|
773
868
|
})
|
|
774
869
|
})]
|
|
775
870
|
}), popover.render(hasSearch ? /*#__PURE__*/_jsxs("div", {
|
|
776
|
-
children: [renderSearch(), /*#__PURE__*/_jsx("div", {
|
|
871
|
+
children: [renderSearch(), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx("div", {
|
|
777
872
|
ref: listboxRef,
|
|
778
873
|
id: listboxId,
|
|
779
874
|
role: "listbox",
|
|
780
875
|
"aria-labelledby": triggerId,
|
|
781
876
|
...{
|
|
782
|
-
|
|
783
|
-
|
|
877
|
+
0: {
|
|
878
|
+
className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo"
|
|
879
|
+
},
|
|
880
|
+
1: {
|
|
881
|
+
className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq"
|
|
882
|
+
}
|
|
883
|
+
}[!!(variant !== 'ghost') << 0],
|
|
784
884
|
children: renderOptions()
|
|
785
885
|
})]
|
|
786
886
|
}) : /*#__PURE__*/_jsx("div", {
|
|
@@ -790,16 +890,26 @@ export function Selector(props) {
|
|
|
790
890
|
"aria-labelledby": triggerId,
|
|
791
891
|
...{
|
|
792
892
|
0: {
|
|
793
|
-
className: "x9f619 xuyqlj2 x1odjw0f
|
|
893
|
+
className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj x1hc1fzr x1ey1afo"
|
|
894
|
+
},
|
|
895
|
+
2: {
|
|
896
|
+
className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x1hc1fzr x1ey1afo x2hg6jq"
|
|
794
897
|
},
|
|
795
898
|
1: {
|
|
796
|
-
className: "x9f619 xuyqlj2 x1odjw0f
|
|
899
|
+
className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x7a5moj xg01cxk xq2gx43"
|
|
900
|
+
},
|
|
901
|
+
3: {
|
|
902
|
+
className: "x9f619 xuyqlj2 x1odjw0f xu0wf1k x2hg6jq xg01cxk xq2gx43"
|
|
797
903
|
}
|
|
798
|
-
}[!!!isPositioned << 0],
|
|
904
|
+
}[!!(variant !== 'ghost') << 1 | !!!isPositioned << 0],
|
|
799
905
|
children: renderOptions()
|
|
800
906
|
}), {
|
|
801
907
|
placement: popoverPlacement,
|
|
802
908
|
alignment: 'start',
|
|
909
|
+
// The system's standard menu clearance, except in overlay mode:
|
|
910
|
+
// there the measured negative margin owns the block geometry and
|
|
911
|
+
// the menu is meant to sit on the trigger, not clear it.
|
|
912
|
+
offset: shouldOverlaySelectedItem ? undefined : spacingVars['--spacing-1'],
|
|
803
913
|
xstyle: [styles.popover, layerAnimations[popoverPlacement]],
|
|
804
914
|
style: popoverOffsetStyle
|
|
805
915
|
}), showStatusTooltip && statusTooltip.renderTooltip(status?.message ?? ''), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|