@astryxdesign/core 0.1.9-canary.d2d84f8 → 0.1.9-canary.e00a241
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/dist/Avatar/Avatar.d.ts +6 -1
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +46 -12
- package/dist/Avatar/AvatarStatusDot.d.ts +6 -4
- package/dist/Avatar/AvatarStatusDot.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +11 -4
- package/dist/Breadcrumbs/index.d.ts +1 -0
- package/dist/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/Breadcrumbs/index.js +2 -1
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +50 -9
- package/dist/Calendar/dayCellUtils.d.ts +4 -4
- package/dist/Calendar/dayCellUtils.js +2 -2
- package/dist/Calendar/styles.d.ts +30 -31
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +30 -31
- package/dist/Card/Card.js +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +22 -12
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +3 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +8 -8
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +10 -3
- package/dist/CheckboxInput/CheckboxInput.js +4 -4
- package/dist/Citation/Citation.d.ts +22 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -6
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +13 -7
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +3 -1
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +42 -3
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +14 -5
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +3 -1
- package/dist/DateInput/DateInput.d.ts +1 -0
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +31 -19
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -0
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +20 -19
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +23 -18
- package/dist/Divider/Divider.d.ts +2 -2
- package/dist/Divider/Divider.d.ts.map +1 -1
- package/dist/Divider/Divider.js +13 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +6 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +22 -5
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +4 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +104 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +427 -0
- package/dist/DropdownMenu/index.d.ts +10 -0
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +13 -0
- package/dist/DropdownMenu/menuItemHover.d.ts +23 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemHover.js +33 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts +8 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemRoles.js +10 -1
- package/dist/DropdownMenu/renderDropdownItems.d.ts.map +1 -1
- package/dist/DropdownMenu/renderDropdownItems.js +21 -6
- package/dist/Field/Field.d.ts +3 -1
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +4 -1
- package/dist/Field/inputStyles.stylex.d.ts +1 -0
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +1 -0
- package/dist/FieldStatus/FieldStatus.d.ts +4 -1
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +4 -2
- package/dist/FileInput/FileInput.d.ts +1 -0
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +91 -65
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +10 -4
- package/dist/Icon/Icon.d.ts +15 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +19 -3
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +15 -9
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +6 -3
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +7 -0
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +65 -40
- package/dist/NumberInput/NumberInput.d.ts +1 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +20 -17
- package/dist/Outline/Outline.js +2 -2
- package/dist/RadioList/RadioList.d.ts +2 -2
- package/dist/RadioList/RadioListItem.js +4 -4
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +49 -19
- package/dist/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +2 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +58 -16
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +5 -5
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +13 -10
- package/dist/SideNav/SideNavItem.d.ts +1 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +12 -10
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +87 -34
- package/dist/Spinner/Spinner.d.ts +3 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +11 -2
- package/dist/Switch/Switch.d.ts +8 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +160 -91
- package/dist/TabList/TabList.d.ts +2 -11
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +5 -9
- package/dist/TabList/TabListContext.d.ts +0 -5
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +0 -5
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +30 -4
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +15 -11
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +36 -26
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +3 -0
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +14 -6
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +29 -23
- package/dist/Table/types.d.ts +32 -0
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/TextArea/TextArea.d.ts +1 -0
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +16 -19
- package/dist/TextInput/TextInput.d.ts +1 -0
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +18 -17
- package/dist/TimeInput/TimeInput.d.ts +1 -0
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +15 -17
- package/dist/Timestamp/Timestamp.d.ts +31 -3
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +47 -76
- package/dist/Timestamp/formatInstant.d.ts +41 -0
- package/dist/Timestamp/formatInstant.d.ts.map +1 -0
- package/dist/Timestamp/formatInstant.js +177 -0
- package/dist/Timestamp/index.d.ts +1 -0
- package/dist/Timestamp/index.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.d.ts +56 -0
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -0
- package/dist/Timestamp/tooltipEntries.js +163 -0
- package/dist/Token/Token.d.ts +30 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +17 -2
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +2 -2
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +17 -1
- package/dist/TopNav/TopNavItem.d.ts +3 -1
- package/dist/TopNav/TopNavItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavItem.js +30 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -0
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +8 -6
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +32 -14
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +19 -10
- package/dist/Typeahead/Typeahead.js +1 -1
- package/dist/Typeahead/TypeaheadItem.d.ts +1 -1
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +20 -10
- package/dist/astryx.css +38 -14
- package/dist/astryx.umd.js +52 -52
- package/dist/astryx.umd.js.map +4 -4
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/isRtlElement.d.ts +18 -0
- package/dist/hooks/isRtlElement.d.ts.map +1 -0
- package/dist/hooks/isRtlElement.js +27 -0
- package/dist/hooks/useAnnounce.d.ts +3 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +39 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +52 -11
- package/dist/hooks/useGridFocus.d.ts +6 -1
- package/dist/hooks/useGridFocus.d.ts.map +1 -1
- package/dist/hooks/useGridFocus.js +12 -9
- package/dist/hooks/useHotkeys.d.ts +9 -0
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +9 -0
- package/dist/hooks/useInputStatusIcon.d.ts +38 -0
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -0
- package/dist/hooks/useInputStatusIcon.js +158 -0
- package/dist/hooks/useListFocus.d.ts +39 -1
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +54 -9
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/plainDate.d.ts +17 -0
- package/dist/utils/plainDate.d.ts.map +1 -1
- package/dist/utils/plainDate.js +23 -4
- package/dist/utils/rtlStyles.d.ts +24 -0
- package/dist/utils/rtlStyles.d.ts.map +1 -0
- package/dist/utils/rtlStyles.js +27 -0
- package/locales/en.json +76 -0
- package/locales/pseudo.json +57 -0
- package/package.json +6 -1
- package/src/Avatar/Avatar.doc.mjs +18 -4
- package/src/Avatar/Avatar.test.tsx +106 -0
- package/src/Avatar/Avatar.tsx +62 -10
- package/src/Avatar/AvatarStatusDot.doc.mjs +4 -4
- package/src/Avatar/AvatarStatusDot.tsx +6 -4
- package/src/AvatarGroup/AvatarGroup.test.tsx +16 -1
- package/src/Breadcrumbs/BreadcrumbItem.tsx +10 -10
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +51 -0
- package/src/Breadcrumbs/index.ts +4 -0
- package/src/Button/Button.doc.mjs +0 -4
- package/src/Calendar/Calendar.test.tsx +170 -20
- package/src/Calendar/Calendar.tsx +73 -16
- package/src/Calendar/dayCellUtils.test.ts +18 -18
- package/src/Calendar/dayCellUtils.ts +2 -2
- package/src/Calendar/styles.ts +33 -39
- package/src/Card/Card.tsx +1 -1
- package/src/Carousel/Carousel.tsx +25 -6
- package/src/Chat/ChatComposer.doc.mjs +2 -2
- package/src/Chat/ChatComposerInput.doc.mjs +1 -1
- package/src/Chat/ChatDictationButton.tsx +7 -1
- package/src/Chat/ChatMessageBubble.tsx +15 -10
- package/src/Chat/ChatSystemMessage.test.tsx +5 -0
- package/src/Chat/ChatToolCalls.tsx +9 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +6 -0
- package/src/CheckboxInput/CheckboxInput.tsx +4 -4
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -0
- package/src/Citation/Citation.doc.mjs +4 -3
- package/src/Citation/Citation.test.tsx +97 -0
- package/src/Citation/Citation.tsx +43 -11
- package/src/CodeBlock/CodeBlock.tsx +35 -8
- package/src/Collapsible/Collapsible.doc.mjs +1 -0
- package/src/Collapsible/Collapsible.test.tsx +7 -0
- package/src/Collapsible/Collapsible.tsx +16 -6
- package/src/CommandPalette/CommandPalette.test.tsx +95 -1
- package/src/CommandPalette/CommandPalette.tsx +41 -2
- package/src/ContextMenu/ContextMenu.test.tsx +42 -0
- package/src/ContextMenu/ContextMenu.tsx +13 -11
- package/src/ContextMenu/index.ts +5 -0
- package/src/DateInput/DateInput.doc.mjs +15 -5
- package/src/DateInput/DateInput.test.tsx +210 -3
- package/src/DateInput/DateInput.tsx +41 -29
- package/src/DateRangeInput/DateRangeInput.doc.mjs +11 -3
- package/src/DateRangeInput/DateRangeInput.test.tsx +120 -3
- package/src/DateRangeInput/DateRangeInput.tsx +29 -27
- package/src/DateTimeInput/DateTimeInput.doc.mjs +22 -1
- package/src/DateTimeInput/DateTimeInput.test.tsx +112 -0
- package/src/DateTimeInput/DateTimeInput.tsx +44 -39
- package/src/Divider/Divider.test.tsx +32 -8
- package/src/Divider/Divider.tsx +14 -1
- package/src/DropdownMenu/DropdownMenu.test.tsx +60 -0
- package/src/DropdownMenu/DropdownMenu.tsx +31 -12
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +8 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +88 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +635 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +553 -0
- package/src/DropdownMenu/index.ts +16 -0
- package/src/DropdownMenu/menuItemHover.ts +39 -0
- package/src/DropdownMenu/menuItemRoles.ts +9 -0
- package/src/DropdownMenu/renderDropdownItems.tsx +29 -15
- package/src/Field/Field.tsx +14 -9
- package/src/Field/inputStyles.stylex.ts +2 -0
- package/src/FieldStatus/FieldStatus.tsx +10 -4
- package/src/FileInput/FileInput.doc.mjs +13 -7
- package/src/FileInput/FileInput.test.tsx +84 -16
- package/src/FileInput/FileInput.tsx +96 -79
- package/src/HoverCard/useHoverCard.tsx +15 -3
- package/src/Icon/Icon.doc.mjs +13 -0
- package/src/Icon/Icon.test.tsx +89 -0
- package/src/Icon/Icon.tsx +51 -3
- package/src/Lightbox/Lightbox.tsx +11 -3
- package/src/List/List.test.tsx +17 -29
- package/src/List/List.tsx +6 -1
- package/src/Markdown/Markdown.test.tsx +21 -0
- package/src/Markdown/Markdown.tsx +4 -0
- package/src/MultiSelector/MultiSelector.doc.mjs +11 -0
- package/src/MultiSelector/MultiSelector.test.tsx +306 -3
- package/src/MultiSelector/MultiSelector.tsx +88 -57
- package/src/NumberInput/NumberInput.doc.mjs +11 -5
- package/src/NumberInput/NumberInput.test.tsx +48 -0
- package/src/NumberInput/NumberInput.tsx +25 -26
- package/src/Outline/Outline.test.tsx +12 -12
- package/src/Outline/Outline.tsx +2 -2
- package/src/RadioList/RadioList.doc.mjs +6 -0
- package/src/RadioList/RadioList.tsx +2 -2
- package/src/RadioList/RadioListItem.tsx +4 -4
- package/src/Resizable/ResizeHandle.test.tsx +94 -0
- package/src/Resizable/ResizeHandle.tsx +70 -20
- package/src/SegmentedControl/SegmentedControlItem.tsx +2 -0
- package/src/Selector/Selector.doc.mjs +8 -0
- package/src/Selector/Selector.test.tsx +328 -3
- package/src/Selector/Selector.tsx +70 -19
- package/src/SideNav/SideNav.tsx +1 -8
- package/src/SideNav/SideNavCollapseButton.tsx +9 -7
- package/src/SideNav/SideNavItem.tsx +5 -3
- package/src/Slider/Slider.doc.mjs +6 -0
- package/src/Slider/Slider.test.tsx +240 -12
- package/src/Slider/Slider.tsx +96 -23
- package/src/Spinner/Spinner.test.tsx +10 -8
- package/src/Spinner/Spinner.tsx +15 -5
- package/src/Switch/Switch.doc.mjs +142 -42
- package/src/Switch/Switch.test.tsx +22 -0
- package/src/Switch/Switch.tsx +90 -33
- package/src/TabList/TabList.doc.mjs +0 -6
- package/src/TabList/TabList.test.tsx +3 -15
- package/src/TabList/TabList.tsx +6 -17
- package/src/TabList/TabListContext.ts +0 -6
- package/src/Table/BaseTable.tsx +34 -2
- package/src/Table/Table.doc.mjs +11 -0
- package/src/Table/Table.test.tsx +85 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +9 -6
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +24 -17
- package/src/Table/plugins/selection/useTableSelection.test.tsx +61 -3
- package/src/Table/plugins/selection/useTableSelection.tsx +3 -0
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +37 -8
- package/src/Table/plugins/tree/useTableTreeData.tsx +17 -13
- package/src/Table/types.ts +33 -0
- package/src/Table/useTableRowStatus.doc.mjs +1 -1
- package/src/TextArea/TextArea.doc.mjs +11 -5
- package/src/TextArea/TextArea.tsx +17 -26
- package/src/TextInput/TextInput.doc.mjs +11 -5
- package/src/TextInput/TextInput.test.tsx +130 -3
- package/src/TextInput/TextInput.tsx +18 -25
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -1
- package/src/TimeInput/TimeInput.doc.mjs +11 -5
- package/src/TimeInput/TimeInput.tsx +14 -25
- package/src/Timestamp/Timestamp.doc.mjs +32 -6
- package/src/Timestamp/Timestamp.test.tsx +371 -0
- package/src/Timestamp/Timestamp.tsx +96 -93
- package/src/Timestamp/formatInstant.ts +218 -0
- package/src/Timestamp/index.ts +4 -0
- package/src/Timestamp/tooltipEntries.test.ts +552 -0
- package/src/Timestamp/tooltipEntries.ts +210 -0
- package/src/Token/Token.test.tsx +21 -15
- package/src/Token/Token.tsx +31 -14
- package/src/Token/index.ts +1 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +8 -1
- package/src/Tokenizer/Tokenizer.tsx +4 -2
- package/src/Tooltip/Tooltip.test.tsx +46 -0
- package/src/Tooltip/useTooltip.tsx +20 -0
- package/src/TopNav/TopNav.test.tsx +93 -2
- package/src/TopNav/TopNavItem.doc.mjs +3 -3
- package/src/TopNav/TopNavItem.tsx +35 -6
- package/src/TopNav/TopNavMegaMenuFeaturedCard.doc.mjs +1 -1
- package/src/TreeList/TreeList.doc.mjs +6 -0
- package/src/TreeList/TreeList.test.tsx +50 -10
- package/src/TreeList/TreeList.tsx +5 -0
- package/src/TreeList/TreeListBranches.tsx +8 -6
- package/src/TreeList/TreeListItem.tsx +33 -11
- package/src/Typeahead/BaseTypeahead.tsx +29 -14
- package/src/Typeahead/Typeahead.doc.mjs +6 -0
- package/src/Typeahead/Typeahead.test.tsx +27 -0
- package/src/Typeahead/Typeahead.tsx +1 -1
- package/src/Typeahead/TypeaheadItem.tsx +2 -1
- package/src/__tests__/inputWidthContract.test.tsx +62 -0
- package/src/doc-mjs.d.ts +19 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/isRtlElement.ts +27 -0
- package/src/hooks/useAnnounce.test.tsx +75 -2
- package/src/hooks/useAnnounce.ts +47 -1
- package/src/hooks/useFocusTrap.test.tsx +104 -0
- package/src/hooks/useFocusTrap.ts +61 -12
- package/src/hooks/useGridFocus.doc.mjs +3 -3
- package/src/hooks/useGridFocus.test.tsx +41 -0
- package/src/hooks/useGridFocus.ts +21 -10
- package/src/hooks/useHotkeys.ts +9 -0
- package/src/hooks/useInputStatusIcon.test.tsx +162 -0
- package/src/hooks/useInputStatusIcon.tsx +224 -0
- package/src/hooks/useListFocus.doc.mjs +25 -3
- package/src/hooks/useListFocus.test.tsx +153 -1
- package/src/hooks/useListFocus.ts +102 -9
- package/src/reset.css +0 -26
- package/src/reset.test.ts +60 -0
- package/src/theme/derivedVarRegistry.test.ts +1 -0
- package/src/theme/derivedVarRegistry.ts +6 -0
- package/src/theme/generateThemeRules.test.ts +42 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/plainDate.test.ts +24 -6
- package/src/utils/plainDate.ts +18 -4
- package/src/utils/rtlStyles.ts +27 -0
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
type ReactNode,
|
|
28
28
|
} from 'react';
|
|
29
29
|
import * as stylex from '@stylexjs/stylex';
|
|
30
|
-
import type {IconName} from '../Icon';
|
|
31
30
|
import {
|
|
32
31
|
colorVars,
|
|
33
32
|
sizeVars,
|
|
@@ -39,7 +38,6 @@ import {
|
|
|
39
38
|
import {
|
|
40
39
|
Field,
|
|
41
40
|
type InputStatus,
|
|
42
|
-
type InputStatusType,
|
|
43
41
|
inputWrapperStyles,
|
|
44
42
|
inputStatusBorderStyles,
|
|
45
43
|
inputStatusHoverShadowStyles,
|
|
@@ -120,6 +118,7 @@ export type {
|
|
|
120
118
|
import {mergeProps, mergeRefs} from '../utils';
|
|
121
119
|
import {useSize} from '../SizeContext/SizeContext';
|
|
122
120
|
import {useInputContainer} from '../hooks/useInputContainer';
|
|
121
|
+
import {useInputStatusIcon} from '../hooks/useInputStatusIcon';
|
|
123
122
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
124
123
|
import type {BaseProps} from '../BaseProps';
|
|
125
124
|
import type {SizeValue} from '../utils/types';
|
|
@@ -203,6 +202,7 @@ export interface TextInputProps extends Omit<
|
|
|
203
202
|
* How the status message is placed relative to the input.
|
|
204
203
|
* - 'attached': message overlaps directly below the input (bordered treatment)
|
|
205
204
|
* - 'detached': message floats below as a separate element with spacing
|
|
205
|
+
* - 'tooltip': no message box; the status icon becomes a focusable info-tip button that reveals the message on hover, keyboard focus, or tap
|
|
206
206
|
* @default 'attached'
|
|
207
207
|
*/
|
|
208
208
|
statusVariant?: FieldStatusVariant;
|
|
@@ -337,26 +337,25 @@ export function TextInput({
|
|
|
337
337
|
isEnabled: showsDisabledMessage,
|
|
338
338
|
});
|
|
339
339
|
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
const statusIconColorMap: Record<
|
|
347
|
-
InputStatusType,
|
|
348
|
-
'warning' | 'error' | 'success'
|
|
349
|
-
> = {
|
|
350
|
-
warning: 'warning',
|
|
351
|
-
error: 'error',
|
|
352
|
-
success: 'success',
|
|
353
|
-
};
|
|
340
|
+
const {statusIcon, describedBy: statusTooltipDescribedBy} =
|
|
341
|
+
useInputStatusIcon({
|
|
342
|
+
status,
|
|
343
|
+
statusVariant,
|
|
344
|
+
isInGroup: !!inputGroup,
|
|
345
|
+
});
|
|
354
346
|
|
|
355
347
|
const {ariaLabelledBy, ariaDescribedBy} = getInputARIA(
|
|
356
348
|
inputLabelID,
|
|
357
349
|
[
|
|
358
350
|
description ? descriptionID : null,
|
|
359
|
-
status
|
|
351
|
+
// The status message element is rendered by Field, which is skipped
|
|
352
|
+
// inside an InputGroup — only reference it when it actually exists.
|
|
353
|
+
!inputGroup && statusVariant !== 'tooltip' && status?.message
|
|
354
|
+
? statusMessageID
|
|
355
|
+
: null,
|
|
356
|
+
// The tooltip variant renders no message box; describe the input by the
|
|
357
|
+
// tooltip's content instead so the status is still announced.
|
|
358
|
+
statusTooltipDescribedBy,
|
|
360
359
|
showsDisabledMessage ? disabledMessageTooltip.describedBy : null,
|
|
361
360
|
],
|
|
362
361
|
inputGroup,
|
|
@@ -411,7 +410,7 @@ export function TextInput({
|
|
|
411
410
|
sizeStyles[size],
|
|
412
411
|
isDisabled && inputWrapperStyles.disabled,
|
|
413
412
|
status && inputStatusBorderStyles[status.type],
|
|
414
|
-
status && inputStatusHoverShadowStyles[status.type],
|
|
413
|
+
status && !isDisabled && inputStatusHoverShadowStyles[status.type],
|
|
415
414
|
status && inputStatusFocusWithinStyles[status.type],
|
|
416
415
|
inputGroup && groupStyles.inGroup,
|
|
417
416
|
xstyle,
|
|
@@ -465,13 +464,7 @@ export function TextInput({
|
|
|
465
464
|
</button>
|
|
466
465
|
)}
|
|
467
466
|
{isBusy && <Spinner size="sm" />}
|
|
468
|
-
{
|
|
469
|
-
<Icon
|
|
470
|
-
icon={statusIconMap[status.type]}
|
|
471
|
-
size="md"
|
|
472
|
-
color={statusIconColorMap[status.type]}
|
|
473
|
-
/>
|
|
474
|
-
)}
|
|
467
|
+
{statusIcon}
|
|
475
468
|
</div>
|
|
476
469
|
);
|
|
477
470
|
|
|
@@ -149,7 +149,7 @@ export const docsDense = {
|
|
|
149
149
|
onClick: '(e) => void. Adds button semantics + hover overlay.',
|
|
150
150
|
isLoading: 'Skeleton (no src) or upload overlay (with src). Default: false.',
|
|
151
151
|
isDisabled: 'Disabled state. Default: false.',
|
|
152
|
-
showRemoveOn: "When remove button shows: hover (default
|
|
152
|
+
showRemoveOn: "When remove button shows: hover (default: reveal on hover/focus, stays visible on touch) | always. Only when onRemove set.",
|
|
153
153
|
xstyle: 'stylex.create() for layout.',
|
|
154
154
|
className: 'CSS class. Prefer xstyle.',
|
|
155
155
|
style: 'Inline styles. Prefer xstyle.',
|
|
@@ -231,9 +231,9 @@ export const docs = {
|
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
name: 'statusVariant',
|
|
234
|
-
type: "'attached' | 'detached'",
|
|
234
|
+
type: "'attached' | 'detached' | 'tooltip'",
|
|
235
235
|
description:
|
|
236
|
-
'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing.',
|
|
236
|
+
'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing; tooltip hides the message box and surfaces it in a tooltip on the status icon.',
|
|
237
237
|
default: "'attached'",
|
|
238
238
|
},
|
|
239
239
|
{
|
|
@@ -242,6 +242,12 @@ export const docs = {
|
|
|
242
242
|
description:
|
|
243
243
|
'Tooltip text rendered as an info icon at the end of the label row.',
|
|
244
244
|
},
|
|
245
|
+
{
|
|
246
|
+
name: 'width',
|
|
247
|
+
type: 'SizeValue',
|
|
248
|
+
description:
|
|
249
|
+
'Width of the field (number = pixels, string used as-is, e.g. "100%"). Sizes the whole field (label, control, and status) so they stay aligned.',
|
|
250
|
+
},
|
|
245
251
|
{
|
|
246
252
|
name: 'xstyle',
|
|
247
253
|
type: 'StyleXStyles',
|
|
@@ -381,9 +387,9 @@ export const docsZh = {
|
|
|
381
387
|
},
|
|
382
388
|
{
|
|
383
389
|
name: 'statusVariant',
|
|
384
|
-
type: "'attached' | 'detached'",
|
|
390
|
+
type: "'attached' | 'detached' | 'tooltip'",
|
|
385
391
|
description:
|
|
386
|
-
'状态消息相对于输入框的放置方式。attached 直接叠加在输入框下方(带边框处理);detached
|
|
392
|
+
'状态消息相对于输入框的放置方式。attached 直接叠加在输入框下方(带边框处理);detached 作为独立元素浮于下方并留有间距;tooltip 隐藏消息框,并在状态图标上以提示气泡形式显示。',
|
|
387
393
|
default: "'attached'",
|
|
388
394
|
},
|
|
389
395
|
{
|
|
@@ -559,7 +565,7 @@ export const docsDense = {
|
|
|
559
565
|
placeholder: 'Placeholder when empty. Focused+empty shows format hint.',
|
|
560
566
|
size: 'Input element height.',
|
|
561
567
|
status: 'Colored border+icon. Message rendered below input.',
|
|
562
|
-
statusVariant: 'How status message is placed: attached overlaps below input; detached floats below w/ spacing.',
|
|
568
|
+
statusVariant: 'How status message is placed: attached overlaps below input; detached floats below w/ spacing; tooltip hides the box and shows it on the status icon.',
|
|
563
569
|
labelTooltip: 'Tooltip as info icon at label row end.',
|
|
564
570
|
xstyle:
|
|
565
571
|
'StyleX styles for layout customization. Must be stylex.create() value, not inline style.',
|
|
@@ -29,7 +29,6 @@ import {
|
|
|
29
29
|
type FocusEvent,
|
|
30
30
|
} from 'react';
|
|
31
31
|
import * as stylex from '@stylexjs/stylex';
|
|
32
|
-
import type {IconName} from '../Icon';
|
|
33
32
|
import {
|
|
34
33
|
colorVars,
|
|
35
34
|
sizeVars,
|
|
@@ -41,7 +40,6 @@ import {
|
|
|
41
40
|
import {
|
|
42
41
|
Field,
|
|
43
42
|
type InputStatus,
|
|
44
|
-
type InputStatusType,
|
|
45
43
|
inputWrapperStyles,
|
|
46
44
|
inputStatusBorderStyles,
|
|
47
45
|
inputStatusHoverShadowStyles,
|
|
@@ -68,6 +66,7 @@ import type {SizeValue} from '../utils/types';
|
|
|
68
66
|
import {useSize} from '../SizeContext/SizeContext';
|
|
69
67
|
import {useAnnounce} from '../hooks/useAnnounce';
|
|
70
68
|
import {useInputContainer} from '../hooks/useInputContainer';
|
|
69
|
+
import {useInputStatusIcon} from '../hooks/useInputStatusIcon';
|
|
71
70
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
72
71
|
import {groupStyles} from '../InputGroup/groupStyles';
|
|
73
72
|
import {useTooltip} from '../Tooltip';
|
|
@@ -303,6 +302,7 @@ export interface TimeInputProps extends Omit<
|
|
|
303
302
|
* How the status message is placed relative to the input.
|
|
304
303
|
* - 'attached': message overlaps directly below the input (bordered treatment)
|
|
305
304
|
* - 'detached': message floats below as a separate element with spacing
|
|
305
|
+
* - 'tooltip': no message box; the status icon becomes a focusable info-tip button that reveals the message on hover, keyboard focus, or tap
|
|
306
306
|
* @default 'attached'
|
|
307
307
|
*/
|
|
308
308
|
statusVariant?: FieldStatusVariant;
|
|
@@ -409,26 +409,21 @@ export function TimeInput({
|
|
|
409
409
|
});
|
|
410
410
|
|
|
411
411
|
// Status icon mapping
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
const statusIconColorMap: Record<
|
|
419
|
-
InputStatusType,
|
|
420
|
-
'warning' | 'error' | 'success'
|
|
421
|
-
> = {
|
|
422
|
-
warning: 'warning',
|
|
423
|
-
error: 'error',
|
|
424
|
-
success: 'success',
|
|
425
|
-
};
|
|
412
|
+
const {statusIcon, describedBy: statusTooltipDescribedBy} =
|
|
413
|
+
useInputStatusIcon({
|
|
414
|
+
status,
|
|
415
|
+
statusVariant,
|
|
416
|
+
isInGroup: !!inputGroup,
|
|
417
|
+
});
|
|
426
418
|
|
|
427
419
|
const {ariaLabelledBy, ariaDescribedBy} = getInputARIA(
|
|
428
420
|
inputLabelID,
|
|
429
421
|
[
|
|
430
422
|
description ? descriptionID : null,
|
|
431
|
-
status?.message ? statusMessageID : null,
|
|
423
|
+
statusVariant !== 'tooltip' && status?.message ? statusMessageID : null,
|
|
424
|
+
// The tooltip variant renders no message box; describe the input by the
|
|
425
|
+
// tooltip's content instead so the status is still announced.
|
|
426
|
+
statusTooltipDescribedBy,
|
|
432
427
|
showsDisabledMessage ? disabledMessageTooltip.describedBy : null,
|
|
433
428
|
],
|
|
434
429
|
inputGroup,
|
|
@@ -619,7 +614,7 @@ export function TimeInput({
|
|
|
619
614
|
sizeStyles[size],
|
|
620
615
|
isDisabled && inputWrapperStyles.disabled,
|
|
621
616
|
status && inputStatusBorderStyles[status.type],
|
|
622
|
-
status && inputStatusHoverShadowStyles[status.type],
|
|
617
|
+
status && !isDisabled && inputStatusHoverShadowStyles[status.type],
|
|
623
618
|
status && inputStatusFocusWithinStyles[status.type],
|
|
624
619
|
inputGroup && groupStyles.inGroup,
|
|
625
620
|
xstyle,
|
|
@@ -690,13 +685,7 @@ export function TimeInput({
|
|
|
690
685
|
<Icon icon="close" size="sm" color="secondary" />
|
|
691
686
|
</button>
|
|
692
687
|
)}
|
|
693
|
-
{
|
|
694
|
-
<Icon
|
|
695
|
-
icon={statusIconMap[status.type]}
|
|
696
|
-
size="md"
|
|
697
|
-
color={statusIconColorMap[status.type]}
|
|
698
|
-
/>
|
|
699
|
-
)}
|
|
688
|
+
{statusIcon}
|
|
700
689
|
</div>
|
|
701
690
|
);
|
|
702
691
|
|
|
@@ -45,11 +45,17 @@ export const docs = {
|
|
|
45
45
|
'Whether to show a tooltip with the full date/time on hover when displaying relative time.',
|
|
46
46
|
default: 'true',
|
|
47
47
|
},
|
|
48
|
+
{
|
|
49
|
+
name: 'tooltipEntries',
|
|
50
|
+
type: 'ReadonlyArray<{timezoneID?: string; format?: TimestampTooltipFormat; label?: string}>',
|
|
51
|
+
description:
|
|
52
|
+
"Lines to show in the hover tooltip, so one instant can be read in several time zones and/or formats at once. Each entry is one line, in the order given. Omit timezoneID (or pass 'local') for the viewer's own zone; format defaults to the full absolute style and also accepts 'full' alongside every non-relative TimestampFormat. Configuring entries also attaches the tooltip to absolute formats, which otherwise have none.",
|
|
53
|
+
},
|
|
48
54
|
{
|
|
49
55
|
name: 'isTimezoneShown',
|
|
50
56
|
type: 'boolean',
|
|
51
57
|
description:
|
|
52
|
-
'Whether to append the timezone abbreviation. Applies to date_time
|
|
58
|
+
'Whether to append the timezone abbreviation to the visible text. Applies to the date_time and time formats; system_* formats stay machine-readable and never carry one. Use tooltipEntries to control the tooltip\'s time zones.',
|
|
53
59
|
default: 'false',
|
|
54
60
|
},
|
|
55
61
|
{
|
|
@@ -94,14 +100,19 @@ export const docs = {
|
|
|
94
100
|
{guidance: true, description: 'Use the auto format in feeds and lists so recent items show "2 hours ago" and older items show the full date automatically.'},
|
|
95
101
|
{guidance: true, description: 'Keep formatting consistent within the same list or table; mixing relative and absolute timestamps in the same column confuses scanning.'},
|
|
96
102
|
{guidance: true, description: 'Enable isTimezoneShown when the audience spans multiple time zones, like a global team calendar or audit log.'},
|
|
103
|
+
{guidance: true, description: 'Use tooltipEntries when readers must compare zones, such as an incident log where the reader\'s time and the event\'s origin zone both matter.'},
|
|
104
|
+
{guidance: true, description: 'Label every entry once a tooltip shows more than one zone; a bare abbreviation is not always recognizable (Tokyo renders as "GMT+9", not "JST").'},
|
|
97
105
|
{guidance: true, description: 'Use isLive for active dashboards or real-time feeds so the relative time stays accurate without a page refresh.'},
|
|
98
106
|
{guidance: false, description: 'Don\'t display raw Unix timestamps or ISO strings to users; always pass them through Timestamp to get a human-readable format.'},
|
|
99
107
|
{guidance: false, description: 'Avoid system_date or system_time formats in user-facing UI; they are meant for developer tools, logs, and machine-readable contexts.'},
|
|
100
108
|
{guidance: false, description: 'Don\'t disable the tooltip on relative timestamps; users expect to hover for the full date when they see "3 hours ago".'},
|
|
109
|
+
{guidance: false, description: 'Don\'t stack many zones into one tooltip; it is capped at 300px wide and long labelled lines wrap. Two or three entries read well.'},
|
|
110
|
+
{guidance: false, description: 'Don\'t pass a fixed-offset abbreviation like "EST" as timezoneID; it is a valid identifier but never observes daylight saving, so it reads an hour wrong for half the year. Use the region id, "America/New_York".'},
|
|
101
111
|
],
|
|
102
112
|
anatomy: [
|
|
103
113
|
{name: 'Formatted text', required: true, description: 'The rendered date, time, or relative label like "2 hours ago" or "Mar 21, 2025".'},
|
|
104
|
-
{name: 'Tooltip', required: false, description: 'A hover card showing the full absolute date and time when the display is relative.'},
|
|
114
|
+
{name: 'Tooltip', required: false, description: 'A hover card showing the full absolute date and time when the display is relative, or the lines configured via tooltipEntries.'},
|
|
115
|
+
{name: 'Tooltip entry', required: false, description: 'One line of the tooltip: an optional label beside the instant rendered in one time zone and format.'},
|
|
105
116
|
],
|
|
106
117
|
},
|
|
107
118
|
};
|
|
@@ -113,7 +124,10 @@ export const docsZh = {
|
|
|
113
124
|
format: "\u663e\u793a\u683c\u5f0f\u3002'relative' \u663e\u793a '2\u5c0f\u65f6\u524d'\uff0c'date' \u663e\u793a\u65e5\u671f\uff0c'date_long' \u663e\u793a\u957f\u6708\u4efd\u65e5\u671f\uff0c'date_weekday' \u663e\u793a\u661f\u671f+\u65e5\u671f\uff0c'auto' \u6839\u636e\u65f6\u95f4\u8fdc\u8fd1\u81ea\u52a8\u5207\u6362\u3002",
|
|
114
125
|
autoThreshold: "auto \u683c\u5f0f\u4ece\u76f8\u5bf9\u65f6\u95f4\u5207\u6362\u5230 date_time \u7684\u9608\u503c\u79d2\u6570\u3002",
|
|
115
126
|
hasTooltip: '\u60ac\u505c\u65f6\u662f\u5426\u663e\u793a\u5305\u542b\u5b8c\u6574\u65e5\u671f/\u65f6\u95f4\u7684\u5de5\u5177\u63d0\u793a\uff08\u76f8\u5bf9\u65f6\u95f4\u6a21\u5f0f\uff09\u3002',
|
|
116
|
-
|
|
127
|
+
tooltipEntries:
|
|
128
|
+
'\u5de5\u5177\u63d0\u793a\u4e2d\u8981\u663e\u793a\u7684\u884c\uff0c\u7528\u4e8e\u540c\u65f6\u5c55\u793a\u591a\u4e2a\u65f6\u533a\u548c/\u6216\u591a\u79cd\u683c\u5f0f\u3002\u6bcf\u9879\u4e3a\u4e00\u884c\uff0c\u6309\u987a\u5e8f\u6e32\u67d3\uff1b\u7701\u7565 timezoneID\uff08\u6216\u4f20\u5165 \'local\'\uff09\u8868\u793a\u67e5\u770b\u8005\u672c\u5730\u65f6\u533a\u3002\u914d\u7f6e\u540e\uff0c\u7edd\u5bf9\u65f6\u95f4\u683c\u5f0f\u4e5f\u4f1a\u663e\u793a\u5de5\u5177\u63d0\u793a\u3002',
|
|
129
|
+
isTimezoneShown:
|
|
130
|
+
'\u662f\u5426\u5728\u53ef\u89c1\u6587\u672c\u540e\u9644\u52a0\u65f6\u533a\u7f29\u5199\uff08\u4ec5 date_time \u548c time\uff1bsystem_* \u683c\u5f0f\u4e0d\u9644\u52a0\uff09\u3002',
|
|
117
131
|
isLive: '\u76f8\u5bf9\u65f6\u95f4\u662f\u5426\u5b9e\u65f6\u66f4\u65b0\u3002',
|
|
118
132
|
type: '\u6765\u81ea Text \u7684\u8bed\u4e49\u6587\u672c\u7c7b\u578b\u3002',
|
|
119
133
|
size: '\u663e\u5f0f\u5b57\u4f53\u5927\u5c0f\u8986\u76d6\u3002',
|
|
@@ -127,21 +141,26 @@ export const docsZh = {
|
|
|
127
141
|
{guidance: true, description: 'Use the auto format in feeds and lists so recent items show "2 hours ago" and older items show the full date automatically.'},
|
|
128
142
|
{guidance: true, description: 'Keep formatting consistent within the same list or table; mixing relative and absolute timestamps in the same column confuses scanning.'},
|
|
129
143
|
{guidance: true, description: 'Enable isTimezoneShown when the audience spans multiple time zones, like a global team calendar or audit log.'},
|
|
144
|
+
{guidance: true, description: 'Use tooltipEntries when readers must compare zones, such as an incident log where the reader\'s time and the event\'s origin zone both matter.'},
|
|
145
|
+
{guidance: true, description: 'Label every entry once a tooltip shows more than one zone; a bare abbreviation is not always recognizable (Tokyo renders as "GMT+9", not "JST").'},
|
|
130
146
|
{guidance: true, description: 'Use isLive for active dashboards or real-time feeds so the relative time stays accurate without a page refresh.'},
|
|
131
147
|
{guidance: false, description: 'Don\'t display raw Unix timestamps or ISO strings to users; always pass them through Timestamp to get a human-readable format.'},
|
|
132
148
|
{guidance: false, description: 'Avoid system_date or system_time formats in user-facing UI; they are meant for developer tools, logs, and machine-readable contexts.'},
|
|
133
149
|
{guidance: false, description: 'Don\'t disable the tooltip on relative timestamps; users expect to hover for the full date when they see "3 hours ago".'},
|
|
150
|
+
{guidance: false, description: 'Don\'t stack many zones into one tooltip; it is capped at 300px wide and long labelled lines wrap. Two or three entries read well.'},
|
|
151
|
+
{guidance: false, description: 'Don\'t pass a fixed-offset abbreviation like "EST" as timezoneID; it is a valid identifier but never observes daylight saving, so it reads an hour wrong for half the year. Use the region id, "America/New_York".'},
|
|
134
152
|
],
|
|
135
153
|
anatomy: [
|
|
136
154
|
{name: 'Formatted text', required: true, description: 'The rendered date, time, or relative label like "2 hours ago" or "Mar 21, 2025".'},
|
|
137
|
-
{name: 'Tooltip', required: false, description: 'A hover card showing the full absolute date and time when the display is relative.'},
|
|
155
|
+
{name: 'Tooltip', required: false, description: 'A hover card showing the full absolute date and time when the display is relative, or the lines configured via tooltipEntries.'},
|
|
156
|
+
{name: 'Tooltip entry', required: false, description: 'One line of the tooltip: an optional label beside the instant rendered in one time zone and format.'},
|
|
138
157
|
],
|
|
139
158
|
},
|
|
140
159
|
};
|
|
141
160
|
|
|
142
161
|
/** @type {import('../docs-types').TranslationDoc} */
|
|
143
162
|
export const docsDense = {
|
|
144
|
-
description: 'formatted timestamp with relative/absolute/auto modes, live updates, timezone display',
|
|
163
|
+
description: 'formatted timestamp with relative/absolute/auto modes, live updates, timezone display, multi-zone tooltip',
|
|
145
164
|
usage: {
|
|
146
165
|
description:
|
|
147
166
|
'Timestamp formats a date or time into readable text. Use for creation dates, update times, or schedules; relative for recency, absolute for precision, auto to switch automatically.',
|
|
@@ -149,10 +168,14 @@ export const docsDense = {
|
|
|
149
168
|
{guidance: true, description: 'Auto format in feeds and lists; recent shows relative, older shows date_time.'},
|
|
150
169
|
{guidance: true, description: 'Consistent formatting within the same list or table column.'},
|
|
151
170
|
{guidance: true, description: 'isTimezoneShown for multi-timezone audiences.'},
|
|
171
|
+
{guidance: true, description: 'tooltipEntries to compare zones when the reader time and event zone both matter.'},
|
|
172
|
+
{guidance: true, description: 'Label each entry once a tooltip shows more than one zone; a bare abbreviation is not always recognizable (Tokyo renders "GMT+9", not "JST").'},
|
|
152
173
|
{guidance: true, description: 'isLive for dashboards so relative time stays current.'},
|
|
153
174
|
{guidance: false, description: 'Don\'t show raw Unix timestamps or ISO strings; always use Timestamp.'},
|
|
154
175
|
{guidance: false, description: 'Avoid system_* formats in user-facing UI; those are for dev tools and logs.'},
|
|
155
176
|
{guidance: false, description: 'Don\'t disable tooltip on relative timestamps; users expect the full date on hover.'},
|
|
177
|
+
{guidance: false, description: 'Don\'t stack many zones in one tooltip; it caps at 300px and long labels wrap. Two or three read well.'},
|
|
178
|
+
{guidance: false, description: 'Don\'t use fixed-offset ids like "EST" for timezoneID; they skip DST. Use region ids like "America/New_York".'},
|
|
156
179
|
],
|
|
157
180
|
},
|
|
158
181
|
propDescriptions: {
|
|
@@ -160,7 +183,10 @@ export const docsDense = {
|
|
|
160
183
|
format: "display mode: 'relative', 'auto', 'date', 'date_long', 'date_weekday', 'date_time', 'time', 'system_date', 'system_date_time', 'system_time'",
|
|
161
184
|
autoThreshold: 'seconds threshold for auto relative\u2192date_time switch',
|
|
162
185
|
hasTooltip: 'show full time tooltip on hover (relative mode)',
|
|
163
|
-
|
|
186
|
+
tooltipEntries:
|
|
187
|
+
"tooltip lines across zones/formats: [{timezoneID?, format?, label?}]; timezoneID omitted or 'local' = viewer zone, format defaults to 'full'; also enables the tooltip on absolute formats",
|
|
188
|
+
isTimezoneShown:
|
|
189
|
+
'append timezone abbreviation to visible text (date_time and time only)',
|
|
164
190
|
isLive: 'live-update relative time',
|
|
165
191
|
type: 'Text semantic type',
|
|
166
192
|
size: 'font size override',
|