@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
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import type { OperatorValue, FilterValue } from './types.js';
|
|
15
15
|
import type { InternalConfig } from './useInternalConfig.js';
|
|
16
|
-
import type { TranslatorFn } from '../i18n/index.js';
|
|
17
16
|
export interface PowerSearchValueEditorProps {
|
|
18
17
|
operatorValue: OperatorValue;
|
|
19
18
|
filterValue: FilterValue | undefined;
|
|
@@ -43,16 +42,5 @@ export interface PowerSearchValueEditorProps {
|
|
|
43
42
|
/** The field's label; names the Tokenizer sheet in the sheet presentation. */
|
|
44
43
|
fieldLabel?: string;
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
* The relative-date choices an operator offers, in display order. Shared by
|
|
48
|
-
* the popover's Selector and the sheet presentation's rows so both list the
|
|
49
|
-
* same values. The labels are the catalog's ICU plural messages.
|
|
50
|
-
*/
|
|
51
|
-
export declare function buildRelativeDateOptions(operatorValue: OperatorValue & {
|
|
52
|
-
type: 'date_relative';
|
|
53
|
-
}, t: TranslatorFn): {
|
|
54
|
-
value: string;
|
|
55
|
-
label: string;
|
|
56
|
-
}[];
|
|
57
45
|
export declare function PowerSearchValueEditor({ operatorValue, filterValue, onChange, onEnter, maxMenuItems, isDisabled, onUnstage, presentation, fieldLabel, timezoneID, }: PowerSearchValueEditorProps): React.JSX.Element | null;
|
|
58
46
|
//# sourceMappingURL=PowerSearchValueEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAIZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"PowerSearchValueEditor.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/PowerSearchValueEditor.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,aAAa,EACb,WAAW,EAIZ,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAuCxD,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IAC1C,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAu3BD,wBAAgB,sBAAsB,CAAC,EACrC,aAAa,EACb,WAAW,EACX,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,UAAU,EACV,SAAS,EACT,YAAwB,EACxB,UAAU,EACV,UAAU,GACX,EAAE,2BAA2B,4BAwJ7B"}
|
|
@@ -32,6 +32,7 @@ import { Typeahead } from "../Typeahead/index.js";
|
|
|
32
32
|
import { useLocale } from "../i18n/index.js";
|
|
33
33
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
34
34
|
import english from "../i18n/generated-english/PowerSearch/PowerSearchValueEditor.generated.js";
|
|
35
|
+
import { buildRelativeDateOptions } from "./relativeDateOptions.js";
|
|
35
36
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
37
|
registerEnglishFallback(english);
|
|
37
38
|
// =============================================================================
|
|
@@ -459,57 +460,6 @@ function DateAbsoluteEditor({
|
|
|
459
460
|
width: presentation === 'bottom-sheet' ? '100%' : undefined
|
|
460
461
|
});
|
|
461
462
|
}
|
|
462
|
-
const RELATIVE_DATE_UNITS = [{
|
|
463
|
-
unit: 'day',
|
|
464
|
-
amounts: [1, 3, 7, 14, 30],
|
|
465
|
-
ago: '@astryx.powersearch.sheet.relativeDaysAgo',
|
|
466
|
-
fromNow: '@astryx.powersearch.sheet.relativeDaysFromNow'
|
|
467
|
-
}, {
|
|
468
|
-
unit: 'week',
|
|
469
|
-
amounts: [1, 2, 4],
|
|
470
|
-
ago: '@astryx.powersearch.sheet.relativeWeeksAgo',
|
|
471
|
-
fromNow: '@astryx.powersearch.sheet.relativeWeeksFromNow'
|
|
472
|
-
}, {
|
|
473
|
-
unit: 'month',
|
|
474
|
-
amounts: [1, 3, 6, 12],
|
|
475
|
-
ago: '@astryx.powersearch.sheet.relativeMonthsAgo',
|
|
476
|
-
fromNow: '@astryx.powersearch.sheet.relativeMonthsFromNow'
|
|
477
|
-
}];
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* The relative-date choices an operator offers, in display order. Shared by
|
|
481
|
-
* the popover's Selector and the sheet presentation's rows so both list the
|
|
482
|
-
* same values. The labels are the catalog's ICU plural messages.
|
|
483
|
-
*/
|
|
484
|
-
export function buildRelativeDateOptions(operatorValue, t) {
|
|
485
|
-
const result = [];
|
|
486
|
-
for (const {
|
|
487
|
-
unit,
|
|
488
|
-
amounts,
|
|
489
|
-
ago,
|
|
490
|
-
fromNow
|
|
491
|
-
} of RELATIVE_DATE_UNITS) {
|
|
492
|
-
for (const amount of amounts) {
|
|
493
|
-
if (operatorValue.isPastAllowed !== false) {
|
|
494
|
-
result.push({
|
|
495
|
-
value: `${amount}${unit[0]}_ago`,
|
|
496
|
-
label: t(ago, {
|
|
497
|
-
count: amount
|
|
498
|
-
})
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
if (operatorValue.isFutureAllowed !== false) {
|
|
502
|
-
result.push({
|
|
503
|
-
value: `${amount}${unit[0]}_from_now`,
|
|
504
|
-
label: t(fromNow, {
|
|
505
|
-
count: amount
|
|
506
|
-
})
|
|
507
|
-
});
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
return result;
|
|
512
|
-
}
|
|
513
463
|
function DateRelativeEditor({
|
|
514
464
|
operatorValue,
|
|
515
465
|
filterValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"formatFilterValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatFilterValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AA2BjC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,IAAI,CACZ,IAAI,CAAC,mBAAmB,EACxB,aAAa,GAAG,uBAAuB,CACxC,GACA,MAAM,CAER;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,UAAU,UAAO,EACjB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CAiBR;AASD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,CAAC,EAAE,YAAY,EACf,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,EACnB,QAAQ,GAAE,cAA0B,GACnC,MAAM,CAiIR"}
|
|
@@ -15,6 +15,8 @@ import { truncateCharacters } from "../utils/characters.js";
|
|
|
15
15
|
import { registerEnglishFallback } from "../i18n/englishFallback.js";
|
|
16
16
|
import english from "../i18n/generated-english/PowerSearch/formatFilterValue.generated.js";
|
|
17
17
|
import { resolveDateZone } from "./powerSearchDateZone.js";
|
|
18
|
+
import { relativeDateLabel } from "./relativeDateOptions.js";
|
|
19
|
+
import { createListFormatter } from "../i18n/listFormat.js";
|
|
18
20
|
registerEnglishFallback(english);
|
|
19
21
|
function truncate(str, maxLength) {
|
|
20
22
|
return truncateCharacters(str, maxLength);
|
|
@@ -60,10 +62,6 @@ export function formatDateAbsolute(unixSeconds, locale, timezoneID, isDateOnly =
|
|
|
60
62
|
};
|
|
61
63
|
return formatCalendarInstant(calendar, new Date(unixSeconds * 1000), options, locale, resolveDateZone(timezoneID, isDateOnly));
|
|
62
64
|
}
|
|
63
|
-
function formatRelativeDate(value) {
|
|
64
|
-
// value is stored as a descriptive string like "7d" or "1w"
|
|
65
|
-
return value;
|
|
66
|
-
}
|
|
67
65
|
function formatDateRange(_value, t) {
|
|
68
66
|
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
69
67
|
}
|
|
@@ -97,7 +95,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
97
95
|
if (items.length === 1) {
|
|
98
96
|
return truncate(items[0], maxLength);
|
|
99
97
|
}
|
|
100
|
-
const joined =
|
|
98
|
+
const joined = createListFormatter(locale)(items);
|
|
101
99
|
if (joined.length <= maxLength) {
|
|
102
100
|
return joined;
|
|
103
101
|
}
|
|
@@ -116,7 +114,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
116
114
|
if (labels.length === 1) {
|
|
117
115
|
return truncate(labels[0], maxLength);
|
|
118
116
|
}
|
|
119
|
-
const joined =
|
|
117
|
+
const joined = createListFormatter(locale)(labels);
|
|
120
118
|
if (joined.length <= maxLength) {
|
|
121
119
|
return joined;
|
|
122
120
|
}
|
|
@@ -140,7 +138,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
140
138
|
if (entities.length === 1) {
|
|
141
139
|
return truncate(entities[0].label, maxLength);
|
|
142
140
|
}
|
|
143
|
-
const joined = entities.map(e => e.label)
|
|
141
|
+
const joined = createListFormatter(locale)(entities.map(e => e.label));
|
|
144
142
|
if (joined.length <= maxLength) {
|
|
145
143
|
return joined;
|
|
146
144
|
}
|
|
@@ -153,7 +151,7 @@ export function formatFilterValue(_config, operatorValue, filterValue, maxLength
|
|
|
153
151
|
case 'date_absolute':
|
|
154
152
|
return truncate(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false, calendar), maxLength);
|
|
155
153
|
case 'date_relative':
|
|
156
|
-
return
|
|
154
|
+
return operatorValue.type === 'date_relative' ? relativeDateLabel(operatorValue, filterValue.value, t) : filterValue.value;
|
|
157
155
|
case 'date_range':
|
|
158
156
|
return formatDateRange(filterValue.value, t);
|
|
159
157
|
case 'custom':
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview The text a PowerSearch filter token shows for a value.
|
|
3
3
|
*
|
|
4
|
-
* @input `OperatorValue`, `FilterValue`, a width budget, the locale,
|
|
5
|
-
* calendar.
|
|
4
|
+
* @input `OperatorValue`, `FilterValue`, a width budget, the locale, the
|
|
5
|
+
* calendar, and the provider's translator.
|
|
6
6
|
* @output `formatTokenValueText` — one string, or null for an empty value;
|
|
7
7
|
* `formatTokenLabel` and `formatTokenText` — the token's "field: operator"
|
|
8
8
|
* label and its full text, each one catalog message; `tokenTextKeepsParts` —
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
import type { OperatorValue, FilterValue } from './types.js';
|
|
16
16
|
import type { Locale, TranslatorFn } from '../i18n/index.js';
|
|
17
17
|
import type { CalendarSystem } from '../utils/calendarSystem.js';
|
|
18
|
-
type ListFormatFn = (items: ReadonlyArray<string>) => string;
|
|
19
18
|
/**
|
|
20
19
|
* A filter token's label: its field and operator, joined by one catalog
|
|
21
20
|
* message so a locale can reorder them. A filter with no operator text shows
|
|
@@ -38,12 +37,8 @@ export declare function tokenTextKeepsParts(t: TranslatorFn): boolean;
|
|
|
38
37
|
* width budget; pass `Number.MAX_SAFE_INTEGER` for the untruncated text.
|
|
39
38
|
* A `date_absolute` value is written in `calendar`, the calendar that the
|
|
40
39
|
* provider resolves.
|
|
41
|
-
*
|
|
42
|
-
* catalog
|
|
43
|
-
* token's own literals. With `formatList` (the provider's list formatter),
|
|
44
|
-
* several labels join as a list in the locale; without it they join with
|
|
45
|
-
* the token's literal ", ".
|
|
40
|
+
* The list, date-range and nested summaries and a relative date resolve
|
|
41
|
+
* through the catalog; several labels join as a list in the locale.
|
|
46
42
|
*/
|
|
47
|
-
export declare function formatTokenValueText(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, locale: Locale, calendar: CalendarSystem, t
|
|
48
|
-
export {};
|
|
43
|
+
export declare function formatTokenValueText(operatorValue: OperatorValue, filterValue: FilterValue, maxLength: number, locale: Locale, calendar: CalendarSystem, t: TranslatorFn, timezoneID?: string): string | null;
|
|
49
44
|
//# sourceMappingURL=formatTokenValue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatTokenValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatTokenValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"formatTokenValue.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/formatTokenValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAE,WAAW,EAAW,MAAM,SAAS,CAAC;AAClE,OAAO,KAAK,EAAC,MAAM,EAAE,YAAY,EAAC,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAU5D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,YAAY,EACf,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,GACpB,MAAM,CAQR;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAC7B,CAAC,EAAE,YAAY,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,YAAY,GAAG,OAAO,CAG5D;AAoED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,EACxB,CAAC,EAAE,YAAY,EACf,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAgGf"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview The text a PowerSearch filter token shows for a value.
|
|
5
5
|
*
|
|
6
|
-
* @input `OperatorValue`, `FilterValue`, a width budget, the locale,
|
|
7
|
-
* calendar.
|
|
6
|
+
* @input `OperatorValue`, `FilterValue`, a width budget, the locale, the
|
|
7
|
+
* calendar, and the provider's translator.
|
|
8
8
|
* @output `formatTokenValueText` — one string, or null for an empty value;
|
|
9
9
|
* `formatTokenLabel` and `formatTokenText` — the token's "field: operator"
|
|
10
10
|
* label and its full text, each one catalog message; `tokenTextKeepsParts` —
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
import { truncateCharacters } from "../utils/characters.js";
|
|
19
19
|
import { formatDateAbsolute, formatSharedNumber } from "./formatFilterValue.js";
|
|
20
|
+
import { createListFormatter } from "../i18n/listFormat.js";
|
|
21
|
+
import { relativeDateLabel } from "./relativeDateOptions.js";
|
|
20
22
|
import { registerEnglishFallback } from "../i18n/englishFallback.js";
|
|
21
23
|
import english from "../i18n/generated-english/PowerSearch/formatTokenValue.generated.js";
|
|
22
24
|
registerEnglishFallback(english);
|
|
25
|
+
|
|
23
26
|
/**
|
|
24
27
|
* A filter token's label: its field and operator, joined by one catalog
|
|
25
28
|
* message so a locale can reorder them. A filter with no operator text shows
|
|
@@ -94,21 +97,12 @@ function formatNumberAsToken(value, locale) {
|
|
|
94
97
|
maximumFractionDigits: MAX_FRACTION_DIGITS
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
|
-
|
|
98
|
-
// The summaries, lists, and numbers the token writes as English literals, and
|
|
99
|
-
// the locale-aware readings of the same: with a translator (the sheet
|
|
100
|
-
// presentation's rows and announcements) the summaries resolve through the
|
|
101
|
-
// catalog, lists through the provider locale's list format, and numbers
|
|
102
|
-
// through its number format; without one they stay the token's own literals,
|
|
103
|
-
// the released popover token's text. In English the two read identically.
|
|
104
100
|
function itemsSummary(count, t) {
|
|
105
|
-
return t
|
|
101
|
+
return t('@astryx.powersearch.valueEditor.itemsCount', {
|
|
106
102
|
count
|
|
107
|
-
})
|
|
108
|
-
// eslint-disable-next-line @astryx/no-hardcoded-i18n-string -- the popover token's released English text; translating it is a separate stable change
|
|
109
|
-
`${count} items`;
|
|
103
|
+
});
|
|
110
104
|
}
|
|
111
|
-
function formatListText(labels, maxLength, t,
|
|
105
|
+
function formatListText(labels, maxLength, t, locale) {
|
|
112
106
|
if (labels.length === 0) {
|
|
113
107
|
return null;
|
|
114
108
|
}
|
|
@@ -119,7 +113,7 @@ function formatListText(labels, maxLength, t, formatList) {
|
|
|
119
113
|
if (totalLength > maxLength) {
|
|
120
114
|
return itemsSummary(labels.length, t);
|
|
121
115
|
}
|
|
122
|
-
return
|
|
116
|
+
return createListFormatter(locale)(labels);
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
/**
|
|
@@ -130,13 +124,10 @@ function formatListText(labels, maxLength, t, formatList) {
|
|
|
130
124
|
* width budget; pass `Number.MAX_SAFE_INTEGER` for the untruncated text.
|
|
131
125
|
* A `date_absolute` value is written in `calendar`, the calendar that the
|
|
132
126
|
* provider resolves.
|
|
133
|
-
*
|
|
134
|
-
* catalog
|
|
135
|
-
* token's own literals. With `formatList` (the provider's list formatter),
|
|
136
|
-
* several labels join as a list in the locale; without it they join with
|
|
137
|
-
* the token's literal ", ".
|
|
127
|
+
* The list, date-range and nested summaries and a relative date resolve
|
|
128
|
+
* through the catalog; several labels join as a list in the locale.
|
|
138
129
|
*/
|
|
139
|
-
export function formatTokenValueText(operatorValue, filterValue, maxLength, locale, calendar, t,
|
|
130
|
+
export function formatTokenValueText(operatorValue, filterValue, maxLength, locale, calendar, t, timezoneID) {
|
|
140
131
|
switch (filterValue.type) {
|
|
141
132
|
case 'empty':
|
|
142
133
|
return null;
|
|
@@ -144,14 +135,14 @@ export function formatTokenValueText(operatorValue, filterValue, maxLength, loca
|
|
|
144
135
|
return truncateString(filterValue.value, maxLength);
|
|
145
136
|
case 'integer':
|
|
146
137
|
case 'float':
|
|
147
|
-
return
|
|
138
|
+
return formatNumberAsToken(filterValue.value, locale);
|
|
148
139
|
case 'enum':
|
|
149
140
|
if (operatorValue.type === 'enum') {
|
|
150
141
|
return truncateString(getEnumLabel(operatorValue.values, filterValue.value), maxLength);
|
|
151
142
|
}
|
|
152
143
|
return truncateString(filterValue.value, maxLength);
|
|
153
144
|
case 'string_list':
|
|
154
|
-
return formatListText(filterValue.value, maxLength, t,
|
|
145
|
+
return formatListText(filterValue.value, maxLength, t, locale);
|
|
155
146
|
case 'enum_list':
|
|
156
147
|
{
|
|
157
148
|
const items = filterValue.value;
|
|
@@ -159,7 +150,7 @@ export function formatTokenValueText(operatorValue, filterValue, maxLength, loca
|
|
|
159
150
|
return null;
|
|
160
151
|
}
|
|
161
152
|
if (operatorValue.type === 'enum_list') {
|
|
162
|
-
return formatListText(items.map(v => getEnumLabel(operatorValue.values, v)), maxLength, t,
|
|
153
|
+
return formatListText(items.map(v => getEnumLabel(operatorValue.values, v)), maxLength, t, locale);
|
|
163
154
|
}
|
|
164
155
|
if (items.length === 1) {
|
|
165
156
|
return truncateString(items[0], maxLength);
|
|
@@ -167,20 +158,16 @@ export function formatTokenValueText(operatorValue, filterValue, maxLength, loca
|
|
|
167
158
|
return itemsSummary(items.length, t);
|
|
168
159
|
}
|
|
169
160
|
case 'entity_list':
|
|
170
|
-
return formatListText(filterValue.value.map(e => e.label), maxLength, t,
|
|
161
|
+
return formatListText(filterValue.value.map(e => e.label), maxLength, t, locale);
|
|
171
162
|
case 'time':
|
|
172
163
|
return filterValue.value;
|
|
173
164
|
case 'date_absolute':
|
|
174
165
|
// The token reads a value in the zone its editor uses.
|
|
175
166
|
return truncateString(formatDateAbsolute(filterValue.unixSeconds, locale, timezoneID, operatorValue.type !== 'date_absolute' || operatorValue.isDateOnly !== false, calendar), maxLength);
|
|
176
167
|
case 'date_relative':
|
|
177
|
-
return truncateString(filterValue.value, maxLength);
|
|
168
|
+
return truncateString(operatorValue.type === 'date_relative' ? relativeDateLabel(operatorValue, filterValue.value, t) : filterValue.value, maxLength);
|
|
178
169
|
case 'date_range':
|
|
179
|
-
|
|
180
|
-
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
181
|
-
}
|
|
182
|
-
// eslint-disable-next-line @astryx/no-hardcoded-i18n-string -- the popover token's released English text; translating it is a separate stable change
|
|
183
|
-
return 'date range';
|
|
170
|
+
return t('@astryx.powersearch.valueEditor.dateRange');
|
|
184
171
|
case 'custom':
|
|
185
172
|
if (operatorValue.type === 'custom') {
|
|
186
173
|
return truncateString(operatorValue.getString(filterValue.value), maxLength);
|
|
@@ -189,13 +176,9 @@ export function formatTokenValueText(operatorValue, filterValue, maxLength, loca
|
|
|
189
176
|
case 'nested':
|
|
190
177
|
{
|
|
191
178
|
const count = filterValue.value.length;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
// eslint-disable-next-line @astryx/no-hardcoded-i18n-string -- the popover token's released English text; translating it is a separate stable change
|
|
198
|
-
return count === 1 ? '1 filter' : `${count} filters`;
|
|
179
|
+
return t('@astryx.powersearch.valueEditor.filtersCount', {
|
|
180
|
+
count
|
|
181
|
+
});
|
|
199
182
|
}
|
|
200
183
|
default:
|
|
201
184
|
return null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file relativeDateOptions.ts
|
|
3
|
+
* @input An operator's `date_relative` value and a translator
|
|
4
|
+
* @output buildRelativeDateOptions, the relative-date choices an operator
|
|
5
|
+
* offers; relativeDateLabel, the choice label for a stored value
|
|
6
|
+
* @position The value editors, the sheet's rows and both token formatters
|
|
7
|
+
* use it. A stored value (`3d_ago`) then reads as one catalog message
|
|
8
|
+
* ("3 days ago") everywhere. It has no React dependency.
|
|
9
|
+
*/
|
|
10
|
+
import type { OperatorValue } from './types.js';
|
|
11
|
+
import type { TranslatorFn } from '../i18n/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* The relative-date choices an operator offers, in display order. Shared by
|
|
14
|
+
* the popover's Selector and the sheet presentation's rows so both list the
|
|
15
|
+
* same values. The labels are the catalog's ICU plural messages.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildRelativeDateOptions(operatorValue: OperatorValue & {
|
|
18
|
+
type: 'date_relative';
|
|
19
|
+
}, t: TranslatorFn): {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}[];
|
|
23
|
+
/**
|
|
24
|
+
* A stored relative-date value as the choice that offers it reads ("3 days
|
|
25
|
+
* ago"); a value no choice offers reads as stored.
|
|
26
|
+
*/
|
|
27
|
+
export declare function relativeDateLabel(operatorValue: OperatorValue & {
|
|
28
|
+
type: 'date_relative';
|
|
29
|
+
}, value: string, t: TranslatorFn): string;
|
|
30
|
+
//# sourceMappingURL=relativeDateOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relativeDateOptions.d.ts","sourceRoot":"","sources":["../../src/PowerSearch/relativeDateOptions.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AA2B1C;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,aAAa,GAAG;IAAC,IAAI,EAAE,eAAe,CAAA;CAAC,EACtD,CAAC,EAAE,YAAY,GACd;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,EAAE,CAmBlC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,aAAa,GAAG;IAAC,IAAI,EAAE,eAAe,CAAA;CAAC,EACtD,KAAK,EAAE,MAAM,EACb,CAAC,EAAE,YAAY,GACd,MAAM,CAMR"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file relativeDateOptions.ts
|
|
5
|
+
* @input An operator's `date_relative` value and a translator
|
|
6
|
+
* @output buildRelativeDateOptions, the relative-date choices an operator
|
|
7
|
+
* offers; relativeDateLabel, the choice label for a stored value
|
|
8
|
+
* @position The value editors, the sheet's rows and both token formatters
|
|
9
|
+
* use it. A stored value (`3d_ago`) then reads as one catalog message
|
|
10
|
+
* ("3 days ago") everywhere. It has no React dependency.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { registerEnglishFallback } from "../i18n/englishFallback.js";
|
|
14
|
+
import english from "../i18n/generated-english/PowerSearch/relativeDateOptions.generated.js";
|
|
15
|
+
registerEnglishFallback(english);
|
|
16
|
+
const RELATIVE_DATE_UNITS = [{
|
|
17
|
+
unit: 'day',
|
|
18
|
+
amounts: [1, 3, 7, 14, 30],
|
|
19
|
+
ago: '@astryx.powersearch.sheet.relativeDaysAgo',
|
|
20
|
+
fromNow: '@astryx.powersearch.sheet.relativeDaysFromNow'
|
|
21
|
+
}, {
|
|
22
|
+
unit: 'week',
|
|
23
|
+
amounts: [1, 2, 4],
|
|
24
|
+
ago: '@astryx.powersearch.sheet.relativeWeeksAgo',
|
|
25
|
+
fromNow: '@astryx.powersearch.sheet.relativeWeeksFromNow'
|
|
26
|
+
}, {
|
|
27
|
+
unit: 'month',
|
|
28
|
+
amounts: [1, 3, 6, 12],
|
|
29
|
+
ago: '@astryx.powersearch.sheet.relativeMonthsAgo',
|
|
30
|
+
fromNow: '@astryx.powersearch.sheet.relativeMonthsFromNow'
|
|
31
|
+
}];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The relative-date choices an operator offers, in display order. Shared by
|
|
35
|
+
* the popover's Selector and the sheet presentation's rows so both list the
|
|
36
|
+
* same values. The labels are the catalog's ICU plural messages.
|
|
37
|
+
*/
|
|
38
|
+
export function buildRelativeDateOptions(operatorValue, t) {
|
|
39
|
+
const result = [];
|
|
40
|
+
for (const {
|
|
41
|
+
unit,
|
|
42
|
+
amounts,
|
|
43
|
+
ago,
|
|
44
|
+
fromNow
|
|
45
|
+
} of RELATIVE_DATE_UNITS) {
|
|
46
|
+
for (const amount of amounts) {
|
|
47
|
+
if (operatorValue.isPastAllowed !== false) {
|
|
48
|
+
result.push({
|
|
49
|
+
value: `${amount}${unit[0]}_ago`,
|
|
50
|
+
label: t(ago, {
|
|
51
|
+
count: amount
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (operatorValue.isFutureAllowed !== false) {
|
|
56
|
+
result.push({
|
|
57
|
+
value: `${amount}${unit[0]}_from_now`,
|
|
58
|
+
label: t(fromNow, {
|
|
59
|
+
count: amount
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* A stored relative-date value as the choice that offers it reads ("3 days
|
|
70
|
+
* ago"); a value no choice offers reads as stored.
|
|
71
|
+
*/
|
|
72
|
+
export function relativeDateLabel(operatorValue, value, t) {
|
|
73
|
+
return buildRelativeDateOptions(operatorValue, t).find(option => option.value === value)?.label ?? value;
|
|
74
|
+
}
|
|
@@ -58,7 +58,7 @@ export interface ProgressBarProps extends BaseProps<HTMLDivElement> {
|
|
|
58
58
|
hasValueLabel?: boolean;
|
|
59
59
|
/**
|
|
60
60
|
* Custom formatter for the value label.
|
|
61
|
-
* @default
|
|
61
|
+
* @default the rounded percentage in the provider locale (`45%` in English)
|
|
62
62
|
*/
|
|
63
63
|
formatValueLabel?: (value: number, max: number) => string;
|
|
64
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/ProgressBar/ProgressBar.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,SAAS,CAAC;AAiBnD;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,qBAAqB,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1D;;;OAGG;IACH,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA6ZD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAS,EACT,GAAS,EACT,KAAK,EACL,aAAqB,EACrB,aAAqB,EACrB,gBAAgB,EAChB,OAAkB,EAClB,eAAuB,EACvB,UAAkB,EAClB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,UAAU,EACzB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAwLlB;yBAzMe,WAAW"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file ProgressBar.tsx
|
|
7
|
-
* @input Uses React, useId, stylex, tokens, ProgressBarTouch
|
|
7
|
+
* @input Uses React, useId, stylex, tokens, ProgressBarTouch, resolveMotion
|
|
8
|
+
* and the shared percentage formatter
|
|
8
9
|
* @output Exports ProgressBar component, ProgressBarProps, ProgressBarVariant types
|
|
9
10
|
* @position Core implementation; consumed by index.ts
|
|
10
11
|
*
|
|
@@ -27,6 +28,8 @@ import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
|
27
28
|
import { useProgressBarTouch } from "./ProgressBarTouch.js";
|
|
28
29
|
import { formatMotionRoleValue } from "../motion/roles.js";
|
|
29
30
|
import { resolveMotion } from "../motion/resolveMotion.js";
|
|
31
|
+
import { useLocale } from "../i18n/useLocale.js";
|
|
32
|
+
import { formatPercent } from "../NumberInput/numberParser.js";
|
|
30
33
|
import { progressBar } from "../motion/uikit/progressBar.js";
|
|
31
34
|
import { timing } from "../motion/uikit/timing.js";
|
|
32
35
|
|
|
@@ -58,7 +61,9 @@ const indeterminateSlide = "xr3m334-B";
|
|
|
58
61
|
|
|
59
62
|
// RTL: mirror the slide so the indeterminate bar travels along the reading
|
|
60
63
|
// flow (inline-start → inline-end, i.e. right → left) instead of always
|
|
61
|
-
// physically left → right. The magnitudes mirror the LTR keyframe.
|
|
64
|
+
// physically left → right. The magnitudes mirror the LTR keyframe. The mirror
|
|
65
|
+
// follows the bar's own direction (`:dir(rtl)`), so a bar in an LTR region of
|
|
66
|
+
// an RTL page slides like its label.
|
|
62
67
|
const indeterminateSlideRtl = "x1c2q33o-B";
|
|
63
68
|
|
|
64
69
|
// Under reduced motion the indeterminate fill stops travelling and pulses in
|
|
@@ -111,7 +116,7 @@ const styles = {
|
|
|
111
116
|
kInvED: "xvr1dqx",
|
|
112
117
|
kzqmXN: "xz84dc7 xie2s74",
|
|
113
118
|
kaIpWk: "xjspbzw",
|
|
114
|
-
kKVMdj: "xozk8ic
|
|
119
|
+
kKVMdj: "xozk8ic xw39qp0 xcp3dgq xfqa98z",
|
|
115
120
|
k44tkh: "xmg6eyc x1p2ibn3",
|
|
116
121
|
kyAemX: "x4hg4is x10xcq22",
|
|
117
122
|
kILWW9: "x4q6aw4",
|
|
@@ -123,7 +128,7 @@ const styles = {
|
|
|
123
128
|
k87sOh: "xwa60dl",
|
|
124
129
|
kzqmXN: "x63cpjl",
|
|
125
130
|
kZKoxP: "xhovv34",
|
|
126
|
-
k3aq6I: "x11lhmoz
|
|
131
|
+
k3aq6I: "x11lhmoz xxk0uts",
|
|
127
132
|
$$css: true
|
|
128
133
|
}
|
|
129
134
|
};
|
|
@@ -227,10 +232,6 @@ function pulseStyle(element) {
|
|
|
227
232
|
'--_progress-bar-pulse-floor': String(progressBar.reducedMotionPulseFloor)
|
|
228
233
|
};
|
|
229
234
|
}
|
|
230
|
-
function defaultFormatValueLabel(value, max) {
|
|
231
|
-
const pct = max > 0 ? Math.round(value / max * 100) : 0;
|
|
232
|
-
return `${pct}%`;
|
|
233
|
-
}
|
|
234
235
|
|
|
235
236
|
/**
|
|
236
237
|
* A progress bar for displaying determinate or indeterminate progress.
|
|
@@ -280,7 +281,7 @@ export function ProgressBar({
|
|
|
280
281
|
label,
|
|
281
282
|
isLabelHidden = false,
|
|
282
283
|
hasValueLabel = false,
|
|
283
|
-
formatValueLabel
|
|
284
|
+
formatValueLabel,
|
|
284
285
|
variant = 'accent',
|
|
285
286
|
isIndeterminate = false,
|
|
286
287
|
isDisabled = false,
|
|
@@ -301,9 +302,14 @@ export function ProgressBar({
|
|
|
301
302
|
const safeMax = Number.isFinite(max) ? max : 0;
|
|
302
303
|
const clampedValue = Math.min(Math.max(0, safeValue), safeMax);
|
|
303
304
|
const percentage = safeMax > 0 ? clampedValue / safeMax * 100 : 0;
|
|
304
|
-
const
|
|
305
|
+
const locale = useLocale();
|
|
306
|
+
const valueText = formatValueLabel ? formatValueLabel(clampedValue, safeMax) : formatPercent(Math.round(percentage), locale);
|
|
305
307
|
const showValueLabel = hasValueLabel && !isIndeterminate;
|
|
306
308
|
const fillVariant = isDisabled ? 'disabled' : variant;
|
|
309
|
+
// A variant a theme adds through ProgressBarVariantMap has no built-in
|
|
310
|
+
// style. It paints the default accent fill until the theme styles it, so
|
|
311
|
+
// the bar never loses its fill.
|
|
312
|
+
const fillStyleKey = Object.hasOwn(variantStyles, fillVariant) ? fillVariant : 'accent';
|
|
307
313
|
// Under a finger the fill moves as UIProgressView's does and draws at least
|
|
308
314
|
// 16px; what that needs from script is the touch layer's (ProgressBarTouch).
|
|
309
315
|
const touch = useProgressBarTouch(percentage, !isIndeterminate && (marks?.length ?? 0) > 0);
|
|
@@ -333,12 +339,12 @@ export function ProgressBar({
|
|
|
333
339
|
};
|
|
334
340
|
}) : [];
|
|
335
341
|
return /*#__PURE__*/_jsxs("div", {
|
|
342
|
+
...rest,
|
|
336
343
|
ref: ref,
|
|
337
344
|
...mergeProps(themeProps('progress-bar', {
|
|
338
345
|
variant
|
|
339
346
|
}), stylex.props(styles.container, xstyle), className, style),
|
|
340
347
|
"data-testid": dataTestId,
|
|
341
|
-
...rest,
|
|
342
348
|
children: [!isLabelHidden || showValueLabel ? /*#__PURE__*/_jsxs("div", {
|
|
343
349
|
...{
|
|
344
350
|
className: "x78zum5 x1qughib x1pha0wt"
|
|
@@ -397,12 +403,12 @@ export function ProgressBar({
|
|
|
397
403
|
children: isIndeterminate ? /*#__PURE__*/_jsx("div", {
|
|
398
404
|
...mergeProps(themeProps('progress-bar-fill', {
|
|
399
405
|
variant: fillVariant
|
|
400
|
-
}), stylex.props(styles.indeterminateFill, variantStyles[
|
|
406
|
+
}), stylex.props(styles.indeterminateFill, variantStyles[fillStyleKey], isDisabled && styles.fillDisabled)),
|
|
401
407
|
style: pulseStyle(null)
|
|
402
408
|
}) : /*#__PURE__*/_jsx("div", {
|
|
403
409
|
...mergeProps(themeProps('progress-bar-fill', {
|
|
404
410
|
variant: fillVariant
|
|
405
|
-
}), stylex.props(styles.fill, percentage === 0 && styles.fillEmpty, variantStyles[
|
|
411
|
+
}), stylex.props(styles.fill, percentage === 0 && styles.fillEmpty, variantStyles[fillStyleKey], isDisabled && styles.fillDisabled)),
|
|
406
412
|
style: fillStyle
|
|
407
413
|
})
|
|
408
414
|
}), resolvedMarks.map(mark => {
|
|
@@ -422,7 +428,7 @@ export function ProgressBar({
|
|
|
422
428
|
...mergeProps(themeProps('progress-bar-mark', {
|
|
423
429
|
variant: fillVariant,
|
|
424
430
|
placement: mark.isOnFill ? 'fill' : 'track'
|
|
425
|
-
}), stylex.props(focusOutlineStyles.focusVisible, styles.mark, mark.isOnFill ? markOnFillStyles[
|
|
431
|
+
}), stylex.props(focusOutlineStyles.focusVisible, styles.mark, mark.isOnFill ? markOnFillStyles[fillStyleKey] : isDisabled ? markOnTrackStyles.trackDisabled : markOnTrackStyles.track)),
|
|
426
432
|
style: {
|
|
427
433
|
insetInlineStart: `${mark.pct}%`
|
|
428
434
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createResizable.d.ts","sourceRoot":"","sources":["../../src/Resizable/createResizable.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAcL,KAAK,kBAAkB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAML,KAAK,cAAc,EAMpB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAc3C,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACxC,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,mEAAmE;IACnE,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,YAAY,CAAC,EAAE;QAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;KAAC,CAAC;IACtD,+DAA+D;IAC/D,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,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