@astryxdesign/core 0.1.5 → 0.1.6-canary.02f2602
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 +24 -0
- package/README.md +2 -0
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +21 -18
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts +0 -2
- package/dist/AlertDialog/useImperativeAlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/useImperativeAlertDialog.js +3 -5
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +55 -53
- package/dist/AspectRatio/AspectRatio.js +5 -5
- package/dist/Avatar/Avatar.js +19 -19
- package/dist/Avatar/AvatarStatusDot.js +5 -5
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +9 -6
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -5
- package/dist/Badge/Badge.js +3 -3
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -30
- package/dist/Blockquote/Blockquote.js +7 -7
- package/dist/Breadcrumbs/BreadcrumbItem.js +17 -17
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +11 -8
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +53 -23
- package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +34 -18
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +51 -48
- package/dist/Card/Card.js +3 -3
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +27 -24
- package/dist/Center/Center.js +3 -3
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +27 -24
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +23 -16
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +20 -16
- package/dist/Chat/ChatDictationButton.js +10 -10
- package/dist/Chat/ChatLayout.d.ts +1 -11
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +23 -21
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +13 -11
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +20 -14
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +10 -8
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +17 -15
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +24 -19
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +16 -14
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +6 -4
- package/dist/Chat/ChatSystemMessage.js +11 -11
- package/dist/Chat/ChatTokenizedText.js +8 -8
- package/dist/Chat/ChatToolCalls.js +73 -73
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +4 -2
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +19 -17
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +26 -24
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +12 -10
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +8 -6
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +20 -12
- package/dist/ClickableCard/ClickableCard.js +6 -6
- package/dist/Code/Code.js +3 -3
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +114 -96
- package/dist/Collapsible/Collapsible.js +11 -11
- package/dist/Collapsible/CollapsibleGroup.js +7 -7
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +39 -34
- package/dist/CommandPalette/CommandPaletteEmpty.js +3 -3
- package/dist/CommandPalette/CommandPaletteFooter.js +16 -16
- package/dist/CommandPalette/CommandPaletteGroup.js +5 -5
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +17 -14
- package/dist/CommandPalette/CommandPaletteItem.js +3 -3
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +7 -4
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +14 -11
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +28 -23
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +32 -27
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +41 -33
- package/dist/Dialog/Dialog.js +9 -9
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +20 -18
- package/dist/Dialog/useImperativeDialog.js +3 -3
- package/dist/Divider/Divider.js +7 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +21 -15
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
- package/dist/DropdownMenu/renderDropdownItems.js +10 -10
- package/dist/EmptyState/EmptyState.d.ts +4 -1
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +9 -9
- package/dist/Field/Field.js +17 -17
- package/dist/Field/FieldLabel.js +15 -15
- package/dist/Field/InputClearButton.js +5 -5
- package/dist/FieldStatus/FieldStatus.js +3 -3
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +34 -30
- package/dist/FormLayout/FormLayout.js +5 -5
- package/dist/Grid/Grid.js +3 -3
- package/dist/Grid/GridSpan.js +3 -3
- package/dist/HStack/HStack.js +3 -3
- package/dist/Heading/Heading.js +10 -10
- package/dist/HoverCard/HoverCard.js +9 -9
- package/dist/HoverCard/useHoverCard.js +3 -3
- package/dist/Icon/Icon.js +11 -11
- package/dist/Icon/defaultIcons.js +116 -116
- package/dist/IconButton/IconButton.js +3 -3
- package/dist/InputGroup/InputGroup.js +9 -9
- package/dist/InputGroup/InputGroupText.js +3 -3
- package/dist/Item/Item.js +17 -17
- package/dist/Kbd/Kbd.js +5 -5
- package/dist/Layer/LayerProvider.js +7 -7
- package/dist/Layer/useLayer.js +5 -5
- package/dist/Layout/Layout.js +21 -21
- package/dist/Layout/LayoutContent.js +3 -3
- package/dist/Layout/LayoutFooter.js +5 -5
- package/dist/Layout/LayoutHeader.js +5 -5
- package/dist/Layout/LayoutPanel.js +3 -3
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +35 -33
- package/dist/Lightbox/useLightbox.d.ts +0 -1
- package/dist/Lightbox/useLightbox.d.ts.map +1 -1
- package/dist/Lightbox/useLightbox.js +3 -4
- package/dist/Link/Link.d.ts +5 -3
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +47 -18
- package/dist/Link/LinkProvider.js +3 -3
- package/dist/Link/useLinkify.js +3 -3
- package/dist/List/List.js +11 -11
- package/dist/List/ListItem.js +11 -11
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +111 -109
- package/dist/MetadataList/MetadataList.js +10 -10
- package/dist/MetadataList/MetadataListItem.js +15 -15
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +19 -17
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +9 -6
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +7 -4
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +69 -62
- package/dist/NavIcon/NavIcon.js +3 -3
- package/dist/NavMenu/NavHeadingMenu.js +5 -5
- package/dist/NavMenu/NavHeadingMenuItem.js +8 -8
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +21 -17
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +19 -16
- package/dist/OverflowList/OverflowList.js +8 -8
- package/dist/Overlay/Overlay.js +3 -3
- package/dist/Overlay/OverlayScrim.js +5 -5
- package/dist/Overlay/useOverlay.d.ts +0 -3
- package/dist/Overlay/useOverlay.d.ts.map +1 -1
- package/dist/Overlay/useOverlay.js +3 -6
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +73 -46
- package/dist/Popover/Popover.js +16 -16
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -8
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +95 -85
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +109 -103
- package/dist/PowerSearch/PowerSearchFilterEditor.js +3 -3
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +12 -8
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +88 -75
- package/dist/PowerSearch/formatFilterValue.d.ts +2 -1
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +19 -9
- package/dist/PowerSearch/index.d.ts +2 -1
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/index.js +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +23 -0
- package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +1 -0
- package/dist/PowerSearch/resolveOperatorLabel.js +28 -0
- package/dist/PowerSearch/types.d.ts +28 -2
- package/dist/PowerSearch/types.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchConfig.js +27 -27
- package/dist/PowerSearch/usePowerSearchSource.d.ts.map +1 -1
- package/dist/PowerSearch/usePowerSearchSource.js +15 -8
- package/dist/ProgressBar/ProgressBar.js +13 -13
- package/dist/RadioList/RadioList.js +7 -7
- package/dist/RadioList/RadioListItem.js +18 -18
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +10 -7
- package/dist/Section/Section.js +5 -5
- package/dist/SegmentedControl/SegmentedControl.js +5 -5
- package/dist/SegmentedControl/SegmentedControlItem.js +7 -7
- package/dist/SelectableCard/SelectableCard.js +5 -5
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +57 -51
- package/dist/Selector/SelectorOption.js +3 -3
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +38 -36
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +8 -6
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +92 -90
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +49 -43
- package/dist/SideNav/SideNavSection.js +14 -14
- package/dist/Skeleton/Skeleton.js +3 -3
- package/dist/Slider/Slider.js +23 -23
- package/dist/Spinner/Spinner.js +9 -9
- package/dist/StatusDot/StatusDot.js +5 -5
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +29 -27
- package/dist/TabList/Tab.js +18 -18
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +9 -6
- package/dist/TabList/TabMenu.js +23 -23
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +39 -37
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +10 -8
- package/dist/Table/TableBody.js +3 -3
- package/dist/Table/TableCell.js +3 -3
- package/dist/Table/TableFooter.js +3 -3
- package/dist/Table/TableHeader.js +3 -3
- package/dist/Table/TableHeaderCell.js +3 -3
- package/dist/Table/TableRow.js +5 -5
- package/dist/Table/index.d.ts +4 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +2 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +9 -9
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +127 -90
- package/dist/Table/plugins/groupedRows/index.d.ts +3 -0
- package/dist/Table/plugins/groupedRows/index.d.ts.map +1 -0
- package/dist/Table/plugins/groupedRows/index.js +3 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +78 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -0
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +257 -0
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +12 -9
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +30 -28
- package/dist/Table/plugins/rowIndex/index.d.ts +3 -0
- package/dist/Table/plugins/rowIndex/index.d.ts.map +1 -0
- package/dist/Table/plugins/rowIndex/index.js +3 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +50 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -0
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +91 -0
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +23 -20
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +23 -21
- package/dist/Table/tableContextMenu.js +9 -9
- package/dist/Text/Text.js +10 -10
- package/dist/TextArea/TextArea.js +14 -14
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +20 -16
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +37 -31
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +28 -23
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +29 -14
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +17 -15
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +14 -12
- package/dist/Toast/useToast.js +4 -4
- package/dist/ToggleButton/ToggleButton.js +12 -12
- package/dist/ToggleButton/ToggleButtonGroup.js +5 -5
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +29 -23
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +33 -31
- package/dist/Toolbar/Toolbar.js +18 -18
- package/dist/Tooltip/Tooltip.js +11 -11
- package/dist/Tooltip/useTooltip.js +3 -3
- package/dist/TopNav/TopNav.d.ts +2 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +36 -33
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +72 -70
- package/dist/TopNav/TopNavItem.js +5 -5
- package/dist/TopNav/TopNavMegaMenu.js +30 -30
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +10 -10
- package/dist/TopNav/TopNavMegaMenuItem.js +16 -16
- package/dist/TopNav/TopNavMenu.js +32 -32
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +13 -9
- package/dist/TreeList/TreeListBranches.js +11 -11
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +37 -31
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +26 -22
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +15 -13
- package/dist/Typeahead/TypeaheadItem.js +10 -10
- package/dist/VStack/VStack.js +3 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -3
- package/dist/astryx.css +20 -2
- package/dist/astryx.umd.js +66 -64
- package/dist/astryx.umd.js.map +4 -4
- package/dist/authoring/doc.d.ts +145 -0
- package/dist/authoring/doc.d.ts.map +1 -0
- package/dist/authoring/doc.js +100 -0
- package/dist/authoring/index.d.ts +29 -0
- package/dist/authoring/index.d.ts.map +1 -0
- package/dist/authoring/index.js +28 -0
- package/dist/authoring/integration.d.ts +35 -0
- package/dist/authoring/integration.d.ts.map +1 -0
- package/dist/authoring/integration.js +30 -0
- package/dist/authoring/template.d.ts +66 -0
- package/dist/authoring/template.d.ts.map +1 -0
- package/dist/authoring/template.js +55 -0
- package/dist/config.d.ts +80 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +40 -0
- package/dist/hooks/useKeyboardHint.js +9 -9
- package/dist/i18n/InternationalizationContext.d.ts +12 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -0
- package/dist/i18n/InternationalizationContext.js +29 -0
- package/dist/i18n/InternationalizationProvider.d.ts +62 -0
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -0
- package/dist/i18n/InternationalizationProvider.js +44 -0
- package/dist/i18n/index.d.ts +24 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +21 -0
- package/dist/i18n/resolve.d.ts +22 -0
- package/dist/i18n/resolve.d.ts.map +1 -0
- package/dist/i18n/resolve.js +141 -0
- package/dist/i18n/translator.d.ts +25 -0
- package/dist/i18n/translator.d.ts.map +1 -0
- package/dist/i18n/translator.js +1 -0
- package/dist/i18n/types.d.ts +47 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +1 -0
- package/dist/i18n/useTranslator.d.ts +15 -0
- package/dist/i18n/useTranslator.d.ts.map +1 -0
- package/dist/i18n/useTranslator.js +39 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/theme/MediaTheme.js +3 -3
- package/dist/theme/Theme.js +7 -7
- package/dist/theme/syntax/SyntaxTheme.js +5 -5
- package/locales/en.json +746 -0
- package/locales/pseudo.json +560 -0
- package/package.json +24 -3
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
- package/src/AlertDialog/AlertDialog.tsx +4 -1
- package/src/AlertDialog/useImperativeAlertDialog.tsx +0 -2
- package/src/AppShell/AppShell.doc.mjs +8 -2
- package/src/AppShell/AppShell.tsx +3 -1
- package/src/AvatarGroup/AvatarGroup.tsx +4 -1
- package/src/Banner/Banner.tsx +10 -5
- package/src/Breadcrumbs/Breadcrumbs.tsx +4 -1
- package/src/Button/Button.tsx +34 -4
- package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
- package/src/ButtonGroup/ButtonGroup.tsx +27 -11
- package/src/Calendar/Calendar.tsx +8 -5
- package/src/Card/Card.doc.mjs +3 -3
- package/src/Carousel/Carousel.tsx +10 -7
- package/src/Chat/ChatComposer.tsx +5 -1
- package/src/Chat/ChatComposerDrawer.tsx +9 -2
- package/src/Chat/ChatComposerInput.tsx +10 -4
- package/src/Chat/ChatLayout.tsx +5 -12
- package/src/Chat/ChatLayoutScrollButton.tsx +4 -2
- package/src/Chat/ChatMessage.tsx +5 -1
- package/src/Chat/ChatMessageBubble.tsx +2 -0
- package/src/Chat/ChatMessageList.doc.mjs +1 -1
- package/src/Chat/ChatMessageList.tsx +2 -0
- package/src/Chat/ChatMessageMetadata.tsx +15 -9
- package/src/Chat/ChatPastedTextToken.tsx +3 -1
- package/src/Chat/ChatSendButton.tsx +3 -1
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/Chat/useSpeechRecognition.ts +11 -2
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.test.tsx +16 -0
- package/src/CheckboxInput/CheckboxInput.tsx +4 -2
- package/src/CheckboxList/CheckboxList.doc.mjs +6 -1
- package/src/CheckboxList/CheckboxList.tsx +2 -0
- package/src/CheckboxList/CheckboxListItem.tsx +7 -1
- package/src/Citation/Citation.tsx +4 -2
- package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
- package/src/CodeBlock/CodeBlock.tsx +91 -40
- package/src/Collapsible/Collapsible.doc.mjs +3 -3
- package/src/CommandPalette/CommandPalette.tsx +10 -3
- package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
- package/src/CommandPalette/CommandPaletteInput.tsx +5 -1
- package/src/CommandPalette/CommandPaletteList.tsx +4 -1
- package/src/ContextMenu/ContextMenu.tsx +4 -1
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.tsx +13 -5
- package/src/DateRangeInput/DateRangeInput.doc.mjs +7 -7
- package/src/DateRangeInput/DateRangeInput.tsx +14 -6
- package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +17 -7
- package/src/Dialog/DialogHeader.tsx +4 -2
- package/src/DropdownMenu/DropdownMenu.tsx +12 -8
- package/src/EmptyState/EmptyState.doc.mjs +3 -3
- package/src/EmptyState/EmptyState.tsx +4 -1
- package/src/Field/Field.doc.mjs +2 -2
- package/src/FileInput/FileInput.tsx +3 -1
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Lightbox/Lightbox.doc.mjs +7 -2
- package/src/Lightbox/Lightbox.tsx +6 -4
- package/src/Lightbox/useLightbox.tsx +0 -1
- package/src/Link/Link.test.tsx +74 -2
- package/src/Link/Link.tsx +48 -3
- package/src/Markdown/Markdown.tsx +12 -4
- package/src/MobileNav/MobileNav.tsx +4 -2
- package/src/MobileNav/MobileNavToggle.tsx +5 -3
- package/src/MoreMenu/MoreMenu.tsx +4 -1
- package/src/MultiSelector/MultiSelector.tsx +14 -5
- package/src/NumberInput/NumberInput.tsx +3 -1
- package/src/Outline/Outline.tsx +4 -1
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- package/src/Overlay/useOverlay.tsx +0 -3
- package/src/Pagination/Pagination.tsx +35 -12
- package/src/Popover/usePopover.tsx +6 -1
- package/src/PowerSearch/PowerSearch.doc.mjs +9 -4
- package/src/PowerSearch/PowerSearch.tsx +22 -10
- package/src/PowerSearch/PowerSearchEditPopover.tsx +27 -20
- package/src/PowerSearch/PowerSearchToken.tsx +17 -6
- package/src/PowerSearch/PowerSearchValueEditor.tsx +34 -21
- package/src/PowerSearch/formatFilterValue.test.ts +282 -0
- package/src/PowerSearch/formatFilterValue.ts +21 -8
- package/src/PowerSearch/index.ts +5 -0
- package/src/PowerSearch/resolveOperatorLabel.ts +34 -0
- package/src/PowerSearch/types.ts +33 -9
- package/src/PowerSearch/usePowerSearchConfig.ts +59 -27
- package/src/PowerSearch/usePowerSearchSource.ts +17 -8
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/Resizable/ResizeHandle.tsx +4 -1
- package/src/Section/Section.doc.mjs +4 -4
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.tsx +11 -6
- package/src/SideNav/SideNav.tsx +4 -2
- package/src/SideNav/SideNavCollapseButton.tsx +3 -1
- package/src/SideNav/SideNavHeading.tsx +5 -3
- package/src/SideNav/SideNavItem.tsx +3 -1
- package/src/Slider/Slider.doc.mjs +2 -2
- package/src/Stack/Stack.doc.mjs +10 -10
- package/src/Switch/Switch.doc.mjs +2 -2
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +4 -2
- package/src/TabList/TabList.tsx +4 -1
- package/src/Table/BaseTable.tsx +8 -1
- package/src/Table/Table.doc.mjs +1 -1
- package/src/Table/Table.tsx +3 -1
- package/src/Table/index.ts +7 -0
- package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
- package/src/Table/plugins/groupedRows/index.ts +7 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.test.tsx +231 -0
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +351 -0
- package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +8 -4
- package/src/Table/plugins/rowIndex/index.ts +4 -0
- package/src/Table/plugins/rowIndex/useTableRowIndex.test.tsx +132 -0
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +114 -0
- package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableGroupedRows.doc.mjs +71 -0
- package/src/Table/useTableRowIndex.doc.mjs +50 -0
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Text/Text.doc.mjs +2 -2
- package/src/TextInput/TextInput.tsx +3 -1
- package/src/Thumbnail/Thumbnail.tsx +4 -2
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.tsx +6 -2
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Timestamp/Timestamp.test.tsx +120 -7
- package/src/Timestamp/Timestamp.tsx +21 -1
- package/src/Toast/Toast.tsx +3 -1
- package/src/Toast/ToastViewport.tsx +3 -1
- package/src/Token/Token.tsx +4 -2
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tokenizer/Tokenizer.tsx +4 -4
- package/src/Toolbar/Toolbar.doc.mjs +1 -1
- package/src/TopNav/TopNav.doc.mjs +1 -0
- package/src/TopNav/TopNav.test.tsx +30 -0
- package/src/TopNav/TopNav.tsx +6 -4
- package/src/TopNav/TopNavHeading.tsx +5 -3
- package/src/TreeList/TreeList.tsx +5 -1
- package/src/TreeList/TreeListItem.tsx +6 -1
- package/src/Typeahead/BaseTypeahead.tsx +11 -4
- package/src/Typeahead/Typeahead.doc.mjs +1 -1
- package/src/Typeahead/Typeahead.tsx +3 -1
- package/src/VisuallyHidden/VisuallyHidden.tsx +1 -3
- package/src/authoring/doc.ts +166 -0
- package/src/authoring/index.test.ts +52 -0
- package/src/authoring/index.ts +50 -0
- package/src/authoring/integration.ts +42 -0
- package/src/authoring/template.ts +74 -0
- package/src/config.test.ts +16 -0
- package/src/config.ts +92 -0
- package/src/docPropLiterals.test.ts +902 -0
- package/src/hooks/useHotkeys.doc.mjs +5 -5
- package/src/i18n/InternationalizationContext.ts +39 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
- package/src/i18n/InternationalizationProvider.tsx +83 -0
- package/src/i18n/__tests__/e2e-pagination.test.tsx +172 -0
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +130 -0
- package/src/i18n/__tests__/resolve.test.ts +284 -0
- package/src/i18n/index.ts +32 -0
- package/src/i18n/resolve.ts +165 -0
- package/src/i18n/translator.ts +31 -0
- package/src/i18n/types.ts +53 -0
- package/src/i18n/useTranslator.doc.mjs +46 -0
- package/src/i18n/useTranslator.ts +50 -0
- package/src/index.ts +3 -0
- package/dist/NavItem/index.d.ts +0 -9
- package/dist/NavItem/index.d.ts.map +0 -1
- package/dist/NavItem/index.js +0 -10
- package/src/NavItem/index.ts +0 -11
|
@@ -137,6 +137,7 @@ import {mergeProps, mergeRefs} from '../utils';
|
|
|
137
137
|
import type {BaseProps} from '../BaseProps';
|
|
138
138
|
import type {SizeValue} from '../utils/types';
|
|
139
139
|
import {themeProps} from '../utils/themeProps';
|
|
140
|
+
import {useTranslator} from '../i18n';
|
|
140
141
|
|
|
141
142
|
export interface DateInputProps extends Omit<
|
|
142
143
|
BaseProps,
|
|
@@ -311,7 +312,7 @@ export function DateInput({
|
|
|
311
312
|
min,
|
|
312
313
|
max,
|
|
313
314
|
dateConstraints,
|
|
314
|
-
placeholder
|
|
315
|
+
placeholder: placeholderFromProps,
|
|
315
316
|
size: sizeProp,
|
|
316
317
|
status,
|
|
317
318
|
labelTooltip,
|
|
@@ -324,6 +325,9 @@ export function DateInput({
|
|
|
324
325
|
ref,
|
|
325
326
|
...rest
|
|
326
327
|
}: DateInputProps) {
|
|
328
|
+
const t = useTranslator();
|
|
329
|
+
const placeholder =
|
|
330
|
+
placeholderFromProps ?? t('@astryx.dateInput.placeholder');
|
|
327
331
|
const size = useSize(sizeProp, 'md');
|
|
328
332
|
const id = useId();
|
|
329
333
|
const inputLabelID = useId();
|
|
@@ -415,8 +419,8 @@ export function DateInput({
|
|
|
415
419
|
: parseDateInput(pendingInput) !== null;
|
|
416
420
|
|
|
417
421
|
const popover = usePopover({
|
|
418
|
-
dialogLabel: '
|
|
419
|
-
closeButtonLabel: '
|
|
422
|
+
dialogLabel: t('@astryx.dateInput.dialogLabel'),
|
|
423
|
+
closeButtonLabel: t('@astryx.dateInput.closeCalendar'),
|
|
420
424
|
onHide: () => inputRef.current?.focus(),
|
|
421
425
|
});
|
|
422
426
|
|
|
@@ -582,7 +586,11 @@ export function DateInput({
|
|
|
582
586
|
type="button"
|
|
583
587
|
onClick={handleToggle}
|
|
584
588
|
disabled={isEffectivelyDisabled}
|
|
585
|
-
aria-label={
|
|
589
|
+
aria-label={
|
|
590
|
+
popover.isOpen
|
|
591
|
+
? t('@astryx.dateInput.toggleCalendarClose')
|
|
592
|
+
: t('@astryx.dateInput.openCalendar')
|
|
593
|
+
}
|
|
586
594
|
{...stylex.props(
|
|
587
595
|
styles.iconButton,
|
|
588
596
|
isEffectivelyDisabled && styles.iconButtonDisabled,
|
|
@@ -637,7 +645,7 @@ export function DateInput({
|
|
|
637
645
|
<button
|
|
638
646
|
type="button"
|
|
639
647
|
onClick={handleClear}
|
|
640
|
-
aria-label={
|
|
648
|
+
aria-label={t('@astryx.dateInput.clear', {label})}
|
|
641
649
|
{...stylex.props(styles.iconButton)}>
|
|
642
650
|
<Icon icon="close" size="sm" color="secondary" />
|
|
643
651
|
</button>
|
|
@@ -58,7 +58,7 @@ export const docs = {
|
|
|
58
58
|
name: 'value',
|
|
59
59
|
type: 'DateRange | null',
|
|
60
60
|
description:
|
|
61
|
-
'Selected date range or null. Import the `DateRange` type from `@astryxdesign/core/DateRangeInput
|
|
61
|
+
'Selected date range or null. Import the `DateRange` type from `@astryxdesign/core/DateRangeInput`; it is `{start: ISODateString, end: ISODateString}`. Do NOT redeclare your own DateRange type; use the exported one so TypeScript structurally matches.',
|
|
62
62
|
required: true,
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -85,13 +85,13 @@ export const docs = {
|
|
|
85
85
|
name: 'min',
|
|
86
86
|
type: 'ISODateString',
|
|
87
87
|
description:
|
|
88
|
-
'Minimum selectable date. `ISODateString` is a template literal type (`\\`${number}${number}${number}${number}-${number}${number}-${number}${number}\\``)
|
|
88
|
+
'Minimum selectable date. `ISODateString` is a template literal type (`\\`${number}${number}${number}${number}-${number}${number}-${number}${number}\\``). Pass a string literal like `"2026-01-28"`, not a runtime string variable. Import it from `@astryxdesign/core/Calendar` or use `as ISODateString` if computing the value dynamically.',
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
name: 'max',
|
|
92
92
|
type: 'ISODateString',
|
|
93
93
|
description:
|
|
94
|
-
'Maximum selectable date. Same template literal type as `min
|
|
94
|
+
'Maximum selectable date. Same template literal type as `min`: use a YYYY-MM-DD string literal or cast with `as ISODateString`.',
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
name: 'dateConstraints',
|
|
@@ -124,7 +124,7 @@ export const docs = {
|
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
name: 'status',
|
|
127
|
-
type: '
|
|
127
|
+
type: "{type: 'warning' | 'error' | 'success', message?: string}",
|
|
128
128
|
description: 'Status indicator for error, warning, or success states.',
|
|
129
129
|
},
|
|
130
130
|
{
|
|
@@ -286,10 +286,10 @@ export const docsDense = {
|
|
|
286
286
|
isDisabled: 'disable trigger+picker',
|
|
287
287
|
disabledMessage:
|
|
288
288
|
'reason shown in a tooltip on hover/focus when disabled; keeps trigger focusable via aria-disabled',
|
|
289
|
-
value: 'selected range {start, end} or null
|
|
289
|
+
value: 'selected range {start, end} or null; import DateRange type from @astryxdesign/core/DateRangeInput (do not redeclare)',
|
|
290
290
|
onChange: 'callback on range change; null on clear',
|
|
291
|
-
min: 'min selectable date
|
|
292
|
-
max: 'max selectable date
|
|
291
|
+
min: 'min selectable date: ISODateString template literal type (YYYY-MM-DD); use string literal or cast `as ISODateString`',
|
|
292
|
+
max: 'max selectable date: ISODateString template literal type (YYYY-MM-DD); use string literal or cast `as ISODateString`',
|
|
293
293
|
dateConstraints: 'custom constraint fns to disable dates',
|
|
294
294
|
presets: 'preset ranges as quick-select options',
|
|
295
295
|
hasClear: 'clear button when range is set (default true)',
|
|
@@ -54,6 +54,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
54
54
|
import type {SizeValue} from '../utils/types';
|
|
55
55
|
import {useSize} from '../SizeContext/SizeContext';
|
|
56
56
|
import {themeProps} from '../utils/themeProps';
|
|
57
|
+
import {useTranslator} from '../i18n';
|
|
57
58
|
|
|
58
59
|
export type {DateRange} from '../Calendar';
|
|
59
60
|
|
|
@@ -381,7 +382,7 @@ export function DateRangeInput({
|
|
|
381
382
|
dateConstraints,
|
|
382
383
|
presets,
|
|
383
384
|
hasClear = true,
|
|
384
|
-
placeholder
|
|
385
|
+
placeholder: placeholderFromProps,
|
|
385
386
|
size: sizeProp,
|
|
386
387
|
status,
|
|
387
388
|
labelTooltip,
|
|
@@ -393,6 +394,9 @@ export function DateRangeInput({
|
|
|
393
394
|
ref,
|
|
394
395
|
...rest
|
|
395
396
|
}: DateRangeInputProps) {
|
|
397
|
+
const t = useTranslator();
|
|
398
|
+
const placeholder =
|
|
399
|
+
placeholderFromProps ?? t('@astryx.dateRangeInput.placeholder');
|
|
396
400
|
const size = useSize(sizeProp, 'md');
|
|
397
401
|
const id = useId();
|
|
398
402
|
const descriptionID = useId();
|
|
@@ -448,8 +452,8 @@ export function DateRangeInput({
|
|
|
448
452
|
);
|
|
449
453
|
|
|
450
454
|
const popover = usePopover({
|
|
451
|
-
dialogLabel: '
|
|
452
|
-
closeButtonLabel: '
|
|
455
|
+
dialogLabel: t('@astryx.dateRangeInput.dialogLabel'),
|
|
456
|
+
closeButtonLabel: t('@astryx.dateInput.closeCalendar'),
|
|
453
457
|
});
|
|
454
458
|
|
|
455
459
|
const fireChange = useCallback(
|
|
@@ -557,7 +561,11 @@ export function DateRangeInput({
|
|
|
557
561
|
type="button"
|
|
558
562
|
onClick={handleToggle}
|
|
559
563
|
disabled={isEffectivelyDisabled}
|
|
560
|
-
aria-label={
|
|
564
|
+
aria-label={
|
|
565
|
+
popover.isOpen
|
|
566
|
+
? t('@astryx.dateInput.toggleCalendarClose')
|
|
567
|
+
: t('@astryx.dateInput.openCalendar')
|
|
568
|
+
}
|
|
561
569
|
tabIndex={-1}
|
|
562
570
|
{...stylex.props(
|
|
563
571
|
styles.iconButton,
|
|
@@ -594,7 +602,7 @@ export function DateRangeInput({
|
|
|
594
602
|
<button
|
|
595
603
|
type="button"
|
|
596
604
|
onClick={handleClear}
|
|
597
|
-
aria-label={
|
|
605
|
+
aria-label={t('@astryx.dateInput.clear', {label})}
|
|
598
606
|
{...stylex.props(styles.iconButton)}>
|
|
599
607
|
<Icon icon="close" size="sm" color="secondary" />
|
|
600
608
|
</button>
|
|
@@ -613,7 +621,7 @@ export function DateRangeInput({
|
|
|
613
621
|
{presets && presets.length > 0 && (
|
|
614
622
|
<div
|
|
615
623
|
role="group"
|
|
616
|
-
aria-label=
|
|
624
|
+
aria-label={t('@astryx.dateRangeInput.presetDateRanges')}
|
|
617
625
|
{...stylex.props(styles.presetSidebar)}>
|
|
618
626
|
{presets.map(preset => {
|
|
619
627
|
const presetRange = preset.getRange();
|
|
@@ -157,7 +157,7 @@ export const docs = {
|
|
|
157
157
|
},
|
|
158
158
|
{
|
|
159
159
|
name: 'status',
|
|
160
|
-
type: '
|
|
160
|
+
type: "{type: 'warning' | 'error' | 'success', message?: string}",
|
|
161
161
|
description:
|
|
162
162
|
'Status indicator object for error, warning, or success states with a message.',
|
|
163
163
|
},
|
|
@@ -449,7 +449,7 @@ export const docsZh = {
|
|
|
449
449
|
},
|
|
450
450
|
{
|
|
451
451
|
name: 'status',
|
|
452
|
-
type: '
|
|
452
|
+
type: "{type: 'warning' | 'error' | 'success', message?: string}",
|
|
453
453
|
description: '错误、警告或成功状态的状态指示对象,附带消息。',
|
|
454
454
|
},
|
|
455
455
|
{
|
|
@@ -77,6 +77,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
77
77
|
import type {SizeValue} from '../utils/types';
|
|
78
78
|
import {useSize} from '../SizeContext/SizeContext';
|
|
79
79
|
import {themeProps} from '../utils/themeProps';
|
|
80
|
+
import {useTranslator} from '../i18n';
|
|
80
81
|
|
|
81
82
|
export type ISODateTimeString = string & {
|
|
82
83
|
readonly __brand: 'ISODateTimeString';
|
|
@@ -418,8 +419,8 @@ export function DateTimeInput({
|
|
|
418
419
|
hourFormat = '12h',
|
|
419
420
|
timeIncrement = 1,
|
|
420
421
|
hasClear = false,
|
|
421
|
-
placeholder
|
|
422
|
-
timePlaceholder
|
|
422
|
+
placeholder: placeholderFromProps,
|
|
423
|
+
timePlaceholder: timePlaceholderFromProps,
|
|
423
424
|
timeLabel,
|
|
424
425
|
size: sizeProp,
|
|
425
426
|
status,
|
|
@@ -432,6 +433,11 @@ export function DateTimeInput({
|
|
|
432
433
|
ref,
|
|
433
434
|
...rest
|
|
434
435
|
}: DateTimeInputProps) {
|
|
436
|
+
const t = useTranslator();
|
|
437
|
+
const placeholder =
|
|
438
|
+
placeholderFromProps ?? t('@astryx.dateTimeInput.placeholder');
|
|
439
|
+
const timePlaceholder =
|
|
440
|
+
timePlaceholderFromProps ?? t('@astryx.dateTimeInput.timePlaceholder');
|
|
435
441
|
const size = useSize(sizeProp, 'md');
|
|
436
442
|
const dateInputId = useId();
|
|
437
443
|
const timeInputId = useId();
|
|
@@ -599,8 +605,8 @@ export function DateTimeInput({
|
|
|
599
605
|
|
|
600
606
|
// --- Popover ---
|
|
601
607
|
const popover = usePopover({
|
|
602
|
-
dialogLabel: '
|
|
603
|
-
closeButtonLabel: '
|
|
608
|
+
dialogLabel: t('@astryx.dateTimeInput.dialogLabel'),
|
|
609
|
+
closeButtonLabel: t('@astryx.dateInput.closeCalendar'),
|
|
604
610
|
onHide: () => dateInputRef.current?.focus(),
|
|
605
611
|
});
|
|
606
612
|
|
|
@@ -887,7 +893,11 @@ export function DateTimeInput({
|
|
|
887
893
|
type="button"
|
|
888
894
|
onClick={handleCalendarToggle}
|
|
889
895
|
disabled={isEffectivelyDisabled}
|
|
890
|
-
aria-label={
|
|
896
|
+
aria-label={
|
|
897
|
+
popover.isOpen
|
|
898
|
+
? t('@astryx.dateInput.toggleCalendarClose')
|
|
899
|
+
: t('@astryx.dateInput.openCalendar')
|
|
900
|
+
}
|
|
891
901
|
{...stylex.props(
|
|
892
902
|
styles.iconButton,
|
|
893
903
|
isEffectivelyDisabled && styles.iconButtonDisabled,
|
|
@@ -942,7 +952,7 @@ export function DateTimeInput({
|
|
|
942
952
|
<button
|
|
943
953
|
type="button"
|
|
944
954
|
onClick={handleClear}
|
|
945
|
-
aria-label={
|
|
955
|
+
aria-label={t('@astryx.dateInput.clear', {label})}
|
|
946
956
|
{...stylex.props(styles.iconButton)}>
|
|
947
957
|
<Icon icon="close" size="sm" color="secondary" />
|
|
948
958
|
</button>
|
|
@@ -990,7 +1000,7 @@ export function DateTimeInput({
|
|
|
990
1000
|
disabled={isEffectivelyDisabled && !showsDisabledMessage}
|
|
991
1001
|
aria-disabled={showsDisabledMessage ? 'true' : undefined}
|
|
992
1002
|
readOnly={showsDisabledMessage || undefined}
|
|
993
|
-
aria-label={timeLabel ??
|
|
1003
|
+
aria-label={timeLabel ?? t('@astryx.dateTimeInput.timeSuffix', {label})}
|
|
994
1004
|
aria-describedby={ariaDescribedBy}
|
|
995
1005
|
aria-required={isRequired === true ? 'true' : undefined}
|
|
996
1006
|
aria-invalid={
|
|
@@ -26,6 +26,7 @@ import {Heading} from '../Heading/Heading';
|
|
|
26
26
|
import {Text} from '../Text/Text';
|
|
27
27
|
import type {BaseProps} from '../BaseProps';
|
|
28
28
|
import {useDialogContext} from './DialogContext';
|
|
29
|
+
import {useTranslator} from '../i18n';
|
|
29
30
|
|
|
30
31
|
const styles = stylex.create({
|
|
31
32
|
container: {
|
|
@@ -131,6 +132,7 @@ export function DialogHeader({
|
|
|
131
132
|
style,
|
|
132
133
|
ref,
|
|
133
134
|
}: DialogHeaderProps) {
|
|
135
|
+
const t = useTranslator();
|
|
134
136
|
const titleRef = useRef<HTMLHeadingElement>(null);
|
|
135
137
|
const dialogContext = useDialogContext();
|
|
136
138
|
const shouldAutoFocus = dialogContext?.isInline !== true;
|
|
@@ -179,8 +181,8 @@ export function DialogHeader({
|
|
|
179
181
|
{onOpenChange && (
|
|
180
182
|
<Button
|
|
181
183
|
variant="ghost"
|
|
182
|
-
label=
|
|
183
|
-
tooltip=
|
|
184
|
+
label={t('@astryx.dialog.close')}
|
|
185
|
+
tooltip={t('@astryx.dialog.close')}
|
|
184
186
|
icon={<Icon icon="close" color="inherit" />}
|
|
185
187
|
onClick={() => {
|
|
186
188
|
onOpenChange?.(false);
|
|
@@ -55,6 +55,7 @@ import {
|
|
|
55
55
|
import {mergeProps} from '../utils';
|
|
56
56
|
import type {BaseProps} from '../BaseProps';
|
|
57
57
|
import {themeProps} from '../utils/themeProps';
|
|
58
|
+
import {useTranslator} from '../i18n';
|
|
58
59
|
|
|
59
60
|
const styles = stylex.create({
|
|
60
61
|
dropdown: {
|
|
@@ -111,9 +112,7 @@ export interface DropdownMenuSection {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
export type DropdownMenuOption =
|
|
114
|
-
|
|
|
115
|
-
| DropdownMenuDivider
|
|
116
|
-
| DropdownMenuSection;
|
|
115
|
+
DropdownMenuItemData | DropdownMenuDivider | DropdownMenuSection;
|
|
117
116
|
|
|
118
117
|
// =============================================================================
|
|
119
118
|
// Props
|
|
@@ -149,8 +148,7 @@ interface DropdownMenuCompoundProps extends DropdownMenuBaseProps {
|
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
export type DropdownMenuProps =
|
|
152
|
-
|
|
|
153
|
-
| DropdownMenuCompoundProps;
|
|
151
|
+
DropdownMenuDataProps | DropdownMenuCompoundProps;
|
|
154
152
|
|
|
155
153
|
// =============================================================================
|
|
156
154
|
// DropdownMenu
|
|
@@ -176,10 +174,13 @@ export type DropdownMenuProps =
|
|
|
176
174
|
* />
|
|
177
175
|
* ```
|
|
178
176
|
*/
|
|
179
|
-
|
|
177
|
+
// When the consumer doesn't pass `button`, the default label is looked up
|
|
178
|
+
// at render time so it respects the active InternationalizationProvider
|
|
179
|
+
// locale.
|
|
180
|
+
const DEFAULT_BUTTON_I18N_KEY = '@astryx.dropdownMenu.label' as const;
|
|
180
181
|
|
|
181
182
|
export function DropdownMenu({
|
|
182
|
-
button
|
|
183
|
+
button: buttonFromProps,
|
|
183
184
|
isMenuOpen: controlledIsOpen,
|
|
184
185
|
onOpenChange,
|
|
185
186
|
menuWidth,
|
|
@@ -192,11 +193,14 @@ export function DropdownMenu({
|
|
|
192
193
|
'data-testid': testId,
|
|
193
194
|
...props
|
|
194
195
|
}: DropdownMenuProps) {
|
|
196
|
+
const t = useTranslator();
|
|
197
|
+
const button = buttonFromProps ?? {label: t(DEFAULT_BUTTON_I18N_KEY)};
|
|
198
|
+
|
|
195
199
|
const items = ('items' in props ? props.items : undefined) ?? [];
|
|
196
200
|
const children = props.children;
|
|
197
201
|
|
|
198
202
|
const menuId = useId();
|
|
199
|
-
const menuSize = button
|
|
203
|
+
const menuSize = button.size ?? 'md';
|
|
200
204
|
const buttonRef = useRef<HTMLButtonElement>(null);
|
|
201
205
|
|
|
202
206
|
// Open state
|
|
@@ -39,7 +39,7 @@ export const docs = {
|
|
|
39
39
|
name: 'headingLevel',
|
|
40
40
|
type: '1 | 2 | 3 | 4 | 5 | 6',
|
|
41
41
|
description:
|
|
42
|
-
'Controls the rendered HTML heading tag (h1-h6)
|
|
42
|
+
'Controls only the rendered HTML heading tag (h1-h6) so the title fits the document outline. This is a semantic change for accessibility and does not change the visual size of the title, which stays fixed regardless of level.',
|
|
43
43
|
default: '3',
|
|
44
44
|
},
|
|
45
45
|
{
|
|
@@ -121,7 +121,7 @@ export const docsZh = {
|
|
|
121
121
|
name: 'headingLevel',
|
|
122
122
|
type: '1 | 2 | 3 | 4 | 5 | 6',
|
|
123
123
|
description:
|
|
124
|
-
'
|
|
124
|
+
'仅控制渲染的 HTML 标题标签(h1-h6),使标题适配文档大纲。这是用于无障碍的语义变化,不会改变标题的视觉大小,标题大小始终固定,与级别无关。',
|
|
125
125
|
default: '3',
|
|
126
126
|
},
|
|
127
127
|
{
|
|
@@ -173,7 +173,7 @@ export const docsDense = {
|
|
|
173
173
|
},
|
|
174
174
|
propDescriptions: {
|
|
175
175
|
title: 'Primary msg rendered as heading (h1-h6) inside empty state.',
|
|
176
|
-
headingLevel: 'Controls HTML heading tag (h1-h6) for document outline.',
|
|
176
|
+
headingLevel: 'Controls only HTML heading tag (h1-h6) for document outline; does not change visual title size.',
|
|
177
177
|
description: 'Optional secondary text w/ additional context below title.',
|
|
178
178
|
icon: 'Optional icon/illustration above title; rendered decorative (aria-hidden="true").',
|
|
179
179
|
actions: 'Optional action buttons below description; horizontal by default, vertical when isCompact.',
|
|
@@ -105,7 +105,10 @@ export interface EmptyStateProps extends BaseProps<HTMLDivElement> {
|
|
|
105
105
|
actions?: ReactNode;
|
|
106
106
|
/**
|
|
107
107
|
* Semantic heading level for the title element.
|
|
108
|
-
* Controls the rendered HTML tag (h1–h6)
|
|
108
|
+
* Controls only the rendered HTML tag (h1–h6) so the title fits the
|
|
109
|
+
* document outline. This is a semantic change for accessibility and does
|
|
110
|
+
* not change the visual size of the title, which stays fixed regardless
|
|
111
|
+
* of level.
|
|
109
112
|
* @default 3
|
|
110
113
|
*/
|
|
111
114
|
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
package/src/Field/Field.doc.mjs
CHANGED
|
@@ -104,8 +104,8 @@ export const docs = {
|
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
name: 'status',
|
|
107
|
-
type: '
|
|
108
|
-
description: 'Status indicator with type and optional message. When message is set, displays a colored status box.',
|
|
107
|
+
type: "{type: 'warning' | 'error' | 'success', message?: string, messageID?: string}",
|
|
108
|
+
description: 'Status indicator with type and optional message. When message is set, displays a colored status box. messageID is for wiring aria-describedby on the input.',
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
name: 'statusVariant',
|
|
@@ -55,6 +55,7 @@ import {mergeProps, mergeRefs} from '../utils';
|
|
|
55
55
|
import type {BaseProps} from '../BaseProps';
|
|
56
56
|
import type {SizeValue} from '../utils/types';
|
|
57
57
|
import {themeProps} from '../utils/themeProps';
|
|
58
|
+
import {useTranslator} from '../i18n';
|
|
58
59
|
|
|
59
60
|
function formatFileSize(bytes: number): string {
|
|
60
61
|
if (bytes < 1024) {
|
|
@@ -425,6 +426,7 @@ export function FileInput({
|
|
|
425
426
|
ref,
|
|
426
427
|
...rest
|
|
427
428
|
}: FileInputProps) {
|
|
429
|
+
const t = useTranslator();
|
|
428
430
|
const id = useId();
|
|
429
431
|
const descriptionID = useId();
|
|
430
432
|
const statusMessageID = useId();
|
|
@@ -774,7 +776,7 @@ export function FileInput({
|
|
|
774
776
|
/>
|
|
775
777
|
{isDropzone ? renderDropzoneContent() : renderCompactContent()}
|
|
776
778
|
{hasFiles && !isDisabled && !isLoading && (
|
|
777
|
-
<InputClearButton label={
|
|
779
|
+
<InputClearButton label={t('@astryx.fileInput.clearLabel', {label})} onClick={handleClear} />
|
|
778
780
|
)}
|
|
779
781
|
</div>
|
|
780
782
|
<div
|
package/src/Grid/Grid.doc.mjs
CHANGED
|
@@ -60,28 +60,28 @@ export const docs = {
|
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
name: 'gap',
|
|
63
|
-
type: '
|
|
63
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
64
64
|
description: 'Spacing between all items.',
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
name: 'rowGap',
|
|
68
|
-
type: '
|
|
68
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
69
69
|
description: 'Row spacing; overrides `gap` for the row axis.',
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
name: 'columnGap',
|
|
73
|
-
type: '
|
|
73
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
74
74
|
description: 'Column spacing; overrides `gap` for the column axis.',
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
name: 'align',
|
|
78
|
-
type: '
|
|
78
|
+
type: "'start' | 'center' | 'end' | 'stretch'",
|
|
79
79
|
description: 'Vertical alignment of items.',
|
|
80
80
|
default: "'stretch'",
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
name: 'justify',
|
|
84
|
-
type: '
|
|
84
|
+
type: "'start' | 'center' | 'end' | 'stretch'",
|
|
85
85
|
description: 'Horizontal alignment of items.',
|
|
86
86
|
default: "'stretch'",
|
|
87
87
|
},
|
|
@@ -78,7 +78,7 @@ export const docs = {
|
|
|
78
78
|
name: 'render',
|
|
79
79
|
type: '(children: ReactNode, props: ContextRenderProps | FixedRenderProps) => ReactNode',
|
|
80
80
|
description:
|
|
81
|
-
'Render function for the popover element. Pass placement/alignment in context mode or x/y in fixed mode. Placement/alignment are logical: they map to the self-* position-area keyword family, which resolves against the popover\'s own inherited direction, so RTL contexts mirror automatically in pure CSS. Pass `positioning: "custom"` in context mode to author position styles yourself via `style` (e.g. explicit anchor() insets or an anchor-size() cover): the hook keeps the popover behavior and position-anchor wiring but derives no position styles
|
|
81
|
+
'Render function for the popover element. Pass placement/alignment in context mode or x/y in fixed mode. Placement/alignment are logical: they map to the self-* position-area keyword family, which resolves against the popover\'s own inherited direction, so RTL contexts mirror automatically in pure CSS. Pass `positioning: "custom"` in context mode to author position styles yourself via `style` (e.g. explicit anchor() insets or an anchor-size() cover): the hook keeps the popover behavior and position-anchor wiring but derives no position styles, including the automatic RTL mirroring, which becomes your responsibility. In context mode, pass `as: "span"` to render an inline-safe layer (e.g. inside a paragraph). The layer renders inline in the React tree; the Popover API promotes it to the top layer when shown, so it escapes ancestor clipping and stacking without a portal.',
|
|
82
82
|
},
|
|
83
83
|
],
|
|
84
84
|
usage: {
|
|
@@ -130,7 +130,7 @@ export const docsDense = {
|
|
|
130
130
|
hide: 'hide layer.',
|
|
131
131
|
isOpen: 'whether layer is open.',
|
|
132
132
|
id: 'unique ARIA id.',
|
|
133
|
-
render: 'renders popover element; pass placement/alignment or x/y. Placement/alignment logical: mapped to self-* position-area keywords resolved against the popover\'s inherited direction (RTL mirrors in pure CSS). `positioning: "custom"` (context mode) = author position styles yourself via `style`; keeps popover behavior + position-anchor wiring, derives nothing (incl. RTL mirroring
|
|
133
|
+
render: 'renders popover element; pass placement/alignment or x/y. Placement/alignment logical: mapped to self-* position-area keywords resolved against the popover\'s inherited direction (RTL mirrors in pure CSS). `positioning: "custom"` (context mode) = author position styles yourself via `style`; keeps popover behavior + position-anchor wiring, derives nothing (incl. RTL mirroring, which becomes yours). Context mode accepts `as: "span"` for inline-safe layers. Renders inline; the Popover API top layer escapes clipping/stacking without a portal.',
|
|
134
134
|
},
|
|
135
135
|
usage: {
|
|
136
136
|
description:
|
|
@@ -22,8 +22,13 @@ export const docs = {
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
name: 'media',
|
|
25
|
+
// Left as the named type on purpose: the shape carries `caption?:
|
|
26
|
+
// ReactNode`, so spelling it out makes the docsite playground parse the
|
|
27
|
+
// whole prop as an editable *string*, which would feed the preview text
|
|
28
|
+
// where a media object belongs. The shape and its legal values live in
|
|
29
|
+
// the description instead (#1645).
|
|
25
30
|
type: 'LightboxMedia | LightboxMedia[]',
|
|
26
|
-
description:
|
|
31
|
+
description: "Media to display. Pass a single object for one item, or an array for gallery mode with prev/next navigation. Each item is {src: string, alt: string, caption?: ReactNode, type?: 'image' | 'video'}; type defaults to 'image', and zoom/pan is disabled for 'video'.",
|
|
27
32
|
required: true,
|
|
28
33
|
},
|
|
29
34
|
{
|
|
@@ -100,7 +105,7 @@ export const docsZh = {
|
|
|
100
105
|
{
|
|
101
106
|
name: 'media',
|
|
102
107
|
type: 'LightboxMedia | LightboxMedia[]',
|
|
103
|
-
description: '
|
|
108
|
+
description: "要显示的媒体。传入单个对象或数组(用于画廊模式的上一张/下一张导航)。每项为 {src, alt, caption?, type?: 'image' | 'video'};type 默认为 'image','video' 禁用缩放/平移。",
|
|
104
109
|
required: true,
|
|
105
110
|
},
|
|
106
111
|
{
|
|
@@ -35,6 +35,7 @@ import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
|
35
35
|
import {mergeProps, mergeRefs} from '../utils';
|
|
36
36
|
import type {BaseProps} from '../BaseProps';
|
|
37
37
|
import {themeProps} from '../utils/themeProps';
|
|
38
|
+
import {useTranslator} from '../i18n';
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Media type for lightbox items.
|
|
@@ -282,6 +283,7 @@ export function Lightbox({
|
|
|
282
283
|
onKeyDown: onKeyDownProp,
|
|
283
284
|
...props
|
|
284
285
|
}: LightboxProps) {
|
|
286
|
+
const t = useTranslator();
|
|
285
287
|
const dialogRef = useRef<HTMLDialogElement>(null);
|
|
286
288
|
const imageWrapperRef = useRef<HTMLDivElement>(null);
|
|
287
289
|
const triggerElementRef = useRef<Element | null>(null);
|
|
@@ -504,7 +506,7 @@ export function Lightbox({
|
|
|
504
506
|
handleKeyDown(e);
|
|
505
507
|
onKeyDownProp?.(e);
|
|
506
508
|
}}
|
|
507
|
-
aria-label={currentItem.alt || '
|
|
509
|
+
aria-label={currentItem.alt || t('@astryx.lightbox.mediaViewer')}
|
|
508
510
|
{...mergeProps(
|
|
509
511
|
themeProps('lightbox'),
|
|
510
512
|
stylex.props(styles.dialog, xstyle),
|
|
@@ -517,7 +519,7 @@ export function Lightbox({
|
|
|
517
519
|
<div {...stylex.props(styles.closeButton)}>
|
|
518
520
|
<IconButton
|
|
519
521
|
icon={<Icon icon="close" size="sm" color="inherit" />}
|
|
520
|
-
label=
|
|
522
|
+
label={t('@astryx.lightbox.close')}
|
|
521
523
|
variant="ghost"
|
|
522
524
|
onClick={handleClose}
|
|
523
525
|
xstyle={styles.controlButton}
|
|
@@ -531,7 +533,7 @@ export function Lightbox({
|
|
|
531
533
|
<div {...stylex.props(styles.navButton, styles.navPrev)}>
|
|
532
534
|
<IconButton
|
|
533
535
|
icon={<Icon icon="chevronLeft" size="sm" color="inherit" />}
|
|
534
|
-
label=
|
|
536
|
+
label={t('@astryx.lightbox.previous')}
|
|
535
537
|
variant="ghost"
|
|
536
538
|
isDisabled={!canPrev}
|
|
537
539
|
onClick={goToPrev}
|
|
@@ -586,7 +588,7 @@ export function Lightbox({
|
|
|
586
588
|
<div {...stylex.props(styles.navButton, styles.navNext)}>
|
|
587
589
|
<IconButton
|
|
588
590
|
icon={<Icon icon="chevronRight" size="sm" color="inherit" />}
|
|
589
|
-
label=
|
|
591
|
+
label={t('@astryx.lightbox.next')}
|
|
590
592
|
variant="ghost"
|
|
591
593
|
isDisabled={!canNext}
|
|
592
594
|
onClick={goToNext}
|