@astryxdesign/core 0.7.17-canary.gffd1fc0 → 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 +45 -7
- 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/Code/Code.d.ts.map +1 -1
- package/dist/Code/Code.js +5 -1
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +39 -12
- package/dist/CodeBlock/highlightRanges.d.ts.map +1 -1
- package/dist/CodeBlock/highlightRanges.js +6 -5
- 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 +76 -15
- 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 +35 -1
- package/dist/Text/TruncationTooltip.d.ts.map +1 -1
- package/dist/Text/TruncationTooltip.js +115 -0
- 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 +14 -9
- 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/Tooltip.d.ts +12 -1
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +31 -1
- 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/TopNavContext.d.ts +13 -0
- package/dist/TopNav/TopNavContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavContext.js +27 -1
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +21 -9
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +25 -17
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuFeaturedCard.js +13 -2
- package/dist/TopNav/TopNavMegaMenuItem.d.ts +9 -1
- package/dist/TopNav/TopNavMegaMenuItem.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenuItem.js +14 -2
- package/dist/TopNav/TopNavMenu.d.ts +8 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +20 -5
- 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 +215 -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 +9 -3
- package/src/Button/Button.tsx +65 -11
- 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/Code/Code.tsx +3 -0
- package/src/CodeBlock/CodeBlock.doc.mjs +7 -0
- package/src/CodeBlock/CodeBlock.tsx +60 -13
- package/src/CodeBlock/highlightRanges.ts +7 -5
- 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 +90 -14
- 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/Table/useTableTreeData.doc.mjs +2 -2
- package/src/Text/Heading.doc.mjs +2 -2
- package/src/Text/Text.doc.mjs +1 -1
- package/src/Text/TruncationTooltip.tsx +168 -1
- 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 +25 -2
- 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/Tooltip.tsx +34 -0
- 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/TopNavContext.ts +31 -1
- package/src/TopNav/TopNavHeading.tsx +22 -9
- package/src/TopNav/TopNavMegaMenu.tsx +27 -18
- package/src/TopNav/TopNavMegaMenuFeaturedCard.tsx +14 -2
- package/src/TopNav/TopNavMegaMenuItem.doc.mjs +26 -5
- package/src/TopNav/TopNavMegaMenuItem.tsx +26 -2
- package/src/TopNav/TopNavMenu.doc.mjs +19 -8
- package/src/TopNav/TopNavMenu.tsx +34 -2
- 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
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
* bounds, snap points, and a storage key
|
|
7
7
|
* @output The resize model's pure parts: size parsing and resolution against a
|
|
8
8
|
* basis, clamping and snapping, persistence, and the content-box measurement
|
|
9
|
-
* of a percentage basis
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* of a percentage basis; and the channel from useResizable to ResizeHandle,
|
|
10
|
+
* keyed by the props the hook returns
|
|
11
|
+
* @position Shared by useResizable, createResizable and ResizeHandle; no
|
|
12
|
+
* React, and no DOM work on import
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
15
|
import type {DevWarnings} from '../utils/devWarning';
|
|
16
|
+
import type {ResizableProps, ResizableRegion} from './useResizable';
|
|
15
17
|
|
|
16
18
|
export type ResizableDirection = 'horizontal' | 'vertical';
|
|
17
19
|
|
|
@@ -360,3 +362,103 @@ export function measureContentBox(
|
|
|
360
362
|
parseFloat(style.paddingRight);
|
|
361
363
|
return Number.isFinite(size) ? size : null;
|
|
362
364
|
}
|
|
365
|
+
|
|
366
|
+
// =============================================================================
|
|
367
|
+
// The hook-to-handle channel
|
|
368
|
+
// =============================================================================
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Collapse/expand for a region, keyed by the `ResizableProps` object the hook
|
|
372
|
+
* returns. A handle's Enter and double-click use them so the pane restores
|
|
373
|
+
* its previous position (APG window splitter) rather than emulating the
|
|
374
|
+
* toggle with a resize to the minimum.
|
|
375
|
+
*
|
|
376
|
+
* Kept off `ResizableProps` on purpose: that type is exported, so a new field
|
|
377
|
+
* on it — optional or underscored — is a public delta. This map and
|
|
378
|
+
* {@link getCollapseControls} are the package's own channel between the hook
|
|
379
|
+
* and the handle; neither is re-exported from the package.
|
|
380
|
+
*/
|
|
381
|
+
type CollapseControls = {collapse: () => void; expand: () => void};
|
|
382
|
+
const collapseControls = new WeakMap<ResizableProps, CollapseControls>();
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* A drag's end with its release velocity, in px per second and signed like
|
|
386
|
+
* the move's delta. Kept off the exported `ResizableProps` for the same reason
|
|
387
|
+
* as the collapse controls; {@link endResizeAt} is internal.
|
|
388
|
+
*/
|
|
389
|
+
const releaseEnds = new WeakMap<ResizableProps, (velocity: number) => void>();
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* The maximum an unbounded region reports as `aria-valuemax`: a measured
|
|
393
|
+
* extent that stands in for the missing configured maximum — the container's
|
|
394
|
+
* content box on the active axis while a percentage bound already observes
|
|
395
|
+
* it, or the window's extent along the axis — floored at the current size
|
|
396
|
+
* and, while collapsed, at the resolved minimum. The region is never clamped
|
|
397
|
+
* to it; it is what the separator announces. Kept off the exported
|
|
398
|
+
* `ResizableProps` for the same reason as the collapse controls;
|
|
399
|
+
* `getEffectiveMaxPx` is internal.
|
|
400
|
+
*/
|
|
401
|
+
const effectiveMaxima = new WeakMap<ResizableProps, number>();
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* The props behind a component's `resizable` slot. It takes useResizable's
|
|
405
|
+
* output directly, and still takes that output's `props`.
|
|
406
|
+
*/
|
|
407
|
+
export function resizablePropsOf(
|
|
408
|
+
value: ResizableRegion | ResizableProps,
|
|
409
|
+
): ResizableProps {
|
|
410
|
+
return 'props' in value ? value.props : value;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/** The reported maximum for `props`, or `undefined` for a hand-built object. */
|
|
414
|
+
export function getEffectiveMaxPx(props: ResizableProps): number | undefined {
|
|
415
|
+
return effectiveMaxima.get(props);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* The collapse/expand pair the hook registered for `props`, or `undefined`
|
|
420
|
+
* for a hand-built `ResizableProps` object (which the handle then toggles
|
|
421
|
+
* with a resize gesture). Internal to the package.
|
|
422
|
+
*/
|
|
423
|
+
export function getCollapseControls(
|
|
424
|
+
props: ResizableProps,
|
|
425
|
+
): CollapseControls | undefined {
|
|
426
|
+
return collapseControls.get(props);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Ends the drag `props` follows at a release `velocity`. A props object the
|
|
431
|
+
* hook did not return ends without one. Internal to the package.
|
|
432
|
+
*/
|
|
433
|
+
export function endResizeAt(props: ResizableProps, velocity: number): void {
|
|
434
|
+
const end = releaseEnds.get(props);
|
|
435
|
+
if (end == null) {
|
|
436
|
+
props._onResizeEnd();
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
end(velocity);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/** The hook records a region's collapse/expand pair for its props. */
|
|
443
|
+
export function registerCollapseControls(
|
|
444
|
+
props: ResizableProps,
|
|
445
|
+
controls: CollapseControls,
|
|
446
|
+
): void {
|
|
447
|
+
collapseControls.set(props, controls);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/** The hook records how a drag on its props ends at a release velocity. */
|
|
451
|
+
export function registerReleaseEnd(
|
|
452
|
+
props: ResizableProps,
|
|
453
|
+
end: (velocity: number) => void,
|
|
454
|
+
): void {
|
|
455
|
+
releaseEnds.set(props, end);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/** The hook records the measured maximum an unbounded region reports. */
|
|
459
|
+
export function registerEffectiveMaxPx(
|
|
460
|
+
props: ResizableProps,
|
|
461
|
+
maxPx: number,
|
|
462
|
+
): void {
|
|
463
|
+
effectiveMaxima.set(props, maxPx);
|
|
464
|
+
}
|
|
@@ -76,6 +76,9 @@ export interface ResizeGesturePointerEvent {
|
|
|
76
76
|
export interface ResizeGestureKeyEvent {
|
|
77
77
|
readonly key: string;
|
|
78
78
|
readonly shiftKey: boolean;
|
|
79
|
+
readonly altKey: boolean;
|
|
80
|
+
readonly ctrlKey: boolean;
|
|
81
|
+
readonly metaKey: boolean;
|
|
79
82
|
preventDefault(): void;
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -293,6 +296,17 @@ export function createResizeGesture(
|
|
|
293
296
|
if (config.isDisabled) {
|
|
294
297
|
return;
|
|
295
298
|
}
|
|
299
|
+
// Only the key map acts: a plain key, or Shift with an arrow. Other
|
|
300
|
+
// modified keys belong to the browser (history navigation, scrolling to
|
|
301
|
+
// the top or bottom) and to app shortcuts, so they pass through.
|
|
302
|
+
if (
|
|
303
|
+
event.altKey ||
|
|
304
|
+
event.ctrlKey ||
|
|
305
|
+
event.metaKey ||
|
|
306
|
+
(event.shiftKey && !event.key.startsWith('Arrow'))
|
|
307
|
+
) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
296
310
|
const state = model.state();
|
|
297
311
|
const isHorizontal = config.direction === 'horizontal';
|
|
298
312
|
const sign = config.isReversed ? -1 : 1;
|
|
@@ -38,6 +38,9 @@ import {
|
|
|
38
38
|
} from './resizablePane';
|
|
39
39
|
import {
|
|
40
40
|
DEFAULT_COLLAPSED_SIZE,
|
|
41
|
+
registerCollapseControls,
|
|
42
|
+
registerEffectiveMaxPx,
|
|
43
|
+
registerReleaseEnd,
|
|
41
44
|
type ResizableDirection,
|
|
42
45
|
} from './resizableModel';
|
|
43
46
|
|
|
@@ -52,6 +55,14 @@ export type ResizableMinConfig = {minSize?: ResizableSize};
|
|
|
52
55
|
export type ResizableMaxConfig = {maxSize?: ResizableSize};
|
|
53
56
|
|
|
54
57
|
export type {ResizableDirection} from './resizableModel';
|
|
58
|
+
// The handle's channel lives in the model, so a handle alone does not load
|
|
59
|
+
// the hook and its controller.
|
|
60
|
+
export {
|
|
61
|
+
endResizeAt,
|
|
62
|
+
getCollapseControls,
|
|
63
|
+
getEffectiveMaxPx,
|
|
64
|
+
resizablePropsOf,
|
|
65
|
+
} from './resizableModel';
|
|
55
66
|
|
|
56
67
|
export interface ResizableRegionSizing {
|
|
57
68
|
/**
|
|
@@ -282,15 +293,15 @@ function useSingleResizable(config: UseResizableSingleConfig): ResizableRegion {
|
|
|
282
293
|
_direction: config.direction ?? 'horizontal',
|
|
283
294
|
_isResizableProps: true,
|
|
284
295
|
};
|
|
285
|
-
|
|
286
|
-
|
|
296
|
+
registerCollapseControls(props, {collapse, expand});
|
|
297
|
+
registerReleaseEnd(props, onResizeRelease);
|
|
287
298
|
// The LayoutPanel that takes these props hands its pane to the region, and
|
|
288
299
|
// the ResizeHandle that takes them says when a pointer drags it.
|
|
289
300
|
registerPropsRegion(props, regionSlot);
|
|
290
301
|
// Without a configured maximum a measured extent stands in, only once it
|
|
291
302
|
// is a real measurement (an observed container, or the window).
|
|
292
303
|
if (snapshot.effectiveMaxPx != null) {
|
|
293
|
-
|
|
304
|
+
registerEffectiveMaxPx(props, snapshot.effectiveMaxPx);
|
|
294
305
|
}
|
|
295
306
|
|
|
296
307
|
return {size, isCollapsed, collapse, expand, resize, props};
|
|
@@ -341,83 +352,11 @@ function useMultiResizable(
|
|
|
341
352
|
// Public API
|
|
342
353
|
// =============================================================================
|
|
343
354
|
|
|
344
|
-
/**
|
|
345
|
-
* Collapse/expand for a region, keyed by the `ResizableProps` object the hook
|
|
346
|
-
* returns. A handle's Enter and double-click use them so the pane restores
|
|
347
|
-
* its previous position (APG window splitter) rather than emulating the
|
|
348
|
-
* toggle with a resize to the minimum.
|
|
349
|
-
*
|
|
350
|
-
* Kept off `ResizableProps` on purpose: that type is exported, so a new field
|
|
351
|
-
* on it — optional or underscored — is a public delta. This module-private
|
|
352
|
-
* map and {@link getCollapseControls} are the package's own channel between
|
|
353
|
-
* the hook and the handle; neither is re-exported.
|
|
354
|
-
*/
|
|
355
|
-
type CollapseControls = {collapse: () => void; expand: () => void};
|
|
356
|
-
const collapseControls = new WeakMap<ResizableProps, CollapseControls>();
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* A drag's end with its release velocity, in px per second and signed like
|
|
360
|
-
* the move's delta. Kept off the exported `ResizableProps` for the same reason
|
|
361
|
-
* as the collapse controls; {@link endResizeAt} is internal.
|
|
362
|
-
*/
|
|
363
|
-
const releaseEnds = new WeakMap<ResizableProps, (velocity: number) => void>();
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* The maximum an unbounded region reports as `aria-valuemax`: a measured
|
|
367
|
-
* extent that stands in for the missing configured maximum — the container's
|
|
368
|
-
* content box on the active axis while a percentage bound already observes
|
|
369
|
-
* it, or the window's extent along the axis — floored at the current size
|
|
370
|
-
* and, while collapsed, at the resolved minimum. The region is never clamped
|
|
371
|
-
* to it; it is what the separator announces. Kept off the exported
|
|
372
|
-
* `ResizableProps` for the same reason as the collapse controls;
|
|
373
|
-
* `getEffectiveMaxPx` is internal.
|
|
374
|
-
*/
|
|
375
|
-
const effectiveMaxima = new WeakMap<ResizableProps, number>();
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* The props behind a component's `resizable` slot. It takes useResizable's
|
|
379
|
-
* output directly, and still takes that output's `props`.
|
|
380
|
-
*/
|
|
381
|
-
export function resizablePropsOf(
|
|
382
|
-
value: ResizableRegion | ResizableProps,
|
|
383
|
-
): ResizableProps {
|
|
384
|
-
return 'props' in value ? value.props : value;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
355
|
/** Whether a `resizable` value is useResizable's output for one region. */
|
|
388
356
|
export function isResizableRegion(value: unknown): value is ResizableRegion {
|
|
389
357
|
return typeof value === 'object' && value !== null && 'props' in value;
|
|
390
358
|
}
|
|
391
359
|
|
|
392
|
-
/** The reported maximum for `props`, or `undefined` for a hand-built object. */
|
|
393
|
-
export function getEffectiveMaxPx(props: ResizableProps): number | undefined {
|
|
394
|
-
return effectiveMaxima.get(props);
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* The collapse/expand pair the hook registered for `props`, or `undefined`
|
|
399
|
-
* for a hand-built `ResizableProps` object (which the handle then toggles
|
|
400
|
-
* with a resize gesture). Internal to the package.
|
|
401
|
-
*/
|
|
402
|
-
export function getCollapseControls(
|
|
403
|
-
props: ResizableProps,
|
|
404
|
-
): CollapseControls | undefined {
|
|
405
|
-
return collapseControls.get(props);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Ends the drag `props` follows at a release `velocity`. A props object the
|
|
410
|
-
* hook did not return ends without one. Internal to the package.
|
|
411
|
-
*/
|
|
412
|
-
export function endResizeAt(props: ResizableProps, velocity: number): void {
|
|
413
|
-
const end = releaseEnds.get(props);
|
|
414
|
-
if (end == null) {
|
|
415
|
-
props._onResizeEnd();
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
end(velocity);
|
|
419
|
-
}
|
|
420
|
-
|
|
421
360
|
/** Removed keys must fail even when a variable bypasses excess-property checks. */
|
|
422
361
|
type RejectRemovedPixelBounds<Config> = Config extends unknown
|
|
423
362
|
? Config & {minSizePx?: never; maxSizePx?: never}
|
|
@@ -169,6 +169,7 @@ const sizeStyles = stylex.create({
|
|
|
169
169
|
borderRadius: CONCENTRIC_RADIUS,
|
|
170
170
|
paddingInline: spacingVars['--spacing-2'],
|
|
171
171
|
fontSize: typeScaleVars['--text-supporting-size'],
|
|
172
|
+
lineHeight: typeScaleVars['--text-supporting-leading'],
|
|
172
173
|
},
|
|
173
174
|
md: {
|
|
174
175
|
height: `calc(${sizeVars['--size-element-md']} - 4px)`,
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* the control is enabled
|
|
9
9
|
* @output useSegmentedTouchTracking (a press of any pointer, landing to
|
|
10
10
|
* lift, and its ClickWait), and segmentTargetAt, measureSegments,
|
|
11
|
-
* measureLiftArea and
|
|
11
|
+
* measureLiftArea, liftTargetAt and createSegmentLiftTarget, the segment a
|
|
12
|
+
* pointer counts for
|
|
12
13
|
* @position Internal to SegmentedControl; drives useSegmentedSelectionMotion.ts
|
|
13
14
|
*
|
|
14
15
|
* SYNC: When modified, update:
|
|
@@ -22,8 +23,8 @@ import {useGestureRecognizer} from '../gestures/useGestureRecognizer';
|
|
|
22
23
|
import {usePressTracker} from '../gestures/usePressTracker';
|
|
23
24
|
import {
|
|
24
25
|
createActionGroupTracker,
|
|
25
|
-
type ActionGroupTarget,
|
|
26
26
|
type ActionGroupTracker,
|
|
27
|
+
type ActionGroupTrackerOptions,
|
|
27
28
|
} from '../hooks/actionGroupTracker';
|
|
28
29
|
import {lockSelection} from '../gestures/selectionLock';
|
|
29
30
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
@@ -61,6 +62,11 @@ export interface SegmentSpan {
|
|
|
61
62
|
readonly element: HTMLElement;
|
|
62
63
|
readonly left: number;
|
|
63
64
|
readonly right: number;
|
|
65
|
+
/** The box's top and bottom, when measured. */
|
|
66
|
+
readonly top?: number;
|
|
67
|
+
readonly bottom?: number;
|
|
68
|
+
/** The box grown by the segment's touch hit band, when measured. */
|
|
69
|
+
readonly band?: ControlBounds;
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
/** Every segment of `track`, disabled ones included, measured once. */
|
|
@@ -69,7 +75,19 @@ export function measureSegments(track: HTMLElement): SegmentSpan[] {
|
|
|
69
75
|
track.querySelectorAll<HTMLElement>(SEGMENT_SELECTOR),
|
|
70
76
|
element => {
|
|
71
77
|
const rect = element.getBoundingClientRect();
|
|
72
|
-
return {
|
|
78
|
+
return {
|
|
79
|
+
element,
|
|
80
|
+
left: rect.left,
|
|
81
|
+
right: rect.right,
|
|
82
|
+
top: rect.top,
|
|
83
|
+
bottom: rect.bottom,
|
|
84
|
+
band: {
|
|
85
|
+
left: rect.left - hitInset(element, 'left'),
|
|
86
|
+
top: rect.top - hitInset(element, 'top'),
|
|
87
|
+
right: rect.right + hitInset(element, 'right'),
|
|
88
|
+
bottom: rect.bottom + hitInset(element, 'bottom'),
|
|
89
|
+
},
|
|
90
|
+
};
|
|
73
91
|
},
|
|
74
92
|
);
|
|
75
93
|
}
|
|
@@ -113,24 +131,68 @@ export function segmentTargetAt(
|
|
|
113
131
|
|
|
114
132
|
/**
|
|
115
133
|
* The segment a lift at viewport (`x`, `y`) commits: inside any box of the
|
|
116
|
-
* control's lift `area`, the
|
|
117
|
-
*
|
|
118
|
-
*
|
|
134
|
+
* control's lift `area`, the segment whose own box, else whose touch band,
|
|
135
|
+
* holds the `finger`, else the one `segmentTargetAt` counts (`x`, `y`) for;
|
|
136
|
+
* outside them, none. The
|
|
137
|
+
* tracker passes (`x`, `y`) on the control's center line, so a press never
|
|
138
|
+
* lands outside and a drift off the control keeps its horizontal position.
|
|
139
|
+
* `finger` is where the pointer really is (it defaults to (`x`, `y`)): the
|
|
140
|
+
* own-box test on it keeps a tap on its segment when a caller's style wraps
|
|
141
|
+
* the segments onto more than one row.
|
|
119
142
|
*/
|
|
120
143
|
export function liftTargetAt(
|
|
121
144
|
x: number,
|
|
122
145
|
y: number,
|
|
123
146
|
area: ReadonlyArray<ControlBounds>,
|
|
124
147
|
segments: ReadonlyArray<SegmentSpan>,
|
|
148
|
+
finger: {readonly x: number; readonly y: number} = {x, y},
|
|
125
149
|
): HTMLElement | null {
|
|
126
150
|
const isInside = area.some(
|
|
127
151
|
box => x >= box.left && x <= box.right && y >= box.top && y <= box.bottom,
|
|
128
152
|
);
|
|
129
|
-
|
|
153
|
+
if (!isInside) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
const holds = (box: ControlBounds) =>
|
|
157
|
+
finger.x >= box.left &&
|
|
158
|
+
finger.x <= box.right &&
|
|
159
|
+
finger.y >= box.top &&
|
|
160
|
+
finger.y <= box.bottom;
|
|
161
|
+
// A segment's own box first, then its touch band, so a band never takes a
|
|
162
|
+
// press that lands on a neighbor.
|
|
163
|
+
const under =
|
|
164
|
+
segments.find(
|
|
165
|
+
({left, right, top, bottom}) =>
|
|
166
|
+
top != null && bottom != null && holds({left, right, top, bottom}),
|
|
167
|
+
) ?? segments.find(({band}) => band != null && holds(band));
|
|
168
|
+
if (under != null) {
|
|
169
|
+
return isDisabled(under.element) ? null : under.element;
|
|
170
|
+
}
|
|
171
|
+
return segmentTargetAt(x, segments);
|
|
130
172
|
}
|
|
131
173
|
|
|
132
174
|
const NO_AREA: ReadonlyArray<ControlBounds> = [];
|
|
133
175
|
|
|
176
|
+
/**
|
|
177
|
+
* The tracker options that pick the segment a lift commits: `onMove` keeps
|
|
178
|
+
* the pointer's own position, which the tracker reports before it moves the
|
|
179
|
+
* point onto the control's center line, and `resolveTarget` runs
|
|
180
|
+
* `liftTargetAt` with both.
|
|
181
|
+
*/
|
|
182
|
+
export function createSegmentLiftTarget(
|
|
183
|
+
area: () => ReadonlyArray<ControlBounds>,
|
|
184
|
+
segments: () => ReadonlyArray<SegmentSpan>,
|
|
185
|
+
): Pick<ActionGroupTrackerOptions, 'onMove' | 'resolveTarget'> {
|
|
186
|
+
let finger: {x: number; y: number} | null = null;
|
|
187
|
+
return {
|
|
188
|
+
onMove: (x, y) => {
|
|
189
|
+
finger = {x, y};
|
|
190
|
+
},
|
|
191
|
+
resolveTarget: (x, y) =>
|
|
192
|
+
liftTargetAt(x, y, area(), segments(), finger ?? {x, y}),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
134
196
|
/** A measured hit inset on `element`, px (0 when none is written). */
|
|
135
197
|
function hitInset(element: HTMLElement, side: keyof HitInsets): number {
|
|
136
198
|
const value = Number.parseFloat(
|
|
@@ -199,6 +261,12 @@ export function useSegmentedTouchTracking(
|
|
|
199
261
|
/** The lift area as the finger found it. */
|
|
200
262
|
const areaRef = useRef<ReadonlyArray<ControlBounds>>(NO_AREA);
|
|
201
263
|
const trackerRef = useRef<ActionGroupTracker | null>(null);
|
|
264
|
+
const [liftTarget] = useState(() =>
|
|
265
|
+
createSegmentLiftTarget(
|
|
266
|
+
() => areaRef.current,
|
|
267
|
+
() => segmentsRef.current,
|
|
268
|
+
),
|
|
269
|
+
);
|
|
202
270
|
const tracker = (trackerRef.current ??= createActionGroupTracker(() => ({
|
|
203
271
|
roots: () => [trackRef.current],
|
|
204
272
|
itemSelector: SEGMENT_SELECTOR,
|
|
@@ -219,11 +287,7 @@ export function useSegmentedTouchTracking(
|
|
|
219
287
|
}
|
|
220
288
|
motion.cancel();
|
|
221
289
|
},
|
|
222
|
-
|
|
223
|
-
x: number,
|
|
224
|
-
y: number,
|
|
225
|
-
_targets: ReadonlyArray<ActionGroupTarget>,
|
|
226
|
-
) => liftTargetAt(x, y, areaRef.current, segmentsRef.current),
|
|
290
|
+
...liftTarget,
|
|
227
291
|
onActivated: (item, cancelled) => {
|
|
228
292
|
const track = trackRef.current;
|
|
229
293
|
const value = item.dataset.value;
|
|
@@ -189,19 +189,27 @@ export const docs = {
|
|
|
189
189
|
},
|
|
190
190
|
{
|
|
191
191
|
name: 'value',
|
|
192
|
-
type: 'string',
|
|
193
|
-
description:
|
|
192
|
+
type: 'string | null',
|
|
193
|
+
description:
|
|
194
|
+
'Currently selected value: a string, or undefined to show the placeholder; with hasClear, value is required and null means no selection. Without hasClear the type is string; with hasClear it is string | null.',
|
|
194
195
|
},
|
|
195
196
|
{
|
|
196
197
|
name: 'onChange',
|
|
197
|
-
type: '(value: string) => void',
|
|
198
|
-
description:
|
|
198
|
+
type: '(value: string | null) => void',
|
|
199
|
+
description:
|
|
200
|
+
'Called with the selected option value; it receives null only when hasClear is set and the user clears the selection. Without hasClear the type is (value: string) => void; with hasClear it is (value: string | null) => void, so a useState<string | null> setter fits.',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'changeAction',
|
|
204
|
+
type: '(value: string | null) => void | Promise<void>',
|
|
205
|
+
description:
|
|
206
|
+
'Async action on change. Fires after onChange; the selector shows the new value and a busy state while it runs. Receives null on clear only with hasClear.',
|
|
199
207
|
},
|
|
200
208
|
{
|
|
201
209
|
name: 'hasClear',
|
|
202
210
|
type: 'boolean',
|
|
203
211
|
description:
|
|
204
|
-
'Shows a clear (×) button when a value is selected
|
|
212
|
+
'Shows a clear (×) button when a value is selected; with it, value becomes required and accepts null, and onChange receives null when the user clears the selection.',
|
|
205
213
|
default: 'false',
|
|
206
214
|
},
|
|
207
215
|
{
|
|
@@ -286,6 +294,12 @@ export const docs = {
|
|
|
286
294
|
type: 'string',
|
|
287
295
|
description: 'Helper text displayed below the label.',
|
|
288
296
|
},
|
|
297
|
+
{
|
|
298
|
+
name: 'labelTooltip',
|
|
299
|
+
type: 'string',
|
|
300
|
+
description:
|
|
301
|
+
'Tooltip text displayed in an info icon at the end of the label.',
|
|
302
|
+
},
|
|
289
303
|
{
|
|
290
304
|
name: 'isOptional',
|
|
291
305
|
type: 'boolean',
|
|
@@ -337,6 +351,19 @@ export const docs = {
|
|
|
337
351
|
'How the option list is presented. adaptive uses a bottom sheet on compact touch screens and an anchored popover otherwise.',
|
|
338
352
|
default: "'popover'",
|
|
339
353
|
},
|
|
354
|
+
{
|
|
355
|
+
name: 'placement',
|
|
356
|
+
type: "'above' | 'below' | 'start' | 'end'",
|
|
357
|
+
description:
|
|
358
|
+
'Position of the popup relative to the trigger. Omit it to place the selected option over the trigger, kept inside the viewport; with hasSearch, the popup then opens below the trigger. Set it for explicit layer positioning, such as placement="above" for a toolbar fixed to the bottom.',
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
name: 'isDefaultOpen',
|
|
362
|
+
type: 'boolean',
|
|
363
|
+
description:
|
|
364
|
+
'Whether the dropdown starts open on mount. Useful for showcases and previews.',
|
|
365
|
+
default: 'false',
|
|
366
|
+
},
|
|
340
367
|
{
|
|
341
368
|
name: 'width',
|
|
342
369
|
type: 'SizeValue',
|
|
@@ -345,8 +372,8 @@ export const docs = {
|
|
|
345
372
|
},
|
|
346
373
|
{
|
|
347
374
|
name: 'startIcon',
|
|
348
|
-
type: '
|
|
349
|
-
description: 'Icon displayed at the start of the selector trigger.',
|
|
375
|
+
type: 'ReactNode | IconType',
|
|
376
|
+
description: 'Icon displayed at the start of the selector trigger; pass a semantic icon name such as \'search\' (see `astryx docs icons`), an icon component, or an icon element.',
|
|
350
377
|
},
|
|
351
378
|
{
|
|
352
379
|
name: 'isLoading',
|
|
@@ -32,6 +32,7 @@ import React, {
|
|
|
32
32
|
useTransition,
|
|
33
33
|
type ReactNode,
|
|
34
34
|
} from 'react';
|
|
35
|
+
import {useCommittedRefInto} from '../hooks/useCommittedRef';
|
|
35
36
|
import * as stylex from '@stylexjs/stylex';
|
|
36
37
|
import {inputDisabledFocusStyles} from '../Field/inputDisabledFocus';
|
|
37
38
|
import {useTooltip} from '../Tooltip';
|
|
@@ -77,13 +78,16 @@ import {useCombobox, useSelectedItemOverlayMargin} from './hooks';
|
|
|
77
78
|
import {useMenuPress} from '../hooks/useMenuPress';
|
|
78
79
|
import {useMenuOverflow} from '../DropdownMenu/useMenuOverflow';
|
|
79
80
|
import {useTypeahead} from '../hooks/useTypeahead';
|
|
80
|
-
import {
|
|
81
|
+
import {
|
|
82
|
+
resolveSearchTriggerRequired,
|
|
83
|
+
useResolvedOptionality,
|
|
84
|
+
} from '../hooks/useResolvedRequired';
|
|
81
85
|
import {SelectorOption} from './SelectorOption';
|
|
82
86
|
import {SelectorRowLayoutContext} from './SelectorRowLayoutContext';
|
|
83
87
|
import {getInputARIA, isImeKeyEvent, mergeProps} from '../utils';
|
|
84
88
|
import {joinAriaIDs} from '../utils/inputAria';
|
|
85
89
|
import {withholdCallerHandlers} from '../utils/disabledInteraction';
|
|
86
|
-
import {warnOnce} from '../utils/devWarning';
|
|
90
|
+
import {devPropError, warnOnce} from '../utils/devWarning';
|
|
87
91
|
import {useSize} from '../SizeContext/SizeContext';
|
|
88
92
|
import {
|
|
89
93
|
useFieldInputStyling,
|
|
@@ -117,6 +121,10 @@ import {
|
|
|
117
121
|
} from '../i18n/useComponentTranslator';
|
|
118
122
|
import english from '../i18n/generated-english/Selector/Selector.generated';
|
|
119
123
|
|
|
124
|
+
// Bundlers replace this value at build time. The declaration lets a product
|
|
125
|
+
// without Node's types type-check this file.
|
|
126
|
+
declare const process: {readonly env: {readonly NODE_ENV?: string}};
|
|
127
|
+
|
|
120
128
|
registerEnglishFallback(english);
|
|
121
129
|
|
|
122
130
|
/**
|
|
@@ -444,9 +452,14 @@ const styles = stylex.create({
|
|
|
444
452
|
transitionProperty: 'none',
|
|
445
453
|
},
|
|
446
454
|
|
|
447
|
-
//
|
|
455
|
+
// Clamp the trigger width with the viewport cap. A CSS minimum otherwise
|
|
456
|
+
// wins over the layer's maximum.
|
|
448
457
|
popover: {
|
|
449
|
-
minWidth:
|
|
458
|
+
minWidth: stylex.firstThatWorks(
|
|
459
|
+
`min(anchor-size(width), ${layerViewportInset.maxInlineSize})`,
|
|
460
|
+
`min(anchor-size(width), ${layerViewportInset.maxInlineSizeFallback})`,
|
|
461
|
+
'anchor-size(width)',
|
|
462
|
+
),
|
|
450
463
|
},
|
|
451
464
|
|
|
452
465
|
// Empty state
|
|
@@ -456,6 +469,7 @@ const styles = stylex.create({
|
|
|
456
469
|
color: colorVars['--color-text-secondary'],
|
|
457
470
|
fontFamily: typographyVars['--font-family-body'],
|
|
458
471
|
fontSize: typeScaleVars['--text-label-size'],
|
|
472
|
+
lineHeight: typeScaleVars['--text-label-leading'],
|
|
459
473
|
},
|
|
460
474
|
|
|
461
475
|
// Section heading. Plain secondary text, no rules — the same treatment
|
|
@@ -490,6 +504,7 @@ const styles = stylex.create({
|
|
|
490
504
|
borderRadius: radiusVars['--radius-element'],
|
|
491
505
|
fontFamily: typographyVars['--font-family-body'],
|
|
492
506
|
fontSize: typeScaleVars['--text-label-size'],
|
|
507
|
+
lineHeight: typeScaleVars['--text-label-leading'],
|
|
493
508
|
color: colorVars['--color-text-primary'],
|
|
494
509
|
backgroundColor: 'transparent',
|
|
495
510
|
borderWidth: 0,
|
|
@@ -1227,6 +1242,13 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1227
1242
|
id,
|
|
1228
1243
|
...restProps
|
|
1229
1244
|
} = props as SelectorPropsClearable<T>;
|
|
1245
|
+
if (process.env.NODE_ENV !== 'production' && !Array.isArray(options)) {
|
|
1246
|
+
throw devPropError(
|
|
1247
|
+
'Selector',
|
|
1248
|
+
'options',
|
|
1249
|
+
"must be an array of options, for example options={[{value: 'nyc', label: 'New York'}]}. Selector does not read <option> children.",
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1230
1252
|
const inputGroup = useInputGroup();
|
|
1231
1253
|
const inputGroupState = use(InputGroupInternalContext);
|
|
1232
1254
|
const isDisabled = isDisabledProp || inputGroupState.isDisabled;
|
|
@@ -1426,6 +1448,8 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1426
1448
|
// Explicit placement opts out of the selector-specific overlay behavior and
|
|
1427
1449
|
// uses the standard layer positioning API instead.
|
|
1428
1450
|
const shouldOverlaySelectedItem = placement == null && !hasSearch;
|
|
1451
|
+
// Written below, once the overlay margin hook has run.
|
|
1452
|
+
const remeasureOverlayRef = useRef<(() => void) | null>(null);
|
|
1429
1453
|
const surface = useSelectorPresentation({
|
|
1430
1454
|
presentation,
|
|
1431
1455
|
onHide: handleLayerHide,
|
|
@@ -1448,6 +1472,11 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1448
1472
|
// The overlay margin moves the list after the show, so the overlay
|
|
1449
1473
|
// writes the entrance's side once it has moved.
|
|
1450
1474
|
writesEntranceSide: shouldOverlaySelectedItem,
|
|
1475
|
+
// A scroll stop can flip the list, and the overlay margin depends on
|
|
1476
|
+
// the side.
|
|
1477
|
+
onPlacedAfresh: shouldOverlaySelectedItem
|
|
1478
|
+
? () => remeasureOverlayRef.current?.()
|
|
1479
|
+
: undefined,
|
|
1451
1480
|
},
|
|
1452
1481
|
});
|
|
1453
1482
|
const {popover} = surface;
|
|
@@ -1530,14 +1559,18 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
1530
1559
|
surface.isOpen && !isLoading && filteredItems.length === 0;
|
|
1531
1560
|
useAnnounceRenderedText(emptyStateRef, isPanelEmpty, searchQuery);
|
|
1532
1561
|
|
|
1533
|
-
const {
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1562
|
+
const {
|
|
1563
|
+
marginBlockStart: rawMarginBlockStart,
|
|
1564
|
+
isPositioned: rawIsPositioned,
|
|
1565
|
+
remeasure: remeasureOverlay,
|
|
1566
|
+
} = useSelectedItemOverlayMargin({
|
|
1567
|
+
isOpen: popover.isOpen && shouldOverlaySelectedItem,
|
|
1568
|
+
selectedItemIndex,
|
|
1569
|
+
listboxId,
|
|
1570
|
+
listboxRef,
|
|
1571
|
+
anchorRef,
|
|
1572
|
+
});
|
|
1573
|
+
useCommittedRefInto(remeasureOverlayRef, remeasureOverlay);
|
|
1541
1574
|
|
|
1542
1575
|
const isPositioned = shouldOverlaySelectedItem ? rawIsPositioned : true;
|
|
1543
1576
|
const popoverPlacement = placement ?? 'below';
|
|
@@ -2144,17 +2177,15 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
2144
2177
|
callerAriaLabel != null && ariaLabelledByProp == null
|
|
2145
2178
|
? triggerId
|
|
2146
2179
|
: (triggerLabelledBy ?? (inputGroup ? undefined : fieldLabelId));
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
const hasRequiredDescription =
|
|
2157
|
-
isSearchTrigger && isEffectivelyRequired && !isLabelRequiredInName;
|
|
2180
|
+
const {ariaRequired, hasRequiredDescription} = resolveSearchTriggerRequired({
|
|
2181
|
+
hasSearch,
|
|
2182
|
+
isReadOnly: isEffectivelyReadOnly,
|
|
2183
|
+
isRequired: isEffectivelyRequired,
|
|
2184
|
+
showsRequiredMarker: isLabelRequiredMarkerShown,
|
|
2185
|
+
isInInputGroup: inputGroup != null,
|
|
2186
|
+
ariaLabel: callerAriaLabel,
|
|
2187
|
+
ariaLabelledBy: ariaLabelledByProp,
|
|
2188
|
+
});
|
|
2158
2189
|
const isValueInTriggerName =
|
|
2159
2190
|
hasSearch &&
|
|
2160
2191
|
!isEffectivelyReadOnly &&
|
|
@@ -2272,8 +2303,7 @@ export function Selector<T extends SelectorOptionType>(
|
|
|
2272
2303
|
'aria-labelledby': isValueInTriggerName
|
|
2273
2304
|
? joinAriaIDs(triggerNameLabelId, valueTextId)
|
|
2274
2305
|
: triggerLabelledBy,
|
|
2275
|
-
'aria-required':
|
|
2276
|
-
isEffectivelyRequired && !isSearchTrigger ? 'true' : undefined,
|
|
2306
|
+
'aria-required': ariaRequired,
|
|
2277
2307
|
'aria-invalid': status?.type === 'error' ? 'true' : undefined,
|
|
2278
2308
|
'aria-busy': isBusy || undefined,
|
|
2279
2309
|
// The built-in keyboard model runs first; a caller handler sees the keys
|