@astryxdesign/core 0.1.6 → 0.1.7-canary.0a6de96
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 +2 -0
- 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.map +1 -1
- package/dist/Collapsible/Collapsible.js +8 -1
- 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/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +4 -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/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/types.d.ts +17 -10
- package/dist/Table/types.d.ts.map +1 -1
- 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/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 +35 -3
- 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/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 +746 -0
- package/locales/pseudo.json +560 -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.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 +1 -0
- package/src/Collapsible/Collapsible.test.tsx +6 -0
- package/src/Collapsible/Collapsible.tsx +19 -4
- 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 +6 -0
- 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 +2 -2
- 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.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/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 +36 -19
- package/src/Table/Table.test.tsx +132 -1
- package/src/Table/Table.tsx +6 -4
- 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/types.ts +18 -12
- 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/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 -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/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
|
@@ -27,6 +27,7 @@ import { Selector } from "../../../Selector/index.js";
|
|
|
27
27
|
import { MultiSelector } from "../../../MultiSelector/index.js";
|
|
28
28
|
import { Tokenizer } from "../../../Tokenizer/index.js";
|
|
29
29
|
import { proportional } from "../../columnUtils.js";
|
|
30
|
+
import { useTranslator } from "../../../i18n/index.js";
|
|
30
31
|
|
|
31
32
|
// =============================================================================
|
|
32
33
|
// Filter Value Types
|
|
@@ -288,18 +289,23 @@ function TextFilterControl({
|
|
|
288
289
|
size,
|
|
289
290
|
hasClear
|
|
290
291
|
}) {
|
|
292
|
+
const t = useTranslator();
|
|
291
293
|
const store = useFilterStore();
|
|
292
294
|
const config = store.getConfig();
|
|
293
295
|
const value = config.filters[columnKey];
|
|
294
296
|
const strValue = typeof value === 'string' ? value : '';
|
|
295
297
|
return /*#__PURE__*/_jsx(TextInput, {
|
|
296
|
-
label:
|
|
298
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
299
|
+
header
|
|
300
|
+
}),
|
|
297
301
|
isLabelHidden: true,
|
|
298
302
|
value: strValue,
|
|
299
303
|
onChange: newValue => {
|
|
300
304
|
store.getConfig().onFilterChange(columnKey, newValue === '' ? null : newValue);
|
|
301
305
|
},
|
|
302
|
-
placeholder:
|
|
306
|
+
placeholder: t('@astryx.tableFiltering.filterByColumn', {
|
|
307
|
+
header
|
|
308
|
+
}),
|
|
303
309
|
size: size,
|
|
304
310
|
hasClear: hasClear
|
|
305
311
|
});
|
|
@@ -311,6 +317,7 @@ function NumberFilterControl({
|
|
|
311
317
|
size,
|
|
312
318
|
hasClear
|
|
313
319
|
}) {
|
|
320
|
+
const t = useTranslator();
|
|
314
321
|
const store = useFilterStore();
|
|
315
322
|
const config = store.getConfig();
|
|
316
323
|
const value = config.filters[columnKey];
|
|
@@ -321,11 +328,15 @@ function NumberFilterControl({
|
|
|
321
328
|
}, [store, columnKey]);
|
|
322
329
|
if (hasClear) {
|
|
323
330
|
return /*#__PURE__*/_jsx(NumberInput, {
|
|
324
|
-
label:
|
|
331
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
332
|
+
header
|
|
333
|
+
}),
|
|
325
334
|
isLabelHidden: true,
|
|
326
335
|
value: numValue,
|
|
327
336
|
onChange: handleChange,
|
|
328
|
-
placeholder:
|
|
337
|
+
placeholder: t('@astryx.tableFiltering.filterByColumn', {
|
|
338
|
+
header
|
|
339
|
+
}),
|
|
329
340
|
min: operatorValue.minValue ?? null,
|
|
330
341
|
max: operatorValue.maxValue ?? null,
|
|
331
342
|
step: step,
|
|
@@ -334,11 +345,15 @@ function NumberFilterControl({
|
|
|
334
345
|
});
|
|
335
346
|
}
|
|
336
347
|
return /*#__PURE__*/_jsx(NumberInput, {
|
|
337
|
-
label:
|
|
348
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
349
|
+
header
|
|
350
|
+
}),
|
|
338
351
|
isLabelHidden: true,
|
|
339
352
|
value: numValue,
|
|
340
353
|
onChange: handleChange,
|
|
341
|
-
placeholder:
|
|
354
|
+
placeholder: t('@astryx.tableFiltering.filterByColumn', {
|
|
355
|
+
header
|
|
356
|
+
}),
|
|
342
357
|
min: operatorValue.minValue ?? null,
|
|
343
358
|
max: operatorValue.maxValue ?? null,
|
|
344
359
|
step: step,
|
|
@@ -352,6 +367,7 @@ function SelectorFilterControl({
|
|
|
352
367
|
size,
|
|
353
368
|
hasClear
|
|
354
369
|
}) {
|
|
370
|
+
const t = useTranslator();
|
|
355
371
|
const store = useFilterStore();
|
|
356
372
|
const config = store.getConfig();
|
|
357
373
|
const value = config.filters[columnKey];
|
|
@@ -365,23 +381,27 @@ function SelectorFilterControl({
|
|
|
365
381
|
}, [store, columnKey]);
|
|
366
382
|
if (hasClear) {
|
|
367
383
|
return /*#__PURE__*/_jsx(Selector, {
|
|
368
|
-
label:
|
|
384
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
385
|
+
header
|
|
386
|
+
}),
|
|
369
387
|
isLabelHidden: true,
|
|
370
388
|
options: options,
|
|
371
389
|
value: strValue || null,
|
|
372
390
|
onChange: handleChange,
|
|
373
|
-
placeholder:
|
|
391
|
+
placeholder: t('@astryx.table.filter.allPlaceholder'),
|
|
374
392
|
size: size,
|
|
375
393
|
hasClear: true
|
|
376
394
|
});
|
|
377
395
|
}
|
|
378
396
|
return /*#__PURE__*/_jsx(Selector, {
|
|
379
|
-
label:
|
|
397
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
398
|
+
header
|
|
399
|
+
}),
|
|
380
400
|
isLabelHidden: true,
|
|
381
401
|
options: options,
|
|
382
402
|
value: strValue,
|
|
383
403
|
onChange: handleChange,
|
|
384
|
-
placeholder:
|
|
404
|
+
placeholder: t('@astryx.table.filter.allPlaceholder'),
|
|
385
405
|
size: size
|
|
386
406
|
});
|
|
387
407
|
}
|
|
@@ -392,6 +412,7 @@ function MultiSelectorFilterControl({
|
|
|
392
412
|
size,
|
|
393
413
|
hasClear
|
|
394
414
|
}) {
|
|
415
|
+
const t = useTranslator();
|
|
395
416
|
const store = useFilterStore();
|
|
396
417
|
const config = store.getConfig();
|
|
397
418
|
const value = config.filters[columnKey];
|
|
@@ -401,14 +422,16 @@ function MultiSelectorFilterControl({
|
|
|
401
422
|
label: v.label
|
|
402
423
|
}));
|
|
403
424
|
return /*#__PURE__*/_jsx(MultiSelector, {
|
|
404
|
-
label:
|
|
425
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
426
|
+
header
|
|
427
|
+
}),
|
|
405
428
|
isLabelHidden: true,
|
|
406
429
|
options: options,
|
|
407
430
|
value: arrValue,
|
|
408
431
|
onChange: newValue => {
|
|
409
432
|
store.getConfig().onFilterChange(columnKey, newValue.length === 0 ? null : newValue);
|
|
410
433
|
},
|
|
411
|
-
placeholder:
|
|
434
|
+
placeholder: t('@astryx.table.filter.allPlaceholder'),
|
|
412
435
|
size: size,
|
|
413
436
|
hasSelectAll: true,
|
|
414
437
|
hasSearch: false,
|
|
@@ -421,10 +444,13 @@ function DateFilterControl({
|
|
|
421
444
|
size,
|
|
422
445
|
hasClear
|
|
423
446
|
}) {
|
|
447
|
+
const t = useTranslator();
|
|
424
448
|
const store = useFilterStore();
|
|
425
449
|
const value = store.getConfig().filters[columnKey];
|
|
426
450
|
return /*#__PURE__*/_jsx(DateInput, {
|
|
427
|
-
label:
|
|
451
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
452
|
+
header
|
|
453
|
+
}),
|
|
428
454
|
isLabelHidden: true,
|
|
429
455
|
value: value ?? undefined,
|
|
430
456
|
onChange: newValue => {
|
|
@@ -440,10 +466,13 @@ function TimeFilterControl({
|
|
|
440
466
|
size,
|
|
441
467
|
hasClear
|
|
442
468
|
}) {
|
|
469
|
+
const t = useTranslator();
|
|
443
470
|
const store = useFilterStore();
|
|
444
471
|
const value = store.getConfig().filters[columnKey];
|
|
445
472
|
return /*#__PURE__*/_jsx(TimeInput, {
|
|
446
|
-
label:
|
|
473
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
474
|
+
header
|
|
475
|
+
}),
|
|
447
476
|
isLabelHidden: true,
|
|
448
477
|
value: value ?? undefined,
|
|
449
478
|
onChange: newValue => {
|
|
@@ -460,6 +489,7 @@ function StringListFilterControl({
|
|
|
460
489
|
size,
|
|
461
490
|
hasClear
|
|
462
491
|
}) {
|
|
492
|
+
const t = useTranslator();
|
|
463
493
|
const store = useFilterStore();
|
|
464
494
|
const value = store.getConfig().filters[columnKey] ?? [];
|
|
465
495
|
|
|
@@ -474,7 +504,9 @@ function StringListFilterControl({
|
|
|
474
504
|
}), []);
|
|
475
505
|
const searchSource = operatorValue.searchSource ?? fallbackSource;
|
|
476
506
|
return /*#__PURE__*/_jsx(Tokenizer, {
|
|
477
|
-
label:
|
|
507
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
508
|
+
header
|
|
509
|
+
}),
|
|
478
510
|
isLabelHidden: true,
|
|
479
511
|
searchSource: searchSource,
|
|
480
512
|
value: value.map(v => ({
|
|
@@ -572,6 +604,7 @@ function PopoverFilterTrigger({
|
|
|
572
604
|
header,
|
|
573
605
|
operatorValue
|
|
574
606
|
}) {
|
|
607
|
+
const t = useTranslator();
|
|
575
608
|
const store = useFilterStore();
|
|
576
609
|
const config = store.getConfig();
|
|
577
610
|
const value = config.filters[columnKey];
|
|
@@ -616,7 +649,9 @@ function PopoverFilterTrigger({
|
|
|
616
649
|
return /*#__PURE__*/_jsx(Popover, {
|
|
617
650
|
isOpen: isOpen,
|
|
618
651
|
onOpenChange: handleOpen,
|
|
619
|
-
label:
|
|
652
|
+
label: t('@astryx.tableFiltering.filterByColumn', {
|
|
653
|
+
header
|
|
654
|
+
}),
|
|
620
655
|
placement: "below",
|
|
621
656
|
alignment: "start",
|
|
622
657
|
content: /*#__PURE__*/_jsx(FilterStoreContext, {
|
|
@@ -635,7 +670,7 @@ function PopoverFilterTrigger({
|
|
|
635
670
|
className: "x78zum5 x1txdalj xtbrsbv"
|
|
636
671
|
},
|
|
637
672
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
638
|
-
label:
|
|
673
|
+
label: t('@astryx.table.filter.reset'),
|
|
639
674
|
variant: "ghost",
|
|
640
675
|
size: "sm",
|
|
641
676
|
onClick: handleClear
|
|
@@ -644,7 +679,7 @@ function PopoverFilterTrigger({
|
|
|
644
679
|
className: "x98rzlu"
|
|
645
680
|
}
|
|
646
681
|
}), /*#__PURE__*/_jsx(Button, {
|
|
647
|
-
label:
|
|
682
|
+
label: t('@astryx.table.filter.apply'),
|
|
648
683
|
variant: "primary",
|
|
649
684
|
size: "sm",
|
|
650
685
|
onClick: handleApply
|
|
@@ -654,7 +689,9 @@ function PopoverFilterTrigger({
|
|
|
654
689
|
}),
|
|
655
690
|
children: /*#__PURE__*/_jsx("button", {
|
|
656
691
|
type: "button",
|
|
657
|
-
"aria-label":
|
|
692
|
+
"aria-label": t('@astryx.tableFiltering.filterByColumn', {
|
|
693
|
+
header
|
|
694
|
+
}),
|
|
658
695
|
"aria-haspopup": "dialog",
|
|
659
696
|
...{
|
|
660
697
|
0: {
|
|
@@ -52,7 +52,7 @@ export interface UseTableGroupedRowsResult<T extends Record<string, unknown>> {
|
|
|
52
52
|
* pass all three to `<Table>`.
|
|
53
53
|
*
|
|
54
54
|
* @example
|
|
55
|
-
* ```
|
|
55
|
+
* ```
|
|
56
56
|
* const [collapsed, setCollapsed] = useState<Set<string>>(new Set());
|
|
57
57
|
* const grouped = useTableGroupedRows({
|
|
58
58
|
* data: rows,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableGroupedRows.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/groupedRows/useTableGroupedRows.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAuB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ3D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useTableGroupedRows.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/groupedRows/useTableGroupedRows.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAAuB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ3D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAqD7C,qDAAqD;AACrD,MAAM,WAAW,yBAAyB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1E,8BAA8B;IAC9B,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,8EAA8E;IAC9E,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC7B,6CAA6C;IAC7C,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,0DAA0D;IAC1D,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,OAAO,KACf,SAAS,CAAC;IACf,8EAA8E;IAC9E,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAChC,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1E,iDAAiD;IACjD,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvB,0EAA0E;IAC1E,IAAI,EAAE,CAAC,EAAE,CAAC;IACV;;;;OAIG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;CAC5B;AA6DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACnC,yBAAyB,CAAC,CAAC,CAAC,CA+I9B"}
|
|
@@ -16,9 +16,11 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
16
16
|
import "../../../theme/tokens.stylex.js";
|
|
17
17
|
import { spacingVars, colorVars, fontWeightVars } from "../../../theme/tokens.stylex.js";
|
|
18
18
|
import { Icon } from "../../../Icon/index.js";
|
|
19
|
-
import {
|
|
19
|
+
import { useTranslator } from "../../../i18n/index.js";
|
|
20
|
+
|
|
20
21
|
// A synthetic group-header row injected into the flattened data. Real rows
|
|
21
22
|
// never carry this marker.
|
|
23
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
22
24
|
const GROUP_HEADER = Symbol('tableGroupHeader');
|
|
23
25
|
function isGroupHeader(item) {
|
|
24
26
|
return typeof item === 'object' && item !== null && item[GROUP_HEADER] === true;
|
|
@@ -78,7 +80,7 @@ const styles = {
|
|
|
78
80
|
* pass all three to `<Table>`.
|
|
79
81
|
*
|
|
80
82
|
* @example
|
|
81
|
-
* ```
|
|
83
|
+
* ```
|
|
82
84
|
* const [collapsed, setCollapsed] = useState<Set<string>>(new Set());
|
|
83
85
|
* const grouped = useTableGroupedRows({
|
|
84
86
|
* data: rows,
|
|
@@ -101,6 +103,7 @@ const styles = {
|
|
|
101
103
|
* ```
|
|
102
104
|
*/
|
|
103
105
|
export function useTableGroupedRows(config) {
|
|
106
|
+
const t = useTranslator();
|
|
104
107
|
const {
|
|
105
108
|
data,
|
|
106
109
|
groupBy,
|
|
@@ -196,7 +199,7 @@ export function useTableGroupedRows(config) {
|
|
|
196
199
|
onClick: toggle,
|
|
197
200
|
'aria-expanded': !collapsed
|
|
198
201
|
},
|
|
199
|
-
|
|
202
|
+
xstyle: [...props.xstyle, styles.headerRow],
|
|
200
203
|
children:
|
|
201
204
|
/*#__PURE__*/
|
|
202
205
|
// colSpan larger than the column count is clamped by the browser
|
|
@@ -220,7 +223,11 @@ export function useTableGroupedRows(config) {
|
|
|
220
223
|
e.stopPropagation();
|
|
221
224
|
toggle();
|
|
222
225
|
},
|
|
223
|
-
"aria-label": collapsed ?
|
|
226
|
+
"aria-label": collapsed ? t('@astryx.tableGroupedRows.expandGroup', {
|
|
227
|
+
groupKey: header.groupKey
|
|
228
|
+
}) : t('@astryx.tableGroupedRows.collapseGroup', {
|
|
229
|
+
groupKey: header.groupKey
|
|
230
|
+
}),
|
|
224
231
|
"aria-expanded": !collapsed,
|
|
225
232
|
children: /*#__PURE__*/_jsx("span", {
|
|
226
233
|
...{
|
|
@@ -241,7 +248,7 @@ export function useTableGroupedRows(config) {
|
|
|
241
248
|
})
|
|
242
249
|
};
|
|
243
250
|
}
|
|
244
|
-
}), [collapsedGroups, onToggleGroup, renderGroupHeader]);
|
|
251
|
+
}), [collapsedGroups, onToggleGroup, renderGroupHeader, t]);
|
|
245
252
|
return {
|
|
246
253
|
plugin,
|
|
247
254
|
data: flattened,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTablePagination.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/pagination/useTablePagination.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"useTablePagination.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/pagination/useTablePagination.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,aAAa,CAAC;AAgC7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,wBAAwB;IAGvC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IAEb,sEAAsE;IACtE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAIrC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAIlB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAI3B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IAE1D;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAEnB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAE/C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAInC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAClE,MAAM,EAAE,wBAAwB,GAC/B,WAAW,CAAC,CAAC,CAAC,CAmGhB"}
|
|
@@ -20,11 +20,12 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
20
20
|
import "../../../theme/tokens.stylex.js";
|
|
21
21
|
import { spacingVars } from "../../../theme/tokens.stylex.js";
|
|
22
22
|
import { Pagination } from "../../../Pagination/index.js";
|
|
23
|
-
import {
|
|
23
|
+
import { useTranslator } from "../../../i18n/index.js";
|
|
24
|
+
|
|
24
25
|
// =============================================================================
|
|
25
26
|
// Styles
|
|
26
27
|
// =============================================================================
|
|
27
|
-
|
|
28
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
29
|
const styles = {
|
|
29
30
|
wrapper: {
|
|
30
31
|
k1xSpc: "x78zum5",
|
|
@@ -98,6 +99,7 @@ const styles = {
|
|
|
98
99
|
* ```
|
|
99
100
|
*/
|
|
100
101
|
export function useTablePagination(config) {
|
|
102
|
+
const t = useTranslator();
|
|
101
103
|
const {
|
|
102
104
|
page,
|
|
103
105
|
onPageChange,
|
|
@@ -111,8 +113,9 @@ export function useTablePagination(config) {
|
|
|
111
113
|
size = 'md',
|
|
112
114
|
position = 'below',
|
|
113
115
|
align = 'center',
|
|
114
|
-
label
|
|
116
|
+
label: labelFromProps
|
|
115
117
|
} = config;
|
|
118
|
+
const label = labelFromProps ?? t('@astryx.table.pagination.label');
|
|
116
119
|
|
|
117
120
|
// Same guard as Pagination itself: 0/NaN/negative pageSize would produce an
|
|
118
121
|
// Infinity/NaN totalPages here, which bypasses Pagination's own coercion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableRowExpansion.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/rowExpansion/useTableRowExpansion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTableRowExpansion.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/rowExpansion/useTableRowExpansion.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,aAAa,CAAC;AAMrB;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3E,0CAA0C;IAC1C,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kDAAkD;IAClD,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC/B,sEAAsE;IACtE,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC/B,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC3C;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IAC1C,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC/C;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,+BAA+B,CAC9C,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEjC,mCAAmC;IACnC,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,qEAAqE;IACrE,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAC9B,kDAAkD;IAClD,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAC/B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC3C,qDAAqD;IACrD,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,+CAA+C;IAC/C,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,+BAA+B,CAC9C,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAEjC,qEAAqE;IACrE,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,4DAA4D;IAC5D,eAAe,EAAE,0BAA0B,CAAC,CAAC,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAC3E,QAAQ,EACR,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,eAAe,GAChB,EAAE,+BAA+B,CAAC,CAAC,CAAC,GAAG,+BAA+B,CAAC,CAAC,CAAC,CAyHzE;AAuGD,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,GACpC,WAAW,CAAC,CAAC,CAAC,CAwOhB"}
|
|
@@ -17,6 +17,7 @@ import "../../../theme/tokens.stylex.js";
|
|
|
17
17
|
import { spacingVars, colorVars, radiusVars } from "../../../theme/tokens.stylex.js";
|
|
18
18
|
import { Icon } from "../../../Icon/index.js";
|
|
19
19
|
import { resolveContextActions } from "../../tableContextMenu.js";
|
|
20
|
+
import { useTranslator } from "../../../i18n/index.js";
|
|
20
21
|
|
|
21
22
|
// =============================================================================
|
|
22
23
|
// Config
|
|
@@ -229,6 +230,7 @@ function ExpansionChevron({
|
|
|
229
230
|
// =============================================================================
|
|
230
231
|
|
|
231
232
|
export function useTableRowExpansion(config) {
|
|
233
|
+
const t = useTranslator();
|
|
232
234
|
const {
|
|
233
235
|
expandedKeys,
|
|
234
236
|
onToggle,
|
|
@@ -264,10 +266,10 @@ export function useTableRowExpansion(config) {
|
|
|
264
266
|
return /*#__PURE__*/_jsx(ExpansionChevron, {
|
|
265
267
|
isExpanded: isExpanded,
|
|
266
268
|
onToggle: () => onToggle(key),
|
|
267
|
-
ariaLabel: isExpanded ? '
|
|
269
|
+
ariaLabel: isExpanded ? t('@astryx.tableRowExpansion.collapseRow') : t('@astryx.tableRowExpansion.expandRow')
|
|
268
270
|
});
|
|
269
271
|
}
|
|
270
|
-
}), [expandedKeys, onToggle, getRowKey, getChildren, getIsItemExpandable, getDepth]);
|
|
272
|
+
}), [expandedKeys, onToggle, getRowKey, getChildren, getIsItemExpandable, getDepth, t]);
|
|
271
273
|
return useMemo(() => ({
|
|
272
274
|
transformColumns(columns) {
|
|
273
275
|
// Track the first user column for indentation.
|
|
@@ -298,7 +300,7 @@ export function useTableRowExpansion(config) {
|
|
|
298
300
|
const chevron = expandable ? /*#__PURE__*/_jsx(ExpansionChevron, {
|
|
299
301
|
isExpanded: isExpanded,
|
|
300
302
|
onToggle: () => onToggle(key),
|
|
301
|
-
ariaLabel: isExpanded ? '
|
|
303
|
+
ariaLabel: isExpanded ? t('@astryx.tableRowExpansion.collapseRow') : t('@astryx.tableRowExpansion.expandRow')
|
|
302
304
|
}) : /*#__PURE__*/_jsx("span", {
|
|
303
305
|
...{
|
|
304
306
|
className: "x1rg5ohu xvy4d1p xxk0z11 x2lah0s"
|
|
@@ -329,7 +331,7 @@ export function useTableRowExpansion(config) {
|
|
|
329
331
|
className: "x3nfvp2 x6s0dn4 xl56j7k xvy4d1p xxk0z11 xx3sua9 x1ypdohk xv9yike xefglzl xx6bhzk x1717udv x2lah0s x1ilzqfv x1cqbx0l"
|
|
330
332
|
},
|
|
331
333
|
onClick: () => onToggleExpandAll(!allExpanded),
|
|
332
|
-
"aria-label": allExpanded ? '
|
|
334
|
+
"aria-label": allExpanded ? t('@astryx.tableRowExpansion.collapseAllRows') : t('@astryx.tableRowExpansion.expandAllRows'),
|
|
333
335
|
children: /*#__PURE__*/_jsx("span", {
|
|
334
336
|
...{
|
|
335
337
|
0: {
|
|
@@ -391,8 +393,8 @@ export function useTableRowExpansion(config) {
|
|
|
391
393
|
...props.htmlProps,
|
|
392
394
|
onClick: () => onToggle(key)
|
|
393
395
|
},
|
|
394
|
-
|
|
396
|
+
xstyle: [...props.xstyle, expansionStyles.clickableRow]
|
|
395
397
|
};
|
|
396
398
|
}
|
|
397
|
-
}), [expandedKeys, getRowKey, onToggle, getChildren, getDepth, getIsItemExpandable, hasRowClickExpansion, isAllExpanded, onToggleExpandAll, expansionColumn]);
|
|
399
|
+
}), [expandedKeys, getRowKey, onToggle, getChildren, getDepth, getIsItemExpandable, hasRowClickExpansion, isAllExpanded, onToggleExpandAll, expansionColumn, t]);
|
|
398
400
|
}
|
|
@@ -41,7 +41,7 @@ export interface UseTableRowIndexConfig<T extends Record<string, unknown>> {
|
|
|
41
41
|
* so it reflects the current sort / filter / pagination view.
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
|
-
* ```
|
|
44
|
+
* ```
|
|
45
45
|
* const rowIndex = useTableRowIndex({data});
|
|
46
46
|
* <Table data={data} columns={columns} idKey="id" plugins={{rowIndex}} />;
|
|
47
47
|
* ```
|
|
@@ -37,7 +37,7 @@ const INDEX_COLUMN_WIDTH = {
|
|
|
37
37
|
* so it reflects the current sort / filter / pagination view.
|
|
38
38
|
*
|
|
39
39
|
* @example
|
|
40
|
-
* ```
|
|
40
|
+
* ```
|
|
41
41
|
* const rowIndex = useTableRowIndex({data});
|
|
42
42
|
* <Table data={data} columns={columns} idKey="id" plugins={{rowIndex}} />;
|
|
43
43
|
* ```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableSelection.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/selection/useTableSelection.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"useTableSelection.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/selection/useTableSelection.tsx"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAC,WAAW,EAAkC,MAAM,aAAa,CAAC;AAQ9E,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxE,uCAAuC;IACvC,iBAAiB,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IACxC,6EAA6E;IAC7E,YAAY,EAAE,CAAC,KAAK,EAAE;QAAC,IAAI,EAAE,CAAC,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAC;IAC9D,kDAAkD;IAClD,WAAW,EAAE,CAAC,KAAK,EAAE;QAAC,aAAa,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAC;IACvD,mDAAmD;IACnD,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC;IACnC,+FAA+F;IAC/F,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;IAC3C,oGAAoG;IACpG,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC;CACzC;AAkND,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,GACjC,WAAW,CAAC,CAAC,CAAC,CAmFhB"}
|
|
@@ -36,6 +36,7 @@ import { colorVars } from "../../../theme/tokens.stylex.js";
|
|
|
36
36
|
import { CheckboxInput } from "../../../CheckboxInput/index.js";
|
|
37
37
|
import { mergeRefs } from "../../../utils/index.js";
|
|
38
38
|
import { pixel } from "../../columnUtils.js";
|
|
39
|
+
import { useTranslator } from "../../../i18n/index.js";
|
|
39
40
|
|
|
40
41
|
// =============================================================================
|
|
41
42
|
// Config Type
|
|
@@ -130,6 +131,7 @@ const SELECT_ALL = 2;
|
|
|
130
131
|
function SelectAllCheckboxInner({
|
|
131
132
|
store
|
|
132
133
|
}) {
|
|
134
|
+
const t = useTranslator();
|
|
133
135
|
const getSnapshot = useCallback(() => {
|
|
134
136
|
const config = store.getConfig();
|
|
135
137
|
const allSelected = config.getIsAllSelected();
|
|
@@ -143,7 +145,7 @@ function SelectAllCheckboxInner({
|
|
|
143
145
|
const allSelected = state === SELECT_ALL;
|
|
144
146
|
const indeterminate = state === SELECT_INDETERMINATE;
|
|
145
147
|
return /*#__PURE__*/_jsx(CheckboxInput, {
|
|
146
|
-
label:
|
|
148
|
+
label: t('@astryx.table.selection.selectAllRows'),
|
|
147
149
|
isLabelHidden: true,
|
|
148
150
|
value: allSelected ? true : indeterminate ? 'indeterminate' : false,
|
|
149
151
|
onChange: () => store.getConfig().onSelectAll({
|
|
@@ -173,6 +175,7 @@ function SelectionCellContentInner({
|
|
|
173
175
|
store,
|
|
174
176
|
item
|
|
175
177
|
}) {
|
|
178
|
+
const t = useTranslator();
|
|
176
179
|
const config = store.getConfig();
|
|
177
180
|
const isSelected = useIsItemSelected(store, item);
|
|
178
181
|
const selectable = config.getIsItemSelectable?.(item) ?? true;
|
|
@@ -181,7 +184,7 @@ function SelectionCellContentInner({
|
|
|
181
184
|
return null;
|
|
182
185
|
}
|
|
183
186
|
return /*#__PURE__*/_jsx(CheckboxInput, {
|
|
184
|
-
label:
|
|
187
|
+
label: t('@astryx.table.selection.selectRow'),
|
|
185
188
|
isLabelHidden: true,
|
|
186
189
|
value: isSelected,
|
|
187
190
|
onChange: () => store.getConfig().onSelectItem({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTableSortable.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/sortable/useTableSortable.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTableSortable.d.ts","sourceRoot":"","sources":["../../../../src/Table/plugins/sortable/useTableSortable.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,WAAW,EAIZ,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,YAAY,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IAC9D,2EAA2E;IAC3E,OAAO,EAAE,QAAQ,CAAC;IAClB,0BAA0B;IAC1B,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IACzD,cAAc,CAAC,QAAQ,CAAC,EAAE,CAAC;AAM7B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,sBAAsB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IACtE,iEAAiE;IACjE,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IAE/B;;;OAGG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAEvD;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAmND;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CA2F1D"}
|
|
@@ -18,6 +18,7 @@ import "../../../theme/tokens.stylex.js";
|
|
|
18
18
|
import { colorVars, spacingVars, radiusVars } from "../../../theme/tokens.stylex.js";
|
|
19
19
|
import { Icon } from "../../../Icon/index.js";
|
|
20
20
|
import { resolveContextActions } from "../../tableContextMenu.js";
|
|
21
|
+
import { useTranslator } from "../../../i18n/index.js";
|
|
21
22
|
|
|
22
23
|
// =============================================================================
|
|
23
24
|
// Sort Types
|
|
@@ -236,6 +237,7 @@ function SortHeaderButton({
|
|
|
236
237
|
* ```
|
|
237
238
|
*/
|
|
238
239
|
export function useTableSortable(config) {
|
|
240
|
+
const t = useTranslator();
|
|
239
241
|
const configRef = useRef(config);
|
|
240
242
|
configRef.current = config;
|
|
241
243
|
return useMemo(() => ({
|
|
@@ -257,7 +259,7 @@ export function useTableSortable(config) {
|
|
|
257
259
|
const actions = [{
|
|
258
260
|
id: 'sort-asc',
|
|
259
261
|
group: 'sort',
|
|
260
|
-
label: '
|
|
262
|
+
label: t('@astryx.table.sort.ascending'),
|
|
261
263
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
262
264
|
icon: "arrowUp",
|
|
263
265
|
size: "xsm",
|
|
@@ -271,7 +273,7 @@ export function useTableSortable(config) {
|
|
|
271
273
|
}, {
|
|
272
274
|
id: 'sort-desc',
|
|
273
275
|
group: 'sort',
|
|
274
|
-
label: '
|
|
276
|
+
label: t('@astryx.table.sort.descending'),
|
|
275
277
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
276
278
|
icon: "arrowDown",
|
|
277
279
|
size: "xsm",
|
|
@@ -287,7 +289,7 @@ export function useTableSortable(config) {
|
|
|
287
289
|
actions.push({
|
|
288
290
|
id: 'sort-clear',
|
|
289
291
|
group: 'sort-clear',
|
|
290
|
-
label: '
|
|
292
|
+
label: t('@astryx.table.sort.clear'),
|
|
291
293
|
icon: /*#__PURE__*/_jsx(Icon, {
|
|
292
294
|
icon: "close",
|
|
293
295
|
size: "xsm",
|
|
@@ -318,5 +320,5 @@ export function useTableSortable(config) {
|
|
|
318
320
|
contextMenuActions: () => [...resolveContextActions(priorActions), ...getSortActions()]
|
|
319
321
|
};
|
|
320
322
|
}
|
|
321
|
-
}), []);
|
|
323
|
+
}), [t]);
|
|
322
324
|
}
|
|
@@ -307,7 +307,7 @@ export function useTableStickyColumns(config) {
|
|
|
307
307
|
...offsetStyle
|
|
308
308
|
}
|
|
309
309
|
},
|
|
310
|
-
|
|
310
|
+
xstyle: [...props.xstyle, stickyStyles.cell, stickyStyles.headerCell, side.edge === 'start' ? shadowStyles.start : shadowStyles.end]
|
|
311
311
|
};
|
|
312
312
|
},
|
|
313
313
|
transformBodyCell(props, column) {
|
|
@@ -333,7 +333,7 @@ export function useTableStickyColumns(config) {
|
|
|
333
333
|
...offsetStyle
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
|
-
|
|
336
|
+
xstyle: [...props.xstyle, stickyStyles.cell, stickyStyles.bodyCell, side.edge === 'start' ? shadowStyles.start : shadowStyles.end]
|
|
337
337
|
};
|
|
338
338
|
},
|
|
339
339
|
transformScrollWrapper(props) {
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -181,12 +181,12 @@ export interface TableColumn<T extends Record<string, unknown>> {
|
|
|
181
181
|
/** Props passed through the plugin pipeline for the `<table>` element */
|
|
182
182
|
export interface TableRenderProps {
|
|
183
183
|
htmlProps: HTMLAttributes<HTMLTableElement>;
|
|
184
|
-
|
|
184
|
+
xstyle: StyleXStyles[];
|
|
185
185
|
}
|
|
186
186
|
/** Props passed through the plugin pipeline for the header `<tr>` */
|
|
187
187
|
export interface HeaderRowRenderProps {
|
|
188
188
|
htmlProps: HTMLAttributes<HTMLTableRowElement>;
|
|
189
|
-
|
|
189
|
+
xstyle: StyleXStyles[];
|
|
190
190
|
children: ReactNode;
|
|
191
191
|
}
|
|
192
192
|
/**
|
|
@@ -206,7 +206,7 @@ export interface HeaderRowRenderProps {
|
|
|
206
206
|
*/
|
|
207
207
|
export interface HeaderCellRenderProps {
|
|
208
208
|
htmlProps: ThHTMLAttributes<HTMLTableCellElement>;
|
|
209
|
-
|
|
209
|
+
xstyle: StyleXStyles[];
|
|
210
210
|
/** Content rendered before the header label. */
|
|
211
211
|
before?: ReactNode;
|
|
212
212
|
/** The header label content. Initialized from `column.header ?? column.key`. Plugins may wrap or replace. */
|
|
@@ -241,7 +241,7 @@ export interface HeaderCellRenderProps {
|
|
|
241
241
|
/** Props passed through the plugin pipeline for each body `<tr>` */
|
|
242
242
|
export interface BodyRowRenderProps {
|
|
243
243
|
htmlProps: HTMLAttributes<HTMLTableRowElement>;
|
|
244
|
-
|
|
244
|
+
xstyle: StyleXStyles[];
|
|
245
245
|
children: ReactNode;
|
|
246
246
|
/** Ref for the `<tr>` element. Plugins can set this to access the row DOM node. */
|
|
247
247
|
ref?: Ref<HTMLTableRowElement>;
|
|
@@ -249,7 +249,7 @@ export interface BodyRowRenderProps {
|
|
|
249
249
|
/** Props passed through the plugin pipeline for each body `<td>` */
|
|
250
250
|
export interface BodyCellRenderProps {
|
|
251
251
|
htmlProps: TdHTMLAttributes<HTMLTableCellElement>;
|
|
252
|
-
|
|
252
|
+
xstyle: StyleXStyles[];
|
|
253
253
|
/**
|
|
254
254
|
* Right-click context-menu actions for this body cell. Plugins append their
|
|
255
255
|
* actions in `transformBodyCell`; BaseTable concatenates the arrays across
|
|
@@ -294,7 +294,7 @@ export interface ScrollWrapperRenderProps {
|
|
|
294
294
|
htmlProps: HTMLAttributes<HTMLDivElement> & {
|
|
295
295
|
ref?: Ref<HTMLDivElement>;
|
|
296
296
|
};
|
|
297
|
-
|
|
297
|
+
xstyle: StyleXStyles[];
|
|
298
298
|
/** Content rendered before the `<table>`, inside the scroll container. */
|
|
299
299
|
beforeTable?: ReactNode;
|
|
300
300
|
/** Content rendered after the `<table>`, inside the scroll container. */
|
|
@@ -449,7 +449,14 @@ export interface BaseTableProps<T extends Record<string, unknown>> extends BaseP
|
|
|
449
449
|
plugins?: TablePlugin<T>[];
|
|
450
450
|
/** Children mode — render `<tr>`/`<td>` directly instead of data-driven */
|
|
451
451
|
children?: ReactNode;
|
|
452
|
-
/**
|
|
452
|
+
/**
|
|
453
|
+
* Additional HTML attributes for the `<table>` element.
|
|
454
|
+
*
|
|
455
|
+
* @deprecated Pass `className`, `style`, `xstyle`, and other HTML
|
|
456
|
+
* attributes directly on the component instead — they now reach the root
|
|
457
|
+
* `<table>` and win over `tableProps` on conflicts. Migrate with
|
|
458
|
+
* `npx astryx upgrade --codemod migrate-table-tableprops-to-direct-props`.
|
|
459
|
+
*/
|
|
453
460
|
tableProps?: HTMLAttributes<HTMLTableElement>;
|
|
454
461
|
/**
|
|
455
462
|
* Optional wrapper rendered around the `<table>` element, inside the
|
|
@@ -457,9 +464,9 @@ export interface BaseTableProps<T extends Record<string, unknown>> extends BaseP
|
|
|
457
464
|
* horizontal scroll container so plugin chrome (pagination, toolbars)
|
|
458
465
|
* stays outside the scrollable area.
|
|
459
466
|
*
|
|
460
|
-
* Receives `htmlProps` (including an optional `ref`) and `
|
|
467
|
+
* Receives `htmlProps` (including an optional `ref`) and `xstyle` produced
|
|
461
468
|
* by the plugin `transformScrollWrapper` pipeline, plus `beforeTable`/`afterTable`
|
|
462
|
-
* chrome. The wrapper must spread `htmlProps` (and apply `
|
|
469
|
+
* chrome. The wrapper must spread `htmlProps` (and apply `xstyle`) onto its
|
|
463
470
|
* scroll-container element so plugins can attach refs / scroll listeners.
|
|
464
471
|
*/
|
|
465
472
|
scrollWrapper?: ComponentType<{
|
|
@@ -467,7 +474,7 @@ export interface BaseTableProps<T extends Record<string, unknown>> extends BaseP
|
|
|
467
474
|
htmlProps?: HTMLAttributes<HTMLDivElement> & {
|
|
468
475
|
ref?: Ref<HTMLDivElement>;
|
|
469
476
|
};
|
|
470
|
-
|
|
477
|
+
xstyle?: StyleXStyles[];
|
|
471
478
|
beforeTable?: ReactNode;
|
|
472
479
|
afterTable?: ReactNode;
|
|
473
480
|
}>;
|