@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
|
@@ -142,6 +142,21 @@ describe('Pagination', () => {
|
|
|
142
142
|
).toBe(true);
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
+
it('renders the prev/next caret icons without an extra mirror wrapper span', () => {
|
|
146
|
+
// Regression: the RTL mirror used to wrap each chevron in a
|
|
147
|
+
// display:contents span, which dropped the icon out of the button's
|
|
148
|
+
// flex-centering context and offset the glyph vertically. The mirror now
|
|
149
|
+
// rides on the Icon via xstyle, so the icon renders as a direct centered
|
|
150
|
+
// child. jsdom has no layout engine to assert the pixel centering, but we
|
|
151
|
+
// can assert the structural fix: the icon carries its own class and is
|
|
152
|
+
// not the lone child of a bare wrapper span. (Centering is verified
|
|
153
|
+
// visually in Storybook.)
|
|
154
|
+
render(<Pagination page={3} onChange={() => {}} totalPages={5} />);
|
|
155
|
+
const next = screen.getByRole('button', {name: 'Go to next page'});
|
|
156
|
+
const icon = next.querySelector('.astryx-icon');
|
|
157
|
+
expect(icon).not.toBeNull();
|
|
158
|
+
});
|
|
159
|
+
|
|
145
160
|
it('renders with data-testid', () => {
|
|
146
161
|
render(
|
|
147
162
|
<Pagination
|
|
@@ -557,7 +572,7 @@ describe('Pagination', () => {
|
|
|
557
572
|
);
|
|
558
573
|
const box = screen.getByRole('spinbutton', {name: 'Go to page'});
|
|
559
574
|
expect(box).toBeInTheDocument();
|
|
560
|
-
expect(box).toHaveValue(3);
|
|
575
|
+
expect(box).toHaveValue('3');
|
|
561
576
|
// Visible leading "Page" label and trailing "/ N" total (10 pages).
|
|
562
577
|
expect(screen.getByText('Page')).toBeInTheDocument();
|
|
563
578
|
expect(screen.getByText('/ 10')).toBeInTheDocument();
|
|
@@ -594,8 +609,8 @@ describe('Pagination', () => {
|
|
|
594
609
|
// The box is a NumberInput (a spinbutton) whose min/max clamp entries to
|
|
595
610
|
// the valid page range without hand-rolled parsing in Pagination.
|
|
596
611
|
const box = screen.getByRole('spinbutton', {name: 'Go to page'});
|
|
597
|
-
expect(box).toHaveAttribute('
|
|
598
|
-
expect(box).toHaveAttribute('
|
|
612
|
+
expect(box).toHaveAttribute('aria-valuemin', '1');
|
|
613
|
+
expect(box).toHaveAttribute('aria-valuemax', '10');
|
|
599
614
|
});
|
|
600
615
|
|
|
601
616
|
it('commits a typed page on Enter and rejects an over-range entry', async () => {
|
|
@@ -661,13 +676,13 @@ describe('Pagination', () => {
|
|
|
661
676
|
await user.type(box, 'abc');
|
|
662
677
|
await user.tab();
|
|
663
678
|
expect(onChange).not.toHaveBeenCalled();
|
|
664
|
-
expect(box).toHaveValue(3);
|
|
679
|
+
expect(box).toHaveValue('3');
|
|
665
680
|
|
|
666
681
|
// Emptying the box and blurring reverts to the committed page too.
|
|
667
682
|
await user.clear(box);
|
|
668
683
|
await user.tab();
|
|
669
684
|
expect(onChange).not.toHaveBeenCalled();
|
|
670
|
-
expect(box).toHaveValue(3);
|
|
685
|
+
expect(box).toHaveValue('3');
|
|
671
686
|
});
|
|
672
687
|
|
|
673
688
|
it('announces the committed page to screen readers', async () => {
|
|
@@ -785,7 +800,7 @@ describe('Pagination', () => {
|
|
|
785
800
|
);
|
|
786
801
|
const box = screen.getByRole('spinbutton', {name: 'Go to page'});
|
|
787
802
|
// The box holds the page number, and committing drives page navigation.
|
|
788
|
-
expect(box).toHaveValue(1);
|
|
803
|
+
expect(box).toHaveValue('1');
|
|
789
804
|
await user.clear(box);
|
|
790
805
|
await user.type(box, '4{Enter}');
|
|
791
806
|
expect(onChange).toHaveBeenCalledWith(4);
|
|
@@ -956,7 +971,7 @@ describe('Pagination', () => {
|
|
|
956
971
|
// The box still holds the 1-based page number.
|
|
957
972
|
expect(
|
|
958
973
|
screen.getByRole('spinbutton', {name: 'Go to page'}),
|
|
959
|
-
).toHaveValue(3);
|
|
974
|
+
).toHaveValue('3');
|
|
960
975
|
});
|
|
961
976
|
|
|
962
977
|
it('keeps the input page-navigating with a custom label', async () => {
|
|
@@ -43,6 +43,7 @@ import {useListFocus} from '../hooks/useListFocus';
|
|
|
43
43
|
import {mergeProps, rtlStyles} from '../utils';
|
|
44
44
|
import type {BaseProps} from '../BaseProps';
|
|
45
45
|
import {themeProps} from '../utils/themeProps';
|
|
46
|
+
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
46
47
|
import {useTranslator} from '../i18n/useTranslator';
|
|
47
48
|
import type {PaginationVariantMap} from './index';
|
|
48
49
|
|
|
@@ -165,6 +166,9 @@ export interface PaginationProps extends Omit<
|
|
|
165
166
|
// Styles
|
|
166
167
|
// =============================================================================
|
|
167
168
|
|
|
169
|
+
/** Width (px) of the page-size Selector field. */
|
|
170
|
+
const PAGE_SIZE_SELECTOR_WIDTH = 80;
|
|
171
|
+
|
|
168
172
|
const styles = stylex.create({
|
|
169
173
|
root: {
|
|
170
174
|
display: 'flex',
|
|
@@ -214,14 +218,6 @@ const styles = stylex.create({
|
|
|
214
218
|
transitionProperty: 'background-color',
|
|
215
219
|
transitionDuration: durationVars['--duration-fast'],
|
|
216
220
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
217
|
-
outline: {
|
|
218
|
-
default: 'none',
|
|
219
|
-
':focus-visible': `2px solid ${colorVars['--color-accent']}`,
|
|
220
|
-
},
|
|
221
|
-
outlineOffset: {
|
|
222
|
-
default: '0',
|
|
223
|
-
':focus-visible': '2px',
|
|
224
|
-
},
|
|
225
221
|
},
|
|
226
222
|
dotSm: {
|
|
227
223
|
width: spacingVars['--spacing-1-5'],
|
|
@@ -265,9 +261,6 @@ const styles = stylex.create({
|
|
|
265
261
|
alignItems: 'center',
|
|
266
262
|
gap: spacingVars['--spacing-2'],
|
|
267
263
|
},
|
|
268
|
-
pageSizeSelectorControl: {
|
|
269
|
-
width: 80,
|
|
270
|
-
},
|
|
271
264
|
disabled: {
|
|
272
265
|
opacity: 0.5,
|
|
273
266
|
pointerEvents: 'none' as const,
|
|
@@ -702,7 +695,7 @@ export function Pagination({
|
|
|
702
695
|
active: isActive ? 'active' : null,
|
|
703
696
|
size,
|
|
704
697
|
}),
|
|
705
|
-
|
|
698
|
+
focusOutlineProps.focusVisible(
|
|
706
699
|
styles.dot,
|
|
707
700
|
isSm && styles.dotSm,
|
|
708
701
|
isActive && styles.dotActive,
|
|
@@ -791,17 +784,19 @@ export function Pagination({
|
|
|
791
784
|
data-testid={testId}>
|
|
792
785
|
{pageSizeOptions != null && pageSizeOptions.length > 0 && (
|
|
793
786
|
<div {...stylex.props(styles.pageSizeSelector)}>
|
|
794
|
-
<
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
787
|
+
<Selector
|
|
788
|
+
label={itemsPerPageLabel}
|
|
789
|
+
isLabelHidden
|
|
790
|
+
options={pageSizeOptions.map(opt => String(opt))}
|
|
791
|
+
value={String(pageSize)}
|
|
792
|
+
onChange={handlePageSizeChange}
|
|
793
|
+
size={buttonSize}
|
|
794
|
+
isDisabled={isDisabled}
|
|
795
|
+
// `width`, not `xstyle`: Selector's xstyle lands on the trigger
|
|
796
|
+
// box, while `width` sizes the whole field — which is what the
|
|
797
|
+
// removed wrapper did.
|
|
798
|
+
width={PAGE_SIZE_SELECTOR_WIDTH}
|
|
799
|
+
/>
|
|
805
800
|
</div>
|
|
806
801
|
)}
|
|
807
802
|
<div {...stylex.props(styles.controls)}>
|
|
@@ -812,9 +807,11 @@ export function Pagination({
|
|
|
812
807
|
variant="ghost"
|
|
813
808
|
size={buttonSize}
|
|
814
809
|
icon={
|
|
815
|
-
<
|
|
816
|
-
|
|
817
|
-
|
|
810
|
+
<Icon
|
|
811
|
+
icon="chevronsLeft"
|
|
812
|
+
size={isSm ? 'sm' : 'md'}
|
|
813
|
+
xstyle={rtlStyles.mirror}
|
|
814
|
+
/>
|
|
818
815
|
}
|
|
819
816
|
onClick={handleFirst}
|
|
820
817
|
isDisabled={isDisabled || !hasPrevious}
|
|
@@ -828,9 +825,11 @@ export function Pagination({
|
|
|
828
825
|
variant="ghost"
|
|
829
826
|
size={buttonSize}
|
|
830
827
|
icon={
|
|
831
|
-
<
|
|
832
|
-
|
|
833
|
-
|
|
828
|
+
<Icon
|
|
829
|
+
icon="chevronLeft"
|
|
830
|
+
size={isSm ? 'sm' : 'md'}
|
|
831
|
+
xstyle={rtlStyles.mirror}
|
|
832
|
+
/>
|
|
834
833
|
}
|
|
835
834
|
onClick={handlePrevious}
|
|
836
835
|
isDisabled={isDisabled || !hasPrevious}
|
|
@@ -845,9 +844,11 @@ export function Pagination({
|
|
|
845
844
|
variant="ghost"
|
|
846
845
|
size={buttonSize}
|
|
847
846
|
icon={
|
|
848
|
-
<
|
|
849
|
-
|
|
850
|
-
|
|
847
|
+
<Icon
|
|
848
|
+
icon="chevronRight"
|
|
849
|
+
size={isSm ? 'sm' : 'md'}
|
|
850
|
+
xstyle={rtlStyles.mirror}
|
|
851
|
+
/>
|
|
851
852
|
}
|
|
852
853
|
onClick={handleNext}
|
|
853
854
|
isDisabled={isDisabled || !hasNext}
|
|
@@ -861,9 +862,11 @@ export function Pagination({
|
|
|
861
862
|
variant="ghost"
|
|
862
863
|
size={buttonSize}
|
|
863
864
|
icon={
|
|
864
|
-
<
|
|
865
|
-
|
|
866
|
-
|
|
865
|
+
<Icon
|
|
866
|
+
icon="chevronsRight"
|
|
867
|
+
size={isSm ? 'sm' : 'md'}
|
|
868
|
+
xstyle={rtlStyles.mirror}
|
|
869
|
+
/>
|
|
867
870
|
}
|
|
868
871
|
onClick={handleLast}
|
|
869
872
|
isDisabled={isDisabled || !hasNext}
|
package/src/Popover/Popover.tsx
CHANGED
|
@@ -250,10 +250,6 @@ const styles = stylex.create({
|
|
|
250
250
|
paddingInlineStart: spacingVars['--spacing-3'],
|
|
251
251
|
paddingInlineEnd: spacingVars['--spacing-3'],
|
|
252
252
|
},
|
|
253
|
-
gap: {
|
|
254
|
-
marginBlockStart: spacingVars['--spacing-1'],
|
|
255
|
-
marginBlockEnd: spacingVars['--spacing-1'],
|
|
256
|
-
},
|
|
257
253
|
customWidth: (width: string | number) => ({
|
|
258
254
|
width: typeof width === 'number' ? `${width}px` : width,
|
|
259
255
|
}),
|
|
@@ -529,7 +525,8 @@ export function Popover({
|
|
|
529
525
|
{
|
|
530
526
|
placement,
|
|
531
527
|
alignment,
|
|
532
|
-
|
|
528
|
+
offset: spacingVars['--spacing-1'],
|
|
529
|
+
xstyle: [popoverXstyle, layerAnimations[placement]],
|
|
533
530
|
},
|
|
534
531
|
)}
|
|
535
532
|
</>
|
|
@@ -565,7 +562,8 @@ export function Popover({
|
|
|
565
562
|
{
|
|
566
563
|
placement,
|
|
567
564
|
alignment,
|
|
568
|
-
|
|
565
|
+
offset: spacingVars['--spacing-1'],
|
|
566
|
+
xstyle: [popoverXstyle, layerAnimations[placement]],
|
|
569
567
|
},
|
|
570
568
|
)}
|
|
571
569
|
</>
|
|
@@ -594,7 +592,8 @@ export function Popover({
|
|
|
594
592
|
{
|
|
595
593
|
placement,
|
|
596
594
|
alignment,
|
|
597
|
-
|
|
595
|
+
offset: spacingVars['--spacing-1'],
|
|
596
|
+
xstyle: [popoverXstyle, layerAnimations[placement]],
|
|
598
597
|
},
|
|
599
598
|
)}
|
|
600
599
|
</>
|
|
@@ -104,7 +104,6 @@ const popoverLayerStyles = stylex.create({
|
|
|
104
104
|
layer: {
|
|
105
105
|
width: 'anchor-size(width)',
|
|
106
106
|
minWidth: 400,
|
|
107
|
-
marginTop: spacingVars['--spacing-1'],
|
|
108
107
|
},
|
|
109
108
|
});
|
|
110
109
|
|
|
@@ -1053,6 +1052,7 @@ export function PowerSearch({
|
|
|
1053
1052
|
{popover.render(popoverContent, {
|
|
1054
1053
|
placement: 'below',
|
|
1055
1054
|
alignment: 'start',
|
|
1055
|
+
offset: spacingVars['--spacing-1'],
|
|
1056
1056
|
xstyle: [popoverLayerStyles.layer, layerAnimations.below],
|
|
1057
1057
|
})}
|
|
1058
1058
|
</>
|
|
@@ -283,4 +283,46 @@ describe('PowerSearch', () => {
|
|
|
283
283
|
// onSave should NOT be called because the event was already consumed (defaultPrevented)
|
|
284
284
|
expect(onSave).not.toHaveBeenCalled();
|
|
285
285
|
});
|
|
286
|
+
|
|
287
|
+
it('does not save/close on a composing Enter while typing a filter value (#4828)', () => {
|
|
288
|
+
const onSave = vi.fn();
|
|
289
|
+
const onCancel = vi.fn();
|
|
290
|
+
|
|
291
|
+
function StringValueHarness() {
|
|
292
|
+
const internalConfig = useInternalConfig(testConfig);
|
|
293
|
+
return (
|
|
294
|
+
<PowerSearchEditPopover
|
|
295
|
+
config={internalConfig}
|
|
296
|
+
filter={{
|
|
297
|
+
field: 'status',
|
|
298
|
+
operator: 'is',
|
|
299
|
+
value: {type: 'string', value: '한국어'},
|
|
300
|
+
}}
|
|
301
|
+
mode="edit"
|
|
302
|
+
onSave={onSave}
|
|
303
|
+
onCancel={onCancel}
|
|
304
|
+
/>
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const {container} = render(<StringValueHarness />);
|
|
309
|
+
const input = container.querySelector('input');
|
|
310
|
+
expect(input).not.toBeNull();
|
|
311
|
+
|
|
312
|
+
// Same composing-Enter signal as BaseTypeahead's guard: isComposing
|
|
313
|
+
// (modern) or legacy keyCode 229. An IME commits its composition on
|
|
314
|
+
// Enter too, so this keydown must not also close/save the popover.
|
|
315
|
+
// handleKeyDown is bound on an ancestor container div, so the keydown
|
|
316
|
+
// reaches it the same way it would from any real input inside — same
|
|
317
|
+
// dispatch mechanism the sibling defaultPrevented test above uses.
|
|
318
|
+
fireEvent.keyDown(input!, {key: 'Enter', isComposing: true});
|
|
319
|
+
expect(onSave).not.toHaveBeenCalled();
|
|
320
|
+
|
|
321
|
+
fireEvent.keyDown(input!, {key: 'Enter', keyCode: 229});
|
|
322
|
+
expect(onSave).not.toHaveBeenCalled();
|
|
323
|
+
|
|
324
|
+
// A real, non-composing Enter still saves normally.
|
|
325
|
+
fireEvent.keyDown(input!, {key: 'Enter'});
|
|
326
|
+
expect(onSave).toHaveBeenCalledTimes(1);
|
|
327
|
+
});
|
|
286
328
|
});
|
|
@@ -20,6 +20,7 @@ import {HStack, VStack} from '../Stack';
|
|
|
20
20
|
import {Icon} from '../Icon';
|
|
21
21
|
import {TreeList, type TreeListItemData} from '../TreeList';
|
|
22
22
|
import {useTranslator} from '../i18n';
|
|
23
|
+
import {isImeKeyEvent} from '../hooks/useFocusTrap';
|
|
23
24
|
import {spacingVars, typeScaleVars} from '../theme/tokens.stylex';
|
|
24
25
|
import {PowerSearchValueEditor} from './PowerSearchValueEditor';
|
|
25
26
|
import {resolveOperatorLabel} from './resolveOperatorLabel';
|
|
@@ -702,6 +703,12 @@ export function PowerSearchEditPopover({
|
|
|
702
703
|
// Handle Enter to save, Escape to cancel
|
|
703
704
|
const handleKeyDown = useCallback(
|
|
704
705
|
(e: React.KeyboardEvent) => {
|
|
706
|
+
// Don't treat an IME composition-commit Enter as save-to-close --
|
|
707
|
+
// typing a CJK filter value and pressing Enter to confirm the
|
|
708
|
+
// composition would otherwise close the popover mid-composition.
|
|
709
|
+
if (isImeKeyEvent(e.nativeEvent)) {
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
705
712
|
if (e.key === 'Enter' && !isSaveDisabled && !e.defaultPrevented) {
|
|
706
713
|
e.preventDefault();
|
|
707
714
|
handleSave();
|
|
@@ -60,7 +60,7 @@ export const docs = {
|
|
|
60
60
|
name: 'marks',
|
|
61
61
|
type: 'ReadonlyArray<{value: number; label: string}>',
|
|
62
62
|
description:
|
|
63
|
-
'Fixed target marks drawn on the track at values in the same 0..max scale as value (e.g. a goal line). They stay visible whether progress is below or past them. Each mark requires a label
|
|
63
|
+
'Fixed target marks drawn on the track at values in the same 0..max scale as value (e.g. a goal line). They stay visible whether progress is below or past them, and take their color from what they sit on: a mark inside the filled area uses the fill variant\'s on-color (on-accent, on-warning, on-error, and so on), a mark still out on the bare track uses the primary text color (the secondary one on a disabled bar, which dims everything it draws). Each mark requires a label: it is the mark\'s accessible name and the text revealed via a tooltip on hover/focus. Ignored when indeterminate.',
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
name: 'isDisabled',
|
|
@@ -80,7 +80,18 @@ export const docs = {
|
|
|
80
80
|
{className: 'astryx-progressbar', visualProps: ['variant']},
|
|
81
81
|
{className: 'astryx-progressbar-fill', visualProps: ['variant']},
|
|
82
82
|
{className: 'astryx-progressbar-track'},
|
|
83
|
-
{
|
|
83
|
+
{
|
|
84
|
+
className: 'astryx-progressbar-mark',
|
|
85
|
+
visualProps: ['variant', 'placement'],
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
vars: [
|
|
89
|
+
{name: '--_progressbar-mark-width', description: 'Target mark tick width', default: '2px', private: true},
|
|
90
|
+
{name: '--_progressbar-mark-height', description: 'Target mark tick height', default: '8px', private: true},
|
|
91
|
+
],
|
|
92
|
+
derived: [
|
|
93
|
+
{property: 'width', vars: ['--_progressbar-mark-width'], replaces: true},
|
|
94
|
+
{property: 'height', vars: ['--_progressbar-mark-height'], replaces: true},
|
|
84
95
|
],
|
|
85
96
|
},
|
|
86
97
|
usage: {
|
|
@@ -154,7 +165,7 @@ export const docsZh = {
|
|
|
154
165
|
name: 'marks',
|
|
155
166
|
type: 'ReadonlyArray<{value: number; label: string}>',
|
|
156
167
|
description:
|
|
157
|
-
'在轨道上按与 value 相同的 0..max
|
|
168
|
+
'在轨道上按与 value 相同的 0..max 刻度绘制的固定目标标记(例如目标线)。无论进度低于还是超过它们都保持可见,并根据所处位置取色:位于已填充区域内的标记使用与填充变体配对的前景色(on-accent、on-warning、on-error 等),仍位于空轨道上的标记使用主文本颜色(禁用状态下会降为次要文本颜色,与其整体弱化的呈现保持一致)。每个标记都必须提供 label——它既是标记的无障碍名称,也是悬停/聚焦时通过工具提示显示的文本。不确定模式下忽略。',
|
|
158
169
|
},
|
|
159
170
|
{
|
|
160
171
|
name: 'isDisabled',
|
|
@@ -174,7 +185,18 @@ export const docsZh = {
|
|
|
174
185
|
{className: 'astryx-progressbar', visualProps: ['variant']},
|
|
175
186
|
{className: 'astryx-progressbar-fill', visualProps: ['variant']},
|
|
176
187
|
{className: 'astryx-progressbar-track'},
|
|
177
|
-
{
|
|
188
|
+
{
|
|
189
|
+
className: 'astryx-progressbar-mark',
|
|
190
|
+
visualProps: ['variant', 'placement'],
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
vars: [
|
|
194
|
+
{name: '--_progressbar-mark-width', description: '目标标记刻度宽度', default: '2px', private: true},
|
|
195
|
+
{name: '--_progressbar-mark-height', description: '目标标记刻度高度', default: '8px', private: true},
|
|
196
|
+
],
|
|
197
|
+
derived: [
|
|
198
|
+
{property: 'width', vars: ['--_progressbar-mark-width'], replaces: true},
|
|
199
|
+
{property: 'height', vars: ['--_progressbar-mark-height'], replaces: true},
|
|
178
200
|
],
|
|
179
201
|
},
|
|
180
202
|
usage: {
|
|
@@ -216,7 +238,7 @@ export const docsDense = {
|
|
|
216
238
|
formatValueLabel: 'Custom value label formatter; defaults to percentage string.',
|
|
217
239
|
variant: 'Semantic color variant.',
|
|
218
240
|
isIndeterminate: 'Animated loading indicator for unknown progress.',
|
|
219
|
-
marks: 'Fixed target marks ({value, label?}) drawn on the track in the 0..max scale; stay visible past the fill. A label reveals a tooltip on hover/focus. Ignored when indeterminate.',
|
|
241
|
+
marks: 'Fixed target marks ({value, label?}) drawn on the track in the 0..max scale; stay visible past the fill. Marks inside the fill take the variant on-color; marks on the bare track take the primary text color (secondary when disabled). A label reveals a tooltip on hover/focus. Ignored when indeterminate.',
|
|
220
242
|
isDisabled: 'Visually disabled: grays out fill and text.',
|
|
221
243
|
xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
|
|
222
244
|
},
|
|
@@ -291,6 +291,16 @@ describe('ProgressBar', () => {
|
|
|
291
291
|
describe('target marks', () => {
|
|
292
292
|
const MARK = '.astryx-progressbar-mark';
|
|
293
293
|
|
|
294
|
+
// The StyleX atomic classes on an element, without the stable astryx-*
|
|
295
|
+
// theme classes and the bare variant/placement tokens — so a comparison
|
|
296
|
+
// reflects the resolved styles, not the reflected props.
|
|
297
|
+
function styleClasses(el: HTMLElement): string {
|
|
298
|
+
return Array.from(el.classList)
|
|
299
|
+
.filter(c => /^x[a-z0-9]+$/.test(c))
|
|
300
|
+
.sort()
|
|
301
|
+
.join(' ');
|
|
302
|
+
}
|
|
303
|
+
|
|
294
304
|
it('renders no mark elements when marks is omitted', () => {
|
|
295
305
|
const {container} = render(<ProgressBar value={50} label="Progress" />);
|
|
296
306
|
expect(container.querySelectorAll(MARK)).toHaveLength(0);
|
|
@@ -405,6 +415,179 @@ describe('ProgressBar', () => {
|
|
|
405
415
|
expect(container.querySelectorAll(MARK)).toHaveLength(0);
|
|
406
416
|
});
|
|
407
417
|
|
|
418
|
+
// Mark color follows what the mark sits on: inside the filled area it
|
|
419
|
+
// takes the fill variant's on-color, out on the bare track it takes the
|
|
420
|
+
// primary text color. The choice is reflected as `data-placement`
|
|
421
|
+
// (plus `data-variant`, mirroring the fill) so themes can target it and
|
|
422
|
+
// tests can assert it without reading atomic class names.
|
|
423
|
+
it('marks the ticks inside the filled area as placed on the fill', () => {
|
|
424
|
+
const {container} = render(
|
|
425
|
+
<ProgressBar
|
|
426
|
+
value={60}
|
|
427
|
+
label="Progress"
|
|
428
|
+
marks={[
|
|
429
|
+
{value: 25, label: 'Behind'},
|
|
430
|
+
{value: 90, label: 'Ahead'},
|
|
431
|
+
]}
|
|
432
|
+
/>,
|
|
433
|
+
);
|
|
434
|
+
const marks = container.querySelectorAll<HTMLElement>(MARK);
|
|
435
|
+
expect(marks[0]).toHaveAttribute('data-placement', 'fill');
|
|
436
|
+
expect(marks[1]).toHaveAttribute('data-placement', 'track');
|
|
437
|
+
// Different placements resolve to different color styles.
|
|
438
|
+
expect(styleClasses(marks[0])).not.toBe(styleClasses(marks[1]));
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
it('treats a mark exactly at the current value as on the fill', () => {
|
|
442
|
+
const {container} = render(
|
|
443
|
+
<ProgressBar
|
|
444
|
+
value={70}
|
|
445
|
+
label="Progress"
|
|
446
|
+
marks={[{value: 70, label: 'Goal'}]}
|
|
447
|
+
/>,
|
|
448
|
+
);
|
|
449
|
+
expect(container.querySelector(MARK)).toHaveAttribute(
|
|
450
|
+
'data-placement',
|
|
451
|
+
'fill',
|
|
452
|
+
);
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
it('places every mark on the track at zero progress', () => {
|
|
456
|
+
// With no fill drawn, even a mark at 0 sits on the bare track.
|
|
457
|
+
const {container} = render(
|
|
458
|
+
<ProgressBar
|
|
459
|
+
value={0}
|
|
460
|
+
label="Progress"
|
|
461
|
+
marks={[
|
|
462
|
+
{value: 0, label: 'Start'},
|
|
463
|
+
{value: 50, label: 'Goal'},
|
|
464
|
+
]}
|
|
465
|
+
/>,
|
|
466
|
+
);
|
|
467
|
+
const marks = container.querySelectorAll<HTMLElement>(MARK);
|
|
468
|
+
expect(marks[0]).toHaveAttribute('data-placement', 'track');
|
|
469
|
+
expect(marks[1]).toHaveAttribute('data-placement', 'track');
|
|
470
|
+
expect(styleClasses(marks[0])).toBe(styleClasses(marks[1]));
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
it('mirrors the fill variant on marks so the on-color matches the bar', () => {
|
|
474
|
+
const {container} = render(
|
|
475
|
+
<ProgressBar
|
|
476
|
+
value={80}
|
|
477
|
+
variant="warning"
|
|
478
|
+
label="Budget used"
|
|
479
|
+
marks={[
|
|
480
|
+
{value: 50, label: 'Half'},
|
|
481
|
+
{value: 95, label: 'Cap'},
|
|
482
|
+
]}
|
|
483
|
+
/>,
|
|
484
|
+
);
|
|
485
|
+
const marks = container.querySelectorAll<HTMLElement>(MARK);
|
|
486
|
+
expect(marks[0]).toHaveAttribute('data-variant', 'warning');
|
|
487
|
+
expect(marks[0]).toHaveAttribute('data-placement', 'fill');
|
|
488
|
+
expect(marks[1]).toHaveAttribute('data-variant', 'warning');
|
|
489
|
+
expect(marks[1]).toHaveAttribute('data-placement', 'track');
|
|
490
|
+
});
|
|
491
|
+
|
|
492
|
+
it('uses the disabled variant for marks when the bar is disabled', () => {
|
|
493
|
+
const {container} = render(
|
|
494
|
+
<ProgressBar
|
|
495
|
+
value={80}
|
|
496
|
+
variant="error"
|
|
497
|
+
isDisabled
|
|
498
|
+
label="Canceled"
|
|
499
|
+
marks={[{value: 50, label: 'Half'}]}
|
|
500
|
+
/>,
|
|
501
|
+
);
|
|
502
|
+
expect(container.querySelector(MARK)).toHaveAttribute(
|
|
503
|
+
'data-variant',
|
|
504
|
+
'disabled',
|
|
505
|
+
);
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
it('keeps one plain foreground on both sides for neutral and disabled bars', () => {
|
|
509
|
+
// The neutral/disabled fill is the muted gray — it carries no semantic
|
|
510
|
+
// weight and has no on-token, so a mark on it takes the same plain
|
|
511
|
+
// foreground it would have out on the track.
|
|
512
|
+
for (const props of [
|
|
513
|
+
{variant: 'neutral'} as const,
|
|
514
|
+
{isDisabled: true} as const,
|
|
515
|
+
]) {
|
|
516
|
+
const {container, unmount} = render(
|
|
517
|
+
<ProgressBar
|
|
518
|
+
value={60}
|
|
519
|
+
label="Progress"
|
|
520
|
+
{...props}
|
|
521
|
+
marks={[
|
|
522
|
+
{value: 20, label: 'On fill'},
|
|
523
|
+
{value: 90, label: 'On track'},
|
|
524
|
+
]}
|
|
525
|
+
/>,
|
|
526
|
+
);
|
|
527
|
+
const marks = container.querySelectorAll<HTMLElement>(MARK);
|
|
528
|
+
expect(marks[0]).toHaveAttribute('data-placement', 'fill');
|
|
529
|
+
expect(marks[1]).toHaveAttribute('data-placement', 'track');
|
|
530
|
+
expect(styleClasses(marks[0])).toBe(styleClasses(marks[1]));
|
|
531
|
+
unmount();
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
it("dims a disabled bar's marks below a live one's", () => {
|
|
536
|
+
// A disabled bar is deliberately low-emphasis (its label and value text
|
|
537
|
+
// drop to muted colors), so its marks step down to the secondary
|
|
538
|
+
// foreground on both sides rather than shouting over the grayed-out
|
|
539
|
+
// bar. A live neutral bar — same muted gray fill — keeps the
|
|
540
|
+
// full-contrast primary foreground.
|
|
541
|
+
const MARKS = [
|
|
542
|
+
{value: 20, label: 'On fill'},
|
|
543
|
+
{value: 90, label: 'On track'},
|
|
544
|
+
];
|
|
545
|
+
const {container: live} = render(
|
|
546
|
+
<ProgressBar value={60} variant="neutral" label="A" marks={MARKS} />,
|
|
547
|
+
);
|
|
548
|
+
const {container: off} = render(
|
|
549
|
+
<ProgressBar value={60} isDisabled label="B" marks={MARKS} />,
|
|
550
|
+
);
|
|
551
|
+
const liveMarks = live.querySelectorAll<HTMLElement>(MARK);
|
|
552
|
+
const offMarks = off.querySelectorAll<HTMLElement>(MARK);
|
|
553
|
+
expect(styleClasses(offMarks[0])).not.toBe(styleClasses(liveMarks[0]));
|
|
554
|
+
expect(styleClasses(offMarks[1])).not.toBe(styleClasses(liveMarks[1]));
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
it('recolors marks per variant when they sit on the fill', () => {
|
|
558
|
+
// Two bars at the same progress with different variants give their
|
|
559
|
+
// on-fill marks different colors (different atomic classes), while
|
|
560
|
+
// their on-track marks stay the same divider color.
|
|
561
|
+
const {container: accent} = render(
|
|
562
|
+
<ProgressBar
|
|
563
|
+
value={60}
|
|
564
|
+
variant="accent"
|
|
565
|
+
label="A"
|
|
566
|
+
marks={[
|
|
567
|
+
{value: 20, label: 'On fill'},
|
|
568
|
+
{value: 90, label: 'On track'},
|
|
569
|
+
]}
|
|
570
|
+
/>,
|
|
571
|
+
);
|
|
572
|
+
const {container: error} = render(
|
|
573
|
+
<ProgressBar
|
|
574
|
+
value={60}
|
|
575
|
+
variant="error"
|
|
576
|
+
label="B"
|
|
577
|
+
marks={[
|
|
578
|
+
{value: 20, label: 'On fill'},
|
|
579
|
+
{value: 90, label: 'On track'},
|
|
580
|
+
]}
|
|
581
|
+
/>,
|
|
582
|
+
);
|
|
583
|
+
const accentMarks = accent.querySelectorAll<HTMLElement>(MARK);
|
|
584
|
+
const errorMarks = error.querySelectorAll<HTMLElement>(MARK);
|
|
585
|
+
expect(styleClasses(accentMarks[0])).not.toBe(
|
|
586
|
+
styleClasses(errorMarks[0]),
|
|
587
|
+
);
|
|
588
|
+
expect(styleClasses(accentMarks[1])).toBe(styleClasses(errorMarks[1]));
|
|
589
|
+
});
|
|
590
|
+
|
|
408
591
|
it('renders every mark as a focusable trigger (label is required, never decorative)', () => {
|
|
409
592
|
const {container} = render(
|
|
410
593
|
<ProgressBar
|
|
@@ -583,9 +766,49 @@ describe('ProgressBar', () => {
|
|
|
583
766
|
expect(trackHasOverflowHidden).toBe(true);
|
|
584
767
|
});
|
|
585
768
|
|
|
769
|
+
it('sizes the mark through the derived vars, so a theme override cannot lose the cascade', () => {
|
|
770
|
+
// width/height are declared as `var(--_progressbar-mark-*)` and nothing
|
|
771
|
+
// else declares those vars, so the value a theme sets on the
|
|
772
|
+
// `progressbar-mark` target lands even in a consumer whose StyleX is
|
|
773
|
+
// unlayered and would otherwise outrank `@layer astryx-theme`.
|
|
774
|
+
const {container} = render(
|
|
775
|
+
<ProgressBar
|
|
776
|
+
value={50}
|
|
777
|
+
label="Progress"
|
|
778
|
+
marks={[{value: 80, label: 'M'}]}
|
|
779
|
+
/>,
|
|
780
|
+
);
|
|
781
|
+
const mark = container.querySelector<HTMLElement>(MARK)!;
|
|
782
|
+
let css = '';
|
|
783
|
+
for (const sheet of Array.from(document.styleSheets)) {
|
|
784
|
+
try {
|
|
785
|
+
for (const rule of Array.from(sheet.cssRules)) {
|
|
786
|
+
css += rule.cssText + '\n';
|
|
787
|
+
}
|
|
788
|
+
} catch {
|
|
789
|
+
// ignore cross-origin sheets
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
css += Array.from(document.querySelectorAll('style'))
|
|
793
|
+
.map(s => s.textContent || '')
|
|
794
|
+
.join('\n');
|
|
795
|
+
const markRules = Array.from(mark.classList)
|
|
796
|
+
.filter(cls => /^x[a-z0-9]+$/.test(cls))
|
|
797
|
+
.flatMap(
|
|
798
|
+
cls =>
|
|
799
|
+
css.match(new RegExp(`\\.${cls}\\b[^{]*\\{[^}]*\\}`, 'g')) ?? [],
|
|
800
|
+
);
|
|
801
|
+
expect(markRules.join('\n')).toMatch(
|
|
802
|
+
/width:\s*var\(--_progressbar-mark-width,\s*2px\)/,
|
|
803
|
+
);
|
|
804
|
+
expect(markRules.join('\n')).toMatch(
|
|
805
|
+
/height:\s*var\(--_progressbar-mark-height,\s*8px\)/,
|
|
806
|
+
);
|
|
807
|
+
});
|
|
808
|
+
|
|
586
809
|
it('renders the mark on the stable progressbar-mark target, centered for symmetric overhang', () => {
|
|
587
810
|
// The mark's width/height/color are directly overridable via the
|
|
588
|
-
// `progressbar-mark` theme target
|
|
811
|
+
// `progressbar-mark` theme target. It is centered
|
|
589
812
|
// on the track (translate -50%,-50%) so a themed taller tick overhangs the
|
|
590
813
|
// bar symmetrically above and below without being clipped.
|
|
591
814
|
const {container} = render(
|