@astryxdesign/core 0.1.6 → 0.1.7-canary.04cd8f7
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 +68 -0
- package/README.md +25 -14
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +4 -1
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +3 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +4 -1
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +8 -6
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +4 -1
- package/dist/Button/Button.d.ts +10 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +49 -6
- package/dist/ButtonGroup/ButtonGroup.d.ts +20 -5
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +27 -11
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +29 -7
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +8 -5
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +4 -1
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +9 -2
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +6 -2
- package/dist/Chat/ChatLayout.d.ts +1 -11
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +6 -4
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +4 -2
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +8 -2
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +3 -1
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +3 -1
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +13 -8
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +3 -1
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +3 -1
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +12 -1
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +43 -6
- 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 +4 -2
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +4 -2
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +3 -1
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +3 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +10 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +71 -53
- package/dist/Collapsible/Collapsible.d.ts +11 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +36 -4
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +8 -3
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +4 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +4 -1
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +8 -4
- package/dist/ContextMenu/index.d.ts +3 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/ContextMenu/index.js +7 -1
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +10 -5
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +11 -6
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +15 -7
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +15 -12
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +7 -3
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +19 -9
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts +89 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +170 -0
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +17 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +18 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioGroup.js +70 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +69 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -0
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +178 -0
- package/dist/DropdownMenu/index.d.ts +5 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/index.js +10 -1
- package/dist/DropdownMenu/menuItemRoles.d.ts +13 -0
- package/dist/DropdownMenu/menuItemRoles.d.ts.map +1 -0
- package/dist/DropdownMenu/menuItemRoles.js +15 -0
- package/dist/EmptyState/EmptyState.d.ts +4 -1
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +11 -1
- package/dist/Icon/Icon.d.ts +17 -12
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +28 -20
- package/dist/Kbd/Kbd.js +1 -1
- package/dist/Layer/useLayer.d.ts +10 -0
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +23 -1
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +6 -4
- package/dist/Link/Link.d.ts +5 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +32 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +10 -8
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +4 -2
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +4 -1
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +4 -1
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +13 -6
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +5 -1
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +4 -1
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +38 -11
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +4 -1
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +22 -12
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +26 -20
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -3
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +34 -21
- 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/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +4 -1
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +52 -14
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +4 -2
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +3 -1
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +5 -3
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +7 -1
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +4 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -2
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +6 -1
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +1 -1
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +29 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +5 -3
- package/dist/Table/index.d.ts +2 -0
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/index.js +1 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +56 -19
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +12 -5
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +6 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +8 -6
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +1 -1
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +5 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +6 -4
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -2
- package/dist/Table/plugins/tree/index.d.ts +5 -0
- package/dist/Table/plugins/tree/index.d.ts.map +1 -0
- package/dist/Table/plugins/tree/index.js +4 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts +38 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.js +358 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts +51 -0
- package/dist/Table/plugins/tree/useTableTreeState.d.ts.map +1 -0
- package/dist/Table/plugins/tree/useTableTreeState.js +175 -0
- package/dist/Table/types.d.ts +17 -10
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +6 -3
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +5 -1
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +8 -2
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +7 -2
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +18 -3
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +3 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +3 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +8 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +3 -1
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +8 -1
- package/dist/TopNav/TopNav.d.ts +2 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +4 -1
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +5 -3
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +5 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +7 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +8 -4
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +3 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -0
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -0
- package/dist/astryx.css +38 -4
- package/dist/astryx.umd.js +62 -60
- 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/docs-types.d.ts +13 -4
- package/dist/docs-types.d.ts.map +1 -1
- 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 +61 -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/Theme.js +1 -1
- package/dist/theme/defineTheme.d.ts +1 -1
- package/dist/theme/defineTheme.js +1 -1
- package/dist/theme/hct.d.ts +0 -1
- package/dist/theme/hct.d.ts.map +1 -1
- package/dist/theme/hct.js +0 -3
- package/dist/utils/color.d.ts +13 -1
- package/dist/utils/color.d.ts.map +1 -1
- package/dist/utils/color.js +23 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/locales/en.json +754 -0
- package/locales/pseudo.json +566 -0
- package/package.json +23 -2
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -0
- package/src/AlertDialog/AlertDialog.tsx +4 -1
- 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.doc.mjs +8 -0
- package/src/Button/Button.test.tsx +27 -0
- package/src/Button/Button.tsx +51 -5
- package/src/ButtonGroup/ButtonGroup.test.tsx +386 -2
- package/src/ButtonGroup/ButtonGroup.tsx +27 -11
- package/src/Calendar/Calendar.test.tsx +103 -2
- package/src/Calendar/Calendar.tsx +29 -6
- 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.test.tsx +127 -2
- 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/index.ts +1 -0
- package/src/Chat/useChatStreamScroll.test.tsx +168 -0
- package/src/Chat/useChatStreamScroll.ts +67 -11
- package/src/Chat/useSpeechRecognition.ts +11 -2
- package/src/Chat/useTriggerMenu.tsx +4 -2
- package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
- 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 +7 -0
- package/src/Collapsible/Collapsible.test.tsx +80 -0
- package/src/Collapsible/Collapsible.tsx +58 -5
- 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.test.tsx +75 -1
- package/src/ContextMenu/ContextMenu.tsx +14 -6
- package/src/ContextMenu/index.ts +15 -0
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.test.tsx +17 -5
- package/src/DateInput/DateInput.tsx +13 -5
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- 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/Dialog.tsx +11 -15
- package/src/Dialog/DialogHeader.tsx +7 -3
- package/src/DropdownMenu/DropdownMenu.doc.mjs +23 -0
- package/src/DropdownMenu/DropdownMenu.tsx +23 -14
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +95 -0
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +237 -0
- package/src/DropdownMenu/DropdownMenuContext.tsx +29 -1
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +7 -1
- package/src/DropdownMenu/DropdownMenuRadioGroup.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +119 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +80 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +232 -0
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +163 -0
- package/src/DropdownMenu/index.ts +23 -3
- package/src/DropdownMenu/menuItemRoles.ts +22 -0
- package/src/EmptyState/EmptyState.doc.mjs +3 -3
- package/src/EmptyState/EmptyState.tsx +4 -1
- package/src/Field/Field.doc.mjs +3 -3
- package/src/Field/FieldLabel.doc.mjs +1 -1
- package/src/FileInput/FileInput.test.tsx +40 -1
- package/src/FileInput/FileInput.tsx +12 -1
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/Icon/Icon.test.tsx +46 -0
- package/src/Icon/Icon.tsx +37 -24
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Kbd/Kbd.test.tsx +26 -0
- package/src/Kbd/Kbd.tsx +1 -1
- package/src/Layer/useLayer.doc.mjs +8 -5
- package/src/Layer/useLayer.test.tsx +136 -1
- package/src/Layer/useLayer.tsx +34 -2
- package/src/Lightbox/Lightbox.doc.mjs +7 -2
- package/src/Lightbox/Lightbox.tsx +6 -4
- package/src/Link/Link.test.tsx +74 -2
- package/src/Link/Link.tsx +48 -1
- 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.doc.mjs +2 -2
- package/src/NumberInput/NumberInput.tsx +3 -1
- package/src/Outline/Outline.tsx +4 -1
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- 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.doc.mjs +6 -3
- package/src/Selector/Selector.test.tsx +114 -6
- package/src/Selector/Selector.tsx +68 -17
- package/src/Selector/SelectorOption.doc.mjs +1 -1
- 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.doc.mjs +2 -2
- 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 +3 -3
- package/src/Switch/Switch.test.tsx +16 -0
- package/src/Switch/Switch.tsx +4 -2
- package/src/TabList/Tab.tsx +5 -1
- package/src/TabList/TabList.doc.mjs +3 -3
- package/src/TabList/TabList.test.tsx +66 -0
- package/src/TabList/TabList.tsx +12 -1
- package/src/TabList/TabMenu.tsx +4 -1
- package/src/Table/BaseTable.tsx +36 -19
- package/src/Table/Table.doc.mjs +2 -0
- package/src/Table/Table.test.tsx +132 -1
- package/src/Table/Table.tsx +6 -4
- package/src/Table/index.ts +7 -0
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +31 -30
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +7 -5
- package/src/Table/plugins/pagination/useTablePagination.tsx +4 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +9 -8
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -1
- package/src/Table/plugins/selection/useTableSelection.tsx +6 -7
- package/src/Table/plugins/sortable/useTableSortable.tsx +8 -5
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +4 -4
- package/src/Table/plugins/tree/index.ts +12 -0
- package/src/Table/plugins/tree/useTableTreeData-perf.test.tsx +163 -0
- package/src/Table/plugins/tree/useTableTreeData.test.tsx +594 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +495 -0
- package/src/Table/plugins/tree/useTableTreeState.test.tsx +636 -0
- package/src/Table/plugins/tree/useTableTreeState.tsx +253 -0
- package/src/Table/types.ts +18 -12
- package/src/Table/useBaseTablePlugins.ts +6 -2
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableGroupedRows.doc.mjs +3 -3
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Table/useTableTreeData.doc.mjs +75 -0
- package/src/Table/useTableTreeState.doc.mjs +98 -0
- package/src/Text/Text.doc.mjs +2 -2
- package/src/TextArea/TextArea.doc.mjs +1 -1
- package/src/TextInput/TextInput.doc.mjs +1 -1
- 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/Toolbar/Toolbar.tsx +10 -3
- 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 -0
- 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 +938 -0
- package/src/docs-types.ts +15 -10
- package/src/i18n/InternationalizationContext.ts +39 -0
- package/src/i18n/InternationalizationProvider.doc.mjs +72 -0
- package/src/i18n/InternationalizationProvider.tsx +82 -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/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +1 -1
- package/src/theme/defineTheme.ts +1 -1
- package/src/theme/hct.ts +0 -4
- package/src/utils/color.test.ts +101 -1
- package/src/utils/color.ts +23 -1
- package/src/utils/index.ts +8 -1
- 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
|
@@ -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}
|
package/src/Link/Link.test.tsx
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {describe, it, expect, vi} from 'vitest';
|
|
13
|
-
import {render, screen} from '@testing-library/react';
|
|
13
|
+
import {fireEvent, render, screen} from '@testing-library/react';
|
|
14
14
|
import userEvent from '@testing-library/user-event';
|
|
15
15
|
import {Link} from './Link';
|
|
16
16
|
import {LinkProvider} from './LinkProvider';
|
|
@@ -153,9 +153,81 @@ describe('Link', () => {
|
|
|
153
153
|
Disabled Link
|
|
154
154
|
</Link>,
|
|
155
155
|
);
|
|
156
|
-
|
|
156
|
+
// An href-less anchor has no implicit `link` role, so query by text.
|
|
157
|
+
const link = screen.getByText('Disabled Link').closest('a');
|
|
158
|
+
expect(link).not.toBeNull();
|
|
157
159
|
expect(link).toHaveAttribute('aria-disabled', 'true');
|
|
158
160
|
expect(link).toHaveAttribute('tabIndex', '-1');
|
|
161
|
+
// Visual classes are preserved in the disabled state.
|
|
162
|
+
expect(link?.className).toContain('astryx-link');
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('disabled link has no href attribute', () => {
|
|
166
|
+
render(
|
|
167
|
+
<Link href="/test" isDisabled>
|
|
168
|
+
Disabled Link
|
|
169
|
+
</Link>,
|
|
170
|
+
);
|
|
171
|
+
const link = screen.getByText('Disabled Link').closest('a');
|
|
172
|
+
expect(link).not.toBeNull();
|
|
173
|
+
expect(link).not.toHaveAttribute('href');
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('clicking a disabled link cancels default navigation', () => {
|
|
177
|
+
render(
|
|
178
|
+
<Link href="/test" isDisabled>
|
|
179
|
+
Disabled Link
|
|
180
|
+
</Link>,
|
|
181
|
+
);
|
|
182
|
+
const link = screen.getByText('Disabled Link').closest('a');
|
|
183
|
+
expect(link).not.toBeNull();
|
|
184
|
+
// fireEvent bypasses pointer-events, simulating programmatic/AT
|
|
185
|
+
// activation. It returns false when preventDefault was called, i.e.
|
|
186
|
+
// any default navigation behavior is cancelled.
|
|
187
|
+
const notCancelled = fireEvent.click(link as HTMLAnchorElement);
|
|
188
|
+
expect(notCancelled).toBe(false);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('disabled link with onClick fires neither navigation nor the consumer onClick', () => {
|
|
192
|
+
const handleClick = vi.fn();
|
|
193
|
+
const {container} = render(
|
|
194
|
+
<Link href="/test" isDisabled onClick={handleClick}>
|
|
195
|
+
Disabled Link
|
|
196
|
+
</Link>,
|
|
197
|
+
);
|
|
198
|
+
// With onClick present, a disabled Link renders as a disabled <button>
|
|
199
|
+
// (useInteractiveRole excludes a disabled href). Either way the rendered
|
|
200
|
+
// root must carry no live href and never invoke the consumer handler.
|
|
201
|
+
const el = container.firstElementChild as HTMLElement;
|
|
202
|
+
expect(el).not.toHaveAttribute('href');
|
|
203
|
+
fireEvent.click(el);
|
|
204
|
+
expect(handleClick).not.toHaveBeenCalled();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('disabled link omits target and rel', () => {
|
|
208
|
+
render(
|
|
209
|
+
<Link href="https://example.com" isDisabled isExternalLink>
|
|
210
|
+
Disabled External
|
|
211
|
+
</Link>,
|
|
212
|
+
);
|
|
213
|
+
const link = screen.getByText('Disabled External').closest('a');
|
|
214
|
+
expect(link).not.toBeNull();
|
|
215
|
+
expect(link).not.toHaveAttribute('target');
|
|
216
|
+
expect(link).not.toHaveAttribute('rel');
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it('disabled link renders a plain anchor, not the custom LinkComponent', () => {
|
|
220
|
+
render(
|
|
221
|
+
<LinkProvider component={CustomLink}>
|
|
222
|
+
<Link href="/custom" as={CustomLink} isDisabled>
|
|
223
|
+
Disabled Custom
|
|
224
|
+
</Link>
|
|
225
|
+
</LinkProvider>,
|
|
226
|
+
);
|
|
227
|
+
const link = screen.getByText('Disabled Custom').closest('a');
|
|
228
|
+
expect(link).not.toBeNull();
|
|
229
|
+
expect(link).not.toHaveAttribute('data-custom-link');
|
|
230
|
+
expect(link).not.toHaveAttribute('href');
|
|
159
231
|
});
|
|
160
232
|
|
|
161
233
|
it('renders external link with icon and target="_blank"', () => {
|
package/src/Link/Link.tsx
CHANGED
|
@@ -44,6 +44,7 @@ import {mergeProps} from '../utils';
|
|
|
44
44
|
import {computeTargetAndRel} from './computeTargetAndRel';
|
|
45
45
|
import {useInteractiveRole} from '../hooks/useInteractiveRole';
|
|
46
46
|
import {themeProps} from '../utils/themeProps';
|
|
47
|
+
import {useTranslator} from '../i18n';
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* Base link styles
|
|
@@ -174,6 +175,10 @@ export interface LinkProps extends BaseProps<
|
|
|
174
175
|
hasUnderline?: boolean;
|
|
175
176
|
/**
|
|
176
177
|
* Whether the link is disabled.
|
|
178
|
+
* A disabled link renders as a plain anchor without an href (and without
|
|
179
|
+
* target/rel/onClick), so it cannot be focused or activated — no
|
|
180
|
+
* navigation and no onClick, even via programmatic focus or assistive
|
|
181
|
+
* technology activation.
|
|
177
182
|
* @default false
|
|
178
183
|
*/
|
|
179
184
|
isDisabled?: boolean;
|
|
@@ -261,6 +266,15 @@ export interface LinkProps extends BaseProps<
|
|
|
261
266
|
children: ReactNode;
|
|
262
267
|
}
|
|
263
268
|
|
|
269
|
+
/**
|
|
270
|
+
* Click handler for disabled links. The disabled anchor renders without an
|
|
271
|
+
* href, so there is no navigation to block in practice; preventDefault is a
|
|
272
|
+
* defensive guard against synthetic/programmatic clicks.
|
|
273
|
+
*/
|
|
274
|
+
function preventDefaultClick(event: React.MouseEvent<HTMLAnchorElement>): void {
|
|
275
|
+
event.preventDefault();
|
|
276
|
+
}
|
|
277
|
+
|
|
264
278
|
/**
|
|
265
279
|
* A styled anchor link component.
|
|
266
280
|
*
|
|
@@ -286,7 +300,7 @@ export function Link({
|
|
|
286
300
|
hasUnderline = false,
|
|
287
301
|
isDisabled = false,
|
|
288
302
|
isExternalLink = false,
|
|
289
|
-
newTabLabel
|
|
303
|
+
newTabLabel: newTabLabelFromProps,
|
|
290
304
|
target: targetFromProps,
|
|
291
305
|
onClick,
|
|
292
306
|
tooltip,
|
|
@@ -305,6 +319,8 @@ export function Link({
|
|
|
305
319
|
ref,
|
|
306
320
|
...props
|
|
307
321
|
}: LinkProps) {
|
|
322
|
+
const t = useTranslator();
|
|
323
|
+
const newTabLabel = newTabLabelFromProps ?? t('@astryx.link.newTab');
|
|
308
324
|
const LinkComponent = useLinkComponent(as);
|
|
309
325
|
const role = useInteractiveRole({href, onClick, isDisabled});
|
|
310
326
|
// Determine target and rel based on isExternalLink
|
|
@@ -368,6 +384,37 @@ export function Link({
|
|
|
368
384
|
{sharedContent}
|
|
369
385
|
</button>
|
|
370
386
|
);
|
|
387
|
+
} else if (isDisabled) {
|
|
388
|
+
// A disabled link renders as a plain <a> with no href: an href-less
|
|
389
|
+
// anchor is not focusable and exposes no link affordance, so programmatic
|
|
390
|
+
// focus + Enter, AT activation commands, and middle-click cannot navigate
|
|
391
|
+
// or fire the consumer onClick. The router LinkComponent is deliberately
|
|
392
|
+
// skipped — a disabled link performs no navigation, and custom router
|
|
393
|
+
// links may require a live href. target/rel are omitted with the href.
|
|
394
|
+
linkElement = (
|
|
395
|
+
<a
|
|
396
|
+
ref={ref as React.Ref<HTMLAnchorElement>}
|
|
397
|
+
onClick={preventDefaultClick}
|
|
398
|
+
aria-label={label || undefined}
|
|
399
|
+
aria-disabled={true}
|
|
400
|
+
tabIndex={-1}
|
|
401
|
+
{...mergeProps(
|
|
402
|
+
themeProps('link', {color}),
|
|
403
|
+
stylex.props(
|
|
404
|
+
styles.base,
|
|
405
|
+
linkColorStyles[color],
|
|
406
|
+
hasUnderline && styles.hasUnderline,
|
|
407
|
+
isStandalone && styles.standalone,
|
|
408
|
+
styles.disabled,
|
|
409
|
+
xstyle,
|
|
410
|
+
),
|
|
411
|
+
className,
|
|
412
|
+
style,
|
|
413
|
+
)}
|
|
414
|
+
{...props}>
|
|
415
|
+
{sharedContent}
|
|
416
|
+
</a>
|
|
417
|
+
);
|
|
371
418
|
} else {
|
|
372
419
|
linkElement = (
|
|
373
420
|
<LinkComponent
|
|
@@ -56,6 +56,7 @@ import {
|
|
|
56
56
|
} from './parser';
|
|
57
57
|
import type {BlockNode, InlineNode, IncrementalState} from './parser';
|
|
58
58
|
import {themeProps} from '../utils/themeProps';
|
|
59
|
+
import {useTranslator, type TranslatorFn} from '../i18n';
|
|
59
60
|
|
|
60
61
|
type SyncReactNode = Exclude<React.ReactNode, Promise<unknown>>;
|
|
61
62
|
|
|
@@ -1041,8 +1042,9 @@ function renderBlock(
|
|
|
1041
1042
|
contentWidthValue: string | null,
|
|
1042
1043
|
contentAlign: 'start' | 'center',
|
|
1043
1044
|
linkComponent: LinkComponentType = 'a',
|
|
1044
|
-
inlinePlugins
|
|
1045
|
-
components
|
|
1045
|
+
inlinePlugins: MarkdownInlinePlugin[] | undefined,
|
|
1046
|
+
components: Partial<MarkdownComponents> | undefined,
|
|
1047
|
+
t: TranslatorFn,
|
|
1046
1048
|
): SyncReactNode {
|
|
1047
1049
|
const blockAlignMargin = BLOCK_ALIGN_MARGIN[contentAlign];
|
|
1048
1050
|
const blockAlignStyle =
|
|
@@ -1197,6 +1199,7 @@ function renderBlock(
|
|
|
1197
1199
|
linkComponent,
|
|
1198
1200
|
inlinePlugins,
|
|
1199
1201
|
components,
|
|
1202
|
+
t,
|
|
1200
1203
|
),
|
|
1201
1204
|
);
|
|
1202
1205
|
return <BlockquoteComp key={index}>{bqC}</BlockquoteComp>;
|
|
@@ -1230,6 +1233,7 @@ function renderBlock(
|
|
|
1230
1233
|
linkComponent,
|
|
1231
1234
|
inlinePlugins,
|
|
1232
1235
|
components,
|
|
1236
|
+
t,
|
|
1233
1237
|
),
|
|
1234
1238
|
)}
|
|
1235
1239
|
</Blockquote>
|
|
@@ -1256,7 +1260,7 @@ function renderBlock(
|
|
|
1256
1260
|
isLast && styles.noMarginBlockEnd,
|
|
1257
1261
|
)}>
|
|
1258
1262
|
<CheckboxList
|
|
1259
|
-
label=
|
|
1263
|
+
label={t('@astryx.markdown.taskList')}
|
|
1260
1264
|
isLabelHidden
|
|
1261
1265
|
value={checkedValues}
|
|
1262
1266
|
xstyle={styles.blockIndent}
|
|
@@ -1300,6 +1304,7 @@ function renderBlock(
|
|
|
1300
1304
|
linkComponent,
|
|
1301
1305
|
inlinePlugins,
|
|
1302
1306
|
components,
|
|
1307
|
+
t,
|
|
1303
1308
|
),
|
|
1304
1309
|
)}
|
|
1305
1310
|
</>
|
|
@@ -1378,6 +1383,7 @@ function renderBlock(
|
|
|
1378
1383
|
linkComponent,
|
|
1379
1384
|
inlinePlugins,
|
|
1380
1385
|
components,
|
|
1386
|
+
t,
|
|
1381
1387
|
),
|
|
1382
1388
|
)}
|
|
1383
1389
|
</>
|
|
@@ -1407,7 +1413,7 @@ function renderBlock(
|
|
|
1407
1413
|
// (axe: landmark-unique).
|
|
1408
1414
|
tabIndex={0}
|
|
1409
1415
|
role="group"
|
|
1410
|
-
aria-label=
|
|
1416
|
+
aria-label={t('@astryx.markdown.table')}
|
|
1411
1417
|
{...stylex.props(
|
|
1412
1418
|
styles.tableWrapper,
|
|
1413
1419
|
spacing,
|
|
@@ -1567,6 +1573,7 @@ export function Markdown({
|
|
|
1567
1573
|
style,
|
|
1568
1574
|
'data-testid': testId,
|
|
1569
1575
|
}: MarkdownProps): React.ReactElement {
|
|
1576
|
+
const t = useTranslator();
|
|
1570
1577
|
const LinkComponent = useLinkComponent();
|
|
1571
1578
|
// Derive the set of source IDs for the parser (stable across renders when sources don't change)
|
|
1572
1579
|
const sourceIds = useMemo(
|
|
@@ -1725,6 +1732,7 @@ export function Markdown({
|
|
|
1725
1732
|
LinkComponent,
|
|
1726
1733
|
inlinePlugins,
|
|
1727
1734
|
components,
|
|
1735
|
+
t,
|
|
1728
1736
|
),
|
|
1729
1737
|
)}
|
|
1730
1738
|
</div>
|
|
@@ -49,6 +49,7 @@ import {useAppShellMobile} from '../AppShell/AppShellMobileContext';
|
|
|
49
49
|
import {mergeProps, mergeRefs, composeEventHandlers} from '../utils';
|
|
50
50
|
import type {BaseProps} from '../BaseProps';
|
|
51
51
|
import {themeProps} from '../utils/themeProps';
|
|
52
|
+
import {useTranslator} from '../i18n';
|
|
52
53
|
|
|
53
54
|
// =============================================================================
|
|
54
55
|
// Styles
|
|
@@ -290,6 +291,7 @@ export function MobileNav({
|
|
|
290
291
|
ref,
|
|
291
292
|
...rest
|
|
292
293
|
}: MobileNavProps) {
|
|
294
|
+
const t = useTranslator();
|
|
293
295
|
// Read from AppShell context as fallback
|
|
294
296
|
const appShellMobile = useAppShellMobile();
|
|
295
297
|
const isOpen = isOpenProp ?? appShellMobile.isMobileNavOpen;
|
|
@@ -423,7 +425,7 @@ export function MobileNav({
|
|
|
423
425
|
)}
|
|
424
426
|
{...rest}
|
|
425
427
|
data-testid={testId}
|
|
426
|
-
aria-label={label ?? (typeof header === 'string' ? header : '
|
|
428
|
+
aria-label={label ?? (typeof header === 'string' ? header : t('@astryx.mobileNav.navigation'))}
|
|
427
429
|
onClick={composeEventHandlers(onClickProp, handleDialogClick)}
|
|
428
430
|
onCancel={handleCancel}>
|
|
429
431
|
{/* Drawer panel — tabIndex so showModal() focuses the drawer, not the close button */}
|
|
@@ -448,7 +450,7 @@ export function MobileNav({
|
|
|
448
450
|
)}
|
|
449
451
|
<Button
|
|
450
452
|
variant="ghost"
|
|
451
|
-
label=
|
|
453
|
+
label={t('@astryx.mobileNav.closeNavigation')}
|
|
452
454
|
icon={<Icon icon="close" color="inherit" />}
|
|
453
455
|
onClick={() => onOpenChange(false)}
|
|
454
456
|
isIconOnly
|
|
@@ -18,6 +18,7 @@ import {Button} from '../Button';
|
|
|
18
18
|
import {Icon} from '../Icon';
|
|
19
19
|
import {useAppShellMobile} from '../AppShell/AppShellMobileContext';
|
|
20
20
|
import type {BaseProps} from '../BaseProps';
|
|
21
|
+
import {useTranslator} from '../i18n';
|
|
21
22
|
|
|
22
23
|
export interface MobileNavToggleProps extends Pick<
|
|
23
24
|
BaseProps,
|
|
@@ -60,14 +61,15 @@ export interface MobileNavToggleProps extends Pick<
|
|
|
60
61
|
export function MobileNavToggle({
|
|
61
62
|
ref,
|
|
62
63
|
children,
|
|
63
|
-
label
|
|
64
|
+
label: labelFromProps,
|
|
64
65
|
'data-testid': testId,
|
|
65
66
|
xstyle,
|
|
66
67
|
className,
|
|
67
68
|
style,
|
|
68
69
|
}: MobileNavToggleProps) {
|
|
69
|
-
const
|
|
70
|
-
|
|
70
|
+
const t = useTranslator();
|
|
71
|
+
const label = labelFromProps ?? t('@astryx.mobileNav.toggle.open');
|
|
72
|
+
const {isMobile, isMobileNavEnabled, toggleMobileNav} = useAppShellMobile();
|
|
71
73
|
|
|
72
74
|
// Don't render above the breakpoint or when mobile nav is disabled
|
|
73
75
|
if (!isMobile || !isMobileNavEnabled) {
|
|
@@ -26,6 +26,7 @@ import type {DropdownMenuOption} from '../DropdownMenu';
|
|
|
26
26
|
import type {ButtonVariant, ButtonSize} from '../Button';
|
|
27
27
|
import type {BaseProps} from '../BaseProps';
|
|
28
28
|
import {stableClassName} from '../naming';
|
|
29
|
+
import {useTranslator} from '../i18n';
|
|
29
30
|
|
|
30
31
|
export interface MoreMenuProps extends Pick<
|
|
31
32
|
BaseProps,
|
|
@@ -102,7 +103,7 @@ export interface MoreMenuProps extends Pick<
|
|
|
102
103
|
*/
|
|
103
104
|
export function MoreMenu({
|
|
104
105
|
items,
|
|
105
|
-
label
|
|
106
|
+
label: labelFromProps,
|
|
106
107
|
variant = 'ghost',
|
|
107
108
|
size: sizeProp,
|
|
108
109
|
icon,
|
|
@@ -115,6 +116,8 @@ export function MoreMenu({
|
|
|
115
116
|
'data-testid': testId,
|
|
116
117
|
ref,
|
|
117
118
|
}: MoreMenuProps) {
|
|
119
|
+
const t = useTranslator();
|
|
120
|
+
const label = labelFromProps ?? t('@astryx.moreMenu.label');
|
|
118
121
|
const size = useSize(sizeProp, 'md');
|
|
119
122
|
const moreIcon = getIcon('moreHorizontal');
|
|
120
123
|
|
|
@@ -76,6 +76,7 @@ import {themeProps} from '../utils/themeProps';
|
|
|
76
76
|
import {groupStyles} from '../InputGroup/groupStyles';
|
|
77
77
|
import {useInputGroup} from '../InputGroup/InputGroupContext';
|
|
78
78
|
import {VisuallyHidden} from '../VisuallyHidden';
|
|
79
|
+
import {useTranslator} from '../i18n';
|
|
79
80
|
|
|
80
81
|
// Sentinel value for the select-all item in keyboard navigation
|
|
81
82
|
const SELECT_ALL_VALUE = '__xds_select_all__';
|
|
@@ -589,16 +590,16 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
589
590
|
onChange,
|
|
590
591
|
changeAction,
|
|
591
592
|
isLoading = false,
|
|
592
|
-
placeholder
|
|
593
|
+
placeholder: placeholderFromProps,
|
|
593
594
|
size: sizeProp,
|
|
594
595
|
status,
|
|
595
596
|
labelTooltip,
|
|
596
597
|
startIcon,
|
|
597
598
|
hasClear = false,
|
|
598
599
|
hasSelectAll = false,
|
|
599
|
-
selectAllLabel
|
|
600
|
+
selectAllLabel: selectAllLabelFromProps,
|
|
600
601
|
hasSearch = false,
|
|
601
|
-
searchPlaceholder
|
|
602
|
+
searchPlaceholder: searchPlaceholderFromProps,
|
|
602
603
|
triggerDisplay = 'count',
|
|
603
604
|
maxBadges = 3,
|
|
604
605
|
renderOption,
|
|
@@ -610,6 +611,13 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
610
611
|
className,
|
|
611
612
|
style,
|
|
612
613
|
}: MultiSelectorProps<T>) {
|
|
614
|
+
const t = useTranslator();
|
|
615
|
+
const placeholder =
|
|
616
|
+
placeholderFromProps ?? t('@astryx.multiSelector.selectPlaceholder');
|
|
617
|
+
const selectAllLabel =
|
|
618
|
+
selectAllLabelFromProps ?? t('@astryx.multiSelector.selectAll');
|
|
619
|
+
const searchPlaceholder =
|
|
620
|
+
searchPlaceholderFromProps ?? t('@astryx.multiSelector.searchPlaceholder');
|
|
613
621
|
const size = useSize(sizeProp, 'md');
|
|
614
622
|
const triggerId = useId();
|
|
615
623
|
const listboxId = useId();
|
|
@@ -1030,7 +1038,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1030
1038
|
? getItemId(highlightedIndex)
|
|
1031
1039
|
: undefined
|
|
1032
1040
|
}
|
|
1033
|
-
aria-label=
|
|
1041
|
+
aria-label={t('@astryx.multiSelector.searchOptions')}
|
|
1034
1042
|
type="text"
|
|
1035
1043
|
value={searchQuery}
|
|
1036
1044
|
onChange={e => setSearchQuery(e.target.value)}
|
|
@@ -1063,6 +1071,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1063
1071
|
popover.isOpen,
|
|
1064
1072
|
highlightedIndex,
|
|
1065
1073
|
getItemId,
|
|
1074
|
+
t,
|
|
1066
1075
|
]);
|
|
1067
1076
|
|
|
1068
1077
|
// Render an individual item (index-based)
|
|
@@ -1305,7 +1314,7 @@ export function MultiSelector<T extends MultiSelectorOptionType>({
|
|
|
1305
1314
|
<button
|
|
1306
1315
|
type="button"
|
|
1307
1316
|
onClick={handleClear}
|
|
1308
|
-
aria-label={
|
|
1317
|
+
aria-label={t('@astryx.multiSelector.clearAll', {label})}
|
|
1309
1318
|
{...stylex.props(styles.clearButton)}>
|
|
1310
1319
|
<Icon icon="close" size="sm" color="secondary" />
|
|
1311
1320
|
</button>
|
|
@@ -82,12 +82,12 @@ export const docs = {
|
|
|
82
82
|
{
|
|
83
83
|
name: 'startIcon',
|
|
84
84
|
type: 'IconType',
|
|
85
|
-
description: 'Icon to display at the start of the input. See `
|
|
85
|
+
description: 'Icon to display at the start of the input. See `astryx docs icons` for valid semantic names.',
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
name: 'labelIcon',
|
|
89
89
|
type: 'IconType',
|
|
90
|
-
description: 'Icon to display before the label text. See `
|
|
90
|
+
description: 'Icon to display before the label text. See `astryx docs icons` for valid semantic names.',
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
name: 'status',
|
|
@@ -135,6 +135,7 @@ import {mergeProps, mergeRefs} from '../utils';
|
|
|
135
135
|
import type {BaseProps} from '../BaseProps';
|
|
136
136
|
import type {SizeValue} from '../utils/types';
|
|
137
137
|
import {themeProps} from '../utils/themeProps';
|
|
138
|
+
import {useTranslator} from '../i18n';
|
|
138
139
|
|
|
139
140
|
interface NumberInputPropsBase extends Omit<
|
|
140
141
|
BaseProps,
|
|
@@ -399,6 +400,7 @@ export function NumberInput({
|
|
|
399
400
|
ref,
|
|
400
401
|
...rest
|
|
401
402
|
}: NumberInputProps) {
|
|
403
|
+
const t = useTranslator();
|
|
402
404
|
const size = useSize(sizeProp, 'md');
|
|
403
405
|
const id = useId();
|
|
404
406
|
const inputLabelID = useId();
|
|
@@ -663,7 +665,7 @@ export function NumberInput({
|
|
|
663
665
|
<button
|
|
664
666
|
type="button"
|
|
665
667
|
onClick={handleClear}
|
|
666
|
-
aria-label={
|
|
668
|
+
aria-label={t('@astryx.numberInput.clearLabel', {label})}
|
|
667
669
|
{...stylex.props(styles.clearButton)}>
|
|
668
670
|
<Icon icon="close" size="sm" color="secondary" />
|
|
669
671
|
</button>
|
package/src/Outline/Outline.tsx
CHANGED
|
@@ -37,6 +37,7 @@ import type {BaseProps} from '../BaseProps';
|
|
|
37
37
|
import {useScrollSpy} from './useScrollSpy';
|
|
38
38
|
import type {OutlineItem} from './types';
|
|
39
39
|
import {themeProps} from '../utils/themeProps';
|
|
40
|
+
import {useTranslator} from '../i18n';
|
|
40
41
|
|
|
41
42
|
export type {OutlineItem} from './types';
|
|
42
43
|
|
|
@@ -236,7 +237,7 @@ export function Outline({
|
|
|
236
237
|
items,
|
|
237
238
|
activeId,
|
|
238
239
|
onActiveIdChange,
|
|
239
|
-
label
|
|
240
|
+
label: labelFromProps,
|
|
240
241
|
density = 'default',
|
|
241
242
|
xstyle,
|
|
242
243
|
className,
|
|
@@ -245,6 +246,8 @@ export function Outline({
|
|
|
245
246
|
'data-testid': testId,
|
|
246
247
|
...props
|
|
247
248
|
}: OutlineProps) {
|
|
249
|
+
const t = useTranslator();
|
|
250
|
+
const label = labelFromProps ?? t('@astryx.outline.label');
|
|
248
251
|
const rootRef = useRef<HTMLElement | null>(null);
|
|
249
252
|
const LinkComponent = useLinkComponent();
|
|
250
253
|
const isControlled = activeId !== undefined;
|
|
@@ -50,7 +50,7 @@ export const docs = {
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
name: 'gap',
|
|
53
|
-
type: '
|
|
53
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
54
54
|
description:
|
|
55
55
|
'Gap between items as a spacing token step (0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10).',
|
|
56
56
|
default: '2',
|
|
@@ -116,7 +116,7 @@ export const docsZh = {
|
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
name: 'gap',
|
|
119
|
-
type: '
|
|
119
|
+
type: '0 | 0.5 | 1 | 1.5 | 2 | 3 | 4 | 5 | 6 | 8 | 10',
|
|
120
120
|
description:
|
|
121
121
|
'项目间距,使用间距步进值(0、0.5、1、1.5、2、3、4、5、6、8、10)。',
|
|
122
122
|
default: '2',
|