@astryxdesign/core 0.0.15 → 0.1.0-canary.08d4cf4
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 +69 -0
- package/README.md +8 -10
- package/dist/AlertDialog/AlertDialog.js +2 -2
- package/dist/AppShell/AppShell.js +5 -5
- package/dist/AspectRatio/AspectRatio.js +2 -2
- package/dist/Avatar/Avatar.js +2 -2
- package/dist/Avatar/AvatarStatusDot.js +2 -2
- package/dist/AvatarGroup/AvatarGroup.js +2 -2
- package/dist/AvatarGroup/AvatarGroupOverflow.js +3 -3
- package/dist/Badge/Badge.js +2 -2
- package/dist/Banner/Banner.d.ts +2 -2
- package/dist/Banner/Banner.js +6 -6
- package/dist/Blockquote/Blockquote.js +2 -2
- package/dist/Breadcrumbs/BreadcrumbItem.js +3 -3
- package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/Button/Button.js +2 -2
- package/dist/ButtonGroup/ButtonGroup.js +2 -2
- package/dist/Calendar/Calendar.js +3 -3
- package/dist/Card/Card.js +2 -2
- package/dist/Carousel/Carousel.js +2 -2
- package/dist/Center/Center.js +2 -2
- package/dist/Chat/ChatComposer.js +2 -2
- package/dist/Chat/ChatComposerDrawer.js +2 -2
- package/dist/Chat/ChatComposerInput.js +2 -2
- package/dist/Chat/ChatLayout.js +2 -2
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +5 -1
- package/dist/Chat/ChatMessage.js +2 -2
- package/dist/Chat/ChatMessageBubble.js +2 -2
- package/dist/Chat/ChatMessageList.js +2 -2
- package/dist/Chat/ChatMessageMetadata.js +2 -2
- package/dist/Chat/ChatSendButton.js +2 -2
- package/dist/Chat/ChatSystemMessage.js +3 -3
- package/dist/Chat/ChatTokenizedText.js +3 -3
- package/dist/Chat/ChatToolCalls.js +3 -3
- package/dist/Chat/useTriggerMenu.js +2 -2
- package/dist/CheckboxInput/CheckboxInput.js +3 -3
- package/dist/CheckboxList/CheckboxList.js +2 -2
- package/dist/Citation/Citation.js +3 -3
- package/dist/ClickableCard/ClickableCard.js +2 -2
- package/dist/Code/Code.js +2 -2
- package/dist/CodeBlock/CodeBlock.js +2 -2
- package/dist/Collapsible/Collapsible.js +2 -2
- package/dist/CommandPalette/CommandPaletteFooter.js +2 -2
- package/dist/CommandPalette/CommandPaletteGroup.js +2 -2
- package/dist/CommandPalette/CommandPaletteInput.js +2 -2
- package/dist/CommandPalette/CommandPaletteItem.js +2 -2
- package/dist/CommandPalette/CommandPaletteList.js +2 -2
- package/dist/ContextMenu/ContextMenu.js +4 -4
- package/dist/DateInput/DateInput.js +2 -2
- package/dist/DateRangeInput/DateRangeInput.js +2 -2
- package/dist/DateTimeInput/DateTimeInput.js +2 -2
- package/dist/Dialog/Dialog.js +3 -3
- package/dist/Divider/Divider.js +2 -2
- package/dist/DropdownMenu/DropdownMenu.js +4 -4
- package/dist/DropdownMenu/DropdownMenuItem.js +2 -2
- package/dist/DropdownMenu/{renderXDSDropdownItems.d.ts → renderDropdownItems.d.ts} +3 -3
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -0
- package/dist/DropdownMenu/{renderXDSDropdownItems.js → renderDropdownItems.js} +2 -2
- package/dist/EmptyState/EmptyState.js +2 -2
- package/dist/Field/Field.js +3 -3
- package/dist/Field/FieldLabel.js +2 -2
- package/dist/FieldStatus/FieldStatus.js +2 -2
- package/dist/FileInput/FileInput.js +2 -2
- package/dist/FormLayout/FormLayout.js +2 -2
- package/dist/Grid/Grid.js +3 -3
- package/dist/Grid/GridSpan.js +2 -2
- package/dist/Heading/Heading.js +2 -2
- package/dist/HoverCard/useHoverCard.js +2 -2
- package/dist/Icon/Icon.js +3 -3
- package/dist/InputGroup/InputGroup.js +2 -2
- package/dist/InputGroup/InputGroupText.js +2 -2
- package/dist/Item/Item.js +2 -2
- package/dist/Kbd/Kbd.js +2 -2
- package/dist/Layer/useLayer.d.ts +2 -2
- package/dist/Layout/Layout.js +2 -2
- package/dist/Layout/LayoutContent.js +2 -2
- package/dist/Layout/LayoutFooter.js +2 -2
- package/dist/Layout/LayoutHeader.js +2 -2
- package/dist/Layout/LayoutPanel.js +2 -2
- package/dist/Lightbox/Lightbox.js +2 -2
- package/dist/Link/Link.js +3 -3
- package/dist/List/List.js +2 -2
- package/dist/List/ListItem.js +2 -2
- package/dist/Markdown/Markdown.js +3 -3
- package/dist/MetadataList/MetadataList.js +2 -2
- package/dist/MetadataList/MetadataListItem.js +3 -3
- package/dist/MobileNav/MobileNav.js +2 -2
- package/dist/MultiSelector/MultiSelector.js +2 -2
- package/dist/NavIcon/NavIcon.js +2 -2
- package/dist/NavMenu/NavHeadingMenu.js +2 -2
- package/dist/NavMenu/NavHeadingMenuItem.js +2 -2
- package/dist/NumberInput/NumberInput.js +2 -2
- package/dist/Outline/Outline.d.ts +3 -2
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +27 -8
- package/dist/Outline/useScrollSpy.d.ts +14 -1
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +161 -50
- package/dist/OverflowList/OverflowList.js +2 -2
- package/dist/Overlay/Overlay.js +2 -2
- package/dist/Overlay/OverlayScrim.js +2 -2
- package/dist/Pagination/Pagination.js +3 -3
- package/dist/Popover/Popover.js +4 -4
- package/dist/PowerSearch/PowerSearch.js +2 -2
- package/dist/ProgressBar/ProgressBar.js +5 -5
- package/dist/RadioList/RadioList.js +2 -2
- package/dist/RadioList/RadioListItem.js +4 -4
- package/dist/Resizable/ResizeHandle.js +4 -4
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +1 -5
- package/dist/Section/Section.js +2 -2
- package/dist/SegmentedControl/SegmentedControl.js +2 -2
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -2
- package/dist/SelectableCard/SelectableCard.js +2 -2
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +3 -3
- package/dist/Selector/SelectorOption.js +2 -2
- package/dist/SideNav/SideNav.js +3 -3
- package/dist/SideNav/SideNavHeading.js +9 -9
- package/dist/SideNav/SideNavItem.js +3 -3
- package/dist/SideNav/SideNavSection.js +2 -2
- package/dist/Skeleton/Skeleton.js +2 -2
- package/dist/Slider/Slider.js +4 -4
- package/dist/Spinner/Spinner.js +3 -3
- package/dist/Stack/Stack.js +2 -2
- package/dist/Stack/StackItem.js +2 -2
- package/dist/StatusDot/StatusDot.js +2 -2
- package/dist/Switch/Switch.js +4 -4
- package/dist/TabList/Tab.js +3 -3
- package/dist/TabList/TabList.js +2 -2
- package/dist/TabList/TabMenu.js +5 -5
- package/dist/Table/BaseTable.js +2 -2
- package/dist/Table/Table.js +3 -3
- package/dist/Table/TableBody.js +2 -2
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableFooter.js +2 -2
- package/dist/Table/TableHeader.js +2 -2
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/TableRow.js +3 -3
- package/dist/Text/Text.js +2 -2
- package/dist/TextArea/TextArea.js +2 -2
- package/dist/TextInput/TextInput.js +2 -2
- package/dist/Thumbnail/Thumbnail.js +2 -2
- package/dist/TimeInput/TimeInput.js +2 -2
- package/dist/Timestamp/Timestamp.js +2 -2
- package/dist/Toast/Toast.js +2 -2
- package/dist/ToggleButton/ToggleButton.d.ts +10 -3
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +66 -20
- package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
- package/dist/Token/Token.js +4 -4
- package/dist/Tokenizer/Tokenizer.js +3 -3
- package/dist/Toolbar/Toolbar.js +2 -2
- package/dist/Tooltip/useTooltip.js +2 -2
- package/dist/TopNav/TopNav.js +3 -3
- package/dist/TopNav/TopNavHeading.js +7 -7
- package/dist/TopNav/TopNavItem.js +3 -3
- package/dist/TopNav/TopNavMegaMenu.js +3 -3
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +2 -2
- package/dist/TopNav/TopNavMegaMenuItem.js +3 -3
- package/dist/TopNav/TopNavMenu.js +2 -2
- package/dist/TreeList/TreeList.js +2 -2
- package/dist/TreeList/TreeListItem.js +2 -2
- package/dist/Typeahead/BaseTypeahead.js +2 -2
- package/dist/Typeahead/Typeahead.js +2 -2
- package/dist/Typeahead/TypeaheadItem.js +2 -2
- package/dist/docs-types.d.ts +3 -3
- package/dist/docs-types.d.ts.map +1 -1
- package/dist/naming.d.ts +1 -1
- package/dist/naming.js +1 -1
- package/dist/theme/Theme.js +1 -1
- package/dist/theme/defineTheme.d.ts +3 -3
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +1 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -2
- package/dist/theme/syntax/defineSyntaxTheme.js +1 -1
- package/dist/theme/tokens.d.ts +1 -1
- package/dist/theme/tokens.js +4 -4
- package/dist/theme/useTheme.d.ts +2 -2
- package/dist/utils/dateParser.d.ts.map +1 -1
- package/dist/utils/dateParser.js +15 -2
- package/dist/utils/mergeProps.d.ts +3 -3
- package/dist/utils/mergeProps.js +4 -4
- package/dist/utils/parseStyleKey.d.ts +2 -2
- package/dist/utils/parseStyleKey.js +2 -2
- package/dist/utils/{xdsThemeProps.d.ts → themeProps.d.ts} +4 -4
- package/dist/utils/themeProps.d.ts.map +1 -0
- package/dist/utils/{xdsThemeProps.js → themeProps.js} +5 -5
- package/package.json +2 -2
- package/src/AlertDialog/AlertDialog.tsx +2 -2
- package/src/AppShell/AppShell.tsx +5 -5
- package/src/AspectRatio/AspectRatio.tsx +2 -2
- package/src/Avatar/Avatar.tsx +2 -2
- package/src/Avatar/AvatarStatusDot.tsx +2 -2
- package/src/AvatarGroup/AvatarGroup.tsx +2 -2
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +3 -3
- package/src/Badge/Badge.tsx +2 -2
- package/src/Banner/Banner.tsx +6 -6
- package/src/Blockquote/Blockquote.tsx +2 -2
- package/src/Breadcrumbs/BreadcrumbItem.tsx +3 -3
- package/src/Breadcrumbs/Breadcrumbs.tsx +2 -2
- package/src/Button/Button.tsx +2 -2
- package/src/ButtonGroup/ButtonGroup.tsx +2 -2
- package/src/Calendar/Calendar.tsx +3 -3
- package/src/Card/Card.tsx +2 -2
- package/src/Carousel/Carousel.tsx +2 -2
- package/src/Center/Center.tsx +2 -2
- package/src/Chat/ChatComposer.tsx +2 -2
- package/src/Chat/ChatComposerDrawer.tsx +2 -2
- package/src/Chat/ChatComposerInput.tsx +2 -2
- package/src/Chat/ChatLayout.tsx +2 -2
- package/src/Chat/ChatLayoutScrollButton.tsx +7 -1
- package/src/Chat/ChatMessage.tsx +2 -2
- package/src/Chat/ChatMessageBubble.tsx +2 -2
- package/src/Chat/ChatMessageList.tsx +2 -2
- package/src/Chat/ChatMessageMetadata.tsx +2 -2
- package/src/Chat/ChatSendButton.tsx +2 -2
- package/src/Chat/ChatSystemMessage.tsx +3 -3
- package/src/Chat/ChatTokenizedText.tsx +3 -3
- package/src/Chat/ChatToolCalls.tsx +3 -3
- package/src/Chat/useTriggerMenu.tsx +2 -2
- package/src/CheckboxInput/CheckboxInput.tsx +3 -3
- package/src/CheckboxList/CheckboxList.tsx +2 -2
- package/src/Citation/Citation.tsx +3 -3
- package/src/ClickableCard/ClickableCard.tsx +2 -2
- package/src/Code/Code.tsx +2 -2
- package/src/CodeBlock/CodeBlock.tsx +2 -2
- package/src/Collapsible/Collapsible.tsx +2 -2
- package/src/Collapsible/useCollapsible.doc.mjs +2 -2
- package/src/CommandPalette/CommandPaletteFooter.tsx +2 -2
- package/src/CommandPalette/CommandPaletteGroup.tsx +2 -2
- package/src/CommandPalette/CommandPaletteInput.tsx +2 -2
- package/src/CommandPalette/CommandPaletteItem.tsx +2 -2
- package/src/CommandPalette/CommandPaletteList.tsx +2 -2
- package/src/ContextMenu/ContextMenu.tsx +4 -4
- package/src/DateInput/DateInput.test.tsx +68 -20
- package/src/DateInput/DateInput.tsx +2 -2
- package/src/DateRangeInput/DateRangeInput.tsx +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +2 -2
- package/src/Dialog/Dialog.tsx +3 -3
- package/src/Divider/Divider.doc.mjs +1 -1
- package/src/Divider/Divider.tsx +2 -2
- package/src/DropdownMenu/DropdownMenu.tsx +4 -4
- package/src/DropdownMenu/DropdownMenuItem.tsx +2 -2
- package/src/DropdownMenu/{renderXDSDropdownItems.tsx → renderDropdownItems.tsx} +2 -2
- package/src/EmptyState/EmptyState.tsx +2 -2
- package/src/Field/Field.tsx +3 -3
- package/src/Field/FieldLabel.tsx +2 -2
- package/src/FieldStatus/FieldStatus.tsx +2 -2
- package/src/FileInput/FileInput.tsx +2 -2
- package/src/FormLayout/FormLayout.doc.mjs +3 -3
- package/src/FormLayout/FormLayout.tsx +2 -2
- package/src/Grid/Grid.tsx +3 -3
- package/src/Grid/GridSpan.tsx +2 -2
- package/src/Heading/Heading.tsx +2 -2
- package/src/HoverCard/useHoverCard.tsx +2 -2
- package/src/Icon/Icon.doc.mjs +4 -4
- package/src/Icon/Icon.tsx +3 -3
- package/src/InputGroup/InputGroup.tsx +2 -2
- package/src/InputGroup/InputGroupText.tsx +2 -2
- package/src/Item/Item.doc.mjs +2 -2
- package/src/Item/Item.tsx +2 -2
- package/src/Kbd/Kbd.tsx +2 -2
- package/src/Layer/useLayer.tsx +2 -2
- package/src/Layout/Layout.tsx +2 -2
- package/src/Layout/LayoutContent.tsx +2 -2
- package/src/Layout/LayoutFooter.tsx +2 -2
- package/src/Layout/LayoutHeader.tsx +2 -2
- package/src/Layout/LayoutPanel.tsx +2 -2
- package/src/Lightbox/Lightbox.tsx +2 -2
- package/src/Link/Link.doc.mjs +3 -3
- package/src/Link/Link.tsx +3 -3
- package/src/Link/LinkProvider.doc.mjs +3 -3
- package/src/List/List.tsx +2 -2
- package/src/List/ListItem.tsx +2 -2
- package/src/Markdown/Markdown.doc.mjs +4 -4
- package/src/Markdown/Markdown.tsx +3 -3
- package/src/MetadataList/MetadataList.tsx +2 -2
- package/src/MetadataList/MetadataListItem.tsx +3 -3
- package/src/MobileNav/MobileNav.tsx +2 -2
- package/src/MoreMenu/MoreMenu.doc.mjs +0 -13
- package/src/MultiSelector/MultiSelector.tsx +2 -2
- package/src/NavIcon/NavIcon.tsx +2 -2
- package/src/NavMenu/NavHeadingMenu.tsx +2 -2
- package/src/NavMenu/NavHeadingMenuItem.tsx +2 -2
- package/src/NumberInput/NumberInput.tsx +2 -2
- package/src/Outline/Outline.doc.mjs +1 -1
- package/src/Outline/Outline.test.tsx +76 -38
- package/src/Outline/Outline.tsx +27 -8
- package/src/Outline/useScrollSpy.ts +196 -63
- package/src/OverflowList/OverflowList.tsx +2 -2
- package/src/Overlay/Overlay.tsx +2 -2
- package/src/Overlay/OverlayScrim.tsx +2 -2
- package/src/Pagination/Pagination.tsx +3 -3
- package/src/Popover/Popover.tsx +4 -4
- package/src/PowerSearch/PowerSearch.tsx +2 -2
- package/src/ProgressBar/ProgressBar.tsx +5 -5
- package/src/RadioList/RadioList.tsx +2 -2
- package/src/RadioList/RadioListItem.tsx +4 -4
- package/src/Resizable/Resizable.doc.mjs +2 -2
- package/src/Resizable/ResizeHandle.tsx +4 -4
- package/src/Resizable/useResizable.ts +1 -7
- package/src/Section/Section.tsx +2 -2
- package/src/SegmentedControl/SegmentedControl.tsx +2 -2
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -2
- package/src/SelectableCard/SelectableCard.tsx +2 -2
- package/src/Selector/Selector.tsx +7 -8
- package/src/Selector/SelectorOption.tsx +2 -2
- package/src/SideNav/SideNav.tsx +3 -3
- package/src/SideNav/SideNavHeading.tsx +9 -9
- package/src/SideNav/SideNavItem.tsx +3 -3
- package/src/SideNav/SideNavSection.tsx +2 -2
- package/src/Skeleton/Skeleton.tsx +2 -2
- package/src/Slider/Slider.tsx +4 -4
- package/src/Spinner/Spinner.tsx +3 -3
- package/src/Stack/Stack.tsx +2 -2
- package/src/Stack/StackItem.tsx +2 -2
- package/src/StatusDot/StatusDot.tsx +2 -2
- package/src/Switch/Switch.tsx +4 -4
- package/src/TabList/Tab.tsx +3 -3
- package/src/TabList/TabList.tsx +2 -2
- package/src/TabList/TabMenu.tsx +5 -5
- package/src/Table/BaseTable.tsx +2 -2
- package/src/Table/Table.doc.mjs +3 -3
- package/src/Table/Table.tsx +3 -3
- package/src/Table/TableBody.tsx +2 -2
- package/src/Table/TableCell.tsx +3 -3
- package/src/Table/TableFooter.tsx +2 -2
- package/src/Table/TableHeader.tsx +2 -2
- package/src/Table/TableHeaderCell.tsx +3 -3
- package/src/Table/TableRow.tsx +3 -3
- package/src/Text/Text.tsx +2 -2
- package/src/TextArea/TextArea.tsx +2 -2
- package/src/TextInput/TextInput.tsx +2 -2
- package/src/Thumbnail/Thumbnail.tsx +2 -2
- package/src/TimeInput/TimeInput.tsx +2 -2
- package/src/Timestamp/Timestamp.tsx +2 -2
- package/src/Toast/Toast.tsx +2 -2
- package/src/ToggleButton/ToggleButton.doc.mjs +2 -2
- package/src/ToggleButton/ToggleButton.test.tsx +148 -6
- package/src/ToggleButton/ToggleButton.tsx +85 -22
- package/src/ToggleButton/ToggleButtonGroup.tsx +2 -2
- package/src/Token/Token.tsx +4 -4
- package/src/Tokenizer/Tokenizer.tsx +3 -3
- package/src/Toolbar/Toolbar.doc.mjs +8 -7
- package/src/Toolbar/Toolbar.tsx +2 -2
- package/src/Tooltip/useTooltip.tsx +2 -2
- package/src/TopNav/TopNav.tsx +3 -3
- package/src/TopNav/TopNavHeading.tsx +7 -7
- package/src/TopNav/TopNavItem.tsx +3 -3
- package/src/TopNav/TopNavMegaMenu.tsx +3 -3
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +2 -2
- package/src/TopNav/TopNavMegaMenuItem.tsx +3 -3
- package/src/TopNav/TopNavMenu.tsx +2 -2
- package/src/TreeList/TreeList.tsx +2 -2
- package/src/TreeList/TreeListItem.tsx +2 -2
- package/src/Typeahead/BaseTypeahead.tsx +2 -2
- package/src/Typeahead/Typeahead.tsx +2 -2
- package/src/Typeahead/TypeaheadItem.tsx +2 -2
- package/src/docs-types.ts +3 -3
- package/src/hooks/useEntryAnimation.doc.mjs +3 -3
- package/src/hooks/useMediaQuery.doc.mjs +2 -2
- package/src/hooks/useStreamingText.doc.mjs +3 -3
- package/src/naming.ts +1 -1
- package/src/reset.css +1 -1
- package/src/tailwind-theme.css +1 -1
- package/src/theme/Theme.doc.mjs +2 -2
- package/src/theme/Theme.tsx +1 -1
- package/src/theme/defineTheme.ts +3 -3
- package/src/theme/index.ts +2 -2
- package/src/theme/syntax/defineSyntaxTheme.ts +1 -1
- package/src/theme/tokens.ts +4 -4
- package/src/theme/useTheme.ts +2 -2
- package/src/utils/dateParser.test.ts +26 -0
- package/src/utils/dateParser.ts +16 -2
- package/src/utils/mergeProps.ts +4 -4
- package/src/utils/parseStyleKey.ts +2 -2
- package/src/utils/{xdsThemeProps.test.ts → themeProps.test.ts} +12 -12
- package/src/utils/{xdsThemeProps.ts → themeProps.ts} +5 -5
- package/dist/DropdownMenu/renderXDSDropdownItems.d.ts.map +0 -1
- package/dist/utils/xdsThemeProps.d.ts.map +0 -1
|
@@ -20,7 +20,7 @@ import "../theme/tokens.stylex.js";
|
|
|
20
20
|
import { colorVars } from "../theme/tokens.stylex.js";
|
|
21
21
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
22
22
|
import { mergeProps } from "../utils/index.js";
|
|
23
|
-
import {
|
|
23
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Pulse animation keyframes
|
|
@@ -128,7 +128,7 @@ export function StatusDot({
|
|
|
128
128
|
ref: ref,
|
|
129
129
|
role: "img",
|
|
130
130
|
"aria-label": label,
|
|
131
|
-
...mergeProps(
|
|
131
|
+
...mergeProps(themeProps('statusdot', {
|
|
132
132
|
variant
|
|
133
133
|
}), stylex.props(styles.base, variants[variant], isPulsing && styles.pulsing, isPulsing && styles.reducedMotion, xstyle), className, style),
|
|
134
134
|
...props
|
package/dist/Switch/Switch.js
CHANGED
|
@@ -25,7 +25,7 @@ import { Spinner } from "../Spinner/index.js";
|
|
|
25
25
|
import { mergeProps } from "../utils/index.js";
|
|
26
26
|
import "./switch.markers.stylex.js";
|
|
27
27
|
import { switchScope } from "./switch.markers.stylex.js";
|
|
28
|
-
import {
|
|
28
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
29
29
|
|
|
30
30
|
// Fixed dimensions: 40px width, 24px height, 16px thumb (off), 20px thumb (on)
|
|
31
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -167,7 +167,7 @@ export function Switch({
|
|
|
167
167
|
}[!!isDisabled << 1 | !!isBusy << 0]
|
|
168
168
|
}), /*#__PURE__*/_jsx("div", {
|
|
169
169
|
"aria-hidden": "true",
|
|
170
|
-
...mergeProps(
|
|
170
|
+
...mergeProps(themeProps('switch', {
|
|
171
171
|
checked: isOn ? 'checked' : null,
|
|
172
172
|
disabled: isDisabled ? 'disabled' : null
|
|
173
173
|
}), {
|
|
@@ -221,7 +221,7 @@ export function Switch({
|
|
|
221
221
|
}
|
|
222
222
|
}[!!isOn << 3 | !!!isDisabled << 2 | !!isDisabled << 1 | !!(isDisabled && !isOn) << 0]),
|
|
223
223
|
children: /*#__PURE__*/_jsx("div", {
|
|
224
|
-
...mergeProps(
|
|
224
|
+
...mergeProps(themeProps('switch-thumb', {
|
|
225
225
|
checked: isOn ? 'checked' : null
|
|
226
226
|
}), {
|
|
227
227
|
0: {
|
|
@@ -261,7 +261,7 @@ export function Switch({
|
|
|
261
261
|
})
|
|
262
262
|
});
|
|
263
263
|
return /*#__PURE__*/_jsxs("div", {
|
|
264
|
-
...mergeProps(
|
|
264
|
+
...mergeProps(themeProps('switch-field', {
|
|
265
265
|
labelPosition: labelPosition !== 'end' ? labelPosition : undefined,
|
|
266
266
|
labelSpacing: labelSpacing !== 'default' ? labelSpacing : undefined
|
|
267
267
|
}), stylex.props(width != null && dynamicWidthStyles.width(width), xstyle), className, style),
|
package/dist/TabList/Tab.js
CHANGED
|
@@ -25,7 +25,7 @@ import { tabScope } from "./tab.markers.stylex.js";
|
|
|
25
25
|
import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
26
26
|
import { mergeProps } from "../utils/index.js";
|
|
27
27
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
28
|
-
import {
|
|
28
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
29
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
30
|
// =============================================================================
|
|
31
31
|
// Styles
|
|
@@ -187,7 +187,7 @@ export function Tab({
|
|
|
187
187
|
} : {}),
|
|
188
188
|
[EDGE_COMP_ATTR]: '',
|
|
189
189
|
'aria-current': isSelected ? 'page' : undefined,
|
|
190
|
-
...mergeProps(
|
|
190
|
+
...mergeProps(themeProps('tab', {
|
|
191
191
|
selected: isSelected ? 'selected' : null
|
|
192
192
|
}), stylex.props(styles.base, sizeStyles[size], isSelected && styles.selected, isFill && layoutStyles.fill, tabScope, xstyle), className, style)
|
|
193
193
|
};
|
|
@@ -196,7 +196,7 @@ export function Tab({
|
|
|
196
196
|
...stylex.props(styles.hoverBg, hoverSizeStyles[size])
|
|
197
197
|
});
|
|
198
198
|
const indicatorElement = /*#__PURE__*/_jsx("span", {
|
|
199
|
-
...mergeProps(
|
|
199
|
+
...mergeProps(themeProps('tab-indicator', {
|
|
200
200
|
selected: isSelected ? 'selected' : null
|
|
201
201
|
}), {
|
|
202
202
|
0: {
|
package/dist/TabList/TabList.js
CHANGED
|
@@ -22,7 +22,7 @@ import { TabListContext } from "./TabListContext.js";
|
|
|
22
22
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
23
23
|
import { mergeProps } from "../utils/index.js";
|
|
24
24
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
25
|
-
import {
|
|
25
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
26
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
27
|
const styles = {
|
|
28
28
|
nav: {
|
|
@@ -88,7 +88,7 @@ export function TabList({
|
|
|
88
88
|
"aria-label": "Tabs",
|
|
89
89
|
[EDGE_COMP_ATTR]: '',
|
|
90
90
|
...restProps,
|
|
91
|
-
...mergeProps(
|
|
91
|
+
...mergeProps(themeProps('tab-list', {
|
|
92
92
|
size
|
|
93
93
|
}), stylex.props(styles.nav, layout === 'fill' && styles.fill, hasDivider && styles.divider, xstyle), className, style),
|
|
94
94
|
children: children
|
package/dist/TabList/TabMenu.js
CHANGED
|
@@ -27,7 +27,7 @@ import { useTabListContext } from "./TabListContext.js";
|
|
|
27
27
|
import "./tab.markers.stylex.js";
|
|
28
28
|
import { tabScope } from "./tab.markers.stylex.js";
|
|
29
29
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
30
|
-
import {
|
|
30
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
31
31
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
32
32
|
// =============================================================================
|
|
33
33
|
// Styles
|
|
@@ -170,7 +170,7 @@ export function TabMenu({
|
|
|
170
170
|
"aria-expanded": popover.isOpen,
|
|
171
171
|
"aria-controls": menuId,
|
|
172
172
|
onClick: handleToggle,
|
|
173
|
-
...mergeProps(
|
|
173
|
+
...mergeProps(themeProps('tab-menu'), stylex.props(styles.trigger, sizeStyles[size], hasSelectedOption && styles.triggerSelected, tabScope, xstyle), className, style),
|
|
174
174
|
children: [/*#__PURE__*/_jsx("span", {
|
|
175
175
|
"aria-hidden": "true",
|
|
176
176
|
...stylex.props(styles.hoverBg, hoverSizeStyles[size])
|
|
@@ -206,7 +206,7 @@ export function TabMenu({
|
|
|
206
206
|
color: "inherit"
|
|
207
207
|
})
|
|
208
208
|
}), hasSelectedOption && /*#__PURE__*/_jsx("span", {
|
|
209
|
-
...mergeProps(
|
|
209
|
+
...mergeProps(themeProps('tab-indicator', {
|
|
210
210
|
selected: 'selected'
|
|
211
211
|
}), {
|
|
212
212
|
className: "x10l6tqk xqmqy1e xnp31yv xmz3bnw x36qwtl xjspbzw x47corl xnpjden xuedmi6 xlr8y92 xowkcby x1hc1fzr"
|
|
@@ -218,7 +218,7 @@ export function TabMenu({
|
|
|
218
218
|
role: "menu",
|
|
219
219
|
"aria-label": label,
|
|
220
220
|
onKeyDown: handleListKeyDown,
|
|
221
|
-
...mergeProps(
|
|
221
|
+
...mergeProps(themeProps('tab-menu-dropdown'), {
|
|
222
222
|
className: "x78zum5 xdt5ytf x1lsbc85 xu0wf1k x7a5moj"
|
|
223
223
|
}),
|
|
224
224
|
children: [/*#__PURE__*/_jsx("span", {
|
|
@@ -240,7 +240,7 @@ export function TabMenu({
|
|
|
240
240
|
handleSelect(option.value);
|
|
241
241
|
}
|
|
242
242
|
},
|
|
243
|
-
...mergeProps(
|
|
243
|
+
...mergeProps(themeProps('tab-menu-item'), {
|
|
244
244
|
0: {
|
|
245
245
|
className: "x78zum5 x6s0dn4 x1qughib x1txdalj xce4md1 xrrkdod xh6dtrn xjb2p0i xcr08ib x1kq96og x1sodnla x1tgivj0 x1ypdohk x15406qy xuedmi6 xlr8y92 xjbqb8w xe9uy6x x17nn4n9"
|
|
246
246
|
},
|
package/dist/Table/BaseTable.js
CHANGED
|
@@ -27,7 +27,7 @@ import { TableBody } from "./TableBody.js";
|
|
|
27
27
|
import { mergeProps } from "../utils/index.js";
|
|
28
28
|
import { EmptyState } from "../EmptyState/index.js";
|
|
29
29
|
import { Text } from "../Text/index.js";
|
|
30
|
-
import {
|
|
30
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
31
31
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
32
|
const styles = {
|
|
33
33
|
table: {
|
|
@@ -342,7 +342,7 @@ function BaseTableInner({
|
|
|
342
342
|
let tableElement = /*#__PURE__*/_jsx("table", {
|
|
343
343
|
ref: ref,
|
|
344
344
|
...tableRenderProps.htmlProps,
|
|
345
|
-
...mergeProps(
|
|
345
|
+
...mergeProps(themeProps('base-table'), stylex.props(...tableRenderProps.styles), tableRenderProps.htmlProps.className),
|
|
346
346
|
style: tableStyle,
|
|
347
347
|
children: children ? children : /*#__PURE__*/_jsxs(_Fragment, {
|
|
348
348
|
children: [hasColumns && /*#__PURE__*/_jsx(TableHeader, {
|
package/dist/Table/Table.js
CHANGED
|
@@ -23,7 +23,7 @@ import { BaseTable } from "./BaseTable.js";
|
|
|
23
23
|
import { TableContext } from "./TableContext.js";
|
|
24
24
|
import { useBaseTablePlugins } from "./useBaseTablePlugins.js";
|
|
25
25
|
import { mergeProps } from "../utils/index.js";
|
|
26
|
-
import {
|
|
26
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
27
27
|
|
|
28
28
|
// =============================================================================
|
|
29
29
|
// Table Types
|
|
@@ -57,7 +57,7 @@ function TableScrollWrapper({
|
|
|
57
57
|
children
|
|
58
58
|
}) {
|
|
59
59
|
return /*#__PURE__*/_jsx("div", {
|
|
60
|
-
...mergeProps(
|
|
60
|
+
...mergeProps(themeProps('table-scroll-wrapper'), {
|
|
61
61
|
className: "xw2csxc x5lxg6s xojxgvx x1fcf3bl xx6qvi6 xkibk3 xlayyun"
|
|
62
62
|
}),
|
|
63
63
|
children: children
|
|
@@ -72,7 +72,7 @@ function buildTableStylePlugin() {
|
|
|
72
72
|
return {
|
|
73
73
|
transformTable(props) {
|
|
74
74
|
const existingClass = props.htmlProps.className ?? '';
|
|
75
|
-
const tableClass =
|
|
75
|
+
const tableClass = themeProps('table').className;
|
|
76
76
|
return {
|
|
77
77
|
...props,
|
|
78
78
|
htmlProps: {
|
package/dist/Table/TableBody.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as stylex from '@stylexjs/stylex';
|
|
6
6
|
import { mergeProps } from "../utils/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export function TableBody({
|
|
10
10
|
ref,
|
|
@@ -13,7 +13,7 @@ export function TableBody({
|
|
|
13
13
|
}) {
|
|
14
14
|
return /*#__PURE__*/_jsx("tbody", {
|
|
15
15
|
ref: ref,
|
|
16
|
-
...mergeProps(
|
|
16
|
+
...mergeProps(themeProps('table-body'), stylex.props(xstyle)),
|
|
17
17
|
children: children
|
|
18
18
|
});
|
|
19
19
|
}
|
package/dist/Table/TableCell.js
CHANGED
|
@@ -20,7 +20,7 @@ import "./table.stylex.js";
|
|
|
20
20
|
import { overflowStyles, wrapStyles, containerEdgeStyles, tableRowMarker } from "./table.stylex.js";
|
|
21
21
|
import { useTableContext, buildDividerStyles, mergeXStyle } from "./useTableCellStyles.js";
|
|
22
22
|
import { mergeProps } from "../utils/index.js";
|
|
23
|
-
import {
|
|
23
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
24
24
|
|
|
25
25
|
/** Props for TableCell — thin `<td>` wrapper */
|
|
26
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -105,7 +105,7 @@ export function TableCell({
|
|
|
105
105
|
return /*#__PURE__*/_jsx("td", {
|
|
106
106
|
ref: ref,
|
|
107
107
|
...props,
|
|
108
|
-
...mergeProps(
|
|
108
|
+
...mergeProps(themeProps('table-cell'), stylex.props(xstyle), incomingClassName, incomingStyle),
|
|
109
109
|
children: children
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -113,7 +113,7 @@ export function TableCell({
|
|
|
113
113
|
return /*#__PURE__*/_jsx("td", {
|
|
114
114
|
ref: ref,
|
|
115
115
|
...props,
|
|
116
|
-
...mergeProps(
|
|
116
|
+
...mergeProps(themeProps('table-cell'), stylex.props(...mergeXStyle(cellStyles, xstyle)), incomingClassName, incomingStyle),
|
|
117
117
|
children: children
|
|
118
118
|
});
|
|
119
119
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as stylex from '@stylexjs/stylex';
|
|
6
6
|
import { mergeProps } from "../utils/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export function TableFooter({
|
|
10
10
|
ref,
|
|
@@ -13,7 +13,7 @@ export function TableFooter({
|
|
|
13
13
|
}) {
|
|
14
14
|
return /*#__PURE__*/_jsx("tfoot", {
|
|
15
15
|
ref: ref,
|
|
16
|
-
...mergeProps(
|
|
16
|
+
...mergeProps(themeProps('table-footer'), stylex.props(xstyle)),
|
|
17
17
|
children: children
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as stylex from '@stylexjs/stylex';
|
|
6
6
|
import { mergeProps } from "../utils/index.js";
|
|
7
|
-
import {
|
|
7
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
export function TableHeader({
|
|
10
10
|
ref,
|
|
@@ -13,7 +13,7 @@ export function TableHeader({
|
|
|
13
13
|
}) {
|
|
14
14
|
return /*#__PURE__*/_jsx("thead", {
|
|
15
15
|
ref: ref,
|
|
16
|
-
...mergeProps(
|
|
16
|
+
...mergeProps(themeProps('table-header'), stylex.props(xstyle)),
|
|
17
17
|
children: children
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -19,7 +19,7 @@ import { colorVars, spacingVars, fontWeightVars, typeScaleVars, borderVars } fro
|
|
|
19
19
|
import { overflowStyles, containerEdgeStyles } from "./table.stylex.js";
|
|
20
20
|
import { useTableContext, mergeXStyle } from "./useTableCellStyles.js";
|
|
21
21
|
import { mergeProps } from "../utils/index.js";
|
|
22
|
-
import {
|
|
22
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
23
23
|
|
|
24
24
|
/** Props for TableHeaderCell — `<th>` wrapper with context-aware styling */
|
|
25
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -103,7 +103,7 @@ export function TableHeaderCell({
|
|
|
103
103
|
return /*#__PURE__*/_jsx("th", {
|
|
104
104
|
ref: ref,
|
|
105
105
|
...props,
|
|
106
|
-
...mergeProps(
|
|
106
|
+
...mergeProps(themeProps('table-header-cell'), stylex.props(xstyle), incomingClassName, incomingStyle),
|
|
107
107
|
children: children
|
|
108
108
|
});
|
|
109
109
|
}
|
|
@@ -120,7 +120,7 @@ export function TableHeaderCell({
|
|
|
120
120
|
return /*#__PURE__*/_jsx("th", {
|
|
121
121
|
ref: ref,
|
|
122
122
|
...props,
|
|
123
|
-
...mergeProps(
|
|
123
|
+
...mergeProps(themeProps('table-header-cell'), stylex.props(...mergeXStyle(cellStyles, xstyle)), incomingClassName, incomingStyle),
|
|
124
124
|
children: children
|
|
125
125
|
});
|
|
126
126
|
}
|
package/dist/Table/TableRow.js
CHANGED
|
@@ -20,7 +20,7 @@ import { colorVars, durationVars, easeVars } from "../theme/tokens.stylex.js";
|
|
|
20
20
|
import { tableRowMarker } from "./table.stylex.js";
|
|
21
21
|
import { TableContext } from "./TableContext.js";
|
|
22
22
|
import { mergeProps } from "../utils/index.js";
|
|
23
|
-
import {
|
|
23
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
24
24
|
|
|
25
25
|
/** Props for TableRow — thin `<tr>` wrapper */
|
|
26
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -76,7 +76,7 @@ export function TableRow({
|
|
|
76
76
|
return /*#__PURE__*/_jsx("tr", {
|
|
77
77
|
ref: ref,
|
|
78
78
|
...props,
|
|
79
|
-
...mergeProps(
|
|
79
|
+
...mergeProps(themeProps('table-row'), stylex.props(tableRowMarker, xstyle)),
|
|
80
80
|
children: children
|
|
81
81
|
});
|
|
82
82
|
}
|
|
@@ -100,7 +100,7 @@ export function TableRow({
|
|
|
100
100
|
return /*#__PURE__*/_jsx("tr", {
|
|
101
101
|
ref: ref,
|
|
102
102
|
...props,
|
|
103
|
-
...mergeProps(
|
|
103
|
+
...mergeProps(themeProps('table-row'), stylex.props(tableRowMarker, ...rowStyles)),
|
|
104
104
|
children: children
|
|
105
105
|
});
|
|
106
106
|
}
|
package/dist/Text/Text.js
CHANGED
|
@@ -20,7 +20,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
20
20
|
import { colorStyles, defaultWeightByTypeStyles, sizeByTypeStyles, weightStyles, displayStyles, justifyStyles, truncationStyles, wordBreakStyles, textWrapStyles, capsizeStyles, decorationStyles, tabularNumbersStyle, truncationTooltipStyles } from "./text.stylex.js";
|
|
21
21
|
import { useTruncation } from "./useTruncation.js";
|
|
22
22
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
23
|
-
import {
|
|
23
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
24
24
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
25
|
const LazyXDSTooltip = /*#__PURE__*/lazy(async () => import('../Tooltip/Tooltip').then(mod => ({
|
|
26
26
|
default: mod.Tooltip
|
|
@@ -118,7 +118,7 @@ export function Text({
|
|
|
118
118
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
119
119
|
children: [/*#__PURE__*/_jsx(Component, {
|
|
120
120
|
ref: mergeRefs(ref, truncation.ref, textRef),
|
|
121
|
-
...mergeProps(
|
|
121
|
+
...mergeProps(themeProps('text', {
|
|
122
122
|
type,
|
|
123
123
|
color: resolvedColor
|
|
124
124
|
}), stylex.props(colorStyles[resolvedColor], sizeByTypeStyles[styleType], defaultWeightByTypeStyles[styleType], weight && weightStyles[weight],
|
|
@@ -25,7 +25,7 @@ import { Spinner } from "../Spinner/index.js";
|
|
|
25
25
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
26
26
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
27
27
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
28
|
-
import {
|
|
28
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
29
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
30
|
const COUNTER_WARNING_THRESHOLD = 0.8;
|
|
31
31
|
const styles = {
|
|
@@ -150,7 +150,7 @@ export function TextArea({
|
|
|
150
150
|
ref: containerRef,
|
|
151
151
|
onClick: handleWrapperClick,
|
|
152
152
|
onMouseUp: handleWrapperMouseUp,
|
|
153
|
-
...mergeProps(
|
|
153
|
+
...mergeProps(themeProps('textarea', {
|
|
154
154
|
size,
|
|
155
155
|
status: status?.type ?? null
|
|
156
156
|
}), stylex.props(inputWrapperStyles.base, styles.wrapper, textareaSizeStyles[size], effectivelyDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
|
|
@@ -44,7 +44,7 @@ import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
|
44
44
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
45
45
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
46
46
|
import { useInputGroup } from "../InputGroup/InputGroupContext.js";
|
|
47
|
-
import {
|
|
47
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
48
48
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
49
49
|
/**
|
|
50
50
|
* A text input component for collecting user input.
|
|
@@ -135,7 +135,7 @@ export function TextInput({
|
|
|
135
135
|
ref: containerRef,
|
|
136
136
|
onClick: handleWrapperClick,
|
|
137
137
|
onMouseUp: handleWrapperMouseUp,
|
|
138
|
-
...mergeProps(
|
|
138
|
+
...mergeProps(themeProps('text-input', {
|
|
139
139
|
size,
|
|
140
140
|
status: status?.type ?? null
|
|
141
141
|
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
@@ -31,7 +31,7 @@ import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
|
31
31
|
import { MediaTheme } from "../theme/MediaTheme.js";
|
|
32
32
|
import { useImageMode } from "../hooks/useImageMode.js";
|
|
33
33
|
import { mergeProps } from "../utils/index.js";
|
|
34
|
-
import {
|
|
34
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
35
35
|
|
|
36
36
|
/** Sample the region behind the remove button (20px button, 4px inset, in 64px container). */
|
|
37
37
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -170,7 +170,7 @@ export function Thumbnail({
|
|
|
170
170
|
ref: ref,
|
|
171
171
|
"data-testid": testId,
|
|
172
172
|
"aria-label": accessibleName,
|
|
173
|
-
...mergeProps(
|
|
173
|
+
...mergeProps(themeProps('thumbnail'), stylex.props(styles.root, isDisabled && styles.disabled, xstyle), className, style),
|
|
174
174
|
...props,
|
|
175
175
|
children: /*#__PURE__*/_jsxs("div", {
|
|
176
176
|
...{
|
|
@@ -25,7 +25,7 @@ import { Spinner } from "../Spinner/index.js";
|
|
|
25
25
|
import { parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, adjustTime, isTimeInRange, mergeProps, mergeRefs } from "../utils/index.js";
|
|
26
26
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
27
27
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
28
|
-
import {
|
|
28
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
29
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
30
|
const sizeStyles = {
|
|
31
31
|
sm: {
|
|
@@ -262,7 +262,7 @@ export function TimeInput({
|
|
|
262
262
|
ref: containerRef,
|
|
263
263
|
onClick: handleWrapperClick,
|
|
264
264
|
onMouseUp: handleWrapperMouseUp,
|
|
265
|
-
...mergeProps(
|
|
265
|
+
...mergeProps(themeProps('time-input', {
|
|
266
266
|
size,
|
|
267
267
|
status: status?.type ?? null
|
|
268
268
|
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
|
|
@@ -19,7 +19,7 @@ import { useEffect, useRef, useState, lazy, Suspense } from 'react';
|
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import { Text } from "../Text/index.js";
|
|
21
21
|
import { mergeProps, mergeRefs } from "../utils/index.js";
|
|
22
|
-
import {
|
|
22
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
23
23
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
24
|
const LazyXDSTooltip = /*#__PURE__*/lazy(async () => import('../Tooltip/Tooltip').then(mod => ({
|
|
25
25
|
default: mod.Tooltip
|
|
@@ -260,7 +260,7 @@ export function Timestamp({
|
|
|
260
260
|
return () => clearInterval(timer);
|
|
261
261
|
}, [isLive, effectiveFormat, diffSeconds]);
|
|
262
262
|
const showTooltip = hasTooltip && effectiveFormat === 'relative';
|
|
263
|
-
const timestampProps = mergeProps(
|
|
263
|
+
const timestampProps = mergeProps(themeProps('timestamp', {
|
|
264
264
|
format: effectiveFormat
|
|
265
265
|
}), {
|
|
266
266
|
className,
|
package/dist/Toast/Toast.js
CHANGED
|
@@ -11,7 +11,7 @@ import { colorVars, spacingVars, radiusVars, durationVars, easeVars, shadowVars,
|
|
|
11
11
|
import { mergeProps } from "../utils/index.js";
|
|
12
12
|
import { useTheme } from "../theme/index.js";
|
|
13
13
|
import { MediaTheme } from "../theme/MediaTheme.js";
|
|
14
|
-
import {
|
|
14
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
/**
|
|
17
17
|
* Individual toast notification.
|
|
@@ -106,7 +106,7 @@ export function Toast({
|
|
|
106
106
|
onMouseLeave: resumeTimer,
|
|
107
107
|
onFocusCapture: pauseTimer,
|
|
108
108
|
onBlurCapture: resumeTimer,
|
|
109
|
-
...mergeProps(
|
|
109
|
+
...mergeProps(themeProps('toast', {
|
|
110
110
|
type
|
|
111
111
|
}), {
|
|
112
112
|
0: {
|
|
@@ -38,8 +38,15 @@ export interface ToggleButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
38
38
|
*/
|
|
39
39
|
onPressedChange?: (isPressed: boolean) => void;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
* The button shows a loading spinner while the
|
|
41
|
+
* Action handler for API- or navigation-backed toggles, run inside a
|
|
42
|
+
* transition. The button shows a loading spinner while the action is
|
|
43
|
+
* pending — whether it returns a promise or synchronously triggers a
|
|
44
|
+
* suspending update (e.g. a router navigation that suspends on data).
|
|
45
|
+
*
|
|
46
|
+
* Because it runs in a transition, the toggle is *interruptible*: clicking
|
|
47
|
+
* again while an action is pending starts a new transition with the next
|
|
48
|
+
* optimistic state, so the action reflects the latest intent rather than
|
|
49
|
+
* being dropped.
|
|
43
50
|
*
|
|
44
51
|
* @example
|
|
45
52
|
* ```
|
|
@@ -53,7 +60,7 @@ export interface ToggleButtonProps extends BaseProps<HTMLButtonElement> {
|
|
|
53
60
|
* />
|
|
54
61
|
* ```
|
|
55
62
|
*/
|
|
56
|
-
pressedChangeAction?: (isPressed: boolean) => Promise<void>;
|
|
63
|
+
pressedChangeAction?: (isPressed: boolean) => void | Promise<void>;
|
|
57
64
|
/**
|
|
58
65
|
* The size of the toggle button.
|
|
59
66
|
* When used inside ToggleButtonGroup, defaults to the group's size.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../src/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAMZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,OAAO,EAAS,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAElD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAyE5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACrE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,mBAAmB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnE;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,SAAS,EAAE,aAAa,EACxB,eAAe,EAAE,mBAAmB,EACpC,mBAAmB,EACnB,IAAI,EAAE,QAAQ,EACd,UAAU,EAAE,cAAsB,EAClC,SAAiB,EACjB,IAAI,EACJ,UAAkB,EAClB,WAAW,EACX,QAAQ,EACR,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EAAE,UAAU,EACrB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,iBAAiB,GAAG,SAAS,CAyG/B;yBA5He,YAAY"}
|
|
@@ -19,13 +19,45 @@
|
|
|
19
19
|
* - /apps/storybook/stories/ToggleButton.stories.tsx
|
|
20
20
|
* - /packages/cli/templates/blocks/components/ToggleButton/ (showcase blocks)
|
|
21
21
|
*/
|
|
22
|
-
import React, { useCallback } from 'react';
|
|
22
|
+
import React, { useCallback, useEffect, useOptimistic, useState, useTransition } from 'react';
|
|
23
23
|
import * as stylex from '@stylexjs/stylex';
|
|
24
24
|
import "../theme/tokens.stylex.js";
|
|
25
25
|
import { colorVars, fontWeightVars } from "../theme/tokens.stylex.js";
|
|
26
26
|
import { Button } from "../Button/index.js";
|
|
27
27
|
import { useToggleButtonGroup } from "./ToggleButtonGroup.js";
|
|
28
|
-
import {
|
|
28
|
+
import { themeProps } from "../utils/themeProps.js";
|
|
29
|
+
|
|
30
|
+
// =============================================================================
|
|
31
|
+
// Constants & helpers
|
|
32
|
+
// =============================================================================
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The spinner only appears once the action has been pending for this long.
|
|
36
|
+
* A fast action shows the optimistic pressed state immediately with no spinner
|
|
37
|
+
* flash, and rapid re-clicks can interrupt the in-flight action before the
|
|
38
|
+
* button locks behind the spinner.
|
|
39
|
+
*/
|
|
40
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
41
|
+
const PENDING_SPINNER_DELAY_MS = 150;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns `true` only once `active` has stayed `true` for `delayMs`.
|
|
45
|
+
* Used to debounce the loading spinner so the optimistic state shows first.
|
|
46
|
+
*/
|
|
47
|
+
function useDelayed(active, delayMs) {
|
|
48
|
+
const [delayed, setDelayed] = useState(false);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!active) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const timer = setTimeout(() => setDelayed(true), delayMs);
|
|
54
|
+
return () => {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
setDelayed(false);
|
|
57
|
+
};
|
|
58
|
+
}, [active, delayMs]);
|
|
59
|
+
return active && delayed;
|
|
60
|
+
}
|
|
29
61
|
|
|
30
62
|
// =============================================================================
|
|
31
63
|
// Styles
|
|
@@ -36,7 +68,6 @@ import { xdsThemeProps } from "../utils/xdsThemeProps.js";
|
|
|
36
68
|
* A hidden span renders the same text at semibold weight to reserve
|
|
37
69
|
* the wider width, preventing layout shift when toggling.
|
|
38
70
|
*/
|
|
39
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
40
71
|
const pressedStyles = {
|
|
41
72
|
background: {
|
|
42
73
|
kWkggS: "xi89dp7",
|
|
@@ -93,32 +124,47 @@ export function ToggleButton({
|
|
|
93
124
|
style,
|
|
94
125
|
...props
|
|
95
126
|
}) {
|
|
96
|
-
// Read group context if inside a group
|
|
97
127
|
const group = useToggleButtonGroup();
|
|
98
|
-
|
|
99
|
-
// Resolve state from group or props
|
|
100
|
-
const isPressed = group && value != null ? group.selectedValues.has(value) : isPressedProp ?? false;
|
|
128
|
+
const committedPressed = group && value != null ? group.selectedValues.has(value) : isPressedProp ?? false;
|
|
101
129
|
const size = sizeProp ?? group?.size ?? 'md';
|
|
102
130
|
const isDisabled = group?.isDisabled ?? isDisabledProp;
|
|
131
|
+
|
|
132
|
+
// Track the pressed state optimistically. While an action is pending, the
|
|
133
|
+
// button reflects the intended (optimistic) state immediately, and a click
|
|
134
|
+
// mid-flight derives its next state from this value — so rapid toggles read
|
|
135
|
+
// true -> false -> true rather than stalling on the last committed value.
|
|
136
|
+
const [optimisticPressed, setOptimisticPressed] = useOptimistic(committedPressed);
|
|
137
|
+
const isPressed = optimisticPressed;
|
|
103
138
|
const resolvedIcon = isPressed && pressedIcon ? pressedIcon : icon;
|
|
139
|
+
|
|
140
|
+
// Run the toggle inside a transition. The action is interruptible: clicking
|
|
141
|
+
// again while it is pending starts a fresh transition with the next
|
|
142
|
+
// optimistic state instead of being dropped, so there is no re-entry guard.
|
|
143
|
+
// Both onPressedChange and pressedChangeAction run inside the transition,
|
|
144
|
+
// which means a synchronous-but-suspending handler (e.g. a router navigation
|
|
145
|
+
// that suspends on data) also drives the pending state — not just promises.
|
|
146
|
+
const [isPending, startTransition] = useTransition();
|
|
147
|
+
// Debounce the spinner so a fast action shows the optimistic state without a
|
|
148
|
+
// spinner flash, and rapid re-clicks can interrupt before the button locks.
|
|
149
|
+
const showSpinner = useDelayed(isPending, PENDING_SPINNER_DELAY_MS);
|
|
150
|
+
const isLoadingState = isLoading || showSpinner;
|
|
104
151
|
const handleClick = useCallback(() => {
|
|
105
|
-
if (isDisabled
|
|
152
|
+
if (isDisabled) {
|
|
106
153
|
return;
|
|
107
154
|
}
|
|
108
155
|
if (group && value != null) {
|
|
109
|
-
//
|
|
156
|
+
// Group mode delegates selection to the group; no async-action path.
|
|
110
157
|
group.toggle(value);
|
|
111
|
-
|
|
112
|
-
// Standalone toggle
|
|
113
|
-
const newState = !isPressed;
|
|
114
|
-
onPressedChangeProp(newState);
|
|
115
|
-
if (pressedChangeAction) {
|
|
116
|
-
void pressedChangeAction(newState);
|
|
117
|
-
}
|
|
158
|
+
return;
|
|
118
159
|
}
|
|
119
|
-
|
|
160
|
+
const newState = !optimisticPressed;
|
|
161
|
+
startTransition(async () => {
|
|
162
|
+
setOptimisticPressed(newState);
|
|
163
|
+
onPressedChangeProp?.(newState);
|
|
164
|
+
await pressedChangeAction?.(newState);
|
|
165
|
+
});
|
|
166
|
+
}, [isDisabled, group, value, optimisticPressed, onPressedChangeProp, pressedChangeAction, setOptimisticPressed]);
|
|
120
167
|
|
|
121
|
-
// Label with font weight shift and width reservation
|
|
122
168
|
// isIconOnly prop is the source of truth for icon-only rendering.
|
|
123
169
|
const labelContent = children != null ? /*#__PURE__*/_jsxs("span", {
|
|
124
170
|
...{
|
|
@@ -165,12 +211,12 @@ export function ToggleButton({
|
|
|
165
211
|
variant: "ghost",
|
|
166
212
|
size: size,
|
|
167
213
|
isDisabled: isDisabled,
|
|
168
|
-
isLoading:
|
|
214
|
+
isLoading: isLoadingState,
|
|
169
215
|
isIconOnly: isIconOnly,
|
|
170
216
|
"aria-pressed": isPressed,
|
|
171
217
|
icon: resolvedIcon,
|
|
172
218
|
tooltip: tooltip,
|
|
173
|
-
...
|
|
219
|
+
...themeProps('toggle-button', {
|
|
174
220
|
isPressed: isPressed ? 'true' : 'false'
|
|
175
221
|
}),
|
|
176
222
|
xstyle: [isPressed ? pressedStyles.background : undefined, xstyle],
|