@astryxdesign/core 0.7.17-canary.gffd1c8e → 0.7.17
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/CHANGELOG.md +334 -0
- package/README.md +26 -9
- package/dist/AlertDialog/AlertDialog.d.ts +1 -1
- package/dist/AlertDialog/AlertDialog.d.ts.map +1 -1
- package/dist/AlertDialog/AlertDialog.js +6 -8
- package/dist/AppShell/AppShell.d.ts +7 -3
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +74 -36
- package/dist/AppShell/unreadWidthPoint.d.ts +29 -0
- package/dist/AppShell/unreadWidthPoint.d.ts.map +1 -0
- package/dist/AppShell/unreadWidthPoint.js +134 -0
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +5 -1
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +2 -2
- package/dist/Banner/Banner.d.ts +6 -4
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +32 -29
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +3 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +11 -7
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +57 -2
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +5 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +6 -14
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +12 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +4 -0
- package/dist/Calendar/Calendar.js +8 -2
- package/dist/Calendar/styles.d.ts +10 -6
- package/dist/Calendar/styles.d.ts.map +1 -1
- package/dist/Calendar/styles.js +7 -3
- package/dist/Card/Card.d.ts.map +1 -1
- package/dist/Card/Card.js +23 -4
- package/dist/Chat/ChatComposer.d.ts +1 -1
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +4 -4
- package/dist/Chat/ChatComposerDrawer.d.ts.map +1 -1
- package/dist/Chat/ChatComposerDrawer.js +8 -4
- package/dist/Chat/ChatDictationButton.d.ts.map +1 -1
- package/dist/Chat/ChatDictationButton.js +7 -0
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +3 -9
- package/dist/Chat/ChatSendButton.d.ts.map +1 -1
- package/dist/Chat/ChatSendButton.js +3 -0
- package/dist/Chat/ChatSystemMessage.d.ts.map +1 -1
- package/dist/Chat/ChatSystemMessage.js +1 -0
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +8 -0
- package/dist/Chat/pastedTextLabel.d.ts +4 -0
- package/dist/Chat/pastedTextLabel.d.ts.map +1 -0
- package/dist/Chat/pastedTextLabel.js +21 -0
- package/dist/Chat/useChatPasteAsToken.d.ts.map +1 -1
- package/dist/Chat/useChatPasteAsToken.js +8 -8
- package/dist/Chat/useTriggerMenu.d.ts.map +1 -1
- package/dist/Chat/useTriggerMenu.js +3 -3
- package/dist/CheckboxInput/CheckboxInput.d.ts +2 -1
- package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxInput.js +69 -18
- package/dist/Citation/Citation.d.ts.map +1 -1
- package/dist/Citation/Citation.js +8 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +17 -3
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +2 -0
- package/dist/CommandPalette/CommandPaletteItem.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteItem.js +1 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +8 -1
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +32 -5
- package/dist/DateInput/MonthScroller.d.ts.map +1 -1
- package/dist/DateInput/MonthScroller.js +1 -0
- package/dist/DateInput/PickerWheel.d.ts.map +1 -1
- package/dist/DateInput/PickerWheel.js +3 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +2 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +8 -8
- package/dist/DateInput/usePointerDragScroll.d.ts.map +1 -1
- package/dist/DateInput/usePointerDragScroll.js +5 -2
- package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
- package/dist/DateRangeInput/DateRangeInput.js +7 -0
- package/dist/DateTimeInput/TouchDateTimeField.d.ts.map +1 -1
- package/dist/DateTimeInput/TouchDateTimeField.js +2 -1
- package/dist/DateTimeInput/nativePickerSegmentStyles.d.ts +2 -2
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +104 -18
- package/dist/Dialog/DialogContext.d.ts +5 -4
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +38 -12
- package/dist/Drawer/DrawerHeader.d.ts.map +1 -1
- package/dist/Drawer/DrawerHeader.js +23 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +23 -17
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuCheckboxItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -2
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +19 -2
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +6 -3
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +31 -7
- package/dist/DropdownMenu/menuRowCorners.stylex.d.ts +24 -0
- package/dist/DropdownMenu/menuRowCorners.stylex.d.ts.map +1 -0
- package/dist/DropdownMenu/menuRowCorners.stylex.js +29 -0
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +2 -2
- package/dist/Field/FieldLabel.d.ts.map +1 -1
- package/dist/Field/FieldLabel.js +2 -2
- package/dist/Field/inputDisabledFocus.d.ts +4 -0
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -1
- package/dist/Field/inputDisabledFocus.js +5 -0
- package/dist/Field/inputStyles.stylex.d.ts +31 -4
- package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
- package/dist/Field/inputStyles.stylex.js +30 -5
- package/dist/Grid/Grid.d.ts +2 -1
- package/dist/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +5 -2
- package/dist/Heading/Heading.d.ts +1 -1
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +15 -1
- package/dist/Icon/Icon.d.ts +1 -1
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +32 -2
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +12 -6
- package/dist/Indicator/RadioIndicator.d.ts.map +1 -1
- package/dist/Indicator/RadioIndicator.js +18 -4
- package/dist/Indicator/indicatorRegistry.d.ts +3 -26
- package/dist/Indicator/indicatorRegistry.d.ts.map +1 -1
- package/dist/Indicator/indicatorRegistry.js +2 -11
- package/dist/Indicator/themeIndicators.d.ts +15 -0
- package/dist/Indicator/themeIndicators.d.ts.map +1 -0
- package/dist/Indicator/themeIndicators.js +21 -0
- package/dist/Indicator/types.d.ts +14 -0
- package/dist/Indicator/types.d.ts.map +1 -1
- package/dist/Indicator/useThemeIndicator.d.ts +3 -0
- package/dist/Indicator/useThemeIndicator.d.ts.map +1 -0
- package/dist/Indicator/useThemeIndicator.js +19 -0
- package/dist/Item/Item.d.ts +6 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +30 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +9 -2
- package/dist/Layer/layerExitCopy.d.ts.map +1 -1
- package/dist/Layer/layerExitCopy.js +1 -1
- package/dist/Layer/layerSlideRules.d.ts +23 -15
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +54 -54
- package/dist/Layer/useLayer.d.ts +41 -29
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +199 -126
- package/dist/Layer/useLayerKeyboardClearance.d.ts +5 -5
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
- package/dist/Layer/useLayerKeyboardClearance.js +5 -5
- package/dist/Layout/LayoutContainerContext.d.ts +4 -0
- package/dist/Layout/LayoutContainerContext.d.ts.map +1 -0
- package/dist/Layout/LayoutContainerContext.js +20 -0
- package/dist/Layout/LayoutContainerScope.d.ts +15 -0
- package/dist/Layout/LayoutContainerScope.d.ts.map +1 -0
- package/dist/Layout/LayoutContainerScope.js +23 -0
- package/dist/Layout/LayoutContent.d.ts +2 -1
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +7 -2
- package/dist/Layout/LayoutFooter.d.ts.map +1 -1
- package/dist/Layout/LayoutFooter.js +5 -1
- package/dist/Layout/LayoutHeader.d.ts.map +1 -1
- package/dist/Layout/LayoutHeader.js +5 -1
- package/dist/Layout/containerCorners.stylex.d.ts +15 -7
- package/dist/Layout/containerCorners.stylex.d.ts.map +1 -1
- package/dist/Layout/containerCorners.stylex.js +16 -7
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +324 -6
- package/dist/Link/Link.d.ts.map +1 -1
- package/dist/Link/Link.js +1 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +14 -6
- package/dist/List/ListContext.d.ts +38 -1
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +50 -2
- package/dist/List/ListItem.js +2 -2
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +85 -96
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +12 -5
- package/dist/Markdown/plugins/protocol.js +3 -3
- package/dist/MetadataList/MetadataListItem.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListItem.js +11 -3
- package/dist/MobileNav/MobileNav.d.ts +1 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +6 -3
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +33 -9
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +5 -2
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +1 -0
- package/dist/NavMenu/NavMenuContext.d.ts +7 -0
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +9 -0
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +8 -2
- package/dist/Outline/Outline.d.ts +7 -3
- package/dist/Outline/Outline.d.ts.map +1 -1
- package/dist/Outline/Outline.js +11 -3
- package/dist/Outline/useScrollSpy.d.ts +1 -1
- package/dist/Outline/useScrollSpy.d.ts.map +1 -1
- package/dist/Outline/useScrollSpy.js +6 -2
- package/dist/OverflowList/OverflowList.d.ts.map +1 -1
- package/dist/OverflowList/OverflowList.js +51 -25
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +33 -13
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +5 -1
- package/dist/Popover/popoverAnchor.d.ts +11 -0
- package/dist/Popover/popoverAnchor.d.ts.map +1 -0
- package/dist/Popover/popoverAnchor.js +33 -0
- package/dist/Popover/usePopover.d.ts +20 -3
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +110 -10
- package/dist/PowerSearch/PowerSearch.d.ts +1 -0
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +46 -9
- package/dist/PowerSearch/PowerSearchEditPopover.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchEditPopover.js +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchFilterEditor.js +7 -1
- package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchToken.js +7 -0
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts +2 -4
- package/dist/PowerSearch/PowerSearchValueEditor.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearchValueEditor.js +6 -13
- package/dist/ProgressBar/ProgressBar.d.ts +5 -4
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +26 -26
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +51 -0
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +1 -1
- package/dist/Resizable/ResizeHandle.d.ts +1 -1
- package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
- package/dist/Resizable/ResizeHandle.js +1 -1
- package/dist/Resizable/resizableModel.d.ts +45 -3
- package/dist/Resizable/resizableModel.d.ts.map +1 -1
- package/dist/Resizable/resizableModel.js +91 -3
- package/dist/Resizable/resizeGesture.d.ts +3 -0
- package/dist/Resizable/resizeGesture.d.ts.map +1 -1
- package/dist/Resizable/resizeGesture.js +6 -0
- package/dist/Resizable/useResizable.d.ts +1 -33
- package/dist/Resizable/useResizable.d.ts.map +1 -1
- package/dist/Resizable/useResizable.js +8 -72
- package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlItem.js +1 -0
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts +27 -5
- package/dist/SegmentedControl/useSegmentedTouchTracking.d.ts.map +1 -1
- package/dist/SegmentedControl/useSegmentedTouchTracking.js +70 -8
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +34 -14
- package/dist/Selector/hooks.d.ts +5 -0
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +72 -16
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -1
- package/dist/Selector/useSelectorPresentation.js +9 -3
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +18 -5
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +2 -2
- package/dist/Spinner/Spinner.d.ts.map +1 -1
- package/dist/Spinner/Spinner.js +47 -33
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +21 -12
- package/dist/Swipe/useSwipeAction.js +3 -3
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +64 -46
- package/dist/Switch/useSwitchTouch.d.ts +22 -1
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +54 -3
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +3 -3
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +37 -18
- package/dist/Table/Table.d.ts +4 -3
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +32 -14
- package/dist/Table/TableBody.d.ts.map +1 -1
- package/dist/Table/TableBody.js +5 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +6 -0
- package/dist/Table/TableHeaderCell.d.ts +1 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +42 -9
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +9 -1
- package/dist/Table/TableRowPlacementContext.d.ts +18 -0
- package/dist/Table/TableRowPlacementContext.d.ts.map +1 -0
- package/dist/Table/TableRowPlacementContext.js +41 -0
- package/dist/Table/TableSelectionToolbar.d.ts.map +1 -1
- package/dist/Table/TableSelectionToolbar.js +7 -0
- package/dist/Table/columnUtils.d.ts +5 -0
- package/dist/Table/columnUtils.d.ts.map +1 -1
- package/dist/Table/columnUtils.js +9 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +2 -2
- package/dist/Table/plugins/sortable/useTableSortable.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortable.js +8 -3
- package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
- package/dist/Table/plugins/sortable/useTableSortableState.js +10 -6
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +5 -1
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +2 -1
- package/dist/Table/table.stylex.d.ts +31 -5
- package/dist/Table/table.stylex.d.ts.map +1 -1
- package/dist/Table/table.stylex.js +33 -5
- package/dist/Table/types.d.ts +3 -1
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +17 -6
- package/dist/Text/text.stylex.d.ts +2 -2
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +23 -4
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +15 -1
- package/dist/TextInput/TextInput.d.ts +9 -3
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +19 -18
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +13 -4
- package/dist/Timer/Timer.d.ts.map +1 -1
- package/dist/Timer/Timer.js +10 -7
- package/dist/Timestamp/Timestamp.d.ts.map +1 -1
- package/dist/Timestamp/Timestamp.js +55 -4
- package/dist/Toast/Toast.d.ts +1 -6
- package/dist/Toast/Toast.d.ts.map +1 -1
- package/dist/Toast/Toast.js +77 -44
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +48 -21
- package/dist/Toast/types.d.ts +8 -0
- package/dist/Toast/types.d.ts.map +1 -1
- package/dist/Toast/useToast.d.ts.map +1 -1
- package/dist/Toast/useToast.js +14 -7
- package/dist/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButton.js +2 -1
- package/dist/Token/Token.d.ts +1 -1
- package/dist/Token/Token.d.ts.map +1 -1
- package/dist/Token/Token.js +6 -2
- package/dist/Tokenizer/Tokenizer.d.ts +2 -2
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +102 -62
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +33 -5
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +20 -1
- package/dist/TopNav/TopNav.d.ts.map +1 -1
- package/dist/TopNav/TopNav.js +24 -8
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +21 -9
- package/dist/TopNav/TopNavMegaMenu.js +1 -1
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +9 -2
- package/dist/TopNav/TopNavRenderContext.d.ts +13 -0
- package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavRenderContext.js +24 -9
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +7 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +20 -2
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.js +2 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +24 -9
- package/dist/Typeahead/TypeaheadItem.d.ts.map +1 -1
- package/dist/Typeahead/TypeaheadItem.js +7 -0
- package/dist/astryx.css +211 -56
- package/dist/gestures/GestureHost.d.ts +7 -0
- package/dist/gestures/GestureHost.d.ts.map +1 -1
- package/dist/gestures/GestureHost.js +37 -0
- package/dist/hooks/anchoredHint.d.ts.map +1 -1
- package/dist/hooks/anchoredHint.js +0 -1
- package/dist/hooks/computeOverflow.d.ts.map +1 -1
- package/dist/hooks/computeOverflow.js +7 -0
- package/dist/hooks/focusableSelector.d.ts +16 -9
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +53 -2
- package/dist/hooks/scrollEdgeFade.d.ts +34 -0
- package/dist/hooks/scrollEdgeFade.d.ts.map +1 -0
- package/dist/hooks/scrollEdgeFade.js +173 -0
- package/dist/hooks/statusButtonPress.d.ts +15 -0
- package/dist/hooks/statusButtonPress.d.ts.map +1 -0
- package/dist/hooks/statusButtonPress.js +19 -0
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +2 -1
- package/dist/hooks/useFocusTrap.d.ts +26 -16
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +75 -112
- package/dist/hooks/useGroupPressTracking.d.ts +1 -1
- package/dist/hooks/useGroupPressTracking.js +1 -1
- package/dist/hooks/useOverflow.d.ts +25 -2
- package/dist/hooks/useOverflow.d.ts.map +1 -1
- package/dist/hooks/useOverflow.js +137 -8
- package/dist/hooks/useResolvedRequired.d.ts +27 -0
- package/dist/hooks/useResolvedRequired.d.ts.map +1 -1
- package/dist/hooks/useResolvedRequired.js +30 -1
- package/dist/hooks/useTreeFocus.d.ts.map +1 -1
- package/dist/hooks/useTreeFocus.js +4 -2
- package/dist/hooks/useTypeahead.d.ts.map +1 -1
- package/dist/hooks/useTypeahead.js +8 -8
- package/dist/i18n/InternationalizationContext.d.ts +13 -6
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +11 -6
- package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
- package/dist/i18n/InternationalizationProvider.js +7 -0
- package/dist/i18n/defaultTranslator.d.ts +17 -0
- package/dist/i18n/defaultTranslator.d.ts.map +1 -0
- package/dist/i18n/defaultTranslator.js +18 -0
- package/dist/i18n/firstStrongDirection.d.ts +3 -2
- package/dist/i18n/firstStrongDirection.d.ts.map +1 -1
- package/dist/i18n/firstStrongDirection.js +50 -12
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Chat/ChatPastedTextToken.generated.js +1 -2
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.d.ts +8 -0
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.d.ts.map +1 -0
- package/dist/i18n/generated-english/Chat/pastedTextLabel.generated.js +12 -0
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Chat/useTriggerMenu.generated.js +1 -0
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/CodeBlock/CodeBlock.generated.js +2 -1
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.js +2 -1
- 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/Slider/Slider.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Slider/Slider.generated.js +2 -1
- package/dist/i18n/generated-english/TextArea/TextArea.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/TextArea/TextArea.generated.js +1 -0
- package/dist/i18n/generated-english/TextInput/TextInput.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/TextInput/TextInput.generated.js +1 -0
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Timestamp/Timestamp.generated.js +2 -1
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.d.ts.map +1 -1
- package/dist/i18n/generated-english/Tokenizer/Tokenizer.generated.js +1 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +9 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +9 -0
- package/dist/i18n/publicContext.d.ts.map +1 -1
- package/dist/i18n/publicContext.js +4 -2
- package/dist/i18n/translatingContext.d.ts +2 -0
- package/dist/i18n/translatingContext.d.ts.map +1 -0
- package/dist/i18n/translatingContext.js +25 -0
- package/dist/i18n/useComponentTranslator.d.ts.map +1 -1
- package/dist/i18n/useComponentTranslator.js +3 -2
- package/dist/i18n/useListFormatter.d.ts.map +1 -1
- package/dist/i18n/useListFormatter.js +3 -2
- package/dist/i18n/useTranslator.d.ts.map +1 -1
- package/dist/i18n/useTranslator.js +3 -2
- package/dist/internal/touch.d.ts +2 -0
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +5 -1
- package/dist/keyboard/keyboardHeight.d.ts +34 -3
- package/dist/keyboard/keyboardHeight.d.ts.map +1 -1
- package/dist/keyboard/keyboardHeight.js +101 -24
- package/dist/keyboard/keyboardTarget.d.ts +19 -16
- package/dist/keyboard/keyboardTarget.d.ts.map +1 -1
- package/dist/keyboard/keyboardTarget.js +529 -72
- package/dist/keyboard/useMobileKeyboard.d.ts.map +1 -1
- package/dist/keyboard/useMobileKeyboard.js +1 -8
- package/dist/palette/color.d.ts +23 -0
- package/dist/palette/color.d.ts.map +1 -0
- package/dist/palette/color.js +126 -0
- package/dist/palette/generator.d.ts +69 -0
- package/dist/palette/generator.d.ts.map +1 -0
- package/dist/palette/generator.js +778 -0
- package/dist/palette/index.d.ts +12 -0
- package/dist/palette/index.d.ts.map +1 -0
- package/dist/palette/index.js +13 -0
- package/dist/palette/mapping.d.ts +319 -0
- package/dist/palette/mapping.d.ts.map +1 -0
- package/dist/palette/mapping.js +1312 -0
- package/dist/palette/themePalette.d.ts +20 -0
- package/dist/palette/themePalette.d.ts.map +1 -0
- package/dist/palette/themePalette.js +145 -0
- package/dist/palette/types.d.ts +178 -0
- package/dist/palette/types.d.ts.map +1 -0
- package/dist/palette/types.js +1 -0
- package/dist/privateAttributes/mediaDarkPage.d.ts +5 -0
- package/dist/privateAttributes/mediaDarkPage.d.ts.map +1 -0
- package/dist/privateAttributes/mediaDarkPage.js +27 -0
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts +2 -1
- package/dist/privateAttributes/pressGroupItem.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/pressGroupItem.stylex.js +2 -1
- package/dist/privateAttributes/scheme.d.ts +10 -0
- package/dist/privateAttributes/scheme.d.ts.map +1 -0
- package/dist/privateAttributes/scheme.js +34 -0
- package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/travelling.stylex.js +2 -2
- package/dist/theme/MediaDarkPage.d.ts +18 -0
- package/dist/theme/MediaDarkPage.d.ts.map +1 -0
- package/dist/theme/MediaDarkPage.js +35 -0
- package/dist/theme/MediaTheme.d.ts.map +1 -1
- package/dist/theme/MediaTheme.js +9 -1
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +99 -31
- package/dist/theme/defineTheme.d.ts +31 -6
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +65 -29
- package/dist/theme/derivedVarRegistry.d.ts +19 -0
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +49 -4
- package/dist/theme/expandRadiusScale.d.ts +1 -2
- package/dist/theme/expandRadiusScale.d.ts.map +1 -1
- package/dist/theme/expandRadiusScale.js +1 -5
- package/dist/theme/generateThemeRules.d.ts +10 -3
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +310 -207
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -1
- package/dist/theme/invertedSurfaceSide.d.ts +17 -0
- package/dist/theme/invertedSurfaceSide.d.ts.map +1 -0
- package/dist/theme/invertedSurfaceSide.js +47 -0
- package/dist/theme/resolveThemeValues.d.ts +5 -2
- package/dist/theme/resolveThemeValues.d.ts.map +1 -1
- package/dist/theme/resolveThemeValues.js +7 -1
- package/dist/theme/statusRoleDefaults.d.ts +43 -0
- package/dist/theme/statusRoleDefaults.d.ts.map +1 -0
- package/dist/theme/statusRoleDefaults.js +196 -0
- package/dist/theme/statusRoleDerivation.d.ts +4 -0
- package/dist/theme/statusRoleDerivation.d.ts.map +1 -1
- package/dist/theme/statusRoleDerivation.js +3 -1
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +7 -0
- package/dist/theme/themeAdaptations.d.ts +24 -1
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +48 -5
- package/dist/theme/tokenDefaults.d.ts +3 -0
- package/dist/theme/tokenDefaults.d.ts.map +1 -0
- package/dist/theme/tokenDefaults.js +30 -0
- package/dist/theme/tokenValues.d.ts +26 -0
- package/dist/theme/tokenValues.d.ts.map +1 -0
- package/dist/theme/tokenValues.js +180 -0
- package/dist/theme/tokens.d.ts +3 -2
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +7 -161
- package/dist/theme/tokens.stylex.d.ts +4 -4
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +7 -5
- package/dist/theme/useTheme.d.ts +40 -3
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +137 -32
- package/dist/utils/devWarning.d.ts +17 -0
- package/dist/utils/devWarning.d.ts.map +1 -1
- package/dist/utils/devWarning.js +20 -0
- package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
- package/dist/utils/focusOutline.stylex.js +7 -4
- package/dist/utils/focusReturn.d.ts +110 -0
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +418 -12
- package/dist/utils/hitArea.d.ts +28 -0
- package/dist/utils/hitArea.d.ts.map +1 -1
- package/dist/utils/hitArea.js +52 -18
- package/dist/utils/inputStream.d.ts +27 -0
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +72 -5
- package/dist/utils/nodeType.d.ts +2 -0
- package/dist/utils/nodeType.d.ts.map +1 -1
- package/dist/utils/nodeType.js +10 -0
- package/dist/utils/timeFormat.d.ts +14 -4
- package/dist/utils/timeFormat.d.ts.map +1 -1
- package/dist/utils/timeFormat.js +42 -4
- package/dist/utils/touchPresentation.d.ts +2 -2
- package/dist/utils/touchPresentation.d.ts.map +1 -1
- package/dist/utils/touchPresentation.js +10 -7
- package/dist/utils/touchPresentation.stylex.d.ts +4 -3
- package/dist/utils/touchPresentation.stylex.d.ts.map +1 -1
- package/dist/utils/touchPresentation.stylex.js +3 -3
- package/dist/utils/touchQueries.d.ts +3 -2
- package/dist/utils/touchQueries.d.ts.map +1 -1
- package/dist/utils/touchQueries.js +3 -2
- package/dist/utils/typeaheadMatch.d.ts +13 -0
- package/dist/utils/typeaheadMatch.d.ts.map +1 -1
- package/dist/utils/typeaheadMatch.js +15 -1
- package/dist/virtualization/useInlineListWindow.d.ts.map +1 -1
- package/dist/virtualization/useInlineListWindow.js +38 -22
- package/locales/en.json +36 -0
- package/locales/pseudo.json +27 -0
- package/package.json +10 -5
- package/scripts/agent-doc-state.mjs +71 -4
- package/src/AlertDialog/AlertDialog.doc.mjs +5 -1
- package/src/AlertDialog/AlertDialog.tsx +34 -7
- package/src/AppShell/AppShell.doc.mjs +22 -0
- package/src/AppShell/AppShell.tsx +112 -65
- package/src/AppShell/unreadWidthPoint.ts +162 -0
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +6 -1
- package/src/Badge/Badge.tsx +5 -2
- package/src/Banner/Banner.doc.mjs +15 -0
- package/src/Banner/Banner.tsx +56 -45
- package/src/BottomSheet/BottomSheet.doc.mjs +6 -3
- package/src/BottomSheet/BottomSheet.tsx +3 -0
- package/src/BottomSheet/BottomSheetPanel.tsx +15 -7
- package/src/BottomSheet/BottomSheetSwitcher.tsx +73 -1
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +5 -0
- package/src/BottomSheet/bottomSheetStack.ts +6 -14
- package/src/Breadcrumbs/BreadcrumbItem.tsx +14 -1
- package/src/Button/Button.doc.mjs +6 -0
- package/src/Button/Button.tsx +6 -0
- package/src/Calendar/Calendar.doc.mjs +16 -0
- package/src/Calendar/Calendar.tsx +32 -20
- package/src/Calendar/styles.ts +12 -3
- package/src/Card/Card.doc.mjs +2 -2
- package/src/Card/Card.tsx +22 -3
- package/src/Chat/Chat.doc.mjs +1 -1
- package/src/Chat/ChatComposer.doc.mjs +3 -3
- package/src/Chat/ChatComposer.tsx +11 -5
- package/src/Chat/ChatComposerDrawer.tsx +11 -7
- package/src/Chat/ChatDictationButton.tsx +12 -0
- package/src/Chat/ChatMessageBubble.tsx +2 -2
- package/src/Chat/ChatPastedTextToken.tsx +3 -9
- package/src/Chat/ChatSendButton.tsx +5 -0
- package/src/Chat/ChatSystemMessage.tsx +1 -0
- package/src/Chat/ChatToolCalls.tsx +16 -0
- package/src/Chat/pastedTextLabel.ts +23 -0
- package/src/Chat/useChatPasteAsToken.ts +9 -8
- package/src/Chat/useTriggerMenu.tsx +4 -1
- package/src/CheckboxInput/CheckboxInput.doc.mjs +20 -0
- package/src/CheckboxInput/CheckboxInput.tsx +83 -26
- package/src/CheckboxList/CheckboxList.doc.mjs +15 -0
- package/src/CheckboxList/CheckboxListItem.doc.mjs +3 -3
- package/src/Citation/Citation.tsx +16 -1
- package/src/CodeBlock/CodeBlock.tsx +29 -2
- package/src/Collapsible/Collapsible.tsx +2 -0
- package/src/CommandPalette/CommandPaletteItem.tsx +1 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +30 -2
- package/src/ComplexSelector/ComplexSelector.tsx +19 -1
- package/src/ContextMenu/ContextMenu.doc.mjs +5 -1
- package/src/ContextMenu/ContextMenu.tsx +44 -5
- package/src/ContextMenu/ContextMenuItem.doc.mjs +55 -5
- package/src/DateInput/MonthScroller.tsx +1 -0
- package/src/DateInput/PickerWheel.tsx +1 -0
- package/src/DateInput/TouchDateField.tsx +2 -0
- package/src/DateInput/Wheel.tsx +1 -0
- package/src/DateInput/usePointerDragScroll.ts +6 -2
- package/src/DateRangeInput/DateRangeInput.tsx +16 -0
- package/src/DateTimeInput/TouchDateTimeField.tsx +2 -0
- package/src/Dialog/Dialog.doc.mjs +11 -1
- package/src/Dialog/Dialog.tsx +116 -19
- package/src/Dialog/DialogContext.ts +5 -4
- package/src/Dialog/DialogHeader.tsx +50 -12
- package/src/Drawer/DrawerHeader.tsx +31 -6
- package/src/DropdownMenu/DropdownMenu.doc.mjs +20 -1
- package/src/DropdownMenu/DropdownMenu.tsx +29 -22
- package/src/DropdownMenu/DropdownMenuCheckboxItem.doc.mjs +4 -4
- package/src/DropdownMenu/DropdownMenuCheckboxItem.tsx +3 -2
- package/src/DropdownMenu/DropdownMenuItem.doc.mjs +5 -5
- package/src/DropdownMenu/DropdownMenuItem.tsx +3 -1
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +4 -4
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +3 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +3 -3
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +23 -1
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +37 -9
- package/src/DropdownMenu/menuRowCorners.stylex.ts +40 -0
- package/src/EmptyState/EmptyState.tsx +2 -0
- package/src/Field/Field.doc.mjs +1 -1
- package/src/Field/FieldLabel.doc.mjs +3 -3
- package/src/Field/FieldLabel.tsx +9 -2
- package/src/Field/inputDisabledFocus.ts +18 -0
- package/src/Field/inputStyles.stylex.ts +52 -1
- package/src/Grid/Grid.doc.mjs +6 -3
- package/src/Grid/Grid.tsx +5 -2
- package/src/Heading/Heading.tsx +24 -1
- package/src/Icon/Icon.doc.mjs +1 -1
- package/src/Icon/Icon.tsx +40 -2
- package/src/Indicator/CheckboxIndicator.tsx +11 -6
- package/src/Indicator/Indicator.doc.mjs +1 -1
- package/src/Indicator/RadioIndicator.tsx +31 -4
- package/src/Indicator/indicatorRegistry.ts +7 -23
- package/src/Indicator/themeIndicators.ts +29 -0
- package/src/Indicator/types.ts +14 -0
- package/src/Indicator/useThemeIndicator.ts +24 -0
- package/src/Item/Item.doc.mjs +3 -3
- package/src/Item/Item.tsx +48 -7
- package/src/Kbd/Kbd.doc.mjs +6 -2
- package/src/Kbd/Kbd.tsx +16 -1
- package/src/Layer/layerExitCopy.ts +0 -1
- package/src/Layer/layerSlideRules.ts +62 -74
- package/src/Layer/useLayer.doc.mjs +2 -2
- package/src/Layer/useLayer.tsx +293 -137
- package/src/Layer/useLayerKeyboardClearance.ts +9 -12
- package/src/Layout/Layout.doc.mjs +3 -3
- package/src/Layout/LayoutContainerContext.ts +27 -0
- package/src/Layout/LayoutContainerScope.tsx +32 -0
- package/src/Layout/LayoutContent.tsx +5 -2
- package/src/Layout/LayoutFooter.tsx +3 -1
- package/src/Layout/LayoutHeader.tsx +3 -1
- package/src/Layout/containerCorners.stylex.ts +44 -7
- package/src/Lightbox/Lightbox.tsx +460 -8
- package/src/Link/Link.doc.mjs +18 -0
- package/src/Link/Link.tsx +3 -1
- package/src/List/List.tsx +14 -2
- package/src/List/ListContext.tsx +60 -1
- package/src/List/ListItem.doc.mjs +11 -9
- package/src/List/ListItem.tsx +4 -4
- package/src/Markdown/Markdown.doc.mjs +1 -1
- package/src/Markdown/Markdown.tsx +189 -190
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +14 -4
- package/src/Markdown/plugins/protocol.ts +3 -3
- package/src/MetadataList/MetadataListItem.tsx +18 -3
- package/src/MobileNav/MobileNav.doc.mjs +134 -52
- package/src/MobileNav/MobileNav.tsx +13 -9
- package/src/MultiSelector/MultiSelector.doc.mjs +2 -2
- package/src/MultiSelector/MultiSelector.tsx +51 -8
- package/src/NavMenu/NavHeadingMenu.tsx +5 -1
- package/src/NavMenu/NavHeadingMenuItem.tsx +1 -0
- package/src/NavMenu/NavMenu.doc.mjs +105 -2
- package/src/NavMenu/NavMenuContext.tsx +13 -0
- package/src/NumberInput/NumberInput.doc.mjs +12 -10
- package/src/NumberInput/NumberInput.tsx +19 -11
- package/src/Outline/Outline.doc.mjs +26 -8
- package/src/Outline/Outline.tsx +35 -5
- package/src/Outline/useScrollSpy.ts +8 -3
- package/src/OverflowList/OverflowList.doc.mjs +15 -0
- package/src/OverflowList/OverflowList.tsx +62 -26
- package/src/Pagination/Pagination.doc.mjs +12 -0
- package/src/Pagination/Pagination.tsx +40 -6
- package/src/Popover/Popover.doc.mjs +10 -0
- package/src/Popover/Popover.tsx +8 -4
- package/src/Popover/popoverAnchor.ts +47 -0
- package/src/Popover/usePopover.doc.mjs +16 -2
- package/src/Popover/usePopover.tsx +152 -16
- package/src/PowerSearch/PowerSearch.doc.mjs +8 -8
- package/src/PowerSearch/PowerSearch.tsx +65 -12
- package/src/PowerSearch/PowerSearchEditPopover.tsx +1 -0
- package/src/PowerSearch/PowerSearchFilterEditor.tsx +12 -0
- package/src/PowerSearch/PowerSearchToken.tsx +12 -0
- package/src/PowerSearch/PowerSearchValueEditor.tsx +14 -19
- package/src/ProgressBar/ProgressBar.doc.mjs +2 -2
- package/src/ProgressBar/ProgressBar.tsx +44 -30
- package/src/RadioList/RadioList.tsx +63 -0
- package/src/RadioList/RadioListItem.tsx +4 -1
- package/src/Resizable/ResizeHandle.tsx +2 -3
- package/src/Resizable/resizableModel.ts +105 -3
- package/src/Resizable/resizeGesture.ts +14 -0
- package/src/Resizable/useResizable.ts +14 -75
- package/src/SegmentedControl/SegmentedControlItem.tsx +1 -0
- package/src/SegmentedControl/useSegmentedTouchTracking.ts +76 -12
- package/src/Selector/Selector.doc.mjs +34 -7
- package/src/Selector/Selector.tsx +55 -25
- package/src/Selector/SelectorOption.doc.mjs +5 -5
- package/src/Selector/hooks.ts +92 -17
- package/src/Selector/useSelectorPresentation.ts +18 -3
- package/src/SideNav/SideNavHeading.tsx +15 -4
- package/src/SideNav/SideNavItem.doc.mjs +10 -10
- package/src/Slider/Slider.tsx +4 -1
- package/src/Spinner/Spinner.tsx +56 -41
- package/src/Stepper/Step.tsx +18 -3
- package/src/Stepper/Stepper.doc.mjs +14 -2
- package/src/Swipe/useSwipeAction.ts +3 -3
- package/src/Switch/Switch.doc.mjs +61 -5
- package/src/Switch/Switch.tsx +72 -35
- package/src/Switch/useSwitchTouch.ts +68 -3
- package/src/TabList/Tab.tsx +6 -0
- package/src/Table/BaseTable.tsx +73 -35
- package/src/Table/Table.doc.mjs +109 -5
- package/src/Table/Table.tsx +42 -17
- package/src/Table/TableBody.tsx +10 -1
- package/src/Table/TableCell.tsx +6 -0
- package/src/Table/TableHeaderCell.tsx +52 -7
- package/src/Table/TableRow.tsx +8 -1
- package/src/Table/TableRowPlacementContext.ts +58 -0
- package/src/Table/TableSelectionToolbar.tsx +12 -0
- package/src/Table/columnUtils.ts +9 -1
- package/src/Table/plugins/columnSettings/useTableColumnSettingsState.doc.mjs +1 -1
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +1 -0
- package/src/Table/plugins/sortable/useTableSortable.tsx +15 -2
- package/src/Table/plugins/sortable/useTableSortableState.doc.mjs +5 -5
- package/src/Table/plugins/sortable/useTableSortableState.tsx +15 -8
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +8 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +2 -4
- package/src/Table/table.stylex.ts +44 -5
- package/src/Table/types.ts +3 -1
- package/src/Table/useTableColumnResize.doc.mjs +3 -3
- package/src/Table/useTableColumnSettings.doc.mjs +3 -3
- package/src/Table/useTableFilterState.doc.mjs +6 -3
- package/src/Table/useTableFiltering.doc.mjs +71 -4
- package/src/Table/useTableInfiniteScroll.doc.mjs +2 -2
- package/src/Table/useTablePagination.doc.mjs +24 -3
- package/src/Table/useTableSelection.doc.mjs +30 -6
- package/src/Table/useTableSelectionState.doc.mjs +30 -2
- package/src/Table/useTableSortable.doc.mjs +104 -17
- package/src/Table/useTableStickyColumns.doc.mjs +3 -3
- package/src/Text/Heading.doc.mjs +2 -2
- package/src/Text/Text.doc.mjs +1 -1
- package/src/Text/TruncationTooltip.tsx +18 -11
- package/src/Text/useTruncation.ts +20 -4
- package/src/TextArea/TextArea.doc.mjs +5 -5
- package/src/TextArea/TextArea.tsx +20 -1
- package/src/TextInput/TextInput.doc.mjs +5 -5
- package/src/TextInput/TextInput.tsx +23 -18
- package/src/Thumbnail/Thumbnail.tsx +2 -1
- package/src/Timer/Timer.tsx +21 -6
- package/src/Timestamp/Timestamp.tsx +67 -4
- package/src/Toast/Toast.doc.mjs +15 -5
- package/src/Toast/Toast.tsx +83 -62
- package/src/Toast/ToastViewport.tsx +62 -23
- package/src/Toast/types.ts +8 -0
- package/src/Toast/useToast.doc.mjs +80 -15
- package/src/Toast/useToast.tsx +18 -7
- package/src/ToggleButton/ToggleButton.doc.mjs +1 -1
- package/src/ToggleButton/ToggleButton.tsx +1 -0
- package/src/Token/Token.tsx +5 -1
- package/src/Tokenizer/Tokenizer.doc.mjs +15 -3
- package/src/Tokenizer/Tokenizer.tsx +130 -75
- package/src/Toolbar/Toolbar.tsx +55 -4
- package/src/Tooltip/useTooltip.tsx +26 -0
- package/src/TopNav/TopNav.doc.mjs +1 -1
- package/src/TopNav/TopNav.tsx +13 -3
- package/src/TopNav/TopNavHeading.tsx +22 -9
- package/src/TopNav/TopNavMegaMenu.tsx +4 -4
- package/src/TopNav/TopNavMenu.tsx +13 -0
- package/src/TopNav/TopNavRenderContext.ts +30 -9
- package/src/TreeList/TreeList.tsx +12 -0
- package/src/TreeList/TreeListItem.tsx +26 -5
- package/src/Typeahead/BaseTypeahead.doc.mjs +6 -0
- package/src/Typeahead/BaseTypeahead.tsx +2 -0
- package/src/Typeahead/Typeahead.doc.mjs +15 -2
- package/src/Typeahead/Typeahead.tsx +37 -13
- package/src/Typeahead/TypeaheadItem.tsx +12 -0
- package/src/gestures/GestureHost.ts +34 -0
- package/src/gestures/README.md +9 -6
- package/src/hooks/anchoredHint.tsx +1 -2
- package/src/hooks/computeOverflow.ts +10 -0
- package/src/hooks/focusableSelector.ts +59 -2
- package/src/hooks/scrollEdgeFade.ts +129 -0
- package/src/hooks/statusButtonPress.ts +26 -0
- package/src/hooks/useAnnounce.ts +2 -1
- package/src/hooks/useFocusTrap.ts +110 -141
- package/src/hooks/useGroupPressTracking.ts +1 -1
- package/src/hooks/useOverflow.ts +227 -13
- package/src/hooks/useResolvedRequired.ts +50 -1
- package/src/hooks/useTreeFocus.ts +8 -4
- package/src/hooks/useTypeahead.ts +12 -10
- package/src/i18n/InternationalizationContext.ts +16 -7
- package/src/i18n/InternationalizationProvider.doc.mjs +1 -1
- package/src/i18n/InternationalizationProvider.tsx +12 -0
- package/src/i18n/defaultTranslator.ts +25 -0
- package/src/i18n/firstStrongDirection.ts +54 -13
- package/src/i18n/generated-english/Chat/ChatPastedTextToken.generated.ts +1 -2
- package/src/i18n/generated-english/Chat/pastedTextLabel.generated.ts +13 -0
- package/src/i18n/generated-english/Chat/useTriggerMenu.generated.ts +1 -0
- package/src/i18n/generated-english/CodeBlock/CodeBlock.generated.ts +2 -1
- package/src/i18n/generated-english/Markdown/plugins/HeadingLinksRenderer.generated.ts +2 -1
- package/src/i18n/generated-english/MultiSelector/MultiSelector.generated.ts +1 -0
- package/src/i18n/generated-english/Slider/Slider.generated.ts +2 -1
- package/src/i18n/generated-english/TextArea/TextArea.generated.ts +1 -0
- package/src/i18n/generated-english/TextInput/TextInput.generated.ts +1 -0
- package/src/i18n/generated-english/Timestamp/Timestamp.generated.ts +2 -1
- package/src/i18n/generated-english/Tokenizer/Tokenizer.generated.ts +1 -0
- package/src/i18n/generated-locales/en.generated.ts +11 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +11 -0
- package/src/i18n/publicContext.ts +4 -2
- package/src/i18n/translatingContext.ts +28 -0
- package/src/i18n/useComponentTranslator.ts +3 -2
- package/src/i18n/useListFormatter.ts +3 -2
- package/src/i18n/useTranslator.ts +3 -2
- package/src/internal/touch.ts +7 -0
- package/src/keyboard/README.md +58 -16
- package/src/keyboard/keyboardHeight.ts +138 -26
- package/src/keyboard/keyboardTarget.ts +667 -71
- package/src/keyboard/useMobileKeyboard.ts +1 -7
- package/src/palette/color.ts +205 -0
- package/src/palette/generator.ts +1134 -0
- package/src/palette/index.ts +35 -0
- package/src/palette/mapping.ts +1630 -0
- package/src/palette/themePalette.ts +175 -0
- package/src/palette/types.ts +194 -0
- package/src/privateAttributes/mediaDarkPage.ts +27 -0
- package/src/privateAttributes/pressGroupItem.stylex.ts +2 -1
- package/src/privateAttributes/scheme.ts +37 -0
- package/src/privateAttributes/travelling.stylex.ts +6 -4
- package/src/reset.css +1 -1
- package/src/theme/MediaDarkPage.tsx +41 -0
- package/src/theme/MediaTheme.tsx +8 -1
- package/src/theme/Theme.doc.mjs +4 -4
- package/src/theme/Theme.tsx +140 -35
- package/src/theme/defineTheme.ts +103 -40
- package/src/theme/derivedVarRegistry.ts +61 -4
- package/src/theme/expandRadiusScale.ts +1 -5
- package/src/theme/generateThemeRules.ts +398 -342
- package/src/theme/index.ts +2 -4
- package/src/theme/invertedSurfaceSide.ts +65 -0
- package/src/theme/resolveThemeValues.ts +8 -2
- package/src/theme/statusRoleDefaults.ts +330 -0
- package/src/theme/statusRoleDerivation.ts +2 -1
- package/src/theme/syntax/SyntaxTheme.tsx +12 -0
- package/src/theme/themeAdaptations.ts +53 -5
- package/src/theme/tokenDefaults.ts +44 -0
- package/src/theme/tokenValues.ts +193 -0
- package/src/theme/tokens.stylex.ts +7 -5
- package/src/theme/tokens.ts +14 -176
- package/src/theme/useTheme.ts +164 -35
- package/src/utils/devWarning.ts +24 -0
- package/src/utils/focusOutline.stylex.ts +7 -4
- package/src/utils/focusReturn.ts +578 -16
- package/src/utils/hitArea.ts +70 -33
- package/src/utils/inputStream.ts +81 -5
- package/src/utils/nodeType.ts +10 -0
- package/src/utils/timeFormat.ts +54 -4
- package/src/utils/touchPresentation.stylex.ts +7 -6
- package/src/utils/touchPresentation.ts +10 -7
- package/src/utils/touchQueries.ts +3 -2
- package/src/utils/typeaheadMatch.ts +20 -1
- package/src/virtualization/useInlineListWindow.ts +57 -33
|
@@ -51,6 +51,7 @@ const styles = stylex.create({
|
|
|
51
51
|
index: {
|
|
52
52
|
fontFamily: 'var(--font-family-code)',
|
|
53
53
|
fontSize: typeScaleVars['--text-supporting-size'],
|
|
54
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
54
55
|
fontVariantNumeric: 'tabular-nums',
|
|
55
56
|
color: colorVars['--color-text-secondary'],
|
|
56
57
|
},
|
|
@@ -140,11 +140,23 @@ const sortStyles = stylex.create({
|
|
|
140
140
|
},
|
|
141
141
|
font: 'inherit',
|
|
142
142
|
color: 'inherit',
|
|
143
|
-
|
|
143
|
+
// At least the cell's content width, so the whole cell is the target. A
|
|
144
|
+
// longer label may grow into the header cell's end padding before it
|
|
145
|
+
// wraps or truncates.
|
|
146
|
+
width: 'max-content',
|
|
147
|
+
minWidth: '100%',
|
|
148
|
+
maxWidth: 'calc(100% + var(--_table-header-end-room, 0px))',
|
|
144
149
|
height: '100%',
|
|
145
150
|
textAlign: 'inherit',
|
|
146
151
|
borderRadius: radiusVars['--radius-inner'],
|
|
147
152
|
},
|
|
153
|
+
// The label wraps or truncates before the sort indicator, so the indicator
|
|
154
|
+
// stays visible in a narrow column.
|
|
155
|
+
label: {
|
|
156
|
+
minWidth: 0,
|
|
157
|
+
overflow: 'hidden',
|
|
158
|
+
textOverflow: 'ellipsis',
|
|
159
|
+
},
|
|
148
160
|
// The button is a full-width flex container, so the `textAlign` a column's
|
|
149
161
|
// `align` puts on the <th> cannot position its contents. Mirror the column
|
|
150
162
|
// alignment onto the main axis, or an `align: 'end'` numeric column ends up
|
|
@@ -163,6 +175,7 @@ const sortStyles = stylex.create({
|
|
|
163
175
|
display: {default: 'inline-flex', ':empty': 'none'},
|
|
164
176
|
alignItems: 'center',
|
|
165
177
|
blockSize: 0,
|
|
178
|
+
flexShrink: 0,
|
|
166
179
|
},
|
|
167
180
|
iconWrapperUnsorted: {
|
|
168
181
|
opacity: {
|
|
@@ -303,7 +316,7 @@ function SortHeaderButton<T extends Record<string, unknown>>({
|
|
|
303
316
|
)}
|
|
304
317
|
aria-describedby={rank != null ? priorityId : undefined}
|
|
305
318
|
onClick={handleClick}>
|
|
306
|
-
<span>{children}</span>
|
|
319
|
+
<span {...stylex.props(sortStyles.label)}>{children}</span>
|
|
307
320
|
<span
|
|
308
321
|
{...stylex.props(
|
|
309
322
|
sortStyles.iconWrapper,
|
|
@@ -55,7 +55,7 @@ export const docs = {
|
|
|
55
55
|
name: 'config.comparators',
|
|
56
56
|
type: 'Partial<Record<TSortKey, (a: T, b: T) => number>>',
|
|
57
57
|
description:
|
|
58
|
-
'Ascending comparators per sort key; the hook flips the result for descending. Keys without one compare numbers numerically, compare other values as strings with a numeric collator in the active InternationalizationProvider locale, and put null, undefined and
|
|
58
|
+
'Ascending comparators per sort key (arrays such as tags need one: they have no sort text); the hook flips the result for descending. Keys without one compare numbers numerically, compare other values as strings with a numeric collator in the active InternationalizationProvider locale, and put null, undefined, NaN and an Invalid Date last in ascending order and first in descending. Arrays and plain objects have no sort text: they compare as equal to each other and sort before text in ascending order, so give a key such as tags a comparator. A Date sorts by its time.',
|
|
59
59
|
required: false,
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -91,7 +91,7 @@ export const docs = {
|
|
|
91
91
|
name: 'sortConfig',
|
|
92
92
|
type: 'UseTableSortableConfig<TSortKey>',
|
|
93
93
|
description:
|
|
94
|
-
'Pass to useTableSortable(sortConfig) and give the resulting plugin to Table.',
|
|
94
|
+
'Pass to useTableSortable<Row, TSortKey>(sortConfig), with the same type arguments as this hook (TypeScript cannot infer the row type there), and give the resulting plugin to Table.',
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
name: 'applySort',
|
|
@@ -112,7 +112,7 @@ export const docs = {
|
|
|
112
112
|
{
|
|
113
113
|
guidance: true,
|
|
114
114
|
description:
|
|
115
|
-
'Add a comparator for values whose order is not their string or number value, such as a status rank.',
|
|
115
|
+
'Add a comparator for values whose order is not their string or number value, such as a status rank, and for arrays such as tags, which otherwise have no sort text.',
|
|
116
116
|
},
|
|
117
117
|
{
|
|
118
118
|
guidance: false,
|
|
@@ -139,7 +139,7 @@ export const docsDense = {
|
|
|
139
139
|
'config.sort': 'controlled sort state; pair with onSortChange.',
|
|
140
140
|
'config.onSortChange': 'called with next sort state; required with sort.',
|
|
141
141
|
'config.comparators':
|
|
142
|
-
'ascending comparators per key (flipped for descending). Else numbers numeric, others numeric-collator strings in provider locale; null/undefined/NaN last ascending, first descending.',
|
|
142
|
+
'ascending comparators per key (arrays e.g. tags need one: no sort text; flipped for descending). Else numbers numeric, others numeric-collator strings in provider locale; null/undefined/NaN/Invalid Date last ascending, first descending; arrays/plain objects have no sort text (equal to each other, before text ascending): give them a comparator; Date sorts by time.',
|
|
143
143
|
'config.allowUnsortedState':
|
|
144
144
|
'to useTableSortable: third click returns to unsorted.',
|
|
145
145
|
'config.isMultiSortEnabled':
|
|
@@ -162,7 +162,7 @@ export const docsDense = {
|
|
|
162
162
|
{
|
|
163
163
|
guidance: true,
|
|
164
164
|
description:
|
|
165
|
-
'Add comparators for non-natural orders (e.g. status rank).',
|
|
165
|
+
'Add comparators for non-natural orders (e.g. status rank) and arrays (e.g. tags), which otherwise have no sort text.',
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
guidance: false,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useTableSortableState.tsx
|
|
7
|
-
* @input React, TableSortState types
|
|
7
|
+
* @input React, TableSortState types, isInvalidDate from columnUtils
|
|
8
8
|
* @output Exports useTableSortableState hook and config types
|
|
9
9
|
* @position Sort state helper; manages sort state + applies local sort to data.
|
|
10
10
|
* Pairs with useTableSortable (the headless sort plugin).
|
|
@@ -21,6 +21,7 @@ import {useState, useMemo, useCallback, useRef} from 'react';
|
|
|
21
21
|
import type {TableSortState, UseTableSortableConfig} from './useTableSortable';
|
|
22
22
|
import {useCollator} from '../../../i18n/useCollator';
|
|
23
23
|
import {useCommittedRef} from '../../../hooks/useCommittedRef';
|
|
24
|
+
import {isInvalidDate} from '../../columnUtils';
|
|
24
25
|
|
|
25
26
|
// =============================================================================
|
|
26
27
|
// Comparator Types
|
|
@@ -34,6 +35,14 @@ import {useCommittedRef} from '../../../hooks/useCommittedRef';
|
|
|
34
35
|
*/
|
|
35
36
|
export type TableSortComparator<T> = (a: T, b: T) => number;
|
|
36
37
|
|
|
38
|
+
function isMissingSortValue(value: unknown): boolean {
|
|
39
|
+
return (
|
|
40
|
+
value == null ||
|
|
41
|
+
(typeof value === 'number' && Number.isNaN(value)) ||
|
|
42
|
+
isInvalidDate(value)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
37
46
|
function toSortableString(value: unknown): string {
|
|
38
47
|
if (value instanceof Date) {
|
|
39
48
|
return value.toISOString();
|
|
@@ -170,13 +179,11 @@ function defaultCompare<T extends Record<string, unknown>>(
|
|
|
170
179
|
const aVal = a[sortKey];
|
|
171
180
|
const bVal = b[sortKey];
|
|
172
181
|
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
const aMissing =
|
|
177
|
-
|
|
178
|
-
const bMissing =
|
|
179
|
-
bVal == null || (typeof bVal === 'number' && Number.isNaN(bVal));
|
|
182
|
+
// Missing values never reach the comparisons below. Array.sort reads a NaN
|
|
183
|
+
// result as equal, which breaks the order of the other rows. toISOString
|
|
184
|
+
// throws for an Invalid Date.
|
|
185
|
+
const aMissing = isMissingSortValue(aVal);
|
|
186
|
+
const bMissing = isMissingSortValue(bVal);
|
|
180
187
|
if (aMissing && bMissing) {
|
|
181
188
|
return 0;
|
|
182
189
|
}
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
} from 'react';
|
|
25
25
|
import * as stylex from '@stylexjs/stylex';
|
|
26
26
|
import {registerCountIndependentPlugin} from '../../tableRowContextUsage';
|
|
27
|
+
import {scrollEdgeFadeOff} from '../../../hooks/scrollEdgeFade';
|
|
27
28
|
|
|
28
29
|
import {colorVars, durationVars, easeVars} from '../../../theme/tokens.stylex';
|
|
29
30
|
import type {
|
|
@@ -790,6 +791,13 @@ export function useTableStickyColumns<T extends Record<string, unknown>>(
|
|
|
790
791
|
return {
|
|
791
792
|
...props,
|
|
792
793
|
htmlProps: {...props.htmlProps, ref: mergedRef},
|
|
794
|
+
// A pinned edge marks its hidden columns with its own shadow, and
|
|
795
|
+
// the pinned column sits at that edge, so the edge does not fade.
|
|
796
|
+
xstyle: [
|
|
797
|
+
...props.xstyle,
|
|
798
|
+
...(stateRef.current.hasStart ? [scrollEdgeFadeOff.start] : []),
|
|
799
|
+
...(stateRef.current.hasEnd ? [scrollEdgeFadeOff.end] : []),
|
|
800
|
+
],
|
|
793
801
|
};
|
|
794
802
|
},
|
|
795
803
|
}),
|
|
@@ -68,6 +68,7 @@ import {createSharedContext} from '../../../utils/sharedContext';
|
|
|
68
68
|
|
|
69
69
|
registerEnglishFallback(english);
|
|
70
70
|
import {TableContext} from '../../TableContext';
|
|
71
|
+
import {defaultCellRenderer} from '../../columnUtils';
|
|
71
72
|
import {registerCountIndependentPlugin} from '../../tableRowContextUsage';
|
|
72
73
|
|
|
73
74
|
// =============================================================================
|
|
@@ -707,10 +708,7 @@ export function useTableTreeData<T extends Record<string, unknown>>(
|
|
|
707
708
|
<TreeCellContent item={item}>
|
|
708
709
|
{originalRenderCell
|
|
709
710
|
? originalRenderCell(item)
|
|
710
|
-
:
|
|
711
|
-
(item[col.key] as
|
|
712
|
-
string | number | null | undefined) ?? '',
|
|
713
|
-
)}
|
|
711
|
+
: defaultCellRenderer(item, col.key)}
|
|
714
712
|
</TreeCellContent>
|
|
715
713
|
),
|
|
716
714
|
};
|
|
@@ -51,9 +51,31 @@ export const overflowStyles = stylex.create({
|
|
|
51
51
|
export const wrapStyles = stylex.create({
|
|
52
52
|
cell: {
|
|
53
53
|
overflow: 'hidden',
|
|
54
|
+
// Break a word only when it cannot fit its column. A zero max-width or a
|
|
55
|
+
// break at any letter lets automatic layout shrink a column below its
|
|
56
|
+
// longest word. The table sets the word-break for its layout.
|
|
54
57
|
overflowWrap: 'break-word',
|
|
55
|
-
wordBreak: '
|
|
56
|
-
|
|
58
|
+
wordBreak: 'var(--_table-cell-word-break, normal)',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Header cells when the table's cells wrap.
|
|
64
|
+
*
|
|
65
|
+
* The table sets the white-space for its layout. In fixed layout the columns
|
|
66
|
+
* come from the column definitions, so a heading wraps like the body cells.
|
|
67
|
+
* In automatic layout a heading stays on one line and its column grows to fit
|
|
68
|
+
* it. There is no zero max-width: in automatic layout it would hold every
|
|
69
|
+
* column at zero width. Under `textOverflow="truncate"`, header cells use
|
|
70
|
+
* `overflowStyles` like the body cells.
|
|
71
|
+
*/
|
|
72
|
+
export const headerOverflowStyles = stylex.create({
|
|
73
|
+
cell: {
|
|
74
|
+
overflow: 'hidden',
|
|
75
|
+
textOverflow: 'ellipsis',
|
|
76
|
+
whiteSpace: 'var(--_table-header-white-space, normal)',
|
|
77
|
+
overflowWrap: 'break-word',
|
|
78
|
+
wordBreak: 'var(--_table-cell-word-break, normal)',
|
|
57
79
|
},
|
|
58
80
|
});
|
|
59
81
|
|
|
@@ -69,6 +91,11 @@ export const wrapStyles = stylex.create({
|
|
|
69
91
|
* Each density variant uses its own paddingInline as the fallback,
|
|
70
92
|
* so standalone tables (where --container-padding-inline-start/end are unset)
|
|
71
93
|
* keep their normal density-based cell padding unchanged.
|
|
94
|
+
*
|
|
95
|
+
* The last column's end inset is also exposed as `--_table-edge-inline-end`,
|
|
96
|
+
* so a header cell can give its content the same room it pads with. Every
|
|
97
|
+
* other cell resets it, so a Table nested in a last-column cell does not
|
|
98
|
+
* inherit the outer cell's inset.
|
|
72
99
|
*/
|
|
73
100
|
export const containerEdgeStyles = stylex.create({
|
|
74
101
|
compact: {
|
|
@@ -76,9 +103,13 @@ export const containerEdgeStyles = stylex.create({
|
|
|
76
103
|
default: null,
|
|
77
104
|
':first-child': `max(var(--container-padding-inline-start, ${spacingVars['--spacing-2']}), ${spacingVars['--spacing-2']})`,
|
|
78
105
|
},
|
|
106
|
+
'--_table-edge-inline-end': {
|
|
107
|
+
default: 'initial',
|
|
108
|
+
':last-child': `max(var(--container-padding-inline-end, ${spacingVars['--spacing-2']}), ${spacingVars['--spacing-2']})`,
|
|
109
|
+
},
|
|
79
110
|
paddingInlineEnd: {
|
|
80
111
|
default: null,
|
|
81
|
-
':last-child':
|
|
112
|
+
':last-child': 'var(--_table-edge-inline-end)',
|
|
82
113
|
},
|
|
83
114
|
},
|
|
84
115
|
balanced: {
|
|
@@ -86,9 +117,13 @@ export const containerEdgeStyles = stylex.create({
|
|
|
86
117
|
default: null,
|
|
87
118
|
':first-child': `max(var(--container-padding-inline-start, ${spacingVars['--spacing-3']}), ${spacingVars['--spacing-2']})`,
|
|
88
119
|
},
|
|
120
|
+
'--_table-edge-inline-end': {
|
|
121
|
+
default: 'initial',
|
|
122
|
+
':last-child': `max(var(--container-padding-inline-end, ${spacingVars['--spacing-3']}), ${spacingVars['--spacing-2']})`,
|
|
123
|
+
},
|
|
89
124
|
paddingInlineEnd: {
|
|
90
125
|
default: null,
|
|
91
|
-
':last-child':
|
|
126
|
+
':last-child': 'var(--_table-edge-inline-end)',
|
|
92
127
|
},
|
|
93
128
|
},
|
|
94
129
|
spacious: {
|
|
@@ -96,9 +131,13 @@ export const containerEdgeStyles = stylex.create({
|
|
|
96
131
|
default: null,
|
|
97
132
|
':first-child': `max(var(--container-padding-inline-start, ${spacingVars['--spacing-4']}), ${spacingVars['--spacing-2']})`,
|
|
98
133
|
},
|
|
134
|
+
'--_table-edge-inline-end': {
|
|
135
|
+
default: 'initial',
|
|
136
|
+
':last-child': `max(var(--container-padding-inline-end, ${spacingVars['--spacing-4']}), ${spacingVars['--spacing-2']})`,
|
|
137
|
+
},
|
|
99
138
|
paddingInlineEnd: {
|
|
100
139
|
default: null,
|
|
101
|
-
':last-child':
|
|
140
|
+
':last-child': 'var(--_table-edge-inline-end)',
|
|
102
141
|
},
|
|
103
142
|
},
|
|
104
143
|
});
|
package/src/Table/types.ts
CHANGED
|
@@ -710,7 +710,9 @@ export interface BaseTableProps<
|
|
|
710
710
|
afterTable?: ReactNode;
|
|
711
711
|
}>;
|
|
712
712
|
/**
|
|
713
|
-
* How default-rendered
|
|
713
|
+
* How default-rendered cell text behaves when it exceeds column width.
|
|
714
|
+
* Header cells follow the same mode: under `'wrap'` a long heading wraps in
|
|
715
|
+
* a data-driven table, and in children mode its column grows to fit it.
|
|
714
716
|
*
|
|
715
717
|
* - `'wrap'` (default) — text wraps and the row grows taller
|
|
716
718
|
* - `'truncate'` — text is clipped with an ellipsis; default-rendered cells
|
|
@@ -7,7 +7,7 @@ export const docs = {
|
|
|
7
7
|
subComponentOf: 'Table',
|
|
8
8
|
displayName: 'useTableColumnResize',
|
|
9
9
|
description:
|
|
10
|
-
'Hook that returns a TablePlugin adding draggable resize handles to column header borders. Supports pointer + keyboard (WAI-ARIA window splitter) resizing, RTL, per-column min/max widths, and proportional-column preservation (resizes the neighbor so the table stays full-width). Commits widths on release.',
|
|
10
|
+
'Hook that returns a TablePlugin adding draggable resize handles to column header borders. T is the row type; TypeScript cannot infer it from the config, so it defaults to Record<string, unknown>, which a Table with typed rows rejects: pass it, as in `useTableColumnResize<Walk>(…)` for `<Table<Walk>>`. Supports pointer + keyboard (WAI-ARIA window splitter) resizing, RTL, per-column min/max widths, and proportional-column preservation (resizes the neighbor so the table stays full-width). Commits widths on release.',
|
|
11
11
|
props: [
|
|
12
12
|
{
|
|
13
13
|
name: 'columnWidths',
|
|
@@ -46,7 +46,7 @@ export const docsZh = {
|
|
|
46
46
|
name: 'useTableColumnResize',
|
|
47
47
|
displayName: 'useTableColumnResize',
|
|
48
48
|
description:
|
|
49
|
-
'返回 TablePlugin 的 Hook
|
|
49
|
+
'返回 TablePlugin 的 Hook,为列表头边框添加可拖动的调整手柄。T 是行类型;TypeScript 无法从配置推断它,因此默认为 Record<string, unknown>,带类型行的 Table 不接受:请传入,例如 `useTableColumnResize<Walk>(…)` 对应 `<Table<Walk>>`。支持指针 + 键盘(WAI-ARIA 窗口分隔符)调整、RTL、每列最小/最大宽度,以及比例列保留(调整相邻列以保持表格全宽)。在释放时提交宽度。',
|
|
50
50
|
props: [
|
|
51
51
|
{
|
|
52
52
|
name: 'columnWidths',
|
|
@@ -83,7 +83,7 @@ export const docsDense = {
|
|
|
83
83
|
name: 'useTableColumnResize',
|
|
84
84
|
displayName: 'useTableColumnResize',
|
|
85
85
|
description:
|
|
86
|
-
'Hook returning TablePlugin w/ draggable column resize handles. Pointer + keyboard (WAI-ARIA splitter), RTL, per-column min/max, proportional-preserving (resizes neighbor). Commits on release.',
|
|
86
|
+
'Hook returning TablePlugin w/ draggable column resize handles. T = row type, not inferred from config (defaults to Record<string, unknown>, rejected by typed Table): pass it, e.g. `useTableColumnResize<Walk>(…)`. Pointer + keyboard (WAI-ARIA splitter), RTL, per-column min/max, proportional-preserving (resizes neighbor). Commits on release.',
|
|
87
87
|
propDescriptions: {
|
|
88
88
|
columnWidths: 'Controlled pixel-width overrides keyed by column key.',
|
|
89
89
|
onColumnResizeEnd:
|
|
@@ -6,7 +6,7 @@ export const docs = {
|
|
|
6
6
|
name: 'useTableColumnSettings',
|
|
7
7
|
subComponentOf: 'Table',
|
|
8
8
|
displayName: 'useTableColumnSettings',
|
|
9
|
-
description: 'Headless column visibility and ordering management for Table. Provides filtered columns, toggle helpers, and pre-built MultiSelector options for a column picker UI.',
|
|
9
|
+
description: 'Headless column visibility and ordering management for Table. T is the row type; TypeScript cannot infer it from the config, so it defaults to Record<string, unknown>, which a Table with typed rows rejects: pass it, as in `useTableColumnSettings<Walk>(…)` for `<Table<Walk>>`. When the column keys have a narrower type than string (a union, or keys that useTableColumnSettingsState infers from its columns), pass both: `useTableColumnSettings<Walk, WalkColumnKey>(…)`. Provides filtered columns, toggle helpers, and pre-built MultiSelector options for a column picker UI.',
|
|
10
10
|
props: [
|
|
11
11
|
{
|
|
12
12
|
name: 'columns',
|
|
@@ -37,7 +37,7 @@ export const docs = {
|
|
|
37
37
|
export const docsZh = {
|
|
38
38
|
name: 'useTableColumnSettings',
|
|
39
39
|
displayName: 'useTableColumnSettings',
|
|
40
|
-
description: '
|
|
40
|
+
description: '无头列可见性和排序管理。T 是行类型;TypeScript 无法从配置推断它,因此默认为 Record<string, unknown>,带类型行的 Table 不接受:请传入,例如 `useTableColumnSettings<Walk>(…)` 对应 `<Table<Walk>>`。列键的类型比 string 更窄时(联合类型,或 useTableColumnSettingsState 从 columns 推断出的键),请传入两个类型参数:`useTableColumnSettings<Walk, WalkColumnKey>(…)`。提供筛选后的列、切换帮助方法和 MultiSelector 选项。',
|
|
41
41
|
props: [
|
|
42
42
|
{
|
|
43
43
|
name: 'columns',
|
|
@@ -63,7 +63,7 @@ export const docsZh = {
|
|
|
63
63
|
export const docsDense = {
|
|
64
64
|
name: 'useTableColumnSettings',
|
|
65
65
|
displayName: 'useTableColumnSettings',
|
|
66
|
-
description: 'Headless column visibility/ordering. Provides filtered columns, toggle helpers, MultiSelector options.',
|
|
66
|
+
description: 'Headless column visibility/ordering. T = row type, not inferred from config (defaults to Record<string, unknown>, rejected by typed Table): pass it, e.g. `useTableColumnSettings<Walk>(…)`; narrower column-key type => pass both: `useTableColumnSettings<Walk, WalkColumnKey>(…)`. Provides filtered columns, toggle helpers, MultiSelector options.',
|
|
67
67
|
propDescriptions: {
|
|
68
68
|
columns: 'All available columns w/ metadata (key, label, isAlwaysVisible, group).',
|
|
69
69
|
activeColumnKeys: 'Active column keys in display order.',
|
|
@@ -7,7 +7,8 @@ export const docs = {
|
|
|
7
7
|
subComponentOf: 'Table',
|
|
8
8
|
displayName: 'useTableFilterState',
|
|
9
9
|
isHiddenFromOverview: true,
|
|
10
|
-
description:
|
|
10
|
+
description:
|
|
11
|
+
'Managed state hook for table filtering. Returns filters (the current filter map), onFilterChange, and clearAll (clears every filter, for example from a "Clear filters" button in the Table emptyState). Pass filters and onFilterChange to useTableFiltering.',
|
|
11
12
|
props: [
|
|
12
13
|
{
|
|
13
14
|
name: 'initialState',
|
|
@@ -21,7 +22,8 @@ export const docsZh = {
|
|
|
21
22
|
name: 'useTableFilterState',
|
|
22
23
|
isHiddenFromOverview: true,
|
|
23
24
|
displayName: 'useTableFilterState',
|
|
24
|
-
description:
|
|
25
|
+
description:
|
|
26
|
+
'表格筛选的受管状态 hook。返回 filters(当前筛选映射)、onFilterChange 和 clearAll(清除所有筛选,例如 Table emptyState 中的“清除筛选”按钮)。将 filters 和 onFilterChange 传给 useTableFiltering。',
|
|
25
27
|
props: [
|
|
26
28
|
{
|
|
27
29
|
name: 'initialState',
|
|
@@ -35,7 +37,8 @@ export const docsDense = {
|
|
|
35
37
|
name: 'useTableFilterState',
|
|
36
38
|
isHiddenFromOverview: true,
|
|
37
39
|
displayName: 'useTableFilterState',
|
|
38
|
-
description:
|
|
40
|
+
description:
|
|
41
|
+
'Managed filter state hook. Returns {filters, onFilterChange, clearAll}; pass filters + onFilterChange to useTableFiltering; clearAll resets every filter.',
|
|
39
42
|
propDescriptions: {
|
|
40
43
|
initialState: 'Optional initial filter state map.',
|
|
41
44
|
},
|
|
@@ -7,7 +7,8 @@ export const docs = {
|
|
|
7
7
|
subComponentOf: 'Table',
|
|
8
8
|
displayName: 'useTableFiltering',
|
|
9
9
|
isHiddenFromOverview: true,
|
|
10
|
-
description:
|
|
10
|
+
description:
|
|
11
|
+
'Table plugin that adds inline column filters with popover or inline controls. T is the row type; TypeScript cannot infer it from the config, so it defaults to Record<string, unknown>, which a Table with typed rows rejects: pass it, as in `useTableFiltering<Walk>(…)` for `<Table<Walk>>`. Pairs with useTableFilterState for managed state. Supports text, select, multi-select, date, and number filter types via PowerSearch field definitions. The plugin renders the filter controls only; it does not remove rows. Filter the data yourself (toSearchFilters with applyFilters from usePowerSearchConfig) and pass the result to Table. When no row matches, Table shows its emptyState prop.',
|
|
11
12
|
props: [
|
|
12
13
|
{
|
|
13
14
|
name: 'filters',
|
|
@@ -18,7 +19,8 @@ export const docs = {
|
|
|
18
19
|
{
|
|
19
20
|
name: 'onFilterChange',
|
|
20
21
|
type: '(columnKey: string, value: TableFilterValue | null) => void',
|
|
21
|
-
description:
|
|
22
|
+
description:
|
|
23
|
+
'Called when the user changes a filter value. null clears the filter.',
|
|
22
24
|
required: true,
|
|
23
25
|
},
|
|
24
26
|
{
|
|
@@ -27,6 +29,60 @@ export const docs = {
|
|
|
27
29
|
description: 'Display variant for filter controls.',
|
|
28
30
|
default: "'popover'",
|
|
29
31
|
},
|
|
32
|
+
{
|
|
33
|
+
name: 'searchConfig',
|
|
34
|
+
type: 'PowerSearchConfig',
|
|
35
|
+
description:
|
|
36
|
+
"Defines the filter fields. A column sets `filter: '<field key>'` to show the control for that field. Build it with usePowerSearchConfig or createPowerSearchConfig; PowerSearch can use the same config.",
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
examples: [
|
|
41
|
+
{
|
|
42
|
+
label: 'Filtered table with an empty state for no matches',
|
|
43
|
+
code: `const fields = [
|
|
44
|
+
{key: 'name', type: 'string', label: 'Name'},
|
|
45
|
+
{key: 'status', type: 'enum', label: 'Status', enumValues: [
|
|
46
|
+
{value: 'active', label: 'Active'},
|
|
47
|
+
{value: 'inactive', label: 'Inactive'},
|
|
48
|
+
]},
|
|
49
|
+
] as const;
|
|
50
|
+
|
|
51
|
+
interface User extends Record<string, unknown> {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
status: 'active' | 'inactive';
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const columns: TableColumn<User>[] = [
|
|
58
|
+
{key: 'name', header: 'Name', filter: 'name'},
|
|
59
|
+
{key: 'status', header: 'Status', filter: 'status'},
|
|
60
|
+
];
|
|
61
|
+
|
|
62
|
+
function UsersTable({users}: {users: User[]}) {
|
|
63
|
+
const {config, applyFilters} = usePowerSearchConfig(fields);
|
|
64
|
+
const {filters, onFilterChange, clearAll} = useTableFilterState();
|
|
65
|
+
const filterPlugin = useTableFiltering<User>({filters, onFilterChange, searchConfig: config});
|
|
66
|
+
// The plugin draws the controls. You remove the rows that do not match.
|
|
67
|
+
const visibleUsers = applyFilters(toSearchFilters(filters, columns, config), users);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Table
|
|
71
|
+
data={visibleUsers}
|
|
72
|
+
columns={columns}
|
|
73
|
+
idKey="id"
|
|
74
|
+
plugins={{filter: filterPlugin}}
|
|
75
|
+
emptyState={
|
|
76
|
+
<EmptyState
|
|
77
|
+
title="No matching users"
|
|
78
|
+
description="Change or clear the filters."
|
|
79
|
+
actions={<Button label="Clear filters" onClick={clearAll} />}
|
|
80
|
+
/>
|
|
81
|
+
}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
}`,
|
|
85
|
+
},
|
|
30
86
|
],
|
|
31
87
|
};
|
|
32
88
|
|
|
@@ -34,7 +90,8 @@ export const docsZh = {
|
|
|
34
90
|
name: 'useTableFiltering',
|
|
35
91
|
isHiddenFromOverview: true,
|
|
36
92
|
displayName: 'useTableFiltering',
|
|
37
|
-
description:
|
|
93
|
+
description:
|
|
94
|
+
'表格筛选插件,添加内联列过滤器(弹出式或内联控件)。T 是行类型;TypeScript 无法从配置推断它,因此默认为 Record<string, unknown>,带类型行的 Table 不接受:请传入,例如 `useTableFiltering<Walk>(…)` 对应 `<Table<Walk>>`。与 useTableFilterState 配合使用管理状态。插件只渲染筛选控件,不会移除行:请自行筛选数据(toSearchFilters 配合 usePowerSearchConfig 的 applyFilters),再把结果传给 Table。没有匹配的行时,Table 显示其 emptyState 属性。',
|
|
38
95
|
props: [
|
|
39
96
|
{
|
|
40
97
|
name: 'filters',
|
|
@@ -54,6 +111,13 @@ export const docsZh = {
|
|
|
54
111
|
description: '筛选控件的显示变体。',
|
|
55
112
|
default: "'popover'",
|
|
56
113
|
},
|
|
114
|
+
{
|
|
115
|
+
name: 'searchConfig',
|
|
116
|
+
type: 'PowerSearchConfig',
|
|
117
|
+
description:
|
|
118
|
+
"定义筛选字段。列设置 `filter: '<字段键>'` 即显示该字段的控件。用 usePowerSearchConfig 或 createPowerSearchConfig 构建;PowerSearch 可共用同一配置。",
|
|
119
|
+
required: true,
|
|
120
|
+
},
|
|
57
121
|
],
|
|
58
122
|
};
|
|
59
123
|
|
|
@@ -61,10 +125,13 @@ export const docsDense = {
|
|
|
61
125
|
name: 'useTableFiltering',
|
|
62
126
|
isHiddenFromOverview: true,
|
|
63
127
|
displayName: 'useTableFiltering',
|
|
64
|
-
description:
|
|
128
|
+
description:
|
|
129
|
+
'Table filtering plugin: inline column filters (popover/inline). T = row type, not inferred from config (defaults to Record<string, unknown>, rejected by typed Table): pass it, e.g. `useTableFiltering<Walk>(…)`. Pairs w/ useTableFilterState. Renders controls only, does not remove rows: filter data yourself (applyFilters(toSearchFilters(filters, columns, config), data)) + pass result to Table; no match => Table emptyState.',
|
|
65
130
|
propDescriptions: {
|
|
66
131
|
filters: 'Current filter state map (columnKey → value).',
|
|
67
132
|
onFilterChange: 'Called on filter change. null clears.',
|
|
68
133
|
variant: 'Filter control display variant.',
|
|
134
|
+
searchConfig:
|
|
135
|
+
"PowerSearchConfig defining filter fields; column `filter: '<field key>'` picks one. Build w/ usePowerSearchConfig.",
|
|
69
136
|
},
|
|
70
137
|
};
|
|
@@ -16,7 +16,7 @@ export const docs = {
|
|
|
16
16
|
'Incrementally load flat Table data with one shared automatic/manual request lifecycle. Returns a stable TablePlugin<T>. A localized Load more Button stays available while hasMore is true; IntersectionObserver adds automatic loading when the end sentinel is visible. The Button remains mounted and focusable while busy and owns the loading announcement.',
|
|
17
17
|
usage: {
|
|
18
18
|
description:
|
|
19
|
-
'Call useTableInfiniteScroll<T>({hasMore, isLoading, onLoadMore}) and pass the result to <Table plugins={{infiniteScroll: plugin}} />. Keep accumulated rows in your own state. onLoadMore must return a Promise<void> that settles when the batch work completes. A fulfilled request finishes after settlement and a subsequent committed isLoading=false; a true loading phase is not required. Visible short batches can automatically request again in a later task, so update hasMore when the source is exhausted. A resolved request that appends no rows must not incorrectly claim endless more data. Throws, rejections and invalid non-Promise results pause automatic loading; the manual Button can retry once controlled loading is false. The hook does not render product errors or cancel transport. For a new dataset, key and remount the component owning both the hook and its Table, not only the Table child; prevent stale responses from committing caller data yourself. Children mode and unsupported row models do not load and emit a deduplicated development warning. Body modifiers must declare compatible rowModel: flat. Observation uses the Table scroll area while the Table windows its rows, and the browser viewport otherwise, with zero look-ahead and no ancestor discovery. Without IntersectionObserver, the same manual command works.',
|
|
19
|
+
'Call useTableInfiniteScroll<T>({hasMore, isLoading, onLoadMore}) and pass the result to <Table plugins={{infiniteScroll: plugin}} />. T is the row type; TypeScript cannot infer it from the config, so it defaults to Record<string, unknown>, which a Table with typed rows rejects: pass it, as in `useTableInfiniteScroll<Walk>(…)` for `<Table<Walk>>`. Keep accumulated rows in your own state. onLoadMore must return a Promise<void> that settles when the batch work completes. A fulfilled request finishes after settlement and a subsequent committed isLoading=false; a true loading phase is not required. Visible short batches can automatically request again in a later task, so update hasMore when the source is exhausted. A resolved request that appends no rows must not incorrectly claim endless more data. Throws, rejections and invalid non-Promise results pause automatic loading; the manual Button can retry once controlled loading is false. The hook does not render product errors or cancel transport. For a new dataset, key and remount the component owning both the hook and its Table, not only the Table child; prevent stale responses from committing caller data yourself. Children mode and unsupported row models do not load and emit a deduplicated development warning. Body modifiers must declare compatible rowModel: flat. Observation uses the Table scroll area while the Table windows its rows, and the browser viewport otherwise, with zero look-ahead and no ancestor discovery. Without IntersectionObserver, the same manual command works.',
|
|
20
20
|
},
|
|
21
21
|
props: [
|
|
22
22
|
{
|
|
@@ -46,7 +46,7 @@ export const docs = {
|
|
|
46
46
|
/** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
|
|
47
47
|
export const docsDense = {
|
|
48
48
|
description:
|
|
49
|
-
'Stable flat-data TablePlugin<T>. Three controlled fields: hasMore, isLoading, onLoadMore():Promise<void>. Always-available manual Button; visible sentinel adds automatic loads. Shared latch and post-settlement false commit gate completion. Failure pauses automatic loads; manual retry recovers. Reset by remounting the hook owner and Table together.',
|
|
49
|
+
'Stable flat-data TablePlugin<T>. T = row type, not inferred from config (defaults to Record<string, unknown>, rejected by typed Table): pass it, e.g. `useTableInfiniteScroll<Walk>(…)`. Three controlled fields: hasMore, isLoading, onLoadMore():Promise<void>. Always-available manual Button; visible sentinel adds automatic loads. Shared latch and post-settlement false commit gate completion. Failure pauses automatic loads; manual retry recovers. Reset by remounting the hook owner and Table together.',
|
|
50
50
|
propDescriptions: {
|
|
51
51
|
hasMore:
|
|
52
52
|
'Allow another batch. False removes observation/chrome and hands off only owned Button focus.',
|
|
@@ -8,8 +8,29 @@ export const docs = {
|
|
|
8
8
|
displayName: 'useTablePagination',
|
|
9
9
|
description: 'Headless pagination plugin for Table. Call with a config object: `useTablePagination({ page, onPageChange, totalItems })`. Returns a TablePlugin to pass to `<Table plugins={{ pagination: paginationPlugin }} />`.',
|
|
10
10
|
usage: {
|
|
11
|
-
description: 'Call useTablePagination with a config object containing page state and callback. Pass the returned plugin to Table via the plugins prop.',
|
|
11
|
+
description: 'Call useTablePagination with a config object containing page state and callback. T is the row type; TypeScript cannot infer it from the config, so it defaults to Record<string, unknown>, which a Table with typed rows rejects: pass it, as in `useTablePagination<Walk>(…)` for `<Table<Walk>>`. Pass the returned plugin to Table via the plugins prop.',
|
|
12
12
|
},
|
|
13
|
+
examples: [
|
|
14
|
+
{
|
|
15
|
+
label: 'Typed rows, one page at a time',
|
|
16
|
+
code: `interface Walk extends Record<string, unknown> { id: string; name: string; km: number }
|
|
17
|
+
const columns: TableColumn<Walk>[] = [{key: 'name', header: 'Name'}, {key: 'km', header: 'Km'}];
|
|
18
|
+
|
|
19
|
+
const pageSize = 20;
|
|
20
|
+
const [page, setPage] = useState(1);
|
|
21
|
+
// Pass the row type: TypeScript cannot infer it from the config.
|
|
22
|
+
const paginationPlugin = useTablePagination<Walk>({
|
|
23
|
+
page,
|
|
24
|
+
onPageChange: setPage,
|
|
25
|
+
totalItems: walks.length,
|
|
26
|
+
pageSize,
|
|
27
|
+
});
|
|
28
|
+
// The plugin draws the page controls; pass only the current page's rows.
|
|
29
|
+
const pageRows = walks.slice((page - 1) * pageSize, page * pageSize);
|
|
30
|
+
|
|
31
|
+
<Table data={pageRows} columns={columns} idKey="id" plugins={{pagination: paginationPlugin}} />;`,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
13
34
|
props: [
|
|
14
35
|
{
|
|
15
36
|
name: 'page',
|
|
@@ -84,7 +105,7 @@ export const docs = {
|
|
|
84
105
|
export const docsZh = {
|
|
85
106
|
name: 'useTablePagination',
|
|
86
107
|
displayName: 'useTablePagination',
|
|
87
|
-
description: '
|
|
108
|
+
description: '无头分页插件。T 是行类型;TypeScript 无法从配置推断它,因此默认为 Record<string, unknown>,带类型行的 Table 不接受:请传入,例如 `useTablePagination<Walk>(…)` 对应 `<Table<Walk>>`。支持客户端切片、服务器端分页和游标分页。自动渲染 Pagination 控件。',
|
|
88
109
|
props: [
|
|
89
110
|
{
|
|
90
111
|
name: 'page',
|
|
@@ -127,7 +148,7 @@ export const docsZh = {
|
|
|
127
148
|
export const docsDense = {
|
|
128
149
|
name: 'useTablePagination',
|
|
129
150
|
displayName: 'useTablePagination',
|
|
130
|
-
description: 'Headless pagination plugin. Client-side slicing, server-side, or cursor-based. Auto-renders Pagination above/below/both.',
|
|
151
|
+
description: 'Headless pagination plugin. T = row type, not inferred from config (defaults to Record<string, unknown>, rejected by typed Table): pass it, e.g. `useTablePagination<Walk>(…)`. Client-side slicing, server-side, or cursor-based. Auto-renders Pagination above/below/both.',
|
|
131
152
|
propDescriptions: {
|
|
132
153
|
page: 'Current page (1-based).',
|
|
133
154
|
onPageChange: 'Called on page change.',
|