@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
package/dist/theme/index.js
CHANGED
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
* - Token exports for direct use in StyleX
|
|
12
12
|
*
|
|
13
13
|
* Themes are in separate packages:
|
|
14
|
-
* import {
|
|
14
|
+
* import { neutralTheme } from '@astryxdesign/theme-neutral';
|
|
15
15
|
* import { neutralTheme } from '@astryxdesign/theme-neutral';
|
|
16
16
|
*/
|
|
17
17
|
export { Theme } from "./Theme.js";
|
|
18
18
|
export { MediaTheme } from "./MediaTheme.js";
|
|
19
|
-
export { defineTheme, generateThemeCSS, generateThemeCSSFlat, generateOnMediaCSS, generateThemeRules, generateThemeRulesSplit, isDefinedTheme,
|
|
19
|
+
export { defineTheme, generateThemeCSS, generateThemeCSSFlat, generateOnMediaCSS, generateThemeRules, generateThemeRulesSplit, isDefinedTheme, tokenDefaults } from "./defineTheme.js";
|
|
20
20
|
export { syntaxTokenDefaults, domainTokenDefaults, dataTokenDefaults } from "./domainTokens/index.js";
|
|
21
21
|
|
|
22
22
|
// Syntax theme API
|
|
@@ -97,7 +97,7 @@ export function resolveSyntaxTokenForMode(value, mode) {
|
|
|
97
97
|
export function defineSyntaxTheme(input) {
|
|
98
98
|
const missing = ALL_SYNTAX_KEYS.filter(key => !(key in input.tokens));
|
|
99
99
|
if (missing.length > 0) {
|
|
100
|
-
console.warn('[
|
|
100
|
+
console.warn('[Astryx] defineSyntaxTheme("' + input.name + '"): missing tokens: ' + missing.join(', ') + '. All 14 syntax tokens are required.');
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
// Resolve tuples to light-dark() CSS strings
|
package/dist/theme/tokens.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare const tokenVars: Record<TokenName, string>;
|
|
|
48
48
|
/**
|
|
49
49
|
* Resolve all Astryx token values for a theme and effective color mode.
|
|
50
50
|
*
|
|
51
|
-
* The result starts with `
|
|
51
|
+
* The result starts with `tokenDefaults`, applies `theme.tokens`, then
|
|
52
52
|
* reapplies `theme.__inputTokens` when available so explicit tuple overrides
|
|
53
53
|
* retain their original light/dark sides instead of relying on CSS parsing.
|
|
54
54
|
* This mirrors the token resolution used by `useTheme()` but does not need
|
package/dist/theme/tokens.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* - /packages/core/src/theme/index.ts
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { tokenDefaults } from "./defineTheme.js";
|
|
19
19
|
|
|
20
20
|
/** Resolved color mode used when choosing the side of light/dark token values. */
|
|
21
21
|
|
|
@@ -45,7 +45,7 @@ export function tokenVar(name) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/** Flat map of every known Astryx token name to its `var(--token-name)` reference. */
|
|
48
|
-
export const tokenVars = Object.fromEntries(Object.keys(
|
|
48
|
+
export const tokenVars = Object.fromEntries(Object.keys(tokenDefaults).map(name => [name, tokenVar(name)]));
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Split the arguments of a CSS function body on the first top-level comma.
|
|
@@ -118,7 +118,7 @@ function resolveXDSTokenValue(value, mode) {
|
|
|
118
118
|
/**
|
|
119
119
|
* Resolve all Astryx token values for a theme and effective color mode.
|
|
120
120
|
*
|
|
121
|
-
* The result starts with `
|
|
121
|
+
* The result starts with `tokenDefaults`, applies `theme.tokens`, then
|
|
122
122
|
* reapplies `theme.__inputTokens` when available so explicit tuple overrides
|
|
123
123
|
* retain their original light/dark sides instead of relying on CSS parsing.
|
|
124
124
|
* This mirrors the token resolution used by `useTheme()` but does not need
|
|
@@ -131,7 +131,7 @@ export function resolveThemeTokens(theme, options) {
|
|
|
131
131
|
mode
|
|
132
132
|
} = options;
|
|
133
133
|
const resolved = {};
|
|
134
|
-
for (const [key, value] of Object.entries(
|
|
134
|
+
for (const [key, value] of Object.entries(tokenDefaults)) {
|
|
135
135
|
resolved[key] = resolveXDSTokenValue(value, mode);
|
|
136
136
|
}
|
|
137
137
|
if (theme == null) {
|
package/dist/theme/useTheme.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface UseThemeReturn {
|
|
|
30
30
|
* For tokens with [light, dark] tuples, returns the value matching
|
|
31
31
|
* the current mode. For single-value tokens, returns the value as-is.
|
|
32
32
|
*
|
|
33
|
-
* Falls back to
|
|
33
|
+
* Falls back to tokenDefaults if the token isn't overridden by the theme.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* ```
|
|
@@ -42,7 +42,7 @@ export interface UseThemeReturn {
|
|
|
42
42
|
/**
|
|
43
43
|
* All tokens resolved for the current color mode.
|
|
44
44
|
*
|
|
45
|
-
* Merges
|
|
45
|
+
* Merges tokenDefaults with the theme's overrides, resolving
|
|
46
46
|
* light-dark() values based on the effective color mode.
|
|
47
47
|
*
|
|
48
48
|
* Memoized — stable reference unless theme or mode changes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateParser.d.ts","sourceRoot":"","sources":["../../src/utils/dateParser.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAqC,MAAM,aAAa,CAAC;AAE/E,OAAO,EACL,gBAAgB,IAAI,QAAQ,EAC5B,cAAc,IAAI,SAAS,GAC5B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAK1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"dateParser.d.ts","sourceRoot":"","sources":["../../src/utils/dateParser.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,OAAO,EAAC,KAAK,SAAS,EAAqC,MAAM,aAAa,CAAC;AAE/E,OAAO,EACL,gBAAgB,IAAI,QAAQ,EAC5B,cAAc,IAAI,SAAS,GAC5B,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAK1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAsG9D"}
|
package/dist/utils/dateParser.js
CHANGED
|
@@ -112,10 +112,23 @@ export function parseDateInput(input) {
|
|
|
112
112
|
return parseNumericDate(+first, +second, currentYear);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
// 6. Fall back to native Date parsing for other formats
|
|
115
|
+
// 6. Fall back to native Date parsing for other formats.
|
|
116
|
+
//
|
|
117
|
+
// Skip bare numeric input (e.g. "0", "1", "01", "2026"). These are
|
|
118
|
+
// in-progress values a user is still typing, not complete dates. Native
|
|
119
|
+
// `Date` parsing coerces them into arbitrary dates ("0" -> year 2000 in V8,
|
|
120
|
+
// year 0 in some engines), which is both surprising and — when the year
|
|
121
|
+
// resolves to 0 — produces an out-of-range date that throws downstream.
|
|
122
|
+
// Treat them as not-yet-a-valid-date instead.
|
|
123
|
+
if (/^\d+$/.test(trimmed)) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
116
126
|
const parsed = new Date(trimmed);
|
|
117
127
|
if (!isNaN(parsed.getTime())) {
|
|
118
|
-
|
|
128
|
+
const fromDate = plainDateFromDate(parsed);
|
|
129
|
+
// Validate the result so we never return an out-of-range date (e.g. a
|
|
130
|
+
// year of 0), which would throw when later re-parsed.
|
|
131
|
+
return tryCreatePlainDate(fromDate.year, fromDate.month, fromDate.day);
|
|
119
132
|
}
|
|
120
133
|
return null;
|
|
121
134
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Merge xds-* props, stylex.props result, and optional consumer className/style.
|
|
3
3
|
*
|
|
4
4
|
* stylex.props() returns { className, style }. This merges the Astryx stable
|
|
5
|
-
* class name plus any data-attribute reflection from `
|
|
5
|
+
* class name plus any data-attribute reflection from `themeProps()` with the
|
|
6
6
|
* StyleX class name so both StyleX styles and the theme-targeting surface are
|
|
7
7
|
* applied.
|
|
8
8
|
*
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```tsx
|
|
14
|
-
* // Root element with
|
|
14
|
+
* // Root element with themeProps
|
|
15
15
|
* <div {...mergeProps(
|
|
16
|
-
*
|
|
16
|
+
* themeProps('button', { variant }),
|
|
17
17
|
* stylex.props(styles.base, variants[variant]),
|
|
18
18
|
* className,
|
|
19
19
|
* style,
|
package/dist/utils/mergeProps.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Merge xds-* props, stylex.props result, and optional consumer className/style.
|
|
5
5
|
*
|
|
6
6
|
* stylex.props() returns { className, style }. This merges the Astryx stable
|
|
7
|
-
* class name plus any data-attribute reflection from `
|
|
7
|
+
* class name plus any data-attribute reflection from `themeProps()` with the
|
|
8
8
|
* StyleX class name so both StyleX styles and the theme-targeting surface are
|
|
9
9
|
* applied.
|
|
10
10
|
*
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```tsx
|
|
16
|
-
* // Root element with
|
|
16
|
+
* // Root element with themeProps
|
|
17
17
|
* <div {...mergeProps(
|
|
18
|
-
*
|
|
18
|
+
* themeProps('button', { variant }),
|
|
19
19
|
* stylex.props(styles.base, variants[variant]),
|
|
20
20
|
* className,
|
|
21
21
|
* style,
|
|
@@ -53,7 +53,7 @@ function mergeTwoProps(base, overrides) {
|
|
|
53
53
|
}
|
|
54
54
|
export function mergeProps(xdsClassOrStylexResult, stylexResultOrClassName, classNameOrStyle, style) {
|
|
55
55
|
// Disambiguate: first arg is string → (xdsClass, stylexResult, className?, style?)
|
|
56
|
-
// first arg is object → merge arbitrary props (supports
|
|
56
|
+
// first arg is object → merge arbitrary props (supports themeProps + data attrs).
|
|
57
57
|
if (typeof xdsClassOrStylexResult === 'string') {
|
|
58
58
|
const xdsClass = xdsClassOrStylexResult;
|
|
59
59
|
const stylexResult = stylexResultOrClassName ?? {
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* Used by both defineTheme (CSS generation) and components (class name rendering)
|
|
5
5
|
* to ensure the same convention is applied consistently.
|
|
6
6
|
*
|
|
7
|
-
* <!-- SYNC: packages/core/src/utils/
|
|
7
|
+
* <!-- SYNC: packages/core/src/utils/themeProps.ts -->
|
|
8
8
|
*
|
|
9
9
|
* Emits the legacy class-selector suffix used by defineTheme/component override
|
|
10
10
|
* generation today. Components also reflect the same prop values as data
|
|
11
|
-
* attributes via `
|
|
11
|
+
* attributes via `themeProps()` (`variant:secondary` renders both `.secondary`
|
|
12
12
|
* and `[data-variant="secondary"]` in the DOM), but generated theme CSS still
|
|
13
13
|
* uses these class selectors until the selector contract migrates fully.
|
|
14
14
|
*
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* Used by both defineTheme (CSS generation) and components (class name rendering)
|
|
7
7
|
* to ensure the same convention is applied consistently.
|
|
8
8
|
*
|
|
9
|
-
* <!-- SYNC: packages/core/src/utils/
|
|
9
|
+
* <!-- SYNC: packages/core/src/utils/themeProps.ts -->
|
|
10
10
|
*
|
|
11
11
|
* Emits the legacy class-selector suffix used by defineTheme/component override
|
|
12
12
|
* generation today. Components also reflect the same prop values as data
|
|
13
|
-
* attributes via `
|
|
13
|
+
* attributes via `themeProps()` (`variant:secondary` renders both `.secondary`
|
|
14
14
|
* and `[data-variant="secondary"]` in the DOM), but generated theme CSS still
|
|
15
15
|
* uses these class selectors until the selector contract migrates fully.
|
|
16
16
|
*
|
|
@@ -11,7 +11,7 @@ export type ThemeProps = {
|
|
|
11
11
|
* literal prop values, including numeric values (`level: 1` → `data-level="1"`).
|
|
12
12
|
* Nullish values are omitted.
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function themeDataAttributes(props?: ClassProps): ThemeDataAttributes;
|
|
15
15
|
/**
|
|
16
16
|
* Build the props object components should spread onto the same element that
|
|
17
17
|
* receives the stable Astryx class name.
|
|
@@ -20,9 +20,9 @@ export declare function xdsThemeDataAttributes(props?: ClassProps): ThemeDataAtt
|
|
|
20
20
|
* surface. For example:
|
|
21
21
|
*
|
|
22
22
|
* ```ts
|
|
23
|
-
*
|
|
23
|
+
* themeProps('button', { variant: 'primary', size: 'sm' })
|
|
24
24
|
* // → { className: 'astryx-button primary sm', data-variant: 'primary', data-size: 'sm' }
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
export declare function
|
|
28
|
-
//# sourceMappingURL=
|
|
27
|
+
export declare function themeProps(component: string, props?: ClassProps): ThemeProps;
|
|
28
|
+
//# sourceMappingURL=themeProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeProps.d.ts","sourceRoot":"","sources":["../../src/utils/themeProps.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;AAC5D,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAC/E,MAAM,MAAM,UAAU,GAAG;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,GAAG,mBAAmB,CAAC;AA6DnE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,GACjB,mBAAmB,CAarB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,UAAU,GACjB,UAAU,CAKZ"}
|
|
@@ -14,7 +14,7 @@ function classTokenForPropValue(prop, value) {
|
|
|
14
14
|
*
|
|
15
15
|
* Every component renders a stable base class (`astryx-button`, `astryx-card`,
|
|
16
16
|
* etc.) plus variant classes derived from visual props. Components also reflect
|
|
17
|
-
* those visual props as data attributes via `
|
|
17
|
+
* those visual props as data attributes via `themeProps()` (`data-variant`,
|
|
18
18
|
* `data-size`, `data-level`, etc.) so consumers target stable data-attribute
|
|
19
19
|
* selectors rather than collision-prone bare class names.
|
|
20
20
|
*
|
|
@@ -64,7 +64,7 @@ function buildClassName(component, props) {
|
|
|
64
64
|
* literal prop values, including numeric values (`level: 1` → `data-level="1"`).
|
|
65
65
|
* Nullish values are omitted.
|
|
66
66
|
*/
|
|
67
|
-
export function
|
|
67
|
+
export function themeDataAttributes(props) {
|
|
68
68
|
const attrs = {};
|
|
69
69
|
if (props) {
|
|
70
70
|
for (const [prop, value] of Object.entries(props)) {
|
|
@@ -85,13 +85,13 @@ export function xdsThemeDataAttributes(props) {
|
|
|
85
85
|
* surface. For example:
|
|
86
86
|
*
|
|
87
87
|
* ```ts
|
|
88
|
-
*
|
|
88
|
+
* themeProps('button', { variant: 'primary', size: 'sm' })
|
|
89
89
|
* // → { className: 'astryx-button primary sm', data-variant: 'primary', data-size: 'sm' }
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
export function
|
|
92
|
+
export function themeProps(component, props) {
|
|
93
93
|
return {
|
|
94
94
|
className: buildClassName(component, props),
|
|
95
|
-
...
|
|
95
|
+
...themeDataAttributes(props)
|
|
96
96
|
};
|
|
97
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-canary.08d4cf4",
|
|
4
4
|
"displayName": "XDS Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"url": "https://github.com/facebook/astryx/issues"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
|
-
"
|
|
18
|
+
"astryx",
|
|
19
19
|
"design-system",
|
|
20
20
|
"react",
|
|
21
21
|
"components",
|
|
@@ -27,7 +27,7 @@ import {Text} from '../Text/Text';
|
|
|
27
27
|
import {Button, type ButtonVariant} from '../Button';
|
|
28
28
|
import type {BaseProps} from '../BaseProps';
|
|
29
29
|
import {mergeProps} from '../utils';
|
|
30
|
-
import {
|
|
30
|
+
import {themeProps} from '../utils/themeProps';
|
|
31
31
|
|
|
32
32
|
export interface AlertDialogProps extends BaseProps<HTMLDialogElement> {
|
|
33
33
|
ref?: React.Ref<HTMLDialogElement>;
|
|
@@ -151,7 +151,7 @@ export function AlertDialog({
|
|
|
151
151
|
role="alertdialog"
|
|
152
152
|
aria-labelledby={titleId}
|
|
153
153
|
aria-describedby={descriptionId}
|
|
154
|
-
{...mergeProps(
|
|
154
|
+
{...mergeProps(themeProps('alert-dialog'), {className, style})}
|
|
155
155
|
xstyle={xstyle}
|
|
156
156
|
data-testid={testId}>
|
|
157
157
|
<Layout
|
|
@@ -52,7 +52,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
52
52
|
import {mergeProps, mergeRefs, isRenderable} from '../utils';
|
|
53
53
|
import {useMediaQuery} from '../hooks/useMediaQuery';
|
|
54
54
|
import {observeResize, unobserveResize} from '../utils/sharedResizeObserver';
|
|
55
|
-
import {
|
|
55
|
+
import {themeProps} from '../utils/themeProps';
|
|
56
56
|
|
|
57
57
|
const HasActivity = typeof React.Activity !== 'undefined';
|
|
58
58
|
const ActivityWrapper = HasActivity
|
|
@@ -667,7 +667,7 @@ export function AppShell({
|
|
|
667
667
|
<div
|
|
668
668
|
ref={headerRef}
|
|
669
669
|
{...mergeProps(
|
|
670
|
-
|
|
670
|
+
themeProps('app-shell-header', {variant}),
|
|
671
671
|
stylex.props(navAreaStyle, isAuto && styles.headerSticky),
|
|
672
672
|
)}>
|
|
673
673
|
{headerInner}
|
|
@@ -687,7 +687,7 @@ export function AppShell({
|
|
|
687
687
|
padding={0}
|
|
688
688
|
hasDivider={navHasDividers}
|
|
689
689
|
isScrollable={isFill}
|
|
690
|
-
{...
|
|
690
|
+
{...themeProps('app-shell-sidenav', {variant})}
|
|
691
691
|
xstyle={[
|
|
692
692
|
navAreaStyle,
|
|
693
693
|
isAuto && stickyBgStyle,
|
|
@@ -748,7 +748,7 @@ export function AppShell({
|
|
|
748
748
|
shouldShowAutoToggle && !hasTopNav && hasSideNav ? (
|
|
749
749
|
<div
|
|
750
750
|
{...mergeProps(
|
|
751
|
-
|
|
751
|
+
themeProps('app-shell-header', {variant}),
|
|
752
752
|
stylex.props(navAreaStyle, isAuto && styles.headerSticky),
|
|
753
753
|
)}>
|
|
754
754
|
<LayoutHeader padding={0} hasDivider={navHasDividers}>
|
|
@@ -771,7 +771,7 @@ export function AppShell({
|
|
|
771
771
|
ref={mergeRefs(ref, shellRef)}
|
|
772
772
|
data-testid={dataTestId}
|
|
773
773
|
{...mergeProps(
|
|
774
|
-
|
|
774
|
+
themeProps('app-shell', {variant}),
|
|
775
775
|
stylex.props(
|
|
776
776
|
styles.root,
|
|
777
777
|
variant === 'wash'
|
|
@@ -19,7 +19,7 @@ import type {ReactNode} from 'react';
|
|
|
19
19
|
import * as stylex from '@stylexjs/stylex';
|
|
20
20
|
import type {BaseProps} from '../BaseProps';
|
|
21
21
|
import {mergeProps} from '../utils';
|
|
22
|
-
import {
|
|
22
|
+
import {themeProps} from '../utils/themeProps';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The shape of the aspect ratio container.
|
|
@@ -123,7 +123,7 @@ export function AspectRatio({
|
|
|
123
123
|
<div
|
|
124
124
|
ref={ref}
|
|
125
125
|
{...mergeProps(
|
|
126
|
-
|
|
126
|
+
themeProps('aspect-ratio', {shape}),
|
|
127
127
|
stylex.props(
|
|
128
128
|
styles.container,
|
|
129
129
|
shape === 'ellipse' && styles.ellipse,
|
package/src/Avatar/Avatar.tsx
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import {AvatarSizeContext} from './AvatarSizeContext';
|
|
28
28
|
import {useAvatarGroup} from '../AvatarGroup/AvatarGroupContext';
|
|
29
29
|
import {mergeProps} from '../utils';
|
|
30
|
-
import {
|
|
30
|
+
import {themeProps} from '../utils/themeProps';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* The offset ratio for positioning elements on a circle's edge at 45°.
|
|
@@ -310,7 +310,7 @@ export function Avatar({
|
|
|
310
310
|
aria-label={accessibleName}
|
|
311
311
|
data-testid={testId}
|
|
312
312
|
{...mergeProps(
|
|
313
|
-
|
|
313
|
+
themeProps('avatar', {size: resolvedSize}),
|
|
314
314
|
stylex.props(
|
|
315
315
|
styles.wrapper,
|
|
316
316
|
avatarGroup && groupStyles.ring,
|
|
@@ -21,7 +21,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
21
21
|
import {colorVars, radiusVars} from '../theme/tokens.stylex';
|
|
22
22
|
import {AvatarSizeContext} from './AvatarSizeContext';
|
|
23
23
|
import {mergeProps} from '../utils';
|
|
24
|
-
import {
|
|
24
|
+
import {themeProps} from '../utils/themeProps';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Resolves the status dot size, border width, and icon size based on the
|
|
@@ -196,7 +196,7 @@ export function AvatarStatusDot({
|
|
|
196
196
|
ref={ref}
|
|
197
197
|
{...(label ? {role: 'img', 'aria-label': label} : undefined)}
|
|
198
198
|
{...mergeProps(
|
|
199
|
-
|
|
199
|
+
themeProps('avatar-status-dot', {variant}),
|
|
200
200
|
stylex.props(
|
|
201
201
|
styles.dot,
|
|
202
202
|
variantStyleMap[variant],
|
|
@@ -24,7 +24,7 @@ import {resolveSize, type AvatarSize} from '../Avatar';
|
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
25
|
import {mergeProps} from '../utils';
|
|
26
26
|
import {AvatarGroupContext} from './AvatarGroupContext';
|
|
27
|
-
import {
|
|
27
|
+
import {themeProps} from '../utils/themeProps';
|
|
28
28
|
|
|
29
29
|
const OVERLAP_RATIO = 0.25;
|
|
30
30
|
|
|
@@ -99,7 +99,7 @@ export function AvatarGroup({
|
|
|
99
99
|
aria-label={ariaLabel}
|
|
100
100
|
data-testid={testId}
|
|
101
101
|
{...mergeProps(
|
|
102
|
-
|
|
102
|
+
themeProps('avatar-group', {size}),
|
|
103
103
|
stylex.props(styles.root, xstyle),
|
|
104
104
|
className,
|
|
105
105
|
style,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import {mergeProps} from '../utils';
|
|
25
25
|
import {useAvatarGroup} from './AvatarGroupContext';
|
|
26
26
|
import type {BaseProps} from '../BaseProps';
|
|
27
|
-
import {
|
|
27
|
+
import {themeProps} from '../utils/themeProps';
|
|
28
28
|
|
|
29
29
|
const BORDER_WIDTH = 2;
|
|
30
30
|
const OVERFLOW_FONT_RATIO = 0.35;
|
|
@@ -148,7 +148,7 @@ export function AvatarGroupOverflow({
|
|
|
148
148
|
onClick={onClick}
|
|
149
149
|
aria-label={label}
|
|
150
150
|
{...mergeProps(
|
|
151
|
-
|
|
151
|
+
themeProps('avatar-group-overflow'),
|
|
152
152
|
stylex.props(
|
|
153
153
|
styles.base,
|
|
154
154
|
styles.button,
|
|
@@ -171,7 +171,7 @@ export function AvatarGroupOverflow({
|
|
|
171
171
|
ref={ref}
|
|
172
172
|
aria-label={label}
|
|
173
173
|
{...mergeProps(
|
|
174
|
-
|
|
174
|
+
themeProps('avatar-group-overflow'),
|
|
175
175
|
stylex.props(
|
|
176
176
|
styles.base,
|
|
177
177
|
styles.overlap,
|
package/src/Badge/Badge.tsx
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
typeScaleVars,
|
|
28
28
|
} from '../theme/tokens.stylex';
|
|
29
29
|
import {mergeProps} from '../utils';
|
|
30
|
-
import {
|
|
30
|
+
import {themeProps} from '../utils/themeProps';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Base badge styles
|
|
@@ -198,7 +198,7 @@ export function Badge({
|
|
|
198
198
|
<span
|
|
199
199
|
ref={ref}
|
|
200
200
|
{...mergeProps(
|
|
201
|
-
|
|
201
|
+
themeProps('badge', {variant}),
|
|
202
202
|
stylex.props(styles.base, variants[variant], xstyle),
|
|
203
203
|
className,
|
|
204
204
|
style,
|
package/src/Banner/Banner.tsx
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Visual structure:
|
|
12
12
|
* - Root container: layout-only wrapper (flex column), no visual styling, no theme target
|
|
13
|
-
* - Header area (
|
|
14
|
-
* - Content area (
|
|
13
|
+
* - Header area (themeProps 'banner'): colored status background with icon, title, description, actions, dismiss
|
|
14
|
+
* - Content area (themeProps 'banner-content'): collapsible card background for additional content (children)
|
|
15
15
|
* - No left border accent — color is expressed through the full header background
|
|
16
16
|
* - Each visual area owns its own border-radius (no overflow:clip on the container)
|
|
17
17
|
* - When children are provided, a collapse/expand toggle button appears in the end area
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from '../theme/tokens.stylex';
|
|
43
43
|
import {mergeProps} from '../utils';
|
|
44
44
|
import {edgeCompSlot} from '../Layout/edgeCompensation.stylex';
|
|
45
|
-
import {
|
|
45
|
+
import {themeProps} from '../utils/themeProps';
|
|
46
46
|
|
|
47
47
|
// =============================================================================
|
|
48
48
|
// Types
|
|
@@ -417,7 +417,7 @@ export function Banner({
|
|
|
417
417
|
{/* Header: colored status background — primary theme target ('banner') */}
|
|
418
418
|
<div
|
|
419
419
|
{...mergeProps(
|
|
420
|
-
|
|
420
|
+
themeProps('banner', {container, status}),
|
|
421
421
|
stylex.props(
|
|
422
422
|
styles.header,
|
|
423
423
|
isSingleLine && styles.headerCentered,
|
|
@@ -430,7 +430,7 @@ export function Banner({
|
|
|
430
430
|
)}>
|
|
431
431
|
<div
|
|
432
432
|
{...mergeProps(
|
|
433
|
-
|
|
433
|
+
themeProps('banner-icon', {status}),
|
|
434
434
|
stylex.props(styles.iconWrapper),
|
|
435
435
|
)}
|
|
436
436
|
aria-hidden="true">
|
|
@@ -491,7 +491,7 @@ export function Banner({
|
|
|
491
491
|
{showContent && (
|
|
492
492
|
<div
|
|
493
493
|
{...mergeProps(
|
|
494
|
-
|
|
494
|
+
themeProps('banner-content', {container, status}),
|
|
495
495
|
stylex.props(styles.contentArea, isCard && styles.contentAreaCard),
|
|
496
496
|
)}>
|
|
497
497
|
{children}
|
|
@@ -20,7 +20,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
20
20
|
import * as stylex from '@stylexjs/stylex';
|
|
21
21
|
import {colorVars, spacingVars, typeScaleVars} from '../theme/tokens.stylex';
|
|
22
22
|
import {mergeProps} from '../utils';
|
|
23
|
-
import {
|
|
23
|
+
import {themeProps} from '../utils/themeProps';
|
|
24
24
|
|
|
25
25
|
export interface BlockquoteProps extends BaseProps<HTMLQuoteElement> {
|
|
26
26
|
/** Ref forwarded to the root <blockquote> element */
|
|
@@ -78,7 +78,7 @@ export function Blockquote({
|
|
|
78
78
|
<blockquote
|
|
79
79
|
ref={ref}
|
|
80
80
|
{...mergeProps(
|
|
81
|
-
|
|
81
|
+
themeProps('blockquote'),
|
|
82
82
|
stylex.props(styles.root, xstyle),
|
|
83
83
|
className,
|
|
84
84
|
style,
|
|
@@ -30,7 +30,7 @@ import {useLinkComponent} from '../Link/useLinkComponent';
|
|
|
30
30
|
import type {LinkComponentType} from '../Link/types';
|
|
31
31
|
import {mergeProps, mergeRefs} from '../utils';
|
|
32
32
|
import type {BaseProps} from '../BaseProps';
|
|
33
|
-
import {
|
|
33
|
+
import {themeProps} from '../utils/themeProps';
|
|
34
34
|
|
|
35
35
|
// =============================================================================
|
|
36
36
|
// Props
|
|
@@ -231,7 +231,7 @@ export function BreadcrumbItem({
|
|
|
231
231
|
<li
|
|
232
232
|
ref={mergeRefs(ref, liRef)}
|
|
233
233
|
{...mergeProps(
|
|
234
|
-
|
|
234
|
+
themeProps('breadcrumb-item'),
|
|
235
235
|
stylex.props(
|
|
236
236
|
itemStyles.root,
|
|
237
237
|
isSupporting ? itemStyles.supportingSize : itemStyles.defaultSize,
|
|
@@ -265,7 +265,7 @@ export function BreadcrumbItem({
|
|
|
265
265
|
<li
|
|
266
266
|
ref={mergeRefs(ref, liRef)}
|
|
267
267
|
{...mergeProps(
|
|
268
|
-
|
|
268
|
+
themeProps('breadcrumb-item'),
|
|
269
269
|
stylex.props(
|
|
270
270
|
itemStyles.root,
|
|
271
271
|
isSupporting ? itemStyles.supportingSize : itemStyles.defaultSize,
|
|
@@ -21,7 +21,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
21
21
|
import {spacingVars} from '../theme/tokens.stylex';
|
|
22
22
|
import {mergeProps} from '../utils';
|
|
23
23
|
import type {BaseProps} from '../BaseProps';
|
|
24
|
-
import {
|
|
24
|
+
import {themeProps} from '../utils/themeProps';
|
|
25
25
|
|
|
26
26
|
// =============================================================================
|
|
27
27
|
// Variant type
|
|
@@ -165,7 +165,7 @@ export function Breadcrumbs({
|
|
|
165
165
|
ref={ref}
|
|
166
166
|
aria-label={label}
|
|
167
167
|
{...mergeProps(
|
|
168
|
-
|
|
168
|
+
themeProps('breadcrumbs', {variant}),
|
|
169
169
|
stylex.props(navStyles.root, xstyle),
|
|
170
170
|
className,
|
|
171
171
|
style,
|
package/src/Button/Button.tsx
CHANGED
|
@@ -41,7 +41,7 @@ import {useButtonGroup} from '../ButtonGroup/ButtonGroupContext';
|
|
|
41
41
|
import {mergeProps} from '../utils';
|
|
42
42
|
import {useLinkComponent} from '../Link/useLinkComponent';
|
|
43
43
|
import type {LinkComponentType} from '../Link/types';
|
|
44
|
-
import {
|
|
44
|
+
import {themeProps} from '../utils/themeProps';
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Base button styles
|
|
@@ -588,7 +588,7 @@ export function Button({
|
|
|
588
588
|
);
|
|
589
589
|
|
|
590
590
|
const sharedMergedProps = mergeProps(
|
|
591
|
-
|
|
591
|
+
themeProps('button', {variant, size}),
|
|
592
592
|
sharedStylexProps,
|
|
593
593
|
className,
|
|
594
594
|
style,
|
|
@@ -29,7 +29,7 @@ import {mergeProps, mergeRefs} from '../utils';
|
|
|
29
29
|
import type {BaseProps} from '../BaseProps';
|
|
30
30
|
import {ButtonGroupContext} from './ButtonGroupContext';
|
|
31
31
|
import type {ButtonGroupOrientation} from './ButtonGroupContext';
|
|
32
|
-
import {
|
|
32
|
+
import {themeProps} from '../utils/themeProps';
|
|
33
33
|
|
|
34
34
|
// =============================================================================
|
|
35
35
|
// Props
|
|
@@ -145,7 +145,7 @@ export function ButtonGroup({
|
|
|
145
145
|
aria-disabled={isDisabled || undefined}
|
|
146
146
|
data-testid={testId}
|
|
147
147
|
{...mergeProps(
|
|
148
|
-
|
|
148
|
+
themeProps('button-group', {size, orientation}),
|
|
149
149
|
stylex.props(
|
|
150
150
|
styles.group,
|
|
151
151
|
orientation === 'vertical' && styles.vertical,
|