@astryxdesign/core 0.7.17 → 0.7.18-canary.g57306fd
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/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/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/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +22 -16
- 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 +3 -12
- 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/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +4 -1
- 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 +14 -5
- 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/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/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 +101 -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 +36 -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 +22 -0
- package/dist/i18n/listFormat.d.ts.map +1 -0
- package/dist/i18n/listFormat.js +29 -0
- package/dist/i18n/useListFormatter.d.ts +1 -3
- package/dist/i18n/useListFormatter.d.ts.map +1 -1
- package/dist/i18n/useListFormatter.js +5 -12
- 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/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 +15 -5
- package/dist/utils/textDirection.d.ts.map +1 -1
- package/dist/utils/textDirection.js +33 -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/Kbd/Kbd.doc.mjs +5 -5
- package/src/Kbd/Kbd.tsx +3 -2
- package/src/Layer/gestureCounter.ts +39 -3
- 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/MoreMenu/MoreMenu.doc.mjs +1 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +2 -2
- package/src/MultiSelector/MultiSelector.tsx +24 -14
- 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 +13 -46
- 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/Slider/Slider.tsx +4 -1
- 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 +14 -4
- 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/sortable/useTableSortable.tsx +41 -2
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +49 -20
- package/src/Table/types.ts +5 -5
- 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 +148 -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 +33 -0
- package/src/i18n/useListFormatter.ts +5 -12
- 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/scrollView.ts +3 -2
- package/src/utils/textDirection.ts +33 -5
- package/src/utils/touchHitArea.ts +3 -2
- package/src/virtualization/useInlineListWindow.ts +102 -11
package/dist/Layer/useLayer.js
CHANGED
|
@@ -262,6 +262,12 @@ const styles = {
|
|
|
262
262
|
* not part of the public `useLayer` options.
|
|
263
263
|
*/
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* `getInvoker` for a layer that holds nothing to focus, such as a tooltip or
|
|
267
|
+
* a hint. When a popover that names an invoker hides, the browser also drops
|
|
268
|
+
* the focus-order place of another open popover that names the same invoker.
|
|
269
|
+
*/
|
|
270
|
+
export const noInvoker = () => null;
|
|
265
271
|
function toCssLength(value) {
|
|
266
272
|
return typeof value === 'number' ? `${value}px` : value;
|
|
267
273
|
}
|
|
@@ -884,13 +890,14 @@ function useLayerImplementation(options) {
|
|
|
884
890
|
const lazyMount = mode === 'context' ? options.lazyMount ?? false : false;
|
|
885
891
|
const keepsMountAfterShow = lazyMount && mode === 'context' ? options.keepsMountAfterShow ?? false : false;
|
|
886
892
|
const keepsAnchorClear = mode === 'context' ? options.keepsAnchorClear ?? false : false;
|
|
887
|
-
const
|
|
893
|
+
const watchesOutside = mode === 'context' ? options.watchesOutside : undefined;
|
|
888
894
|
const writesEntranceSide = mode === 'context' ? options.writesEntranceSide ?? false : false;
|
|
889
895
|
const onPlacedAfreshRef = useCommittedRef(mode === 'context' ? options.onPlacedAfresh : undefined);
|
|
890
896
|
const onCloseStart = mode === 'context' ? options.onCloseStart : undefined;
|
|
891
897
|
const onOpenPendingChange = mode === 'context' ? options.onOpenPendingChange : undefined;
|
|
892
898
|
const waitsForAnchorRef = useCommittedRef(mode === 'context' && options.waitsForAnchor === true);
|
|
893
899
|
const onCloseStartRef = useCommittedRef(onCloseStart);
|
|
900
|
+
const getInvokerRef = useCommittedRef(mode === 'context' ? options.getInvoker : undefined);
|
|
894
901
|
const id = useId();
|
|
895
902
|
const anchorId = `--astryx-layer-${id.replace(/:/g, '')}`;
|
|
896
903
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -992,12 +999,17 @@ function useLayerImplementation(options) {
|
|
|
992
999
|
const browserHideRef = useRef(null);
|
|
993
1000
|
const forgetDismissalRef = useRef(null);
|
|
994
1001
|
|
|
995
|
-
// Stops the watch for
|
|
996
|
-
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
|
|
1002
|
+
// Stops the owner's watch for pointers outside the open layer
|
|
1003
|
+
// (`watchesOutside`).
|
|
1004
|
+
const stopOutsideWatchRef = useRef(null);
|
|
1005
|
+
const stopOutsideWatch = useCallback(() => {
|
|
1006
|
+
stopOutsideWatchRef.current?.();
|
|
1007
|
+
stopOutsideWatchRef.current = null;
|
|
1000
1008
|
}, []);
|
|
1009
|
+
// The owner's watch closes the layer through this. It is filled in once
|
|
1010
|
+
// `hide` and the dismissal memory exist.
|
|
1011
|
+
const dismissFromOutsideRef = useRef(() => {});
|
|
1012
|
+
const dismissFromOutside = useCallback(() => dismissFromOutsideRef.current(), []);
|
|
1001
1013
|
const wasJustDismissed = useCallback(() => {
|
|
1002
1014
|
const gesture = currentGesture();
|
|
1003
1015
|
return dismissedByGestureRef.current === gesture;
|
|
@@ -1020,23 +1032,21 @@ function useLayerImplementation(options) {
|
|
|
1020
1032
|
const duringBrowserHide = isBrowserHideInFlight(doc);
|
|
1021
1033
|
try {
|
|
1022
1034
|
runPopoverOperation(doc, () => {
|
|
1023
|
-
// The
|
|
1024
|
-
//
|
|
1025
|
-
//
|
|
1026
|
-
//
|
|
1027
|
-
//
|
|
1028
|
-
//
|
|
1029
|
-
//
|
|
1030
|
-
//
|
|
1031
|
-
//
|
|
1032
|
-
//
|
|
1033
|
-
//
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
const trigger = triggerRef.current;
|
|
1037
|
-
const triggerView = trigger?.ownerDocument.defaultView;
|
|
1035
|
+
// The invoker is passed as `source`. A layer hosted away from it
|
|
1036
|
+
// still takes its focus order and popover nesting from it.
|
|
1037
|
+
// Browsers without the option ignore it. `source` is declared as
|
|
1038
|
+
// an `HTMLElement`. A caller-rendered icon trigger is an
|
|
1039
|
+
// `SVGElement`, whose dictionary conversion throws before the
|
|
1040
|
+
// popover opens. Omitting the option for it still anchors the
|
|
1041
|
+
// layer, because positioning reads the anchor-name pair, and only
|
|
1042
|
+
// gives up the invoker's focus order. The check asks the
|
|
1043
|
+
// invoker's own window: an HTML element rendered into another
|
|
1044
|
+
// document (an iframe, a Picture-in-Picture window) is not an
|
|
1045
|
+
// instance of this window's `HTMLElement`, and keeps its source.
|
|
1046
|
+
const invoker = getInvokerRef.current != null ? getInvokerRef.current() : triggerRef.current;
|
|
1047
|
+
const invokerView = invoker?.ownerDocument.defaultView;
|
|
1038
1048
|
popover.showPopover({
|
|
1039
|
-
source:
|
|
1049
|
+
source: invokerView != null && invoker instanceof invokerView.HTMLElement ? invoker : undefined
|
|
1040
1050
|
});
|
|
1041
1051
|
});
|
|
1042
1052
|
} catch (error) {
|
|
@@ -1052,7 +1062,7 @@ function useLayerImplementation(options) {
|
|
|
1052
1062
|
}
|
|
1053
1063
|
openedPopoverRef.current = popover;
|
|
1054
1064
|
return true;
|
|
1055
|
-
}, []);
|
|
1065
|
+
}, [getInvokerRef]);
|
|
1056
1066
|
const isCurrentContextPopover = useCallback(popover => {
|
|
1057
1067
|
if (mode !== 'context') {
|
|
1058
1068
|
return true;
|
|
@@ -1159,7 +1169,7 @@ function useLayerImplementation(options) {
|
|
|
1159
1169
|
browserHide.moved = true;
|
|
1160
1170
|
openedPopoverRef.current = null;
|
|
1161
1171
|
isOpenRef.current = false;
|
|
1162
|
-
|
|
1172
|
+
stopOutsideWatch();
|
|
1163
1173
|
}
|
|
1164
1174
|
// A context popover left over until React commits a previous hide must not
|
|
1165
1175
|
// be reopened. The synchronous mount ref is the source of truth.
|
|
@@ -1220,10 +1230,10 @@ function useLayerImplementation(options) {
|
|
|
1220
1230
|
closeKeepsShownRef.current = closeTransitionHolds || closeStartsAnimation;
|
|
1221
1231
|
if (lightDismiss) {
|
|
1222
1232
|
claimContextMenuPress(popover);
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1233
|
+
}
|
|
1234
|
+
if (watchesOutside != null) {
|
|
1235
|
+
stopOutsideWatch();
|
|
1236
|
+
stopOutsideWatchRef.current = watchesOutside(popover, dismissFromOutside);
|
|
1227
1237
|
}
|
|
1228
1238
|
const anchorBoxes = keepsAnchorClear ? keepAnchorClear(popover, triggerRef.current) : null;
|
|
1229
1239
|
if (!writesEntranceSide) {
|
|
@@ -1233,7 +1243,7 @@ function useLayerImplementation(options) {
|
|
|
1233
1243
|
setIsOpen(true);
|
|
1234
1244
|
onShow?.();
|
|
1235
1245
|
}
|
|
1236
|
-
}, [anchorId, onShow, keepsAnchorClear, writesEntranceSide, lightDismiss,
|
|
1246
|
+
}, [anchorId, onShow, keepsAnchorClear, writesEntranceSide, lightDismiss, watchesOutside, stopOutsideWatch, dismissFromOutside, requestContextMount, applyDeferredWritingContext, showPopoverElement, isCurrentContextPopover, wasJustDismissed]);
|
|
1237
1247
|
|
|
1238
1248
|
// A wait for the trigger to get a layout box, started by a show() that
|
|
1239
1249
|
// found none. Cancelled by hide(), by a show() for another trigger, or by
|
|
@@ -1463,7 +1473,7 @@ function useLayerImplementation(options) {
|
|
|
1463
1473
|
// dismissals from ours.
|
|
1464
1474
|
openedPopoverRef.current = null;
|
|
1465
1475
|
isOpenRef.current = false;
|
|
1466
|
-
|
|
1476
|
+
stopOutsideWatch();
|
|
1467
1477
|
// See finding infra-4 note in `show`: mirror the same guard on hide so
|
|
1468
1478
|
// unsupported browsers degrade gracefully instead of throwing.
|
|
1469
1479
|
if (el) {
|
|
@@ -1484,7 +1494,7 @@ function useLayerImplementation(options) {
|
|
|
1484
1494
|
}
|
|
1485
1495
|
releaseAnchor(popoverRef.current);
|
|
1486
1496
|
clearContextMount();
|
|
1487
|
-
}, [onHide, clearContextMount, releaseAnchor, cancelPendingAnchorWait,
|
|
1497
|
+
}, [onHide, clearContextMount, releaseAnchor, cancelPendingAnchorWait, stopOutsideWatch, onCloseStartRef]);
|
|
1488
1498
|
|
|
1489
1499
|
// A deferred show() replays through a ref so the queued closure reaches the
|
|
1490
1500
|
// current callback rather than the one captured when it was queued.
|
|
@@ -1642,10 +1652,16 @@ function useLayerImplementation(options) {
|
|
|
1642
1652
|
doc.addEventListener('click', scheduleForget, true);
|
|
1643
1653
|
forgetDismissalRef.current = forget;
|
|
1644
1654
|
}, []);
|
|
1655
|
+
// A press outside is absorbed as the browser's own light dismiss is: the
|
|
1656
|
+
// click of that press must not reopen the layer it closed.
|
|
1657
|
+
useCommittedRefInto(dismissFromOutsideRef, () => {
|
|
1658
|
+
rememberDismissal(popoverRef.current?.ownerDocument ?? document);
|
|
1659
|
+
hide();
|
|
1660
|
+
});
|
|
1645
1661
|
|
|
1646
1662
|
// Syncs the document's capture-phase gesture tracking with this mount.
|
|
1647
1663
|
// Unmount forgets the layer's dismissal, releases a pending anchor wait and
|
|
1648
|
-
// a show waiting for a release, and stops the outside
|
|
1664
|
+
// a show waiting for a release, and stops the owner's outside watch.
|
|
1649
1665
|
useEffect(() => {
|
|
1650
1666
|
// Install capture-phase gesture tracking before the first interaction.
|
|
1651
1667
|
currentGesture();
|
|
@@ -1654,9 +1670,9 @@ function useLayerImplementation(options) {
|
|
|
1654
1670
|
pendingAnchorWaitRef.current?.();
|
|
1655
1671
|
cancelAfterReleaseRef.current?.();
|
|
1656
1672
|
cancelAfterReleaseRef.current = null;
|
|
1657
|
-
|
|
1673
|
+
stopOutsideWatch();
|
|
1658
1674
|
};
|
|
1659
|
-
}, [
|
|
1675
|
+
}, [stopOutsideWatch]);
|
|
1660
1676
|
|
|
1661
1677
|
// Reconcile browser-initiated closes (light-dismiss, popover="auto" stack
|
|
1662
1678
|
// eviction). These are the only cases where the DOM mutates without going
|
|
@@ -1717,14 +1733,14 @@ function useLayerImplementation(options) {
|
|
|
1717
1733
|
if (toggleEvent.newState === 'closed' && isOpenRef.current) {
|
|
1718
1734
|
openedPopoverRef.current = null;
|
|
1719
1735
|
isOpenRef.current = false;
|
|
1720
|
-
|
|
1736
|
+
stopOutsideWatch();
|
|
1721
1737
|
rememberDismissal(e.currentTarget?.ownerDocument ?? document);
|
|
1722
1738
|
releaseAnchor(e.currentTarget);
|
|
1723
1739
|
setIsOpen(false);
|
|
1724
1740
|
onHide?.();
|
|
1725
1741
|
clearContextMount();
|
|
1726
1742
|
}
|
|
1727
|
-
}, [onHide, clearContextMount, rememberDismissal, releaseAnchor,
|
|
1743
|
+
}, [onHide, clearContextMount, rememberDismissal, releaseAnchor, stopOutsideWatch]);
|
|
1728
1744
|
|
|
1729
1745
|
// Ref callback for popover element — sets up the `toggle` listener.
|
|
1730
1746
|
// Tracks the element + handler currently bound so the listener is removed
|
|
@@ -1769,20 +1785,27 @@ function useLayerImplementation(options) {
|
|
|
1769
1785
|
// that hide has ended, for the element still mounted then. The
|
|
1770
1786
|
// keyboard cap follows the replacement element too.
|
|
1771
1787
|
followLayerElement();
|
|
1772
|
-
|
|
1788
|
+
const followShownReplacement = () => {
|
|
1773
1789
|
const anchorBoxes = keepsAnchorClear ? keepAnchorClear(el, triggerRef.current) : null;
|
|
1774
1790
|
writeEntranceSide(el, triggerRef.current, anchorBoxes);
|
|
1791
|
+
// The owner's watch judges presses against the layer element.
|
|
1792
|
+
if (stopOutsideWatchRef.current != null) {
|
|
1793
|
+
stopOutsideWatch();
|
|
1794
|
+
stopOutsideWatchRef.current = watchesOutside?.(el, dismissFromOutside) ?? null;
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
if (showPopoverElement(el)) {
|
|
1798
|
+
followShownReplacement();
|
|
1775
1799
|
} else {
|
|
1776
1800
|
afterPopoverOperations(el.ownerDocument, () => {
|
|
1777
1801
|
const current = popoverRef.current;
|
|
1778
1802
|
if (isOpenRef.current && current === el && openedPopoverRef.current !== el && showPopoverElement(el)) {
|
|
1779
|
-
|
|
1780
|
-
writeEntranceSide(el, triggerRef.current, anchorBoxes);
|
|
1803
|
+
followShownReplacement();
|
|
1781
1804
|
}
|
|
1782
1805
|
});
|
|
1783
1806
|
}
|
|
1784
1807
|
}
|
|
1785
|
-
}, [handleToggle, bindToggleListener, show, showPopoverElement, isCurrentContextPopover, keepsAnchorClear, followLayerElement]);
|
|
1808
|
+
}, [handleToggle, bindToggleListener, show, showPopoverElement, isCurrentContextPopover, keepsAnchorClear, followLayerElement, stopOutsideWatch, watchesOutside, dismissFromOutside]);
|
|
1786
1809
|
const sentinelRefCallback = useCallback(el => {
|
|
1787
1810
|
sentinelRef.current = el;
|
|
1788
1811
|
// A layer that keeps its mount re-resolves it too once it has one.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lightbox.d.ts","sourceRoot":"","sources":["../../src/Lightbox/Lightbox.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAWL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAuBf,OAA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;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,QAAQ,CAAC,EACvB,MAAM,EACN,YAAY,EACZ,KAAK,EACL,KAAK,EAAE,eAAe,EACtB,YAAgB,EAChB,aAAa,EACb,OAAe,EACf,WAAmB,EACnB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,KAAK,EACT,EAAE,aAAa,sCAoiDf;yBApjDe,QAAQ"}
|
|
@@ -73,6 +73,10 @@ import { MediaTheme } from "../theme/MediaTheme.js";
|
|
|
73
73
|
import { Text } from "../Text/Text.js";
|
|
74
74
|
import { useTruncation } from "../Text/useTruncation.js";
|
|
75
75
|
import { Link } from "../Link/Link.js";
|
|
76
|
+
import { devMissingCallback } from "../utils/devWarning.js";
|
|
77
|
+
|
|
78
|
+
// Bundlers replace this value at build time. The declaration lets a product
|
|
79
|
+
// without Node's types type-check this file.
|
|
76
80
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
77
81
|
registerEnglishFallback(english);
|
|
78
82
|
/**
|
|
@@ -694,6 +698,9 @@ export function Lightbox({
|
|
|
694
698
|
onKeyDown: onKeyDownProp,
|
|
695
699
|
...props
|
|
696
700
|
}) {
|
|
701
|
+
if (process.env.NODE_ENV !== 'production' && typeof onOpenChange !== 'function') {
|
|
702
|
+
onOpenChange = devMissingCallback('Lightbox', 'onOpenChange', 'is required to close the lightbox, for example onOpenChange={setIsOpen}. Lightbox has no onClose prop.');
|
|
703
|
+
}
|
|
697
704
|
const t = useComponentTranslator();
|
|
698
705
|
const dialogRef = useRef(null);
|
|
699
706
|
// The last input in the viewer's own document, a Picture-in-Picture window's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelector.d.ts","sourceRoot":"","sources":["../../src/MultiSelector/MultiSelector.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,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AAkB,EACrC,GAAG,SAAS,EACb,EAAE,kBAAkB,CAAC,CAAC,CAAC,qBAsrDvB;yBA7uDe,aAAa"}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import React, { use, useCallback, useEffect, useId, useImperativeHandle, useMemo, useOptimistic, useRef, useState, useTransition } from 'react';
|
|
20
20
|
import * as stylex from '@stylexjs/stylex';
|
|
21
|
+
import { withTextDirection } from "../utils/textDirection.js";
|
|
21
22
|
import { inputDisabledFocusStyles } from "../Field/inputDisabledFocus.js";
|
|
22
23
|
import { useTooltip } from "../Tooltip/index.js";
|
|
23
24
|
import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
@@ -65,6 +66,7 @@ import { useSelectorPresentation } from "../Selector/useSelectorPresentation.js"
|
|
|
65
66
|
import { selectorPresentationStyles } from "../Selector/selectorPresentation.stylex.js";
|
|
66
67
|
import { registerEnglishFallback, useComponentTranslator } from "../i18n/useComponentTranslator.js";
|
|
67
68
|
import english from "../i18n/generated-english/MultiSelector/MultiSelector.generated.js";
|
|
69
|
+
import { useListFormatter } from "../i18n/useListFormatter.js";
|
|
68
70
|
|
|
69
71
|
// Bundlers replace this value at build time. The declaration lets a product
|
|
70
72
|
// without Node's types type-check this file.
|
|
@@ -439,6 +441,7 @@ export function MultiSelector({
|
|
|
439
441
|
});
|
|
440
442
|
useDevWarning('MultiSelector', RENDER_TRIGGER_PARTS_MESSAGE, renderTrigger != null && (containerXstyle != null || containerClassName != null || containerStyle != null || controlXstyle != null || controlClassName != null || controlStyle != null));
|
|
441
443
|
const t = useComponentTranslator();
|
|
444
|
+
const formatList = useListFormatter();
|
|
442
445
|
const pressable = usePressFeedback();
|
|
443
446
|
const {
|
|
444
447
|
isRequired: isEffectivelyRequired,
|
|
@@ -1056,7 +1059,11 @@ export function MultiSelector({
|
|
|
1056
1059
|
{
|
|
1057
1060
|
const displayed = selectedLabels.slice(0, 3);
|
|
1058
1061
|
const remaining = selectedLabels.length - displayed.length;
|
|
1059
|
-
|
|
1062
|
+
// The count is the list's last item, so the locale's conjunction goes
|
|
1063
|
+
// before it and not between the shown labels.
|
|
1064
|
+
const text = formatList(remaining > 0 ? [...displayed, t('@astryx.multiSelector.overflowCount', {
|
|
1065
|
+
count: remaining
|
|
1066
|
+
})] : displayed);
|
|
1060
1067
|
return /*#__PURE__*/_jsx("span", {
|
|
1061
1068
|
...{
|
|
1062
1069
|
className: "xb3r6kr xlyipyv xuxw1ft"
|
|
@@ -1075,16 +1082,18 @@ export function MultiSelector({
|
|
|
1075
1082
|
children: [displayed.map(label => /*#__PURE__*/_jsx(Badge, {
|
|
1076
1083
|
label: label,
|
|
1077
1084
|
variant: "neutral"
|
|
1078
|
-
}, label)), remaining > 0 && /*#__PURE__*/
|
|
1085
|
+
}, label)), remaining > 0 && /*#__PURE__*/_jsx("span", {
|
|
1079
1086
|
...{
|
|
1080
1087
|
className: "x2lah0s xcr08ib x1kq96og xv1l7n4 x1e4wzip"
|
|
1081
1088
|
},
|
|
1082
|
-
children:
|
|
1089
|
+
children: t('@astryx.multiSelector.overflowCount', {
|
|
1090
|
+
count: remaining
|
|
1091
|
+
})
|
|
1083
1092
|
})]
|
|
1084
1093
|
});
|
|
1085
1094
|
}
|
|
1086
1095
|
}
|
|
1087
|
-
}, [optimisticValue, triggerDisplay, selectedItems, selectedLabels, placeholder, formatValue, maxBadges, t]);
|
|
1096
|
+
}, [optimisticValue, triggerDisplay, selectedItems, selectedLabels, placeholder, formatValue, maxBadges, t, formatList]);
|
|
1088
1097
|
|
|
1089
1098
|
// Render search input
|
|
1090
1099
|
const renderSearch = useCallback(() => {
|
|
@@ -1406,6 +1415,11 @@ export function MultiSelector({
|
|
|
1406
1415
|
// In a bottom sheet, or hung off a caller's anchor that may not take focus,
|
|
1407
1416
|
// the listbox itself owns the keyboard.
|
|
1408
1417
|
const listboxOwnsKeyboard = surface.activePresentation === 'bottom-sheet' || hasExternalTrigger;
|
|
1418
|
+
// A bottom sheet is a modal layer, so Chromium cannot reliably compute the
|
|
1419
|
+
// listbox's name from the trigger outside that layer.
|
|
1420
|
+
const panelListboxLabelProps = surface.activePresentation === 'bottom-sheet' ? {
|
|
1421
|
+
'aria-label': label
|
|
1422
|
+
} : listboxLabelProps;
|
|
1409
1423
|
const panelContent = hasSearch ? /*#__PURE__*/_jsxs("div", {
|
|
1410
1424
|
...{
|
|
1411
1425
|
className: "x78zum5 xdt5ytf x3v4n1"
|
|
@@ -1419,7 +1433,7 @@ export function MultiSelector({
|
|
|
1419
1433
|
id: listboxId,
|
|
1420
1434
|
role: isGrid ? 'grid' : 'listbox',
|
|
1421
1435
|
"aria-multiselectable": "true",
|
|
1422
|
-
...
|
|
1436
|
+
...panelListboxLabelProps,
|
|
1423
1437
|
...{
|
|
1424
1438
|
className: "x1a2a7pz"
|
|
1425
1439
|
},
|
|
@@ -1434,16 +1448,8 @@ export function MultiSelector({
|
|
|
1434
1448
|
ref: listboxRef,
|
|
1435
1449
|
id: listboxId,
|
|
1436
1450
|
role: isGrid ? 'grid' : 'listbox',
|
|
1437
|
-
"aria-multiselectable": "true"
|
|
1438
|
-
|
|
1439
|
-
// reliably compute this listbox's name from the trigger outside that
|
|
1440
|
-
// layer. Name only this no-search sheet directly from the component's
|
|
1441
|
-
// existing label; searchable sheets and popovers retain their current
|
|
1442
|
-
// trigger relationship.
|
|
1443
|
-
,
|
|
1444
|
-
...(surface.activePresentation === 'bottom-sheet' ? {
|
|
1445
|
-
'aria-label': label
|
|
1446
|
-
} : listboxLabelProps),
|
|
1451
|
+
"aria-multiselectable": "true",
|
|
1452
|
+
...panelListboxLabelProps,
|
|
1447
1453
|
"aria-activedescendant": activeDescendantId,
|
|
1448
1454
|
tabIndex: listboxOwnsKeyboard ? 0 : undefined,
|
|
1449
1455
|
onKeyDown: listboxOwnsKeyboard ? onKeyDown : undefined,
|
|
@@ -1693,7 +1699,7 @@ export function MultiSelector({
|
|
|
1693
1699
|
state: surface.isOpen ? 'expanded' : 'collapsed'
|
|
1694
1700
|
})
|
|
1695
1701
|
}) : null]
|
|
1696
|
-
}), selectionSurface, showStatusTooltip && statusTooltip.renderTooltip(status?.message ?? ''), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
1702
|
+
}), selectionSurface, showStatusTooltip && statusTooltip.renderTooltip(withTextDirection(status?.message ?? '')), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
1697
1703
|
});
|
|
1698
1704
|
if (inputGroup) {
|
|
1699
1705
|
return multiSelectorContent;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @file NavIcon.tsx
|
|
3
3
|
* @input Uses React, HTMLAttributes, ReactNode
|
|
4
4
|
* @output Exports NavIcon component and NavIconProps
|
|
5
|
-
* @position Shared circular icon container for navigation
|
|
5
|
+
* @position Shared circular icon container for navigation headings (TopNavHeading, SideNavHeading)
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update these files to stay in sync:
|
|
8
8
|
* - /packages/core/src/NavIcon/NavIcon.doc.mjs
|
|
@@ -35,7 +35,7 @@ export interface NavIconProps extends BaseProps<HTMLSpanElement> {
|
|
|
35
35
|
* heading="Dashboard"
|
|
36
36
|
* logo={<NavIcon icon={<HomeIcon style={{width: 16, height: 16}} />} />}
|
|
37
37
|
* />
|
|
38
|
-
* <
|
|
38
|
+
* <SideNavHeading
|
|
39
39
|
* icon={<NavIcon icon={<HomeIcon style={{width: 16, height: 16}} />} />}
|
|
40
40
|
* heading="My App"
|
|
41
41
|
* />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavIcon.d.ts","sourceRoot":"","sources":["../../src/NavIcon/NavIcon.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"NavIcon.d.ts","sourceRoot":"","sources":["../../src/NavIcon/NavIcon.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAwB5C,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC9D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,OAAO,CAAC,EACtB,IAAI,EACJ,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,YAAY,+BAcd;yBArBe,OAAO"}
|
package/dist/NavIcon/NavIcon.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @file NavIcon.tsx
|
|
5
5
|
* @input Uses React, HTMLAttributes, ReactNode
|
|
6
6
|
* @output Exports NavIcon component and NavIconProps
|
|
7
|
-
* @position Shared circular icon container for navigation
|
|
7
|
+
* @position Shared circular icon container for navigation headings (TopNavHeading, SideNavHeading)
|
|
8
8
|
*
|
|
9
9
|
* SYNC: When modified, update these files to stay in sync:
|
|
10
10
|
* - /packages/core/src/NavIcon/NavIcon.doc.mjs
|
|
@@ -51,7 +51,7 @@ const styles = {
|
|
|
51
51
|
* heading="Dashboard"
|
|
52
52
|
* logo={<NavIcon icon={<HomeIcon style={{width: 16, height: 16}} />} />}
|
|
53
53
|
* />
|
|
54
|
-
* <
|
|
54
|
+
* <SideNavHeading
|
|
55
55
|
* icon={<NavIcon icon={<HomeIcon style={{width: 16, height: 16}} />} />}
|
|
56
56
|
* heading="My App"
|
|
57
57
|
* />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavHeadingMenuItem.d.ts","sourceRoot":"","sources":["../../src/NavMenu/NavHeadingMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NavHeadingMenuItem.d.ts","sourceRoot":"","sources":["../../src/NavMenu/NavHeadingMenuItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAatD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsE5C,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CACnD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B,wCAAwC;IACxC,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,0BAA0B;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,IAAI,EACJ,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,SAAS,EACb,EAAE,uBAAuB,qBAwEzB;yBArFe,kBAAkB"}
|
|
@@ -16,7 +16,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
16
16
|
import { renderIconSlot } from "../Icon/index.js";
|
|
17
17
|
import { Text } from "../Text/index.js";
|
|
18
18
|
import "../theme/tokens.stylex.js";
|
|
19
|
-
import { colorVars,
|
|
19
|
+
import { colorVars, focusVars, radiusVars, spacingVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
20
20
|
import { composeEventHandlers } from "../utils/composeEventHandlers.js";
|
|
21
21
|
import { mergeProps } from "../utils/mergeProps.js";
|
|
22
22
|
import { useFocusAcrossSwap } from "../utils/useFocusAcrossSwap.js";
|
|
@@ -25,6 +25,7 @@ import { useLinkComponent } from "../Link/useLinkComponent.js";
|
|
|
25
25
|
import { themeProps } from "../utils/themeProps.js";
|
|
26
26
|
import { isRenderable } from "../utils/isRenderable.js";
|
|
27
27
|
import { keepDisabledRowUnfocused } from "../DropdownMenu/menuItemRoles.js";
|
|
28
|
+
import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
|
|
28
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
30
|
const styles = {
|
|
30
31
|
root: {
|
|
@@ -44,7 +45,7 @@ const styles = {
|
|
|
44
45
|
ksu8eU: "xng3xce",
|
|
45
46
|
kkrTdU: "x1ypdohk x16khyan",
|
|
46
47
|
k9WMMc: "x1yc453h",
|
|
47
|
-
|
|
48
|
+
kInvED: "x1c097ug",
|
|
48
49
|
kybGjl: "x1hl2dhg",
|
|
49
50
|
$$css: true
|
|
50
51
|
},
|
|
@@ -139,7 +140,7 @@ export function NavHeadingMenuItem({
|
|
|
139
140
|
"data-testid": testId,
|
|
140
141
|
...mergeProps(themeProps('nav-heading-menu-item', {
|
|
141
142
|
size
|
|
142
|
-
}), stylex.props(styles.root, sizeStyles[size], isDisabled && styles.disabled, xstyle), className, style),
|
|
143
|
+
}), stylex.props(focusOutlineStyles.focusVisible, styles.root, sizeStyles[size], isDisabled && styles.disabled, xstyle), className, style),
|
|
143
144
|
children: [icon && renderIconSlot(icon, {
|
|
144
145
|
size: 'sm',
|
|
145
146
|
color: 'secondary'
|
|
@@ -21,13 +21,19 @@ import { type InputStatus } from '../Field/index.js';
|
|
|
21
21
|
import { type IconType } from '../Icon/index.js';
|
|
22
22
|
declare const sizeStyles: Readonly<{
|
|
23
23
|
readonly sm: Readonly<{
|
|
24
|
-
readonly height: stylex.StyleXClassNameFor<"height", "28px"
|
|
24
|
+
readonly height: stylex.StyleXClassNameFor<"height", `max(${stylex.StyleXVar<"28px">}, ${string})` | {
|
|
25
|
+
readonly '@supports (-webkit-touch-callout: none)': `max(${stylex.StyleXVar<"28px">}, ${string})`;
|
|
26
|
+
}>;
|
|
25
27
|
}>;
|
|
26
28
|
readonly md: Readonly<{
|
|
27
|
-
readonly height: stylex.StyleXClassNameFor<"height", "32px"
|
|
29
|
+
readonly height: stylex.StyleXClassNameFor<"height", `max(${stylex.StyleXVar<"32px">}, ${string})` | {
|
|
30
|
+
readonly '@supports (-webkit-touch-callout: none)': `max(${stylex.StyleXVar<"32px">}, ${string})`;
|
|
31
|
+
}>;
|
|
28
32
|
}>;
|
|
29
33
|
readonly lg: Readonly<{
|
|
30
|
-
readonly height: stylex.StyleXClassNameFor<"height", "36px"
|
|
34
|
+
readonly height: stylex.StyleXClassNameFor<"height", `max(${stylex.StyleXVar<"36px">}, ${string})` | {
|
|
35
|
+
readonly '@supports (-webkit-touch-callout: none)': `max(${stylex.StyleXVar<"36px">}, ${string})`;
|
|
36
|
+
}>;
|
|
31
37
|
}>;
|
|
32
38
|
}>;
|
|
33
39
|
export type NumberInputSize = keyof typeof sizeStyles;
|
|
@@ -253,7 +259,8 @@ interface NumberInputPropsBase extends Omit<FieldInputBaseProps, 'onChange' | 'd
|
|
|
253
259
|
step?: number | null;
|
|
254
260
|
/**
|
|
255
261
|
* Formats the committed value while the input is not being edited.
|
|
256
|
-
* The
|
|
262
|
+
* The plain number, with the locale's decimal separator, is shown on focus
|
|
263
|
+
* so it remains editable.
|
|
257
264
|
*/
|
|
258
265
|
formatValue?: (value: number) => string;
|
|
259
266
|
/**
|
|
@@ -306,7 +313,8 @@ type NumberInputPropsNonClearable = NumberInputPropsBase & {
|
|
|
306
313
|
};
|
|
307
314
|
type NumberInputPropsClearable = NumberInputPropsBase & {
|
|
308
315
|
/**
|
|
309
|
-
* Whether to show a clear button when a value is set
|
|
316
|
+
* Whether to show a clear button when a value is set and the field is
|
|
317
|
+
* editable (not disabled or read-only).
|
|
310
318
|
* When clicked, resets the value to null and returns focus to the input.
|
|
311
319
|
*
|
|
312
320
|
* When enabled, the `onChange` callback type widens to also accept `null`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../src/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,aAAa,EAGlB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"NumberInput.d.ts","sourceRoot":"","sources":["../../src/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAQL,KAAK,UAAU,EACf,KAAK,aAAa,EAGlB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAQ3C,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AA+J5D,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;EAAqB,CAAC;AAEtC,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,UAAU,CAAC;AAMtD,YAAY,EACV,WAAW,IAAI,iBAAiB,EAChC,eAAe,IAAI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AAO,EACP,SAAS,EACT,KAAK,EACL,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,EAAE,EAAE,MAAM,EACV,kBAAkB,EAAE,mBAAmB,EACvC,iBAAiB,EAAE,kBAAkB,EACrC,GAAG,SAAS,EACb,EAAE,gBAAgB,+BA03BlB;yBA56Be,WAAW"}
|
|
@@ -23,7 +23,7 @@ import { use, useId, useState, useMemo, useCallback, useEffect, useRef } from 'r
|
|
|
23
23
|
import { flushSync } from 'react-dom';
|
|
24
24
|
import * as stylex from '@stylexjs/stylex';
|
|
25
25
|
import "../theme/tokens.stylex.js";
|
|
26
|
-
import { colorVars,
|
|
26
|
+
import { colorVars, spacingVars, typographyVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
|
|
27
27
|
import { Field, InputClearButton, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
|
|
28
28
|
import { Icon, renderIconSlot } from "../Icon/index.js";
|
|
29
29
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
@@ -35,6 +35,7 @@ import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js"
|
|
|
35
35
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
36
36
|
import { lockSelection, locksSelectionFor } from "../utils/selectionLock.js";
|
|
37
37
|
import { inputDisabledFocusStyles } from "../Field/inputDisabledFocus.js";
|
|
38
|
+
import { inputRowSizeStyles, inputRowStepperSizeStyles } from "../Field/inputStyles.stylex.js";
|
|
38
39
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
39
40
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
40
41
|
import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
@@ -112,20 +113,7 @@ const styles = {
|
|
|
112
113
|
$$css: true
|
|
113
114
|
}
|
|
114
115
|
};
|
|
115
|
-
const sizeStyles =
|
|
116
|
-
sm: {
|
|
117
|
-
kZKoxP: "x6k0iem",
|
|
118
|
-
$$css: true
|
|
119
|
-
},
|
|
120
|
-
md: {
|
|
121
|
-
kZKoxP: "x1ueg155",
|
|
122
|
-
$$css: true
|
|
123
|
-
},
|
|
124
|
-
lg: {
|
|
125
|
-
kZKoxP: "xssyfek",
|
|
126
|
-
$$css: true
|
|
127
|
-
}
|
|
128
|
-
};
|
|
116
|
+
const sizeStyles = inputRowSizeStyles;
|
|
129
117
|
import { groupStyles, inputGroupItemProps } from "../InputGroup/groupStyles.js";
|
|
130
118
|
|
|
131
119
|
// Re-export shared types for convenience
|
|
@@ -458,7 +446,8 @@ export function NumberInput({
|
|
|
458
446
|
}, [formatValue, value]);
|
|
459
447
|
|
|
460
448
|
// Preserve pending text while editing. Otherwise show the formatted value
|
|
461
|
-
// at rest and
|
|
449
|
+
// at rest and, while focused, the plain number with the locale's decimal
|
|
450
|
+
// separator so it remains editable.
|
|
462
451
|
const displayValue = useMemo(() => {
|
|
463
452
|
if (holdDraft !== null) {
|
|
464
453
|
return formatEditableNumber(holdDraft, locale);
|
|
@@ -870,7 +859,7 @@ export function NumberInput({
|
|
|
870
859
|
status: fieldStatus?.type ?? null,
|
|
871
860
|
disabled: isDisabled ? 'disabled' : null,
|
|
872
861
|
readonly: isReadOnly ? 'readonly' : null
|
|
873
|
-
}), stylex.props(inputWrapperStyles.base, inputWrapperStyles.textField, styles.wrapper, hasNumberSteppers && styles.wrapperWithNumberSteppers, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, isDisabled && inputDisabledFocusStyles.ring, fieldStatus && inputStatusBorderStyles[fieldStatus.type], fieldStatus && !isDisabled && inputStatusHoverShadowStyles[fieldStatus.type], fieldStatus && inputStatusFocusWithinStyles[fieldStatus.type], inputGroup && groupStyles.inGroup, controlXstyle), controlClassName, controlStyle),
|
|
862
|
+
}), stylex.props(inputWrapperStyles.base, inputWrapperStyles.textField, styles.wrapper, hasNumberSteppers && styles.wrapperWithNumberSteppers, sizeStyles[size], hasNumberSteppers && inputRowStepperSizeStyles[size], isDisabled && inputWrapperStyles.disabled, isDisabled && inputDisabledFocusStyles.ring, fieldStatus && inputStatusBorderStyles[fieldStatus.type], fieldStatus && !isDisabled && inputStatusHoverShadowStyles[fieldStatus.type], fieldStatus && inputStatusFocusWithinStyles[fieldStatus.type], inputGroup && groupStyles.inGroup, controlXstyle), controlClassName, controlStyle),
|
|
874
863
|
children: [startIcon && renderIconSlot(startIcon, {
|
|
875
864
|
size: 'sm',
|
|
876
865
|
color: 'secondary'
|