@astryxdesign/core 0.3.0 → 0.4.0
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 +9 -0
- 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/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +15 -14
- 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 +11 -15
- 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/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +8 -12
- 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/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/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 +35 -33
- 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 +24 -23
- package/dist/DateRangeInput/DateRangeInput.d.ts +9 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +11 -16
- package/dist/DateTimeInput/DateTimeInput.d.ts +9 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +22 -17
- 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/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/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +3 -19
- 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 +167 -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 +56 -53
- 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.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +78 -75
- 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/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 +96 -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/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 +2 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +164 -94
- 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/Stack/stack.stylex.d.ts +3 -3
- package/dist/Switch/Switch.js +11 -10
- 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/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 +7 -15
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +16 -34
- 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/astryx.css +74 -85
- 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/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 +16 -0
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +8 -0
- 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 +1 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.d.ts +107 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -0
- package/dist/utils/focusOutline.stylex.js +130 -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 +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -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 +12 -0
- package/locales/pseudo.json +9 -0
- package/package.json +7 -2
- 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 +11 -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 -0
- 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/Banner/Banner.tsx +9 -6
- package/src/Breadcrumbs/BreadcrumbItem.tsx +16 -6
- package/src/Breadcrumbs/index.ts +5 -1
- package/src/Button/Button.tsx +21 -41
- package/src/Calendar/Calendar.tsx +2 -1
- package/src/Calendar/styles.ts +0 -8
- package/src/Carousel/Carousel.doc.mjs +3 -0
- package/src/Carousel/Carousel.tsx +10 -6
- 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 +115 -0
- package/src/CheckboxInput/CheckboxInput.tsx +45 -202
- package/src/ClickableCard/ClickableCard.tsx +6 -11
- 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 +29 -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 +64 -0
- package/src/ComplexSelector/ComplexSelector.tsx +46 -29
- 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 +93 -11
- package/src/DateInput/DateInput.tsx +41 -19
- package/src/DateRangeInput/DateRangeInput.doc.mjs +10 -2
- package/src/DateRangeInput/DateRangeInput.test.tsx +110 -14
- package/src/DateRangeInput/DateRangeInput.tsx +24 -12
- package/src/DateTimeInput/DateTimeInput.doc.mjs +16 -2
- package/src/DateTimeInput/DateTimeInput.test.tsx +75 -0
- package/src/DateTimeInput/DateTimeInput.tsx +35 -8
- 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/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/HoverCard/useHoverCard.tsx +2 -23
- package/src/Icon/Icon.doc.mjs +2 -1
- 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 +45 -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 +186 -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 +43 -38
- 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 +9 -1
- package/src/MultiSelector/MultiSelector.test.tsx +255 -16
- package/src/MultiSelector/MultiSelector.tsx +103 -99
- 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.tsx +6 -7
- 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 +124 -22
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioListItem.tsx +31 -130
- package/src/Resizable/ResizeHandle.tsx +2 -9
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -9
- package/src/SelectableCard/SelectableCard.tsx +4 -9
- package/src/Selector/Selector.doc.mjs +7 -4
- package/src/Selector/Selector.test.tsx +935 -25
- package/src/Selector/Selector.tsx +189 -106
- 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/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 +8 -8
- package/src/TabList/Tab.tsx +2 -9
- package/src/TabList/TabMenu.tsx +14 -21
- package/src/Table/BaseTable.tsx +11 -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 +30 -3
- package/src/TimeInput/TimeInput.tsx +9 -26
- package/src/Timestamp/Timestamp.doc.mjs +4 -3
- package/src/Timestamp/TimestampHoverCard.tsx +13 -35
- 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.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 +206 -7
- 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/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/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/theme/defineTheme.ts +24 -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 +61 -20
- package/src/theme/generateThemeRules.ts +11 -0
- package/src/theme/index.ts +13 -0
- package/src/utils/focusOutline.stylex.ts +163 -0
- package/src/utils/focusReturn.test.ts +42 -0
- package/src/utils/focusReturn.ts +31 -0
- package/src/utils/index.ts +1 -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
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
import { useId, useState, useMemo, useCallback, useRef } from 'react';
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import "../theme/tokens.stylex.js";
|
|
21
|
-
import { colorVars, sizeVars, radiusVars, typographyVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
|
|
22
|
-
import { Field, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
|
|
21
|
+
import { colorVars, sizeVars, spacingVars, radiusVars, typographyVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
|
|
22
|
+
import { Field, InputClearButton, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
|
|
23
23
|
import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
24
24
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
25
25
|
import { useTooltip } from "../Tooltip/index.js";
|
|
@@ -32,6 +32,14 @@ const styles = {
|
|
|
32
32
|
wrapper: {
|
|
33
33
|
kY2c9j: "x1vjfegm",
|
|
34
34
|
$$css: true
|
|
35
|
+
},
|
|
36
|
+
wrapperWithNumberSteppers: {
|
|
37
|
+
kwRFfy: "xyri2b",
|
|
38
|
+
$$css: true
|
|
39
|
+
},
|
|
40
|
+
incrementIcon: {
|
|
41
|
+
k3aq6I: "x19jd1h0",
|
|
42
|
+
$$css: true
|
|
35
43
|
}
|
|
36
44
|
};
|
|
37
45
|
const sizeStyles = {
|
|
@@ -91,6 +99,56 @@ function parseNumberInput(input, options) {
|
|
|
91
99
|
}
|
|
92
100
|
return num;
|
|
93
101
|
}
|
|
102
|
+
function getDecimalPlaces(value) {
|
|
103
|
+
const [coefficient, exponentText] = String(value).toLowerCase().split('e');
|
|
104
|
+
const fractionLength = coefficient.split('.')[1]?.length ?? 0;
|
|
105
|
+
const exponent = exponentText == null ? 0 : Number(exponentText);
|
|
106
|
+
return Math.max(0, fractionLength - exponent);
|
|
107
|
+
}
|
|
108
|
+
function getEffectiveStep(step, isIntegerOnly) {
|
|
109
|
+
if (step == null || !Number.isFinite(step) || step <= 0 || isIntegerOnly && !Number.isInteger(step)) {
|
|
110
|
+
return 1;
|
|
111
|
+
}
|
|
112
|
+
return step;
|
|
113
|
+
}
|
|
114
|
+
function getSteppedValue({
|
|
115
|
+
currentValue,
|
|
116
|
+
direction,
|
|
117
|
+
min,
|
|
118
|
+
max,
|
|
119
|
+
step,
|
|
120
|
+
isIntegerOnly
|
|
121
|
+
}) {
|
|
122
|
+
const effectiveStep = getEffectiveStep(step, isIntegerOnly);
|
|
123
|
+
const stepBase = min != null && (!isIntegerOnly || Number.isInteger(min)) ? min : 0;
|
|
124
|
+
let nextValue;
|
|
125
|
+
if (currentValue == null) {
|
|
126
|
+
nextValue = direction === 1 ? min ?? 0 : max ?? 0;
|
|
127
|
+
if (isIntegerOnly) {
|
|
128
|
+
nextValue = direction === 1 ? Math.ceil(nextValue) : Math.floor(nextValue);
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
const stepPosition = (currentValue - stepBase) / effectiveStep;
|
|
132
|
+
const tolerance = Number.EPSILON * Math.max(1, Math.abs(stepPosition)) * 4;
|
|
133
|
+
const nextStepPosition = direction === 1 ? Math.floor(stepPosition + tolerance) + 1 : Math.ceil(stepPosition - tolerance) - 1;
|
|
134
|
+
nextValue = stepBase + nextStepPosition * effectiveStep;
|
|
135
|
+
}
|
|
136
|
+
if (min != null) {
|
|
137
|
+
nextValue = Math.max(min, nextValue);
|
|
138
|
+
}
|
|
139
|
+
if (max != null) {
|
|
140
|
+
nextValue = Math.min(max, nextValue);
|
|
141
|
+
}
|
|
142
|
+
if (!Number.isFinite(nextValue)) {
|
|
143
|
+
return currentValue;
|
|
144
|
+
}
|
|
145
|
+
const precision = Math.min(12, Math.max(getDecimalPlaces(effectiveStep), getDecimalPlaces(stepBase)));
|
|
146
|
+
const roundedValue = Number(nextValue.toFixed(precision));
|
|
147
|
+
if (isIntegerOnly && !Number.isInteger(roundedValue)) {
|
|
148
|
+
return currentValue;
|
|
149
|
+
}
|
|
150
|
+
return Object.is(roundedValue, -0) ? 0 : roundedValue;
|
|
151
|
+
}
|
|
94
152
|
|
|
95
153
|
/**
|
|
96
154
|
* A number input component for collecting numeric user input.
|
|
@@ -109,6 +167,7 @@ export function NumberInput({
|
|
|
109
167
|
isOptional = false,
|
|
110
168
|
isRequired = false,
|
|
111
169
|
isDisabled = false,
|
|
170
|
+
isReadOnly = false,
|
|
112
171
|
disabledMessage,
|
|
113
172
|
startIcon,
|
|
114
173
|
labelIcon,
|
|
@@ -125,6 +184,9 @@ export function NumberInput({
|
|
|
125
184
|
min,
|
|
126
185
|
max,
|
|
127
186
|
step,
|
|
187
|
+
formatValue,
|
|
188
|
+
isWheelEnabled = true,
|
|
189
|
+
hasNumberSteppers = false,
|
|
128
190
|
units,
|
|
129
191
|
isIntegerOnly = false,
|
|
130
192
|
onFocus,
|
|
@@ -152,6 +214,7 @@ export function NumberInput({
|
|
|
152
214
|
|
|
153
215
|
// Pending input while user is typing (null = show formatted value)
|
|
154
216
|
const [pendingInput, setPendingInput] = useState(null);
|
|
217
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
155
218
|
|
|
156
219
|
// Disabled-reason tooltip. Disabled controls swallow pointer events, so the
|
|
157
220
|
// tooltip listeners attach to the input container (which already exists) and
|
|
@@ -184,9 +247,15 @@ export function NumberInput({
|
|
|
184
247
|
// The tooltip variant renders no message box; describe the input by the
|
|
185
248
|
// tooltip's content instead so the status is still announced.
|
|
186
249
|
statusTooltipDescribedBy, units ? unitsID : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null], inputGroup);
|
|
250
|
+
const formattedValue = useMemo(() => {
|
|
251
|
+
if (value == null) {
|
|
252
|
+
return '';
|
|
253
|
+
}
|
|
254
|
+
return formatValue?.(value) ?? String(value);
|
|
255
|
+
}, [formatValue, value]);
|
|
187
256
|
|
|
188
|
-
//
|
|
189
|
-
//
|
|
257
|
+
// Preserve pending text while editing. Otherwise show the formatted value
|
|
258
|
+
// at rest and the raw numeric value while focused so it remains editable.
|
|
190
259
|
const displayValue = useMemo(() => {
|
|
191
260
|
if (pendingInput !== null) {
|
|
192
261
|
return pendingInput;
|
|
@@ -194,8 +263,8 @@ export function NumberInput({
|
|
|
194
263
|
if (value == null) {
|
|
195
264
|
return '';
|
|
196
265
|
}
|
|
197
|
-
return String(value);
|
|
198
|
-
}, [pendingInput, value]);
|
|
266
|
+
return isFocused ? String(value) : formattedValue;
|
|
267
|
+
}, [formattedValue, isFocused, pendingInput, value]);
|
|
199
268
|
|
|
200
269
|
// Check if current pending input is valid (for styling purposes)
|
|
201
270
|
const isInputValid = useMemo(() => {
|
|
@@ -214,7 +283,7 @@ export function NumberInput({
|
|
|
214
283
|
// Value can't change while showing a disabled message (the field is
|
|
215
284
|
// read-only and non-native-disabled), but guard the handler too so the
|
|
216
285
|
// pending value and onChange never fire.
|
|
217
|
-
if (isDisabled) {
|
|
286
|
+
if (isDisabled || isReadOnly) {
|
|
218
287
|
return;
|
|
219
288
|
}
|
|
220
289
|
const newValue = e.target.value;
|
|
@@ -229,10 +298,11 @@ export function NumberInput({
|
|
|
229
298
|
if (parsed !== null && parsed !== value) {
|
|
230
299
|
onChange(parsed);
|
|
231
300
|
}
|
|
232
|
-
}, [value, onChange, min, max, isIntegerOnly, isDisabled]);
|
|
301
|
+
}, [value, onChange, min, max, isIntegerOnly, isDisabled, isReadOnly]);
|
|
233
302
|
|
|
234
303
|
// Handle focus
|
|
235
304
|
const handleFocus = useCallback(e => {
|
|
305
|
+
setIsFocused(true);
|
|
236
306
|
onFocus?.(e);
|
|
237
307
|
}, [onFocus]);
|
|
238
308
|
|
|
@@ -259,11 +329,58 @@ export function NumberInput({
|
|
|
259
329
|
|
|
260
330
|
// Clear pending input - display will revert to formatted value
|
|
261
331
|
setPendingInput(null);
|
|
332
|
+
setIsFocused(false);
|
|
262
333
|
onBlur?.(e);
|
|
263
334
|
}, [pendingInput, value, onChange, min, max, isIntegerOnly, onBlur, hasClear]);
|
|
335
|
+
const valueForStepping = useMemo(() => {
|
|
336
|
+
if (pendingInput === null) {
|
|
337
|
+
return value ?? null;
|
|
338
|
+
}
|
|
339
|
+
if (pendingInput.trim() === '') {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
return parseNumberInput(pendingInput, {
|
|
343
|
+
min,
|
|
344
|
+
max,
|
|
345
|
+
isIntegerOnly
|
|
346
|
+
}) ?? value ?? null;
|
|
347
|
+
}, [isIntegerOnly, max, min, pendingInput, value]);
|
|
348
|
+
const getNextValue = useCallback(direction => getSteppedValue({
|
|
349
|
+
currentValue: valueForStepping,
|
|
350
|
+
direction,
|
|
351
|
+
min,
|
|
352
|
+
max,
|
|
353
|
+
step,
|
|
354
|
+
isIntegerOnly
|
|
355
|
+
}), [isIntegerOnly, max, min, step, valueForStepping]);
|
|
356
|
+
const stepValue = useCallback(direction => {
|
|
357
|
+
// A read-only field is not steppable by any route: keyboard, wheel, or
|
|
358
|
+
// the stepper buttons all land here.
|
|
359
|
+
if (isDisabled || isReadOnly) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const nextValue = getNextValue(direction);
|
|
363
|
+
if (nextValue == null) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
setPendingInput(null);
|
|
367
|
+
if (nextValue !== value) {
|
|
368
|
+
onChange(nextValue);
|
|
369
|
+
}
|
|
370
|
+
}, [getNextValue, isDisabled, isReadOnly, onChange, value]);
|
|
264
371
|
|
|
265
372
|
// Handle keyboard events
|
|
266
373
|
const handleKeyDown = useCallback(e => {
|
|
374
|
+
const hasModifier = e.altKey || e.ctrlKey || e.metaKey || e.shiftKey;
|
|
375
|
+
if (!hasModifier && (e.key === 'ArrowUp' || e.key === 'ArrowDown')) {
|
|
376
|
+
onKeyDown?.(e);
|
|
377
|
+
if (e.defaultPrevented) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
e.preventDefault();
|
|
381
|
+
stepValue(e.key === 'ArrowUp' ? 1 : -1);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
267
384
|
if (e.key === 'Enter') {
|
|
268
385
|
// Validate and commit on Enter
|
|
269
386
|
if (pendingInput !== null) {
|
|
@@ -287,17 +404,33 @@ export function NumberInput({
|
|
|
287
404
|
onEnter?.();
|
|
288
405
|
}
|
|
289
406
|
onKeyDown?.(e);
|
|
290
|
-
}, [pendingInput, value, onChange, min, max, isIntegerOnly, onEnter, onKeyDown, hasClear]);
|
|
407
|
+
}, [pendingInput, value, onChange, min, max, isIntegerOnly, onEnter, onKeyDown, hasClear, stepValue]);
|
|
291
408
|
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
e.stopPropagation();
|
|
409
|
+
// React's delegated wheel listener can be passive, so use a native,
|
|
410
|
+
// explicitly non-passive listener to prevent page scrolling only when this
|
|
411
|
+
// focused input is intentionally consuming the gesture to step its value.
|
|
412
|
+
const wheelListenerRef = useCallback(input => {
|
|
413
|
+
if (input == null || !isWheelEnabled) {
|
|
414
|
+
return;
|
|
299
415
|
}
|
|
300
|
-
|
|
416
|
+
const handleWheel = event => {
|
|
417
|
+
// Bail before preventDefault so a read-only input never swallows the
|
|
418
|
+
// page scroll it cannot act on.
|
|
419
|
+
if (document.activeElement !== input || isDisabled || isReadOnly || event.deltaY === 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
event.preventDefault();
|
|
423
|
+
event.stopPropagation();
|
|
424
|
+
stepValue(event.deltaY < 0 ? 1 : -1);
|
|
425
|
+
};
|
|
426
|
+
input.addEventListener('wheel', handleWheel, {
|
|
427
|
+
passive: false
|
|
428
|
+
});
|
|
429
|
+
return () => input.removeEventListener('wheel', handleWheel);
|
|
430
|
+
}, [isDisabled, isReadOnly, isWheelEnabled, stepValue]);
|
|
431
|
+
const mergedInputRef = useMemo(() => mergeRefs(ref, inputRef, wheelListenerRef), [ref, wheelListenerRef]);
|
|
432
|
+
const canIncrement = getNextValue(1) !== valueForStepping;
|
|
433
|
+
const canDecrement = getNextValue(-1) !== valueForStepping;
|
|
301
434
|
|
|
302
435
|
// Handle clear button click
|
|
303
436
|
const handleClear = useCallback(() => {
|
|
@@ -329,8 +462,10 @@ export function NumberInput({
|
|
|
329
462
|
onMouseUp: handleWrapperMouseUp,
|
|
330
463
|
...mergeProps(themeProps('number-input', {
|
|
331
464
|
size,
|
|
332
|
-
status: status?.type ?? null
|
|
333
|
-
|
|
465
|
+
status: status?.type ?? null,
|
|
466
|
+
disabled: isDisabled ? 'disabled' : null,
|
|
467
|
+
readonly: isReadOnly ? 'readonly' : null
|
|
468
|
+
}), stylex.props(inputWrapperStyles.base, styles.wrapper, hasNumberSteppers && styles.wrapperWithNumberSteppers, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && !isDisabled && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
334
469
|
children: [startIcon && renderIconSlot(startIcon, {
|
|
335
470
|
size: 'sm',
|
|
336
471
|
color: 'secondary'
|
|
@@ -339,17 +474,18 @@ export function NumberInput({
|
|
|
339
474
|
children: label
|
|
340
475
|
}), /*#__PURE__*/_jsx("input", {
|
|
341
476
|
...rest,
|
|
342
|
-
ref:
|
|
477
|
+
ref: mergedInputRef,
|
|
343
478
|
id: id,
|
|
344
|
-
name: htmlName,
|
|
345
|
-
type: "
|
|
479
|
+
name: isDisabled || formatValue ? undefined : htmlName,
|
|
480
|
+
type: "text",
|
|
481
|
+
inputMode: isIntegerOnly ? 'numeric' : 'decimal',
|
|
482
|
+
role: "spinbutton",
|
|
346
483
|
autoComplete: autoComplete,
|
|
347
484
|
value: displayValue,
|
|
348
485
|
onChange: handleInputChange,
|
|
349
486
|
onFocus: handleFocus,
|
|
350
487
|
onBlur: handleBlur,
|
|
351
488
|
onKeyDown: handleKeyDown,
|
|
352
|
-
onWheel: handleWheel,
|
|
353
489
|
placeholder: placeholder
|
|
354
490
|
// With a disabledMessage the input keeps focusability via aria-disabled
|
|
355
491
|
// so the reason is focus-discoverable; readOnly + the handler guards
|
|
@@ -357,30 +493,35 @@ export function NumberInput({
|
|
|
357
493
|
,
|
|
358
494
|
disabled: isDisabled && !showsDisabledMessage,
|
|
359
495
|
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
360
|
-
readOnly: showsDisabledMessage || undefined,
|
|
496
|
+
readOnly: isReadOnly || showsDisabledMessage || undefined,
|
|
361
497
|
autoFocus: hasAutoFocus,
|
|
362
498
|
"data-autofocus": hasAutoFocus || undefined,
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
499
|
+
"aria-valuemin": min ?? undefined,
|
|
500
|
+
"aria-valuemax": max ?? undefined,
|
|
501
|
+
"aria-valuenow": value ?? undefined,
|
|
502
|
+
"aria-valuetext": value == null || !formatValue ? undefined : formattedValue,
|
|
366
503
|
"aria-describedby": ariaDescribedBy,
|
|
367
504
|
"aria-required": isRequired === true ? 'true' : undefined,
|
|
368
505
|
"aria-invalid": status?.type === 'error' || !isInputValid ? 'true' : undefined,
|
|
369
506
|
"aria-labelledby": ariaLabelledBy,
|
|
370
507
|
...{
|
|
371
508
|
0: {
|
|
372
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv
|
|
509
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5"
|
|
373
510
|
},
|
|
374
511
|
2: {
|
|
375
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv
|
|
512
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc"
|
|
376
513
|
},
|
|
377
514
|
1: {
|
|
378
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv
|
|
515
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xv1l7n4"
|
|
379
516
|
},
|
|
380
517
|
3: {
|
|
381
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv
|
|
518
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc xv1l7n4"
|
|
382
519
|
}
|
|
383
520
|
}[!!isDisabled << 1 | !!!isInputValid << 0]
|
|
521
|
+
}), formatValue && htmlName && !isDisabled && /*#__PURE__*/_jsx("input", {
|
|
522
|
+
type: "hidden",
|
|
523
|
+
name: htmlName,
|
|
524
|
+
value: value == null ? '' : String(value)
|
|
384
525
|
}), units && /*#__PURE__*/_jsx("span", {
|
|
385
526
|
id: unitsID,
|
|
386
527
|
...{
|
|
@@ -392,21 +533,68 @@ export function NumberInput({
|
|
|
392
533
|
role: "alert",
|
|
393
534
|
"aria-live": "assertive",
|
|
394
535
|
children: !isInputValid ? 'Invalid number' : ''
|
|
395
|
-
}), hasClear && value != null && !isDisabled && /*#__PURE__*/_jsx(
|
|
396
|
-
|
|
397
|
-
onClick: handleClear,
|
|
398
|
-
"aria-label": t('@astryx.numberInput.clearLabel', {
|
|
536
|
+
}), hasClear && value != null && !isDisabled && !isReadOnly && /*#__PURE__*/_jsx(InputClearButton, {
|
|
537
|
+
label: t('@astryx.numberInput.clearLabel', {
|
|
399
538
|
label
|
|
400
539
|
}),
|
|
540
|
+
onClick: handleClear
|
|
541
|
+
}), statusIcon, hasNumberSteppers && /*#__PURE__*/_jsxs("div", {
|
|
401
542
|
...{
|
|
402
|
-
className: "x78zum5
|
|
543
|
+
className: "xkh2ocl x78zum5 xdt5ytf x2lah0s x12xnipv x10hv0ee xgbv0en x1t7ytsu x14ydlgx xb3r6kr xxbepff x14i3lts"
|
|
403
544
|
},
|
|
404
|
-
children: /*#__PURE__*/_jsx(
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
545
|
+
children: [/*#__PURE__*/_jsx("button", {
|
|
546
|
+
type: "button",
|
|
547
|
+
tabIndex: -1,
|
|
548
|
+
disabled: isDisabled || isReadOnly || !canIncrement,
|
|
549
|
+
"aria-label": t('@astryx.numberInput.incrementLabel', {
|
|
550
|
+
label
|
|
551
|
+
}),
|
|
552
|
+
onPointerDown: event => event.preventDefault(),
|
|
553
|
+
onClick: () => {
|
|
554
|
+
inputRef.current?.focus();
|
|
555
|
+
stepValue(1);
|
|
556
|
+
},
|
|
557
|
+
...{
|
|
558
|
+
0: {
|
|
559
|
+
className: "x9f619 x78zum5 x6s0dn4 xl56j7k x98rzlu x2lwn1j x1717udv x1ghz6dp xc342km xng3xce xv9yike x10xzikg x1ilzqfv xq8i9tn x1ypdohk x1a2a7pz"
|
|
560
|
+
},
|
|
561
|
+
1: {
|
|
562
|
+
className: "x9f619 x78zum5 x6s0dn4 xl56j7k x98rzlu x2lwn1j x1717udv x1ghz6dp xc342km xng3xce x10xzikg x1a2a7pz xqa6c3m x1h6gzvc x18o3ruo"
|
|
563
|
+
}
|
|
564
|
+
}[!!(isDisabled || isReadOnly || !canIncrement) << 0],
|
|
565
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
566
|
+
icon: "chevronDown",
|
|
567
|
+
size: "xsm",
|
|
568
|
+
color: "inherit",
|
|
569
|
+
xstyle: styles.incrementIcon
|
|
570
|
+
})
|
|
571
|
+
}), /*#__PURE__*/_jsx("button", {
|
|
572
|
+
type: "button",
|
|
573
|
+
tabIndex: -1,
|
|
574
|
+
disabled: isDisabled || isReadOnly || !canDecrement,
|
|
575
|
+
"aria-label": t('@astryx.numberInput.decrementLabel', {
|
|
576
|
+
label
|
|
577
|
+
}),
|
|
578
|
+
onPointerDown: event => event.preventDefault(),
|
|
579
|
+
onClick: () => {
|
|
580
|
+
inputRef.current?.focus();
|
|
581
|
+
stepValue(-1);
|
|
582
|
+
},
|
|
583
|
+
...{
|
|
584
|
+
0: {
|
|
585
|
+
className: "x9f619 x78zum5 x6s0dn4 xl56j7k x98rzlu x2lwn1j x1717udv x1ghz6dp xc342km xng3xce xv9yike x10xzikg x1ilzqfv xq8i9tn x1ypdohk x1a2a7pz x11xkdxz x13fuv20 x1mly77v"
|
|
586
|
+
},
|
|
587
|
+
1: {
|
|
588
|
+
className: "x9f619 x78zum5 x6s0dn4 xl56j7k x98rzlu x2lwn1j x1717udv x1ghz6dp xc342km xng3xce x10xzikg x1a2a7pz x11xkdxz x13fuv20 x1mly77v xqa6c3m x1h6gzvc x18o3ruo"
|
|
589
|
+
}
|
|
590
|
+
}[!!(isDisabled || isReadOnly || !canDecrement) << 0],
|
|
591
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
592
|
+
icon: "chevronDown",
|
|
593
|
+
size: "xsm",
|
|
594
|
+
color: "inherit"
|
|
595
|
+
})
|
|
596
|
+
})]
|
|
597
|
+
})]
|
|
410
598
|
});
|
|
411
599
|
if (inputGroup) {
|
|
412
600
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Outline.d.ts","sourceRoot":"","sources":["../../src/Outline/Outline.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Outline.d.ts","sourceRoot":"","sources":["../../src/Outline/Outline.tsx"],"names":[],"mappings":"AAwCA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,E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AG,EACH,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,YAAY,+BAiLd;yBAlMe,OAAO"}
|
package/dist/Outline/Outline.js
CHANGED
|
@@ -32,6 +32,7 @@ import { useIsomorphicLayoutEffect } from "../hooks/useIsomorphicLayoutEffect.js
|
|
|
32
32
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
33
33
|
import { useScrollSpy } from "./useScrollSpy.js";
|
|
34
34
|
import { themeProps } from "../utils/themeProps.js";
|
|
35
|
+
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
35
36
|
import { useTranslator } from "../i18n/index.js";
|
|
36
37
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
38
|
// =============================================================================
|
|
@@ -72,8 +73,6 @@ const styles = {
|
|
|
72
73
|
kHE3J0: "xe9uy6x",
|
|
73
74
|
krNwJM: "x140uwzg",
|
|
74
75
|
kSReZ0: "xyxi2l3",
|
|
75
|
-
k3Woio: "x17nn4n9",
|
|
76
|
-
kiEn40: "x7s97pk",
|
|
77
76
|
$$css: true
|
|
78
77
|
},
|
|
79
78
|
activeLink: {
|
|
@@ -332,7 +331,7 @@ export function Outline({
|
|
|
332
331
|
...mergeProps(themeProps('outline-item', {
|
|
333
332
|
active: isActive ? 'active' : null,
|
|
334
333
|
level: item.level
|
|
335
|
-
}),
|
|
334
|
+
}), focusOutlineProps.focusVisible(styles.link, densityStyles[density], getIndentStyle(item.level), isActive && styles.activeLink, isActive && styles.activeAnchor)),
|
|
336
335
|
children: /*#__PURE__*/_jsx("span", {
|
|
337
336
|
...{
|
|
338
337
|
className: "xb3r6kr xlyipyv xuxw1ft"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":"AA2CA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"P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OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,cAAc,CAAC;IAGtB,wDAAwD;IACxD,UAAU,CAAC,EAAE,OAAO,CAAC;IAGrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA+GD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CA6CpB;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EAAE,cAAc,EAC1B,OAAO,EACP,QAAQ,EAAE,YAAiB,EAC3B,eAAe,EACf,gBAAgB,EAChB,OAAiB,EACjB,SAAS,EACT,YAAmB,EACnB,IAAI,EAAE,QAAY,EAClB,YAAgB,EAChB,IAAW,EACX,UAAkB,EAClB,KAAK,EAAE,cAAc,EACrB,aAAa,EAAE,MAAM,EACrB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,sCAkfjB;yBA1gBe,UAAU"}
|
|
@@ -34,6 +34,7 @@ import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
|
34
34
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
35
35
|
import { mergeProps, rtlStyles } from "../utils/index.js";
|
|
36
36
|
import { themeProps } from "../utils/themeProps.js";
|
|
37
|
+
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
37
38
|
import { useTranslator } from "../i18n/useTranslator.js";
|
|
38
39
|
|
|
39
40
|
// =============================================================================
|
|
@@ -50,6 +51,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
50
51
|
// Styles
|
|
51
52
|
// =============================================================================
|
|
52
53
|
|
|
54
|
+
/** Width (px) of the page-size Selector field. */
|
|
55
|
+
const PAGE_SIZE_SELECTOR_WIDTH = 80;
|
|
53
56
|
const styles = {
|
|
54
57
|
root: {
|
|
55
58
|
k1xSpc: "x78zum5",
|
|
@@ -58,6 +61,34 @@ const styles = {
|
|
|
58
61
|
kOIVth: "x18g69wz",
|
|
59
62
|
$$css: true
|
|
60
63
|
},
|
|
64
|
+
dot: {
|
|
65
|
+
kzqmXN: "x1f0dxl5",
|
|
66
|
+
kZKoxP: "xoqw5ej",
|
|
67
|
+
kMzoRj: "xc342km",
|
|
68
|
+
ksu8eU: "xng3xce",
|
|
69
|
+
kmVPX3: "x1717udv",
|
|
70
|
+
kaIpWk: "x16rqkct",
|
|
71
|
+
kWkggS: "x17x4s8c",
|
|
72
|
+
kkrTdU: "x1ypdohk",
|
|
73
|
+
k1ekBW: "x15406qy",
|
|
74
|
+
kIyJzY: "xuedmi6",
|
|
75
|
+
kAMwcw: "xlr8y92",
|
|
76
|
+
$$css: true
|
|
77
|
+
},
|
|
78
|
+
dotSm: {
|
|
79
|
+
kzqmXN: "x1wu31ai",
|
|
80
|
+
kZKoxP: "xcenk2v",
|
|
81
|
+
$$css: true
|
|
82
|
+
},
|
|
83
|
+
dotActive: {
|
|
84
|
+
kWkggS: "x1ewilqj",
|
|
85
|
+
$$css: true
|
|
86
|
+
},
|
|
87
|
+
dotDisabled: {
|
|
88
|
+
kkrTdU: "x1h6gzvc",
|
|
89
|
+
kSiTet: "xbyyjgo",
|
|
90
|
+
$$css: true
|
|
91
|
+
},
|
|
61
92
|
activePage: {
|
|
62
93
|
kWkggS: "x17x4s8c",
|
|
63
94
|
k63SB2: "x1e4wzip",
|
|
@@ -459,32 +490,7 @@ export function Pagination({
|
|
|
459
490
|
...mergeProps(themeProps('pagination-dot', {
|
|
460
491
|
active: isActive ? 'active' : null,
|
|
461
492
|
size
|
|
462
|
-
}),
|
|
463
|
-
0: {
|
|
464
|
-
className: "x1f0dxl5 xoqw5ej xc342km xng3xce x1717udv x16rqkct x17x4s8c x1ypdohk x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk"
|
|
465
|
-
},
|
|
466
|
-
4: {
|
|
467
|
-
className: "xc342km xng3xce x1717udv x16rqkct x17x4s8c x1ypdohk x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1wu31ai xcenk2v"
|
|
468
|
-
},
|
|
469
|
-
2: {
|
|
470
|
-
className: "x1f0dxl5 xoqw5ej xc342km xng3xce x1717udv x16rqkct x1ypdohk x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1ewilqj"
|
|
471
|
-
},
|
|
472
|
-
6: {
|
|
473
|
-
className: "xc342km xng3xce x1717udv x16rqkct x1ypdohk x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1wu31ai xcenk2v x1ewilqj"
|
|
474
|
-
},
|
|
475
|
-
1: {
|
|
476
|
-
className: "x1f0dxl5 xoqw5ej xc342km xng3xce x1717udv x16rqkct x17x4s8c x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1h6gzvc xbyyjgo"
|
|
477
|
-
},
|
|
478
|
-
5: {
|
|
479
|
-
className: "xc342km xng3xce x1717udv x16rqkct x17x4s8c x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1wu31ai xcenk2v x1h6gzvc xbyyjgo"
|
|
480
|
-
},
|
|
481
|
-
3: {
|
|
482
|
-
className: "x1f0dxl5 xoqw5ej xc342km xng3xce x1717udv x16rqkct x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1ewilqj x1h6gzvc xbyyjgo"
|
|
483
|
-
},
|
|
484
|
-
7: {
|
|
485
|
-
className: "xc342km xng3xce x1717udv x16rqkct x15406qy xuedmi6 xlr8y92 x1a2a7pz x17nn4n9 x1wfwxd8 x7s97pk x1wu31ai xcenk2v x1ewilqj x1h6gzvc xbyyjgo"
|
|
486
|
-
}
|
|
487
|
-
}[!!isSm << 2 | !!isActive << 1 | !!isDisabled << 0])
|
|
493
|
+
}), focusOutlineProps.focusVisible(styles.dot, isSm && styles.dotSm, isActive && styles.dotActive, isDisabled && styles.dotDisabled))
|
|
488
494
|
}, i + 1);
|
|
489
495
|
})
|
|
490
496
|
});
|
|
@@ -564,19 +570,19 @@ export function Pagination({
|
|
|
564
570
|
...{
|
|
565
571
|
className: "x78zum5 x6s0dn4 x1txdalj"
|
|
566
572
|
},
|
|
567
|
-
children: /*#__PURE__*/_jsx(
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
573
|
+
children: /*#__PURE__*/_jsx(Selector, {
|
|
574
|
+
label: itemsPerPageLabel,
|
|
575
|
+
isLabelHidden: true,
|
|
576
|
+
options: pageSizeOptions.map(opt => String(opt)),
|
|
577
|
+
value: String(pageSize),
|
|
578
|
+
onChange: handlePageSizeChange,
|
|
579
|
+
size: buttonSize,
|
|
580
|
+
isDisabled: isDisabled
|
|
581
|
+
// `width`, not `xstyle`: Selector's xstyle lands on the trigger
|
|
582
|
+
// box, while `width` sizes the whole field — which is what the
|
|
583
|
+
// removed wrapper did.
|
|
584
|
+
,
|
|
585
|
+
width: PAGE_SIZE_SELECTOR_WIDTH
|
|
580
586
|
})
|
|
581
587
|
}), /*#__PURE__*/_jsxs("div", {
|
|
582
588
|
...{
|
|
@@ -587,12 +593,10 @@ export function Pagination({
|
|
|
587
593
|
tooltip: isDisabled || !hasPrevious ? undefined : firstLabel,
|
|
588
594
|
variant: "ghost",
|
|
589
595
|
size: buttonSize,
|
|
590
|
-
icon: /*#__PURE__*/_jsx(
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
size: isSm ? 'sm' : 'md'
|
|
595
|
-
})
|
|
596
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
597
|
+
icon: "chevronsLeft",
|
|
598
|
+
size: isSm ? 'sm' : 'md',
|
|
599
|
+
xstyle: rtlStyles.mirror
|
|
596
600
|
}),
|
|
597
601
|
onClick: handleFirst,
|
|
598
602
|
isDisabled: isDisabled || !hasPrevious,
|
|
@@ -602,12 +606,10 @@ export function Pagination({
|
|
|
602
606
|
tooltip: isDisabled || !hasPrevious ? undefined : previousLabel,
|
|
603
607
|
variant: "ghost",
|
|
604
608
|
size: buttonSize,
|
|
605
|
-
icon: /*#__PURE__*/_jsx(
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
size: isSm ? 'sm' : 'md'
|
|
610
|
-
})
|
|
609
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
610
|
+
icon: "chevronLeft",
|
|
611
|
+
size: isSm ? 'sm' : 'md',
|
|
612
|
+
xstyle: rtlStyles.mirror
|
|
611
613
|
}),
|
|
612
614
|
onClick: handlePrevious,
|
|
613
615
|
isDisabled: isDisabled || !hasPrevious,
|
|
@@ -617,12 +619,10 @@ export function Pagination({
|
|
|
617
619
|
tooltip: isDisabled || !hasNext ? undefined : nextLabel,
|
|
618
620
|
variant: "ghost",
|
|
619
621
|
size: buttonSize,
|
|
620
|
-
icon: /*#__PURE__*/_jsx(
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
size: isSm ? 'sm' : 'md'
|
|
625
|
-
})
|
|
622
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
623
|
+
icon: "chevronRight",
|
|
624
|
+
size: isSm ? 'sm' : 'md',
|
|
625
|
+
xstyle: rtlStyles.mirror
|
|
626
626
|
}),
|
|
627
627
|
onClick: handleNext,
|
|
628
628
|
isDisabled: isDisabled || !hasNext,
|
|
@@ -632,12 +632,10 @@ export function Pagination({
|
|
|
632
632
|
tooltip: isDisabled || !hasNext ? undefined : lastLabel,
|
|
633
633
|
variant: "ghost",
|
|
634
634
|
size: buttonSize,
|
|
635
|
-
icon: /*#__PURE__*/_jsx(
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
size: isSm ? 'sm' : 'md'
|
|
640
|
-
})
|
|
635
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
636
|
+
icon: "chevronsRight",
|
|
637
|
+
size: isSm ? 'sm' : 'md',
|
|
638
|
+
xstyle: rtlStyles.mirror
|
|
641
639
|
}),
|
|
642
640
|
onClick: handleLast,
|
|
643
641
|
isDisabled: isDisabled || !hasNext,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../src/Popover/Popover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAGZ,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAKf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AA4BtE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,GAAG,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACtC,sCAAsC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,+DAA+D;IAC/D,eAAe,EAAE,QAAQ,CAAC;IAC1B,6DAA6D;IAC7D,eAAe,EAAE,OAAO,CAAC;IACzB,4DAA4D;IAC5D,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,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