@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
|
@@ -36,7 +36,7 @@ import React, {
|
|
|
36
36
|
import type {ReactNode} from 'react';
|
|
37
37
|
import * as stylex from '@stylexjs/stylex';
|
|
38
38
|
import {useLayer} from '../Layer/useLayer';
|
|
39
|
-
import {
|
|
39
|
+
import {renderDropdownItems} from '../DropdownMenu/renderDropdownItems';
|
|
40
40
|
import {
|
|
41
41
|
DropdownMenuContext,
|
|
42
42
|
type DropdownMenuContextValue,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
} from '../theme/tokens.stylex';
|
|
54
54
|
import {mergeProps} from '../utils';
|
|
55
55
|
import type {BaseProps} from '../BaseProps';
|
|
56
|
-
import {
|
|
56
|
+
import {themeProps} from '../utils/themeProps';
|
|
57
57
|
import type {
|
|
58
58
|
DropdownMenuOption,
|
|
59
59
|
DropdownMenuItemData,
|
|
@@ -278,7 +278,7 @@ export function ContextMenu({
|
|
|
278
278
|
);
|
|
279
279
|
|
|
280
280
|
const resolvedMenuContent =
|
|
281
|
-
props.items !== undefined ?
|
|
281
|
+
props.items !== undefined ? renderDropdownItems(items) : menuContent;
|
|
282
282
|
|
|
283
283
|
return (
|
|
284
284
|
<>
|
|
@@ -297,7 +297,7 @@ export function ContextMenu({
|
|
|
297
297
|
role="menu"
|
|
298
298
|
onKeyDown={listKeyDown}
|
|
299
299
|
{...mergeProps(
|
|
300
|
-
|
|
300
|
+
themeProps('context-menu'),
|
|
301
301
|
stylex.props(styles.menu, xstyle),
|
|
302
302
|
className,
|
|
303
303
|
style,
|
|
@@ -21,19 +21,13 @@ describe('DateInput', () => {
|
|
|
21
21
|
|
|
22
22
|
it('renders with placeholder', () => {
|
|
23
23
|
render(
|
|
24
|
-
<DateInput
|
|
25
|
-
label="Date"
|
|
26
|
-
onChange={() => {}}
|
|
27
|
-
placeholder="Pick a date"
|
|
28
|
-
/>,
|
|
24
|
+
<DateInput label="Date" onChange={() => {}} placeholder="Pick a date" />,
|
|
29
25
|
);
|
|
30
26
|
expect(screen.getByPlaceholderText('Pick a date')).toBeInTheDocument();
|
|
31
27
|
});
|
|
32
28
|
|
|
33
29
|
it('displays formatted date when value is provided', () => {
|
|
34
|
-
render(
|
|
35
|
-
<DateInput label="Date" value="2026-01-25" onChange={() => {}} />,
|
|
36
|
-
);
|
|
30
|
+
render(<DateInput label="Date" value="2026-01-25" onChange={() => {}} />);
|
|
37
31
|
expect(screen.getByDisplayValue('January 25, 2026')).toBeInTheDocument();
|
|
38
32
|
});
|
|
39
33
|
|
|
@@ -118,9 +112,7 @@ describe('DateInput', () => {
|
|
|
118
112
|
|
|
119
113
|
it('reverts to previous value on blur when input is invalid', async () => {
|
|
120
114
|
const onChange = vi.fn();
|
|
121
|
-
render(
|
|
122
|
-
<DateInput label="Date" value="2026-01-25" onChange={onChange} />,
|
|
123
|
-
);
|
|
115
|
+
render(<DateInput label="Date" value="2026-01-25" onChange={onChange} />);
|
|
124
116
|
|
|
125
117
|
const input = screen.getByRole('combobox');
|
|
126
118
|
fireEvent.change(input, {target: {value: 'not a date'}});
|
|
@@ -299,9 +291,7 @@ describe('DateInput', () => {
|
|
|
299
291
|
// --- P1: Tab order: calendar button first, then input ---
|
|
300
292
|
|
|
301
293
|
it('renders calendar button before input in DOM order', () => {
|
|
302
|
-
const {container} = render(
|
|
303
|
-
<DateInput label="Date" onChange={() => {}} />,
|
|
304
|
-
);
|
|
294
|
+
const {container} = render(<DateInput label="Date" onChange={() => {}} />);
|
|
305
295
|
const input = container.querySelector('input');
|
|
306
296
|
const button = container.querySelector('button');
|
|
307
297
|
// Calendar button should come before input in the DOM
|
|
@@ -389,9 +379,7 @@ describe('DateInput', () => {
|
|
|
389
379
|
|
|
390
380
|
it('calls onChange with undefined when input is cleared and blurred', () => {
|
|
391
381
|
const onChange = vi.fn();
|
|
392
|
-
render(
|
|
393
|
-
<DateInput label="Date" value="2026-01-25" onChange={onChange} />,
|
|
394
|
-
);
|
|
382
|
+
render(<DateInput label="Date" value="2026-01-25" onChange={onChange} />);
|
|
395
383
|
|
|
396
384
|
const input = screen.getByRole('combobox');
|
|
397
385
|
fireEvent.change(input, {target: {value: ''}});
|
|
@@ -476,9 +464,7 @@ describe('DateInput', () => {
|
|
|
476
464
|
});
|
|
477
465
|
|
|
478
466
|
it('does not show clear button when hasClear is false', () => {
|
|
479
|
-
render(
|
|
480
|
-
<DateInput label="Date" value="2026-01-15" onChange={() => {}} />,
|
|
481
|
-
);
|
|
467
|
+
render(<DateInput label="Date" value="2026-01-15" onChange={() => {}} />);
|
|
482
468
|
expect(
|
|
483
469
|
screen.queryByRole('button', {name: 'Clear Date'}),
|
|
484
470
|
).not.toBeInTheDocument();
|
|
@@ -514,6 +500,68 @@ describe('DateInput', () => {
|
|
|
514
500
|
});
|
|
515
501
|
});
|
|
516
502
|
|
|
503
|
+
// --- Regression: in-progress / leading-zero input must not crash ---
|
|
504
|
+
|
|
505
|
+
describe('incomplete typed input', () => {
|
|
506
|
+
it('does not crash or fire onChange when first digit typed is 0', () => {
|
|
507
|
+
const onChange = vi.fn();
|
|
508
|
+
render(<DateInput label="Date" onChange={onChange} />);
|
|
509
|
+
|
|
510
|
+
const input = screen.getByRole('combobox');
|
|
511
|
+
// Typing a leading "0" (e.g. starting "01" for January) must be treated
|
|
512
|
+
// as incomplete input, not coerced into an (invalid) date that crashes.
|
|
513
|
+
expect(() =>
|
|
514
|
+
fireEvent.change(input, {target: {value: '0'}}),
|
|
515
|
+
).not.toThrow();
|
|
516
|
+
|
|
517
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
518
|
+
expect(input).toHaveValue('0');
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
it('does not crash or fire onChange when first digit typed is 1', () => {
|
|
522
|
+
const onChange = vi.fn();
|
|
523
|
+
render(<DateInput label="Date" onChange={onChange} />);
|
|
524
|
+
|
|
525
|
+
const input = screen.getByRole('combobox');
|
|
526
|
+
expect(() =>
|
|
527
|
+
fireEvent.change(input, {target: {value: '1'}}),
|
|
528
|
+
).not.toThrow();
|
|
529
|
+
|
|
530
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
531
|
+
expect(input).toHaveValue('1');
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
it('does not crash while progressively typing a numeric date', () => {
|
|
535
|
+
const onChange = vi.fn();
|
|
536
|
+
render(<DateInput label="Date" onChange={onChange} />);
|
|
537
|
+
|
|
538
|
+
const input = screen.getByRole('combobox');
|
|
539
|
+
// Simulate keystroke-by-keystroke entry of "01/15/2026". The leading
|
|
540
|
+
// single-digit keystrokes must not crash (the original bug).
|
|
541
|
+
for (const partial of ['0', '01', '01/', '01/1', '01/15', '01/15/']) {
|
|
542
|
+
expect(() =>
|
|
543
|
+
fireEvent.change(input, {target: {value: partial}}),
|
|
544
|
+
).not.toThrow();
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// Completing the date commits it without error.
|
|
548
|
+
expect(() =>
|
|
549
|
+
fireEvent.change(input, {target: {value: '01/15/2026'}}),
|
|
550
|
+
).not.toThrow();
|
|
551
|
+
expect(onChange).toHaveBeenCalledWith('2026-01-15');
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
it('does not crash on blur after typing an incomplete value', () => {
|
|
555
|
+
const onChange = vi.fn();
|
|
556
|
+
render(<DateInput label="Date" onChange={onChange} />);
|
|
557
|
+
|
|
558
|
+
const input = screen.getByRole('combobox');
|
|
559
|
+
fireEvent.change(input, {target: {value: '0'}});
|
|
560
|
+
expect(() => fireEvent.blur(input)).not.toThrow();
|
|
561
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
|
|
517
565
|
describe('external value changes', () => {
|
|
518
566
|
it('clears pending input when value changes externally', () => {
|
|
519
567
|
const onChange = vi.fn();
|
|
@@ -135,7 +135,7 @@ export type {
|
|
|
135
135
|
import {mergeProps, mergeRefs} from '../utils';
|
|
136
136
|
import type {BaseProps} from '../BaseProps';
|
|
137
137
|
import type {SizeValue} from '../utils/types';
|
|
138
|
-
import {
|
|
138
|
+
import {themeProps} from '../utils/themeProps';
|
|
139
139
|
|
|
140
140
|
export interface DateInputProps extends Omit<
|
|
141
141
|
BaseProps,
|
|
@@ -516,7 +516,7 @@ export function DateInput({
|
|
|
516
516
|
ref={popover.triggerRef}
|
|
517
517
|
{...rest}
|
|
518
518
|
{...mergeProps(
|
|
519
|
-
|
|
519
|
+
themeProps('date-input', {size, status: status?.type ?? null}),
|
|
520
520
|
stylex.props(
|
|
521
521
|
inputWrapperStyles.base,
|
|
522
522
|
sizeStyles[size],
|
|
@@ -52,7 +52,7 @@ import {mergeProps} from '../utils';
|
|
|
52
52
|
import type {BaseProps} from '../BaseProps';
|
|
53
53
|
import type {SizeValue} from '../utils/types';
|
|
54
54
|
import {useSize} from '../SizeContext/SizeContext';
|
|
55
|
-
import {
|
|
55
|
+
import {themeProps} from '../utils/themeProps';
|
|
56
56
|
|
|
57
57
|
export type {DateRange} from '../Calendar';
|
|
58
58
|
|
|
@@ -490,7 +490,7 @@ export function DateRangeInput({
|
|
|
490
490
|
ref={popover.triggerRef}
|
|
491
491
|
{...rest}
|
|
492
492
|
{...mergeProps(
|
|
493
|
-
|
|
493
|
+
themeProps('date-range-input', {
|
|
494
494
|
size,
|
|
495
495
|
status: status?.type ?? null,
|
|
496
496
|
}),
|
|
@@ -78,7 +78,7 @@ import type {StyleXStyles} from '@stylexjs/stylex';
|
|
|
78
78
|
import type {BaseProps} from '../BaseProps';
|
|
79
79
|
import type {SizeValue} from '../utils/types';
|
|
80
80
|
import {useSize} from '../SizeContext/SizeContext';
|
|
81
|
-
import {
|
|
81
|
+
import {themeProps} from '../utils/themeProps';
|
|
82
82
|
|
|
83
83
|
export type ISODateTimeString = string & {
|
|
84
84
|
readonly __brand: 'ISODateTimeString';
|
|
@@ -790,7 +790,7 @@ export function DateTimeInput({
|
|
|
790
790
|
<div
|
|
791
791
|
{...rest}
|
|
792
792
|
{...mergeProps(
|
|
793
|
-
|
|
793
|
+
themeProps('date-time-input', {
|
|
794
794
|
size,
|
|
795
795
|
status: status?.type ?? null,
|
|
796
796
|
}),
|
package/src/Dialog/Dialog.tsx
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
import type {SpacingStep} from '../utils/types';
|
|
40
40
|
import {mergeProps, mergeRefs} from '../utils';
|
|
41
41
|
import {DialogContext} from './DialogContext';
|
|
42
|
-
import {
|
|
42
|
+
import {themeProps} from '../utils/themeProps';
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Calculate a directional translate offset for dialog entry animation.
|
|
@@ -505,7 +505,7 @@ export function Dialog({
|
|
|
505
505
|
return (
|
|
506
506
|
<div
|
|
507
507
|
{...mergeProps(
|
|
508
|
-
|
|
508
|
+
themeProps('dialog', {variant}),
|
|
509
509
|
stylex.props(
|
|
510
510
|
styles.inlineWrapper,
|
|
511
511
|
!isFullscreen && dynamicStyles.sizing(width, maxHeight),
|
|
@@ -539,7 +539,7 @@ export function Dialog({
|
|
|
539
539
|
aria-modal="true"
|
|
540
540
|
role={purpose === 'required' ? 'alertdialog' : undefined}
|
|
541
541
|
{...mergeProps(
|
|
542
|
-
|
|
542
|
+
themeProps('dialog', {variant}),
|
|
543
543
|
stylex.props(
|
|
544
544
|
styles.dialog,
|
|
545
545
|
isOpen && styles.open,
|
|
@@ -108,7 +108,7 @@ export const docsZh = {
|
|
|
108
108
|
|
|
109
109
|
/** @type {import('../docs-types').TranslationDoc} */
|
|
110
110
|
export const docsDense = {
|
|
111
|
-
description: 'visual separator w/ optional label, using
|
|
111
|
+
description: 'visual separator w/ optional label, using Astryx design tokens',
|
|
112
112
|
usage: {
|
|
113
113
|
description: 'A visual separator that divides content into distinct sections. Use to create clear boundaries between groups of related content, or to demarcate interactive regions within a layout.',
|
|
114
114
|
bestPractices: [
|
package/src/Divider/Divider.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
borderVars,
|
|
27
27
|
} from '../theme/tokens.stylex';
|
|
28
28
|
import {mergeProps} from '../utils';
|
|
29
|
-
import {
|
|
29
|
+
import {themeProps} from '../utils/themeProps';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Extensible variant map for Divider.
|
|
@@ -197,7 +197,7 @@ export function Divider({
|
|
|
197
197
|
role="separator"
|
|
198
198
|
aria-orientation={orientation}
|
|
199
199
|
{...mergeProps(
|
|
200
|
-
|
|
200
|
+
themeProps('divider', {variant, orientation}),
|
|
201
201
|
stylex.props(
|
|
202
202
|
isHorizontal ? baseStyles.horizontal : baseStyles.vertical,
|
|
203
203
|
isFullBleed &&
|
|
@@ -37,7 +37,7 @@ import {Button, type ButtonProps} from '../Button';
|
|
|
37
37
|
import {Icon} from '../Icon';
|
|
38
38
|
import type {IconType} from '../Icon';
|
|
39
39
|
|
|
40
|
-
import {
|
|
40
|
+
import {renderDropdownItems} from './renderDropdownItems';
|
|
41
41
|
import {
|
|
42
42
|
DropdownMenuContext,
|
|
43
43
|
type DropdownMenuContextValue,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
} from '../theme/tokens.stylex';
|
|
54
54
|
import {mergeProps} from '../utils';
|
|
55
55
|
import type {BaseProps} from '../BaseProps';
|
|
56
|
-
import {
|
|
56
|
+
import {themeProps} from '../utils/themeProps';
|
|
57
57
|
|
|
58
58
|
const styles = stylex.create({
|
|
59
59
|
dropdown: {
|
|
@@ -366,7 +366,7 @@ export function DropdownMenu({
|
|
|
366
366
|
|
|
367
367
|
// Resolve menu content: data-driven items become components
|
|
368
368
|
const menuContent =
|
|
369
|
-
props.items !== undefined ?
|
|
369
|
+
props.items !== undefined ? renderDropdownItems(items) : children;
|
|
370
370
|
|
|
371
371
|
return (
|
|
372
372
|
<>
|
|
@@ -401,7 +401,7 @@ export function DropdownMenu({
|
|
|
401
401
|
role="menu"
|
|
402
402
|
onKeyDown={listKeyDown}
|
|
403
403
|
{...mergeProps(
|
|
404
|
-
|
|
404
|
+
themeProps('dropdown-menu'),
|
|
405
405
|
stylex.props(styles.dropdown, xstyle),
|
|
406
406
|
className,
|
|
407
407
|
style,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from '../theme/tokens.stylex';
|
|
37
37
|
import {mergeProps} from '../utils';
|
|
38
38
|
import {useDropdownMenuContext} from './DropdownMenuContext';
|
|
39
|
-
import {
|
|
39
|
+
import {themeProps} from '../utils/themeProps';
|
|
40
40
|
|
|
41
41
|
const menuItemStyles = stylex.create({
|
|
42
42
|
root: {
|
|
@@ -161,7 +161,7 @@ export function DropdownMenuItem({
|
|
|
161
161
|
isDisabled && menuItemStyles.disabled,
|
|
162
162
|
xstyle,
|
|
163
163
|
]}
|
|
164
|
-
{...mergeProps(
|
|
164
|
+
{...mergeProps(themeProps('dropdown-menu-item', {size: menuSize}), {
|
|
165
165
|
className,
|
|
166
166
|
style,
|
|
167
167
|
})}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file
|
|
4
|
+
* @file renderDropdownItems.tsx
|
|
5
5
|
* @output Converts data-driven menu items into DropdownMenuItem components
|
|
6
6
|
* @position Utility; used by DropdownMenu to unify data-driven and compound paths
|
|
7
7
|
*/
|
|
@@ -49,7 +49,7 @@ function getSectionKey(section: DropdownMenuSection, index: number): string {
|
|
|
49
49
|
* Converts data-driven items into DropdownMenuItem components,
|
|
50
50
|
* so both modes share the same rendering and keyboard navigation path.
|
|
51
51
|
*/
|
|
52
|
-
export function
|
|
52
|
+
export function renderDropdownItems(
|
|
53
53
|
items: DropdownMenuOption[],
|
|
54
54
|
): ReactNode {
|
|
55
55
|
const elements: ReactNode[] = [];
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from '../theme/tokens.stylex';
|
|
25
25
|
import type {BaseProps} from '../BaseProps';
|
|
26
26
|
import {mergeProps} from '../utils';
|
|
27
|
-
import {
|
|
27
|
+
import {themeProps} from '../utils/themeProps';
|
|
28
28
|
|
|
29
29
|
const styles = stylex.create({
|
|
30
30
|
container: {
|
|
@@ -156,7 +156,7 @@ export function EmptyState({
|
|
|
156
156
|
ref={ref}
|
|
157
157
|
role="status"
|
|
158
158
|
{...mergeProps(
|
|
159
|
-
|
|
159
|
+
themeProps('empty-state', {variant: isCompact ? 'compact' : null}),
|
|
160
160
|
stylex.props(
|
|
161
161
|
styles.container,
|
|
162
162
|
isCompact && styles.containerCompact,
|
package/src/Field/Field.tsx
CHANGED
|
@@ -27,7 +27,7 @@ import type {IconType} from '../Icon';
|
|
|
27
27
|
import {mergeProps} from '../utils';
|
|
28
28
|
import {FormLayoutContext} from '../FormLayout/FormLayoutContext';
|
|
29
29
|
import {Text} from '../Text';
|
|
30
|
-
import {
|
|
30
|
+
import {themeProps} from '../utils/themeProps';
|
|
31
31
|
|
|
32
32
|
const styles = stylex.create({
|
|
33
33
|
container: {
|
|
@@ -236,7 +236,7 @@ export function Field({
|
|
|
236
236
|
<div
|
|
237
237
|
ref={ref}
|
|
238
238
|
{...mergeProps(
|
|
239
|
-
|
|
239
|
+
themeProps('field', {layout: 'horizontal-labels'}),
|
|
240
240
|
stylex.props(styles.horizontalLabels, xstyle),
|
|
241
241
|
className,
|
|
242
242
|
style,
|
|
@@ -264,7 +264,7 @@ export function Field({
|
|
|
264
264
|
<div
|
|
265
265
|
ref={ref}
|
|
266
266
|
{...mergeProps(
|
|
267
|
-
|
|
267
|
+
themeProps('field'),
|
|
268
268
|
stylex.props(
|
|
269
269
|
styles.container,
|
|
270
270
|
!isLabelHidden && styles.containerGap,
|
package/src/Field/FieldLabel.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '../theme/tokens.stylex';
|
|
27
27
|
import {Icon, renderIconSlot, type IconType} from '../Icon';
|
|
28
28
|
import {Tooltip} from '../Tooltip';
|
|
29
|
-
import {
|
|
29
|
+
import {themeProps} from '../utils/themeProps';
|
|
30
30
|
|
|
31
31
|
const styles = stylex.create({
|
|
32
32
|
label: {
|
|
@@ -158,7 +158,7 @@ export function FieldLabel({
|
|
|
158
158
|
ref={ref}
|
|
159
159
|
htmlFor={inputID}
|
|
160
160
|
{...mergeProps(
|
|
161
|
-
|
|
161
|
+
themeProps('field-label'),
|
|
162
162
|
stylex.props(
|
|
163
163
|
styles.label,
|
|
164
164
|
isDisabled && styles.labelDisabled,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from '../theme/tokens.stylex';
|
|
30
30
|
import type {InputStatusType} from '../Field/types';
|
|
31
31
|
import {useEntryAnimation} from '../hooks/useEntryAnimation';
|
|
32
|
-
import {
|
|
32
|
+
import {themeProps} from '../utils/themeProps';
|
|
33
33
|
|
|
34
34
|
const styles = stylex.create({
|
|
35
35
|
base: {
|
|
@@ -147,7 +147,7 @@ export function FieldStatus({
|
|
|
147
147
|
aria-live={type === 'error' ? 'assertive' : 'polite'}
|
|
148
148
|
{...rest}
|
|
149
149
|
{...mergeProps(
|
|
150
|
-
|
|
150
|
+
themeProps('field-status', {type, variant}),
|
|
151
151
|
stylex.props(
|
|
152
152
|
styles.base,
|
|
153
153
|
entryStyle,
|
|
@@ -52,7 +52,7 @@ export type {
|
|
|
52
52
|
import {mergeProps, mergeRefs} from '../utils';
|
|
53
53
|
import type {BaseProps} from '../BaseProps';
|
|
54
54
|
import type {SizeValue} from '../utils/types';
|
|
55
|
-
import {
|
|
55
|
+
import {themeProps} from '../utils/themeProps';
|
|
56
56
|
|
|
57
57
|
function formatFileSize(bytes: number): string {
|
|
58
58
|
if (bytes < 1024) {
|
|
@@ -674,7 +674,7 @@ export function FileInput({
|
|
|
674
674
|
aria-busy={isLoading || undefined}
|
|
675
675
|
{...dragDropProps}
|
|
676
676
|
{...mergeProps(
|
|
677
|
-
|
|
677
|
+
themeProps('file-input', {mode, status: status?.type ?? null}),
|
|
678
678
|
stylex.props(
|
|
679
679
|
isDropzone ? styles.dropzone : styles.compact,
|
|
680
680
|
isDropzone && !isDisabled && styles.dropzoneHover,
|
|
@@ -20,7 +20,7 @@ export const docs = {
|
|
|
20
20
|
name: 'children',
|
|
21
21
|
type: 'ReactNode',
|
|
22
22
|
description:
|
|
23
|
-
'Form fields to arrange. Accepts
|
|
23
|
+
'Form fields to arrange. Accepts Astryx inputs (TextInput, Selector, etc.) and Field-wrapped custom controls.',
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: 'xstyle',
|
|
@@ -68,7 +68,7 @@ export const docsZh = {
|
|
|
68
68
|
name: 'children',
|
|
69
69
|
type: 'ReactNode',
|
|
70
70
|
description:
|
|
71
|
-
'要排列的表单字段。接受
|
|
71
|
+
'要排列的表单字段。接受 Astryx 输入组件(TextInput、Selector 等)和 Field 包装的自定义控件。',
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
name: 'xstyle',
|
|
@@ -122,7 +122,7 @@ export const docsDense = {
|
|
|
122
122
|
},
|
|
123
123
|
propDescriptions: {
|
|
124
124
|
direction: 'Field arrangement. Vertical stacks top-to-bottom, horizontal arranges left-to-right w/ equal flex-grow, horizontal-labels uses CSS Grid w/ labels left of inputs (collapses <=480px).',
|
|
125
|
-
children: 'Form fields to arrange. Accepts
|
|
125
|
+
children: 'Form fields to arrange. Accepts Astryx inputs + Field-wrapped custom controls.',
|
|
126
126
|
xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
|
|
127
127
|
},
|
|
128
128
|
};
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
type FormLayoutDirection,
|
|
25
25
|
} from './FormLayoutContext';
|
|
26
26
|
import {mergeProps} from '../utils';
|
|
27
|
-
import {
|
|
27
|
+
import {themeProps} from '../utils/themeProps';
|
|
28
28
|
|
|
29
29
|
// =============================================================================
|
|
30
30
|
// Responsive breakpoint for horizontal-labels collapse
|
|
@@ -125,7 +125,7 @@ export function FormLayout({
|
|
|
125
125
|
<div
|
|
126
126
|
ref={ref}
|
|
127
127
|
{...mergeProps(
|
|
128
|
-
|
|
128
|
+
themeProps('form-layout', {direction}),
|
|
129
129
|
stylex.props(
|
|
130
130
|
styles.base,
|
|
131
131
|
direction === 'horizontal' && styles.horizontal,
|
package/src/Grid/Grid.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {spacingVars} from '../theme/tokens.stylex';
|
|
|
22
22
|
import type {SpacingStep} from '../utils/types';
|
|
23
23
|
import type {SizeValue} from '../utils/types';
|
|
24
24
|
import {mergeProps} from '../utils';
|
|
25
|
-
import {
|
|
25
|
+
import {themeProps} from '../utils/themeProps';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Grid alignment options for align-items and justify-items.
|
|
@@ -411,7 +411,7 @@ export function Grid({
|
|
|
411
411
|
}),
|
|
412
412
|
};
|
|
413
413
|
|
|
414
|
-
// For
|
|
414
|
+
// For themeProps, extract numeric columns value for variant tracking
|
|
415
415
|
const columnsVariant =
|
|
416
416
|
typeof columns === 'number'
|
|
417
417
|
? columns
|
|
@@ -423,7 +423,7 @@ export function Grid({
|
|
|
423
423
|
<div
|
|
424
424
|
ref={ref}
|
|
425
425
|
{...mergeProps(
|
|
426
|
-
|
|
426
|
+
themeProps('grid', {columns: columnsVariant, gap, align, justify}),
|
|
427
427
|
stylex.props(
|
|
428
428
|
baseStyles.grid,
|
|
429
429
|
gap != null && gapStyles[gap],
|
package/src/Grid/GridSpan.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import type {ReactNode} from 'react';
|
|
|
17
17
|
import type {BaseProps} from '../BaseProps';
|
|
18
18
|
import * as stylex from '@stylexjs/stylex';
|
|
19
19
|
import {mergeProps} from '../utils';
|
|
20
|
-
import {
|
|
20
|
+
import {themeProps} from '../utils/themeProps';
|
|
21
21
|
|
|
22
22
|
export interface GridSpanProps extends BaseProps<HTMLDivElement> {
|
|
23
23
|
/** Ref forwarded to the root element */
|
|
@@ -89,7 +89,7 @@ export function GridSpan({
|
|
|
89
89
|
<div
|
|
90
90
|
ref={ref}
|
|
91
91
|
{...mergeProps(
|
|
92
|
-
|
|
92
|
+
themeProps('grid-span'),
|
|
93
93
|
stylex.props(baseStyles.span, xstyle),
|
|
94
94
|
className,
|
|
95
95
|
{...style, ...inlineStyle},
|
package/src/Heading/Heading.tsx
CHANGED
|
@@ -44,7 +44,7 @@ import {useTruncation} from '../Text/useTruncation';
|
|
|
44
44
|
import type {LayerPlacement} from '../Layer';
|
|
45
45
|
import {mergeProps, mergeRefs} from '../utils';
|
|
46
46
|
import type {BaseProps} from '../BaseProps';
|
|
47
|
-
import {
|
|
47
|
+
import {themeProps} from '../utils/themeProps';
|
|
48
48
|
|
|
49
49
|
const LazyXDSTooltip = lazy(async () =>
|
|
50
50
|
import('../Tooltip/Tooltip').then(mod => ({default: mod.Tooltip})),
|
|
@@ -249,7 +249,7 @@ export function Heading({
|
|
|
249
249
|
<Component
|
|
250
250
|
ref={mergeRefs(ref, truncation.ref, headingRef)}
|
|
251
251
|
{...mergeProps(
|
|
252
|
-
|
|
252
|
+
themeProps('heading', {level, color, ...(type && {type})}),
|
|
253
253
|
stylex.props(
|
|
254
254
|
colorStyles[color],
|
|
255
255
|
type ? sizeByTypeStyles[type] : sizeByLevelStyles[level],
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
spacingVars,
|
|
36
36
|
} from '../theme/tokens.stylex';
|
|
37
37
|
import {mergeProps} from '../utils';
|
|
38
|
-
import {
|
|
38
|
+
import {themeProps} from '../utils/themeProps';
|
|
39
39
|
|
|
40
40
|
const styles = stylex.create({
|
|
41
41
|
// Base container styles passed to useLayer
|
|
@@ -459,7 +459,7 @@ export function useHoverCard(
|
|
|
459
459
|
return layer.render(
|
|
460
460
|
<div
|
|
461
461
|
{...mergeProps(
|
|
462
|
-
|
|
462
|
+
themeProps('hovercard'),
|
|
463
463
|
stylex.props(styles.content),
|
|
464
464
|
)}
|
|
465
465
|
onMouseEnter={() => {
|
package/src/Icon/Icon.doc.mjs
CHANGED
|
@@ -17,7 +17,7 @@ export const docs = {
|
|
|
17
17
|
{
|
|
18
18
|
name: 'color',
|
|
19
19
|
type: "'primary' | 'secondary' | 'tertiary' | 'disabled' | 'accent' | 'success' | 'error' | 'warning' | 'inherit'",
|
|
20
|
-
description: 'Color variant mapped to
|
|
20
|
+
description: 'Color variant mapped to Astryx icon color tokens.',
|
|
21
21
|
default: "'inherit'",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
@@ -62,7 +62,7 @@ export const docsZh = {
|
|
|
62
62
|
{
|
|
63
63
|
name: 'color',
|
|
64
64
|
type: "'primary' | 'secondary' | 'tertiary' | 'disabled' | 'accent' | 'success' | 'error' | 'warning' | 'inherit'",
|
|
65
|
-
description: '映射到
|
|
65
|
+
description: '映射到 Astryx 图标颜色令牌的颜色变体。',
|
|
66
66
|
default: "'inherit'",
|
|
67
67
|
},
|
|
68
68
|
{
|
|
@@ -96,7 +96,7 @@ export const docsZh = {
|
|
|
96
96
|
/** @type {import('../docs-types').TranslationDoc} */
|
|
97
97
|
export const docsDense = {
|
|
98
98
|
description:
|
|
99
|
-
'Renders icons w/
|
|
99
|
+
'Renders icons w/ Astryx design system colors + sizes. Supports direct SVG icon components + semantic icon names that adapt to active theme.',
|
|
100
100
|
usage: {
|
|
101
101
|
description: 'Icons are small visual symbols that represent actions, objects, or concepts. They improve scannability and reinforce meaning alongside text. Supports both direct SVG components and semantic icon names that adapt to the active theme.',
|
|
102
102
|
bestPractices: [
|
|
@@ -113,7 +113,7 @@ export const docsDense = {
|
|
|
113
113
|
},
|
|
114
114
|
propDescriptions: {
|
|
115
115
|
icon: 'Semantic icon name or SVG component. Valid names: close, chevronDown, chevronLeft, chevronRight, check, success, error, warning, info, calendar, clock, externalLink, menu, moreHorizontal, search, arrowUp, arrowDown, arrowsUpDown, funnel, eyeSlash, viewColumns, copy, checkDouble, wrench, stop, microphone. For others, pass an SVG component.',
|
|
116
|
-
color: 'Color variant mapped to
|
|
116
|
+
color: 'Color variant mapped to Astryx icon color tokens.',
|
|
117
117
|
size: 'Icon size.',
|
|
118
118
|
},
|
|
119
119
|
};
|
package/src/Icon/Icon.tsx
CHANGED
|
@@ -28,7 +28,7 @@ import {colorVars} from '../theme/tokens.stylex';
|
|
|
28
28
|
import {getIcon} from './globalIconRegistry';
|
|
29
29
|
import type {IconName} from './globalIconRegistry';
|
|
30
30
|
import {mergeProps} from '../utils';
|
|
31
|
-
import {
|
|
31
|
+
import {themeProps} from '../utils/themeProps';
|
|
32
32
|
|
|
33
33
|
// =============================================================================
|
|
34
34
|
// Styles
|
|
@@ -241,7 +241,7 @@ export function Icon({
|
|
|
241
241
|
ref={ref}
|
|
242
242
|
aria-hidden="true"
|
|
243
243
|
{...mergeProps(
|
|
244
|
-
|
|
244
|
+
themeProps('icon', {size, color}),
|
|
245
245
|
stylex.props(styles.root, colorStyles[color], sizeStyles[size]),
|
|
246
246
|
)}
|
|
247
247
|
{...props}
|
|
@@ -283,7 +283,7 @@ function IconFromRegistry({
|
|
|
283
283
|
<span
|
|
284
284
|
{...(spanProps as React.HTMLAttributes<HTMLSpanElement>)}
|
|
285
285
|
{...mergeProps(
|
|
286
|
-
|
|
286
|
+
themeProps('icon', {size, color}),
|
|
287
287
|
stylex.props(styles.span, colorStyles[color], spanSizeStyles[size]),
|
|
288
288
|
)}
|
|
289
289
|
aria-hidden="true">
|