@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
package/src/hooks/useOverflow.ts
CHANGED
|
@@ -22,6 +22,11 @@ import {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';
|
|
|
22
22
|
import {useCommittedRef} from './useCommittedRef';
|
|
23
23
|
import {observeResize} from '../utils/sharedResizeObserver';
|
|
24
24
|
import {computeOverflow, countRows} from './computeOverflow';
|
|
25
|
+
import {
|
|
26
|
+
layoutSize,
|
|
27
|
+
screenScale,
|
|
28
|
+
type ScreenScaleTolerance,
|
|
29
|
+
} from '../utils/hitArea';
|
|
25
30
|
import {useDevWarning} from './useDevWarning';
|
|
26
31
|
|
|
27
32
|
export interface UseOverflowOptions {
|
|
@@ -88,6 +93,117 @@ export interface UseOverflowReturn {
|
|
|
88
93
|
rowHeight: number;
|
|
89
94
|
}
|
|
90
95
|
|
|
96
|
+
/**
|
|
97
|
+
* A single-row list's inline bounds, from the measure copy. `collapsed` is
|
|
98
|
+
* the list folded as far as it can fold (the minimum items and the
|
|
99
|
+
* indicator), rounded up to a whole pixel. `rendered` is every item
|
|
100
|
+
* unfolded, exact. `chrome` is the list's own inline padding and border. All
|
|
101
|
+
* are 0 until the list measures.
|
|
102
|
+
*/
|
|
103
|
+
export interface OverflowInlineBounds {
|
|
104
|
+
collapsed: number;
|
|
105
|
+
rendered: number;
|
|
106
|
+
/** The list's own inline padding and border. */
|
|
107
|
+
chrome: number;
|
|
108
|
+
/**
|
|
109
|
+
* Whether the list's parent lays it out in a flex row, where its width
|
|
110
|
+
* would otherwise follow its shown (folded) content.
|
|
111
|
+
*/
|
|
112
|
+
inFlexRow: boolean;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const NO_INLINE_BOUNDS: OverflowInlineBounds = {
|
|
116
|
+
collapsed: 0,
|
|
117
|
+
rendered: 0,
|
|
118
|
+
chrome: 0,
|
|
119
|
+
inFlexRow: false,
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** Whether `parent` lays its children out in a flex row. */
|
|
123
|
+
function isFlexRow(parent: Element | null): boolean {
|
|
124
|
+
if (parent == null) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const style = getComputedStyle(parent);
|
|
128
|
+
return (
|
|
129
|
+
(style.display === 'flex' || style.display === 'inline-flex') &&
|
|
130
|
+
style.flexDirection.startsWith('row')
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* An element's sub-pixel border-box width in layout pixels; its rounded width
|
|
136
|
+
* without layout. Under a scale, the width comes from the computed style: a
|
|
137
|
+
* scaled rect is rounded on screen, and divided by the scale it can be a
|
|
138
|
+
* layout unit short, which shrinks an item below its text. The computed
|
|
139
|
+
* width keeps six significant digits, so half of its last digit is added
|
|
140
|
+
* back: the sum of the widths is then never short of the items.
|
|
141
|
+
*/
|
|
142
|
+
function exactWidth(element: HTMLElement, scale: number): number {
|
|
143
|
+
if (scale !== 1) {
|
|
144
|
+
const layout = layoutSize(element)?.width ?? 0;
|
|
145
|
+
if (layout > 0) {
|
|
146
|
+
return layout + 0.5 * 10 ** (Math.floor(Math.log10(layout)) - 5);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
const width = element.getBoundingClientRect().width;
|
|
150
|
+
return width > 0 ? width / scale : element.offsetWidth;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The list counts any scale beyond the computed width's rounding (six
|
|
155
|
+
* significant digits), however close to 1: the last frames of a layer
|
|
156
|
+
* scaling in still shorten its measured items.
|
|
157
|
+
*/
|
|
158
|
+
const INLINE_SCALE_TOLERANCE: ScreenScaleTolerance = {pixels: 0, ratio: 6e-6};
|
|
159
|
+
|
|
160
|
+
/** The bounds of a single-row set, from sub-pixel widths. */
|
|
161
|
+
function inlineBoundsOf(
|
|
162
|
+
widths: ReadonlyArray<number>,
|
|
163
|
+
indicatorWidth: number,
|
|
164
|
+
gap: number,
|
|
165
|
+
minVisibleItems: number,
|
|
166
|
+
collapseFrom: 'start' | 'end',
|
|
167
|
+
maxVisibleItems: number | undefined,
|
|
168
|
+
chrome: number,
|
|
169
|
+
inFlexRow: boolean,
|
|
170
|
+
): OverflowInlineBounds {
|
|
171
|
+
const span = (set: ReadonlyArray<number>) =>
|
|
172
|
+
set.reduce((sum, width) => sum + width, 0) +
|
|
173
|
+
gap * Math.max(0, set.length - 1);
|
|
174
|
+
const kept = Math.min(minVisibleItems, widths.length);
|
|
175
|
+
const keptWidths =
|
|
176
|
+
collapseFrom === 'end'
|
|
177
|
+
? widths.slice(0, kept)
|
|
178
|
+
: widths.slice(widths.length - kept);
|
|
179
|
+
const folds = kept < widths.length;
|
|
180
|
+
const collapsed = folds
|
|
181
|
+
? span(keptWidths) + (keptWidths.length > 0 ? gap : 0) + indicatorWidth
|
|
182
|
+
: span(widths);
|
|
183
|
+
// The most the list shows: the items the cap allows (the floor wins over a
|
|
184
|
+
// smaller cap), and the indicator when the cap leaves items out.
|
|
185
|
+
const allowed = Math.max(
|
|
186
|
+
kept,
|
|
187
|
+
Math.min(maxVisibleItems ?? widths.length, widths.length),
|
|
188
|
+
);
|
|
189
|
+
const allowedWidths =
|
|
190
|
+
collapseFrom === 'end'
|
|
191
|
+
? widths.slice(0, allowed)
|
|
192
|
+
: widths.slice(widths.length - allowed);
|
|
193
|
+
const capped = allowed < widths.length && indicatorWidth > 0;
|
|
194
|
+
const rendered =
|
|
195
|
+
span(allowedWidths) +
|
|
196
|
+
(capped ? (allowedWidths.length > 0 ? gap : 0) + indicatorWidth : 0);
|
|
197
|
+
// Round the folded width up so the trigger never clips. Keep the unfolded
|
|
198
|
+
// width exact: the list's width at it must not widen a list with room.
|
|
199
|
+
return {
|
|
200
|
+
collapsed: Math.ceil(collapsed),
|
|
201
|
+
rendered,
|
|
202
|
+
chrome,
|
|
203
|
+
inFlexRow,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
91
207
|
/**
|
|
92
208
|
* Why a list measures:
|
|
93
209
|
* - `'commit'`: a React commit mounted or changed it. Its result applies with
|
|
@@ -349,11 +465,11 @@ export function useOverflow(
|
|
|
349
465
|
itemCount: number,
|
|
350
466
|
options: UseOverflowOptions = {},
|
|
351
467
|
): UseOverflowReturn {
|
|
352
|
-
const {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
);
|
|
468
|
+
const {
|
|
469
|
+
remeasure: _remeasure,
|
|
470
|
+
inlineBounds: _inlineBounds,
|
|
471
|
+
...result
|
|
472
|
+
} = useOverflowInternal(itemCount, options, {tracksRows: true});
|
|
357
473
|
return result;
|
|
358
474
|
}
|
|
359
475
|
|
|
@@ -365,13 +481,28 @@ export function useOverflow(
|
|
|
365
481
|
* them. `onMeasure` runs after each measurement, in the same render as its
|
|
366
482
|
* result, so a host can mark what that measurement covered. `remeasure`
|
|
367
483
|
* measures again with the lists of the current commit, for a change that
|
|
368
|
-
* resizes nothing.
|
|
484
|
+
* resizes nothing. With `gapToken`, the CSS value of the host's gap, the hook
|
|
485
|
+
* ignores `gap` and reads the gap the browser renders on the measurement copy;
|
|
486
|
+
* a new token measures again.
|
|
369
487
|
*/
|
|
370
488
|
export function useOverflowInternal(
|
|
371
489
|
itemCount: number,
|
|
372
490
|
options: UseOverflowOptions,
|
|
373
|
-
{
|
|
374
|
-
|
|
491
|
+
{
|
|
492
|
+
tracksRows,
|
|
493
|
+
tracksInlineBounds = false,
|
|
494
|
+
onMeasure,
|
|
495
|
+
gapToken,
|
|
496
|
+
}: {
|
|
497
|
+
tracksRows: boolean;
|
|
498
|
+
tracksInlineBounds?: boolean;
|
|
499
|
+
onMeasure?: () => void;
|
|
500
|
+
gapToken?: string;
|
|
501
|
+
},
|
|
502
|
+
): UseOverflowReturn & {
|
|
503
|
+
inlineBounds: OverflowInlineBounds;
|
|
504
|
+
remeasure: () => void;
|
|
505
|
+
} {
|
|
375
506
|
const {
|
|
376
507
|
gap = 0,
|
|
377
508
|
minVisibleItems = 0,
|
|
@@ -395,6 +526,9 @@ export function useOverflowInternal(
|
|
|
395
526
|
const [measuredSizes] = useState<MeasuredSizes>(() => new WeakMap());
|
|
396
527
|
const [rows, setRows] = useState(1);
|
|
397
528
|
const [rowHeight, setRowHeight] = useState(0);
|
|
529
|
+
const [inlineBounds, setInlineBounds] =
|
|
530
|
+
useState<OverflowInlineBounds>(NO_INLINE_BOUNDS);
|
|
531
|
+
const appliedBoundsRef = useRef<OverflowInlineBounds>(NO_INLINE_BOUNDS);
|
|
398
532
|
// The values last written to state. A measurement that matches them writes
|
|
399
533
|
// nothing, so a resize that changes nothing renders nothing.
|
|
400
534
|
const appliedRef = useRef({visibleCount: itemCount, rows: 1, rowHeight: 0});
|
|
@@ -403,6 +537,7 @@ export function useOverflowInternal(
|
|
|
403
537
|
const observedElRef = useRef<HTMLElement | null>(null);
|
|
404
538
|
const observedMeasureElRef = useRef<HTMLElement | null>(null);
|
|
405
539
|
const unobserveContainerRef = useRef<(() => void) | null>(null);
|
|
540
|
+
const unobserveParentRef = useRef<(() => void) | null>(null);
|
|
406
541
|
const unobserveMeasureRef = useRef<(() => void) | null>(null);
|
|
407
542
|
|
|
408
543
|
const apply = useCallback(
|
|
@@ -450,8 +585,17 @@ export function useOverflowInternal(
|
|
|
450
585
|
} else {
|
|
451
586
|
availableWidth = container.offsetWidth;
|
|
452
587
|
recordBorderBox(measuredSizes, container);
|
|
588
|
+
if (tracksInlineBounds && container.parentElement != null) {
|
|
589
|
+
recordBorderBox(measuredSizes, container.parentElement);
|
|
590
|
+
}
|
|
453
591
|
}
|
|
454
592
|
recordBorderBox(measuredSizes, measure);
|
|
593
|
+
// A spacing token follows the theme's scale and the root font size, so
|
|
594
|
+
// its pixel value is known only after layout.
|
|
595
|
+
const gapPx =
|
|
596
|
+
gapToken != null
|
|
597
|
+
? Number.parseFloat(getComputedStyle(measure).columnGap) || 0
|
|
598
|
+
: gap;
|
|
455
599
|
|
|
456
600
|
const allChildren = Array.from(measure.children) as HTMLElement[];
|
|
457
601
|
|
|
@@ -470,7 +614,62 @@ export function useOverflowInternal(
|
|
|
470
614
|
return;
|
|
471
615
|
}
|
|
472
616
|
|
|
473
|
-
|
|
617
|
+
let widths = children.map(child => child.offsetWidth);
|
|
618
|
+
let fitIndicatorWidth = indicatorWidth;
|
|
619
|
+
let chrome = 0;
|
|
620
|
+
if (tracksInlineBounds) {
|
|
621
|
+
const style = getComputedStyle(container);
|
|
622
|
+
const px = (value: string) => parseFloat(value) || 0;
|
|
623
|
+
chrome =
|
|
624
|
+
px(style.paddingLeft) +
|
|
625
|
+
px(style.paddingRight) +
|
|
626
|
+
px(style.borderLeftWidth) +
|
|
627
|
+
px(style.borderRightWidth);
|
|
628
|
+
}
|
|
629
|
+
// The visible list shares the measure copy's scale and, unlike the
|
|
630
|
+
// zero-height copy, has a box to read it from.
|
|
631
|
+
const scale = tracksInlineBounds
|
|
632
|
+
? screenScale(
|
|
633
|
+
container,
|
|
634
|
+
container.getBoundingClientRect(),
|
|
635
|
+
INLINE_SCALE_TOLERANCE,
|
|
636
|
+
).x
|
|
637
|
+
: 1;
|
|
638
|
+
const exact = (element: HTMLElement) => exactWidth(element, scale);
|
|
639
|
+
if (tracksInlineBounds && !observeParent) {
|
|
640
|
+
// The list publishes its unfolded width as its own width. It fits
|
|
641
|
+
// sub-pixel items in its sub-pixel content box, so a box at that
|
|
642
|
+
// width holds every item.
|
|
643
|
+
widths = children.map(exact);
|
|
644
|
+
fitIndicatorWidth = hasIndicator
|
|
645
|
+
? exact(allChildren[allChildren.length - 1])
|
|
646
|
+
: 0;
|
|
647
|
+
// Layout snaps a published width to a fraction of a pixel; the
|
|
648
|
+
// allowance keeps a box at that width holding every item.
|
|
649
|
+
availableWidth = exact(container) - chrome + 0.05;
|
|
650
|
+
}
|
|
651
|
+
if (tracksInlineBounds) {
|
|
652
|
+
const bounds = inlineBoundsOf(
|
|
653
|
+
children.map(exact),
|
|
654
|
+
hasIndicator ? exact(allChildren[allChildren.length - 1]) : 0,
|
|
655
|
+
gapPx,
|
|
656
|
+
minVisibleItems,
|
|
657
|
+
collapseFrom,
|
|
658
|
+
maxVisibleItems,
|
|
659
|
+
chrome,
|
|
660
|
+
!observeParent && isFlexRow(container.parentElement),
|
|
661
|
+
);
|
|
662
|
+
const applied = appliedBoundsRef.current;
|
|
663
|
+
if (
|
|
664
|
+
applied.collapsed !== bounds.collapsed ||
|
|
665
|
+
applied.rendered !== bounds.rendered ||
|
|
666
|
+
applied.chrome !== bounds.chrome ||
|
|
667
|
+
applied.inFlexRow !== bounds.inFlexRow
|
|
668
|
+
) {
|
|
669
|
+
appliedBoundsRef.current = bounds;
|
|
670
|
+
setInlineBounds(bounds);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
474
673
|
const measuredRowHeight = children.reduce(
|
|
475
674
|
(max, child) => Math.max(max, child.offsetHeight || 0),
|
|
476
675
|
0,
|
|
@@ -478,9 +677,9 @@ export function useOverflowInternal(
|
|
|
478
677
|
|
|
479
678
|
const {visibleCount: nextVisible, rows: nextRows} = computeOverflow({
|
|
480
679
|
widths,
|
|
481
|
-
gap,
|
|
680
|
+
gap: gapPx,
|
|
482
681
|
availableWidth,
|
|
483
|
-
indicatorWidth,
|
|
682
|
+
indicatorWidth: fitIndicatorWidth,
|
|
484
683
|
minVisibleItems,
|
|
485
684
|
maxVisibleItems,
|
|
486
685
|
maxRows,
|
|
@@ -533,7 +732,7 @@ export function useOverflowInternal(
|
|
|
533
732
|
canChangeListHeight(
|
|
534
733
|
renderedSet(appliedRef.current.visibleCount),
|
|
535
734
|
renderedSet(nextVisible),
|
|
536
|
-
|
|
735
|
+
gapPx,
|
|
537
736
|
availableWidth,
|
|
538
737
|
maxRows ?? 1,
|
|
539
738
|
)
|
|
@@ -547,6 +746,7 @@ export function useOverflowInternal(
|
|
|
547
746
|
[
|
|
548
747
|
itemCount,
|
|
549
748
|
gap,
|
|
749
|
+
gapToken,
|
|
550
750
|
minVisibleItems,
|
|
551
751
|
maxVisibleItems,
|
|
552
752
|
maxRows,
|
|
@@ -554,6 +754,7 @@ export function useOverflowInternal(
|
|
|
554
754
|
observeParent,
|
|
555
755
|
apply,
|
|
556
756
|
measuredSizes,
|
|
757
|
+
tracksInlineBounds,
|
|
557
758
|
],
|
|
558
759
|
);
|
|
559
760
|
|
|
@@ -578,6 +779,8 @@ export function useOverflowInternal(
|
|
|
578
779
|
unobserveContainerRef.current?.();
|
|
579
780
|
unobserveContainerRef.current = null;
|
|
580
781
|
observedElRef.current = null;
|
|
782
|
+
unobserveParentRef.current?.();
|
|
783
|
+
unobserveParentRef.current = null;
|
|
581
784
|
|
|
582
785
|
if (el) {
|
|
583
786
|
const target =
|
|
@@ -588,9 +791,19 @@ export function useOverflowInternal(
|
|
|
588
791
|
measuredSizes,
|
|
589
792
|
);
|
|
590
793
|
observedElRef.current = target;
|
|
794
|
+
// A parent that resizes can change how it lays the list out (a flex
|
|
795
|
+
// row at one width, a block at another), and the list's published
|
|
796
|
+
// width depends on that, so the list measures again.
|
|
797
|
+
if (!observeParent && tracksInlineBounds && el.parentElement != null) {
|
|
798
|
+
unobserveParentRef.current = observeForOverflow(
|
|
799
|
+
el.parentElement,
|
|
800
|
+
measureLatest,
|
|
801
|
+
measuredSizes,
|
|
802
|
+
);
|
|
803
|
+
}
|
|
591
804
|
}
|
|
592
805
|
},
|
|
593
|
-
[measureLatest, measuredSizes, observeParent],
|
|
806
|
+
[measureLatest, measuredSizes, observeParent, tracksInlineBounds],
|
|
594
807
|
);
|
|
595
808
|
|
|
596
809
|
const measureRef = useCallback(
|
|
@@ -637,6 +850,7 @@ export function useOverflowInternal(
|
|
|
637
850
|
// the return uses the fixed values.
|
|
638
851
|
rows: tracksRows ? rows : 1,
|
|
639
852
|
rowHeight: tracksRows ? rowHeight : 0,
|
|
853
|
+
inlineBounds: tracksInlineBounds ? inlineBounds : NO_INLINE_BOUNDS,
|
|
640
854
|
remeasure,
|
|
641
855
|
};
|
|
642
856
|
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useResolvedRequired.ts
|
|
7
7
|
* @input Uses React, FormLayoutContext
|
|
8
|
-
* @output Exports useResolvedOptionality and
|
|
8
|
+
* @output Exports useResolvedOptionality, useResolvedRequired and
|
|
9
|
+
* resolveSearchTriggerRequired
|
|
9
10
|
* @position Resolves a field's effective aria-required, and which optionality
|
|
10
11
|
* marker its label shows, against the form default
|
|
11
12
|
*
|
|
@@ -90,3 +91,51 @@ export function useResolvedRequired({
|
|
|
90
91
|
}): boolean {
|
|
91
92
|
return useResolvedOptionality({isRequired, isOptional}).isRequired;
|
|
92
93
|
}
|
|
94
|
+
|
|
95
|
+
/** How a select trigger with search announces its required state. */
|
|
96
|
+
export interface SearchTriggerRequired {
|
|
97
|
+
/** The trigger's `aria-required`. */
|
|
98
|
+
readonly ariaRequired: 'true' | undefined;
|
|
99
|
+
/** The trigger needs a hidden "Required" description. */
|
|
100
|
+
readonly hasRequiredDescription: boolean;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Resolve the required state of a Selector or MultiSelector trigger.
|
|
105
|
+
*
|
|
106
|
+
* With search, the editable trigger is a role-less button, where
|
|
107
|
+
* `aria-required` is not allowed. The closed trigger then states the required
|
|
108
|
+
* state in its name, through the Field label's visible marker, or else in a
|
|
109
|
+
* hidden description. The search combobox carries `aria-required` while open.
|
|
110
|
+
* Without search, or read-only, the trigger is the combobox and carries it.
|
|
111
|
+
*/
|
|
112
|
+
export function resolveSearchTriggerRequired({
|
|
113
|
+
hasSearch,
|
|
114
|
+
isReadOnly,
|
|
115
|
+
isRequired,
|
|
116
|
+
showsRequiredMarker,
|
|
117
|
+
isInInputGroup,
|
|
118
|
+
ariaLabel,
|
|
119
|
+
ariaLabelledBy,
|
|
120
|
+
}: {
|
|
121
|
+
hasSearch: boolean;
|
|
122
|
+
isReadOnly: boolean;
|
|
123
|
+
isRequired: boolean;
|
|
124
|
+
/** `ResolvedOptionality.showsRequiredMarker`. */
|
|
125
|
+
showsRequiredMarker: boolean;
|
|
126
|
+
/** An InputGroup names the trigger instead of the Field label. */
|
|
127
|
+
isInInputGroup: boolean;
|
|
128
|
+
ariaLabel: string | undefined;
|
|
129
|
+
ariaLabelledBy: string | undefined;
|
|
130
|
+
}): SearchTriggerRequired {
|
|
131
|
+
const isSearchTrigger = hasSearch && !isReadOnly;
|
|
132
|
+
const isLabelRequiredInName =
|
|
133
|
+
showsRequiredMarker &&
|
|
134
|
+
!isInInputGroup &&
|
|
135
|
+
(ariaLabel == null || ariaLabelledBy != null);
|
|
136
|
+
return {
|
|
137
|
+
ariaRequired: isRequired && !isSearchTrigger ? 'true' : undefined,
|
|
138
|
+
hasRequiredDescription:
|
|
139
|
+
isSearchTrigger && isRequired && !isLabelRequiredInName,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
@@ -17,7 +17,11 @@
|
|
|
17
17
|
import {useCallback, useRef} from 'react';
|
|
18
18
|
import {useIsomorphicLayoutEffect} from './useIsomorphicLayoutEffect';
|
|
19
19
|
import {isRtlElement} from './isRtlElement';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
findTypeaheadMatch,
|
|
22
|
+
nextTypeaheadBuffer,
|
|
23
|
+
isShortcutChord,
|
|
24
|
+
} from '../utils/typeaheadMatch';
|
|
21
25
|
|
|
22
26
|
/** Keys handled by the tree keyboard model (used to gate typeahead). */
|
|
23
27
|
const NAVIGATION_KEYS = new Set([
|
|
@@ -503,9 +507,9 @@ export function useTreeFocusInternal<T extends HTMLElement = HTMLElement>(
|
|
|
503
507
|
if (
|
|
504
508
|
typeahead &&
|
|
505
509
|
e.key.length === 1 &&
|
|
506
|
-
!e
|
|
507
|
-
|
|
508
|
-
!e.altKey &&
|
|
510
|
+
!isShortcutChord(e) &&
|
|
511
|
+
// AltGr reports Alt too; the letter it types still jumps.
|
|
512
|
+
(!e.altKey || e.getModifierState('AltGraph')) &&
|
|
509
513
|
NAVIGATION_KEYS.has(e.key) === false
|
|
510
514
|
) {
|
|
511
515
|
runTypeahead(e, items, currentIndex);
|
|
@@ -16,7 +16,11 @@
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
import {useCallback, useEffect, useRef} from 'react';
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
findTypeaheadMatch,
|
|
21
|
+
nextTypeaheadBuffer,
|
|
22
|
+
isShortcutChord,
|
|
23
|
+
} from '../utils/typeaheadMatch';
|
|
20
24
|
|
|
21
25
|
export interface UseTypeaheadOptions {
|
|
22
26
|
/**
|
|
@@ -72,10 +76,8 @@ function isPrintableCharacter(e: React.KeyboardEvent | KeyboardEvent): boolean {
|
|
|
72
76
|
e.key.length === 1 &&
|
|
73
77
|
// Alt alone is not excluded: Option+letter on macOS composes a printable
|
|
74
78
|
// character (Option+a → "å"), and dropping those makes accented labels
|
|
75
|
-
// untypeable.
|
|
76
|
-
|
|
77
|
-
!e.ctrlKey &&
|
|
78
|
-
!e.metaKey &&
|
|
79
|
+
// untypeable. AltGr sets ctrlKey on Windows and still types a letter.
|
|
80
|
+
!isShortcutChord(e) &&
|
|
79
81
|
// A key that is part of an input method's composition is the IME's, not
|
|
80
82
|
// a jump. React's synthetic event surfaces `isComposing` too.
|
|
81
83
|
!isComposingKey(e) &&
|
|
@@ -157,13 +159,13 @@ export function useTypeahead(options: UseTypeaheadOptions): UseTypeaheadReturn {
|
|
|
157
159
|
const onKeyDown = useCallback(
|
|
158
160
|
(e: React.KeyboardEvent | KeyboardEvent): boolean => {
|
|
159
161
|
// A bare Space with no active buffer is not typeahead (menus activate on
|
|
160
|
-
// Space); once the user is mid-typing, Space extends the query.
|
|
161
|
-
//
|
|
162
|
-
// consuming it would append a raw space that poisons the
|
|
162
|
+
// Space); once the user is mid-typing, Space extends the query. With a
|
|
163
|
+
// Control or Command shortcut it is neither — that is an OS or IME
|
|
164
|
+
// shortcut, and consuming it would append a raw space that poisons the
|
|
165
|
+
// whole buffer.
|
|
163
166
|
const isSpaceMidType =
|
|
164
167
|
e.key === ' ' &&
|
|
165
|
-
!e
|
|
166
|
-
!e.metaKey &&
|
|
168
|
+
!isShortcutChord(e) &&
|
|
167
169
|
!isComposingKey(e) &&
|
|
168
170
|
bufferRef.current.length > 0;
|
|
169
171
|
if (!isPrintableCharacter(e) && !isSpaceMidType) {
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InternationalizationContext.ts
|
|
7
|
-
* @input createSharedContext, i18n types
|
|
7
|
+
* @input createSharedContext, defaultTranslator, i18n types
|
|
8
8
|
* @output Exports InternationalizationContext and InternationalizationContextValue
|
|
9
9
|
* @position Context definition for client-side locale + messages
|
|
10
10
|
*
|
|
11
11
|
* Separated from InternationalizationProvider.tsx so components can consume
|
|
12
12
|
* the context without pulling in the full provider implementation.
|
|
13
|
-
* Follows the LinkContext.ts / ThemeContext.ts pattern.
|
|
13
|
+
* Follows the LinkContext.ts / ThemeContext.ts pattern. It does not import the
|
|
14
|
+
* resolver, so a module that only reads the locale skips the message parser.
|
|
14
15
|
*
|
|
15
16
|
* SYNC: When modified, update these files to stay in sync:
|
|
16
17
|
* - /packages/core/src/i18n/InternationalizationProvider.tsx
|
|
@@ -20,12 +21,17 @@
|
|
|
20
21
|
* - /packages/core/src/i18n/useCollator.ts
|
|
21
22
|
* - /packages/core/src/i18n/getLocaleDirection.ts
|
|
22
23
|
* - /packages/core/src/i18n/index.ts
|
|
24
|
+
* - /packages/core/src/i18n/defaultTranslator.ts
|
|
25
|
+
* - /packages/core/src/i18n/translatingContext.ts
|
|
23
26
|
*/
|
|
24
27
|
|
|
25
|
-
import {getResolve} from './resolve';
|
|
28
|
+
import type {getResolve} from './resolve';
|
|
26
29
|
import type {Locale, MessagesByLocale, Overrides} from './types';
|
|
27
30
|
import type {CalendarSystem} from '../utils/calendarSystem';
|
|
28
31
|
import {createSharedContext} from '../utils/sharedContext';
|
|
32
|
+
import {defaultTranslator} from './defaultTranslator';
|
|
33
|
+
|
|
34
|
+
type Translate = ReturnType<typeof getResolve>;
|
|
29
35
|
|
|
30
36
|
export interface InternationalizationContextValue {
|
|
31
37
|
locale: Locale;
|
|
@@ -37,12 +43,14 @@ export interface InternationalizationContextValue {
|
|
|
37
43
|
calendar?: CalendarSystem;
|
|
38
44
|
messages: MessagesByLocale;
|
|
39
45
|
overrides?: Overrides;
|
|
40
|
-
translate:
|
|
46
|
+
translate: Translate;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
50
|
+
* Without a provider, `translate` resolves shipped English through the
|
|
51
|
+
* translator that translatingContext.ts registers when a translating module
|
|
52
|
+
* loads it. It returns the key only when no such module
|
|
53
|
+
* has loaded, which no translating path can reach.
|
|
46
54
|
*/
|
|
47
55
|
export const InternationalizationContext =
|
|
48
56
|
createSharedContext<InternationalizationContextValue>(
|
|
@@ -52,7 +60,8 @@ export const InternationalizationContext =
|
|
|
52
60
|
locale: 'en',
|
|
53
61
|
direction: 'ltr',
|
|
54
62
|
messages: {},
|
|
55
|
-
translate:
|
|
63
|
+
translate: (key, values) =>
|
|
64
|
+
defaultTranslator.translate?.(key, values) ?? key,
|
|
56
65
|
},
|
|
57
66
|
);
|
|
58
67
|
InternationalizationContext.displayName = 'InternationalizationContext';
|
|
@@ -141,7 +141,7 @@ export function AppI18n({children}: {children: ReactNode}) {
|
|
|
141
141
|
}`,
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
label: '
|
|
144
|
+
label: 'Change one Astryx string across your app',
|
|
145
145
|
code: `import type {ReactNode} from 'react';
|
|
146
146
|
import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
147
147
|
|
|
@@ -31,6 +31,11 @@ import type {
|
|
|
31
31
|
ProviderMessagesByLocale,
|
|
32
32
|
} from './types';
|
|
33
33
|
import {getResolve} from './resolve';
|
|
34
|
+
import {devPropError} from '../utils/devWarning';
|
|
35
|
+
|
|
36
|
+
// Bundlers replace this value at build time. The declaration lets a product
|
|
37
|
+
// without Node's types type-check this file.
|
|
38
|
+
declare const process: {readonly env: {readonly NODE_ENV?: string}};
|
|
34
39
|
|
|
35
40
|
const PROVIDER_NAME = 'InternationalizationProvider';
|
|
36
41
|
|
|
@@ -138,6 +143,13 @@ export function InternationalizationProvider({
|
|
|
138
143
|
calendar: calendarProp,
|
|
139
144
|
children,
|
|
140
145
|
}: InternationalizationProviderProps) {
|
|
146
|
+
if (process.env.NODE_ENV !== 'production' && locale == null) {
|
|
147
|
+
throw devPropError(
|
|
148
|
+
'InternationalizationProvider',
|
|
149
|
+
'locale',
|
|
150
|
+
'is required: a BCP 47 language tag, for example locale="en" or locale="pt-BR".',
|
|
151
|
+
);
|
|
152
|
+
}
|
|
141
153
|
const direction = dir ?? getLocaleDirection(locale);
|
|
142
154
|
const calendar = useMemo(
|
|
143
155
|
() =>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file defaultTranslator.ts
|
|
7
|
+
* @input sharedState
|
|
8
|
+
* @output defaultTranslator, the slot for the English translator of a context
|
|
9
|
+
* without a provider
|
|
10
|
+
* @position Internal. InternationalizationContext.ts reads the slot and
|
|
11
|
+
* translatingContext.ts fills it. It imports no resolver.
|
|
12
|
+
*
|
|
13
|
+
* SYNC: When modified, update these files to stay in sync:
|
|
14
|
+
* - /packages/core/src/i18n/InternationalizationContext.ts
|
|
15
|
+
* - /packages/core/src/i18n/translatingContext.ts
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type {getResolve} from './resolve';
|
|
19
|
+
import {sharedState} from '../utils/sharedRealm';
|
|
20
|
+
|
|
21
|
+
export const defaultTranslator = sharedState(
|
|
22
|
+
'i18n/default-translator/default-translator',
|
|
23
|
+
1,
|
|
24
|
+
(): {translate?: ReturnType<typeof getResolve>} => ({}),
|
|
25
|
+
);
|