@astryxdesign/core 0.3.0 → 0.4.0-canary.3112e99
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 +3 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -17
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +21 -8
- package/dist/Breadcrumbs/index.d.ts +2 -1
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +1 -0
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +12 -16
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +2 -1
- package/dist/Calendar/styles.d.ts +0 -2
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +0 -2
- package/dist/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 +32 -31
- package/dist/ContextMenu/ContextMenu.d.ts +2 -2
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +1 -1
- package/dist/ContextMenu/index.d.ts +2 -1
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +1 -0
- package/dist/DateInput/DateInput.d.ts +9 -2
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +47 -33
- package/dist/DateRangeInput/DateRangeInput.d.ts +9 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +55 -32
- package/dist/DateTimeInput/DateTimeInput.d.ts +9 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +54 -30
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +4 -4
- package/dist/DropdownMenu/DropdownMenu.d.ts +33 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +62 -20
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +8 -11
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +32 -31
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts +25 -0
- package/dist/DropdownMenu/DropdownMenuDivider.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuDivider.js +66 -0
- package/dist/DropdownMenu/DropdownMenuItem.d.ts +15 -2
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +20 -8
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +10 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +5 -5
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +24 -67
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +2 -8
- package/dist/DropdownMenu/index.d.ts +2 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +4 -0
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +35 -27
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +9 -5
- package/dist/Field/InputClearButton.d.ts +16 -3
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +15 -4
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +21 -10
- 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 +177 -0
- package/dist/Indicator/types.d.ts.map +1 -0
- package/dist/Indicator/types.js +1 -0
- package/dist/Indicator/useIndicator.d.ts +18 -0
- package/dist/Indicator/useIndicator.d.ts.map +1 -0
- package/dist/Indicator/useIndicator.js +30 -0
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -8
- package/dist/Layer/useLayer.d.ts +14 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +25 -2
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +80 -103
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +4 -5
- package/dist/MobileNav/MobileNav.js +8 -8
- package/dist/MoreMenu/MoreMenu.d.ts +14 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -0
- package/dist/MultiSelector/MultiSelector.d.ts +8 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +119 -95
- package/dist/NumberInput/NumberInput.d.ts +27 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +230 -42
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +2 -3
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +61 -63
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +6 -8
- package/dist/Popover/usePopover.d.ts +15 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +14 -2
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +7 -0
- package/dist/ProgressBar/ProgressBar.d.ts +11 -4
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +95 -6
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +29 -84
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +2 -3
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -3
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +3 -11
- package/dist/Selector/Selector.d.ts +12 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +222 -111
- 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/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +2 -6
- package/dist/Stack/stack.stylex.d.ts +3 -3
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +14 -13
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -3
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +41 -19
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +8 -0
- package/dist/Table/TableRow.d.ts +1 -1
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +4 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +22 -18
- package/dist/Table/plugins/rowExpansion/index.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/index.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/index.js +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +41 -76
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +94 -345
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +23 -4
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +29 -33
- package/dist/Table/tableContextMenu.d.ts.map +1 -1
- package/dist/Table/tableContextMenu.js +2 -1
- package/dist/Table/types.d.ts +11 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/TextArea/TextArea.d.ts +10 -1
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +16 -6
- package/dist/TextInput/TextInput.d.ts +10 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +13 -19
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +32 -26
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +14 -17
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +14 -3
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +16 -34
- package/dist/Timestamp/formatInstant.d.ts +11 -1
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +3 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +20 -11
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +4 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +3 -19
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +6 -5
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +54 -16
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +3 -9
- package/dist/TopNav/TopNavMegaMenu.d.ts +7 -0
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +146 -60
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +22 -3
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +83 -38
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +13 -0
- package/dist/TreeList/TreeListBranches.d.ts +1 -1
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +14 -4
- package/dist/TreeList/TreeListItem.d.ts +11 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +57 -30
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +16 -8
- package/dist/astryx.css +84 -96
- package/dist/astryx.umd.js +56 -56
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/containerReveal.stylex.d.ts +61 -0
- package/dist/hooks/containerReveal.stylex.d.ts.map +1 -0
- package/dist/hooks/containerReveal.stylex.js +63 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/useClipboard.d.ts +59 -0
- package/dist/hooks/useClipboard.d.ts.map +1 -0
- package/dist/hooks/useClipboard.js +106 -0
- package/dist/hooks/useContainerReveal.d.ts +14 -8
- package/dist/hooks/useContainerReveal.d.ts.map +1 -1
- package/dist/hooks/useContainerReveal.js +28 -69
- package/dist/hooks/useIndicatorFocusRing.d.ts +28 -0
- package/dist/hooks/useIndicatorFocusRing.d.ts.map +1 -0
- package/dist/hooks/useIndicatorFocusRing.js +96 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +17 -4
- package/dist/hooks/useLongPress.d.ts.map +1 -1
- package/dist/hooks/useLongPress.js +12 -2
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +33 -18
- package/dist/hooks/useStreamingText.d.ts +18 -3
- package/dist/hooks/useStreamingText.d.ts.map +1 -1
- package/dist/hooks/useStreamingText.js +47 -7
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +9 -3
- package/dist/hooks/useTypeahead.d.ts +3 -2
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.js +19 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/theme/defineTheme.d.ts +18 -2
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +10 -1
- package/dist/theme/derivedVarRegistry.d.ts +8 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +14 -13
- package/dist/theme/expandColorScale.d.ts +3 -1
- package/dist/theme/expandColorScale.d.ts.map +1 -1
- package/dist/theme/expandColorScale.js +17 -7
- package/dist/theme/expandTypeScale.d.ts.map +1 -1
- package/dist/theme/expandTypeScale.js +17 -0
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +11 -0
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/tokens.stylex.d.ts +12 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +23 -0
- package/dist/utils/focusOutline.stylex.d.ts +122 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -0
- package/dist/utils/focusOutline.stylex.js +143 -0
- package/dist/utils/focusReturn.d.ts +24 -0
- package/dist/utils/focusReturn.d.ts.map +1 -0
- package/dist/utils/focusReturn.js +29 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -1
- package/dist/utils/mergeRefs.d.ts.map +1 -1
- package/dist/utils/mergeRefs.js +7 -5
- package/dist/utils/rtlStyles.d.ts +2 -2
- package/dist/utils/rtlStyles.js +2 -2
- package/dist/utils/themeProps.d.ts +20 -1
- package/dist/utils/themeProps.d.ts.map +1 -1
- package/dist/utils/themeProps.js +8 -2
- package/locales/en.json +52 -0
- package/locales/pseudo.json +39 -0
- package/package.json +8 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +16 -3
- package/src/AlertDialog/AlertDialog.test.tsx +208 -1
- package/src/AlertDialog/AlertDialog.tsx +21 -3
- package/src/AppShell/AppShell.doc.mjs +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.test.tsx +58 -1
- package/src/Banner/Banner.tsx +33 -11
- package/src/Breadcrumbs/BreadcrumbItem.tsx +16 -6
- package/src/Breadcrumbs/index.ts +5 -1
- package/src/Button/Button.doc.mjs +2 -2
- package/src/Button/Button.tsx +22 -41
- package/src/Calendar/Calendar.tsx +2 -1
- package/src/Calendar/styles.ts +0 -8
- package/src/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 +120 -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 +73 -0
- package/src/ComplexSelector/ComplexSelector.tsx +41 -28
- package/src/ContextMenu/ContextMenu.doc.mjs +1 -1
- package/src/ContextMenu/ContextMenu.test.tsx +41 -0
- package/src/ContextMenu/ContextMenu.tsx +3 -3
- package/src/ContextMenu/index.ts +5 -1
- package/src/DateInput/DateInput.doc.mjs +18 -3
- package/src/DateInput/DateInput.test.tsx +112 -11
- package/src/DateInput/DateInput.tsx +44 -25
- package/src/DateRangeInput/DateRangeInput.doc.mjs +10 -2
- package/src/DateRangeInput/DateRangeInput.test.tsx +110 -14
- package/src/DateRangeInput/DateRangeInput.tsx +27 -21
- package/src/DateTimeInput/DateTimeInput.doc.mjs +16 -2
- package/src/DateTimeInput/DateTimeInput.test.tsx +154 -1
- package/src/DateTimeInput/DateTimeInput.tsx +58 -17
- package/src/Dialog/Dialog.tsx +2 -9
- package/src/DropdownMenu/DropdownMenu.doc.mjs +5 -9
- package/src/DropdownMenu/DropdownMenu.test.tsx +534 -4
- package/src/DropdownMenu/DropdownMenu.tsx +113 -52
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +27 -30
- package/src/DropdownMenu/DropdownMenuDivider.doc.mjs +34 -0
- package/src/DropdownMenu/DropdownMenuDivider.tsx +81 -0
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +39 -4
- package/src/DropdownMenu/DropdownMenuItem.tsx +48 -10
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +2 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +30 -76
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +25 -19
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +44 -14
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +1 -5
- package/src/DropdownMenu/index.ts +8 -1
- package/src/DropdownMenu/renderDropdownItems.tsx +33 -34
- package/src/EmptyState/EmptyState.doc.mjs +4 -0
- package/src/EmptyState/EmptyState.test.tsx +62 -0
- package/src/EmptyState/EmptyState.tsx +16 -6
- package/src/Field/Field.doc.mjs +1 -0
- package/src/Field/InputClearButton.test.tsx +117 -0
- package/src/Field/InputClearButton.tsx +30 -3
- package/src/FileInput/FileInput.tsx +21 -8
- 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 +46 -0
- package/src/Indicator/indicator.markers.stylex.ts +19 -0
- package/src/Indicator/indicatorRegistry.test.tsx +106 -0
- package/src/Indicator/indicatorRegistry.ts +120 -0
- package/src/Indicator/types.ts +197 -0
- package/src/Indicator/useIndicator.ts +39 -0
- package/src/Item/Item.doc.mjs +1 -1
- package/src/Item/Item.tsx +7 -14
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Layer/useLayer.test.tsx +85 -0
- package/src/Layer/useLayer.tsx +39 -1
- package/src/Lightbox/Lightbox.doc.mjs +1 -1
- package/src/Lightbox/Lightbox.tsx +45 -49
- package/src/Link/Link.tsx +4 -11
- package/src/MobileNav/MobileNav.tsx +3 -3
- package/src/MoreMenu/MoreMenu.doc.mjs +31 -0
- package/src/MoreMenu/MoreMenu.test.tsx +68 -1
- package/src/MoreMenu/MoreMenu.tsx +19 -0
- package/src/MultiSelector/MultiSelector.doc.mjs +16 -1
- package/src/MultiSelector/MultiSelector.test.tsx +259 -16
- package/src/MultiSelector/MultiSelector.tsx +144 -121
- package/src/NumberInput/NumberInput.doc.mjs +265 -50
- package/src/NumberInput/NumberInput.test.tsx +726 -21
- package/src/NumberInput/NumberInput.tsx +353 -59
- package/src/Outline/Outline.tsx +2 -5
- package/src/Pagination/Pagination.doc.mjs +1 -1
- package/src/Pagination/Pagination.test.tsx +22 -7
- package/src/Pagination/Pagination.tsx +38 -35
- package/src/Popover/Popover.doc.mjs +2 -0
- package/src/Popover/Popover.tsx +6 -7
- package/src/Popover/usePopover.tsx +37 -4
- package/src/PowerSearch/PowerSearch.tsx +1 -1
- package/src/PowerSearch/PowerSearchEditPopover.test.tsx +42 -0
- package/src/PowerSearch/PowerSearchEditPopover.tsx +7 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +27 -5
- package/src/ProgressBar/ProgressBar.test.tsx +224 -1
- package/src/ProgressBar/ProgressBar.tsx +126 -30
- package/src/RadioList/RadioList.doc.mjs +4 -2
- package/src/RadioList/RadioListItem.tsx +31 -130
- package/src/Resizable/ResizeHandle.tsx +2 -9
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -9
- package/src/SelectableCard/SelectableCard.tsx +4 -9
- package/src/Selector/Selector.doc.mjs +15 -4
- package/src/Selector/Selector.test.tsx +1234 -98
- package/src/Selector/Selector.tsx +254 -126
- 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/Slider/Slider.tsx +2 -11
- package/src/Stack/Stack.doc.mjs +110 -0
- package/src/StatusDot/StatusDot.doc.mjs +12 -3
- package/src/Switch/Switch.test.tsx +32 -0
- package/src/Switch/Switch.tsx +18 -10
- package/src/TabList/Tab.tsx +2 -9
- package/src/TabList/TabMenu.tsx +14 -21
- package/src/Table/BaseTable.tsx +11 -0
- package/src/Table/Table.test.tsx +31 -0
- package/src/Table/TableRow.tsx +6 -0
- package/src/Table/index.ts +1 -4
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +30 -14
- package/src/Table/plugins/rowExpansion/index.ts +1 -4
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +125 -175
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +115 -458
- package/src/Table/plugins/sortable/useTableSortable.tsx +2 -6
- package/src/Table/plugins/tree/useTableTreeData.tsx +43 -24
- package/src/Table/tableContextMenu.test.tsx +27 -0
- package/src/Table/tableContextMenu.tsx +1 -0
- package/src/Table/types.ts +11 -0
- package/src/Table/useTableGroupedRows.doc.mjs +1 -1
- package/src/Table/useTableRowExpansion.doc.mjs +43 -66
- package/src/TextArea/TextArea.doc.mjs +42 -2
- package/src/TextArea/TextArea.test.tsx +219 -0
- package/src/TextArea/TextArea.tsx +34 -7
- package/src/TextInput/TextInput.doc.mjs +18 -2
- package/src/TextInput/TextInput.test.tsx +189 -0
- package/src/TextInput/TextInput.tsx +25 -31
- package/src/Thumbnail/Thumbnail.tsx +2 -9
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.test.tsx +84 -3
- package/src/TimeInput/TimeInput.tsx +26 -28
- package/src/Timestamp/Timestamp.doc.mjs +4 -3
- package/src/Timestamp/Timestamp.test.tsx +91 -14
- package/src/Timestamp/Timestamp.tsx +14 -2
- package/src/Timestamp/TimestampHoverCard.tsx +13 -35
- package/src/Timestamp/formatInstant.ts +16 -1
- package/src/Token/Token.tsx +5 -28
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.test.tsx +45 -3
- package/src/Tokenizer/Tokenizer.tsx +10 -2
- package/src/Tooltip/useTooltip.tsx +2 -23
- package/src/TopNav/TopNav.tsx +1 -3
- package/src/TopNav/TopNavHeading.tsx +42 -13
- package/src/TopNav/TopNavItem.tsx +3 -21
- package/src/TopNav/TopNavMegaMenu.doc.mjs +5 -0
- package/src/TopNav/TopNavMegaMenu.test.tsx +433 -33
- package/src/TopNav/TopNavMegaMenu.tsx +118 -53
- package/src/TopNav/TopNavMegaMenuItem.tsx +2 -9
- package/src/TopNav/TopNavMenu.tsx +34 -37
- package/src/TreeList/TreeList.doc.mjs +5 -0
- package/src/TreeList/TreeList.test.tsx +208 -8
- package/src/TreeList/TreeList.tsx +22 -0
- package/src/TreeList/TreeListBranches.tsx +25 -2
- package/src/TreeList/TreeListItem.tsx +89 -52
- package/src/Typeahead/BaseTypeahead.tsx +19 -6
- package/src/Typeahead/Typeahead.doc.mjs +1 -0
- package/src/Typeahead/Typeahead.test.tsx +76 -3
- package/src/hooks/containerReveal.stylex.ts +102 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/useClipboard.doc.mjs +87 -0
- package/src/hooks/useClipboard.test.tsx +151 -0
- package/src/hooks/useClipboard.ts +135 -0
- package/src/hooks/useContainerReveal.doc.mjs +7 -7
- package/src/hooks/useContainerReveal.test.tsx +42 -62
- package/src/hooks/useContainerReveal.ts +36 -91
- package/src/hooks/useImageMode.test.ts +1 -1
- package/src/hooks/useIndicatorFocusRing.tsx +120 -0
- package/src/hooks/useInputStatusIcon.tsx +8 -8
- package/src/hooks/useLongPress.test.tsx +18 -0
- package/src/hooks/useLongPress.ts +12 -2
- package/src/hooks/useScrollLock.test.ts +72 -0
- package/src/hooks/useScrollLock.ts +51 -19
- package/src/hooks/useStreamingText.test.ts +46 -1
- package/src/hooks/useStreamingText.ts +49 -7
- package/src/hooks/useTreeFocus.test.tsx +50 -0
- package/src/hooks/useTreeFocus.ts +14 -3
- package/src/hooks/useTypeahead.test.tsx +150 -0
- package/src/hooks/useTypeahead.ts +24 -9
- package/src/i18n/InternationalizationProvider.doc.mjs +7 -2
- package/src/index.ts +1 -0
- package/src/theme/defineTheme.ts +27 -0
- package/src/theme/derivedVarRegistry.test.ts +21 -1
- package/src/theme/derivedVarRegistry.ts +19 -6
- package/src/theme/expandColorScale.test.ts +14 -0
- package/src/theme/expandColorScale.ts +24 -9
- package/src/theme/expandTypeScale.test.ts +43 -0
- package/src/theme/expandTypeScale.ts +17 -0
- package/src/theme/generateThemeRules.test.ts +78 -20
- package/src/theme/generateThemeRules.ts +11 -0
- package/src/theme/index.ts +15 -0
- package/src/theme/tokens.stylex.ts +18 -0
- package/src/theme/tokens.test.ts +37 -0
- package/src/utils/focusOutline.stylex.ts +177 -0
- package/src/utils/focusReturn.test.ts +42 -0
- package/src/utils/focusReturn.ts +31 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derivedVarRegistry.d.ts","sourceRoot":"","sources":["../../src/theme/derivedVarRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"derivedVarRegistry.d.ts","sourceRoot":"","sources":["../../src/theme/derivedVarRegistry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,iFAAiF;IACjF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,CAsChE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,GACf,eAAe,EAAE,CAMnB"}
|
|
@@ -26,19 +26,6 @@
|
|
|
26
26
|
* entries share the same property.
|
|
27
27
|
*/
|
|
28
28
|
export const derivedVarRegistry = {
|
|
29
|
-
avatar: [{
|
|
30
|
-
property: 'fontSize',
|
|
31
|
-
vars: ['--_avatar-fallback-font-size']
|
|
32
|
-
}, {
|
|
33
|
-
property: 'fontWeight',
|
|
34
|
-
vars: ['--_avatar-fallback-font-weight']
|
|
35
|
-
}, {
|
|
36
|
-
property: 'color',
|
|
37
|
-
vars: ['--_avatar-fallback-color']
|
|
38
|
-
}, {
|
|
39
|
-
property: 'backgroundColor',
|
|
40
|
-
vars: ['--_avatar-fallback-background']
|
|
41
|
-
}],
|
|
42
29
|
banner: [{
|
|
43
30
|
property: 'borderRadius',
|
|
44
31
|
vars: ['--_banner-radius']
|
|
@@ -87,6 +74,15 @@ export const derivedVarRegistry = {
|
|
|
87
74
|
property: 'borderRadius',
|
|
88
75
|
vars: ['--_popover-radius']
|
|
89
76
|
}],
|
|
77
|
+
'progressbar-mark': [{
|
|
78
|
+
property: 'width',
|
|
79
|
+
vars: ['--_progressbar-mark-width'],
|
|
80
|
+
replaces: true
|
|
81
|
+
}, {
|
|
82
|
+
property: 'height',
|
|
83
|
+
vars: ['--_progressbar-mark-height'],
|
|
84
|
+
replaces: true
|
|
85
|
+
}],
|
|
90
86
|
section: [{
|
|
91
87
|
property: 'padding',
|
|
92
88
|
expand: 'container'
|
|
@@ -97,6 +93,11 @@ export const derivedVarRegistry = {
|
|
|
97
93
|
}, {
|
|
98
94
|
property: 'padding',
|
|
99
95
|
vars: ['--_segmented-control-padding']
|
|
96
|
+
}],
|
|
97
|
+
textarea: [{
|
|
98
|
+
property: 'paddingInline',
|
|
99
|
+
vars: ['--_textarea-inline-padding'],
|
|
100
|
+
replaces: true
|
|
100
101
|
}]
|
|
101
102
|
};
|
|
102
103
|
|
|
@@ -30,7 +30,9 @@ export interface ColorScaleConfig {
|
|
|
30
30
|
*/
|
|
31
31
|
neutralStyle?: 'warm' | 'cool' | 'neutral';
|
|
32
32
|
/**
|
|
33
|
-
* Contrast level.
|
|
33
|
+
* Contrast level. `'high'` pulls text, icons, and borders toward stronger
|
|
34
|
+
* tones (and thickens the subtle border's alpha) so structural and textual
|
|
35
|
+
* boundaries stay perceivable.
|
|
34
36
|
* @default 'standard'
|
|
35
37
|
*/
|
|
36
38
|
contrast?: 'standard' | 'high';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandColorScale.d.ts","sourceRoot":"","sources":["../../src/theme/expandColorScale.ts"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAE3C
|
|
1
|
+
{"version":3,"file":"expandColorScale.d.ts","sourceRoot":"","sources":["../../src/theme/expandColorScale.ts"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IAE3C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAyCtD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,EACZ,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAYR;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAoI3E"}
|
|
@@ -158,13 +158,21 @@ export function expandColorScale(config) {
|
|
|
158
158
|
const textSecondaryLightTone = isHigh ? 20 : 30;
|
|
159
159
|
const textSecondaryDarkTone = isHigh ? 80 : 70;
|
|
160
160
|
|
|
161
|
+
// Borders track contrast the same way text does: high contrast pulls the
|
|
162
|
+
// emphasized border tone toward mid-scale (stronger against both the near-
|
|
163
|
+
// white light surface and the near-black dark surface) and thickens the
|
|
164
|
+
// otherwise-decorative subtle hairline by doubling its alpha, so structural
|
|
165
|
+
// boundaries stay perceivable for users who opt into high contrast.
|
|
166
|
+
const borderSubtleAlpha = isHigh ? 0.2 : 0.1;
|
|
167
|
+
|
|
161
168
|
// Emphasized borders outline form controls (CheckboxInput, Selector), so
|
|
162
169
|
// they are non-text UI boundaries under WCAG 1.4.11 and must reach 3:1
|
|
163
|
-
// against the surface they sit on.
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
const
|
|
170
|
+
// against the surface they sit on. High contrast starts at a more
|
|
171
|
+
// aggressive tone (50 vs 70/30), guaranteeing a stronger result; standard
|
|
172
|
+
// contrast starts at 70/30 and walks toward mid-scale only as far as needed.
|
|
173
|
+
const borderEmphasizedStartLight = isHigh ? 50 : 70;
|
|
174
|
+
const borderEmphasizedStartDark = isHigh ? 50 : 30;
|
|
175
|
+
const borderEmphasized = ld(ensureContrastTone(seedHue, neutralVariantChroma, borderEmphasizedStartLight, -1, N[99], NON_TEXT_MIN_CONTRAST), ensureContrastTone(seedHue, neutralVariantChroma, borderEmphasizedStartDark, 1, N[10], NON_TEXT_MIN_CONTRAST));
|
|
168
176
|
return {
|
|
169
177
|
// Core semantic — only with a seed accent. Without one these fall through
|
|
170
178
|
// to colorDefaults, whose --color-accent is NOT what the default seed
|
|
@@ -202,8 +210,10 @@ export function expandColorScale(config) {
|
|
|
202
210
|
'--color-background-popover': ld(N[99], N[20]),
|
|
203
211
|
'--color-background-inverted': ld(N[10], N[99]),
|
|
204
212
|
// Border
|
|
205
|
-
//
|
|
206
|
-
|
|
213
|
+
// Border
|
|
214
|
+
// Decorative hairline — not a WCAG 1.4.11 boundary. High contrast
|
|
215
|
+
// doubles the alpha so structural boundaries stay perceivable.
|
|
216
|
+
'--color-border': ld(hexWithAlpha(N[10], borderSubtleAlpha), hexWithAlpha(N[95], borderSubtleAlpha)),
|
|
207
217
|
'--color-border-emphasized': borderEmphasized,
|
|
208
218
|
// Effects
|
|
209
219
|
'--color-skeleton': ld(NV[70], NV[30]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandTypeScale.d.ts","sourceRoot":"","sources":["../../src/theme/expandTypeScale.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAMH,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAC1C,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,eAAe,CAAC,CAC/C,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,CACF,MAAM,GACN,OAAO,GACP,OAAO,GACP,MAAM,GACN,YAAY,GACZ,WAAW,GACX,WAAW,GACX,WAAW,GACX,CAAC,MAAM,GAAG,EAAE,CAAC,EACf,eAAe,CAChB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,OAAO,CAAC,EAAE;QACR,yEAAyE;QACzE,OAAO,CAAC,EAAE,sBAAsB,CAAC;QACjC,oEAAoE;QACpE,IAAI,CAAC,EAAE,mBAAmB,CAAC;KAC5B,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAwIrD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,CAAC,MAAM,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A0BG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CA+CxE;AAiBD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,eAAe,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAmDxD"}
|
|
@@ -332,6 +332,23 @@ export function generateTypeScaleComponents(_config) {
|
|
|
332
332
|
lineHeight: `var(--text-heading-${level}-leading)`
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
+
// `Heading` renders both a `level:N` and, when set, a `type:display-N`
|
|
336
|
+
// visual-prop class simultaneously (type sizing takes precedence over
|
|
337
|
+
// level sizing — see Heading.tsx's own `type ? sizeByTypeStyles[type] :
|
|
338
|
+
// sizeByLevelStyles[level]`). Without a `type:display-N` rule here, the
|
|
339
|
+
// `level:N` rule is the only one that matches, so it silently wins
|
|
340
|
+
// regardless of `type` once a theme supplies a type scale. Emitting these
|
|
341
|
+
// after the level rules keeps them later in source order, so they take
|
|
342
|
+
// precedence at equal specificity, matching the component's own logic.
|
|
343
|
+
// fontWeight is intentionally omitted, mirroring the `text` branch below
|
|
344
|
+
// and preserving `defaultWeightByTypeStyles`.
|
|
345
|
+
for (const type of ['display-1', 'display-2', 'display-3']) {
|
|
346
|
+
headingRules[`type:${type}`] = {
|
|
347
|
+
fontFamily: 'var(--font-family-heading)',
|
|
348
|
+
fontSize: `var(--text-${type}-size)`,
|
|
349
|
+
lineHeight: `var(--text-${type}-leading)`
|
|
350
|
+
};
|
|
351
|
+
}
|
|
335
352
|
components.heading = headingRules;
|
|
336
353
|
const textRules = {};
|
|
337
354
|
for (const type of ['body', 'large', 'label', 'code', 'supporting', 'display-1', 'display-2', 'display-3']) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AA+DhD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAgKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAoChE;
|
|
1
|
+
{"version":3,"file":"generateThemeRules.d.ts","sourceRoot":"","sources":["../../src/theme/generateThemeRules.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AA+DhD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,kFAAkF;IAClF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAgKD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,EAAE,CAoChE;AAmQD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CAe5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CA4E9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CA2BpE"}
|
|
@@ -288,9 +288,11 @@ function generateComponentRules(components, parts) {
|
|
|
288
288
|
// Entries are processed in order (priority).
|
|
289
289
|
// - `vars`: emit internal CSS custom property declarations
|
|
290
290
|
// - `expand: 'container'`: expand padding to container layout tokens
|
|
291
|
+
// - `replaces: true`: emit only the var, dropping the source property
|
|
291
292
|
let finalProps = props;
|
|
292
293
|
const derivedProps = [];
|
|
293
294
|
let containerExpanded = false;
|
|
295
|
+
const replacedProps = new Set();
|
|
294
296
|
for (const [prop, value] of props) {
|
|
295
297
|
const derived = getDerivedVars(component, prop);
|
|
296
298
|
// Padding longhands (paddingBlock, paddingInline, etc.) also
|
|
@@ -300,6 +302,9 @@ function generateComponentRules(components, parts) {
|
|
|
300
302
|
if (entry.expand === 'container' && PADDING_PROPS.has(prop)) {
|
|
301
303
|
containerExpanded = true;
|
|
302
304
|
}
|
|
305
|
+
if (entry.replaces) {
|
|
306
|
+
replacedProps.add(prop);
|
|
307
|
+
}
|
|
303
308
|
if (entry.vars) {
|
|
304
309
|
for (const varName of entry.vars) {
|
|
305
310
|
derivedProps.push([varName, value]);
|
|
@@ -317,6 +322,12 @@ function generateComponentRules(components, parts) {
|
|
|
317
322
|
const containerTokens = expandContainerPadding(component, parsed);
|
|
318
323
|
finalProps = [...nonPaddingProps, ...containerTokens];
|
|
319
324
|
}
|
|
325
|
+
|
|
326
|
+
// Drop properties whose derived entry set `replaces` — their value is
|
|
327
|
+
// carried by the emitted var and must not land on the class element.
|
|
328
|
+
if (replacedProps.size > 0) {
|
|
329
|
+
finalProps = finalProps.filter(([p]) => !replacedProps.has(p));
|
|
330
|
+
}
|
|
320
331
|
if (derivedProps.length > 0) {
|
|
321
332
|
finalProps = [...finalProps, ...derivedProps];
|
|
322
333
|
}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -30,10 +30,11 @@ export { expandColorScale } from './expandColorScale';
|
|
|
30
30
|
export type { ColorScaleConfig, ColorScaleTokens } from './expandColorScale';
|
|
31
31
|
export { expandMotionScale } from './expandMotionScale';
|
|
32
32
|
export type { MotionScaleConfig, MotionScaleTokens } from './expandMotionScale';
|
|
33
|
-
export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars, } from './tokens.stylex';
|
|
33
|
+
export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, focusVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars, } from './tokens.stylex';
|
|
34
34
|
export type { ColorVarName, SpacingVarName, SizeVarName, BorderVarName, RadiusVarName, ShadowVarName, DurationVarName, EaseVarName, TypographyVarName, TextSizeVarName, FontWeightVarName, TypeScaleVarName, } from './tokens.stylex';
|
|
35
35
|
export { useTheme, useThemeName, ThemeContext } from './useTheme';
|
|
36
36
|
export type { UseThemeReturn, ThemeContextValue } from './useTheme';
|
|
37
|
+
export type { IndicatorComponent, IndicatorFamily, IndicatorFamilyMap, IndicatorMap, IndicatorName, IndicatorNameOfFamily, IndicatorProps, IndicatorRegistry, IndicatorSize, IndicatorState, } from '../Indicator';
|
|
37
38
|
export { resolveThemeToken, resolveThemeTokens, tokenVar, tokenVars, } from './tokens';
|
|
38
39
|
export type { ResolveThemeTokenOptions, ResolveThemeTokensOptions, ResolvedThemeMode, } from './tokens';
|
|
39
40
|
export type { TextColorMap } from '../Text';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;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Ac,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AAChE,YAAY,EAAC,cAAc,EAAE,iBAAiB,EAAC,MAAM,YAAY,CAAC;AAElE,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,SAAS,GACV,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,wBAAwB,EACxB,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAC1C,YAAY,EACV,SAAS,EACT,UAAU,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EACf,QAAQ,EACR,UAAU,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,UAAU,GACX,MAAM,SAAS,CAAC"}
|
package/dist/theme/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export { expandRadiusScale } from "./expandRadiusScale.js";
|
|
|
29
29
|
export { expandColorScale } from "./expandColorScale.js";
|
|
30
30
|
export { expandMotionScale } from "./expandMotionScale.js";
|
|
31
31
|
// Export token defaults and vars for use in custom components and themes
|
|
32
|
-
export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars } from "./tokens.stylex.js";
|
|
32
|
+
export { colorDefaults, spacingDefaults, sizeDefaults, borderDefaults, focusDefaults, radiusDefaults, shadowDefaults, durationDefaults, easeDefaults, typographyDefaults, textSizeDefaults, fontWeightDefaults, typeScaleDefaults, colorVars, spacingVars, sizeVars, borderVars, focusVars, radiusVars, shadowVars, durationVars, easeVars, typographyVars, textSizeVars, fontWeightVars, typeScaleVars } from "./tokens.stylex.js";
|
|
33
33
|
|
|
34
34
|
// Export token key types for theme authoring
|
|
35
35
|
|
|
@@ -225,6 +225,18 @@ export declare const borderVars: stylex.VarGroup<Readonly<{
|
|
|
225
225
|
readonly '--border-width': "1px";
|
|
226
226
|
}>, symbol>;
|
|
227
227
|
export type BorderVarName = keyof typeof borderDefaults;
|
|
228
|
+
export declare const focusDefaults: {
|
|
229
|
+
readonly '--focus-outline-width': "2px";
|
|
230
|
+
readonly '--focus-outline-style': "solid";
|
|
231
|
+
readonly '--focus-outline-color': "var(--color-accent)";
|
|
232
|
+
readonly '--focus-outline-offset': "3px";
|
|
233
|
+
};
|
|
234
|
+
export declare const focusVars: stylex.VarGroup<Readonly<{
|
|
235
|
+
readonly '--focus-outline-width': "2px";
|
|
236
|
+
readonly '--focus-outline-style': "solid";
|
|
237
|
+
readonly '--focus-outline-color': "var(--color-accent)";
|
|
238
|
+
readonly '--focus-outline-offset': "3px";
|
|
239
|
+
}>, symbol>;
|
|
228
240
|
export declare const radiusDefaults: {
|
|
229
241
|
readonly '--radius-none': "0px";
|
|
230
242
|
readonly '--radius-inner': "4px";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.stylex.d.ts","sourceRoot":"","sources":["../../src/theme/tokens.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAM3C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHhB,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAmC,CAAC;AAM1D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CAgBlB,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;WAAqC,CAAC;AAM9D,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;WAAkC,CAAC;AAMxD,eAAO,MAAM,cAAc;;CAEjB,CAAC;AAEX,eAAO,MAAM,UAAU;;WAAoC,CAAC;AAE5D,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tokens.stylex.d.ts","sourceRoot":"","sources":["../../src/theme/tokens.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAM3C,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyHhB,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAY,GAAG,MAAM,OAAO,aAAa,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,eAAe,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,YAAY,CAAC;AACpD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,cAAc,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,cAAc,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAChE,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAehE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DpB,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAAuC,CAAC;AAElE,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,iBAAiB,CAAC"}
|
|
@@ -284,6 +284,29 @@ export const borderVars = {
|
|
|
284
284
|
"--border-width": "var(--border-width)",
|
|
285
285
|
__varGroupHash__: "xafi2nm"
|
|
286
286
|
};
|
|
287
|
+
// =============================================================================
|
|
288
|
+
// Focus Tokens
|
|
289
|
+
// =============================================================================
|
|
290
|
+
// The keyboard focus ring, as one definition for the whole system. Values come
|
|
291
|
+
// from Design Conventions §User Interaction States: 2px --color-accent at 3px
|
|
292
|
+
// offset. Components read these through utils/focusOutline.stylex.ts; the
|
|
293
|
+
// `:focus-visible` condition stays in core, so a theme can restyle the ring
|
|
294
|
+
// but cannot show it to pointer users.
|
|
295
|
+
|
|
296
|
+
export const focusDefaults = {
|
|
297
|
+
'--focus-outline-width': '2px',
|
|
298
|
+
'--focus-outline-style': 'solid',
|
|
299
|
+
'--focus-outline-color': 'var(--color-accent)',
|
|
300
|
+
'--focus-outline-offset': '3px'
|
|
301
|
+
};
|
|
302
|
+
export const focusVars = {
|
|
303
|
+
"--focus-outline-width": "var(--focus-outline-width)",
|
|
304
|
+
"--focus-outline-style": "var(--focus-outline-style)",
|
|
305
|
+
"--focus-outline-color": "var(--focus-outline-color)",
|
|
306
|
+
"--focus-outline-offset": "var(--focus-outline-offset)",
|
|
307
|
+
__varGroupHash__: "xzxs3qz"
|
|
308
|
+
};
|
|
309
|
+
|
|
287
310
|
// =============================================================================
|
|
288
311
|
// Radius Tokens
|
|
289
312
|
// =============================================================================
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file focusOutline.stylex.ts
|
|
3
|
+
* @input Uses StyleX and theme color tokens
|
|
4
|
+
* @output Exports shared focus-outline prop builders
|
|
5
|
+
* @position Internal utility for consistent keyboard focus outlines across core components
|
|
6
|
+
*
|
|
7
|
+
* Centralizes the standard Astryx focus outline, shown only for keyboard focus.
|
|
8
|
+
* Every focusable surface drew the same 2px accent ring already; writing it per
|
|
9
|
+
* component meant dozens of identical definitions to keep in step, and they did
|
|
10
|
+
* not stay in step — offsets drifted and one ring was a border-width thick.
|
|
11
|
+
*
|
|
12
|
+
* Every ring in core and lab is drawn from here, with one exception recorded in
|
|
13
|
+
* Switch: its condition is a component-scoped ancestor marker, which cannot be
|
|
14
|
+
* shared without leaking focus state between components. A component may still
|
|
15
|
+
* override the OFFSET (a ring that must sit inset, or clear of a field border);
|
|
16
|
+
* width, style and color are not restated anywhere.
|
|
17
|
+
*
|
|
18
|
+
* Every value comes from the `--focus-outline-*` tokens, which is how a theme
|
|
19
|
+
* restyles the ring: one override reaches every component at once. The
|
|
20
|
+
* `:focus-visible` condition is not themeable and stays here, so a theme can
|
|
21
|
+
* change what the ring looks like but cannot show it to pointer users.
|
|
22
|
+
*/
|
|
23
|
+
import * as stylex from '@stylexjs/stylex';
|
|
24
|
+
/**
|
|
25
|
+
* The ring as a single `outline` value, for reading it at runtime — an
|
|
26
|
+
* assertion, or an element styled imperatively.
|
|
27
|
+
*
|
|
28
|
+
* NOT usable inside another file's `stylex.create`: StyleX resolves imported
|
|
29
|
+
* `defineVars` and nothing else, so a component whose condition
|
|
30
|
+
* {@link focusOutlineStyles} cannot express (Switch, whose ring keys off a
|
|
31
|
+
* component-scoped ancestor marker) has to compose the `focusVars` tokens
|
|
32
|
+
* itself.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FOCUS_OUTLINE: string;
|
|
35
|
+
/**
|
|
36
|
+
* The standard focus ring as plain CSS values, for the one case that has to
|
|
37
|
+
* apply it imperatively: a control whose focusable input is visually hidden and
|
|
38
|
+
* whose ring must land on a *themeable indicator* beside it (see
|
|
39
|
+
* `useIndicatorFocusRing`). Everything else should use the styles above.
|
|
40
|
+
*
|
|
41
|
+
* Longhands, not the `outline` shorthand, for the same reason the styles are:
|
|
42
|
+
* a shorthand resets every longhand it covers, so a caller could not re-color
|
|
43
|
+
* the ring without restating its width and style. Split, each part is
|
|
44
|
+
* independently overridable — and every part stays a var, so a theme's
|
|
45
|
+
* `--focus-outline-*` overrides still flow through.
|
|
46
|
+
*
|
|
47
|
+
* Keys are camelCase to match `HTMLElement.style`, so this spreads straight
|
|
48
|
+
* onto an element:
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* Object.assign(el.style, FOCUS_OUTLINE_PARTS); // draw
|
|
52
|
+
* Object.assign(el.style, FOCUS_OUTLINE_PARTS_NONE); // clear
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const FOCUS_OUTLINE_PARTS: {
|
|
56
|
+
readonly outlineWidth: stylex.StyleXVar<"2px">;
|
|
57
|
+
readonly outlineStyle: stylex.StyleXVar<"solid">;
|
|
58
|
+
readonly outlineColor: stylex.StyleXVar<"var(--color-accent)">;
|
|
59
|
+
readonly outlineOffset: stylex.StyleXVar<"3px">;
|
|
60
|
+
};
|
|
61
|
+
/** Clears {@link FOCUS_OUTLINE_PARTS}, one key per part so nothing lingers. */
|
|
62
|
+
export declare const FOCUS_OUTLINE_PARTS_NONE: {
|
|
63
|
+
readonly outlineWidth: "";
|
|
64
|
+
readonly outlineStyle: "";
|
|
65
|
+
readonly outlineColor: "";
|
|
66
|
+
readonly outlineOffset: "";
|
|
67
|
+
};
|
|
68
|
+
export declare const focusOutlineStyles: Readonly<{
|
|
69
|
+
readonly focusVisible: Readonly<{
|
|
70
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "0" | "2px">;
|
|
71
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
|
|
72
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-accent)" | null>;
|
|
73
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "0" | "3px">;
|
|
74
|
+
}>;
|
|
75
|
+
readonly focusWithin: Readonly<{
|
|
76
|
+
readonly outlineWidth: stylex.StyleXClassNameFor<"outlineWidth", "0" | "2px">;
|
|
77
|
+
readonly outlineStyle: stylex.StyleXClassNameFor<"outlineStyle", "none" | "solid">;
|
|
78
|
+
readonly outlineColor: stylex.StyleXClassNameFor<"outlineColor", "var(--color-accent)" | null>;
|
|
79
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "0" | "3px">;
|
|
80
|
+
}>;
|
|
81
|
+
readonly publishFocusVisibleVars: Readonly<{
|
|
82
|
+
readonly '--_focus-outline': stylex.StyleXClassNameFor<"--_focus-outline", string>;
|
|
83
|
+
readonly '--_focus-outline-offset': stylex.StyleXClassNameFor<"--_focus-outline-offset", "0" | "3px">;
|
|
84
|
+
}>;
|
|
85
|
+
readonly focusWithinOrPublished: Readonly<{
|
|
86
|
+
readonly outline: stylex.StyleXClassNameFor<"outline", string>;
|
|
87
|
+
readonly outlineOffset: stylex.StyleXClassNameFor<"outlineOffset", "3px" | "var(--_focus-outline-offset, 0)">;
|
|
88
|
+
}>;
|
|
89
|
+
}>;
|
|
90
|
+
type StyleXPropsArg = unknown;
|
|
91
|
+
export declare const focusOutlineProps: {
|
|
92
|
+
readonly focusVisible: (...styles: StyleXPropsArg[]) => Readonly<{
|
|
93
|
+
className?: string;
|
|
94
|
+
'data-style-src'?: string;
|
|
95
|
+
style?: Readonly<{
|
|
96
|
+
[$$Key$$: string]: string | number;
|
|
97
|
+
}>;
|
|
98
|
+
}>;
|
|
99
|
+
readonly focusWithin: (...styles: StyleXPropsArg[]) => Readonly<{
|
|
100
|
+
className?: string;
|
|
101
|
+
'data-style-src'?: string;
|
|
102
|
+
style?: Readonly<{
|
|
103
|
+
[$$Key$$: string]: string | number;
|
|
104
|
+
}>;
|
|
105
|
+
}>;
|
|
106
|
+
readonly publishFocusVisibleVars: (...styles: StyleXPropsArg[]) => Readonly<{
|
|
107
|
+
className?: string;
|
|
108
|
+
'data-style-src'?: string;
|
|
109
|
+
style?: Readonly<{
|
|
110
|
+
[$$Key$$: string]: string | number;
|
|
111
|
+
}>;
|
|
112
|
+
}>;
|
|
113
|
+
readonly focusWithinOrPublished: (...styles: StyleXPropsArg[]) => Readonly<{
|
|
114
|
+
className?: string;
|
|
115
|
+
'data-style-src'?: string;
|
|
116
|
+
style?: Readonly<{
|
|
117
|
+
[$$Key$$: string]: string | number;
|
|
118
|
+
}>;
|
|
119
|
+
}>;
|
|
120
|
+
};
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=focusOutline.stylex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusOutline.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/focusOutline.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,QAAyE,CAAC;AAgBpG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB;;;;;CAK3B,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;EAmD7B,CAAC;AAIH,KAAK,cAAc,GAAG,OAAO,CAAC;AAiB9B,eAAO,MAAM,iBAAiB;uCAdT,cAAc,EAAE;;;;;;;sCAAhB,cAAc,EAAE;;;;;;;kDAAhB,cAAc,EAAE;;;;;;;iDAAhB,cAAc,EAAE;;;;;;;CAuB3B,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file focusOutline.stylex.ts
|
|
5
|
+
* @input Uses StyleX and theme color tokens
|
|
6
|
+
* @output Exports shared focus-outline prop builders
|
|
7
|
+
* @position Internal utility for consistent keyboard focus outlines across core components
|
|
8
|
+
*
|
|
9
|
+
* Centralizes the standard Astryx focus outline, shown only for keyboard focus.
|
|
10
|
+
* Every focusable surface drew the same 2px accent ring already; writing it per
|
|
11
|
+
* component meant dozens of identical definitions to keep in step, and they did
|
|
12
|
+
* not stay in step — offsets drifted and one ring was a border-width thick.
|
|
13
|
+
*
|
|
14
|
+
* Every ring in core and lab is drawn from here, with one exception recorded in
|
|
15
|
+
* Switch: its condition is a component-scoped ancestor marker, which cannot be
|
|
16
|
+
* shared without leaking focus state between components. A component may still
|
|
17
|
+
* override the OFFSET (a ring that must sit inset, or clear of a field border);
|
|
18
|
+
* width, style and color are not restated anywhere.
|
|
19
|
+
*
|
|
20
|
+
* Every value comes from the `--focus-outline-*` tokens, which is how a theme
|
|
21
|
+
* restyles the ring: one override reaches every component at once. The
|
|
22
|
+
* `:focus-visible` condition is not themeable and stays here, so a theme can
|
|
23
|
+
* change what the ring looks like but cannot show it to pointer users.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import * as stylex from '@stylexjs/stylex';
|
|
27
|
+
import "../theme/tokens.stylex.js";
|
|
28
|
+
import { focusVars } from "../theme/tokens.stylex.js";
|
|
29
|
+
const FOCUS_OUTLINE_WIDTH = focusVars['--focus-outline-width'];
|
|
30
|
+
const FOCUS_OUTLINE_STYLE = focusVars['--focus-outline-style'];
|
|
31
|
+
const FOCUS_OUTLINE_COLOR = focusVars['--focus-outline-color'];
|
|
32
|
+
const FOCUS_OUTLINE_OFFSET = focusVars['--focus-outline-offset'];
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The ring as a single `outline` value, for reading it at runtime — an
|
|
36
|
+
* assertion, or an element styled imperatively.
|
|
37
|
+
*
|
|
38
|
+
* NOT usable inside another file's `stylex.create`: StyleX resolves imported
|
|
39
|
+
* `defineVars` and nothing else, so a component whose condition
|
|
40
|
+
* {@link focusOutlineStyles} cannot express (Switch, whose ring keys off a
|
|
41
|
+
* component-scoped ancestor marker) has to compose the `focusVars` tokens
|
|
42
|
+
* itself.
|
|
43
|
+
*/
|
|
44
|
+
export const FOCUS_OUTLINE = `${FOCUS_OUTLINE_WIDTH} ${FOCUS_OUTLINE_STYLE} ${FOCUS_OUTLINE_COLOR}`;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Written as longhands rather than the `outline` shorthand.
|
|
48
|
+
*
|
|
49
|
+
* A shorthand resets every longhand it covers, so `outline: 2px solid accent`
|
|
50
|
+
* would clobber a later `outlineColor` no matter the order — which is how
|
|
51
|
+
* destructive buttons silently lost their red ring. With longhands, a variant
|
|
52
|
+
* can re-color the ring and inherit width, style and offset.
|
|
53
|
+
*/
|
|
54
|
+
const focusOutlineLonghands = {
|
|
55
|
+
outlineWidth: FOCUS_OUTLINE_WIDTH,
|
|
56
|
+
outlineStyle: FOCUS_OUTLINE_STYLE,
|
|
57
|
+
outlineColor: FOCUS_OUTLINE_COLOR
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The standard focus ring as plain CSS values, for the one case that has to
|
|
62
|
+
* apply it imperatively: a control whose focusable input is visually hidden and
|
|
63
|
+
* whose ring must land on a *themeable indicator* beside it (see
|
|
64
|
+
* `useIndicatorFocusRing`). Everything else should use the styles above.
|
|
65
|
+
*
|
|
66
|
+
* Longhands, not the `outline` shorthand, for the same reason the styles are:
|
|
67
|
+
* a shorthand resets every longhand it covers, so a caller could not re-color
|
|
68
|
+
* the ring without restating its width and style. Split, each part is
|
|
69
|
+
* independently overridable — and every part stays a var, so a theme's
|
|
70
|
+
* `--focus-outline-*` overrides still flow through.
|
|
71
|
+
*
|
|
72
|
+
* Keys are camelCase to match `HTMLElement.style`, so this spreads straight
|
|
73
|
+
* onto an element:
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* Object.assign(el.style, FOCUS_OUTLINE_PARTS); // draw
|
|
77
|
+
* Object.assign(el.style, FOCUS_OUTLINE_PARTS_NONE); // clear
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export const FOCUS_OUTLINE_PARTS = {
|
|
81
|
+
outlineWidth: FOCUS_OUTLINE_WIDTH,
|
|
82
|
+
outlineStyle: FOCUS_OUTLINE_STYLE,
|
|
83
|
+
outlineColor: FOCUS_OUTLINE_COLOR,
|
|
84
|
+
outlineOffset: FOCUS_OUTLINE_OFFSET
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** Clears {@link FOCUS_OUTLINE_PARTS}, one key per part so nothing lingers. */
|
|
88
|
+
export const FOCUS_OUTLINE_PARTS_NONE = {
|
|
89
|
+
outlineWidth: '',
|
|
90
|
+
outlineStyle: '',
|
|
91
|
+
outlineColor: '',
|
|
92
|
+
outlineOffset: ''
|
|
93
|
+
};
|
|
94
|
+
export const focusOutlineStyles = {
|
|
95
|
+
focusVisible: {
|
|
96
|
+
kMeerF: "x1k57tk5 x1vidyx5",
|
|
97
|
+
k3XXqK: "x1t137rt x1jhp3zv",
|
|
98
|
+
kjBf7l: "xx47ajj",
|
|
99
|
+
kInvED: "x1wfwxd8 x1vwwbsn",
|
|
100
|
+
$$css: true
|
|
101
|
+
},
|
|
102
|
+
focusWithin: {
|
|
103
|
+
kMeerF: "x1k57tk5 x11j6mr8",
|
|
104
|
+
k3XXqK: "x1t137rt xciu248",
|
|
105
|
+
kjBf7l: "x1uy843r",
|
|
106
|
+
kInvED: "x1wfwxd8 x1jumodi",
|
|
107
|
+
$$css: true
|
|
108
|
+
},
|
|
109
|
+
publishFocusVisibleVars: {
|
|
110
|
+
"--_focus-outline": "x17wzz1v xqih627",
|
|
111
|
+
"--_focus-outline-offset": "xgzxwq1 xqchwus",
|
|
112
|
+
$$css: true
|
|
113
|
+
},
|
|
114
|
+
focusWithinOrPublished: {
|
|
115
|
+
kI3sdo: "xaw4jrz x16s19ga",
|
|
116
|
+
kInvED: "x1kvmbwa x1jumodi",
|
|
117
|
+
$$css: true
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// StyleX does not expose a stable public input type for stylex.props();
|
|
122
|
+
// keep this helper permissive so it mirrors stylex.props() itself.
|
|
123
|
+
|
|
124
|
+
function makeFocusOutlineProps(style) {
|
|
125
|
+
return (...styles) =>
|
|
126
|
+
// Caller styles LAST, so a component can deliberately re-color its ring —
|
|
127
|
+
// destructive buttons ring in error red, not accent. StyleX is last-wins,
|
|
128
|
+
// and reversing this to protect the ring silently ate that override.
|
|
129
|
+
//
|
|
130
|
+
// The hazard in this direction is the opposite one: a caller whose base
|
|
131
|
+
// style carries `outline: 'none'` wipes the ring out entirely (TreeList
|
|
132
|
+
// did, and shipped a focusable row with no visible focus). Two things
|
|
133
|
+
// guard it — this file states the rule, and the ring is written as
|
|
134
|
+
// LONGHANDS, so an override has to name `outlineStyle`/`outlineWidth`
|
|
135
|
+
// explicitly rather than erasing them through the `outline` shorthand.
|
|
136
|
+
stylex.props(style, ...styles);
|
|
137
|
+
}
|
|
138
|
+
export const focusOutlineProps = {
|
|
139
|
+
focusVisible: makeFocusOutlineProps(focusOutlineStyles.focusVisible),
|
|
140
|
+
focusWithin: makeFocusOutlineProps(focusOutlineStyles.focusWithin),
|
|
141
|
+
publishFocusVisibleVars: makeFocusOutlineProps(focusOutlineStyles.publishFocusVisibleVars),
|
|
142
|
+
focusWithinOrPublished: makeFocusOutlineProps(focusOutlineStyles.focusWithinOrPublished)
|
|
143
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file focusReturn.ts
|
|
3
|
+
* @input The document's current active element.
|
|
4
|
+
* @output Whether focus is currently "detached" — on nothing in particular.
|
|
5
|
+
* @position Utility; used by overlay triggers (e.g. DateInput, DateTimeInput)
|
|
6
|
+
* that return focus to their control when the overlay closes, but only when
|
|
7
|
+
* the dismiss did not already move focus somewhere the user chose.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* True when focus rests on nothing in particular — no active element, or the
|
|
11
|
+
* document body / root element.
|
|
12
|
+
*
|
|
13
|
+
* An overlay (popover, calendar, dropdown) that restores focus to its trigger
|
|
14
|
+
* on close should do so ONLY when this is true. A native `popover="auto"`
|
|
15
|
+
* light-dismiss fires its close synchronously with the pointer event that
|
|
16
|
+
* moved focus, so by the time the close handler runs, focus has already
|
|
17
|
+
* landed on whatever the user clicked — another field, a button, anywhere.
|
|
18
|
+
* Restoring focus unconditionally would yank it back and fight that click.
|
|
19
|
+
* The one case the browser leaves unresolved is Escape or a click on
|
|
20
|
+
* non-focusable empty space, which drops focus to the body; that is exactly
|
|
21
|
+
* when the trigger should reclaim it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isFocusDetached(doc?: Document): boolean;
|
|
24
|
+
//# sourceMappingURL=focusReturn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusReturn.d.ts","sourceRoot":"","sources":["../../src/utils/focusReturn.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,GAAG,GAAE,QAAmB,GAAG,OAAO,CAKjE"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file focusReturn.ts
|
|
5
|
+
* @input The document's current active element.
|
|
6
|
+
* @output Whether focus is currently "detached" — on nothing in particular.
|
|
7
|
+
* @position Utility; used by overlay triggers (e.g. DateInput, DateTimeInput)
|
|
8
|
+
* that return focus to their control when the overlay closes, but only when
|
|
9
|
+
* the dismiss did not already move focus somewhere the user chose.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* True when focus rests on nothing in particular — no active element, or the
|
|
14
|
+
* document body / root element.
|
|
15
|
+
*
|
|
16
|
+
* An overlay (popover, calendar, dropdown) that restores focus to its trigger
|
|
17
|
+
* on close should do so ONLY when this is true. A native `popover="auto"`
|
|
18
|
+
* light-dismiss fires its close synchronously with the pointer event that
|
|
19
|
+
* moved focus, so by the time the close handler runs, focus has already
|
|
20
|
+
* landed on whatever the user clicked — another field, a button, anywhere.
|
|
21
|
+
* Restoring focus unconditionally would yank it back and fight that click.
|
|
22
|
+
* The one case the browser leaves unresolved is Escape or a click on
|
|
23
|
+
* non-focusable empty space, which drops focus to the body; that is exactly
|
|
24
|
+
* when the trigger should reclaim it.
|
|
25
|
+
*/
|
|
26
|
+
export function isFocusDetached(doc = document) {
|
|
27
|
+
const active = doc.activeElement;
|
|
28
|
+
return active == null || active === doc.body || active === doc.documentElement;
|
|
29
|
+
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export { parseStyleKey } from './parseStyleKey';
|
|
|
15
15
|
export { getKey, type Key, type KeyFallback } from './getKey';
|
|
16
16
|
export { mergeProps } from './mergeProps';
|
|
17
17
|
export { mergeRefs } from './mergeRefs';
|
|
18
|
+
export { isFocusDetached } from './focusReturn';
|
|
18
19
|
export { composeEventHandlers } from './composeEventHandlers';
|
|
19
20
|
export { themeProps, themeDataAttributes } from './themeProps';
|
|
20
21
|
export type { ClassValue, ClassProps, ThemeDataAttributes, ThemeProps, } from './themeProps';
|
|
@@ -28,4 +29,5 @@ export { parseHex, parseRgb, parseColor, formatHex, formatColor, toGLFloats, } f
|
|
|
28
29
|
export type { RGBA } from './color';
|
|
29
30
|
export { devWarn, devError, warnOnce, formatDevMessage } from './devWarning';
|
|
30
31
|
export { rtlStyles } from './rtlStyles';
|
|
32
|
+
export { focusOutlineStyles, focusOutlineProps } from './focusOutline.stylex';
|
|
31
33
|
//# sourceMappingURL=index.d.ts.map
|