@astryxdesign/core 0.1.6-canary.1b61ba6 → 0.1.6-canary.1d64659
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/README.md +0 -2
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +1 -4
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +1 -3
- package/dist/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +1 -4
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +6 -8
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -4
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -34
- package/dist/ButtonGroup/ButtonGroup.d.ts +5 -20
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +11 -27
- package/dist/Calendar/Calendar.d.ts.map +1 -1
- package/dist/Calendar/Calendar.js +5 -8
- package/dist/Carousel/Carousel.d.ts +1 -1
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +5 -8
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +1 -4
- package/dist/Chat/ChatComposerDrawer.d.ts +1 -1
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +2 -9
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +2 -6
- package/dist/Chat/ChatLayout.d.ts +11 -1
- package/dist/Chat/ChatLayout.d.ts.map +1 -1
- package/dist/Chat/ChatLayout.js +4 -6
- package/dist/Chat/ChatLayoutScrollButton.d.ts.map +1 -1
- package/dist/Chat/ChatLayoutScrollButton.js +2 -4
- package/dist/Chat/ChatMessage.d.ts +1 -1
- package/dist/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/Chat/ChatMessage.js +2 -8
- package/dist/Chat/ChatMessageBubble.d.ts +1 -1
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +1 -3
- package/dist/Chat/ChatMessageList.d.ts +1 -1
- package/dist/Chat/ChatMessageList.d.ts.map +1 -1
- package/dist/Chat/ChatMessageList.js +1 -3
- package/dist/Chat/ChatMessageMetadata.d.ts.map +1 -1
- package/dist/Chat/ChatMessageMetadata.js +8 -13
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +1 -3
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +1 -3
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.d.ts +1 -12
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +6 -43
- package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
- package/dist/Chat/useSpeechRecognition.js +2 -4
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +2 -4
- package/dist/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/CheckboxList/CheckboxList.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxList.js +1 -3
- package/dist/CheckboxList/CheckboxListItem.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListItem.js +1 -3
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +2 -10
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +2 -4
- package/dist/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +3 -8
- package/dist/CommandPalette/CommandPaletteInput.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +1 -4
- package/dist/CommandPalette/CommandPaletteList.d.ts +1 -1
- package/dist/CommandPalette/CommandPaletteList.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteList.js +1 -4
- package/dist/ContextMenu/ContextMenu.d.ts +1 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +1 -4
- package/dist/DateInput/DateInput.d.ts +1 -1
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +5 -10
- package/dist/DateRangeInput/DateRangeInput.d.ts +1 -1
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +6 -11
- package/dist/DateTimeInput/DateTimeInput.d.ts +1 -1
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +7 -15
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +12 -15
- package/dist/Dialog/DialogHeader.d.ts +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +3 -7
- package/dist/DropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +5 -11
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +1 -11
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +4 -6
- package/dist/Link/Link.d.ts +1 -1
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +1 -4
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +8 -10
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +2 -4
- package/dist/MobileNav/MobileNavToggle.d.ts +1 -1
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +1 -4
- package/dist/MoreMenu/MoreMenu.d.ts +1 -1
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +1 -4
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +6 -13
- package/dist/NavItem/index.d.ts +9 -0
- package/dist/NavItem/index.d.ts.map +1 -0
- package/dist/NavItem/index.js +10 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +1 -5
- package/dist/Outline/Outline.d.ts +1 -1
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +1 -4
- package/dist/Pagination/Pagination.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +11 -38
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +1 -4
- package/dist/PowerSearch/PowerSearch.d.ts +1 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +12 -22
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +20 -26
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +3 -7
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +21 -34
- package/dist/PowerSearch/formatFilterValue.d.ts +1 -2
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +9 -19
- package/dist/PowerSearch/index.d.ts +1 -2
- package/dist/PowerSearch/index.d.ts.map +1 -1
- package/dist/PowerSearch/index.js +0 -1
- package/dist/PowerSearch/types.d.ts +2 -28
- 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 +8 -15
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +1 -4
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +5 -11
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +2 -4
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseButton.js +1 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +3 -5
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +1 -7
- package/dist/TabList/TabList.d.ts +1 -1
- package/dist/TabList/TabList.d.ts.map +1 -1
- package/dist/TabList/TabList.js +1 -4
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +16 -29
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -5
- 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 +19 -56
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
- package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +4 -11
- package/dist/Table/plugins/pagination/useTablePagination.d.ts.map +1 -1
- package/dist/Table/plugins/pagination/useTablePagination.js +3 -6
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +6 -8
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +2 -5
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +4 -6
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +2 -2
- package/dist/Table/types.d.ts +10 -17
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +1 -5
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +2 -8
- package/dist/TimeInput/TimeInput.d.ts +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +2 -7
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +1 -3
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +1 -3
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +2 -8
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +1 -3
- package/dist/TopNav/TopNav.d.ts +1 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +1 -4
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +3 -5
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +1 -5
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +1 -7
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +4 -8
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +1 -3
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +0 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.js +0 -1
- package/dist/astryx.css +1 -3
- package/dist/astryx.umd.js +60 -62
- package/dist/astryx.umd.js.map +4 -4
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/package.json +2 -23
- package/src/AlertDialog/AlertDialog.tsx +1 -4
- package/src/AppShell/AppShell.doc.mjs +2 -8
- package/src/AppShell/AppShell.tsx +1 -3
- package/src/AvatarGroup/AvatarGroup.tsx +1 -4
- package/src/Banner/Banner.tsx +5 -10
- package/src/Breadcrumbs/Breadcrumbs.tsx +1 -4
- package/src/Button/Button.tsx +4 -34
- package/src/ButtonGroup/ButtonGroup.test.tsx +2 -386
- package/src/ButtonGroup/ButtonGroup.tsx +11 -27
- package/src/Calendar/Calendar.tsx +5 -8
- package/src/Card/Card.doc.mjs +3 -3
- package/src/Carousel/Carousel.tsx +7 -10
- package/src/Chat/ChatComposer.tsx +1 -5
- package/src/Chat/ChatComposerDrawer.tsx +2 -9
- package/src/Chat/ChatComposerInput.tsx +4 -10
- package/src/Chat/ChatLayout.test.tsx +2 -127
- package/src/Chat/ChatLayout.tsx +12 -5
- package/src/Chat/ChatLayoutScrollButton.tsx +2 -4
- package/src/Chat/ChatMessage.tsx +1 -5
- package/src/Chat/ChatMessageBubble.tsx +0 -2
- package/src/Chat/ChatMessageList.doc.mjs +1 -1
- package/src/Chat/ChatMessageList.tsx +0 -2
- package/src/Chat/ChatMessageMetadata.tsx +9 -15
- package/src/Chat/ChatPastedTextToken.tsx +1 -3
- package/src/Chat/ChatSendButton.tsx +1 -3
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/Chat/index.ts +0 -1
- package/src/Chat/useChatStreamScroll.ts +11 -67
- package/src/Chat/useSpeechRecognition.ts +2 -11
- package/src/Chat/useTriggerMenu.tsx +2 -4
- package/src/CheckboxList/CheckboxList.doc.mjs +1 -1
- package/src/CheckboxList/CheckboxList.tsx +0 -2
- package/src/CheckboxList/CheckboxListItem.tsx +1 -7
- package/src/Citation/Citation.tsx +2 -4
- package/src/ClickableCard/ClickableCard.doc.mjs +1 -1
- package/src/CodeBlock/CodeBlock.tsx +2 -4
- package/src/CommandPalette/CommandPalette.tsx +3 -10
- package/src/CommandPalette/CommandPaletteInput.test.tsx +1 -1
- package/src/CommandPalette/CommandPaletteInput.tsx +1 -5
- package/src/CommandPalette/CommandPaletteList.tsx +1 -4
- package/src/ContextMenu/ContextMenu.tsx +1 -4
- package/src/DateInput/DateInput.doc.mjs +2 -2
- package/src/DateInput/DateInput.tsx +5 -13
- package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
- package/src/DateRangeInput/DateRangeInput.tsx +6 -14
- package/src/DateTimeInput/DateTimeInput.doc.mjs +2 -2
- package/src/DateTimeInput/DateTimeInput.tsx +7 -17
- package/src/Dialog/Dialog.tsx +15 -11
- package/src/Dialog/DialogHeader.tsx +3 -7
- package/src/DropdownMenu/DropdownMenu.tsx +8 -12
- package/src/Field/Field.doc.mjs +2 -2
- package/src/FileInput/FileInput.test.tsx +1 -40
- package/src/FileInput/FileInput.tsx +1 -12
- package/src/Grid/Grid.doc.mjs +5 -5
- package/src/InputGroup/InputGroup.doc.mjs +1 -1
- package/src/Lightbox/Lightbox.doc.mjs +2 -7
- package/src/Lightbox/Lightbox.tsx +4 -6
- package/src/Link/Link.tsx +1 -4
- package/src/Markdown/Markdown.tsx +4 -12
- package/src/MobileNav/MobileNav.tsx +2 -4
- package/src/MobileNav/MobileNavToggle.tsx +3 -5
- package/src/MoreMenu/MoreMenu.tsx +1 -4
- package/src/MultiSelector/MultiSelector.tsx +5 -14
- package/src/NavItem/index.ts +11 -0
- package/src/NumberInput/NumberInput.tsx +1 -3
- package/src/Outline/Outline.tsx +1 -4
- package/src/OverflowList/OverflowList.doc.mjs +2 -2
- package/src/Pagination/Pagination.tsx +12 -35
- package/src/Popover/usePopover.tsx +1 -6
- package/src/PowerSearch/PowerSearch.doc.mjs +4 -4
- package/src/PowerSearch/PowerSearch.tsx +10 -22
- package/src/PowerSearch/PowerSearchEditPopover.tsx +20 -27
- package/src/PowerSearch/PowerSearchToken.tsx +6 -17
- package/src/PowerSearch/PowerSearchValueEditor.tsx +21 -34
- package/src/PowerSearch/formatFilterValue.ts +8 -21
- package/src/PowerSearch/index.ts +0 -5
- package/src/PowerSearch/types.ts +9 -33
- package/src/PowerSearch/usePowerSearchConfig.ts +27 -59
- package/src/PowerSearch/usePowerSearchSource.ts +8 -17
- package/src/RadioList/RadioList.doc.mjs +1 -1
- package/src/Resizable/ResizeHandle.tsx +1 -4
- package/src/Section/Section.doc.mjs +4 -4
- package/src/SelectableCard/SelectableCard.doc.mjs +1 -1
- package/src/Selector/Selector.tsx +6 -11
- package/src/SideNav/SideNav.tsx +2 -4
- package/src/SideNav/SideNavCollapseButton.tsx +1 -3
- package/src/SideNav/SideNavHeading.tsx +3 -5
- package/src/SideNav/SideNavItem.tsx +1 -3
- 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/TabList/TabList.tsx +1 -4
- package/src/Table/BaseTable.tsx +19 -36
- package/src/Table/Table.test.tsx +1 -132
- package/src/Table/Table.tsx +4 -6
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +1 -1
- package/src/Table/plugins/filtering/useTableFiltering.tsx +30 -31
- package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +4 -6
- package/src/Table/plugins/pagination/useTablePagination.tsx +1 -4
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +8 -9
- package/src/Table/plugins/selection/useTableSelection.tsx +7 -6
- package/src/Table/plugins/sortable/useTableSortable.tsx +5 -8
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +4 -4
- package/src/Table/types.ts +12 -18
- package/src/Table/useTableFiltering.doc.mjs +2 -2
- package/src/Table/useTableSortable.doc.mjs +11 -11
- package/src/Text/Text.doc.mjs +2 -2
- package/src/TextInput/TextInput.tsx +1 -3
- package/src/Thumbnail/Thumbnail.tsx +2 -4
- package/src/TimeInput/TimeInput.doc.mjs +2 -2
- package/src/TimeInput/TimeInput.tsx +2 -6
- package/src/Timestamp/Timestamp.doc.mjs +4 -4
- package/src/Toast/Toast.tsx +1 -3
- package/src/Toast/ToastViewport.tsx +1 -3
- package/src/Token/Token.tsx +2 -4
- 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.tsx +1 -4
- package/src/TopNav/TopNavHeading.tsx +3 -5
- package/src/TreeList/TreeList.tsx +1 -5
- package/src/TreeList/TreeListItem.tsx +1 -6
- package/src/Typeahead/BaseTypeahead.tsx +4 -11
- package/src/Typeahead/Typeahead.doc.mjs +1 -1
- package/src/Typeahead/Typeahead.tsx +1 -3
- package/src/VisuallyHidden/VisuallyHidden.tsx +0 -1
- package/src/index.ts +0 -3
- package/dist/PowerSearch/resolveOperatorLabel.d.ts +0 -23
- package/dist/PowerSearch/resolveOperatorLabel.d.ts.map +0 -1
- package/dist/PowerSearch/resolveOperatorLabel.js +0 -28
- package/dist/authoring/doc.d.ts +0 -145
- package/dist/authoring/doc.d.ts.map +0 -1
- package/dist/authoring/doc.js +0 -100
- package/dist/authoring/index.d.ts +0 -29
- package/dist/authoring/index.d.ts.map +0 -1
- package/dist/authoring/index.js +0 -28
- package/dist/authoring/integration.d.ts +0 -35
- package/dist/authoring/integration.d.ts.map +0 -1
- package/dist/authoring/integration.js +0 -30
- package/dist/authoring/template.d.ts +0 -66
- package/dist/authoring/template.d.ts.map +0 -1
- package/dist/authoring/template.js +0 -55
- package/dist/config.d.ts +0 -80
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -40
- package/dist/i18n/InternationalizationContext.d.ts +0 -12
- package/dist/i18n/InternationalizationContext.d.ts.map +0 -1
- package/dist/i18n/InternationalizationContext.js +0 -29
- package/dist/i18n/InternationalizationProvider.d.ts +0 -62
- package/dist/i18n/InternationalizationProvider.d.ts.map +0 -1
- package/dist/i18n/InternationalizationProvider.js +0 -44
- package/dist/i18n/index.d.ts +0 -24
- package/dist/i18n/index.d.ts.map +0 -1
- package/dist/i18n/index.js +0 -21
- package/dist/i18n/resolve.d.ts +0 -22
- package/dist/i18n/resolve.d.ts.map +0 -1
- package/dist/i18n/resolve.js +0 -141
- package/dist/i18n/translator.d.ts +0 -25
- package/dist/i18n/translator.d.ts.map +0 -1
- package/dist/i18n/translator.js +0 -1
- package/dist/i18n/types.d.ts +0 -47
- package/dist/i18n/types.d.ts.map +0 -1
- package/dist/i18n/types.js +0 -1
- package/dist/i18n/useTranslator.d.ts +0 -15
- package/dist/i18n/useTranslator.d.ts.map +0 -1
- package/dist/i18n/useTranslator.js +0 -39
- package/locales/en.json +0 -746
- package/locales/pseudo.json +0 -560
- package/src/Chat/useChatStreamScroll.test.tsx +0 -168
- package/src/PowerSearch/formatFilterValue.test.ts +0 -282
- package/src/PowerSearch/resolveOperatorLabel.ts +0 -34
- package/src/authoring/doc.ts +0 -166
- package/src/authoring/index.test.ts +0 -52
- package/src/authoring/index.ts +0 -50
- package/src/authoring/integration.ts +0 -42
- package/src/authoring/template.ts +0 -74
- package/src/config.test.ts +0 -16
- package/src/config.ts +0 -92
- package/src/docPropLiterals.test.ts +0 -938
- package/src/i18n/InternationalizationContext.ts +0 -39
- package/src/i18n/InternationalizationProvider.doc.mjs +0 -72
- package/src/i18n/InternationalizationProvider.tsx +0 -83
- package/src/i18n/__tests__/e2e-pagination.test.tsx +0 -172
- package/src/i18n/__tests__/e2e-powersearch.test.tsx +0 -130
- package/src/i18n/__tests__/resolve.test.ts +0 -284
- package/src/i18n/index.ts +0 -32
- package/src/i18n/resolve.ts +0 -165
- package/src/i18n/translator.ts +0 -31
- package/src/i18n/types.ts +0 -53
- package/src/i18n/useTranslator.doc.mjs +0 -46
- package/src/i18n/useTranslator.ts +0 -50
|
@@ -50,7 +50,7 @@ export const docs = {
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
name: 'gap',
|
|
53
|
-
type: '
|
|
53
|
+
type: 'SpacingStep',
|
|
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: 'SpacingStep',
|
|
120
120
|
description:
|
|
121
121
|
'项目间距,使用间距步进值(0、0.5、1、1.5、2、3、4、5、6、8、10)。',
|
|
122
122
|
default: '2',
|
|
@@ -39,7 +39,6 @@ import {useListFocus} from '../hooks/useListFocus';
|
|
|
39
39
|
import {mergeProps} from '../utils';
|
|
40
40
|
import type {BaseProps} from '../BaseProps';
|
|
41
41
|
import {themeProps} from '../utils/themeProps';
|
|
42
|
-
import {useTranslator} from '../i18n/useTranslator';
|
|
43
42
|
|
|
44
43
|
// =============================================================================
|
|
45
44
|
// Types
|
|
@@ -345,7 +344,7 @@ export function Pagination({
|
|
|
345
344
|
siblingCount = 1,
|
|
346
345
|
size = 'md',
|
|
347
346
|
isDisabled = false,
|
|
348
|
-
label
|
|
347
|
+
label = 'Pagination',
|
|
349
348
|
'data-testid': testId,
|
|
350
349
|
xstyle,
|
|
351
350
|
className,
|
|
@@ -355,14 +354,6 @@ export function Pagination({
|
|
|
355
354
|
}: PaginationProps) {
|
|
356
355
|
const [, startTransition] = useTransition();
|
|
357
356
|
|
|
358
|
-
// Resolve system strings once per render. Prop overrides win.
|
|
359
|
-
const t = useTranslator();
|
|
360
|
-
const label = labelFromProps ?? t('@astryx.pagination.label');
|
|
361
|
-
const previousLabel = t('@astryx.pagination.previous');
|
|
362
|
-
const nextLabel = t('@astryx.pagination.next');
|
|
363
|
-
const pageIndicatorsLabel = t('@astryx.pagination.pageIndicators');
|
|
364
|
-
const itemsPerPageLabel = t('@astryx.pagination.itemsPerPage');
|
|
365
|
-
|
|
366
357
|
// pageSize is typed as number, so 0, NaN, and negatives are valid at the
|
|
367
358
|
// type level but yield Infinity/NaN page counts, and
|
|
368
359
|
// Array.from({length: Infinity}) crashes the dots variant. Coerce to a
|
|
@@ -427,11 +418,8 @@ export function Pagination({
|
|
|
427
418
|
onChange(newPage);
|
|
428
419
|
announce(
|
|
429
420
|
computedTotalPages != null
|
|
430
|
-
?
|
|
431
|
-
|
|
432
|
-
total: computedTotalPages,
|
|
433
|
-
})
|
|
434
|
-
: t('@astryx.pagination.pageAnnounce', {current: newPage}),
|
|
421
|
+
? `Page ${newPage} of ${computedTotalPages}`
|
|
422
|
+
: `Page ${newPage}`,
|
|
435
423
|
);
|
|
436
424
|
startTransition(async () => {
|
|
437
425
|
setOptimisticPage(newPage);
|
|
@@ -523,10 +511,8 @@ export function Pagination({
|
|
|
523
511
|
return (
|
|
524
512
|
<Button
|
|
525
513
|
key={item}
|
|
526
|
-
label={
|
|
527
|
-
aria-label={
|
|
528
|
-
page: item,
|
|
529
|
-
})}
|
|
514
|
+
label={`Go to page ${item}`}
|
|
515
|
+
aria-label={`Go to page ${item}`}
|
|
530
516
|
variant="ghost"
|
|
531
517
|
size={buttonSize}
|
|
532
518
|
onClick={() => handlePageChange(item)}
|
|
@@ -548,11 +534,7 @@ export function Pagination({
|
|
|
548
534
|
return (
|
|
549
535
|
<span {...stylex.props(styles.infoText)}>
|
|
550
536
|
<Text type="body" size="sm" color="secondary">
|
|
551
|
-
{
|
|
552
|
-
from: rangeStart,
|
|
553
|
-
to: rangeEnd,
|
|
554
|
-
total: totalItems,
|
|
555
|
-
})}
|
|
537
|
+
{`${rangeStart}\u2013${rangeEnd} of ${totalItems}`}
|
|
556
538
|
</Text>
|
|
557
539
|
</span>
|
|
558
540
|
);
|
|
@@ -565,10 +547,7 @@ export function Pagination({
|
|
|
565
547
|
return (
|
|
566
548
|
<span {...stylex.props(styles.infoText)}>
|
|
567
549
|
<Text type="body" size="sm" color="secondary">
|
|
568
|
-
{
|
|
569
|
-
current: optimisticPage,
|
|
570
|
-
total: computedTotalPages,
|
|
571
|
-
})}
|
|
550
|
+
{`Page ${optimisticPage} of ${computedTotalPages}`}
|
|
572
551
|
</Text>
|
|
573
552
|
</span>
|
|
574
553
|
);
|
|
@@ -584,7 +563,7 @@ export function Pagination({
|
|
|
584
563
|
ref={dotsListRef}
|
|
585
564
|
{...stylex.props(styles.dotsContainer)}
|
|
586
565
|
role="group"
|
|
587
|
-
aria-label=
|
|
566
|
+
aria-label="Page indicators"
|
|
588
567
|
onKeyDown={handleDotsKeyDown}
|
|
589
568
|
onFocus={handleDotsFocus}>
|
|
590
569
|
{Array.from({length: computedTotalPages}, (_, i) => {
|
|
@@ -594,9 +573,7 @@ export function Pagination({
|
|
|
594
573
|
key={i + 1}
|
|
595
574
|
type="button"
|
|
596
575
|
data-page={i + 1}
|
|
597
|
-
aria-label={
|
|
598
|
-
page: i + 1,
|
|
599
|
-
})}
|
|
576
|
+
aria-label={`Go to page ${i + 1}`}
|
|
600
577
|
aria-current={isActive ? 'page' : undefined}
|
|
601
578
|
// The active dot is the single roving tab stop; useListFocus
|
|
602
579
|
// maintains it as focus and the active page move.
|
|
@@ -647,7 +624,7 @@ export function Pagination({
|
|
|
647
624
|
<div {...stylex.props(styles.pageSizeSelector)}>
|
|
648
625
|
<div {...stylex.props(styles.pageSizeSelectorControl)}>
|
|
649
626
|
<Selector
|
|
650
|
-
label=
|
|
627
|
+
label="Items per page"
|
|
651
628
|
isLabelHidden
|
|
652
629
|
options={pageSizeOptions.map(opt => String(opt))}
|
|
653
630
|
value={String(pageSize)}
|
|
@@ -660,7 +637,7 @@ export function Pagination({
|
|
|
660
637
|
)}
|
|
661
638
|
<div {...stylex.props(styles.controls)}>
|
|
662
639
|
<Button
|
|
663
|
-
label=
|
|
640
|
+
label="Go to previous page"
|
|
664
641
|
variant="ghost"
|
|
665
642
|
size={buttonSize}
|
|
666
643
|
icon={<Icon icon="chevronLeft" size={isSm ? 'sm' : 'md'} />}
|
|
@@ -672,7 +649,7 @@ export function Pagination({
|
|
|
672
649
|
{renderIndicator()}
|
|
673
650
|
|
|
674
651
|
<Button
|
|
675
|
-
label=
|
|
652
|
+
label="Go to next page"
|
|
676
653
|
variant="ghost"
|
|
677
654
|
size={buttonSize}
|
|
678
655
|
icon={<Icon icon="chevronRight" size={isSm ? 'sm' : 'md'} />}
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
shadowVars,
|
|
28
28
|
} from '../theme/tokens.stylex';
|
|
29
29
|
import {Button} from '../Button';
|
|
30
|
-
import {useTranslator} from '../i18n';
|
|
31
30
|
|
|
32
31
|
const styles = stylex.create({
|
|
33
32
|
// Default popover surface — background, radius, shadow.
|
|
@@ -310,16 +309,12 @@ export function usePopover(options: UsePopoverOptions = {}): UsePopoverReturn {
|
|
|
310
309
|
hasAutoFocus = true,
|
|
311
310
|
hasSurface = true,
|
|
312
311
|
hasCloseButton = true,
|
|
313
|
-
closeButtonLabel
|
|
312
|
+
closeButtonLabel = 'Close popover',
|
|
314
313
|
dialogLabel,
|
|
315
314
|
role = 'dialog',
|
|
316
315
|
isModal = true,
|
|
317
316
|
} = options;
|
|
318
317
|
|
|
319
|
-
const t = useTranslator();
|
|
320
|
-
const closeButtonLabel =
|
|
321
|
-
closeButtonLabelFromProps ?? t('@astryx.popover.close');
|
|
322
|
-
|
|
323
318
|
// Track the trigger element for returning focus
|
|
324
319
|
const triggerElementRef = useRef<HTMLElement | null>(null);
|
|
325
320
|
|
|
@@ -23,7 +23,7 @@ export const docs = {
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
name: 'onChange',
|
|
26
|
-
type:
|
|
26
|
+
type: '(filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void',
|
|
27
27
|
description:
|
|
28
28
|
"Called when filters change. changeType is 'add', 'edit', or 'remove'. index is the affected filter's position.",
|
|
29
29
|
required: true,
|
|
@@ -79,7 +79,7 @@ export const docs = {
|
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
name: 'status',
|
|
82
|
-
type:
|
|
82
|
+
type: 'InputStatus',
|
|
83
83
|
description:
|
|
84
84
|
'Validation status object with type and optional message.',
|
|
85
85
|
},
|
|
@@ -177,7 +177,7 @@ export const docsZh = {
|
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
name: 'onChange',
|
|
180
|
-
type:
|
|
180
|
+
type: '(filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void',
|
|
181
181
|
description:
|
|
182
182
|
"当过滤器变更时调用。changeType 为 'add'、'edit' 或 'remove'。index 为受影响的过滤器位置。",
|
|
183
183
|
required: true,
|
|
@@ -232,7 +232,7 @@ export const docsZh = {
|
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
234
|
name: 'status',
|
|
235
|
-
type:
|
|
235
|
+
type: 'InputStatus',
|
|
236
236
|
description: '带有类型和可选消息的验证状态对象。',
|
|
237
237
|
},
|
|
238
238
|
{
|
|
@@ -52,9 +52,7 @@ import {useInternalConfig} from './useInternalConfig';
|
|
|
52
52
|
import {usePowerSearchSource} from './usePowerSearchSource';
|
|
53
53
|
import {formatFilterValue} from './formatFilterValue';
|
|
54
54
|
import {PowerSearchEditPopover} from './PowerSearchEditPopover';
|
|
55
|
-
import {resolveOperatorLabel} from './resolveOperatorLabel';
|
|
56
55
|
import {themeProps} from '../utils/themeProps';
|
|
57
|
-
import {useTranslator} from '../i18n';
|
|
58
56
|
import type {
|
|
59
57
|
PowerSearchConfig,
|
|
60
58
|
PowerSearchFilter,
|
|
@@ -515,9 +513,9 @@ export function PowerSearch({
|
|
|
515
513
|
config: configProp,
|
|
516
514
|
filters,
|
|
517
515
|
onChange,
|
|
518
|
-
label
|
|
516
|
+
label = 'Search',
|
|
519
517
|
isLabelHidden = true,
|
|
520
|
-
placeholder
|
|
518
|
+
placeholder = 'Search...',
|
|
521
519
|
hasAutoFocus = false,
|
|
522
520
|
hasClear = true,
|
|
523
521
|
isReadOnly = false,
|
|
@@ -528,7 +526,7 @@ export function PowerSearch({
|
|
|
528
526
|
onBlur,
|
|
529
527
|
status,
|
|
530
528
|
maxTokenLength = 40,
|
|
531
|
-
popoverSaveButtonLabel
|
|
529
|
+
popoverSaveButtonLabel = 'Apply',
|
|
532
530
|
timezoneID,
|
|
533
531
|
tokenOverflowBehavior,
|
|
534
532
|
endContent,
|
|
@@ -545,12 +543,6 @@ export function PowerSearch({
|
|
|
545
543
|
const size = useSize(sizeProp, 'md');
|
|
546
544
|
const config = useInternalConfig(configProp);
|
|
547
545
|
const searchSource = usePowerSearchSource(config);
|
|
548
|
-
const t = useTranslator();
|
|
549
|
-
const label = labelFromProps ?? t('@astryx.powersearch.label');
|
|
550
|
-
const placeholder =
|
|
551
|
-
placeholderFromProps ?? t('@astryx.powersearch.placeholder');
|
|
552
|
-
const popoverSaveButtonLabel =
|
|
553
|
-
popoverSaveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
|
|
554
546
|
const tokenizerRef = useRef<TokenizerHandle>(null);
|
|
555
547
|
|
|
556
548
|
const [popoverState, setPopoverStateRaw] = useState<PopoverState>({
|
|
@@ -606,15 +598,13 @@ export function PowerSearch({
|
|
|
606
598
|
return filters.map((filter, index) => {
|
|
607
599
|
const field = config.getField(filter.field);
|
|
608
600
|
const operator = config.getOperator(filter.field, filter.operator);
|
|
609
|
-
const
|
|
610
|
-
const operatorLabel = resolvedOp ? `: ${resolvedOp}` : '';
|
|
601
|
+
const operatorLabel = operator?.label ? `: ${operator.label}` : '';
|
|
611
602
|
const valueStr = operator
|
|
612
603
|
? formatFilterValue(
|
|
613
604
|
config,
|
|
614
605
|
operator.value,
|
|
615
606
|
filter.value,
|
|
616
607
|
maxTokenLength,
|
|
617
|
-
t,
|
|
618
608
|
timezoneID,
|
|
619
609
|
)
|
|
620
610
|
: '';
|
|
@@ -634,7 +624,7 @@ export function PowerSearch({
|
|
|
634
624
|
},
|
|
635
625
|
};
|
|
636
626
|
});
|
|
637
|
-
}, [filters, config, maxTokenLength, timezoneID
|
|
627
|
+
}, [filters, config, maxTokenLength, timezoneID]);
|
|
638
628
|
|
|
639
629
|
// Handle tokenizer onChange (field selected from typeahead)
|
|
640
630
|
const handleTokenizerChange = useCallback(
|
|
@@ -797,7 +787,7 @@ export function PowerSearch({
|
|
|
797
787
|
|
|
798
788
|
// Default token rendering
|
|
799
789
|
const fieldLabel = field?.label ?? '';
|
|
800
|
-
const operatorLabel = operator
|
|
790
|
+
const operatorLabel = operator?.label ?? '';
|
|
801
791
|
const tokenLabel = `${fieldLabel}: ${operatorLabel}`.trim();
|
|
802
792
|
const adjustedMaxLength = Math.max(
|
|
803
793
|
maxTokenLength - fieldLabel.length - operatorLabel.length,
|
|
@@ -853,7 +843,6 @@ export function PowerSearch({
|
|
|
853
843
|
isDisabled,
|
|
854
844
|
handleTokenClick,
|
|
855
845
|
componentOverrides,
|
|
856
|
-
t,
|
|
857
846
|
],
|
|
858
847
|
);
|
|
859
848
|
|
|
@@ -959,18 +948,17 @@ export function PowerSearch({
|
|
|
959
948
|
]);
|
|
960
949
|
|
|
961
950
|
// Plain-text form of the result count, shared by the visible label and the
|
|
962
|
-
// screen-reader announcement so the two never drift.
|
|
963
|
-
// the number formatting + `result` vs `results` in one message so translators
|
|
964
|
-
// can match the locale's plural rules.
|
|
951
|
+
// screen-reader announcement so the two never drift.
|
|
965
952
|
const resultCountText = useMemo((): string | null => {
|
|
966
953
|
if (resultCount == null) {
|
|
967
954
|
return null;
|
|
968
955
|
}
|
|
969
956
|
if (typeof resultCount === 'number') {
|
|
970
|
-
|
|
957
|
+
const formatted = new Intl.NumberFormat().format(resultCount);
|
|
958
|
+
return `${formatted} ${resultCount === 1 ? 'result' : 'results'}`;
|
|
971
959
|
}
|
|
972
960
|
return resultCount;
|
|
973
|
-
}, [resultCount
|
|
961
|
+
}, [resultCount]);
|
|
974
962
|
|
|
975
963
|
// Announce result-count changes to screen readers through a polite live
|
|
976
964
|
// region, mirroring the way Typeahead announces its dropdown result count.
|
|
@@ -19,10 +19,8 @@ import {Selector} from '../Selector';
|
|
|
19
19
|
import {HStack, VStack} from '../Stack';
|
|
20
20
|
import {Icon} from '../Icon';
|
|
21
21
|
import {TreeList, type TreeListItemData} from '../TreeList';
|
|
22
|
-
import {useTranslator} from '../i18n';
|
|
23
22
|
import {spacingVars, typeScaleVars} from '../theme/tokens.stylex';
|
|
24
23
|
import {PowerSearchValueEditor} from './PowerSearchValueEditor';
|
|
25
|
-
import {resolveOperatorLabel} from './resolveOperatorLabel';
|
|
26
24
|
import type {InternalConfig} from './useInternalConfig';
|
|
27
25
|
import type {
|
|
28
26
|
PowerSearchFilter,
|
|
@@ -240,7 +238,6 @@ function NestedSubFilterRow({
|
|
|
240
238
|
onChange,
|
|
241
239
|
isReadOnly,
|
|
242
240
|
}: NestedSubFilterRowProps) {
|
|
243
|
-
const t = useTranslator();
|
|
244
241
|
const fieldOptions = useMemo(
|
|
245
242
|
() =>
|
|
246
243
|
config.getVisibleFields().map(field => ({
|
|
@@ -254,9 +251,9 @@ function NestedSubFilterRow({
|
|
|
254
251
|
const operators = config.getVisibleOperators(subFilter.field);
|
|
255
252
|
return operators.map(op => ({
|
|
256
253
|
value: op.key,
|
|
257
|
-
label:
|
|
254
|
+
label: op.label,
|
|
258
255
|
}));
|
|
259
|
-
}, [config, subFilter.field
|
|
256
|
+
}, [config, subFilter.field]);
|
|
260
257
|
|
|
261
258
|
const currentOperator = subFilter.operator
|
|
262
259
|
? config.getOperator(subFilter.field, subFilter.operator)
|
|
@@ -311,7 +308,7 @@ function NestedSubFilterRow({
|
|
|
311
308
|
<HStack gap={2} vAlign="center">
|
|
312
309
|
<div {...stylex.props(styles.nestedFieldSelector)}>
|
|
313
310
|
<Selector
|
|
314
|
-
label=
|
|
311
|
+
label="Field"
|
|
315
312
|
isLabelHidden
|
|
316
313
|
options={fieldOptions}
|
|
317
314
|
value={subFilter.field}
|
|
@@ -323,7 +320,7 @@ function NestedSubFilterRow({
|
|
|
323
320
|
{operatorOptions.length > 0 && (
|
|
324
321
|
<div {...stylex.props(styles.nestedOperatorSelector)}>
|
|
325
322
|
<Selector
|
|
326
|
-
label=
|
|
323
|
+
label="Operator"
|
|
327
324
|
isLabelHidden
|
|
328
325
|
options={operatorOptions}
|
|
329
326
|
value={subFilter.operator}
|
|
@@ -369,7 +366,6 @@ function NestedEditor({
|
|
|
369
366
|
onPartialFilterChange,
|
|
370
367
|
isReadOnly,
|
|
371
368
|
}: NestedEditorProps) {
|
|
372
|
-
const t = useTranslator();
|
|
373
369
|
const [subFilters, setSubFilters] = useState<EditablePartialFilter[]>(() => {
|
|
374
370
|
if (partialFilter.value && partialFilter.value.type === 'nested') {
|
|
375
371
|
return partialFilter.value.value.map(f => initEditableFilter(config, f));
|
|
@@ -472,7 +468,7 @@ function NestedEditor({
|
|
|
472
468
|
id: `${itemPath.join('-')}-add`,
|
|
473
469
|
label: (
|
|
474
470
|
<Button
|
|
475
|
-
label=
|
|
471
|
+
label="+ Add filter"
|
|
476
472
|
onClick={() => handleAdd(itemPath)}
|
|
477
473
|
variant="ghost"
|
|
478
474
|
size="sm"
|
|
@@ -495,7 +491,7 @@ function NestedEditor({
|
|
|
495
491
|
children,
|
|
496
492
|
endContent: !isReadOnly ? (
|
|
497
493
|
<Button
|
|
498
|
-
label=
|
|
494
|
+
label="Remove filter"
|
|
499
495
|
icon={<Icon icon="close" size="sm" />}
|
|
500
496
|
variant="ghost"
|
|
501
497
|
size="sm"
|
|
@@ -519,7 +515,7 @@ function NestedEditor({
|
|
|
519
515
|
),
|
|
520
516
|
endContent: !isReadOnly ? (
|
|
521
517
|
<Button
|
|
522
|
-
label=
|
|
518
|
+
label="Remove filter"
|
|
523
519
|
icon={<Icon icon="close" size="sm" />}
|
|
524
520
|
variant="ghost"
|
|
525
521
|
size="sm"
|
|
@@ -540,7 +536,7 @@ function NestedEditor({
|
|
|
540
536
|
id: 'add-filter',
|
|
541
537
|
label: (
|
|
542
538
|
<Button
|
|
543
|
-
label=
|
|
539
|
+
label="+ Add filter"
|
|
544
540
|
onClick={() => handleAdd([])}
|
|
545
541
|
variant="ghost"
|
|
546
542
|
size="sm"
|
|
@@ -554,7 +550,7 @@ function NestedEditor({
|
|
|
554
550
|
{operatorOptions.length > 1 ? (
|
|
555
551
|
<div {...stylex.props(styles.operatorSelector)}>
|
|
556
552
|
<Selector
|
|
557
|
-
label=
|
|
553
|
+
label="Group operator"
|
|
558
554
|
isLabelHidden
|
|
559
555
|
options={operatorOptions}
|
|
560
556
|
value={partialFilter.operator}
|
|
@@ -564,7 +560,7 @@ function NestedEditor({
|
|
|
564
560
|
/>
|
|
565
561
|
</div>
|
|
566
562
|
) : (
|
|
567
|
-
(operatorOptions[0]?.label ??
|
|
563
|
+
(operatorOptions[0]?.label ?? 'Group')
|
|
568
564
|
)}
|
|
569
565
|
</div>
|
|
570
566
|
);
|
|
@@ -591,12 +587,9 @@ export function PowerSearchEditPopover({
|
|
|
591
587
|
mode,
|
|
592
588
|
onSave,
|
|
593
589
|
onCancel,
|
|
594
|
-
saveButtonLabel
|
|
590
|
+
saveButtonLabel = 'Apply',
|
|
595
591
|
isReadOnly = false,
|
|
596
592
|
}: PowerSearchEditPopoverProps) {
|
|
597
|
-
const t = useTranslator();
|
|
598
|
-
const saveButtonLabel =
|
|
599
|
-
saveButtonLabelFromProps ?? t('@astryx.powersearch.editor.apply');
|
|
600
593
|
const [partialFilter, setPartialFilter] =
|
|
601
594
|
useState<PartialFilter>(initialFilter);
|
|
602
595
|
const valueEditorRef = useRef<HTMLDivElement>(null);
|
|
@@ -635,9 +628,9 @@ export function PowerSearchEditPopover({
|
|
|
635
628
|
const operators = config.getVisibleOperators(partialFilter.field);
|
|
636
629
|
return operators.map(op => ({
|
|
637
630
|
value: op.key,
|
|
638
|
-
label:
|
|
631
|
+
label: op.label,
|
|
639
632
|
}));
|
|
640
|
-
}, [config, partialFilter.field
|
|
633
|
+
}, [config, partialFilter.field]);
|
|
641
634
|
|
|
642
635
|
const handleFieldChange = useCallback(
|
|
643
636
|
(fieldKey: string) => {
|
|
@@ -739,7 +732,7 @@ export function PowerSearchEditPopover({
|
|
|
739
732
|
<HStack gap={2}>
|
|
740
733
|
<div {...stylex.props(styles.fieldSelector)}>
|
|
741
734
|
<Selector
|
|
742
|
-
label=
|
|
735
|
+
label="Field"
|
|
743
736
|
isLabelHidden
|
|
744
737
|
options={fieldOptions}
|
|
745
738
|
value={partialFilter.field}
|
|
@@ -763,7 +756,7 @@ export function PowerSearchEditPopover({
|
|
|
763
756
|
<HStack gap={2} hAlign="between">
|
|
764
757
|
{!isReadOnly && mode === 'edit' ? (
|
|
765
758
|
<Button
|
|
766
|
-
label=
|
|
759
|
+
label="Delete"
|
|
767
760
|
onClick={handleDelete}
|
|
768
761
|
variant="ghost"
|
|
769
762
|
size="sm"
|
|
@@ -773,7 +766,7 @@ export function PowerSearchEditPopover({
|
|
|
773
766
|
)}
|
|
774
767
|
<HStack gap={2}>
|
|
775
768
|
<Button
|
|
776
|
-
label=
|
|
769
|
+
label="Cancel"
|
|
777
770
|
onClick={onCancel}
|
|
778
771
|
variant="ghost"
|
|
779
772
|
size="sm"
|
|
@@ -798,7 +791,7 @@ export function PowerSearchEditPopover({
|
|
|
798
791
|
<HStack gap={2}>
|
|
799
792
|
<div {...stylex.props(styles.fieldSelector)}>
|
|
800
793
|
<Selector
|
|
801
|
-
label=
|
|
794
|
+
label="Field"
|
|
802
795
|
isLabelHidden
|
|
803
796
|
options={fieldOptions}
|
|
804
797
|
value={partialFilter.field}
|
|
@@ -810,7 +803,7 @@ export function PowerSearchEditPopover({
|
|
|
810
803
|
{showOperatorSelector && operatorOptions.length > 0 && (
|
|
811
804
|
<div {...stylex.props(styles.operatorSelector)}>
|
|
812
805
|
<Selector
|
|
813
|
-
label=
|
|
806
|
+
label="Operator"
|
|
814
807
|
isLabelHidden
|
|
815
808
|
options={operatorOptions}
|
|
816
809
|
value={partialFilter.operator}
|
|
@@ -839,7 +832,7 @@ export function PowerSearchEditPopover({
|
|
|
839
832
|
<HStack gap={2} hAlign="between">
|
|
840
833
|
{!isReadOnly && mode === 'edit' ? (
|
|
841
834
|
<Button
|
|
842
|
-
label=
|
|
835
|
+
label="Delete"
|
|
843
836
|
onClick={handleDelete}
|
|
844
837
|
variant="ghost"
|
|
845
838
|
size="sm"
|
|
@@ -849,7 +842,7 @@ export function PowerSearchEditPopover({
|
|
|
849
842
|
)}
|
|
850
843
|
<HStack gap={2}>
|
|
851
844
|
<Button
|
|
852
|
-
label=
|
|
845
|
+
label="Cancel"
|
|
853
846
|
onClick={onCancel}
|
|
854
847
|
variant="ghost"
|
|
855
848
|
size="sm"
|
|
@@ -12,10 +12,8 @@
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import * as stylex from '@stylexjs/stylex';
|
|
14
14
|
import {Token} from '../Token';
|
|
15
|
-
import {useTranslator} from '../i18n';
|
|
16
15
|
import {fontWeightVars} from '../theme/tokens.stylex';
|
|
17
16
|
import {formatFilterValue} from './formatFilterValue';
|
|
18
|
-
import {resolveOperatorLabel} from './resolveOperatorLabel';
|
|
19
17
|
import {useInternalConfig} from './useInternalConfig';
|
|
20
18
|
import type {PowerSearchTokenProps} from './types';
|
|
21
19
|
|
|
@@ -43,17 +41,13 @@ export function PowerSearchToken({
|
|
|
43
41
|
isDisabled,
|
|
44
42
|
}: PowerSearchTokenProps) {
|
|
45
43
|
const config = useInternalConfig(configProp);
|
|
46
|
-
const t = useTranslator();
|
|
47
44
|
|
|
48
45
|
const fieldLabel = field.label;
|
|
49
|
-
const
|
|
50
|
-
const operatorLabel = resolvedOperatorLabel
|
|
51
|
-
? `: ${resolvedOperatorLabel}`
|
|
52
|
-
: '';
|
|
46
|
+
const operatorLabel = operator.label ? `: ${operator.label}` : '';
|
|
53
47
|
const tokenLabel = `${fieldLabel}${operatorLabel}`;
|
|
54
48
|
|
|
55
49
|
const adjustedMaxLength = Math.max(
|
|
56
|
-
maxLength - fieldLabel.length -
|
|
50
|
+
maxLength - fieldLabel.length - (operator.label?.length ?? 0),
|
|
57
51
|
10,
|
|
58
52
|
);
|
|
59
53
|
|
|
@@ -62,7 +56,6 @@ export function PowerSearchToken({
|
|
|
62
56
|
operator.value,
|
|
63
57
|
filter.value,
|
|
64
58
|
adjustedMaxLength,
|
|
65
|
-
t,
|
|
66
59
|
);
|
|
67
60
|
|
|
68
61
|
const valueContent = valueStr ? (
|
|
@@ -73,14 +66,10 @@ export function PowerSearchToken({
|
|
|
73
66
|
<Token
|
|
74
67
|
label={tokenLabel}
|
|
75
68
|
endContent={valueContent}
|
|
76
|
-
onClick={
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
onClick();
|
|
81
|
-
}
|
|
82
|
-
: undefined
|
|
83
|
-
}
|
|
69
|
+
onClick={onClick ? (e: React.MouseEvent) => {
|
|
70
|
+
e.stopPropagation();
|
|
71
|
+
onClick();
|
|
72
|
+
} : undefined}
|
|
84
73
|
onRemove={onRemove}
|
|
85
74
|
isDisabled={isDisabled}
|
|
86
75
|
/>
|