@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
|
@@ -234,12 +234,14 @@ const styles = stylex.create({
|
|
|
234
234
|
minHeight: sizeVars['--size-element-md'],
|
|
235
235
|
color: colorVars['--color-text-secondary'],
|
|
236
236
|
fontSize: typeScaleVars['--text-label-size'],
|
|
237
|
+
lineHeight: typeScaleVars['--text-label-leading'],
|
|
237
238
|
userSelect: 'none',
|
|
238
239
|
},
|
|
239
240
|
ellipsisSm: {
|
|
240
241
|
minWidth: sizeVars['--size-element-sm'],
|
|
241
242
|
minHeight: sizeVars['--size-element-sm'],
|
|
242
243
|
fontSize: typeScaleVars['--text-supporting-size'],
|
|
244
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
243
245
|
},
|
|
244
246
|
infoText: {
|
|
245
247
|
display: 'flex',
|
|
@@ -291,18 +293,22 @@ const styles = stylex.create({
|
|
|
291
293
|
inputLabel: {
|
|
292
294
|
color: colorVars['--color-text-secondary'],
|
|
293
295
|
fontSize: typeScaleVars['--text-label-size'],
|
|
296
|
+
lineHeight: typeScaleVars['--text-label-leading'],
|
|
294
297
|
userSelect: 'none',
|
|
295
298
|
},
|
|
296
299
|
inputLabelSm: {
|
|
297
300
|
fontSize: typeScaleVars['--text-supporting-size'],
|
|
301
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
298
302
|
},
|
|
299
303
|
inputTotal: {
|
|
300
304
|
color: colorVars['--color-text-secondary'],
|
|
301
305
|
fontSize: typeScaleVars['--text-label-size'],
|
|
306
|
+
lineHeight: typeScaleVars['--text-label-leading'],
|
|
302
307
|
userSelect: 'none',
|
|
303
308
|
},
|
|
304
309
|
inputTotalSm: {
|
|
305
310
|
fontSize: typeScaleVars['--text-supporting-size'],
|
|
311
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
306
312
|
},
|
|
307
313
|
pageSizeSelector: {
|
|
308
314
|
display: 'flex',
|
|
@@ -400,9 +406,29 @@ function navigatesHere(event: React.MouseEvent<HTMLElement>): boolean {
|
|
|
400
406
|
* Button replaces the element when the control starts or stops being a link.
|
|
401
407
|
* The new element takes the focus.
|
|
402
408
|
*/
|
|
403
|
-
function PaginationButton(
|
|
409
|
+
function PaginationButton({
|
|
410
|
+
isCurrent = false,
|
|
411
|
+
rowEnd,
|
|
412
|
+
...props
|
|
413
|
+
}: React.ComponentProps<typeof Button> & {
|
|
414
|
+
isCurrent?: boolean;
|
|
415
|
+
rowEnd?: 'first' | 'last';
|
|
416
|
+
}) {
|
|
404
417
|
const ref = useFocusAcrossSwap<HTMLButtonElement>();
|
|
405
|
-
return
|
|
418
|
+
return (
|
|
419
|
+
<Button
|
|
420
|
+
{...props}
|
|
421
|
+
{...themeProps('pagination-item', {
|
|
422
|
+
selected: isCurrent ? 'selected' : null,
|
|
423
|
+
// A theme that joins the controls into one strip reads the row's ends
|
|
424
|
+
// here. A control with a tooltip renders its layer after it in the
|
|
425
|
+
// row, so `:last-child` can miss the last control.
|
|
426
|
+
first: rowEnd === 'first' ? 'first' : null,
|
|
427
|
+
last: rowEnd === 'last' ? 'last' : null,
|
|
428
|
+
})}
|
|
429
|
+
ref={ref}
|
|
430
|
+
/>
|
|
431
|
+
);
|
|
406
432
|
}
|
|
407
433
|
|
|
408
434
|
// =============================================================================
|
|
@@ -696,9 +722,9 @@ export function Pagination({
|
|
|
696
722
|
<span
|
|
697
723
|
key={`ellipsis-${previousPage}-${nextPage}`}
|
|
698
724
|
aria-hidden="true"
|
|
699
|
-
{...
|
|
700
|
-
|
|
701
|
-
isSm && styles.ellipsisSm,
|
|
725
|
+
{...mergeProps(
|
|
726
|
+
themeProps('pagination-ellipsis'),
|
|
727
|
+
stylex.props(styles.ellipsis, isSm && styles.ellipsisSm),
|
|
702
728
|
)}>
|
|
703
729
|
…
|
|
704
730
|
</span>
|
|
@@ -717,6 +743,7 @@ export function Pagination({
|
|
|
717
743
|
{...controlProps(item, true)}
|
|
718
744
|
isDisabled={isDisabled}
|
|
719
745
|
aria-current={isActive ? 'page' : undefined}
|
|
746
|
+
isCurrent={isActive}
|
|
720
747
|
xstyle={isActive && styles.activePage}>
|
|
721
748
|
{item}
|
|
722
749
|
</PaginationButton>
|
|
@@ -920,7 +947,10 @@ export function Pagination({
|
|
|
920
947
|
</div>
|
|
921
948
|
)}
|
|
922
949
|
<div
|
|
923
|
-
{...
|
|
950
|
+
{...mergeProps(
|
|
951
|
+
themeProps('pagination-list', {variant, size}),
|
|
952
|
+
stylex.props(styles.controls),
|
|
953
|
+
)}
|
|
924
954
|
// A key or pointer press can arrive before that task. The click that
|
|
925
955
|
// it starts counts from the current page too.
|
|
926
956
|
onKeyDownCapture={countFromCurrentPage}
|
|
@@ -941,6 +971,7 @@ export function Pagination({
|
|
|
941
971
|
{...controlProps(1, hasPrevious)}
|
|
942
972
|
isDisabled={isDisabled || !hasPrevious}
|
|
943
973
|
isIconOnly
|
|
974
|
+
rowEnd="first"
|
|
944
975
|
xstyle={variant === 'compact' && styles.compactFirst}
|
|
945
976
|
/>
|
|
946
977
|
)}
|
|
@@ -960,6 +991,7 @@ export function Pagination({
|
|
|
960
991
|
{...controlProps(clampPage(linkPage - step), hasPrevious)}
|
|
961
992
|
isDisabled={isDisabled || !hasPrevious}
|
|
962
993
|
isIconOnly
|
|
994
|
+
rowEnd={showFirstLast ? undefined : 'first'}
|
|
963
995
|
/>
|
|
964
996
|
|
|
965
997
|
{renderIndicator()}
|
|
@@ -979,6 +1011,7 @@ export function Pagination({
|
|
|
979
1011
|
{...controlProps(clampPage(linkPage + step), hasNext)}
|
|
980
1012
|
isDisabled={isDisabled || !hasNext}
|
|
981
1013
|
isIconOnly
|
|
1014
|
+
rowEnd={showFirstLast ? undefined : 'last'}
|
|
982
1015
|
/>
|
|
983
1016
|
|
|
984
1017
|
{showFirstLast && (
|
|
@@ -997,6 +1030,7 @@ export function Pagination({
|
|
|
997
1030
|
{...controlProps(computedTotalPages ?? optimisticPage, hasNext)}
|
|
998
1031
|
isDisabled={isDisabled || !hasNext}
|
|
999
1032
|
isIconOnly
|
|
1033
|
+
rowEnd="last"
|
|
1000
1034
|
xstyle={variant === 'compact' && styles.compactLast}
|
|
1001
1035
|
/>
|
|
1002
1036
|
)}
|
|
@@ -223,6 +223,11 @@ export const docs = {
|
|
|
223
223
|
description:
|
|
224
224
|
'A click-triggered overlay anchored to a button or trigger element. Use it for secondary actions, inline confirmations, or supplementary information that does not warrant a full dialog. For hover previews use HoverCard, for brief helper text use Tooltip. Under a finger (a coarse primary pointer), it is presented like a native popover: it grows out of its trigger and shrinks back into it on the theme\u2019s motion tokens; with reduced motion it cross-fades, opacity only, in 200 ms or less.',
|
|
225
225
|
bestPractices: [
|
|
226
|
+
{
|
|
227
|
+
guidance: false,
|
|
228
|
+
description:
|
|
229
|
+
"Don't add your own focus return or try to turn it off. When the anchored popover closes with focus inside it, focus goes back to the opener, or to the nearest control that stands in for it, never to the page; as a BottomSheet it uses the sheet's own return. To send focus somewhere specific, focus that element in onOpenChange.",
|
|
230
|
+
},
|
|
226
231
|
{
|
|
227
232
|
guidance: true,
|
|
228
233
|
description:
|
|
@@ -441,6 +446,11 @@ export const docsZh = {
|
|
|
441
446
|
description:
|
|
442
447
|
'A click-triggered overlay anchored to a button or trigger element. Use it for secondary actions, inline confirmations, or supplementary information that does not warrant a full dialog. For hover previews use HoverCard, for brief helper text use Tooltip. Under a finger (a coarse primary pointer), it is presented like a native popover: it grows out of its trigger and shrinks back into it on the theme\u2019s motion tokens; with reduced motion it cross-fades, opacity only, in 200 ms or less.',
|
|
443
448
|
bestPractices: [
|
|
449
|
+
{
|
|
450
|
+
guidance: false,
|
|
451
|
+
description:
|
|
452
|
+
'不要自行实现或关闭焦点返回。锚定的弹出框在焦点位于其内部时关闭,焦点会回到打开它的元素,或回到最近的替代控件,绝不会落到页面上;以底部面板呈现时使用面板自身的焦点返回。若要把焦点移到特定位置,请在 onOpenChange 中聚焦该元素。',
|
|
453
|
+
},
|
|
444
454
|
{
|
|
445
455
|
guidance: true,
|
|
446
456
|
description:
|
package/src/Popover/Popover.tsx
CHANGED
|
@@ -913,10 +913,14 @@ export function Popover({
|
|
|
913
913
|
isSheetMounted ? 'dialog' : popover.triggerProps['aria-haspopup'],
|
|
914
914
|
);
|
|
915
915
|
button.setAttribute('aria-expanded', String(isAnySurfaceOpen));
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
916
|
+
// A closed trigger names no surface. The attach runs again as the
|
|
917
|
+
// surface opens and closes, so the reference follows the open state.
|
|
918
|
+
if (isAnySurfaceOpen) {
|
|
919
|
+
button.setAttribute(
|
|
920
|
+
'aria-controls',
|
|
921
|
+
isSheetMounted ? sheetId : popover.triggerProps['aria-controls'],
|
|
922
|
+
);
|
|
923
|
+
}
|
|
920
924
|
// The trigger's text is in the DOM the caller rendered, read as the
|
|
921
925
|
// trigger attaches; it names a sheet that has no `label` (DEC-8).
|
|
922
926
|
// eslint-disable-next-line @eslint-react/set-state-in-effect -- reads the caller-rendered trigger's text, which only the DOM holds
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file popoverAnchor.ts
|
|
5
|
+
* @input A caller's `anchorRef`
|
|
6
|
+
* @output resolvePopoverAnchor
|
|
7
|
+
* @position Internal to Popover; usePopover binds the element it resolves as
|
|
8
|
+
* the layer's CSS anchor, apart from the trigger
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {RefObject} from 'react';
|
|
12
|
+
import {warnOnce} from '../utils/devWarning';
|
|
13
|
+
|
|
14
|
+
// Bundlers replace this value at build time. The declaration lets a product
|
|
15
|
+
// without Node's types type-check this file.
|
|
16
|
+
declare const process: {readonly env: {readonly NODE_ENV?: string}};
|
|
17
|
+
|
|
18
|
+
/** The element `anchorRef` holds now, or `null` when it holds none in a document. */
|
|
19
|
+
export function resolvePopoverAnchor(
|
|
20
|
+
anchorRef: RefObject<Element | null>,
|
|
21
|
+
): Element | null {
|
|
22
|
+
const element = anchorRef.current;
|
|
23
|
+
if (element == null || !element.isConnected) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
// A shape or a nested `<svg>` inside an `<svg>` has no CSS box. It cannot
|
|
27
|
+
// be an anchor, so the popover sits at the viewport corner. An `<svg>`
|
|
28
|
+
// whose parent is HTML or `<foreignObject>` has a box.
|
|
29
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
30
|
+
const svg = 'http://www.w3.org/2000/svg';
|
|
31
|
+
const parent = element.parentElement;
|
|
32
|
+
if (
|
|
33
|
+
element.namespaceURI === svg &&
|
|
34
|
+
parent?.namespaceURI === svg &&
|
|
35
|
+
parent.localName !== 'foreignObject'
|
|
36
|
+
) {
|
|
37
|
+
warnOnce(
|
|
38
|
+
'usePopover:anchor-svg-shape',
|
|
39
|
+
'usePopover',
|
|
40
|
+
'`anchorRef` holds a shape or a nested <svg> inside an <svg>, which has ' +
|
|
41
|
+
'no CSS box, so the popover cannot sit on it. Anchor to the ' +
|
|
42
|
+
'outermost <svg> element or to an HTML element placed over it.',
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return element;
|
|
47
|
+
}
|
|
@@ -16,6 +16,12 @@ export const docs = {
|
|
|
16
16
|
'flyout',
|
|
17
17
|
],
|
|
18
18
|
params: [
|
|
19
|
+
{
|
|
20
|
+
name: 'anchorRef',
|
|
21
|
+
type: 'React.RefObject<Element | null>',
|
|
22
|
+
description:
|
|
23
|
+
'External ref to use as the popover anchor: the element the popover sits on when it is not the trigger. Any element with a CSS box works (an HTML element or an <svg> element; a shape inside an <svg> warns in development). The trigger keeps its toggle and ARIA; the anchor gets neither and is never a trigger. The ref is read on open, on each render of your component, and on each show(). To move an open popover, set anchorRef.current and call show(). A show() while the ref holds no element waits, and opens when the ref is next read and holds one. With no trigger attached, open it with show(). Omit it and the trigger is the anchor.',
|
|
24
|
+
},
|
|
19
25
|
{
|
|
20
26
|
name: 'onShow',
|
|
21
27
|
type: '() => void',
|
|
@@ -25,7 +31,7 @@ export const docs = {
|
|
|
25
31
|
name: 'onHide',
|
|
26
32
|
type: '() => void',
|
|
27
33
|
description:
|
|
28
|
-
'Callback fired when the popover is hidden.
|
|
34
|
+
'Callback fired when the popover is hidden. Focus returns on its own as the popover closes, and there is no option to turn that off; to send focus somewhere else, focus that element here.',
|
|
29
35
|
},
|
|
30
36
|
{
|
|
31
37
|
name: 'xstyle',
|
|
@@ -177,6 +183,11 @@ export const docs = {
|
|
|
177
183
|
description:
|
|
178
184
|
'Prefer the Popover component for standard trigger-content pairs; use the hook for custom trigger patterns.',
|
|
179
185
|
},
|
|
186
|
+
{
|
|
187
|
+
guidance: true,
|
|
188
|
+
description:
|
|
189
|
+
'Do not add your own focus return: the hook returns focus as the popover closes, to the opener or a stand-in, and has no option to turn that off.',
|
|
190
|
+
},
|
|
180
191
|
{
|
|
181
192
|
guidance: true,
|
|
182
193
|
description: 'Use popover as the broad canonical surface target.',
|
|
@@ -204,8 +215,11 @@ export const docsDense = {
|
|
|
204
215
|
description:
|
|
205
216
|
'Headless click-triggered popovers w/ focus trap, auto-focus, light dismiss, Escape, optional hidden close button. Every surface emits the canonical popover target. Custom compositions needing a distinct seam pass/document an owned surfaceTarget.',
|
|
206
217
|
paramDescriptions: {
|
|
218
|
+
anchorRef:
|
|
219
|
+
'ref to the element popover sits on when not the trigger; read on open, each render and each show(); position only, no trigger ARIA or handlers.',
|
|
207
220
|
onShow: 'fires when popover becomes visible.',
|
|
208
|
-
onHide:
|
|
221
|
+
onHide:
|
|
222
|
+
'fires when popover hides; focus a specific element here to send focus there (focus return then leaves it).',
|
|
209
223
|
xstyle: 'StyleX styles for content wrapper, after default surface.',
|
|
210
224
|
hasLightDismiss: 'whether outside click dismisses popover.',
|
|
211
225
|
hasEscapeDismiss:
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file usePopover.tsx
|
|
7
7
|
* @input Uses useLayer, useFocusTrap, React hooks, and Layer's outside-pan watch (outsidePanClaim)
|
|
8
|
-
* @output Exports the public usePopover hook with derived focus
|
|
8
|
+
* @output Exports the public usePopover hook with derived focus, guarded opening
|
|
9
|
+
* and an optional anchor apart from the trigger.
|
|
9
10
|
* For Popover.tsx (internal), exports usePopoverInternal and
|
|
10
11
|
* FALLBACK_CLOSE_SELECTOR.
|
|
11
12
|
* @position Higher-level layer utility; used by DatePicker, Combobox, etc.
|
|
@@ -17,11 +18,22 @@
|
|
|
17
18
|
* - /packages/core/src/Popover/index.ts
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
|
-
import React, {
|
|
21
|
+
import React, {
|
|
22
|
+
useCallback,
|
|
23
|
+
useEffect,
|
|
24
|
+
useRef,
|
|
25
|
+
useState,
|
|
26
|
+
type ReactNode,
|
|
27
|
+
} from 'react';
|
|
21
28
|
import * as stylex from '@stylexjs/stylex';
|
|
22
29
|
import {useLayerInternal, type ContextRenderProps} from '../Layer/useLayer';
|
|
23
30
|
import {watchOutsidePans} from '../Layer/outsidePanClaim';
|
|
31
|
+
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
32
|
+
import {resolvePopoverAnchor} from './popoverAnchor';
|
|
24
33
|
import {useFocusTrapInternal} from '../hooks/useFocusTrap';
|
|
34
|
+
import {useCommittedRef, useCommittedRefInto} from '../hooks/useCommittedRef';
|
|
35
|
+
import {isHTMLElement} from '../utils/nodeType';
|
|
36
|
+
import {takesFocusAsIs} from '../utils/focusReturn';
|
|
25
37
|
import {LayerDepthProvider} from '../Layer/LayerDepthContext';
|
|
26
38
|
import type {StyleXStyles} from '@stylexjs/stylex';
|
|
27
39
|
import {
|
|
@@ -111,6 +123,11 @@ const styles = stylex.create({
|
|
|
111
123
|
'@media (forced-colors: active)': 'CanvasText',
|
|
112
124
|
},
|
|
113
125
|
},
|
|
126
|
+
// An open popover whose separate anchor resolves to nothing shows no
|
|
127
|
+
// surface until it does: an unanchored layer would sit at the page origin.
|
|
128
|
+
unanchored: {
|
|
129
|
+
visibility: 'hidden',
|
|
130
|
+
},
|
|
114
131
|
// Focus trap container. Shared :focus-visible styling keeps semantic focus
|
|
115
132
|
// placement independent of pointer/keyboard indication.
|
|
116
133
|
contentWrapper: {
|
|
@@ -156,6 +173,21 @@ const styles = stylex.create({
|
|
|
156
173
|
* Options for usePopover
|
|
157
174
|
*/
|
|
158
175
|
export interface UsePopoverOptions {
|
|
176
|
+
/**
|
|
177
|
+
* External ref to use as the popover anchor. When provided, the popover
|
|
178
|
+
* sits on this element instead of the trigger. The trigger keeps its toggle
|
|
179
|
+
* and ARIA attributes; the anchor gets neither, and it is never a trigger.
|
|
180
|
+
*
|
|
181
|
+
* Any element with a CSS box works (an HTML element or an `<svg>` element;
|
|
182
|
+
* a shape inside an `<svg>` warns in development). The ref is read when the
|
|
183
|
+
* popover opens, on each render of the component that calls `usePopover`,
|
|
184
|
+
* and on each `show()`; nothing watches the page. To move an open popover,
|
|
185
|
+
* set `anchorRef.current` and call `show()`. A `show()` while the ref holds
|
|
186
|
+
* no element in the document waits, and opens when the ref is next read and
|
|
187
|
+
* holds one. An open popover whose anchor is missing shows no surface.
|
|
188
|
+
*/
|
|
189
|
+
anchorRef?: React.RefObject<Element | null>;
|
|
190
|
+
|
|
159
191
|
/**
|
|
160
192
|
* Callback fired when popover is shown.
|
|
161
193
|
* Wrap in useCallback for stable identity.
|
|
@@ -163,8 +195,8 @@ export interface UsePopoverOptions {
|
|
|
163
195
|
onShow?: () => void;
|
|
164
196
|
|
|
165
197
|
/**
|
|
166
|
-
* Callback fired when popover is hidden.
|
|
167
|
-
*
|
|
198
|
+
* Callback fired when popover is hidden. Focus returns on its own as the
|
|
199
|
+
* popover closes; focus another element here to send focus there instead.
|
|
168
200
|
* Wrap in useCallback for stable identity.
|
|
169
201
|
*/
|
|
170
202
|
onHide?: () => void;
|
|
@@ -419,6 +451,8 @@ export interface InternalPopoverOptions extends UsePopoverOptions {
|
|
|
419
451
|
* moves the popover (`useLayerInternal`'s `writesEntranceSide`).
|
|
420
452
|
*/
|
|
421
453
|
writesEntranceSide?: boolean;
|
|
454
|
+
/** Called after a scroll stop places the popover afresh (`useLayerInternal`'s `onPlacedAfresh`). */
|
|
455
|
+
onPlacedAfresh?: () => void;
|
|
422
456
|
}
|
|
423
457
|
|
|
424
458
|
/**
|
|
@@ -465,10 +499,12 @@ function usePopoverImplementation(
|
|
|
465
499
|
options: InternalPopoverOptions = {},
|
|
466
500
|
): UsePopoverReturn {
|
|
467
501
|
const {
|
|
502
|
+
anchorRef,
|
|
468
503
|
onShow,
|
|
469
504
|
onHide,
|
|
470
505
|
onCloseStart,
|
|
471
506
|
writesEntranceSide,
|
|
507
|
+
onPlacedAfresh,
|
|
472
508
|
xstyle,
|
|
473
509
|
className,
|
|
474
510
|
style,
|
|
@@ -496,6 +532,10 @@ function usePopoverImplementation(
|
|
|
496
532
|
|
|
497
533
|
// Track the trigger element for returning focus
|
|
498
534
|
const triggerElementRef = useRef<HTMLElement | null>(null);
|
|
535
|
+
// The caller's `anchorRef`, and the element bound as the anchor: `null`
|
|
536
|
+
// while the ref holds none, `undefined` while the trigger is the anchor.
|
|
537
|
+
const anchorOptionRef = useCommittedRef(anchorRef);
|
|
538
|
+
const boundAnchorRef = useRef<Element | null | undefined>(undefined);
|
|
499
539
|
|
|
500
540
|
// Track whether to skip auto-focus for the current open event
|
|
501
541
|
const skipAutoFocusRef = useRef(false);
|
|
@@ -519,16 +559,32 @@ function usePopoverImplementation(
|
|
|
519
559
|
}, [onShow]);
|
|
520
560
|
|
|
521
561
|
// Core layer for popover positioning
|
|
562
|
+
// Filled in once the content ref exists; runs when the surface hides because
|
|
563
|
+
// its anchor is missing.
|
|
564
|
+
const anchorMissingRef = useRef<(() => void) | null>(null);
|
|
565
|
+
// Focus returns as the popover starts to close, while it still holds focus:
|
|
566
|
+
// the browser restores focus only for an auto popover whose opener is still
|
|
567
|
+
// there, and then with a focus ring whatever the last input was. The trap
|
|
568
|
+
// below supplies the return; it is read through a ref because the layer
|
|
569
|
+
// exists first.
|
|
570
|
+
const returnFocusRef = useRef<() => void>(() => {});
|
|
571
|
+
const onCloseStartRef = useCommittedRef(onCloseStart);
|
|
572
|
+
const handleCloseStart = useCallback(() => {
|
|
573
|
+
returnFocusRef.current();
|
|
574
|
+
onCloseStartRef.current?.();
|
|
575
|
+
}, [onCloseStartRef]);
|
|
522
576
|
const layer = useLayerInternal({
|
|
523
577
|
mode: 'context',
|
|
524
578
|
lightDismiss: hasLightDismiss,
|
|
525
579
|
onShow: handleLayerShow,
|
|
526
580
|
onHide,
|
|
527
|
-
onCloseStart,
|
|
581
|
+
onCloseStart: handleCloseStart,
|
|
528
582
|
watchesOutsidePans:
|
|
529
583
|
hasLightDismiss && !ownsOutsidePan ? watchOutsidePans : undefined,
|
|
530
584
|
writesEntranceSide,
|
|
585
|
+
onPlacedAfresh,
|
|
531
586
|
onOpenPendingChange,
|
|
587
|
+
waitsForAnchor: anchorRef != null,
|
|
532
588
|
});
|
|
533
589
|
|
|
534
590
|
// Focus trap for the popover content. Escape stays registered while light
|
|
@@ -540,14 +596,22 @@ function usePopoverImplementation(
|
|
|
540
596
|
const getOpenerRef = useRef(getOpener);
|
|
541
597
|
getOpenerRef.current = getOpener;
|
|
542
598
|
const getRestoreTarget = useCallback(() => openerRef.current, []);
|
|
543
|
-
const {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
599
|
+
const {
|
|
600
|
+
containerRef: contentRef,
|
|
601
|
+
focusFirst,
|
|
602
|
+
returnFocus,
|
|
603
|
+
moveFocusOut,
|
|
604
|
+
} = useFocusTrapInternal<HTMLDivElement>({
|
|
605
|
+
isActive: layer.isOpen,
|
|
606
|
+
onEscape: hasEscapeDismiss || hasLightDismiss ? layer.hide : undefined,
|
|
607
|
+
getRestoreTarget,
|
|
608
|
+
getRestoreFallback,
|
|
609
|
+
restoreFocusTo,
|
|
610
|
+
getTrigger: () => triggerElementRef.current,
|
|
611
|
+
getAnchor: () => boundAnchorRef.current ?? null,
|
|
612
|
+
layerId: layer.id,
|
|
613
|
+
});
|
|
614
|
+
useCommittedRefInto(returnFocusRef, returnFocus);
|
|
551
615
|
|
|
552
616
|
const focusInitialTarget = useCallback(() => {
|
|
553
617
|
const container = contentRef.current;
|
|
@@ -602,10 +666,76 @@ function usePopoverImplementation(
|
|
|
602
666
|
// and its anchor name and anchor-clearance option, so nothing in it goes
|
|
603
667
|
// stale.
|
|
604
668
|
const layerRef = layer.ref;
|
|
669
|
+
// With `anchorRef`, the trigger keeps its role but is not the layer's
|
|
670
|
+
// anchor: the element the ref holds is.
|
|
671
|
+
const [isAnchorMissing, setIsAnchorMissing] = useState(false);
|
|
605
672
|
const triggerRef = useCallback(
|
|
606
673
|
(el: HTMLElement | null) => {
|
|
607
674
|
triggerElementRef.current = el;
|
|
608
|
-
|
|
675
|
+
if (anchorOptionRef.current == null) {
|
|
676
|
+
layerRef(el);
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
[anchorOptionRef, layerRef],
|
|
680
|
+
);
|
|
681
|
+
// Focus leaves a surface that hides because its anchor is missing: to the
|
|
682
|
+
// trigger when it takes focus, then along the focus-return chain.
|
|
683
|
+
const moveFocusOutOfHiddenSurface = () => {
|
|
684
|
+
const container = contentRef.current;
|
|
685
|
+
const active = container?.ownerDocument.activeElement ?? null;
|
|
686
|
+
if (container == null || active == null || !container.contains(active)) {
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
const trigger = triggerElementRef.current;
|
|
690
|
+
moveFocusOut([
|
|
691
|
+
isHTMLElement(trigger) && takesFocusAsIs(trigger) ? trigger : null,
|
|
692
|
+
]);
|
|
693
|
+
};
|
|
694
|
+
useCommittedRefInto(anchorMissingRef, moveFocusOutOfHiddenSurface);
|
|
695
|
+
|
|
696
|
+
const bindAnchor = useCallback(() => {
|
|
697
|
+
const option = anchorOptionRef.current;
|
|
698
|
+
if (option == null) {
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
const element = resolvePopoverAnchor(option);
|
|
702
|
+
if (element !== boundAnchorRef.current) {
|
|
703
|
+
boundAnchorRef.current = element;
|
|
704
|
+
// The layer's ref reads only the element's style and box; an element
|
|
705
|
+
// with a box can carry an anchor name.
|
|
706
|
+
layerRef(element as HTMLElement | null);
|
|
707
|
+
}
|
|
708
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect -- whether the caller's anchor exists is a DOM fact; it hides the surface until it does
|
|
709
|
+
setIsAnchorMissing(element == null);
|
|
710
|
+
if (element == null) {
|
|
711
|
+
anchorMissingRef.current?.();
|
|
712
|
+
}
|
|
713
|
+
}, [anchorOptionRef, layerRef]);
|
|
714
|
+
|
|
715
|
+
// Syncs the layer's CSS anchor with the element the caller's `anchorRef`
|
|
716
|
+
// holds. The ref changes with no event here, so this reads it after every
|
|
717
|
+
// commit.
|
|
718
|
+
useIsomorphicLayoutEffect(() => {
|
|
719
|
+
if (anchorRef != null) {
|
|
720
|
+
bindAnchor();
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
if (boundAnchorRef.current !== undefined) {
|
|
724
|
+
// The caller dropped its anchor: the trigger anchors again.
|
|
725
|
+
boundAnchorRef.current = undefined;
|
|
726
|
+
setIsAnchorMissing(false);
|
|
727
|
+
layerRef(triggerElementRef.current);
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
// React detaches a trigger's ref when the popover unmounts. The anchor is
|
|
731
|
+
// the caller's element, so this hook takes its anchor name off. Effects
|
|
732
|
+
// that run again bind the anchor again.
|
|
733
|
+
useIsomorphicLayoutEffect(
|
|
734
|
+
() => () => {
|
|
735
|
+
if (boundAnchorRef.current !== undefined) {
|
|
736
|
+
layerRef(null);
|
|
737
|
+
boundAnchorRef.current = undefined;
|
|
738
|
+
}
|
|
609
739
|
},
|
|
610
740
|
[layerRef],
|
|
611
741
|
);
|
|
@@ -650,9 +780,11 @@ function usePopoverImplementation(
|
|
|
650
780
|
// that renders on open (and the dialog-surface fallback) waits for the
|
|
651
781
|
// effect's frame.
|
|
652
782
|
focusOnShowRef.current = focusWithinEvent;
|
|
783
|
+
// The first frame is anchored: the anchor is read as the popover opens.
|
|
784
|
+
bindAnchor();
|
|
653
785
|
layer.show();
|
|
654
786
|
},
|
|
655
|
-
[layer, hasAutoFocus, contentRef],
|
|
787
|
+
[layer, hasAutoFocus, contentRef, bindAnchor],
|
|
656
788
|
);
|
|
657
789
|
|
|
658
790
|
// Toggle function. Opening delegates to show so every route inherits the
|
|
@@ -733,7 +865,10 @@ function usePopoverImplementation(
|
|
|
733
865
|
)}
|
|
734
866
|
</div>
|
|
735
867
|
</LayerDepthProvider>,
|
|
736
|
-
{
|
|
868
|
+
{
|
|
869
|
+
...props,
|
|
870
|
+
xstyle: [props?.xstyle, isAnchorMissing && styles.unanchored],
|
|
871
|
+
},
|
|
737
872
|
);
|
|
738
873
|
},
|
|
739
874
|
[
|
|
@@ -751,6 +886,7 @@ function usePopoverImplementation(
|
|
|
751
886
|
role,
|
|
752
887
|
isModal,
|
|
753
888
|
xstyle,
|
|
889
|
+
isAnchorMissing,
|
|
754
890
|
],
|
|
755
891
|
);
|
|
756
892
|
|
|
@@ -96,14 +96,14 @@ export const docs = {
|
|
|
96
96
|
name: 'startIcon',
|
|
97
97
|
type: 'ReactNode | IconType',
|
|
98
98
|
description:
|
|
99
|
-
'Icon to display at the start of the input, before any filter tokens
|
|
99
|
+
'Icon to display at the start of the input, before any filter tokens; pass a semantic icon name such as \'search\' (see `astryx docs icons`), an icon component, or an icon element. Forwarded to the internal Tokenizer.',
|
|
100
100
|
slotElements: [{__element: 'Icon', props: {icon: 'search', size: 'sm'}}],
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
name: 'statusVariant',
|
|
104
|
-
type: "'attached' | 'detached'",
|
|
104
|
+
type: "'attached' | 'detached' | 'tooltip'",
|
|
105
105
|
description:
|
|
106
|
-
'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing.',
|
|
106
|
+
'How the status message is placed relative to the input. attached overlaps directly below the input (bordered treatment); detached floats below as a separate element with spacing; tooltip reveals the message in an info-tip button.',
|
|
107
107
|
default: "'attached'",
|
|
108
108
|
},
|
|
109
109
|
{
|
|
@@ -406,13 +406,13 @@ export const docsZh = {
|
|
|
406
406
|
name: 'startIcon',
|
|
407
407
|
type: 'ReactNode | IconType',
|
|
408
408
|
description:
|
|
409
|
-
'在输入框开头(筛选 token 之前)显示的图标,转发给内部的 Tokenizer
|
|
409
|
+
'在输入框开头(筛选 token 之前)显示的图标,转发给内部的 Tokenizer;可传语义图标名称(如 \'search\',见 `astryx docs icons`)、图标组件或图标元素。',
|
|
410
410
|
},
|
|
411
411
|
{
|
|
412
412
|
name: 'statusVariant',
|
|
413
|
-
type: "'attached' | 'detached'",
|
|
413
|
+
type: "'attached' | 'detached' | 'tooltip'",
|
|
414
414
|
description:
|
|
415
|
-
'状态消息相对于输入框的放置方式。attached 直接叠加在输入框下方(带边框处理);detached
|
|
415
|
+
'状态消息相对于输入框的放置方式。attached 直接叠加在输入框下方(带边框处理);detached 作为独立元素浮于下方并留有间距;tooltip 在状态图标的提示气泡中显示消息。',
|
|
416
416
|
default: "'attached'",
|
|
417
417
|
},
|
|
418
418
|
{
|
|
@@ -561,9 +561,9 @@ export const docsDense = {
|
|
|
561
561
|
isDisabled: 'Disables entire component.',
|
|
562
562
|
status: 'Validation status object w/ type + optional message.',
|
|
563
563
|
startIcon:
|
|
564
|
-
'Icon at input start, before filter tokens. Forwarded to internal Tokenizer.',
|
|
564
|
+
'Icon at input start, before filter tokens. Forwarded to internal Tokenizer; semantic icon name string OK, e.g. \'search\' (`astryx docs icons`), or icon component/element.',
|
|
565
565
|
statusVariant:
|
|
566
|
-
'How status message is placed: attached overlaps below input; detached floats below w/ spacing.',
|
|
566
|
+
'How status message is placed: attached overlaps below input; detached floats below w/ spacing; tooltip shows on status icon.',
|
|
567
567
|
maxTokenLength: 'Max char length for filter value display in tokens.',
|
|
568
568
|
maxOperatorMenuItems:
|
|
569
569
|
'Max suggestions in string/entity value typeaheads; excludes main field search + enum menus.',
|