@astryxdesign/core 0.7.11 → 0.7.12-canary.ccb4a6d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppShell/AppShellMobileContext.d.ts.map +1 -1
- package/dist/AppShell/AppShellMobileContext.js +4 -3
- package/dist/AppShell/useAppShellMainId.d.ts.map +1 -1
- package/dist/AppShell/useAppShellMainId.js +3 -2
- package/dist/Avatar/AvatarSizeContext.d.ts.map +1 -1
- package/dist/Avatar/AvatarSizeContext.js +2 -2
- package/dist/Avatar/AvatarStatusLabelContext.d.ts +2 -2
- package/dist/Avatar/AvatarStatusLabelContext.d.ts.map +1 -1
- package/dist/Avatar/AvatarStatusLabelContext.js +3 -3
- package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupContext.js +2 -2
- package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetHostContext.js +3 -2
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +48 -4
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcherContext.js +2 -2
- package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetEscape.js +2 -2
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +2 -13
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +25 -42
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +12 -21
- package/dist/Button/buttonHitArea.d.ts.map +1 -1
- package/dist/Button/buttonHitArea.js +3 -3
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroup.js +13 -7
- package/dist/ButtonGroup/ButtonGroupContext.d.ts.map +1 -1
- package/dist/ButtonGroup/ButtonGroupContext.js +2 -2
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +24 -15
- package/dist/Chat/ChatContext.d.ts.map +1 -1
- package/dist/Chat/ChatContext.js +6 -5
- package/dist/Chat/useChatStreamScroll.d.ts.map +1 -1
- package/dist/Chat/useChatStreamScroll.js +7 -22
- package/dist/CheckboxInput/CheckboxRowPressContext.d.ts.map +1 -1
- package/dist/CheckboxInput/CheckboxRowPressContext.js +1 -1
- package/dist/CheckboxList/CheckboxListContext.d.ts.map +1 -1
- package/dist/CheckboxList/CheckboxListContext.js +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.d.ts.map +1 -1
- package/dist/Collapsible/CollapsibleGroupContext.js +3 -3
- package/dist/CommandPalette/CommandPaletteContext.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteContext.js +4 -3
- package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -1
- package/dist/CommandPalette/busyStartSettle.js +2 -2
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +41 -4
- package/dist/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/Dialog/DialogContext.js +3 -2
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.js +6 -5
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +4 -15
- package/dist/DropdownMenu/menuRegionStops.d.ts.map +1 -1
- package/dist/DropdownMenu/menuRegionStops.js +2 -37
- package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
- package/dist/FormLayout/FormLayoutContext.js +2 -2
- package/dist/Heading/Heading.d.ts.map +1 -1
- package/dist/Heading/Heading.js +19 -16
- package/dist/HoverCard/HoverCard.d.ts +1 -2
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.d.ts +1 -2
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +5 -1
- package/dist/Icon/IconDefaultSizeContext.d.ts.map +1 -1
- package/dist/Icon/IconDefaultSizeContext.js +2 -2
- package/dist/InputGroup/InputGroupContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupContext.js +2 -2
- package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupInternalContext.js +2 -2
- package/dist/InteractiveRoleContext/InteractiveRoleContext.d.ts.map +1 -1
- package/dist/InteractiveRoleContext/InteractiveRoleContext.js +5 -3
- package/dist/Item/ItemDescriptionContext.d.ts.map +1 -1
- package/dist/Item/ItemDescriptionContext.js +3 -3
- package/dist/Item/ItemListRowContext.d.ts.map +1 -1
- package/dist/Item/ItemListRowContext.js +3 -3
- package/dist/Item/ItemMarkerColumnsContext.d.ts +1 -1
- package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -1
- package/dist/Item/ItemMarkerColumnsContext.js +2 -2
- package/dist/Layer/LayerContext.d.ts.map +1 -1
- package/dist/Layer/LayerContext.js +3 -2
- package/dist/Layer/LayerDepthContext.d.ts.map +1 -1
- package/dist/Layer/LayerDepthContext.js +3 -2
- package/dist/Layer/LayerTouch.d.ts +3 -2
- package/dist/Layer/LayerTouch.d.ts.map +1 -1
- package/dist/Layer/LayerTouch.js +3 -2
- package/dist/Layer/anchorName.d.ts.map +1 -1
- package/dist/Layer/anchorName.js +5 -1
- package/dist/Layer/inputHold.d.ts.map +1 -1
- package/dist/Layer/inputHold.js +115 -13
- package/dist/Layer/layerScopedContext.d.ts +5 -2
- package/dist/Layer/layerScopedContext.d.ts.map +1 -1
- package/dist/Layer/layerScopedContext.js +27 -10
- package/dist/Layer/layerSlideRules.d.ts +28 -26
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +41 -40
- package/dist/Layer/outsidePress.d.ts +21 -3
- package/dist/Layer/outsidePress.d.ts.map +1 -1
- package/dist/Layer/outsidePress.js +119 -29
- package/dist/Layer/settledBox.d.ts +9 -8
- package/dist/Layer/settledBox.d.ts.map +1 -1
- package/dist/Layer/settledBox.js +169 -49
- package/dist/Layer/toastHost.d.ts.map +1 -1
- package/dist/Layer/toastHost.js +3 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +172 -60
- package/dist/Layer/useLayerKeyboardClearance.d.ts +14 -2
- package/dist/Layer/useLayerKeyboardClearance.d.ts.map +1 -1
- package/dist/Layer/useLayerKeyboardClearance.js +83 -12
- package/dist/Layer/useTouchTrigger.d.ts +21 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +61 -37
- package/dist/Layout/Layout.d.ts +1 -1
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +10 -6
- package/dist/Layout/LayoutAreaContext.d.ts.map +1 -1
- package/dist/Layout/LayoutAreaContext.js +3 -3
- package/dist/Layout/LayoutContent.d.ts +6 -6
- package/dist/Layout/LayoutContent.js +9 -9
- package/dist/Layout/LayoutDividerContext.d.ts.map +1 -1
- package/dist/Layout/LayoutDividerContext.js +2 -2
- package/dist/Layout/LayoutSlotsContext.d.ts.map +1 -1
- package/dist/Layout/LayoutSlotsContext.js +2 -2
- package/dist/Link/LinkContext.d.ts +16 -0
- package/dist/Link/LinkContext.d.ts.map +1 -1
- package/dist/Link/LinkContext.js +3 -3
- package/dist/List/List.d.ts +12 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +29 -10
- package/dist/List/ListContext.d.ts +18 -3
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +9 -6
- package/dist/List/ListItem.d.ts +13 -4
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +37 -10
- package/dist/List/listLayoutUpdates.d.ts +34 -0
- package/dist/List/listLayoutUpdates.d.ts.map +1 -0
- package/dist/List/listLayoutUpdates.js +539 -0
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.js +57 -10
- package/dist/Markdown/blockDirection.d.ts +26 -0
- package/dist/Markdown/blockDirection.d.ts.map +1 -0
- package/dist/Markdown/blockDirection.js +68 -0
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts +3 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.d.ts.map +1 -1
- package/dist/Markdown/plugins/HeadingLinksRenderer.js +3 -1
- package/dist/MetadataList/MetadataListContext.d.ts.map +1 -1
- package/dist/MetadataList/MetadataListContext.js +2 -2
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +5 -4
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +9 -9
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -8
- package/dist/RadioList/RadioList.d.ts.map +1 -1
- package/dist/RadioList/RadioList.js +2 -2
- package/dist/RadioList/RadioListReasonContext.d.ts.map +1 -1
- package/dist/RadioList/RadioListReasonContext.js +1 -1
- package/dist/SegmentedControl/SegmentedControlContext.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlContext.js +2 -2
- package/dist/SelectableCard/selectableCardInput.d.ts.map +1 -1
- package/dist/SelectableCard/selectableCardInput.js +2 -2
- package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -1
- package/dist/Selector/SelectorRowLayoutContext.js +2 -2
- package/dist/SideNav/SideNavCollapseButton.d.ts +4 -3
- package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavCollapseContext.js +4 -3
- package/dist/SideNav/SideNavFocusTargetsContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavFocusTargetsContext.js +2 -2
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +3 -2
- package/dist/SideNav/SideNavRenderContext.d.ts.map +1 -1
- package/dist/SideNav/SideNavRenderContext.js +4 -3
- package/dist/SideNav/railMotion.d.ts +40 -0
- package/dist/SideNav/railMotion.d.ts.map +1 -1
- package/dist/SideNav/railMotion.js +2 -2
- package/dist/SizeContext/SizeContext.d.ts.map +1 -1
- package/dist/SizeContext/SizeContext.js +2 -2
- package/dist/SnapPaging/SnapPaging.d.ts.map +1 -1
- package/dist/SnapPaging/SnapPaging.js +162 -36
- package/dist/SnapPaging/snapPagingValue.d.ts +29 -3
- package/dist/SnapPaging/snapPagingValue.d.ts.map +1 -1
- package/dist/SnapPaging/snapPagingValue.js +38 -6
- package/dist/Spinner/SpinnerOwnerContext.d.ts.map +1 -1
- package/dist/Spinner/SpinnerOwnerContext.js +2 -2
- package/dist/Stepper/StepperContext.d.ts.map +1 -1
- package/dist/Stepper/StepperContext.js +3 -3
- package/dist/Switch/useSwitchTouch.d.ts.map +1 -1
- package/dist/Switch/useSwitchTouch.js +8 -3
- package/dist/TabList/TabListContext.d.ts.map +1 -1
- package/dist/TabList/TabListContext.js +2 -2
- package/dist/Table/BaseTable.d.ts +3 -2
- package/dist/Table/BaseTable.d.ts.map +1 -1
- package/dist/Table/BaseTable.js +73 -16
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +3 -2
- package/dist/Table/TableContext.d.ts.map +1 -1
- package/dist/Table/TableContext.js +2 -2
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.d.ts.map +1 -1
- package/dist/Table/plugins/filtering/useTableFiltering.js +4 -3
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +5 -3
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts +16 -18
- package/dist/Table/plugins/rowIndex/useTableRowIndex.d.ts.map +1 -1
- package/dist/Table/plugins/rowIndex/useTableRowIndex.js +48 -39
- package/dist/Table/plugins/selection/useTableSelection.d.ts.map +1 -1
- package/dist/Table/plugins/selection/useTableSelection.js +4 -2
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +1 -0
- package/dist/Table/plugins/tree/useTableTreeData.d.ts.map +1 -1
- package/dist/Table/plugins/tree/useTableTreeData.js +3 -2
- package/dist/Table/tableRowContextUsage.d.ts +21 -0
- package/dist/Table/tableRowContextUsage.d.ts.map +1 -0
- package/dist/Table/tableRowContextUsage.js +88 -0
- package/dist/Table/types.d.ts +58 -5
- package/dist/Table/types.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.d.ts.map +1 -1
- package/dist/Table/useBaseTablePlugins.js +5 -2
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +18 -14
- package/dist/Text/TruncationTooltip.d.ts +45 -0
- package/dist/Text/TruncationTooltip.d.ts.map +1 -0
- package/dist/Text/TruncationTooltip.js +123 -0
- package/dist/Text/textClampContext.d.ts.map +1 -1
- package/dist/Text/textClampContext.js +1 -1
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +4 -0
- package/dist/ToggleButton/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/ToggleButton/ToggleButtonGroup.js +2 -2
- package/dist/Token/TokenNamingContext.d.ts.map +1 -1
- package/dist/Token/TokenNamingContext.js +2 -2
- package/dist/Tokenizer/TokenizerClearAllMessageContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerClearAllMessageContext.js +2 -2
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts +12 -0
- package/dist/Tokenizer/TokenizerItemRemovableContext.d.ts.map +1 -1
- package/dist/Tokenizer/TokenizerItemRemovableContext.js +2 -2
- package/dist/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar/Toolbar.js +12 -6
- package/dist/Tooltip/tooltipPresentInterest.d.ts +29 -0
- package/dist/Tooltip/tooltipPresentInterest.d.ts.map +1 -0
- package/dist/Tooltip/tooltipPresentInterest.js +29 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +30 -4
- package/dist/TopNav/TopNavContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavContext.js +2 -2
- package/dist/TopNav/TopNavMobileContentContext.d.ts +1 -1
- package/dist/TopNav/TopNavMobileContentContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavMobileContentContext.js +4 -3
- package/dist/TopNav/TopNavRenderContext.d.ts.map +1 -1
- package/dist/TopNav/TopNavRenderContext.js +4 -3
- package/dist/Typeahead/busyIndicatorLane.d.ts.map +1 -1
- package/dist/Typeahead/busyIndicatorLane.js +3 -2
- package/dist/Typeahead/committedChoicesKey.d.ts.map +1 -1
- package/dist/Typeahead/committedChoicesKey.js +3 -2
- package/dist/Typeahead/trailingKeyDown.d.ts.map +1 -1
- package/dist/Typeahead/trailingKeyDown.js +3 -2
- package/dist/astryx.css +18 -8
- package/dist/gestures/GestureArena.d.ts +2 -0
- package/dist/gestures/GestureArena.d.ts.map +1 -1
- package/dist/gestures/GestureArena.js +8 -1
- package/dist/gestures/GestureRecognizer.d.ts +6 -0
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -1
- package/dist/gestures/GestureRecognizer.js +9 -0
- package/dist/gestures/PressTracker.d.ts.map +1 -1
- package/dist/gestures/PressTracker.js +9 -4
- package/dist/hooks/focusableSelector.d.ts +13 -1
- package/dist/hooks/focusableSelector.d.ts.map +1 -1
- package/dist/hooks/focusableSelector.js +22 -2
- package/dist/hooks/longPressDetector.d.ts.map +1 -1
- package/dist/hooks/longPressDetector.js +1 -25
- package/dist/hooks/pressGroupContext.d.ts.map +1 -1
- package/dist/hooks/pressGroupContext.js +1 -1
- package/dist/hooks/useActionGroupTracking.d.ts +18 -1
- package/dist/hooks/useActionGroupTracking.d.ts.map +1 -1
- package/dist/hooks/useActionGroupTracking.js +13 -2
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +3 -2
- package/dist/hooks/useFocusTrap.d.ts +11 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +47 -2
- package/dist/hooks/useListFocus.d.ts +7 -0
- package/dist/hooks/useListFocus.d.ts.map +1 -1
- package/dist/hooks/useListFocus.js +20 -3
- package/dist/hooks/usePager.d.ts.map +1 -1
- package/dist/hooks/usePager.js +26 -3
- package/dist/hooks/useScrollOverflow.d.ts +22 -0
- package/dist/hooks/useScrollOverflow.d.ts.map +1 -1
- package/dist/hooks/useScrollOverflow.js +67 -11
- package/dist/i18n/InternationalizationContext.d.ts +19 -0
- package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
- package/dist/i18n/InternationalizationContext.js +3 -3
- package/dist/i18n/englishFallback.d.ts.map +1 -1
- package/dist/i18n/englishFallback.js +5 -1
- package/dist/i18n/firstStrongDirection.d.ts +7 -0
- package/dist/i18n/firstStrongDirection.d.ts.map +1 -0
- package/dist/i18n/firstStrongDirection.js +65 -0
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +1 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +1 -0
- package/dist/internal/scroll-anchoring.d.ts +16 -0
- package/dist/internal/scroll-anchoring.d.ts.map +1 -0
- package/dist/internal/scroll-anchoring.js +16 -0
- package/dist/internal/touch.d.ts +2 -0
- package/dist/internal/touch.d.ts.map +1 -1
- package/dist/internal/touch.js +4 -1
- package/dist/motion/animatedLayout.d.ts +8 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +51 -3
- package/dist/motion/animator.d.ts +19 -2
- package/dist/motion/animator.d.ts.map +1 -1
- package/dist/motion/animator.js +72 -7
- package/dist/privateAttributes/itemKey.stylex.d.ts +5 -0
- package/dist/privateAttributes/itemKey.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/itemKey.stylex.js +25 -0
- package/dist/privateAttributes/leaving.stylex.d.ts +5 -0
- package/dist/privateAttributes/leaving.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/leaving.stylex.js +23 -0
- package/dist/privateAttributes/press.stylex.d.ts.map +1 -1
- package/dist/privateAttributes/press.stylex.js +13 -3
- package/dist/privateAttributes/scrollAnchoring.stylex.d.ts +7 -0
- package/dist/privateAttributes/scrollAnchoring.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/scrollAnchoring.stylex.js +50 -0
- package/dist/privateAttributes/travelling.stylex.d.ts +27 -0
- package/dist/privateAttributes/travelling.stylex.d.ts.map +1 -0
- package/dist/privateAttributes/travelling.stylex.js +51 -0
- package/dist/theme/Theme.d.ts.map +1 -1
- package/dist/theme/Theme.js +95 -49
- package/dist/theme/syntax/SyntaxTheme.d.ts.map +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +3 -2
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +3 -2
- package/dist/utils/calendarSystem.d.ts.map +1 -1
- package/dist/utils/calendarSystem.js +4 -1
- package/dist/utils/flatTree.d.ts +13 -0
- package/dist/utils/flatTree.d.ts.map +1 -1
- package/dist/utils/flatTree.js +28 -4
- package/dist/utils/inputAge.d.ts +22 -0
- package/dist/utils/inputAge.d.ts.map +1 -0
- package/dist/utils/inputAge.js +54 -0
- package/dist/utils/inputStream.d.ts +8 -0
- package/dist/utils/inputStream.d.ts.map +1 -1
- package/dist/utils/inputStream.js +53 -3
- package/dist/utils/moduleLoader.d.ts +23 -0
- package/dist/utils/moduleLoader.d.ts.map +1 -0
- package/dist/utils/moduleLoader.js +31 -0
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +13 -8
- package/dist/utils/selectionLock.d.ts.map +1 -1
- package/dist/utils/selectionLock.js +7 -14
- package/dist/utils/sharedContext.d.ts +18 -0
- package/dist/utils/sharedContext.d.ts.map +1 -0
- package/dist/utils/sharedContext.js +33 -0
- package/dist/utils/sharedRealm.d.ts +24 -0
- package/dist/utils/sharedRealm.d.ts.map +1 -0
- package/dist/utils/sharedRealm.js +38 -0
- package/locales/en.json +4 -0
- package/locales/pseudo.json +3 -0
- package/package.json +10 -5
- package/src/AppShell/AppShellMobileContext.tsx +8 -3
- package/src/AppShell/useAppShellMainId.ts +7 -2
- package/src/Avatar/AvatarSizeContext.ts +6 -2
- package/src/Avatar/AvatarStatusLabelContext.ts +8 -3
- package/src/AvatarGroup/AvatarGroupContext.ts +7 -4
- package/src/BottomSheet/BottomSheetHostContext.ts +7 -3
- package/src/BottomSheet/BottomSheetPanel.tsx +56 -7
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +7 -2
- package/src/BottomSheet/bottomSheetEscape.ts +6 -2
- package/src/BottomSheet/bottomSheetStack.ts +6 -14
- package/src/BottomSheet/useSheetGestures.ts +28 -48
- package/src/Breadcrumbs/Breadcrumbs.tsx +6 -5
- package/src/Button/Button.doc.mjs +3 -3
- package/src/Button/Button.tsx +10 -22
- package/src/Button/buttonHitArea.ts +7 -4
- package/src/ButtonGroup/ButtonGroup.doc.mjs +3 -3
- package/src/ButtonGroup/ButtonGroup.tsx +27 -16
- package/src/ButtonGroup/ButtonGroupContext.ts +7 -4
- package/src/Carousel/Carousel.tsx +33 -15
- package/src/Chat/ChatContext.tsx +23 -7
- package/src/Chat/useChatStreamScroll.ts +7 -26
- package/src/CheckboxInput/CheckboxRowPressContext.ts +5 -1
- package/src/CheckboxList/CheckboxListContext.tsx +5 -1
- package/src/Collapsible/CollapsibleGroupContext.tsx +11 -3
- package/src/CommandPalette/CommandPaletteContext.ts +8 -3
- package/src/CommandPalette/busyStartSettle.ts +6 -2
- package/src/DateInput/TouchDateField.tsx +62 -4
- package/src/Dialog/DialogContext.ts +7 -2
- package/src/DropdownMenu/DropdownMenuContext.tsx +18 -5
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +6 -18
- package/src/DropdownMenu/menuRegionStops.ts +1 -49
- package/src/FormLayout/FormLayoutContext.ts +3 -3
- package/src/Heading/Heading.tsx +34 -18
- package/src/HoverCard/HoverCard.doc.mjs +3 -3
- package/src/HoverCard/HoverCard.tsx +1 -2
- package/src/HoverCard/useHoverCard.tsx +6 -2
- package/src/Icon/IconDefaultSizeContext.ts +6 -2
- package/src/IconButton/IconButton.doc.mjs +2 -2
- package/src/InputGroup/InputGroupContext.ts +7 -4
- package/src/InputGroup/InputGroupInternalContext.ts +6 -2
- package/src/InteractiveRoleContext/InteractiveRoleContext.ts +8 -3
- package/src/Item/ItemDescriptionContext.tsx +7 -3
- package/src/Item/ItemListRowContext.tsx +7 -3
- package/src/Item/ItemMarkerColumnsContext.tsx +7 -2
- package/src/Layer/LayerContext.ts +7 -2
- package/src/Layer/LayerDepthContext.tsx +3 -2
- package/src/Layer/LayerTouch.ts +6 -2
- package/src/Layer/anchorName.ts +8 -4
- package/src/Layer/inputHold.ts +138 -21
- package/src/Layer/layerScopedContext.tsx +34 -7
- package/src/Layer/layerSlideRules.ts +43 -40
- package/src/Layer/outsidePress.ts +144 -28
- package/src/Layer/settledBox.ts +216 -54
- package/src/Layer/toastHost.tsx +6 -2
- package/src/Layer/useLayer.tsx +200 -69
- package/src/Layer/useLayerKeyboardClearance.ts +90 -12
- package/src/Layer/useTouchTrigger.ts +89 -40
- package/src/Layout/Layout.doc.mjs +17 -0
- package/src/Layout/Layout.tsx +13 -9
- package/src/Layout/LayoutAreaContext.ts +8 -9
- package/src/Layout/LayoutContent.doc.mjs +11 -0
- package/src/Layout/LayoutContent.tsx +9 -9
- package/src/Layout/LayoutDividerContext.ts +6 -2
- package/src/Layout/LayoutSlotsContext.ts +6 -3
- package/src/Link/LinkContext.ts +7 -3
- package/src/List/List.doc.mjs +5 -0
- package/src/List/List.tsx +53 -5
- package/src/List/ListContext.tsx +28 -6
- package/src/List/ListItem.doc.mjs +11 -0
- package/src/List/ListItem.tsx +51 -14
- package/src/List/listLayoutUpdates.ts +603 -0
- package/src/Markdown/Markdown.tsx +93 -5
- package/src/Markdown/blockDirection.ts +100 -0
- package/src/Markdown/plugins/HeadingLinksRenderer.tsx +4 -0
- package/src/MetadataList/MetadataListContext.tsx +6 -2
- package/src/NavMenu/NavMenuContext.tsx +14 -5
- package/src/Popover/Popover.tsx +23 -16
- package/src/Popover/usePopover.tsx +21 -7
- package/src/RadioList/RadioList.tsx +7 -4
- package/src/RadioList/RadioListReasonContext.ts +1 -1
- package/src/Section/Section.doc.mjs +22 -0
- package/src/SegmentedControl/SegmentedControlContext.ts +6 -2
- package/src/SelectableCard/selectableCardInput.ts +6 -2
- package/src/Selector/SelectorRowLayoutContext.ts +6 -2
- package/src/SideNav/SideNavCollapseButton.doc.mjs +5 -5
- package/src/SideNav/SideNavCollapseButton.tsx +4 -3
- package/src/SideNav/SideNavCollapseContext.ts +12 -7
- package/src/SideNav/SideNavFocusTargetsContext.ts +6 -2
- package/src/SideNav/SideNavItem.tsx +6 -2
- package/src/SideNav/SideNavRenderContext.ts +9 -8
- package/src/SideNav/railMotion.ts +6 -2
- package/src/SizeContext/SizeContext.ts +6 -2
- package/src/SnapPaging/SnapPaging.ts +164 -39
- package/src/SnapPaging/snapPagingValue.ts +59 -12
- package/src/Spinner/SpinnerOwnerContext.ts +6 -2
- package/src/Stepper/StepperContext.ts +12 -3
- package/src/Switch/useSwitchTouch.ts +7 -5
- package/src/TabList/TabListContext.ts +7 -2
- package/src/Table/BaseTable.tsx +143 -19
- package/src/Table/Table.tsx +4 -3
- package/src/Table/TableContext.ts +6 -2
- package/src/Table/index.ts +2 -0
- package/src/Table/plugins/filtering/useTableFiltering.tsx +11 -3
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +10 -3
- package/src/Table/plugins/rowIndex/useTableRowIndex.tsx +38 -29
- package/src/Table/plugins/selection/useTableSelection.tsx +7 -2
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +1 -0
- package/src/Table/plugins/tree/useTableTreeData.tsx +6 -2
- package/src/Table/tableRowContextUsage.ts +105 -0
- package/src/Table/types.ts +60 -2
- package/src/Table/useBaseTablePlugins.ts +5 -2
- package/src/Table/useTableRowIndex.doc.mjs +6 -7
- package/src/Text/Text.tsx +34 -18
- package/src/Text/TruncationTooltip.tsx +179 -0
- package/src/Text/textClampContext.ts +5 -1
- package/src/TimeInput/TimeInput.tsx +4 -0
- package/src/ToggleButton/ToggleButtonGroup.tsx +6 -2
- package/src/Token/TokenNamingContext.ts +6 -2
- package/src/Tokenizer/TokenizerClearAllMessageContext.ts +4 -4
- package/src/Tokenizer/TokenizerItemRemovableContext.ts +3 -3
- package/src/Toolbar/Toolbar.tsx +16 -9
- package/src/Tooltip/tooltipPresentInterest.ts +43 -0
- package/src/Tooltip/useTooltip.tsx +33 -0
- package/src/TopNav/TopNavContext.ts +6 -2
- package/src/TopNav/TopNavMobileContentContext.ts +8 -3
- package/src/TopNav/TopNavRenderContext.ts +8 -4
- package/src/Typeahead/busyIndicatorLane.tsx +7 -2
- package/src/Typeahead/committedChoicesKey.tsx +4 -3
- package/src/Typeahead/trailingKeyDown.tsx +7 -2
- package/src/gestures/GestureArena.ts +8 -1
- package/src/gestures/GestureRecognizer.ts +9 -0
- package/src/gestures/PressTracker.ts +13 -4
- package/src/hooks/focusableSelector.ts +29 -1
- package/src/hooks/longPressDetector.ts +1 -35
- package/src/hooks/pressGroupContext.ts +5 -1
- package/src/hooks/useActionGroupTracking.ts +29 -2
- package/src/hooks/useAnnounce.ts +8 -4
- package/src/hooks/useFocusTrap.ts +62 -2
- package/src/hooks/useListFocus.ts +34 -7
- package/src/hooks/usePager.ts +30 -3
- package/src/hooks/useScrollOverflow.ts +65 -7
- package/src/i18n/InternationalizationContext.ts +12 -8
- package/src/i18n/englishFallback.ts +7 -1
- package/src/i18n/firstStrongDirection.ts +69 -0
- package/src/i18n/generated-locales/en.generated.ts +1 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +1 -0
- package/src/internal/scroll-anchoring.ts +16 -0
- package/src/internal/touch.ts +4 -0
- package/src/motion/animatedLayout.ts +44 -3
- package/src/motion/animator.ts +97 -9
- package/src/privateAttributes/itemKey.stylex.ts +25 -0
- package/src/privateAttributes/leaving.stylex.ts +23 -0
- package/src/privateAttributes/press.stylex.ts +19 -7
- package/src/privateAttributes/scrollAnchoring.stylex.ts +50 -0
- package/src/privateAttributes/travelling.stylex.ts +88 -0
- package/src/theme/Theme.tsx +124 -60
- package/src/theme/syntax/SyntaxTheme.tsx +7 -2
- package/src/theme/useTheme.ts +7 -8
- package/src/utils/calendarSystem.ts +7 -1
- package/src/utils/flatTree.ts +31 -4
- package/src/utils/inputAge.ts +66 -0
- package/src/utils/inputStream.ts +52 -3
- package/src/utils/moduleLoader.ts +47 -0
- package/src/utils/pressFeedback.ts +16 -7
- package/src/utils/selectionLock.ts +8 -18
- package/src/utils/sharedContext.ts +42 -0
- package/src/utils/sharedRealm.ts +42 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file TruncationTooltip.tsx
|
|
7
|
+
* @input A truncated element's ref, its full text and the tooltip placement
|
|
8
|
+
* @output Exports `useTruncationTooltipInterest`, which loads the Tooltip
|
|
9
|
+
* module once text is truncated and tracks the first hover, tap or focus on
|
|
10
|
+
* it, and `TruncationTooltip`, the Tooltip that mounts on that interaction
|
|
11
|
+
* @position Shared by Text and Heading. Until the first interaction a page of
|
|
12
|
+
* truncated text mounts no tooltip layers, and the tooltip that then mounts
|
|
13
|
+
* answers that interaction as it would once mounted.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
useCallback,
|
|
18
|
+
useEffect,
|
|
19
|
+
useRef,
|
|
20
|
+
useState,
|
|
21
|
+
type FocusEvent,
|
|
22
|
+
type PointerEvent,
|
|
23
|
+
type ReactNode,
|
|
24
|
+
type RefObject,
|
|
25
|
+
} from 'react';
|
|
26
|
+
import type {LayerPlacement} from '../Layer';
|
|
27
|
+
import {createModuleLoader} from '../utils/moduleLoader';
|
|
28
|
+
import type {Tooltip as TooltipType} from '../Tooltip/Tooltip';
|
|
29
|
+
import {useTapRecognizer} from '../Layer/useTouchTrigger';
|
|
30
|
+
import {
|
|
31
|
+
TooltipPresentInterestContext,
|
|
32
|
+
type TooltipPresentInterestState,
|
|
33
|
+
} from '../Tooltip/tooltipPresentInterest';
|
|
34
|
+
|
|
35
|
+
type TooltipComponent = typeof TooltipType;
|
|
36
|
+
|
|
37
|
+
// The Tooltip module. Once loaded, a tooltip renders from it at once: no
|
|
38
|
+
// boundary suspends, so the first hover's delay starts on the hover.
|
|
39
|
+
const tooltipModule = createModuleLoader(
|
|
40
|
+
async () => import('../Tooltip/Tooltip'),
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export interface TruncationTooltipInterest {
|
|
44
|
+
/** Whether a hover, tap or focus has reached the element. It stays true. */
|
|
45
|
+
readonly isWanted: boolean;
|
|
46
|
+
/** The Tooltip component, once its module has loaded. */
|
|
47
|
+
readonly tooltip: TooltipComponent | null;
|
|
48
|
+
/** The interaction that mounted the tooltip, until the tooltip reads it. */
|
|
49
|
+
readonly interestRef: RefObject<TooltipPresentInterestState>;
|
|
50
|
+
readonly onPointerEnter: (event: PointerEvent<HTMLElement>) => void;
|
|
51
|
+
readonly onPointerLeave: (event: PointerEvent<HTMLElement>) => void;
|
|
52
|
+
readonly onPointerDown: (event: PointerEvent<HTMLElement>) => void;
|
|
53
|
+
readonly onFocus: (event: FocusEvent<HTMLElement>) => void;
|
|
54
|
+
readonly onBlur: (event: FocusEvent<HTMLElement>) => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Tracks the interaction that mounts a truncated element's tooltip, while
|
|
59
|
+
* `isEnabled`, until the mounted tooltip reads it. A finger's arrival does not
|
|
60
|
+
* count: only a press that the touch trigger's recognizer takes for a tap
|
|
61
|
+
* does. Once the tooltip has read the interaction, its own listeners take
|
|
62
|
+
* over.
|
|
63
|
+
*/
|
|
64
|
+
export function useTruncationTooltipInterest(
|
|
65
|
+
isEnabled: boolean,
|
|
66
|
+
): TruncationTooltipInterest {
|
|
67
|
+
const [isWanted, setIsWanted] = useState(false);
|
|
68
|
+
const [tooltip, setTooltip] = useState<TooltipComponent | null>(
|
|
69
|
+
() => tooltipModule.loaded()?.Tooltip ?? null,
|
|
70
|
+
);
|
|
71
|
+
// Syncs with the module loader: truncated text loads the Tooltip module, so
|
|
72
|
+
// the first interaction mounts the tooltip at once.
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (!isEnabled || tooltip != null) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
let isCurrent = true;
|
|
78
|
+
tooltipModule.load().then(
|
|
79
|
+
loaded => {
|
|
80
|
+
if (isCurrent) {
|
|
81
|
+
setTooltip(() => loaded.Tooltip);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
() => {},
|
|
85
|
+
);
|
|
86
|
+
return () => {
|
|
87
|
+
isCurrent = false;
|
|
88
|
+
};
|
|
89
|
+
}, [isEnabled, tooltip]);
|
|
90
|
+
const interestRef = useRef<TooltipPresentInterestState>({
|
|
91
|
+
interest: null,
|
|
92
|
+
tapEvent: null,
|
|
93
|
+
isRead: false,
|
|
94
|
+
});
|
|
95
|
+
const tapRecognizer = useTapRecognizer();
|
|
96
|
+
const want = useCallback(
|
|
97
|
+
(interest: 'hover' | 'tap' | 'focus', tapEvent: Event | null = null) => {
|
|
98
|
+
const state = interestRef.current;
|
|
99
|
+
if (!isEnabled || state.isRead) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
state.interest = interest;
|
|
103
|
+
state.tapEvent = tapEvent;
|
|
104
|
+
setIsWanted(true);
|
|
105
|
+
},
|
|
106
|
+
[isEnabled],
|
|
107
|
+
);
|
|
108
|
+
const forget = useCallback((interest: 'hover' | 'focus') => {
|
|
109
|
+
const state = interestRef.current;
|
|
110
|
+
if (!state.isRead && state.interest === interest) {
|
|
111
|
+
state.interest = null;
|
|
112
|
+
}
|
|
113
|
+
}, []);
|
|
114
|
+
const onPointerEnter = useCallback(
|
|
115
|
+
(event: PointerEvent<HTMLElement>) => {
|
|
116
|
+
if (event.pointerType !== 'touch') {
|
|
117
|
+
want('hover');
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
[want],
|
|
121
|
+
);
|
|
122
|
+
const onPointerLeave = useCallback(() => forget('hover'), [forget]);
|
|
123
|
+
const onPointerDown = useCallback(
|
|
124
|
+
(event: PointerEvent<HTMLElement>) => {
|
|
125
|
+
if (!isEnabled || interestRef.current.isRead) {
|
|
126
|
+
tapRecognizer.forget();
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const isTouch = tapRecognizer.press(
|
|
130
|
+
event.nativeEvent,
|
|
131
|
+
event.currentTarget,
|
|
132
|
+
tapEvent => want('tap', tapEvent),
|
|
133
|
+
);
|
|
134
|
+
// A mouse press cancels a hover show, as a mounted tooltip does. A pen
|
|
135
|
+
// press waits for its tap.
|
|
136
|
+
if (!isTouch) {
|
|
137
|
+
forget('hover');
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
[isEnabled, tapRecognizer, want, forget],
|
|
141
|
+
);
|
|
142
|
+
const onFocus = useCallback(() => want('focus'), [want]);
|
|
143
|
+
const onBlur = useCallback(() => forget('focus'), [forget]);
|
|
144
|
+
return {
|
|
145
|
+
isWanted,
|
|
146
|
+
tooltip,
|
|
147
|
+
interestRef,
|
|
148
|
+
onPointerEnter,
|
|
149
|
+
onPointerLeave,
|
|
150
|
+
onPointerDown,
|
|
151
|
+
onFocus,
|
|
152
|
+
onBlur,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** The truncated element's Tooltip, given the interaction that mounted it. */
|
|
157
|
+
export function TruncationTooltip({
|
|
158
|
+
anchorRef,
|
|
159
|
+
content,
|
|
160
|
+
placement,
|
|
161
|
+
interest,
|
|
162
|
+
}: {
|
|
163
|
+
anchorRef: RefObject<HTMLElement | null>;
|
|
164
|
+
content: ReactNode;
|
|
165
|
+
placement: LayerPlacement;
|
|
166
|
+
interest: TruncationTooltipInterest;
|
|
167
|
+
}): ReactNode {
|
|
168
|
+
// A first interaction before the module loads mounts the tooltip once it
|
|
169
|
+
// has: the interaction is held until the tooltip reads it.
|
|
170
|
+
const Tooltip = interest.tooltip;
|
|
171
|
+
if (Tooltip == null) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
return (
|
|
175
|
+
<TooltipPresentInterestContext value={interest.interestRef}>
|
|
176
|
+
<Tooltip anchorRef={anchorRef} content={content} placement={placement} />
|
|
177
|
+
</TooltipPresentInterestContext>
|
|
178
|
+
);
|
|
179
|
+
}
|
|
@@ -711,6 +711,10 @@ function TimeField({
|
|
|
711
711
|
|
|
712
712
|
// Check if within range
|
|
713
713
|
if (isTimeInRange(newTime, min, max)) {
|
|
714
|
+
// The step is the committed value now: drop any typed draft so the
|
|
715
|
+
// box shows the stepped time and blur cannot re-commit stale text
|
|
716
|
+
// over it.
|
|
717
|
+
setPendingInput(null);
|
|
714
718
|
fireChange(newTime);
|
|
715
719
|
// Stepping programmatically rewrites a plain textbox's value, and
|
|
716
720
|
// screen readers do not announce programmatic textbox changes — the
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import {useCallback, use, useMemo, type ReactNode} from 'react';
|
|
22
|
-
import {createLayerScopedContext
|
|
22
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
23
23
|
import * as stylex from '@stylexjs/stylex';
|
|
24
24
|
import {spacingVars} from '../theme/tokens.stylex';
|
|
25
25
|
import type {ButtonSize} from '../Button';
|
|
@@ -44,7 +44,11 @@ interface ToggleButtonGroupContextValue {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
const ToggleButtonGroupContext =
|
|
47
|
-
|
|
47
|
+
createLayerScopedContext<ToggleButtonGroupContextValue | null>(
|
|
48
|
+
'ToggleButtonGroupContext',
|
|
49
|
+
1,
|
|
50
|
+
null,
|
|
51
|
+
);
|
|
48
52
|
ToggleButtonGroupContext.displayName = 'ToggleButtonGroupContext';
|
|
49
53
|
|
|
50
54
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @position Internal to Core; not exported from the Token entry point
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Names for a Token whose visible text runs past its label. PowerSearch
|
|
@@ -24,5 +24,9 @@ export interface TokenNaming {
|
|
|
24
24
|
removeName?: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export const TokenNamingContext =
|
|
27
|
+
export const TokenNamingContext = createSharedContext<TokenNaming | null>(
|
|
28
|
+
'TokenNamingContext',
|
|
29
|
+
1,
|
|
30
|
+
null,
|
|
31
|
+
);
|
|
28
32
|
TokenNamingContext.displayName = 'TokenNamingContext';
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* words (component:Tokenizer AR7).
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
17
17
|
|
|
18
|
-
export const TokenizerClearAllMessageContext =
|
|
19
|
-
null
|
|
20
|
-
);
|
|
18
|
+
export const TokenizerClearAllMessageContext = createSharedContext<
|
|
19
|
+
string | null
|
|
20
|
+
>('TokenizerClearAllMessageContext', 1, null);
|
|
21
21
|
TokenizerClearAllMessageContext.displayName = 'TokenizerClearAllMessageContext';
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* while a removable token remains. Without it, every token is removable.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {createContext} from 'react';
|
|
19
18
|
import type {SearchableItem} from '../Typeahead/types';
|
|
19
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
20
20
|
|
|
21
|
-
export const TokenizerItemRemovableContext =
|
|
21
|
+
export const TokenizerItemRemovableContext = createSharedContext<
|
|
22
22
|
((item: SearchableItem) => boolean) | null
|
|
23
|
-
>(null);
|
|
23
|
+
>('TokenizerItemRemovableContext', 1, null);
|
|
24
24
|
TokenizerItemRemovableContext.displayName = 'TokenizerItemRemovableContext';
|
package/src/Toolbar/Toolbar.tsx
CHANGED
|
@@ -26,7 +26,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
26
26
|
import {spacingVars, sizeVars} from '../theme/tokens.stylex';
|
|
27
27
|
import {mergeProps} from '../utils';
|
|
28
28
|
import {Section} from '../Section/Section';
|
|
29
|
-
import {
|
|
29
|
+
import {oneTabStopAmong, useInternalListFocus} from '../hooks/useListFocus';
|
|
30
30
|
import {useKeyboardHint} from '../hooks/useKeyboardHint';
|
|
31
31
|
import {SizeProvider} from '../SizeContext/SizeContext';
|
|
32
32
|
import {edgeCompSlot} from '../Layout/edgeCompensation.stylex';
|
|
@@ -202,6 +202,11 @@ export interface ToolbarProps extends BaseProps<HTMLDivElement> {
|
|
|
202
202
|
dividers?: ('top' | 'bottom' | 'start' | 'end')[];
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
// `a[href]` catches a Button rendered with `href`.
|
|
206
|
+
const TOOLBAR_ITEMS = 'button, input, a[href], [tabindex]';
|
|
207
|
+
const TOOLBAR_BOUNDARY = '[role="toolbar"], [popover]';
|
|
208
|
+
const toolbarTabStop = oneTabStopAmong(TOOLBAR_ITEMS, TOOLBAR_BOUNDARY);
|
|
209
|
+
|
|
205
210
|
/**
|
|
206
211
|
* General-purpose toolbar with start, center, and end content slots.
|
|
207
212
|
*
|
|
@@ -247,14 +252,16 @@ export function Toolbar({
|
|
|
247
252
|
|
|
248
253
|
const gapVar = spacingVars[spacingStepToVar[gap]] as string;
|
|
249
254
|
|
|
250
|
-
const {listRef, handleKeyDown, handleFocus} =
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
const {listRef, handleKeyDown, handleFocus} =
|
|
256
|
+
useInternalListFocus<HTMLDivElement>({
|
|
257
|
+
itemSelector: TOOLBAR_ITEMS,
|
|
258
|
+
boundarySelector: TOOLBAR_BOUNDARY,
|
|
259
|
+
orientation,
|
|
260
|
+
hasRovingTabIndex: true,
|
|
261
|
+
hasCaretGuard: true,
|
|
262
|
+
// A read-only toolbar of disabled controls stays one Tab stop.
|
|
263
|
+
tabStopOrder: toolbarTabStop,
|
|
264
|
+
});
|
|
258
265
|
|
|
259
266
|
const {
|
|
260
267
|
hintElement,
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file tooltipPresentInterest.ts
|
|
7
|
+
* @input createSharedContext
|
|
8
|
+
* @output Exports `TooltipPresentInterestContext` and its value types: the
|
|
9
|
+
* interaction on a tooltip's anchor that mounted the tooltip
|
|
10
|
+
* @position Internal to Core, not exported from the Tooltip entry. A
|
|
11
|
+
* truncated Text or Heading mounts its tooltip on the first hover, tap or
|
|
12
|
+
* focus, and provides that interaction here, so the tooltip answers it when
|
|
13
|
+
* its trigger attaches, as its own listeners would have.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import type {RefObject} from 'react';
|
|
17
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The interaction on the anchor that mounted the tooltip: a hover from a
|
|
21
|
+
* mouse or pen still over it, a completed tap, or focus inside it. `null`
|
|
22
|
+
* when there is none.
|
|
23
|
+
*/
|
|
24
|
+
export type TooltipPresentInterest = 'hover' | 'tap' | 'focus' | null;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Holds the interaction until the tooltip's trigger attaches. The tooltip
|
|
28
|
+
* reads it once and marks it read, so a later remount opens nothing by itself.
|
|
29
|
+
*/
|
|
30
|
+
export interface TooltipPresentInterestState {
|
|
31
|
+
interest: TooltipPresentInterest;
|
|
32
|
+
/** The `click` that completed the tap, for the touch trigger's rules. */
|
|
33
|
+
tapEvent: Event | null;
|
|
34
|
+
isRead: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const TooltipPresentInterestContext =
|
|
38
|
+
createSharedContext<RefObject<TooltipPresentInterestState> | null>(
|
|
39
|
+
'TooltipPresentInterestContext',
|
|
40
|
+
1,
|
|
41
|
+
null,
|
|
42
|
+
);
|
|
43
|
+
TooltipPresentInterestContext.displayName = 'TooltipPresentInterestContext';
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
|
+
use,
|
|
17
18
|
useCallback,
|
|
18
19
|
useEffect,
|
|
19
20
|
useRef,
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
type ReactNode,
|
|
22
23
|
type RefCallback,
|
|
23
24
|
} from 'react';
|
|
25
|
+
import {TooltipPresentInterestContext} from './tooltipPresentInterest';
|
|
24
26
|
import {createTriggerFocusGate, isFocusOnTrigger} from '../utils/triggerFocus';
|
|
25
27
|
import * as stylex from '@stylexjs/stylex';
|
|
26
28
|
import {
|
|
@@ -311,6 +313,8 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
311
313
|
const showTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
312
314
|
const hideTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
313
315
|
const triggerRef = useRef<HTMLElement | null>(null);
|
|
316
|
+
// Set only by a Core component that mounts the tooltip on interaction.
|
|
317
|
+
const presentInterest = use(TooltipPresentInterestContext);
|
|
314
318
|
// Whether the tooltip is enabled now, for a show that runs after a render
|
|
315
319
|
// (a pending hover show) and for the trigger ref callback.
|
|
316
320
|
const isEnabledRef = useRef(isEnabled);
|
|
@@ -394,6 +398,7 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
394
398
|
handlePointerDown: handleTouchPointerDown,
|
|
395
399
|
clearTapOpen,
|
|
396
400
|
armOutsideDismiss,
|
|
401
|
+
answerTap,
|
|
397
402
|
} = useTouchTriggerInternal(
|
|
398
403
|
{
|
|
399
404
|
touchTrigger,
|
|
@@ -683,6 +688,8 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
683
688
|
hideNow,
|
|
684
689
|
showNow,
|
|
685
690
|
opensOnFocus,
|
|
691
|
+
presentInterest,
|
|
692
|
+
answerTap,
|
|
686
693
|
});
|
|
687
694
|
handlersRef.current = {
|
|
688
695
|
handleMouseEnter,
|
|
@@ -698,6 +705,8 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
698
705
|
hideNow,
|
|
699
706
|
showNow,
|
|
700
707
|
opensOnFocus,
|
|
708
|
+
presentInterest,
|
|
709
|
+
answerTap,
|
|
701
710
|
};
|
|
702
711
|
|
|
703
712
|
// Removes the attached trigger's listeners (the trigger ref callback's
|
|
@@ -775,6 +784,30 @@ export function useTooltip(options: TooltipOptions = {}): TooltipReturn {
|
|
|
775
784
|
latest().showNow();
|
|
776
785
|
}
|
|
777
786
|
|
|
787
|
+
// This tooltip mounted after the interaction that wants it. It answers
|
|
788
|
+
// that interaction once, by the same rules as its listeners.
|
|
789
|
+
const state = latest().presentInterest?.current;
|
|
790
|
+
const interest = state == null || state.isRead ? null : state.interest;
|
|
791
|
+
const tapEvent = state?.tapEvent ?? null;
|
|
792
|
+
if (state != null) {
|
|
793
|
+
state.isRead = true;
|
|
794
|
+
}
|
|
795
|
+
if (isEnabledRef.current && latest().isOpen === undefined) {
|
|
796
|
+
if (interest === 'hover') {
|
|
797
|
+
latest().handleMouseEnter();
|
|
798
|
+
} else if (interest === 'tap') {
|
|
799
|
+
latest().answerTap(tapEvent);
|
|
800
|
+
} else if (
|
|
801
|
+
interest === 'focus' &&
|
|
802
|
+
latest().focusTrigger !== 'never' &&
|
|
803
|
+
focused instanceof HTMLElement &&
|
|
804
|
+
el.contains(focused) &&
|
|
805
|
+
latest().opensOnFocus(focused, el)
|
|
806
|
+
) {
|
|
807
|
+
latest().showNow();
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
|
|
778
811
|
const detach = () => {
|
|
779
812
|
if (detachTriggerRef.current === detach) {
|
|
780
813
|
detachTriggerRef.current = null;
|
|
@@ -10,11 +10,15 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import {use} from 'react';
|
|
13
|
-
import {createLayerScopedContext
|
|
13
|
+
import {createLayerScopedContext} from '../Layer/layerScopedContext';
|
|
14
14
|
|
|
15
15
|
export type TopNavSlot = 'start' | 'center' | 'end';
|
|
16
16
|
|
|
17
|
-
export const TopNavSlotContext =
|
|
17
|
+
export const TopNavSlotContext = createLayerScopedContext<TopNavSlot>(
|
|
18
|
+
'TopNavSlotContext',
|
|
19
|
+
1,
|
|
20
|
+
'start',
|
|
21
|
+
);
|
|
18
22
|
TopNavSlotContext.displayName = 'TopNavSlotContext';
|
|
19
23
|
|
|
20
24
|
export function useTopNavSlot(): TopNavSlot {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TopNavMobileContentContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, use
|
|
8
8
|
* @output Exports TopNavMobileContentContext and useTopNavMobileContent
|
|
9
9
|
* @position Internal context for passing additional drawer content to TopNav
|
|
10
10
|
*
|
|
@@ -13,9 +13,14 @@
|
|
|
13
13
|
* mobile drawer, producing a single combined drawer.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {use, type ReactNode} from 'react';
|
|
17
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
17
18
|
|
|
18
|
-
export const TopNavMobileContentContext =
|
|
19
|
+
export const TopNavMobileContentContext = createSharedContext<ReactNode>(
|
|
20
|
+
'TopNavMobileContentContext',
|
|
21
|
+
1,
|
|
22
|
+
null,
|
|
23
|
+
);
|
|
19
24
|
TopNavMobileContentContext.displayName = 'TopNavMobileContentContext';
|
|
20
25
|
|
|
21
26
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TopNavRenderContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, use
|
|
8
8
|
* @output Exports TopNavRenderContext and useTopNavRenderMode hook
|
|
9
9
|
* @position Internal context for controlling TopNav rendering mode
|
|
10
10
|
*
|
|
@@ -15,12 +15,16 @@
|
|
|
15
15
|
* - 'drawer': nav items as vertical list elements (mobile drawer)
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import {use} from 'react';
|
|
19
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
19
20
|
|
|
20
21
|
export type TopNavRenderMode = 'default' | 'mobile-bar' | 'drawer';
|
|
21
22
|
|
|
22
|
-
export const TopNavRenderContext =
|
|
23
|
-
|
|
23
|
+
export const TopNavRenderContext = createSharedContext<TopNavRenderMode>(
|
|
24
|
+
'TopNavRenderContext',
|
|
25
|
+
1,
|
|
26
|
+
'default',
|
|
27
|
+
);
|
|
24
28
|
TopNavRenderContext.displayName = 'TopNavRenderContext';
|
|
25
29
|
|
|
26
30
|
/**
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* @position Package-internal; not exported from the package entry point
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {use, useSyncExternalStore} from 'react';
|
|
13
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* How the base hands its busy state to a wrapper that owns the inline-end lane.
|
|
@@ -92,7 +93,11 @@ export function useIsBusy(lane: BusyIndicatorLane): boolean {
|
|
|
92
93
|
return useSyncExternalStore(lane.subscribe, lane.getIsBusy, lane.getIsBusy);
|
|
93
94
|
}
|
|
94
95
|
|
|
95
|
-
const BusyIndicatorLaneContext =
|
|
96
|
+
const BusyIndicatorLaneContext = createSharedContext<BusyIndicatorLane | null>(
|
|
97
|
+
'BusyIndicatorLaneContext',
|
|
98
|
+
1,
|
|
99
|
+
null,
|
|
100
|
+
);
|
|
96
101
|
BusyIndicatorLaneContext.displayName = 'BusyIndicatorLaneContext';
|
|
97
102
|
|
|
98
103
|
export const BusyIndicatorLaneProvider = BusyIndicatorLaneContext.Provider;
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* render does not change the key and reloads nothing.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import {use} from 'react';
|
|
19
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
19
20
|
|
|
20
21
|
export type CommittedChoices = {
|
|
21
22
|
/** Changes exactly when the committed values change. */
|
|
@@ -26,9 +27,9 @@ export type CommittedChoices = {
|
|
|
26
27
|
isAtLimit: boolean;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
|
-
export const CommittedChoicesKeyContext =
|
|
30
|
+
export const CommittedChoicesKeyContext = createSharedContext<
|
|
30
31
|
CommittedChoices | undefined
|
|
31
|
-
>(undefined);
|
|
32
|
+
>('CommittedChoicesKeyContext', 1, undefined);
|
|
32
33
|
CommittedChoicesKeyContext.displayName = 'CommittedChoicesKeyContext';
|
|
33
34
|
|
|
34
35
|
/** The caller's committed values, if a caller provides them. */
|
|
@@ -13,12 +13,17 @@
|
|
|
13
13
|
* navigation, selection, or token editing (family:input-fields FR10).
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import {use, type KeyboardEvent} from 'react';
|
|
17
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
17
18
|
|
|
18
19
|
export type TrailingKeyDown =
|
|
19
20
|
((event: KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
20
21
|
|
|
21
|
-
export const TrailingKeyDownContext =
|
|
22
|
+
export const TrailingKeyDownContext = createSharedContext<TrailingKeyDown>(
|
|
23
|
+
'TrailingKeyDownContext',
|
|
24
|
+
1,
|
|
25
|
+
undefined,
|
|
26
|
+
);
|
|
22
27
|
TrailingKeyDownContext.displayName = 'TrailingKeyDownContext';
|
|
23
28
|
|
|
24
29
|
/** The consumer key handler BaseTypeahead runs after its own, if any. */
|
|
@@ -513,6 +513,11 @@ export class GestureArena {
|
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
515
|
|
|
516
|
+
/** @internal A recognizer takes its touches from the view, unclaimed. */
|
|
517
|
+
cancelTouchesInViewOf(recognizer: GestureRecognizer): void {
|
|
518
|
+
this.cancelViewTouchesOf(recognizer);
|
|
519
|
+
}
|
|
520
|
+
|
|
516
521
|
/**
|
|
517
522
|
* Runs `body`, code outside input that stops recognizers (an Effect that
|
|
518
523
|
* turns one off or detaches it), without resolving what those stops
|
|
@@ -629,7 +634,9 @@ export class GestureArena {
|
|
|
629
634
|
}
|
|
630
635
|
this.claim(recognizer);
|
|
631
636
|
// A watcher takes nothing from the view either: the press and the click
|
|
632
|
-
// under it stay (spec:AST-094 FR11, FR19; FR15 exempts watchers).
|
|
637
|
+
// under it stay (spec:AST-094 FR11, FR19; FR15 exempts watchers). Only
|
|
638
|
+
// `cancelTouchesInView` takes them, as a pager's catch on a release's settle
|
|
639
|
+
// does.
|
|
633
640
|
if (recognizer.claimsTouches && recognizer.cancelsTouchesInView) {
|
|
634
641
|
this.cancelViewTouchesOf(recognizer);
|
|
635
642
|
}
|
|
@@ -559,6 +559,15 @@ export abstract class GestureRecognizer {
|
|
|
559
559
|
return this.arena?.now() ?? 0;
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
+
/**
|
|
563
|
+
* Takes this recognizer's touches from the view, as a claiming winner does
|
|
564
|
+
* under `cancelsTouchesInView`: the view's press ends and no click follows.
|
|
565
|
+
* The touches stay unclaimed, so the page still scrolls.
|
|
566
|
+
*/
|
|
567
|
+
protected cancelTouchesInView(): void {
|
|
568
|
+
this.arena?.cancelTouchesInViewOf(this);
|
|
569
|
+
}
|
|
570
|
+
|
|
562
571
|
// --- Arena hooks (internal) ----------------------------------------------
|
|
563
572
|
|
|
564
573
|
/** @internal Whether this recognizer takes `touch` right now. */
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* UIControl semantics, event for event:
|
|
15
15
|
*
|
|
16
16
|
* - `touchDown` when the finger lands; the highlight comes on in the same
|
|
17
|
-
* frame, unless the control sits in a scroller
|
|
18
|
-
* `contentTouchDelay` (UIScrollView.delaysContentTouches)
|
|
19
|
-
* paints nothing.
|
|
17
|
+
* frame, unless the control sits in a scroller. There it waits
|
|
18
|
+
* `contentTouchDelay` (UIScrollView.delaysContentTouches) from the touch's
|
|
19
|
+
* own time, so a flick paints nothing.
|
|
20
20
|
* - `touchDragInside` / `touchDragOutside` on every move, `touchDragExit` /
|
|
21
21
|
* `touchDragEnter` when the finger crosses the control's bounds EXPANDED
|
|
22
22
|
* by `trackingExpansion` (a fingertip dragged a little off a button is
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
import {UIKIT_CONTROL, UIKIT_PAN, UIKIT_PRESS} from '../motion/uikit/gestures';
|
|
50
50
|
// Importing the whole table bundles its curves into each press-tracking control.
|
|
51
51
|
import {press as pressClocks} from '../motion/uikit/timing';
|
|
52
|
+
import {msSinceInput} from '../utils/inputAge';
|
|
52
53
|
import {travel} from './geometry';
|
|
53
54
|
import type {GestureRecognizer, SelectionLock} from './GestureRecognizer';
|
|
54
55
|
import type {TapGestureRecognizer} from './TapGestureRecognizer';
|
|
@@ -345,12 +346,20 @@ export function createPressTracker(options: PressTrackerOptions): PressTracker {
|
|
|
345
346
|
(delay === 'always' ||
|
|
346
347
|
(delay === 'inScrollers' && touch.scroll?.isInsideScroller === true));
|
|
347
348
|
if (delays) {
|
|
349
|
+
// The delay counts from the touch, so the time a busy main thread
|
|
350
|
+
// took to deliver it comes off the wait. The touch's time is on the
|
|
351
|
+
// clock of its own window, which can be an iframe's.
|
|
352
|
+
const wait = Math.max(
|
|
353
|
+
0,
|
|
354
|
+
PRESS.contentTouchDelay.value -
|
|
355
|
+
msSinceInput(touch.time, touch.target),
|
|
356
|
+
);
|
|
348
357
|
highlightTimer = setTimeout(() => {
|
|
349
358
|
highlightTimer = null;
|
|
350
359
|
if (state.isTouchInside) {
|
|
351
360
|
setHighlighted(true);
|
|
352
361
|
}
|
|
353
|
-
},
|
|
362
|
+
}, wait);
|
|
354
363
|
} else {
|
|
355
364
|
setHighlighted(true);
|
|
356
365
|
}
|