@astryxdesign/core 0.7.17 → 0.7.18-canary.g170df15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +7 -0
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +5 -3
- package/dist/AppShell/observeMainOverflow.d.ts +5 -0
- package/dist/AppShell/observeMainOverflow.d.ts.map +1 -1
- package/dist/AppShell/observeMainOverflow.js +39 -9
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +8 -0
- package/dist/BottomSheet/useSheetGestures.d.ts +8 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +16 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +3 -16
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +5 -1
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +2 -2
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +7 -2
- package/dist/DateInput/DateInput.d.ts +0 -3
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +3 -5
- package/dist/DateInput/NativeDateField.d.ts.map +1 -1
- package/dist/DateInput/NativeDateField.js +3 -5
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +2 -4
- package/dist/DateInput/useTypedDate.d.ts.map +1 -1
- package/dist/DateInput/useTypedDate.js +9 -6
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +13 -9
- package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
- package/dist/DateTimeInput/DateTimeInput.js +3 -15
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +2 -14
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +7 -1
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +7 -0
- package/dist/Field/Field.d.ts.map +1 -1
- package/dist/Field/Field.js +2 -1
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +9 -2
- package/dist/Field/InputClearButton.d.ts.map +1 -1
- package/dist/Field/InputClearButton.js +23 -0
- package/dist/Field/inputStyles.stylex.d.ts +22 -6
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +32 -0
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +7 -2
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +4 -4
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +6 -16
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -8
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +8 -2
- package/dist/Kbd/Kbd.d.ts +3 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +3 -2
- package/dist/Layer/gestureCounter.d.ts +5 -0
- package/dist/Layer/gestureCounter.d.ts.map +1 -1
- package/dist/Layer/gestureCounter.js +40 -4
- package/dist/Layer/inputHold.d.ts +13 -0
- package/dist/Layer/inputHold.d.ts.map +1 -1
- package/dist/Layer/inputHold.js +203 -14
- package/dist/Layer/layerHost.d.ts +3 -2
- package/dist/Layer/layerHost.d.ts.map +1 -1
- package/dist/Layer/layerHost.js +3 -2
- package/dist/Layer/outsidePanClaim.d.ts +17 -0
- package/dist/Layer/outsidePanClaim.d.ts.map +1 -1
- package/dist/Layer/outsidePanClaim.js +36 -8
- package/dist/Layer/outsidePress.d.ts +7 -1
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +9 -2
- package/dist/Layer/useLayer.d.ts +21 -5
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +63 -40
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +7 -0
- package/dist/MetadataList/MetadataList.d.ts +1 -1
- package/dist/MetadataList/MetadataList.d.ts.map +1 -1
- package/dist/MetadataList/MetadataList.js +8 -0
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +37 -17
- package/dist/NavIcon/NavIcon.d.ts +2 -2
- package/dist/NavIcon/NavIcon.d.ts.map +1 -1
- package/dist/NavIcon/NavIcon.js +2 -2
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +4 -3
- package/dist/NumberInput/NumberInput.d.ts +13 -5
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +6 -17
- package/dist/NumberInput/numberParser.d.ts +9 -2
- package/dist/NumberInput/numberParser.d.ts.map +1 -1
- package/dist/NumberInput/numberParser.js +15 -2
- package/dist/Overlay/OverlayScrim.d.ts.map +1 -1
- package/dist/Overlay/OverlayScrim.js +13 -4
- package/dist/Overlay/useOverlay.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts +3 -2
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +9 -2
- package/dist/Popover/usePopover.d.ts +37 -6
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +103 -20
- package/dist/PowerSearch/PowerSearch.d.ts +4 -1
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +3 -4
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts +1 -2
- package/dist/PowerSearch/PowerSearchBottomSheet.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchBottomSheet.js +173 -185
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +0 -12
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +1 -51
- package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatFilterValue.js +6 -8
- package/dist/PowerSearch/formatTokenValue.d.ts +5 -10
- package/dist/PowerSearch/formatTokenValue.d.ts.map +1 -1
- package/dist/PowerSearch/formatTokenValue.js +21 -38
- package/dist/PowerSearch/relativeDateOptions.d.ts +30 -0
- package/dist/PowerSearch/relativeDateOptions.d.ts.map +1 -0
- package/dist/PowerSearch/relativeDateOptions.js +74 -0
- package/dist/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +20 -14
- package/dist/Resizable/createResizable.d.ts.map +1 -1
- package/dist/Resizable/createResizable.js +38 -4
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +5 -3
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +6 -2
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +2 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +1 -1
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +53 -8
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +2 -2
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +2 -0
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +2 -0
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +30 -8
- package/dist/Table/Table.d.ts +9 -4
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +9 -4
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +3 -7
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +4 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.d.ts.map +1 -1
- package/dist/Table/plugins/rowStatus/useTableRowStatus.js +2 -0
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +18 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +34 -24
- package/dist/Table/tableColumnAdmission.d.ts +7 -0
- package/dist/Table/tableColumnAdmission.d.ts.map +1 -1
- package/dist/Table/tableColumnAdmission.js +15 -0
- package/dist/Table/types.d.ts +5 -5
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +13 -8
- package/dist/Text/TruncationTooltip.d.ts +7 -39
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +47 -128
- package/dist/Text/cutText.d.ts +22 -0
- package/dist/Text/cutText.d.ts.map +1 -0
- package/dist/Text/cutText.js +92 -0
- package/dist/Text/cutTextOnKeyboardFocus.d.ts +41 -0
- package/dist/Text/cutTextOnKeyboardFocus.d.ts.map +1 -0
- package/dist/Text/cutTextOnKeyboardFocus.js +112 -0
- package/dist/Text/textClampContext.d.ts +1 -0
- package/dist/Text/textClampContext.d.ts.map +1 -1
- package/dist/Text/textClampContext.js +10 -5
- package/dist/Text/useTruncation.d.ts +23 -1
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +74 -28
- package/dist/TextInput/TextInput.d.ts +6 -6
- package/dist/Thumbnail/Thumbnail.js +4 -1
- package/dist/TimeInput/TimeInput.d.ts +0 -3
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +3 -5
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +3 -5
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +22 -16
- package/dist/Timestamp/TimestampHoverCard.d.ts +6 -3
- package/dist/Timestamp/TimestampHoverCard.d.ts.map +1 -1
- package/dist/Timestamp/TimestampHoverCard.js +30 -19
- package/dist/Timestamp/formatInstant.d.ts.map +1 -1
- package/dist/Timestamp/formatInstant.js +3 -3
- package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
- package/dist/Timestamp/tooltipEntries.js +4 -2
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +62 -31
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +35 -13
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +35 -14
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +3 -3
- package/dist/astryx.css +38 -8
- package/dist/hooks/useAnnounceRenderedText.d.ts +10 -3
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +11 -3
- package/dist/hooks/useFocusTrap.d.ts +12 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +13 -6
- package/dist/hooks/useHotkeys.d.ts +9 -1
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +52 -2
- package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
- package/dist/hooks/useInputStatusIcon.js +2 -1
- package/dist/hooks/useKeyboardHint.d.ts.map +1 -1
- package/dist/hooks/useKeyboardHint.js +4 -3
- package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/DateRangeInput/DateRangeInput.generated.js +2 -0
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/MultiSelector/MultiSelector.generated.js +1 -0
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js +0 -6
- package/dist/i18n/generated-english/PowerSearch/relativeDateOptions.generated.d.ts +8 -0
- package/dist/i18n/generated-english/PowerSearch/relativeDateOptions.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/PowerSearch/relativeDateOptions.generated.js +17 -0
- package/dist/i18n/generated-english/Slider/Slider.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Slider/Slider.generated.js +1 -0
- package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Thumbnail/Thumbnail.generated.js +1 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +5 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +5 -0
- package/dist/i18n/getLocaleDirection.d.ts +0 -16
- package/dist/i18n/getLocaleDirection.d.ts.map +1 -1
- package/dist/i18n/getLocaleDirection.js +16 -6
- package/dist/i18n/listFormat.d.ts +34 -0
- package/dist/i18n/listFormat.d.ts.map +1 -0
- package/dist/i18n/listFormat.js +45 -0
- package/dist/i18n/useListFormatter.d.ts +7 -3
- package/dist/i18n/useListFormatter.d.ts.map +1 -1
- package/dist/i18n/useListFormatter.js +16 -13
- package/dist/internal/module-loader.d.ts +15 -0
- package/dist/internal/module-loader.d.ts.map +1 -0
- package/dist/internal/module-loader.js +15 -0
- package/dist/motion/animatedLayout.d.ts +6 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +201 -27
- package/dist/palette/color.d.ts +16 -0
- package/dist/palette/color.d.ts.map +1 -1
- package/dist/palette/color.js +37 -1
- package/dist/palette/derive-look.d.ts +235 -0
- package/dist/palette/derive-look.d.ts.map +1 -0
- package/dist/palette/derive-look.js +879 -0
- package/dist/palette/editor-look.d.ts +41 -0
- package/dist/palette/editor-look.d.ts.map +1 -0
- package/dist/palette/editor-look.js +401 -0
- package/dist/palette/mapping.d.ts +99 -6
- package/dist/palette/mapping.d.ts.map +1 -1
- package/dist/palette/mapping.js +68 -11
- package/dist/theme/tokens.d.ts +1 -1
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +1 -1
- package/dist/utils/characters.d.ts.map +1 -1
- package/dist/utils/characters.js +7 -0
- package/dist/utils/devWarning.d.ts +18 -0
- package/dist/utils/devWarning.d.ts.map +1 -1
- package/dist/utils/devWarning.js +30 -0
- package/dist/utils/focusReturn.d.ts +2 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +3 -8
- package/dist/utils/hitArea.d.ts +4 -1
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +72 -9
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/mergeProps.js +53 -38
- package/dist/utils/scrollView.d.ts +2 -2
- package/dist/utils/scrollView.d.ts.map +1 -1
- package/dist/utils/scrollView.js +3 -3
- package/dist/utils/textDirection.d.ts +29 -5
- package/dist/utils/textDirection.d.ts.map +1 -1
- package/dist/utils/textDirection.js +56 -4
- package/dist/utils/touchHitArea.d.ts.map +1 -1
- package/dist/utils/touchHitArea.js +4 -2
- package/dist/virtualization/useInlineListWindow.d.ts.map +1 -1
- package/dist/virtualization/useInlineListWindow.js +63 -4
- package/locales/en.json +26 -6
- package/locales/pseudo.json +15 -0
- package/package.json +10 -5
- package/src/AlertDialog/AlertDialog.tsx +15 -0
- package/src/AlertDialog/useImperativeAlertDialog.doc.mjs +7 -4
- package/src/AppShell/AppShell.tsx +6 -3
- package/src/AppShell/observeMainOverflow.ts +39 -9
- package/src/Badge/Badge.doc.mjs +3 -3
- package/src/BottomSheet/BottomSheet.tsx +15 -0
- package/src/BottomSheet/useSheetGestures.ts +26 -1
- package/src/Button/Button.tsx +3 -23
- package/src/Card/Card.doc.mjs +3 -3
- package/src/Card/Card.tsx +11 -6
- package/src/Chat/ChatSendButton.doc.mjs +6 -6
- package/src/Chat/ChatToolCalls.doc.mjs +1 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +3 -3
- package/src/Citation/Citation.tsx +8 -2
- package/src/ClickableCard/ClickableCard.tsx +9 -2
- package/src/ComplexSelector/ComplexSelector.doc.mjs +3 -3
- package/src/ContextMenu/ContextMenuItem.doc.mjs +3 -3
- package/src/DateInput/DateInput.tsx +2 -4
- package/src/DateInput/NativeDateField.tsx +5 -4
- package/src/DateInput/TouchDateField.tsx +2 -3
- package/src/DateInput/useTypedDate.ts +13 -6
- package/src/DateRangeInput/DateRangeInput.tsx +14 -10
- package/src/DateTimeInput/DateTimeInput.tsx +2 -12
- package/src/DateTimeInput/TouchDateTimeField.tsx +2 -11
- package/src/Dialog/Dialog.tsx +15 -1
- package/src/Dialog/useImperativeDialog.doc.mjs +7 -4
- package/src/Drawer/Drawer.tsx +15 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +1 -1
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +3 -3
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +3 -3
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +3 -3
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +2 -2
- package/src/Field/Field.doc.mjs +1 -1
- package/src/Field/Field.tsx +2 -1
- package/src/Field/FieldLabel.doc.mjs +3 -3
- package/src/Field/FieldLabel.tsx +11 -3
- package/src/Field/InputClearButton.tsx +27 -0
- package/src/Field/inputStyles.stylex.ts +53 -6
- package/src/FieldStatus/FieldStatus.tsx +7 -2
- package/src/FileInput/FileInput.tsx +12 -2
- package/src/Icon/Icon.doc.mjs +17 -14
- package/src/Icon/useIcon.doc.mjs +6 -6
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/InfoTip/InfoTip.doc.mjs +1 -1
- package/src/InputGroup/InputGroup.tsx +5 -12
- package/src/InputGroup/InputGroupText.tsx +2 -3
- package/src/Item/Item.tsx +10 -1
- package/src/Kbd/Kbd.doc.mjs +5 -5
- package/src/Kbd/Kbd.tsx +3 -2
- package/src/Layer/gestureCounter.ts +39 -3
- package/src/Layer/inputHold.ts +241 -18
- package/src/Layer/layerHost.ts +3 -2
- package/src/Layer/outsidePanClaim.ts +50 -8
- package/src/Layer/outsidePress.ts +18 -4
- package/src/Layer/useLayer.tsx +128 -76
- package/src/Lightbox/Lightbox.tsx +15 -0
- package/src/MetadataList/MetadataList.tsx +8 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +1 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +2 -2
- package/src/MultiSelector/MultiSelector.tsx +45 -15
- package/src/NavIcon/NavIcon.doc.mjs +19 -10
- package/src/NavIcon/NavIcon.tsx +3 -2
- package/src/NavMenu/NavHeadingMenuItem.tsx +9 -3
- package/src/NumberInput/NumberInput.doc.mjs +12 -12
- package/src/NumberInput/NumberInput.tsx +12 -15
- package/src/NumberInput/numberParser.ts +15 -2
- package/src/Overlay/Overlay.doc.mjs +13 -1
- package/src/Overlay/OverlayScrim.tsx +45 -15
- package/src/Overlay/useOverlay.doc.mjs +7 -7
- package/src/Overlay/useOverlay.tsx +1 -1
- package/src/Pagination/Pagination.doc.mjs +9 -6
- package/src/Pagination/Pagination.tsx +15 -3
- package/src/Popover/usePopover.doc.mjs +14 -4
- package/src/Popover/usePopover.tsx +180 -23
- package/src/PowerSearch/PowerSearch.doc.mjs +165 -15
- package/src/PowerSearch/PowerSearch.tsx +6 -8
- package/src/PowerSearch/PowerSearchBottomSheet.tsx +182 -223
- package/src/PowerSearch/PowerSearchValueEditor.tsx +1 -51
- package/src/PowerSearch/formatFilterValue.ts +8 -9
- package/src/PowerSearch/formatTokenValue.ts +24 -42
- package/src/PowerSearch/relativeDateOptions.ts +84 -0
- package/src/ProgressBar/ProgressBar.doc.mjs +24 -5
- package/src/ProgressBar/ProgressBar.tsx +28 -18
- package/src/Resizable/createResizable.ts +46 -5
- package/src/SegmentedControl/SegmentedControlItem.tsx +4 -3
- package/src/SelectableCard/SelectableCard.tsx +8 -2
- package/src/Selector/Selector.doc.mjs +3 -3
- package/src/Selector/Selector.tsx +3 -1
- package/src/Selector/SelectorOption.doc.mjs +3 -3
- package/src/SideNav/SideNavItem.doc.mjs +6 -6
- package/src/SideNav/SideNavItem.tsx +3 -0
- package/src/Slider/Slider.tsx +48 -6
- package/src/Stepper/Step.tsx +7 -1
- package/src/Switch/Switch.doc.mjs +3 -3
- package/src/TabList/Tab.tsx +4 -0
- package/src/TabList/TabMenu.tsx +4 -0
- package/src/Table/BaseTable.tsx +35 -7
- package/src/Table/Table.doc.mjs +56 -6
- package/src/Table/Table.tsx +9 -4
- package/src/Table/TableHeaderCell.tsx +2 -8
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +10 -1
- package/src/Table/plugins/rowStatus/useTableRowStatus.tsx +5 -0
- package/src/Table/plugins/sortable/useTableSortable.tsx +41 -2
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +49 -20
- package/src/Table/tableColumnAdmission.ts +23 -0
- package/src/Table/types.ts +5 -5
- package/src/Table/useTableRowsVirtualization.doc.mjs +2 -2
- package/src/Text/Text.tsx +21 -7
- package/src/Text/TruncationTooltip.tsx +51 -184
- package/src/Text/cutText.tsx +126 -0
- package/src/Text/cutTextOnKeyboardFocus.tsx +158 -0
- package/src/Text/textClampContext.ts +14 -4
- package/src/Text/useTruncation.ts +85 -27
- package/src/TextArea/TextArea.doc.mjs +4 -4
- package/src/TextInput/TextInput.doc.mjs +3 -3
- package/src/Thumbnail/Thumbnail.tsx +1 -1
- package/src/TimeInput/TimeInput.tsx +3 -9
- package/src/TimeInput/TouchTimeField.tsx +6 -4
- package/src/Timestamp/Timestamp.tsx +29 -21
- package/src/Timestamp/TimestampHoverCard.tsx +44 -31
- package/src/Timestamp/formatInstant.ts +7 -3
- package/src/Timestamp/tooltipEntries.ts +4 -2
- package/src/Toast/Toast.doc.mjs +24 -37
- package/src/Toast/Toast.tsx +77 -29
- package/src/Toast/ToastViewport.tsx +33 -13
- package/src/Toast/useToast.tsx +42 -15
- package/src/Tokenizer/Tokenizer.doc.mjs +2 -2
- package/src/Tooltip/useTooltip.tsx +2 -1
- package/src/TopNav/TopNavMegaMenu.doc.mjs +13 -0
- package/src/TopNav/TopNavMenu.doc.mjs +2 -0
- package/src/Typeahead/Typeahead.doc.mjs +2 -2
- package/src/hooks/useAnnounceRenderedText.ts +15 -2
- package/src/hooks/useFocusTrap.ts +27 -4
- package/src/hooks/useHotkeys.doc.mjs +54 -11
- package/src/hooks/useHotkeys.ts +72 -3
- package/src/hooks/useInputStatusIcon.tsx +2 -1
- package/src/hooks/useKeyboardHint.tsx +3 -2
- package/src/i18n/generated-english/DateRangeInput/DateRangeInput.generated.ts +2 -0
- package/src/i18n/generated-english/MultiSelector/MultiSelector.generated.ts +1 -0
- package/src/i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.ts +0 -6
- package/src/i18n/generated-english/PowerSearch/relativeDateOptions.generated.ts +18 -0
- package/src/i18n/generated-english/Slider/Slider.generated.ts +1 -0
- package/src/i18n/generated-english/Thumbnail/Thumbnail.generated.ts +1 -0
- package/src/i18n/generated-locales/en.generated.ts +5 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +5 -0
- package/src/i18n/getLocaleDirection.ts +57 -7
- package/src/i18n/listFormat.ts +55 -0
- package/src/i18n/useListFormatter.ts +22 -13
- package/src/internal/module-loader.ts +15 -0
- package/src/motion/animatedLayout.ts +215 -28
- package/src/palette/color.ts +41 -1
- package/src/palette/derive-look.ts +1186 -0
- package/src/palette/editor-look.ts +480 -0
- package/src/palette/mapping.ts +129 -15
- package/src/theme/SyntaxTheme.doc.mjs +1 -1
- package/src/theme/tokens.ts +2 -1
- package/src/theme/useThemeName.doc.mjs +1 -1
- package/src/utils/characters.ts +11 -0
- package/src/utils/devWarning.ts +35 -0
- package/src/utils/focusReturn.ts +3 -11
- package/src/utils/hitArea.ts +87 -18
- package/src/utils/mergeProps.ts +57 -34
- package/src/utils/scrollView.ts +3 -2
- package/src/utils/textDirection.ts +65 -5
- package/src/utils/touchHitArea.ts +3 -2
- package/src/virtualization/useInlineListWindow.ts +102 -11
|
@@ -46,7 +46,7 @@ import { useInternalConfig } from "./useInternalConfig.js";
|
|
|
46
46
|
import { usePowerSearchSource } from "./usePowerSearchSource.js";
|
|
47
47
|
import { formatFilterValue } from "./formatFilterValue.js";
|
|
48
48
|
import { NestedEditor, PowerSearchEditPopover } from "./PowerSearchEditPopover.js";
|
|
49
|
-
import {
|
|
49
|
+
import { PowerSearchValueEditor } from "./PowerSearchValueEditor.js";
|
|
50
50
|
import { resolveOperatorLabel } from "./resolveOperatorLabel.js";
|
|
51
51
|
import { pickDataAttributes, themeProps } from "../utils/themeProps.js";
|
|
52
52
|
import { useLocale } from "../i18n/useLocale.js";
|
|
@@ -150,8 +150,7 @@ const LazyPowerSearchBottomSheet = /*#__PURE__*/lazy(async () => loadPowerSearch
|
|
|
150
150
|
// module already loads; see PowerSearchSheetEditors.
|
|
151
151
|
const SHEET_EDITORS = {
|
|
152
152
|
NestedEditor,
|
|
153
|
-
PowerSearchValueEditor
|
|
154
|
-
buildRelativeDateOptions
|
|
153
|
+
PowerSearchValueEditor
|
|
155
154
|
};
|
|
156
155
|
|
|
157
156
|
/**
|
|
@@ -416,7 +415,7 @@ export function PowerSearch({
|
|
|
416
415
|
const fieldLabel = field?.label ?? filter.field;
|
|
417
416
|
const operatorLabel = operator ? resolveOperatorLabel(operator, t) : '';
|
|
418
417
|
const label = formatTokenLabel(t, fieldLabel, operatorLabel);
|
|
419
|
-
const value = operator ? formatTokenValueText(operator.value, filter.value, Math.max(maxTokenLength - fieldLabel.length - operatorLabel.length, 10), locale, calendar,
|
|
418
|
+
const value = operator ? formatTokenValueText(operator.value, filter.value, Math.max(maxTokenLength - fieldLabel.length - operatorLabel.length, 10), locale, calendar, t, timezoneID) : null;
|
|
420
419
|
return {
|
|
421
420
|
label,
|
|
422
421
|
value,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
import React, { type RefObject } from 'react';
|
|
39
39
|
import type { SearchSource } from '../Typeahead/types.js';
|
|
40
|
-
import type {
|
|
40
|
+
import type { PowerSearchValueEditor } from './PowerSearchValueEditor.js';
|
|
41
41
|
import type { NestedEditor } from './PowerSearchEditPopover.js';
|
|
42
42
|
import type { InternalConfig } from './useInternalConfig.js';
|
|
43
43
|
import type { PowerSearchChangeType, PowerSearchComponents, PowerSearchConfig, PowerSearchFilter, PowerSearchItem } from './types.js';
|
|
@@ -51,7 +51,6 @@ import type { PowerSearchChangeType, PowerSearchComponents, PowerSearchConfig, P
|
|
|
51
51
|
export interface PowerSearchSheetEditors {
|
|
52
52
|
NestedEditor: typeof NestedEditor;
|
|
53
53
|
PowerSearchValueEditor: typeof PowerSearchValueEditor;
|
|
54
|
-
buildRelativeDateOptions: typeof buildRelativeDateOptions;
|
|
55
54
|
}
|
|
56
55
|
export interface PowerSearchBottomSheetProps {
|
|
57
56
|
/** Whether the flow is open; the trigger in PowerSearch.tsx owns it. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchBottomSheet.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchBottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAmBf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchBottomSheet.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchBottomSheet.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,KAAK,EAAE,EASZ,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAmBf,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAqBrD,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,0BAA0B,CAAC;AAErE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAe3D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAIV,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EAEjB,iBAAiB,EACjB,eAAe,EAEhB,MAAM,SAAS,CAAC;AAajB;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,sBAAsB,EAAE,OAAO,sBAAsB,CAAC;CACvD;AAED,MAAM,WAAW,2BAA2B;IAC1C,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC;;;OAGG;IACH,aAAa,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,yEAAyE;IACzE,UAAU,EAAE,iBAAiB,CAAC;IAC9B,yEAAyE;IACzE,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,EAAE,CACR,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,KACV,IAAI,CAAC;IACV,4EAA4E;IAC5E,YAAY,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC5C,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAMD,kJAAkJ;AAClJ,UAAU,SAAS;IACjB,MAAM,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACzC,KAAK,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IACxC,UAAU,EAAE,qBAAqB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAwCD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACtC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAC/B,MAAM,EAAE,CACN,OAAO,EAAE,aAAa,CAAC,iBAAiB,CAAC,EACzC,UAAU,EAAE,qBAAqB,EACjC,KAAK,EAAE,MAAM,KACV,IAAI,GACR,aAAa,CAAC,iBAAiB,CAAC,CA+ClC;AA0eD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,YAAY,EACZ,aAAa,EACb,eAAe,EACf,MAAM,EACN,UAAU,EACV,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,eAAe,EAAE,wBAAwB,EACzC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,GACR,EAAE,2BAA2B,qBAyqD7B;yBA7rDe,sBAAsB"}
|
|
@@ -59,7 +59,7 @@ import { CheckboxListItem } from "../CheckboxList/CheckboxListItem.js";
|
|
|
59
59
|
import { Text } from "../Text/Text.js";
|
|
60
60
|
import { TextInput } from "../TextInput/TextInput.js";
|
|
61
61
|
import { useAnnounce } from "../hooks/useAnnounce.js";
|
|
62
|
-
import {
|
|
62
|
+
import { useCommittedRef } from "../hooks/useCommittedRef.js";
|
|
63
63
|
import { useLocale } from "../i18n/useLocale.js";
|
|
64
64
|
import { useCalendarSystem } from "../i18n/useCalendarSystem.js";
|
|
65
65
|
import { SheetConfirmation } from "../internal/SheetConfirmation.js";
|
|
@@ -69,14 +69,12 @@ import { colorVars, fontWeightVars, radiusVars, spacingVars } from "../theme/tok
|
|
|
69
69
|
import { isImeKeyEvent } from "../utils/ime.js";
|
|
70
70
|
import { rtlStyles } from "../utils/rtlStyles.js";
|
|
71
71
|
import { formatTokenValueText } from "./formatTokenValue.js";
|
|
72
|
-
function resolveRelativeDateLabel(operatorValue, value, t, buildRelativeDateOptions) {
|
|
73
|
-
return buildRelativeDateOptions(operatorValue, t).find(option => option.value === value)?.label ?? value;
|
|
74
|
-
}
|
|
75
72
|
|
|
76
73
|
// A placeholder the Filters row formats `labelValue` with, then splits on, so
|
|
77
74
|
// the value segment can render bold inside the catalog's ordering. A private
|
|
78
75
|
// use code point: never part of a label or value.
|
|
79
76
|
const ROW_VALUE_SLOT = '\uE000';
|
|
77
|
+
import { buildRelativeDateOptions } from "./relativeDateOptions.js";
|
|
80
78
|
import { useAnnounceRenderedText } from "../hooks/useAnnounceRenderedText.js";
|
|
81
79
|
import { useInternalListFocus } from "../hooks/useListFocus.js";
|
|
82
80
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
@@ -386,7 +384,6 @@ function SheetValueEditor({
|
|
|
386
384
|
editors
|
|
387
385
|
}) {
|
|
388
386
|
const {
|
|
389
|
-
buildRelativeDateOptions,
|
|
390
387
|
PowerSearchValueEditor
|
|
391
388
|
} = editors;
|
|
392
389
|
const t = useComponentTranslator();
|
|
@@ -502,7 +499,6 @@ export function PowerSearchBottomSheet({
|
|
|
502
499
|
const t = useComponentTranslator();
|
|
503
500
|
const locale = useLocale();
|
|
504
501
|
const calendar = useCalendarSystem(undefined, 'PowerSearch');
|
|
505
|
-
const formatList = useListFormatter();
|
|
506
502
|
const isInteractive = !isDisabled && !isReadOnly;
|
|
507
503
|
|
|
508
504
|
// ---- draft ----
|
|
@@ -575,9 +571,8 @@ export function PowerSearchBottomSheet({
|
|
|
575
571
|
}, []);
|
|
576
572
|
const managerRowsRef = useRef(new Map());
|
|
577
573
|
const fieldRowsRef = useRef(new Map());
|
|
578
|
-
const latestFiltersRef =
|
|
574
|
+
const latestFiltersRef = useCommittedRef(filters);
|
|
579
575
|
const pendingSheetFocusRef = useRef(null);
|
|
580
|
-
const pendingMutationFocusRef = useRef(false);
|
|
581
576
|
|
|
582
577
|
// The step an open starts on: Add filter directly when an interactive field
|
|
583
578
|
// has nothing to manage yet, otherwise Filters. Neither search field takes
|
|
@@ -587,8 +582,8 @@ export function PowerSearchBottomSheet({
|
|
|
587
582
|
const isEntryAddFilter = filters.length === 0 && isInteractive;
|
|
588
583
|
const [step, setStep] = useState(() => isOpen ? isEntryAddFilter ? 'fields' : 'manage' : null);
|
|
589
584
|
const [fieldPickerOrigin, setFieldPickerOrigin] = useState(() => isOpen && isEntryAddFilter ? 'trigger' : 'manage');
|
|
590
|
-
// The current step, read by the sheets' close reports and by
|
|
591
|
-
//
|
|
585
|
+
// The current step, read by the sheets' close reports and by the discard
|
|
586
|
+
// confirmation's close.
|
|
592
587
|
const stepRef = useRef(step);
|
|
593
588
|
useLayoutEffect(() => {
|
|
594
589
|
stepRef.current = step;
|
|
@@ -611,9 +606,9 @@ export function PowerSearchBottomSheet({
|
|
|
611
606
|
// caller, and this component renders above the
|
|
612
607
|
// sheets, so it cannot call the hook itself. Each step's body renders a
|
|
613
608
|
// `SheetAnnouncer` inside its BottomSheet, which publishes the dialog's own
|
|
614
|
-
// `announce` here while that step is the active one; the
|
|
615
|
-
//
|
|
616
|
-
//
|
|
609
|
+
// `announce` here while that step is the active one; the handlers speak
|
|
610
|
+
// through it, so every message about a sheet's content is delivered in
|
|
611
|
+
// that sheet's dialog.
|
|
617
612
|
const announceRef = useRef(null);
|
|
618
613
|
const handleAnnounceChange = useCallback(next => {
|
|
619
614
|
announceRef.current = next;
|
|
@@ -621,7 +616,6 @@ export function PowerSearchBottomSheet({
|
|
|
621
616
|
const announce = useCallback(message => {
|
|
622
617
|
announceRef.current?.(message);
|
|
623
618
|
}, []);
|
|
624
|
-
const pendingAnnouncementRef = useRef(null);
|
|
625
619
|
|
|
626
620
|
// The controlled `isOpen` opens and closes the flow; the step follows it in
|
|
627
621
|
// the render that sees the change, not an effect, so the entry step's sheet
|
|
@@ -651,6 +645,7 @@ export function PowerSearchBottomSheet({
|
|
|
651
645
|
}
|
|
652
646
|
const closeFlow = useCallback(() => {
|
|
653
647
|
pendingSheetFocusRef.current = null;
|
|
648
|
+
stepReturnTargetRef.current = null;
|
|
654
649
|
setStep(null);
|
|
655
650
|
onOpenChange(false);
|
|
656
651
|
}, [onOpenChange]);
|
|
@@ -697,11 +692,15 @@ export function PowerSearchBottomSheet({
|
|
|
697
692
|
// receives it even when the first move could not land. With no control
|
|
698
693
|
// named, the closing steps return focus as the flow does.
|
|
699
694
|
const stepReturnTargetRef = useRef(null);
|
|
695
|
+
// A flow that closed, however it closed, returns focus as the flow does:
|
|
696
|
+
// a target named before the close never carries past it.
|
|
697
|
+
const isFlowOpenRef = useCommittedRef(step != null);
|
|
700
698
|
const stepFinalFocusRef = useMemo(() => ({
|
|
701
699
|
get current() {
|
|
702
|
-
|
|
700
|
+
const named = stepReturnTargetRef.current;
|
|
701
|
+
return isFlowOpenRef.current && named?.isConnected === true ? named : finalFocusRef.current;
|
|
703
702
|
}
|
|
704
|
-
}), [finalFocusRef]);
|
|
703
|
+
}), [finalFocusRef, isFlowOpenRef]);
|
|
705
704
|
const placeFocus = element => {
|
|
706
705
|
if (element == null) {
|
|
707
706
|
return;
|
|
@@ -745,15 +744,43 @@ export function PowerSearchBottomSheet({
|
|
|
745
744
|
const row = index == null ? null : managerRowsRef.current.get(index);
|
|
746
745
|
const rowButton = target.part === 'remove' ? row?.querySelector('[data-sheet-remove]') ?? row?.querySelector('button') : row?.querySelector('button');
|
|
747
746
|
placeFocus(rowButton ?? managerAddButtonRef.current);
|
|
748
|
-
}, [isRowButton]);
|
|
747
|
+
}, [isRowButton, latestFiltersRef]);
|
|
748
|
+
|
|
749
|
+
// Every step change goes through this, from the handler of the action that
|
|
750
|
+
// caused it, so its words are spoken once and focus moves once. The update
|
|
751
|
+
// is flushed, so the entering sheet is open, and then focus moves to the
|
|
752
|
+
// control the change named. A step that opens starts with no named return
|
|
753
|
+
// target; a return to Filters keeps the one it names.
|
|
754
|
+
const changeStep = useCallback((next, {
|
|
755
|
+
focus = null,
|
|
756
|
+
announcement,
|
|
757
|
+
update
|
|
758
|
+
} = {}) => {
|
|
759
|
+
pendingSheetFocusRef.current = focus;
|
|
760
|
+
if (next !== 'manage') {
|
|
761
|
+
stepReturnTargetRef.current = null;
|
|
762
|
+
}
|
|
763
|
+
// The words go to the dialog of the step the person acted in. When
|
|
764
|
+
// that step leaves, its dialog hands words not yet heard to the
|
|
765
|
+
// dialog that shows next; when it stays, they are spoken in it.
|
|
766
|
+
if (announcement != null) {
|
|
767
|
+
announce(announcement);
|
|
768
|
+
}
|
|
769
|
+
// eslint-disable-next-line @eslint-react/dom-no-flush-sync -- the entering sheet must be open before focus moves into it
|
|
770
|
+
flushSync(() => {
|
|
771
|
+
update?.();
|
|
772
|
+
setStep(next);
|
|
773
|
+
});
|
|
774
|
+
focusPendingSheetTarget();
|
|
775
|
+
}, [announce, focusPendingSheetTarget]);
|
|
749
776
|
|
|
750
777
|
// A controlled update that unmounts the focused control of the Filters or
|
|
751
778
|
// Add filter sheet leaves focus on the page body inside the open modal.
|
|
752
779
|
// Read before paint on every commit of an open step: when focus is no
|
|
753
780
|
// longer inside the sheet's dialog, the nearest remaining row by the last
|
|
754
781
|
// focused index takes it, else the sheet's first control, else its panel.
|
|
755
|
-
//
|
|
756
|
-
//
|
|
782
|
+
// A step change's handler moves focus after its flushed commit, so the
|
|
783
|
+
// control it names wins over this repair.
|
|
757
784
|
useLayoutEffect(() => {
|
|
758
785
|
const last = lastSheetFocusRef.current;
|
|
759
786
|
if (step !== 'manage' && step !== 'fields') {
|
|
@@ -787,49 +814,6 @@ export function PowerSearchBottomSheet({
|
|
|
787
814
|
}
|
|
788
815
|
});
|
|
789
816
|
|
|
790
|
-
// Both Effects move focus inside the entering sheet — the external system
|
|
791
|
-
// is the document's focus — to the control the step named. They run after
|
|
792
|
-
// the entering sheet's own
|
|
793
|
-
// panel focus (child effects commit first), so the intended control wins,
|
|
794
|
-
// and they acquire nothing, so they need no cleanup. The filters effect is
|
|
795
|
-
// declared first so a mutation that lands in the same commit as the step
|
|
796
|
-
// change resolves its row against the new filters.
|
|
797
|
-
useEffect(() => {
|
|
798
|
-
latestFiltersRef.current = filters;
|
|
799
|
-
if (step === 'manage' && pendingMutationFocusRef.current) {
|
|
800
|
-
pendingMutationFocusRef.current = false;
|
|
801
|
-
focusPendingSheetTarget();
|
|
802
|
-
}
|
|
803
|
-
}, [filters, focusPendingSheetTarget, step]);
|
|
804
|
-
|
|
805
|
-
// A target still pending when the flow closes, such as a commit that
|
|
806
|
-
// disabled the field, never carries into the next open.
|
|
807
|
-
useEffect(() => {
|
|
808
|
-
if (step == null) {
|
|
809
|
-
stepReturnTargetRef.current = null;
|
|
810
|
-
pendingSheetFocusRef.current = null;
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
// A step that opens starts with no named return target; a return to
|
|
814
|
-
// Filters keeps the one its commit, or its removal, has just named.
|
|
815
|
-
if (step !== 'manage') {
|
|
816
|
-
stepReturnTargetRef.current = null;
|
|
817
|
-
}
|
|
818
|
-
focusPendingSheetTarget();
|
|
819
|
-
}, [focusPendingSheetTarget, step]);
|
|
820
|
-
|
|
821
|
-
// An announcement queued by a step change — a suggestion or a removal that
|
|
822
|
-
// changed the filters — is spoken in the commit that shows the next step,
|
|
823
|
-
// so it lands in that step's dialog region rather than the one about to
|
|
824
|
-
// close. It synchronizes the live region named above and acquires nothing.
|
|
825
|
-
useEffect(() => {
|
|
826
|
-
const message = pendingAnnouncementRef.current;
|
|
827
|
-
if (step != null && message != null) {
|
|
828
|
-
pendingAnnouncementRef.current = null;
|
|
829
|
-
announce(message);
|
|
830
|
-
}
|
|
831
|
-
}, [announce, step]);
|
|
832
|
-
|
|
833
817
|
// ----------------------------------------------------------------- fields --
|
|
834
818
|
|
|
835
819
|
// Every visible field lists: the value step edits every operator's value,
|
|
@@ -926,16 +910,12 @@ export function PowerSearchBottomSheet({
|
|
|
926
910
|
value: null
|
|
927
911
|
};
|
|
928
912
|
}
|
|
929
|
-
|
|
930
|
-
// as the value step's choice row does ("3 days ago"), through the
|
|
931
|
-
// catalog's relative-date messages, so the sheet agrees with itself. The popover token
|
|
932
|
-
// shows the stored key (a known gap of the record).
|
|
933
|
-
const value = operator.value.type === 'date_relative' && filter.value.type === 'date_relative' ? resolveRelativeDateLabel(operator.value, filter.value.value, t, editors.buildRelativeDateOptions) : formatTokenValueText(operator.value, filter.value, Number.MAX_SAFE_INTEGER, locale, calendar, t, formatList, timezoneID);
|
|
913
|
+
const value = formatTokenValueText(operator.value, filter.value, Number.MAX_SAFE_INTEGER, locale, calendar, t, timezoneID);
|
|
934
914
|
return {
|
|
935
915
|
label,
|
|
936
916
|
value
|
|
937
917
|
};
|
|
938
|
-
}, [calendar, config,
|
|
918
|
+
}, [calendar, config, locale, t, timezoneID]);
|
|
939
919
|
const describeFilter = useCallback(filter => {
|
|
940
920
|
const parts = describeFilterParts(filter);
|
|
941
921
|
return parts.value ? t('@astryx.powersearch.sheet.labelValue', {
|
|
@@ -947,21 +927,21 @@ export function PowerSearchBottomSheet({
|
|
|
947
927
|
if (!isInteractive) {
|
|
948
928
|
return;
|
|
949
929
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
type: 'manager-add'
|
|
959
|
-
};
|
|
960
|
-
}, []);
|
|
930
|
+
changeStep('fields', {
|
|
931
|
+
update: () => {
|
|
932
|
+
setFieldPickerOrigin('manage');
|
|
933
|
+
setFieldQuery('');
|
|
934
|
+
setContentQuery('');
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
}, [changeStep, isInteractive]);
|
|
961
938
|
const commitSavedFilter = useCallback((next, filter) => {
|
|
962
939
|
if (!isInteractive) {
|
|
963
|
-
|
|
964
|
-
|
|
940
|
+
changeStep('manage', {
|
|
941
|
+
focus: {
|
|
942
|
+
type: 'manager-add'
|
|
943
|
+
}
|
|
944
|
+
});
|
|
965
945
|
return;
|
|
966
946
|
}
|
|
967
947
|
if (next.mode === 'edit') {
|
|
@@ -972,38 +952,44 @@ export function PowerSearchBottomSheet({
|
|
|
972
952
|
// could be, or made it read-only: nothing is written, and focus
|
|
973
953
|
// returns to the nearest row that is a button around where it was,
|
|
974
954
|
// else Add filter.
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
955
|
+
changeStep('manage', {
|
|
956
|
+
focus: next.sourceFilter != null && next.sourceSignature != null && next.filterIndex != null ? {
|
|
957
|
+
type: 'manager-filter',
|
|
958
|
+
sourceFilter: next.sourceFilter,
|
|
959
|
+
sourceSignature: next.sourceSignature,
|
|
960
|
+
preferredIndex: next.filterIndex
|
|
961
|
+
} : {
|
|
962
|
+
type: 'manager-add'
|
|
963
|
+
}
|
|
964
|
+
});
|
|
984
965
|
return;
|
|
985
966
|
}
|
|
986
|
-
pendingSheetFocusRef.current = {
|
|
987
|
-
type: 'manager-filter',
|
|
988
|
-
sourceFilter: filter,
|
|
989
|
-
sourceSignature: filterSignature(filter),
|
|
990
|
-
preferredIndex: filterIndex
|
|
991
|
-
};
|
|
992
967
|
const updated = [...filters];
|
|
993
968
|
updated[filterIndex] = filter;
|
|
994
|
-
|
|
969
|
+
changeStep('manage', {
|
|
970
|
+
focus: {
|
|
971
|
+
type: 'manager-filter',
|
|
972
|
+
sourceFilter: filter,
|
|
973
|
+
sourceSignature: filterSignature(filter),
|
|
974
|
+
preferredIndex: filterIndex
|
|
975
|
+
},
|
|
976
|
+
update: () => onChange(updated, 'edit', filterIndex)
|
|
977
|
+
});
|
|
995
978
|
} else {
|
|
996
|
-
|
|
997
|
-
|
|
979
|
+
changeStep('manage', {
|
|
980
|
+
focus: {
|
|
981
|
+
type: 'manager-add'
|
|
982
|
+
},
|
|
983
|
+
update: () => onChange([...filters, filter], 'add', filters.length)
|
|
984
|
+
});
|
|
998
985
|
}
|
|
999
|
-
|
|
1000
|
-
}, [filters, isInteractive, onChange, queueManagerAddFocus]);
|
|
986
|
+
}, [changeStep, filters, isInteractive, onChange]);
|
|
1001
987
|
|
|
1002
988
|
// Opening a new filter can come from a field row or a content-search
|
|
1003
989
|
// suggestion. The origin is kept so Cancel returns to the control the person
|
|
1004
990
|
// came from.
|
|
1005
991
|
const openCreateEditor = useCallback((field, operator, returnFocus = 'field') => {
|
|
1006
|
-
|
|
992
|
+
const nextDraft = {
|
|
1007
993
|
mode: 'create',
|
|
1008
994
|
generation: nextDraftGeneration(),
|
|
1009
995
|
returnFocus,
|
|
@@ -1012,10 +998,11 @@ export function PowerSearchBottomSheet({
|
|
|
1012
998
|
value: operator.value.type === 'empty' ? {
|
|
1013
999
|
type: 'empty'
|
|
1014
1000
|
} : undefined
|
|
1001
|
+
};
|
|
1002
|
+
changeStep('value', {
|
|
1003
|
+
update: () => setDraft(nextDraft)
|
|
1015
1004
|
});
|
|
1016
|
-
|
|
1017
|
-
setStep('value');
|
|
1018
|
-
}, [nextDraftGeneration]);
|
|
1005
|
+
}, [changeStep, nextDraftGeneration]);
|
|
1019
1006
|
const handleFieldSelect = useCallback(field => {
|
|
1020
1007
|
if (!isInteractive) {
|
|
1021
1008
|
return;
|
|
@@ -1031,18 +1018,18 @@ export function PowerSearchBottomSheet({
|
|
|
1031
1018
|
type: 'empty'
|
|
1032
1019
|
}
|
|
1033
1020
|
};
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1021
|
+
changeStep('manage', {
|
|
1022
|
+
focus: {
|
|
1023
|
+
type: 'manager-filter',
|
|
1024
|
+
sourceFilter: nextFilter,
|
|
1025
|
+
sourceSignature: filterSignature(nextFilter),
|
|
1026
|
+
preferredIndex: filters.length
|
|
1027
|
+
},
|
|
1028
|
+
announcement: t('@astryx.tokenizer.tokenAdded', {
|
|
1029
|
+
label: describeFilter(nextFilter)
|
|
1030
|
+
}),
|
|
1031
|
+
update: () => onChange([...filters, nextFilter], 'add', filters.length)
|
|
1044
1032
|
});
|
|
1045
|
-
setStep('manage');
|
|
1046
1033
|
return;
|
|
1047
1034
|
}
|
|
1048
1035
|
const operator = config.getDefaultOperator(field.key) ?? field.operators[0];
|
|
@@ -1050,7 +1037,7 @@ export function PowerSearchBottomSheet({
|
|
|
1050
1037
|
return;
|
|
1051
1038
|
}
|
|
1052
1039
|
openCreateEditor(field, operator);
|
|
1053
|
-
}, [config, describeFilter, filters, isImmediateAddField, isInteractive, onChange, openCreateEditor, t]);
|
|
1040
|
+
}, [changeStep, config, describeFilter, filters, isImmediateAddField, isInteractive, onChange, openCreateEditor, t]);
|
|
1054
1041
|
const handleContentSuggestionSelect = useCallback(item => {
|
|
1055
1042
|
if (!isInteractive || item?.auxiliaryData == null) {
|
|
1056
1043
|
return;
|
|
@@ -1072,31 +1059,31 @@ export function PowerSearchBottomSheet({
|
|
|
1072
1059
|
operator: operator.key,
|
|
1073
1060
|
value: filterValue
|
|
1074
1061
|
};
|
|
1075
|
-
pendingSheetFocusRef.current = {
|
|
1076
|
-
type: 'manager-filter',
|
|
1077
|
-
sourceFilter: nextFilter,
|
|
1078
|
-
sourceSignature: filterSignature(nextFilter),
|
|
1079
|
-
preferredIndex: filters.length
|
|
1080
|
-
};
|
|
1081
|
-
pendingMutationFocusRef.current = true;
|
|
1082
|
-
onChange([...filters, nextFilter], 'add', filters.length);
|
|
1083
1062
|
// The same announcement the popover presentation's typeahead add
|
|
1084
1063
|
// makes, so assistive technology hears one phrase for one outcome;
|
|
1085
1064
|
// spoken once the Filters sheet is the open dialog.
|
|
1086
|
-
|
|
1087
|
-
|
|
1065
|
+
changeStep('manage', {
|
|
1066
|
+
focus: {
|
|
1067
|
+
type: 'manager-filter',
|
|
1068
|
+
sourceFilter: nextFilter,
|
|
1069
|
+
sourceSignature: filterSignature(nextFilter),
|
|
1070
|
+
preferredIndex: filters.length
|
|
1071
|
+
},
|
|
1072
|
+
announcement: t('@astryx.tokenizer.tokenAdded', {
|
|
1073
|
+
label: item.label
|
|
1074
|
+
}),
|
|
1075
|
+
update: () => onChange([...filters, nextFilter], 'add', filters.length)
|
|
1088
1076
|
});
|
|
1089
|
-
setStep('manage');
|
|
1090
1077
|
return;
|
|
1091
1078
|
}
|
|
1092
1079
|
openCreateEditor(field, operator, 'content-search');
|
|
1093
|
-
}, [config, filters, isInteractive, onChange, openCreateEditor, t]);
|
|
1080
|
+
}, [changeStep, config, filters, isInteractive, onChange, openCreateEditor, t]);
|
|
1094
1081
|
const handleFilterEdit = useCallback(index => {
|
|
1095
1082
|
const filter = filters[index];
|
|
1096
1083
|
if (!isInteractive || filter == null || filter.isReadOnly) {
|
|
1097
1084
|
return;
|
|
1098
1085
|
}
|
|
1099
|
-
|
|
1086
|
+
const nextDraft = {
|
|
1100
1087
|
mode: 'edit',
|
|
1101
1088
|
generation: nextDraftGeneration(),
|
|
1102
1089
|
filterIndex: index,
|
|
@@ -1105,10 +1092,15 @@ export function PowerSearchBottomSheet({
|
|
|
1105
1092
|
field: filter.field,
|
|
1106
1093
|
operator: filter.operator,
|
|
1107
1094
|
value: filter.value
|
|
1095
|
+
};
|
|
1096
|
+
changeStep('value', {
|
|
1097
|
+
update: () => setDraft(nextDraft)
|
|
1108
1098
|
});
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1099
|
+
}, [changeStep, filters, isInteractive, nextDraftGeneration]);
|
|
1100
|
+
|
|
1101
|
+
// The popover's token × announces the same phrase. The words are spoken in
|
|
1102
|
+
// the Filters sheet's dialog, also when a caller's Editor removes the filter
|
|
1103
|
+
// from the value step.
|
|
1112
1104
|
const handleRemoveFilter = useCallback(index => {
|
|
1113
1105
|
const filter = filters[index];
|
|
1114
1106
|
if (!isInteractive || filter == null || filter.isReadOnly) {
|
|
@@ -1116,35 +1108,23 @@ export function PowerSearchBottomSheet({
|
|
|
1116
1108
|
}
|
|
1117
1109
|
const nextFilters = filters.filter((_, i) => i !== index);
|
|
1118
1110
|
const nextIndex = nearestEditableIndex(nextFilters, index, isRowButton);
|
|
1119
|
-
|
|
1120
|
-
|
|
1111
|
+
const nextFilter = nextIndex == null ? undefined : nextFilters[nextIndex];
|
|
1112
|
+
changeStep('manage', {
|
|
1113
|
+
focus: nextIndex == null || nextFilter == null ? {
|
|
1121
1114
|
type: 'manager-add'
|
|
1122
|
-
}
|
|
1123
|
-
} else {
|
|
1124
|
-
const nextFilter = nextFilters[nextIndex];
|
|
1125
|
-
pendingSheetFocusRef.current = {
|
|
1115
|
+
} : {
|
|
1126
1116
|
type: 'manager-filter',
|
|
1127
1117
|
sourceFilter: nextFilter,
|
|
1128
1118
|
sourceSignature: filterSignature(nextFilter),
|
|
1129
1119
|
preferredIndex: nextIndex,
|
|
1130
1120
|
part: 'remove'
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
// removal from a Filters row stays in that sheet and speaks at once; a
|
|
1137
|
-
// caller's Editor that removes while returning to Filters speaks once
|
|
1138
|
-
// the Filters sheet is the open dialog.
|
|
1139
|
-
const message = t('@astryx.tokenizer.tokenRemoved', {
|
|
1140
|
-
label: describeFilter(filter)
|
|
1121
|
+
},
|
|
1122
|
+
announcement: t('@astryx.tokenizer.tokenRemoved', {
|
|
1123
|
+
label: describeFilter(filter)
|
|
1124
|
+
}),
|
|
1125
|
+
update: () => onChange(nextFilters, 'remove', index)
|
|
1141
1126
|
});
|
|
1142
|
-
|
|
1143
|
-
announce(message);
|
|
1144
|
-
} else {
|
|
1145
|
-
pendingAnnouncementRef.current = message;
|
|
1146
|
-
}
|
|
1147
|
-
}, [announce, describeFilter, filters, isInteractive, isRowButton, onChange, t]);
|
|
1127
|
+
}, [changeStep, describeFilter, filters, isInteractive, isRowButton, onChange, t]);
|
|
1148
1128
|
|
|
1149
1129
|
// Closing Clear all's confirmation. Kept, focus returns to Clear all.
|
|
1150
1130
|
// Confirmed, Clear all removes the filters the person can edit and keeps
|
|
@@ -1220,46 +1200,48 @@ export function PowerSearchBottomSheet({
|
|
|
1220
1200
|
}, [commitSavedFilter, draft]);
|
|
1221
1201
|
const returnFromValue = useCallback(() => {
|
|
1222
1202
|
if (draft == null) {
|
|
1223
|
-
|
|
1224
|
-
|
|
1203
|
+
changeStep('manage', {
|
|
1204
|
+
focus: {
|
|
1205
|
+
type: 'manager-add'
|
|
1206
|
+
}
|
|
1207
|
+
});
|
|
1225
1208
|
return;
|
|
1226
1209
|
}
|
|
1227
1210
|
if (draft.mode === 'edit' && draft.sourceFilter != null && draft.sourceSignature != null && draft.filterIndex != null) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1211
|
+
changeStep('manage', {
|
|
1212
|
+
focus: {
|
|
1213
|
+
type: 'manager-filter',
|
|
1214
|
+
sourceFilter: draft.sourceFilter,
|
|
1215
|
+
sourceSignature: draft.sourceSignature,
|
|
1216
|
+
preferredIndex: resolveDraftFilterIndex(filters, draft) ?? draft.filterIndex
|
|
1217
|
+
}
|
|
1218
|
+
});
|
|
1235
1219
|
return;
|
|
1236
1220
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1221
|
+
changeStep('fields', {
|
|
1222
|
+
focus: draft.returnFocus === 'content-search' ? {
|
|
1239
1223
|
type: 'content-search'
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
fieldKey: draft.field
|
|
1247
|
-
};
|
|
1248
|
-
setStep('fields');
|
|
1249
|
-
}, [draft, filters, queueManagerAddFocus]);
|
|
1224
|
+
} : {
|
|
1225
|
+
type: 'field',
|
|
1226
|
+
fieldKey: draft.field
|
|
1227
|
+
}
|
|
1228
|
+
});
|
|
1229
|
+
}, [changeStep, draft, filters]);
|
|
1250
1230
|
const handleRemove = useCallback(() => {
|
|
1251
1231
|
if (draft?.mode !== 'edit') {
|
|
1252
1232
|
return;
|
|
1253
1233
|
}
|
|
1254
1234
|
const filterIndex = resolveDraftFilterIndex(filters, draft);
|
|
1255
1235
|
if (filterIndex == null || filters[filterIndex]?.isReadOnly) {
|
|
1256
|
-
|
|
1257
|
-
|
|
1236
|
+
changeStep('manage', {
|
|
1237
|
+
focus: {
|
|
1238
|
+
type: 'manager-add'
|
|
1239
|
+
}
|
|
1240
|
+
});
|
|
1258
1241
|
return;
|
|
1259
1242
|
}
|
|
1260
1243
|
handleRemoveFilter(filterIndex);
|
|
1261
|
-
|
|
1262
|
-
}, [draft, filters, handleRemoveFilter, queueManagerAddFocus]);
|
|
1244
|
+
}, [changeStep, draft, filters, handleRemoveFilter]);
|
|
1263
1245
|
|
|
1264
1246
|
// Each step sheet is controlled by `step`; a sheet only ever asks to close
|
|
1265
1247
|
// (a dismissal its `purpose` allows: Escape, the scrim, a swipe, a platform
|
|
@@ -1280,9 +1262,12 @@ export function PowerSearchBottomSheet({
|
|
|
1280
1262
|
requestDismiss();
|
|
1281
1263
|
return;
|
|
1282
1264
|
}
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1265
|
+
changeStep('manage', {
|
|
1266
|
+
focus: {
|
|
1267
|
+
type: 'manager-add'
|
|
1268
|
+
}
|
|
1269
|
+
});
|
|
1270
|
+
}, [changeStep, fieldPickerOrigin, requestDismiss]);
|
|
1286
1271
|
const handleValueOpenChange = useCallback(isSheetOpen => {
|
|
1287
1272
|
if (!isSheetOpen && stepRef.current === 'value') {
|
|
1288
1273
|
returnFromValue();
|
|
@@ -1831,8 +1816,11 @@ export function PowerSearchBottomSheet({
|
|
|
1831
1816
|
if (draft.mode === 'edit') {
|
|
1832
1817
|
handleRemove();
|
|
1833
1818
|
} else {
|
|
1834
|
-
|
|
1835
|
-
|
|
1819
|
+
changeStep('manage', {
|
|
1820
|
+
focus: {
|
|
1821
|
+
type: 'manager-add'
|
|
1822
|
+
}
|
|
1823
|
+
});
|
|
1836
1824
|
}
|
|
1837
1825
|
return;
|
|
1838
1826
|
}
|