@astryxdesign/core 0.7.17 → 0.7.18-canary.g32556bb
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/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +2 -2
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +3 -7
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +10 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +11 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +203 -51
- 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/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +20 -3
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +3 -3
- package/dist/astryx.css +41 -10
- 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/themeProps.d.ts.map +1 -1
- package/dist/utils/themeProps.js +22 -3
- 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 +63 -6
- package/src/Table/Table.tsx +9 -4
- package/src/Table/TableCell.tsx +5 -2
- package/src/Table/TableHeaderCell.tsx +2 -8
- package/src/Table/TableRow.tsx +10 -1
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +250 -53
- 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/Toolbar/Toolbar.tsx +20 -6
- 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/themeProps.ts +22 -3
- package/src/utils/touchHitArea.ts +3 -2
- package/src/virtualization/useInlineListWindow.ts +102 -11
|
@@ -24,6 +24,8 @@ import {
|
|
|
24
24
|
useLayoutEffect,
|
|
25
25
|
useMemo,
|
|
26
26
|
useRef,
|
|
27
|
+
useState,
|
|
28
|
+
useSyncExternalStore,
|
|
27
29
|
type ReactNode,
|
|
28
30
|
type RefObject,
|
|
29
31
|
} from 'react';
|
|
@@ -59,6 +61,7 @@ import type {
|
|
|
59
61
|
ScrollWrapperRenderProps,
|
|
60
62
|
} from '../../types';
|
|
61
63
|
import {LayoutChangeSnapshot} from '../../../motion/LayoutChangeSnapshot';
|
|
64
|
+
import {useCommittedRef} from '../../../hooks/useCommittedRef';
|
|
62
65
|
import {
|
|
63
66
|
applyLayoutChangeTransition,
|
|
64
67
|
glideOf,
|
|
@@ -284,12 +287,11 @@ const expansionStyles = stylex.create({
|
|
|
284
287
|
* So the row gives up its border and the panel takes one. On a table with no
|
|
285
288
|
* row dividers the suppression is a no-op (there was no border to remove) and
|
|
286
289
|
* the panel's is never applied, so neither needs to consult the divider mode.
|
|
290
|
+
* The open panel sets its row's private divider width to 0
|
|
291
|
+
* (OPEN_ROW_DIVIDER_WIDTH), which TableCell's own divider style reads, so a
|
|
292
|
+
* toggle needs no render of the row.
|
|
287
293
|
*/
|
|
288
294
|
const dividerStyles = stylex.create({
|
|
289
|
-
expandedRowCell: {
|
|
290
|
-
'--_table-row-divider-width': '0px',
|
|
291
|
-
borderBottomWidth: 0,
|
|
292
|
-
},
|
|
293
295
|
// The row's divider, carried down: its row's themed or app-set border
|
|
294
296
|
// reaches the panel through `--_table-panel-divider-*` on the panel's cell
|
|
295
297
|
// (set after each commit, see ExpansionPanelCell), the tokens otherwise.
|
|
@@ -607,6 +609,175 @@ function ExpansionSnapshot({
|
|
|
607
609
|
return <LayoutChangeSnapshot value={value} onBeforeChange={onBeforeChange} />;
|
|
608
610
|
}
|
|
609
611
|
|
|
612
|
+
// =============================================================================
|
|
613
|
+
// Expansion store
|
|
614
|
+
// =============================================================================
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* The private divider width an open row's cells read (TableCell): the panel
|
|
618
|
+
* below carries the divider, so the row shows none.
|
|
619
|
+
*/
|
|
620
|
+
const OPEN_ROW_DIVIDER_WIDTH = '--_table-open-row-divider-width';
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* The expanded keys, held outside the plugin object. A toggle changes only
|
|
624
|
+
* the store, so the plugin keeps its identity and the table re-renders no
|
|
625
|
+
* row: the chevron, the panel and the glide's measurement each subscribe to
|
|
626
|
+
* the key or keys they show.
|
|
627
|
+
*/
|
|
628
|
+
interface ExpansionStore {
|
|
629
|
+
get: () => Set<string>;
|
|
630
|
+
set: (next: Set<string>) => void;
|
|
631
|
+
subscribe: (listener: () => void) => () => void;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
function createExpansionStore(initial: Set<string>): ExpansionStore {
|
|
635
|
+
let current = initial;
|
|
636
|
+
const listeners = new Set<() => void>();
|
|
637
|
+
return {
|
|
638
|
+
get: () => current,
|
|
639
|
+
set: next => {
|
|
640
|
+
if (Object.is(next, current)) {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
current = next;
|
|
644
|
+
// Each subscriber re-renders only if what it reads changed.
|
|
645
|
+
for (const listener of [...listeners]) {
|
|
646
|
+
listener();
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
subscribe: listener => {
|
|
650
|
+
listeners.add(listener);
|
|
651
|
+
return () => {
|
|
652
|
+
listeners.delete(listener);
|
|
653
|
+
};
|
|
654
|
+
},
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function useIsExpanded(store: ExpansionStore, key: string): boolean {
|
|
659
|
+
const read = () => store.get().has(key);
|
|
660
|
+
return useSyncExternalStore(store.subscribe, read, read);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/** The chevron for one row, re-rendered only when that row toggles. */
|
|
664
|
+
function ExpansionChevronCell({
|
|
665
|
+
store,
|
|
666
|
+
rowKey,
|
|
667
|
+
rowLabel,
|
|
668
|
+
onToggle,
|
|
669
|
+
}: {
|
|
670
|
+
store: ExpansionStore;
|
|
671
|
+
rowKey: string;
|
|
672
|
+
rowLabel?: string;
|
|
673
|
+
onToggle: (key: string) => void;
|
|
674
|
+
}) {
|
|
675
|
+
const isExpanded = useIsExpanded(store, rowKey);
|
|
676
|
+
return (
|
|
677
|
+
<ExpansionChevron
|
|
678
|
+
rowLabel={rowLabel}
|
|
679
|
+
isExpanded={isExpanded}
|
|
680
|
+
onToggle={() => onToggle(rowKey)}
|
|
681
|
+
/>
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/** One row's detail panel, rendered only while that row is expanded. */
|
|
686
|
+
function ExpansionPanelRow<T>({
|
|
687
|
+
store,
|
|
688
|
+
rowKey,
|
|
689
|
+
colSpan,
|
|
690
|
+
cellsRef,
|
|
691
|
+
isMuted,
|
|
692
|
+
item,
|
|
693
|
+
renderExpanded,
|
|
694
|
+
}: {
|
|
695
|
+
store: ExpansionStore;
|
|
696
|
+
rowKey: string;
|
|
697
|
+
colSpan: number;
|
|
698
|
+
cellsRef: RefObject<Set<HTMLTableCellElement>>;
|
|
699
|
+
isMuted: boolean;
|
|
700
|
+
item: T;
|
|
701
|
+
renderExpanded: (item: T) => ReactNode;
|
|
702
|
+
}) {
|
|
703
|
+
const isOpen = useIsExpanded(store, rowKey);
|
|
704
|
+
// While mounted, the panel hands its row's divider to itself: it sets the
|
|
705
|
+
// row's private divider width (TableCell reads it), in the same commit.
|
|
706
|
+
// The row is found by its key, as another plugin's afterRow may sit
|
|
707
|
+
// between them.
|
|
708
|
+
const markRow = useCallback(
|
|
709
|
+
(panel: HTMLTableRowElement | null) => {
|
|
710
|
+
const row = panel?.parentElement?.querySelector<HTMLElement>(
|
|
711
|
+
`:scope > tr[data-expansion-key="${CSS.escape(rowKey)}"]`,
|
|
712
|
+
);
|
|
713
|
+
if (row == null) {
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
row.style.setProperty(OPEN_ROW_DIVIDER_WIDTH, '0px');
|
|
717
|
+
return () => {
|
|
718
|
+
row.style.removeProperty(OPEN_ROW_DIVIDER_WIDTH);
|
|
719
|
+
};
|
|
720
|
+
},
|
|
721
|
+
[rowKey],
|
|
722
|
+
);
|
|
723
|
+
if (!isOpen) {
|
|
724
|
+
return null;
|
|
725
|
+
}
|
|
726
|
+
return (
|
|
727
|
+
<tr
|
|
728
|
+
ref={markRow}
|
|
729
|
+
// A panel is its row's continuation, not a row of its own. Striping
|
|
730
|
+
// counts `:nth-child(even of :not([data-expansion-panel]))`, so this
|
|
731
|
+
// attribute is what keeps an open panel from inverting the zebra of
|
|
732
|
+
// every row beneath it. Load-bearing, not diagnostic.
|
|
733
|
+
data-expansion-panel=""
|
|
734
|
+
{...stylex.props(
|
|
735
|
+
// Carries the marker so the panel cell's divider can ask whether
|
|
736
|
+
// this row is the table's last, the same way TableCell does.
|
|
737
|
+
tableRowMarker,
|
|
738
|
+
glidingDividerStyles.row,
|
|
739
|
+
)}>
|
|
740
|
+
<ExpansionPanelCell
|
|
741
|
+
colSpan={colSpan}
|
|
742
|
+
cellsRef={cellsRef}
|
|
743
|
+
isMuted={isMuted}>
|
|
744
|
+
{renderExpanded(item)}
|
|
745
|
+
</ExpansionPanelCell>
|
|
746
|
+
</tr>
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* The glide's measurement, fed by the store: it renders in the same commit
|
|
752
|
+
* as the panels, so it measures before they change the DOM and plays the
|
|
753
|
+
* glide after (`onAfterChange`).
|
|
754
|
+
*/
|
|
755
|
+
function ExpansionSnapshotFromStore({
|
|
756
|
+
store,
|
|
757
|
+
onBeforeChange,
|
|
758
|
+
onAfterChange,
|
|
759
|
+
onColumnLines,
|
|
760
|
+
}: {
|
|
761
|
+
store: ExpansionStore;
|
|
762
|
+
onBeforeChange: (previous: Set<string>) => void;
|
|
763
|
+
onAfterChange: () => void;
|
|
764
|
+
onColumnLines: () => void;
|
|
765
|
+
}) {
|
|
766
|
+
const value = useSyncExternalStore(store.subscribe, store.get, store.get);
|
|
767
|
+
useLayoutEffect(() => {
|
|
768
|
+
// Plays the pending glides (Web Animations) after the commit that changed
|
|
769
|
+
// the panels.
|
|
770
|
+
onAfterChange();
|
|
771
|
+
}, [value, onAfterChange]);
|
|
772
|
+
return (
|
|
773
|
+
<ExpansionSnapshot
|
|
774
|
+
value={value}
|
|
775
|
+
onBeforeChange={onBeforeChange}
|
|
776
|
+
onColumnLines={onColumnLines}
|
|
777
|
+
/>
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
|
|
610
781
|
// =============================================================================
|
|
611
782
|
// Hook
|
|
612
783
|
// =============================================================================
|
|
@@ -621,8 +792,16 @@ function ExpansionSnapshot({
|
|
|
621
792
|
* For hierarchical data (child rows sharing the parent columns) use
|
|
622
793
|
* `useTableTreeData` + `useTableTreeState` instead.
|
|
623
794
|
*
|
|
795
|
+
* A toggle re-renders no other row while `getRowKey`, `getRowLabel`,
|
|
796
|
+
* `getIsItemExpandable` and `renderExpanded` keep their identity (defined
|
|
797
|
+
* outside the component, or memoized). `onToggle` can be written inline.
|
|
798
|
+
*
|
|
624
799
|
* @example
|
|
625
800
|
* ```
|
|
801
|
+
* const getRowKey = (item: Order) => item.id;
|
|
802
|
+
* const getRowLabel = (item: Order) => item.name;
|
|
803
|
+
* const renderExpanded = (item: Order) => <OrderDetails order={item} />;
|
|
804
|
+
*
|
|
626
805
|
* const [expandedKeys, setExpandedKeys] = useState<Set<string>>(new Set());
|
|
627
806
|
* const expansion = useTableRowExpansion({
|
|
628
807
|
* expandedKeys,
|
|
@@ -632,9 +811,9 @@ function ExpansionSnapshot({
|
|
|
632
811
|
* next.has(key) ? next.delete(key) : next.add(key);
|
|
633
812
|
* return next;
|
|
634
813
|
* }),
|
|
635
|
-
* getRowKey
|
|
636
|
-
* getRowLabel
|
|
637
|
-
* renderExpanded
|
|
814
|
+
* getRowKey,
|
|
815
|
+
* getRowLabel,
|
|
816
|
+
* renderExpanded,
|
|
638
817
|
* });
|
|
639
818
|
* <Table data={data} columns={columns} idKey="id" plugins={{expansion}} />;
|
|
640
819
|
* ```
|
|
@@ -656,6 +835,23 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
656
835
|
|
|
657
836
|
const t = useComponentTranslator();
|
|
658
837
|
|
|
838
|
+
// The expanded keys live in a store, so a toggle leaves the plugin object
|
|
839
|
+
// as it is and re-renders no row: the chevron, the panel and the glide's
|
|
840
|
+
// measurement each subscribe to the keys they show. The caller's other
|
|
841
|
+
// callbacks stay memo inputs, so a changed callback re-renders the rows.
|
|
842
|
+
const [store] = useState(() => createExpansionStore(expandedKeys));
|
|
843
|
+
useLayoutEffect(() => {
|
|
844
|
+
// Syncs the expansion store with the controlled expandedKeys, after the
|
|
845
|
+
// commit and before the frame paints.
|
|
846
|
+
store.set(expandedKeys);
|
|
847
|
+
}, [store, expandedKeys]);
|
|
848
|
+
// Read only in the chevron, row-click and menu handlers.
|
|
849
|
+
const onToggleRef = useCommittedRef(onToggle);
|
|
850
|
+
const toggle = useCallback(
|
|
851
|
+
(key: string) => onToggleRef.current(key),
|
|
852
|
+
[onToggleRef],
|
|
853
|
+
);
|
|
854
|
+
|
|
659
855
|
// Final rendered column count, captured in transformColumns (pipeline step
|
|
660
856
|
// 1) and read in transformBodyRow for the detail panel's colSpan.
|
|
661
857
|
const columnCountRef = useRef(1);
|
|
@@ -697,6 +893,7 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
697
893
|
if (animatedLayout == null) {
|
|
698
894
|
return;
|
|
699
895
|
}
|
|
896
|
+
const expandedKeys = store.get();
|
|
700
897
|
const changed = [
|
|
701
898
|
...[...previous].filter(key => !expandedKeys.has(key)),
|
|
702
899
|
...[...expandedKeys].filter(key => !previous.has(key)),
|
|
@@ -740,7 +937,7 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
740
937
|
});
|
|
741
938
|
}
|
|
742
939
|
},
|
|
743
|
-
[animatedLayout,
|
|
940
|
+
[animatedLayout, store, rowFor],
|
|
744
941
|
);
|
|
745
942
|
// The chevrons back on the theme's own turn: a spring a handle set stays
|
|
746
943
|
// only while the glide runs (`spec:AST-105` FR2), so it goes without a
|
|
@@ -764,7 +961,7 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
764
961
|
}
|
|
765
962
|
}, [animatedLayout, resetChevrons]);
|
|
766
963
|
|
|
767
|
-
|
|
964
|
+
const playPendingGlides = useCallback(() => {
|
|
768
965
|
const pendings = pendingLayoutRef.current;
|
|
769
966
|
pendingLayoutRef.current = [];
|
|
770
967
|
// The rows that changed, each with the panel it opened (if that panel
|
|
@@ -874,7 +1071,7 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
874
1071
|
hold(heldHeightRef.current);
|
|
875
1072
|
});
|
|
876
1073
|
});
|
|
877
|
-
}, [
|
|
1074
|
+
}, [animatedLayout, rowFor]);
|
|
878
1075
|
|
|
879
1076
|
const expansionColumn = useMemo(
|
|
880
1077
|
(): TableColumn<T> => ({
|
|
@@ -895,18 +1092,17 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
895
1092
|
if (!expandable) {
|
|
896
1093
|
return null;
|
|
897
1094
|
}
|
|
898
|
-
const key = getRowKey(item);
|
|
899
|
-
const isExpanded = expandedKeys.has(key);
|
|
900
1095
|
return (
|
|
901
|
-
<
|
|
1096
|
+
<ExpansionChevronCell
|
|
1097
|
+
store={store}
|
|
1098
|
+
rowKey={getRowKey(item)}
|
|
902
1099
|
rowLabel={getRowLabel?.(item)?.trim() || undefined}
|
|
903
|
-
|
|
904
|
-
onToggle={() => onToggle(key)}
|
|
1100
|
+
onToggle={toggle}
|
|
905
1101
|
/>
|
|
906
1102
|
);
|
|
907
1103
|
},
|
|
908
1104
|
}),
|
|
909
|
-
[
|
|
1105
|
+
[store, toggle, getRowKey, getIsItemExpandable, getRowLabel, t],
|
|
910
1106
|
);
|
|
911
1107
|
|
|
912
1108
|
return useMemo(
|
|
@@ -951,7 +1147,8 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
951
1147
|
return props;
|
|
952
1148
|
}
|
|
953
1149
|
const key = getRowKey(item);
|
|
954
|
-
|
|
1150
|
+
// Read when the menu opens: a toggle does not render this row again.
|
|
1151
|
+
const isOpen = () => store.get().has(key);
|
|
955
1152
|
return {
|
|
956
1153
|
...props,
|
|
957
1154
|
xstyle: [
|
|
@@ -960,29 +1157,26 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
960
1157
|
...(column.key === EXPANSION_COLUMN_KEY
|
|
961
1158
|
? [chevronCellStyles.cell]
|
|
962
1159
|
: []),
|
|
963
|
-
// Hand the row divider to the panel below, so the line closes the
|
|
964
|
-
// row-plus-panel pair instead of splitting it.
|
|
965
|
-
...(isExpanded ? [dividerStyles.expandedRowCell] : []),
|
|
966
1160
|
],
|
|
967
1161
|
contextMenuActions: () => [
|
|
968
1162
|
...resolveContextActions(props.contextMenuActions),
|
|
969
1163
|
{
|
|
970
1164
|
id: 'row-expansion-toggle',
|
|
971
1165
|
group: 'row-expansion',
|
|
972
|
-
label:
|
|
1166
|
+
label: isOpen()
|
|
973
1167
|
? t('@astryx.tableRowExpansion.collapseRow')
|
|
974
1168
|
: t('@astryx.tableRowExpansion.expandRow'),
|
|
975
1169
|
icon: (
|
|
976
1170
|
<Icon
|
|
977
|
-
icon={
|
|
1171
|
+
icon={isOpen() ? 'chevronDown' : 'chevronRight'}
|
|
978
1172
|
size="xsm"
|
|
979
1173
|
aria-hidden
|
|
980
1174
|
// chevronDown needs no mirroring; chevronRight (collapsed,
|
|
981
1175
|
// pointing toward the reveal direction) does.
|
|
982
|
-
xstyle={!
|
|
1176
|
+
xstyle={!isOpen() && rtlStyles.mirror}
|
|
983
1177
|
/>
|
|
984
1178
|
),
|
|
985
|
-
onSelect: () =>
|
|
1179
|
+
onSelect: () => toggle(key),
|
|
986
1180
|
},
|
|
987
1181
|
],
|
|
988
1182
|
};
|
|
@@ -1020,9 +1214,10 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
1020
1214
|
) : (
|
|
1021
1215
|
<>
|
|
1022
1216
|
{props.beforeTable}
|
|
1023
|
-
<
|
|
1024
|
-
|
|
1217
|
+
<ExpansionSnapshotFromStore
|
|
1218
|
+
store={store}
|
|
1025
1219
|
onBeforeChange={measureChanges}
|
|
1220
|
+
onAfterChange={playPendingGlides}
|
|
1026
1221
|
onColumnLines={resetChevrons}
|
|
1027
1222
|
/>
|
|
1028
1223
|
</>
|
|
@@ -1042,9 +1237,24 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
1042
1237
|
const keyAttribute: Record<string, string> = {
|
|
1043
1238
|
'data-expansion-key': key,
|
|
1044
1239
|
};
|
|
1240
|
+
// A row that renders open carries its private divider width in its
|
|
1241
|
+
// own markup too, so a server render draws the divider on the panel
|
|
1242
|
+
// before hydration. After that, the panel sets and clears it.
|
|
1243
|
+
const isOpenNow = store.get().has(key);
|
|
1045
1244
|
const keyed = {
|
|
1046
1245
|
...props,
|
|
1047
|
-
htmlProps: {
|
|
1246
|
+
htmlProps: {
|
|
1247
|
+
...props.htmlProps,
|
|
1248
|
+
...keyAttribute,
|
|
1249
|
+
...(isOpenNow
|
|
1250
|
+
? {
|
|
1251
|
+
style: {
|
|
1252
|
+
...props.htmlProps.style,
|
|
1253
|
+
[OPEN_ROW_DIVIDER_WIDTH]: '0px',
|
|
1254
|
+
} as React.CSSProperties,
|
|
1255
|
+
}
|
|
1256
|
+
: {}),
|
|
1257
|
+
},
|
|
1048
1258
|
};
|
|
1049
1259
|
|
|
1050
1260
|
// Whole-row-click expansion (opt-in), applied before the collapsed
|
|
@@ -1089,38 +1299,24 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
1089
1299
|
return;
|
|
1090
1300
|
}
|
|
1091
1301
|
keyed.htmlProps.onClick?.(event);
|
|
1092
|
-
|
|
1302
|
+
toggle(key);
|
|
1093
1303
|
},
|
|
1094
1304
|
},
|
|
1095
1305
|
xstyle: [...keyed.xstyle, expansionStyles.clickableRow],
|
|
1096
1306
|
}
|
|
1097
1307
|
: keyed;
|
|
1098
1308
|
|
|
1099
|
-
if (!expandedKeys.has(key)) {
|
|
1100
|
-
return withClick;
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
1309
|
const panel = (
|
|
1104
|
-
<
|
|
1310
|
+
<ExpansionPanelRow
|
|
1105
1311
|
key={`${key}-expanded`}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
{
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
tableRowMarker,
|
|
1115
|
-
glidingDividerStyles.row,
|
|
1116
|
-
)}>
|
|
1117
|
-
<ExpansionPanelCell
|
|
1118
|
-
colSpan={columnCountRef.current}
|
|
1119
|
-
cellsRef={panelCellsRef}
|
|
1120
|
-
isMuted={panelVariant === 'muted'}>
|
|
1121
|
-
{renderExpanded(item)}
|
|
1122
|
-
</ExpansionPanelCell>
|
|
1123
|
-
</tr>
|
|
1312
|
+
store={store}
|
|
1313
|
+
rowKey={key}
|
|
1314
|
+
colSpan={columnCountRef.current}
|
|
1315
|
+
cellsRef={panelCellsRef}
|
|
1316
|
+
isMuted={panelVariant === 'muted'}
|
|
1317
|
+
item={item}
|
|
1318
|
+
renderExpanded={renderExpanded}
|
|
1319
|
+
/>
|
|
1124
1320
|
);
|
|
1125
1321
|
|
|
1126
1322
|
return {
|
|
@@ -1137,17 +1333,18 @@ export function useTableRowExpansion<T extends Record<string, unknown>>(
|
|
|
1137
1333
|
},
|
|
1138
1334
|
}),
|
|
1139
1335
|
[
|
|
1140
|
-
|
|
1336
|
+
store,
|
|
1141
1337
|
getRowKey,
|
|
1142
1338
|
renderExpanded,
|
|
1143
1339
|
getIsItemExpandable,
|
|
1144
1340
|
hasRowClickExpansion,
|
|
1145
1341
|
panelVariant,
|
|
1146
|
-
|
|
1342
|
+
toggle,
|
|
1147
1343
|
t,
|
|
1148
1344
|
expansionColumn,
|
|
1149
1345
|
animatedLayout,
|
|
1150
1346
|
measureChanges,
|
|
1347
|
+
playPendingGlides,
|
|
1151
1348
|
resetChevrons,
|
|
1152
1349
|
],
|
|
1153
1350
|
);
|
|
@@ -16,7 +16,10 @@ import {useMemo, type ReactNode} from 'react';
|
|
|
16
16
|
import * as stylex from '@stylexjs/stylex';
|
|
17
17
|
import {colorVars, typeScaleVars} from '../../../theme/tokens.stylex';
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
registerFixedHeightColumn,
|
|
21
|
+
registerWindowFallbackReason,
|
|
22
|
+
} from '../../tableColumnAdmission';
|
|
20
23
|
import type {TableColumn, TablePlugin} from '../../types';
|
|
21
24
|
|
|
22
25
|
/**
|
|
@@ -112,6 +115,12 @@ export function useTableRowIndex<T extends Record<string, unknown>>(
|
|
|
112
115
|
registerFixedHeightColumn(indexColumn, startFrom === 1, logicalIndex => (
|
|
113
116
|
<span {...stylex.props(styles.index)}>{logicalIndex + 1}</span>
|
|
114
117
|
));
|
|
118
|
+
if (startFrom !== 1) {
|
|
119
|
+
registerWindowFallbackReason(
|
|
120
|
+
indexColumn,
|
|
121
|
+
`the useTableRowIndex column counts from ${startFrom}, and only a row-number column that counts from 1 stays windowed`,
|
|
122
|
+
);
|
|
123
|
+
}
|
|
115
124
|
return {
|
|
116
125
|
rowModel: 'flat',
|
|
117
126
|
transformBodyCell(props, column, item, _columnIndex, _columns, context) {
|
|
@@ -24,6 +24,7 @@ import {warnOnce} from '../../../utils/devWarning';
|
|
|
24
24
|
import {VisuallyHidden} from '../../../VisuallyHidden';
|
|
25
25
|
import type {TableRowStatus, TableSemanticRowStatus} from '../../index';
|
|
26
26
|
import type {TableColumn, TablePlugin} from '../../types';
|
|
27
|
+
import {registerWindowFallbackReason} from '../../tableColumnAdmission';
|
|
27
28
|
import {
|
|
28
29
|
registerEnglishFallback,
|
|
29
30
|
useComponentTranslator,
|
|
@@ -269,6 +270,10 @@ export function useTableRowStatus<T extends Record<string, unknown>>(
|
|
|
269
270
|
);
|
|
270
271
|
},
|
|
271
272
|
};
|
|
273
|
+
registerWindowFallbackReason(
|
|
274
|
+
statusColumn,
|
|
275
|
+
'the useTableRowStatus column is not one Table checks for a fixed row height',
|
|
276
|
+
);
|
|
272
277
|
|
|
273
278
|
return {
|
|
274
279
|
transformColumns(columns) {
|
|
@@ -14,13 +14,22 @@
|
|
|
14
14
|
* - /packages/core/src/Table/index.ts (exports)
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
useCallback,
|
|
19
|
+
useId,
|
|
20
|
+
useRef,
|
|
21
|
+
useMemo,
|
|
22
|
+
useState,
|
|
23
|
+
type ReactNode,
|
|
24
|
+
} from 'react';
|
|
18
25
|
import * as stylex from '@stylexjs/stylex';
|
|
19
26
|
import {colorVars, spacingVars, radiusVars} from '../../../theme/tokens.stylex';
|
|
20
27
|
import {focusOutlineProps} from '../../../utils/focusOutline.stylex';
|
|
21
28
|
import {Icon} from '../../../Icon';
|
|
22
29
|
import {ComponentIcon} from '../../../Icon/ComponentIcon';
|
|
23
30
|
import {resolveContextActions} from '../../tableContextMenu';
|
|
31
|
+
import {createDevWarnings} from '../../../utils/devWarning';
|
|
32
|
+
import {INTERACTIVE_SELECTORS} from '../../../hooks/useClickableContainer';
|
|
24
33
|
import type {
|
|
25
34
|
TablePlugin,
|
|
26
35
|
HeaderCellRenderProps,
|
|
@@ -227,6 +236,11 @@ function getNextDirection(
|
|
|
227
236
|
// Sort Header Button Component
|
|
228
237
|
// =============================================================================
|
|
229
238
|
|
|
239
|
+
/** A control nested in the label: Core's interactive elements, or a positive tab stop. */
|
|
240
|
+
declare const process: {readonly env: {readonly NODE_ENV?: string}};
|
|
241
|
+
|
|
242
|
+
const HEADER_CONTROL_SELECTOR = `${INTERACTIVE_SELECTORS},[tabindex]:not([tabindex="-1"])`;
|
|
243
|
+
|
|
230
244
|
function SortHeaderButton<T extends Record<string, unknown>>({
|
|
231
245
|
column,
|
|
232
246
|
children,
|
|
@@ -254,6 +268,29 @@ function SortHeaderButton<T extends Record<string, unknown>>({
|
|
|
254
268
|
? 'arrowDown'
|
|
255
269
|
: 'arrowsUpDown';
|
|
256
270
|
|
|
271
|
+
// A header that holds its own control nests that control in the Sort
|
|
272
|
+
// button, which no assistive technology can operate (WCAG 4.1.2). Table has
|
|
273
|
+
// no place outside the Sort control for a caller's header control, so the
|
|
274
|
+
// column warns, from the label it first renders.
|
|
275
|
+
const [warn] = useState(createDevWarnings);
|
|
276
|
+
const labelRef = useCallback(
|
|
277
|
+
(label: HTMLSpanElement | null) => {
|
|
278
|
+
if (
|
|
279
|
+
process.env.NODE_ENV !== 'production' &&
|
|
280
|
+
label?.querySelector(HEADER_CONTROL_SELECTOR) != null
|
|
281
|
+
) {
|
|
282
|
+
warn(
|
|
283
|
+
'useTableSortable',
|
|
284
|
+
`the header of sortable column "${sortKey}" holds its own control. ` +
|
|
285
|
+
'Its control nests in the Sort button, which assistive technology ' +
|
|
286
|
+
'cannot operate; this column cannot hold a header control while it ' +
|
|
287
|
+
'is sortable.',
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
[warn, sortKey],
|
|
292
|
+
);
|
|
293
|
+
|
|
257
294
|
// The button is named by its column's text, so the column header keeps
|
|
258
295
|
// that name; direction lives in the header's aria-sort. Only the multi-sort
|
|
259
296
|
// priority, which aria-sort cannot carry, is a description
|
|
@@ -316,7 +353,9 @@ function SortHeaderButton<T extends Record<string, unknown>>({
|
|
|
316
353
|
)}
|
|
317
354
|
aria-describedby={rank != null ? priorityId : undefined}
|
|
318
355
|
onClick={handleClick}>
|
|
319
|
-
<span {...stylex.props(sortStyles.label)}>
|
|
356
|
+
<span ref={labelRef} {...stylex.props(sortStyles.label)}>
|
|
357
|
+
{children}
|
|
358
|
+
</span>
|
|
320
359
|
<span
|
|
321
360
|
{...stylex.props(
|
|
322
361
|
sortStyles.iconWrapper,
|