@astryxdesign/core 0.4.5 → 0.4.6-canary.cea9ecd
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 +134 -0
- package/dist/Avatar/Avatar.d.ts +10 -5
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +139 -30
- package/dist/Avatar/AvatarStatusDot.d.ts +2 -1
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusDot.js +30 -4
- package/dist/Avatar/AvatarStatusLabelContext.d.ts +39 -0
- package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -0
- package/dist/Avatar/AvatarStatusLabelContext.js +41 -0
- package/dist/AvatarGroup/AvatarGroup.d.ts +3 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +15 -9
- package/dist/Blockquote/Blockquote.d.ts +4 -3
- package/dist/Blockquote/Blockquote.d.ts.map +1 -1
- package/dist/Blockquote/Blockquote.js +9 -10
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +21 -5
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +47 -34
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +7 -7
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +21 -12
- package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
- package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
- package/dist/Calendar/styles.d.ts +2 -2
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +5 -5
- package/dist/Center/Center.d.ts +23 -1
- package/dist/Center/Center.d.ts.map +1 -1
- package/dist/Center/Center.js +12 -6
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +3 -3
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +2 -2
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +2 -2
- package/dist/Chat/useChatDictation.d.ts +1 -1
- package/dist/Chat/useChatDictation.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.d.ts +1 -1
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -3
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +2 -2
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +5 -5
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +4 -4
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +1 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +2 -2
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +3 -3
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +6 -6
- package/dist/DateInput/DateInput.d.ts +31 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +90 -22
- package/dist/DateInput/MonthScroller.d.ts +35 -0
- package/dist/DateInput/MonthScroller.d.ts.map +1 -0
- package/dist/DateInput/MonthScroller.js +658 -0
- package/dist/DateInput/MonthYearWheels.d.ts +24 -0
- package/dist/DateInput/MonthYearWheels.d.ts.map +1 -0
- package/dist/DateInput/MonthYearWheels.js +114 -0
- package/dist/DateInput/TouchDateField.d.ts +10 -0
- package/dist/DateInput/TouchDateField.d.ts.map +1 -0
- package/dist/DateInput/TouchDateField.js +810 -0
- package/dist/DateInput/Wheel.d.ts +41 -0
- package/dist/DateInput/Wheel.d.ts.map +1 -0
- package/dist/DateInput/Wheel.js +315 -0
- package/dist/DateInput/monthGeometry.d.ts +65 -0
- package/dist/DateInput/monthGeometry.d.ts.map +1 -0
- package/dist/DateInput/monthGeometry.js +98 -0
- package/dist/DateInput/tokens.stylex.d.ts +63 -0
- package/dist/DateInput/tokens.stylex.d.ts.map +1 -0
- package/dist/DateInput/tokens.stylex.js +74 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts +41 -0
- package/dist/DateInput/useOwnScrollGesture.d.ts.map +1 -0
- package/dist/DateInput/useOwnScrollGesture.js +202 -0
- package/dist/DateInput/usePointerDragScroll.d.ts +15 -0
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -0
- package/dist/DateInput/usePointerDragScroll.js +216 -0
- package/dist/DateInput/useScrollSettle.d.ts +26 -0
- package/dist/DateInput/useScrollSettle.d.ts.map +1 -0
- package/dist/DateInput/useScrollSettle.js +149 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +17 -14
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +17 -14
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +2 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +2 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +2 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +4 -4
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +6 -0
- package/dist/Field/inputStyles.stylex.d.ts +1 -1
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +5 -5
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +6 -6
- package/dist/HoverCard/HoverCard.d.ts +13 -3
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +2 -0
- package/dist/HoverCard/index.d.ts +1 -1
- package/dist/HoverCard/index.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +17 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +78 -9
- package/dist/InputGroup/InputGroup.js +1 -1
- package/dist/Item/Item.d.ts +9 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +52 -14
- package/dist/Layer/index.d.ts +4 -2
- package/dist/Layer/index.d.ts.map +1 -1
- package/dist/Layer/index.js +2 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +3 -2
- package/dist/Layer/useTouchTrigger.d.ts +113 -0
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -0
- package/dist/Layer/useTouchTrigger.js +241 -0
- package/dist/Layout/container.stylex.d.ts +4 -2
- package/dist/Layout/container.stylex.d.ts.map +1 -1
- package/dist/Layout/container.stylex.js +19 -11
- package/dist/Layout/index.d.ts +1 -0
- package/dist/Layout/index.d.ts.map +1 -1
- package/dist/Layout/index.js +4 -0
- package/dist/Layout/padding.stylex.d.ts +315 -12
- package/dist/Layout/padding.stylex.d.ts.map +1 -1
- package/dist/Layout/padding.stylex.js +389 -12
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +5 -4
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +6 -6
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +1 -1
- package/dist/MobileNav/MobileNav.d.ts +1 -0
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +24 -6
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +8 -8
- package/dist/NavItem/navItemStyles.stylex.d.ts +4 -4
- package/dist/NavItem/navItemStyles.stylex.d.ts.map +1 -1
- package/dist/NavItem/navItemStyles.stylex.js +4 -4
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +3 -3
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +36 -8
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +3 -3
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +2 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +11 -12
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -1
- package/dist/PowerSearch/formatFilterValue.d.ts +11 -2
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +23 -8
- package/dist/RadioList/RadioListItem.d.ts +2 -2
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +70 -40
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +7 -7
- package/dist/Section/Section.d.ts +36 -1
- package/dist/Section/Section.d.ts.map +1 -1
- package/dist/Section/Section.js +12 -2
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +7 -2
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +3 -3
- package/dist/Selector/Selector.d.ts +26 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +93 -20
- package/dist/Selector/SelectorOption.d.ts +14 -1
- package/dist/Selector/SelectorOption.d.ts.map +1 -1
- package/dist/Selector/SelectorOption.js +6 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
- package/dist/Selector/SelectorRowLayoutContext.js +27 -0
- package/dist/Selector/types.d.ts +1 -0
- package/dist/Selector/types.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +4 -4
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +7 -7
- package/dist/Stack/Stack.d.ts +23 -1
- package/dist/Stack/Stack.d.ts.map +1 -1
- package/dist/Stack/Stack.js +12 -6
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +2 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +1 -1
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +3 -3
- package/dist/Table/TableRow.js +4 -4
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +2 -2
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +2 -2
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +2 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts +5 -3
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +12 -9
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +3 -3
- package/dist/TextArea/TextArea.js +1 -1
- package/dist/TextInput/TextInput.js +1 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +3 -3
- package/dist/TimeInput/TimeInput.js +2 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +6 -4
- package/dist/Timestamp/formatInstant.d.ts +3 -2
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +8 -8
- package/dist/Timestamp/tooltipEntries.d.ts +2 -1
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +5 -3
- package/dist/Toast/Toast.d.ts +4 -3
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +10 -7
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +6 -6
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +1 -1
- package/dist/Tooltip/Tooltip.d.ts +16 -3
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +2 -0
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.d.ts +21 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +71 -13
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +4 -4
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +3 -3
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +2 -2
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +2 -2
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +4 -4
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +7 -7
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -2
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +1 -1
- package/dist/astryx.css +124 -62
- package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
- package/dist/hooks/containerReveal.stylex.js +18 -18
- package/dist/hooks/scrollbarGutter.d.ts +28 -0
- package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
- package/dist/hooks/scrollbarGutter.js +103 -0
- package/dist/hooks/useAutoMediaMode.d.ts +31 -0
- package/dist/hooks/useAutoMediaMode.d.ts.map +1 -0
- package/dist/hooks/useAutoMediaMode.js +201 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +1 -1
- package/dist/hooks/useListFocus.d.ts +5 -2
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +12 -6
- package/dist/hooks/useScrollLock.d.ts +4 -0
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +13 -1
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +2 -0
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +6 -0
- package/dist/i18n/useCollator.d.ts +12 -0
- package/dist/i18n/useCollator.d.ts.map +1 -0
- package/dist/i18n/useCollator.js +40 -0
- package/dist/i18n/useLocale.d.ts +3 -0
- package/dist/i18n/useLocale.d.ts.map +1 -0
- package/dist/i18n/useLocale.js +31 -0
- package/dist/theme/MediaTheme.d.ts +25 -5
- package/dist/theme/MediaTheme.d.ts.map +1 -1
- package/dist/theme/MediaTheme.js +31 -6
- package/dist/theme/defineTheme.d.ts +5 -0
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +5 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +7 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +66 -5
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/syntax/index.d.ts +6 -0
- package/dist/theme/syntax/index.d.ts.map +1 -1
- package/dist/theme/syntax/index.js +7 -2
- package/dist/utils/dateParser.d.ts +4 -3
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +8 -8
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/plainDate.d.ts +5 -2
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +20 -4
- package/locales/en.json +28 -0
- package/locales/pseudo.json +21 -0
- package/package.json +3 -3
- package/src/Avatar/Avatar.doc.mjs +10 -6
- package/src/Avatar/Avatar.test.tsx +219 -1
- package/src/Avatar/Avatar.tsx +179 -37
- package/src/Avatar/AvatarStatusDot.tsx +30 -4
- package/src/Avatar/AvatarStatusLabelContext.ts +47 -0
- package/src/AvatarGroup/AvatarGroup.doc.mjs +10 -6
- package/src/AvatarGroup/AvatarGroup.test.tsx +62 -0
- package/src/AvatarGroup/AvatarGroup.tsx +3 -1
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +31 -8
- package/src/Banner/Banner.doc.mjs +2 -0
- package/src/Blockquote/Blockquote.doc.mjs +30 -7
- package/src/Blockquote/Blockquote.test.tsx +34 -3
- package/src/Blockquote/Blockquote.tsx +11 -9
- package/src/BottomSheet/BottomSheet.doc.mjs +3 -3
- package/src/BottomSheet/BottomSheet.test.tsx +24 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +91 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +58 -3
- package/src/Breadcrumbs/BreadcrumbItem.tsx +36 -23
- package/src/Breadcrumbs/Breadcrumbs.doc.mjs +26 -2
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +31 -0
- package/src/Button/Button.tsx +12 -9
- package/src/Calendar/Calendar.tsx +15 -9
- package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
- package/src/Calendar/styles.ts +8 -5
- package/src/Center/Center.doc.mjs +48 -0
- package/src/Center/Center.test.tsx +158 -0
- package/src/Center/Center.tsx +50 -9
- package/src/Chat/ChatComposer.tsx +11 -5
- package/src/Chat/ChatComposerDrawer.tsx +4 -1
- package/src/Chat/ChatToolCalls.tsx +13 -4
- package/src/Chat/{useChatDictation.test.ts → useChatDictation.test.tsx} +29 -14
- package/src/Chat/useChatDictation.ts +1 -1
- package/src/Chat/useSpeechRecognition.ts +5 -3
- package/src/Chat/useTriggerMenu.tsx +4 -1
- package/src/CheckboxInput/CheckboxInput.tsx +5 -2
- package/src/Citation/Citation.test.tsx +6 -1
- package/src/Citation/Citation.tsx +11 -5
- package/src/ClickableCard/ClickableCard.tsx +7 -4
- package/src/CodeBlock/CodeBlock.tsx +4 -1
- package/src/Collapsible/Collapsible.tsx +5 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +6 -3
- package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
- package/src/ComplexSelector/ComplexSelector.tsx +14 -7
- package/src/DateInput/DateInput.test.tsx +17 -1
- package/src/DateInput/DateInput.tsx +93 -21
- package/src/DateInput/DateInputTouch.test.tsx +2582 -0
- package/src/DateInput/MonthScroller.tsx +878 -0
- package/src/DateInput/MonthYearWheels.tsx +147 -0
- package/src/DateInput/TouchDateField.tsx +1223 -0
- package/src/DateInput/Wheel.tsx +473 -0
- package/src/DateInput/monthGeometry.ts +118 -0
- package/src/DateInput/tokens.stylex.ts +99 -0
- package/src/DateInput/useOwnScrollGesture.ts +227 -0
- package/src/DateInput/usePointerDragScroll.ts +220 -0
- package/src/DateInput/useScrollSettle.ts +164 -0
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- package/src/DateRangeInput/DateRangeInput.tsx +31 -13
- package/src/DateTimeInput/DateTimeInput.tsx +25 -9
- package/src/Dialog/Dialog.test.tsx +24 -0
- package/src/Dialog/Dialog.tsx +3 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +5 -2
- package/src/DropdownMenu/DropdownMenuItem.tsx +5 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +5 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +5 -2
- package/src/Field/Field.doc.mjs +2 -0
- package/src/Field/FieldLabel.tsx +9 -3
- package/src/Field/InputClearButton.test.tsx +110 -3
- package/src/Field/InputClearButton.tsx +38 -0
- package/src/Field/inputStyles.stylex.ts +17 -13
- package/src/FileInput/FileInput.tsx +15 -8
- package/src/FormLayout/FormLayout.doc.mjs +1 -1
- package/src/HoverCard/HoverCard.doc.mjs +18 -0
- package/src/HoverCard/HoverCard.test.tsx +189 -0
- package/src/HoverCard/HoverCard.tsx +22 -2
- package/src/HoverCard/index.ts +1 -0
- package/src/HoverCard/useHoverCard.doc.mjs +2 -0
- package/src/HoverCard/useHoverCard.tsx +103 -7
- package/src/InputGroup/InputGroup.tsx +1 -1
- package/src/Item/Item.doc.mjs +1 -0
- package/src/Item/Item.test.tsx +50 -0
- package/src/Item/Item.tsx +54 -6
- package/src/Layer/index.ts +10 -0
- package/src/Layer/useLayer.tsx +13 -2
- package/src/Layer/useTouchTrigger.test.ts +70 -0
- package/src/Layer/useTouchTrigger.ts +366 -0
- package/src/Layout/Layout.doc.mjs +18 -0
- package/src/Layout/container.stylex.ts +11 -3
- package/src/Layout/index.ts +4 -0
- package/src/Layout/overlayPaddingReset.test.tsx +222 -0
- package/src/Layout/padding.stylex.ts +192 -12
- package/src/Lightbox/Lightbox.tsx +11 -3
- package/src/Link/Link.tsx +9 -6
- package/src/MetadataList/MetadataList.tsx +4 -1
- package/src/MobileNav/MobileNav.tsx +61 -5
- package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
- package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
- package/src/MultiSelector/MultiSelector.test.tsx +1 -1
- package/src/MultiSelector/MultiSelector.tsx +26 -10
- package/src/NavItem/navItemStyles.stylex.ts +7 -4
- package/src/NavMenu/NavHeadingMenuItem.tsx +6 -3
- package/src/NumberInput/NumberInput.doc.mjs +24 -0
- package/src/NumberInput/NumberInput.test.tsx +138 -0
- package/src/NumberInput/NumberInput.tsx +47 -8
- package/src/Outline/Outline.tsx +5 -2
- package/src/Pagination/Pagination.tsx +5 -2
- package/src/Popover/Popover.test.tsx +27 -1
- package/src/PowerSearch/PowerSearch.tsx +17 -8
- package/src/PowerSearch/PowerSearchToken.tsx +3 -0
- package/src/PowerSearch/formatFilterValue.test.ts +22 -2
- package/src/PowerSearch/formatFilterValue.ts +31 -6
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/RadioList/RadioList.test.tsx +170 -2
- package/src/RadioList/RadioListItem.tsx +88 -53
- package/src/Resizable/ResizeHandle.test.tsx +22 -0
- package/src/Resizable/ResizeHandle.tsx +25 -7
- package/src/Section/Section.doc.mjs +55 -0
- package/src/Section/Section.test.tsx +201 -4
- package/src/Section/Section.tsx +69 -0
- package/src/SegmentedControl/SegmentedControl.test.tsx +31 -0
- package/src/SegmentedControl/SegmentedControlItem.tsx +15 -3
- package/src/SelectableCard/SelectableCard.tsx +6 -3
- package/src/Selector/Selector.doc.mjs +16 -2
- package/src/Selector/Selector.test.tsx +525 -1
- package/src/Selector/Selector.tsx +180 -25
- package/src/Selector/SelectorOption.doc.mjs +7 -0
- package/src/Selector/SelectorOption.tsx +21 -0
- package/src/Selector/SelectorRowLayoutContext.ts +32 -0
- package/src/Selector/types.ts +4 -4
- package/src/SideNav/SideNavHeading.tsx +14 -5
- package/src/SideNav/SideNavItem.tsx +9 -3
- package/src/Slider/Slider.tsx +25 -6
- package/src/Stack/Stack.doc.mjs +72 -0
- package/src/Stack/Stack.test.tsx +156 -0
- package/src/Stack/Stack.tsx +50 -8
- package/src/Switch/Switch.tsx +5 -2
- package/src/TabList/Tab.tsx +4 -1
- package/src/TabList/TabMenu.tsx +9 -3
- package/src/Table/TableRow.tsx +4 -4
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +6 -2
- package/src/Table/plugins/filtering/useTableFiltering.tsx +4 -1
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +10 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +6 -3
- package/src/Table/plugins/sortable/useTableSortable.tsx +4 -1
- package/src/Table/plugins/sortable/useTableSortableState.test.tsx +34 -0
- package/src/Table/plugins/sortable/useTableSortableState.tsx +26 -23
- package/src/Table/plugins/tree/useTableTreeData.tsx +10 -4
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextArea/TextArea.tsx +1 -1
- package/src/TextInput/TextInput.tsx +1 -1
- package/src/Thumbnail/Thumbnail.tsx +9 -3
- package/src/TimeInput/TimeInput.tsx +1 -1
- package/src/Timestamp/Timestamp.test.tsx +27 -7
- package/src/Timestamp/Timestamp.tsx +8 -4
- package/src/Timestamp/formatInstant.ts +9 -7
- package/src/Timestamp/tooltipEntries.test.ts +11 -6
- package/src/Timestamp/tooltipEntries.ts +6 -2
- package/src/Toast/Toast.tsx +9 -7
- package/src/Token/Token.tsx +14 -5
- package/src/Tokenizer/Tokenizer.tsx +4 -1
- package/src/Tooltip/Tooltip.doc.mjs +18 -0
- package/src/Tooltip/Tooltip.test.tsx +254 -1
- package/src/Tooltip/Tooltip.tsx +22 -2
- package/src/Tooltip/index.ts +1 -0
- package/src/Tooltip/useTooltip.doc.mjs +2 -0
- package/src/Tooltip/useTooltip.tsx +99 -21
- package/src/TopNav/TopNavHeading.tsx +13 -4
- package/src/TopNav/TopNavItem.tsx +6 -3
- package/src/TopNav/TopNavMegaMenu.tsx +5 -2
- package/src/TopNav/TopNavMegaMenuItem.tsx +5 -2
- package/src/TopNav/TopNavMenu.tsx +10 -4
- package/src/TreeList/TreeListItem.tsx +22 -7
- package/src/Typeahead/BaseTypeahead.tsx +5 -2
- package/src/Typeahead/Typeahead.tsx +4 -1
- package/src/hooks/containerReveal.stylex.ts +54 -18
- package/src/hooks/scrollbarGutter.test.ts +167 -0
- package/src/hooks/scrollbarGutter.ts +121 -0
- package/src/hooks/useAutoMediaMode.test.ts +109 -0
- package/src/hooks/useAutoMediaMode.ts +233 -0
- package/src/hooks/useInputStatusIcon.tsx +4 -1
- package/src/hooks/useListFocus.doc.mjs +2 -2
- package/src/hooks/useListFocus.test.tsx +65 -3
- package/src/hooks/useListFocus.ts +15 -7
- package/src/hooks/useScrollLock.doc.mjs +4 -4
- package/src/hooks/useScrollLock.test.ts +73 -0
- package/src/hooks/useScrollLock.ts +14 -0
- package/src/i18n/InternationalizationContext.ts +2 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +37 -1
- package/src/i18n/__tests__/useCollator.test.tsx +115 -0
- package/src/i18n/__tests__/useLocale.test.tsx +52 -0
- package/src/i18n/index.ts +6 -0
- package/src/i18n/useCollator.doc.mjs +84 -0
- package/src/i18n/useCollator.ts +44 -0
- package/src/i18n/useLocale.doc.mjs +70 -0
- package/src/i18n/useLocale.ts +34 -0
- package/src/i18n/useTranslator.doc.mjs +1 -1
- package/src/reset.css +9 -2
- package/src/reset.test.ts +22 -0
- package/src/theme/MediaTheme.doc.mjs +23 -4
- package/src/theme/MediaTheme.dom.test.tsx +97 -0
- package/src/theme/MediaTheme.tsx +42 -7
- package/src/theme/defineTheme.test.ts +9 -3
- package/src/theme/defineTheme.ts +5 -0
- package/src/theme/derivedVarRegistry.test.ts +19 -5
- package/src/theme/derivedVarRegistry.ts +4 -0
- package/src/theme/generateThemeRules.test.ts +118 -0
- package/src/theme/generateThemeRules.ts +83 -5
- package/src/theme/index.ts +1 -1
- package/src/theme/syntax/index.ts +6 -2
- package/src/theme/syntax/serverSafeSyntax.test.ts +68 -0
- package/src/utils/dateParser.test.ts +20 -0
- package/src/utils/dateParser.ts +14 -7
- package/src/utils/index.ts +2 -0
- package/src/utils/plainDate.test.ts +6 -0
- package/src/utils/plainDate.ts +21 -4
|
@@ -63,7 +63,10 @@ const styles = stylex.create({
|
|
|
63
63
|
cursor: 'default',
|
|
64
64
|
},
|
|
65
65
|
interactive: {
|
|
66
|
-
cursor:
|
|
66
|
+
cursor: {
|
|
67
|
+
default: 'pointer',
|
|
68
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
69
|
+
},
|
|
67
70
|
borderRadius: radiusVars['--radius-element'],
|
|
68
71
|
borderWidth: 0,
|
|
69
72
|
borderStyle: 'none',
|
|
@@ -72,14 +75,17 @@ const styles = stylex.create({
|
|
|
72
75
|
fontSize: 'inherit',
|
|
73
76
|
fontWeight: fontWeightVars['--font-weight-normal'],
|
|
74
77
|
textAlign: 'start',
|
|
75
|
-
':hover': {
|
|
78
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
76
79
|
'@media (hover: hover)': {
|
|
77
80
|
backgroundColor: colorVars['--color-overlay-hover'],
|
|
78
81
|
},
|
|
79
82
|
},
|
|
80
83
|
},
|
|
81
84
|
menuTrigger: {
|
|
82
|
-
cursor:
|
|
85
|
+
cursor: {
|
|
86
|
+
default: 'pointer',
|
|
87
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
88
|
+
},
|
|
83
89
|
borderRadius: radiusVars['--radius-element'],
|
|
84
90
|
borderWidth: 0,
|
|
85
91
|
borderStyle: 'none',
|
|
@@ -190,7 +196,10 @@ const styles = stylex.create({
|
|
|
190
196
|
marginBlockStart: spacingVars['--spacing-1'],
|
|
191
197
|
marginBlockEnd: spacingVars['--spacing-2'],
|
|
192
198
|
marginInline: spacingVars['--spacing-1'],
|
|
193
|
-
cursor:
|
|
199
|
+
cursor: {
|
|
200
|
+
default: 'pointer',
|
|
201
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
202
|
+
},
|
|
194
203
|
},
|
|
195
204
|
// Composes over `chevron` — the flipped popover copy differs only by the
|
|
196
205
|
// rotation, so it carries just that.
|
|
@@ -53,13 +53,16 @@ const styles = stylex.create({
|
|
|
53
53
|
fontWeight: fontWeightVars['--font-weight-medium'],
|
|
54
54
|
color: colorVars['--color-text-secondary'],
|
|
55
55
|
textDecoration: 'none',
|
|
56
|
-
cursor:
|
|
56
|
+
cursor: {
|
|
57
|
+
default: 'pointer',
|
|
58
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
59
|
+
},
|
|
57
60
|
transitionProperty: 'background-color, color',
|
|
58
61
|
transitionDuration: durationVars['--duration-fast'],
|
|
59
62
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
60
63
|
backgroundColor: {
|
|
61
64
|
default: 'transparent',
|
|
62
|
-
':hover': {
|
|
65
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
63
66
|
'@media (hover: hover)': colorVars['--color-overlay-hover'],
|
|
64
67
|
},
|
|
65
68
|
':active': colorVars['--color-overlay-pressed'],
|
|
@@ -70,7 +73,7 @@ const styles = stylex.create({
|
|
|
70
73
|
fontWeight: fontWeightVars['--font-weight-semibold'],
|
|
71
74
|
backgroundColor: {
|
|
72
75
|
default: colorVars['--color-neutral'],
|
|
73
|
-
':hover': {
|
|
76
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
74
77
|
'@media (hover: hover)': colorVars['--color-neutral'],
|
|
75
78
|
},
|
|
76
79
|
':active': colorVars['--color-neutral'],
|
|
@@ -78,13 +78,16 @@ const styles = stylex.create({
|
|
|
78
78
|
fontWeight: fontWeightVars['--font-weight-medium'],
|
|
79
79
|
color: colorVars['--color-text-secondary'],
|
|
80
80
|
textDecoration: 'none',
|
|
81
|
-
cursor:
|
|
81
|
+
cursor: {
|
|
82
|
+
default: 'pointer',
|
|
83
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
84
|
+
},
|
|
82
85
|
transitionProperty: 'background-color, color',
|
|
83
86
|
transitionDuration: durationVars['--duration-fast'],
|
|
84
87
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
85
88
|
backgroundColor: {
|
|
86
89
|
default: 'transparent',
|
|
87
|
-
':hover': {
|
|
90
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
88
91
|
'@media (hover: hover)': colorVars['--color-overlay-hover'],
|
|
89
92
|
},
|
|
90
93
|
},
|
|
@@ -50,13 +50,16 @@ const styles = stylex.create({
|
|
|
50
50
|
paddingInline: spacingVars['--spacing-3'],
|
|
51
51
|
borderRadius: radiusVars['--radius-element'],
|
|
52
52
|
textDecoration: 'none',
|
|
53
|
-
cursor:
|
|
53
|
+
cursor: {
|
|
54
|
+
default: 'pointer',
|
|
55
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
56
|
+
},
|
|
54
57
|
transitionProperty: 'background-color',
|
|
55
58
|
transitionDuration: durationVars['--duration-fast'],
|
|
56
59
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
57
60
|
backgroundColor: {
|
|
58
61
|
default: 'transparent',
|
|
59
|
-
':hover': {
|
|
62
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
60
63
|
'@media (hover: hover)': colorVars['--color-overlay-hover'],
|
|
61
64
|
},
|
|
62
65
|
':active': colorVars['--color-overlay-pressed'],
|
|
@@ -65,13 +65,16 @@ const styles = stylex.create({
|
|
|
65
65
|
fontWeight: fontWeightVars['--font-weight-medium'],
|
|
66
66
|
color: colorVars['--color-text-secondary'],
|
|
67
67
|
textDecoration: 'none',
|
|
68
|
-
cursor:
|
|
68
|
+
cursor: {
|
|
69
|
+
default: 'pointer',
|
|
70
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
71
|
+
},
|
|
69
72
|
transitionProperty: 'background-color, color',
|
|
70
73
|
transitionDuration: durationVars['--duration-fast'],
|
|
71
74
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
72
75
|
backgroundColor: {
|
|
73
76
|
default: 'transparent',
|
|
74
|
-
':hover': {
|
|
77
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
75
78
|
'@media (hover: hover)': colorVars['--color-overlay-hover'],
|
|
76
79
|
},
|
|
77
80
|
},
|
|
@@ -115,13 +118,16 @@ const styles = stylex.create({
|
|
|
115
118
|
paddingInline: spacingVars['--spacing-3'],
|
|
116
119
|
borderRadius: radiusVars['--radius-element'],
|
|
117
120
|
textDecoration: 'none',
|
|
118
|
-
cursor:
|
|
121
|
+
cursor: {
|
|
122
|
+
default: 'pointer',
|
|
123
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
124
|
+
},
|
|
119
125
|
transitionProperty: 'background-color',
|
|
120
126
|
transitionDuration: durationVars['--duration-fast'],
|
|
121
127
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
122
128
|
backgroundColor: {
|
|
123
129
|
default: 'transparent',
|
|
124
|
-
':hover': {
|
|
130
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
125
131
|
'@media (hover: hover)': colorVars['--color-overlay-hover'],
|
|
126
132
|
},
|
|
127
133
|
},
|
|
@@ -95,20 +95,23 @@ const styles = stylex.create({
|
|
|
95
95
|
marginInlineStart: 'var(--_tree-indent, 0px)',
|
|
96
96
|
},
|
|
97
97
|
interactive: {
|
|
98
|
-
cursor:
|
|
98
|
+
cursor: {
|
|
99
|
+
default: 'pointer',
|
|
100
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
101
|
+
},
|
|
99
102
|
transitionProperty: 'background-image',
|
|
100
103
|
transitionDuration: durationVars['--duration-fast'],
|
|
101
104
|
transitionTimingFunction: easeVars['--ease-standard'],
|
|
102
105
|
backgroundImage: {
|
|
103
106
|
default: null,
|
|
104
|
-
':hover': {
|
|
107
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
105
108
|
'@media (hover: hover)': `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`,
|
|
106
109
|
},
|
|
107
110
|
':active': `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`,
|
|
108
111
|
},
|
|
109
112
|
},
|
|
110
113
|
disabled: {
|
|
111
|
-
cursor: '
|
|
114
|
+
cursor: 'default',
|
|
112
115
|
opacity: 0.5,
|
|
113
116
|
pointerEvents: 'none' as const,
|
|
114
117
|
},
|
|
@@ -117,7 +120,10 @@ const styles = stylex.create({
|
|
|
117
120
|
},
|
|
118
121
|
invisibleButton: {
|
|
119
122
|
all: 'unset',
|
|
120
|
-
cursor:
|
|
123
|
+
cursor: {
|
|
124
|
+
default: 'inherit',
|
|
125
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
126
|
+
},
|
|
121
127
|
font: 'inherit',
|
|
122
128
|
color: 'inherit',
|
|
123
129
|
display: 'flex',
|
|
@@ -130,7 +136,10 @@ const styles = stylex.create({
|
|
|
130
136
|
},
|
|
131
137
|
invisibleAnchor: {
|
|
132
138
|
all: 'unset',
|
|
133
|
-
cursor:
|
|
139
|
+
cursor: {
|
|
140
|
+
default: 'inherit',
|
|
141
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
142
|
+
},
|
|
134
143
|
font: 'inherit',
|
|
135
144
|
color: 'inherit',
|
|
136
145
|
display: 'flex',
|
|
@@ -174,7 +183,10 @@ const styles = stylex.create({
|
|
|
174
183
|
width: spacingVars['--spacing-4'],
|
|
175
184
|
height: spacingVars['--spacing-4'],
|
|
176
185
|
fontSize: spacingVars['--spacing-4'],
|
|
177
|
-
cursor:
|
|
186
|
+
cursor: {
|
|
187
|
+
default: 'pointer',
|
|
188
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
189
|
+
},
|
|
178
190
|
border: 'none',
|
|
179
191
|
background: 'none',
|
|
180
192
|
padding: 0,
|
|
@@ -191,7 +203,10 @@ const styles = stylex.create({
|
|
|
191
203
|
width: spacingVars['--spacing-4'],
|
|
192
204
|
height: spacingVars['--spacing-4'],
|
|
193
205
|
fontSize: spacingVars['--spacing-4'],
|
|
194
|
-
cursor:
|
|
206
|
+
cursor: {
|
|
207
|
+
default: 'pointer',
|
|
208
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
209
|
+
},
|
|
195
210
|
color: colorVars['--color-icon-secondary'],
|
|
196
211
|
borderRadius: radiusVars['--radius-inner'],
|
|
197
212
|
marginInlineStart: spacingVars['--spacing-1'],
|
|
@@ -215,7 +215,7 @@ const styles = stylex.create({
|
|
|
215
215
|
},
|
|
216
216
|
},
|
|
217
217
|
inputDisabled: {
|
|
218
|
-
cursor: '
|
|
218
|
+
cursor: 'default',
|
|
219
219
|
},
|
|
220
220
|
dropdown: {
|
|
221
221
|
boxSizing: 'border-box',
|
|
@@ -233,7 +233,10 @@ const styles = stylex.create({
|
|
|
233
233
|
width: '100%',
|
|
234
234
|
padding: spacingVars['--spacing-2'],
|
|
235
235
|
borderRadius: radiusVars['--radius-element'],
|
|
236
|
-
cursor:
|
|
236
|
+
cursor: {
|
|
237
|
+
default: 'pointer',
|
|
238
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
239
|
+
},
|
|
237
240
|
outline: 'none',
|
|
238
241
|
backgroundColor: 'transparent',
|
|
239
242
|
border: 'none',
|
|
@@ -167,7 +167,10 @@ const styles = stylex.create({
|
|
|
167
167
|
// Standard padding minus border width to prevent height jump
|
|
168
168
|
// when a token (28px) is added inside the input
|
|
169
169
|
paddingBlock: `calc(${spacingVars['--spacing-1']} - 1px)`,
|
|
170
|
-
cursor:
|
|
170
|
+
cursor: {
|
|
171
|
+
default: 'text',
|
|
172
|
+
':is(:disabled,[aria-disabled="true"])': 'default',
|
|
173
|
+
},
|
|
171
174
|
},
|
|
172
175
|
token: {
|
|
173
176
|
// Offset token so it sits 3px from the inner edge (4px from outer edge
|
|
@@ -32,13 +32,17 @@ export const styles = stylex.create({
|
|
|
32
32
|
'--_hover-delay': '0s',
|
|
33
33
|
'--_reveal-opacity': {
|
|
34
34
|
default: 0,
|
|
35
|
-
':hover
|
|
35
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
36
|
+
'@media (hover: hover)': 1,
|
|
37
|
+
},
|
|
36
38
|
':focus-within': 1,
|
|
37
39
|
'@media (any-pointer: coarse)': 1,
|
|
38
40
|
},
|
|
39
41
|
'--_reveal-position': {
|
|
40
42
|
default: 'absolute',
|
|
41
|
-
':hover
|
|
43
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
44
|
+
'@media (hover: hover)': 'static',
|
|
45
|
+
},
|
|
42
46
|
':focus-within': 'static',
|
|
43
47
|
'@media (any-pointer: coarse)': 'static',
|
|
44
48
|
},
|
|
@@ -49,7 +53,9 @@ export const styles = stylex.create({
|
|
|
49
53
|
// content would snap out of flow at full opacity and flicker.
|
|
50
54
|
'--_reveal-delay': {
|
|
51
55
|
default: REST_DELAY,
|
|
52
|
-
':hover
|
|
56
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
57
|
+
'@media (hover: hover)': HOVER_DELAY + ', ' + HOVER_DELAY,
|
|
58
|
+
},
|
|
53
59
|
':focus-within': '0s, 0s',
|
|
54
60
|
'@media (any-pointer: coarse)': '0s, 0s',
|
|
55
61
|
},
|
|
@@ -57,7 +63,9 @@ export const styles = stylex.create({
|
|
|
57
63
|
// for) but keeps the dwell: an intent gate is timing, not motion.
|
|
58
64
|
'--_reveal-delay-reduced': {
|
|
59
65
|
default: '0s, 0s',
|
|
60
|
-
':hover
|
|
66
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
67
|
+
'@media (hover: hover)': HOVER_DELAY + ', ' + HOVER_DELAY,
|
|
68
|
+
},
|
|
61
69
|
':focus-within': '0s, 0s',
|
|
62
70
|
'@media (any-pointer: coarse)': '0s, 0s',
|
|
63
71
|
},
|
|
@@ -66,13 +74,17 @@ export const styles = stylex.create({
|
|
|
66
74
|
// coarse-pointer branch (it stays visible on touch).
|
|
67
75
|
'--_conceal-opacity': {
|
|
68
76
|
default: 1,
|
|
69
|
-
':hover
|
|
77
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
78
|
+
'@media (hover: hover)': 0,
|
|
79
|
+
},
|
|
70
80
|
},
|
|
71
81
|
// Single-value dwell for the opacity-only blocks, which have no discrete
|
|
72
82
|
// position to sequence.
|
|
73
83
|
'--_fade-delay': {
|
|
74
84
|
default: '0s',
|
|
75
|
-
':hover
|
|
85
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
86
|
+
'@media (hover: hover)': HOVER_DELAY,
|
|
87
|
+
},
|
|
76
88
|
':focus-within': '0s',
|
|
77
89
|
'@media (any-pointer: coarse)': '0s',
|
|
78
90
|
},
|
|
@@ -87,35 +99,47 @@ export const styles = stylex.create({
|
|
|
87
99
|
stateInactive: {
|
|
88
100
|
'--_reveal-opacity': {
|
|
89
101
|
default: 0,
|
|
90
|
-
':hover
|
|
102
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
103
|
+
'@media (hover: hover)': 0,
|
|
104
|
+
},
|
|
91
105
|
':focus-within': 1,
|
|
92
106
|
'@media (any-pointer: coarse)': 1,
|
|
93
107
|
},
|
|
94
108
|
'--_reveal-position': {
|
|
95
109
|
default: 'absolute',
|
|
96
|
-
':hover
|
|
110
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
111
|
+
'@media (hover: hover)': 'absolute',
|
|
112
|
+
},
|
|
97
113
|
':focus-within': 'static',
|
|
98
114
|
'@media (any-pointer: coarse)': 'static',
|
|
99
115
|
},
|
|
100
116
|
'--_reveal-delay': {
|
|
101
117
|
default: REST_DELAY,
|
|
102
|
-
':hover
|
|
118
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
119
|
+
'@media (hover: hover)': REST_DELAY,
|
|
120
|
+
},
|
|
103
121
|
':focus-within': '0s, 0s',
|
|
104
122
|
'@media (any-pointer: coarse)': '0s, 0s',
|
|
105
123
|
},
|
|
106
124
|
'--_reveal-delay-reduced': {
|
|
107
125
|
default: '0s, 0s',
|
|
108
|
-
':hover
|
|
126
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
127
|
+
'@media (hover: hover)': '0s, 0s',
|
|
128
|
+
},
|
|
109
129
|
':focus-within': '0s, 0s',
|
|
110
130
|
'@media (any-pointer: coarse)': '0s, 0s',
|
|
111
131
|
},
|
|
112
132
|
'--_conceal-opacity': {
|
|
113
133
|
default: 1,
|
|
114
|
-
':hover
|
|
134
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
135
|
+
'@media (hover: hover)': 1,
|
|
136
|
+
},
|
|
115
137
|
},
|
|
116
138
|
'--_fade-delay': {
|
|
117
139
|
default: '0s',
|
|
118
|
-
':hover
|
|
140
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
141
|
+
'@media (hover: hover)': '0s',
|
|
142
|
+
},
|
|
119
143
|
':focus-within': '0s',
|
|
120
144
|
'@media (any-pointer: coarse)': '0s',
|
|
121
145
|
},
|
|
@@ -126,35 +150,47 @@ export const styles = stylex.create({
|
|
|
126
150
|
stateActive: {
|
|
127
151
|
'--_reveal-opacity': {
|
|
128
152
|
default: 1,
|
|
129
|
-
':hover
|
|
153
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
154
|
+
'@media (hover: hover)': 1,
|
|
155
|
+
},
|
|
130
156
|
':focus-within': 1,
|
|
131
157
|
'@media (any-pointer: coarse)': 1,
|
|
132
158
|
},
|
|
133
159
|
'--_reveal-position': {
|
|
134
160
|
default: 'static',
|
|
135
|
-
':hover
|
|
161
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
162
|
+
'@media (hover: hover)': 'static',
|
|
163
|
+
},
|
|
136
164
|
':focus-within': 'static',
|
|
137
165
|
'@media (any-pointer: coarse)': 'static',
|
|
138
166
|
},
|
|
139
167
|
'--_reveal-delay': {
|
|
140
168
|
default: '0s, 0s',
|
|
141
|
-
':hover
|
|
169
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
170
|
+
'@media (hover: hover)': '0s, 0s',
|
|
171
|
+
},
|
|
142
172
|
':focus-within': '0s, 0s',
|
|
143
173
|
'@media (any-pointer: coarse)': '0s, 0s',
|
|
144
174
|
},
|
|
145
175
|
'--_reveal-delay-reduced': {
|
|
146
176
|
default: '0s, 0s',
|
|
147
|
-
':hover
|
|
177
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
178
|
+
'@media (hover: hover)': '0s, 0s',
|
|
179
|
+
},
|
|
148
180
|
':focus-within': '0s, 0s',
|
|
149
181
|
'@media (any-pointer: coarse)': '0s, 0s',
|
|
150
182
|
},
|
|
151
183
|
'--_conceal-opacity': {
|
|
152
184
|
default: 0,
|
|
153
|
-
':hover
|
|
185
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
186
|
+
'@media (hover: hover)': 0,
|
|
187
|
+
},
|
|
154
188
|
},
|
|
155
189
|
'--_fade-delay': {
|
|
156
190
|
default: '0s',
|
|
157
|
-
':hover
|
|
191
|
+
':hover:where(:not(:disabled,[aria-disabled="true"]))': {
|
|
192
|
+
'@media (hover: hover)': '0s',
|
|
193
|
+
},
|
|
158
194
|
':focus-within': '0s',
|
|
159
195
|
'@media (any-pointer: coarse)': '0s',
|
|
160
196
|
},
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file scrollbarGutter.test.ts
|
|
5
|
+
* @input Uses vitest and a stubbed viewport + element box (jsdom does no layout)
|
|
6
|
+
* @output Unit tests for holdScrollbarGutter
|
|
7
|
+
* @position Testing; validates scrollbarGutter.ts implementation
|
|
8
|
+
*
|
|
9
|
+
* SYNC: When scrollbarGutter.ts changes, update tests to match new behavior
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import {afterEach, describe, expect, it} from 'vitest';
|
|
13
|
+
import {holdScrollbarGutter} from './scrollbarGutter';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* jsdom does no layout, so both halves of the measurement are stubbed: the
|
|
17
|
+
* viewport (`innerWidth` vs `documentElement.clientWidth`) and the element's
|
|
18
|
+
* own box, which `widths` reads from and a test flips to simulate the lock
|
|
19
|
+
* widening it.
|
|
20
|
+
*/
|
|
21
|
+
function stub({
|
|
22
|
+
innerWidth,
|
|
23
|
+
clientWidth,
|
|
24
|
+
widths,
|
|
25
|
+
}: {
|
|
26
|
+
innerWidth: number;
|
|
27
|
+
clientWidth: number;
|
|
28
|
+
widths?: () => number;
|
|
29
|
+
}) {
|
|
30
|
+
Object.defineProperty(window, 'innerWidth', {
|
|
31
|
+
value: innerWidth,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(document.documentElement, 'clientWidth', {
|
|
36
|
+
value: clientWidth,
|
|
37
|
+
configurable: true,
|
|
38
|
+
});
|
|
39
|
+
if (widths) {
|
|
40
|
+
document.body.getBoundingClientRect = () => ({width: widths()}) as DOMRect;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const rootGutter = () => document.documentElement.style.scrollbarGutter;
|
|
45
|
+
|
|
46
|
+
describe('holdScrollbarGutter', () => {
|
|
47
|
+
afterEach(() => {
|
|
48
|
+
document.body.style.cssText = '';
|
|
49
|
+
document.documentElement.style.cssText = '';
|
|
50
|
+
// @ts-expect-error -- drop the stubs so jsdom's own values come back
|
|
51
|
+
delete document.documentElement.clientWidth;
|
|
52
|
+
// @ts-expect-error -- restore the prototype's implementation
|
|
53
|
+
delete document.body.getBoundingClientRect;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it('holds the gutter open when a space-taking scrollbar is about to be hidden', () => {
|
|
57
|
+
// A 1024px window over a 1009px layout viewport = a 15px classic scrollbar.
|
|
58
|
+
stub({innerWidth: 1024, clientWidth: 1009});
|
|
59
|
+
|
|
60
|
+
const hold = holdScrollbarGutter(document.body);
|
|
61
|
+
|
|
62
|
+
expect(rootGutter()).toBe('stable');
|
|
63
|
+
|
|
64
|
+
hold.settle();
|
|
65
|
+
hold.release();
|
|
66
|
+
|
|
67
|
+
expect(rootGutter()).toBe('');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('leaves an overlay scrollbar alone — there is no gutter to hold', () => {
|
|
71
|
+
stub({innerWidth: 1024, clientWidth: 1024});
|
|
72
|
+
|
|
73
|
+
const hold = holdScrollbarGutter(document.body);
|
|
74
|
+
hold.settle();
|
|
75
|
+
|
|
76
|
+
expect(rootGutter()).toBe('');
|
|
77
|
+
expect(document.body.style.paddingRight).toBe('');
|
|
78
|
+
|
|
79
|
+
hold.release();
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('does not pad when holding the gutter kept the element still', () => {
|
|
83
|
+
stub({innerWidth: 1024, clientWidth: 1009, widths: () => 1009});
|
|
84
|
+
|
|
85
|
+
const hold = holdScrollbarGutter(document.body);
|
|
86
|
+
hold.settle();
|
|
87
|
+
|
|
88
|
+
expect(rootGutter()).toBe('stable');
|
|
89
|
+
expect(document.body.style.paddingRight).toBe('');
|
|
90
|
+
|
|
91
|
+
hold.release();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('falls back to padding when the element grew anyway', () => {
|
|
95
|
+
// What an engine without scrollbar-gutter support does: the gutter request
|
|
96
|
+
// is ignored, the scrollbar goes away, and the element widens by 15px.
|
|
97
|
+
let width = 1009;
|
|
98
|
+
stub({innerWidth: 1024, clientWidth: 1009, widths: () => width});
|
|
99
|
+
|
|
100
|
+
const hold = holdScrollbarGutter(document.body);
|
|
101
|
+
width = 1024;
|
|
102
|
+
hold.settle();
|
|
103
|
+
|
|
104
|
+
expect(document.body.style.paddingRight).toBe('15px');
|
|
105
|
+
|
|
106
|
+
hold.release();
|
|
107
|
+
|
|
108
|
+
expect(document.body.style.paddingRight).toBe('');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("adds to the page's own padding instead of replacing it", () => {
|
|
112
|
+
let width = 1009;
|
|
113
|
+
stub({innerWidth: 1024, clientWidth: 1009, widths: () => width});
|
|
114
|
+
document.body.style.paddingRight = '24px';
|
|
115
|
+
|
|
116
|
+
const hold = holdScrollbarGutter(document.body);
|
|
117
|
+
width = 1024;
|
|
118
|
+
hold.settle();
|
|
119
|
+
|
|
120
|
+
expect(document.body.style.paddingRight).toBe('39px');
|
|
121
|
+
|
|
122
|
+
hold.release();
|
|
123
|
+
|
|
124
|
+
expect(document.body.style.paddingRight).toBe('24px');
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('restores the page\u2019s own scrollbar-gutter rather than clearing it', () => {
|
|
128
|
+
stub({innerWidth: 1024, clientWidth: 1009});
|
|
129
|
+
document.documentElement.style.scrollbarGutter = 'stable both-edges';
|
|
130
|
+
|
|
131
|
+
const hold = holdScrollbarGutter(document.body);
|
|
132
|
+
|
|
133
|
+
expect(rootGutter()).toBe('stable');
|
|
134
|
+
|
|
135
|
+
hold.settle();
|
|
136
|
+
hold.release();
|
|
137
|
+
|
|
138
|
+
expect(rootGutter()).toBe('stable both-edges');
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('settles once, however many times it is called', () => {
|
|
142
|
+
let width = 1009;
|
|
143
|
+
stub({innerWidth: 1024, clientWidth: 1009, widths: () => width});
|
|
144
|
+
|
|
145
|
+
const hold = holdScrollbarGutter(document.body);
|
|
146
|
+
width = 1024;
|
|
147
|
+
hold.settle();
|
|
148
|
+
hold.settle();
|
|
149
|
+
hold.settle();
|
|
150
|
+
|
|
151
|
+
expect(document.body.style.paddingRight).toBe('15px');
|
|
152
|
+
|
|
153
|
+
hold.release();
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('does nothing where there is no layout to measure', () => {
|
|
157
|
+
stub({innerWidth: 1024, clientWidth: 0});
|
|
158
|
+
|
|
159
|
+
const hold = holdScrollbarGutter(document.body);
|
|
160
|
+
hold.settle();
|
|
161
|
+
|
|
162
|
+
expect(rootGutter()).toBe('');
|
|
163
|
+
expect(document.body.style.paddingRight).toBe('');
|
|
164
|
+
|
|
165
|
+
hold.release();
|
|
166
|
+
});
|
|
167
|
+
});
|