@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @file focusableSelector.ts
|
|
5
5
|
* @input None (a plain CSS selector string constant)
|
|
6
|
-
* @output Exports FOCUSABLE_SELECTOR
|
|
6
|
+
* @output Exports FOCUSABLE_SELECTOR, isDisabledWithin and preferTabStops
|
|
7
7
|
* @position Internal utility; the canonical CSS selector for focusable
|
|
8
8
|
* elements, shared by focus-management hooks (e.g. useFocusTrap) so the
|
|
9
9
|
* selector isn't duplicated across components/hooks. Not exported from the
|
|
@@ -23,3 +23,31 @@
|
|
|
23
23
|
*/
|
|
24
24
|
export const FOCUSABLE_SELECTOR =
|
|
25
25
|
'button:not([disabled]), a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [contenteditable]:not([contenteditable="false"]), audio[controls], video[controls], iframe, details > summary:first-child';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether `element` is disabled inside `container`: it, or an ancestor up to
|
|
29
|
+
* `container`, has `aria-disabled="true"`. Popover skips such an element when
|
|
30
|
+
* it picks initial focus. Tab still reaches it.
|
|
31
|
+
*/
|
|
32
|
+
export function isDisabledWithin(
|
|
33
|
+
element: Element,
|
|
34
|
+
container: Element,
|
|
35
|
+
): boolean {
|
|
36
|
+
const disabled = element.closest('[aria-disabled="true"]');
|
|
37
|
+
return disabled != null && container.contains(disabled);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* `elements` with tab stops first, each group in document order. Inside a
|
|
42
|
+
* composite widget with a roving tab stop (a grid, a toolbar), the member
|
|
43
|
+
* that holds `tabindex="0"` comes before the members that hold `-1`.
|
|
44
|
+
*/
|
|
45
|
+
export function preferTabStops<T extends Element>(
|
|
46
|
+
elements: ReadonlyArray<T>,
|
|
47
|
+
): T[] {
|
|
48
|
+
const isTabStop = (element: T) => element.getAttribute('tabindex') !== '-1';
|
|
49
|
+
return [
|
|
50
|
+
...elements.filter(isTabStop),
|
|
51
|
+
...elements.filter(element => !isTabStop(element)),
|
|
52
|
+
];
|
|
53
|
+
}
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
LONG_PRESS_ALLOWABLE_MOVEMENT_PX,
|
|
17
17
|
LONG_PRESS_DURATION_MS,
|
|
18
18
|
} from '../motion/uikit/longPress';
|
|
19
|
+
import {clockOf, timeOn, type EventClock} from '../utils/inputAge';
|
|
19
20
|
import {claimPress} from '../utils/pressClaim';
|
|
20
21
|
|
|
21
22
|
// The hold is a deadline on the touch events' timestamps, on the clock of the
|
|
@@ -90,41 +91,6 @@ export interface LongPressDetector {
|
|
|
90
91
|
setOptions: (options: LongPressDetectorOptions) => void;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
/** The part of a window's performance timeline a press reads. */
|
|
94
|
-
type EventClock = Pick<Performance, 'now'>;
|
|
95
|
-
|
|
96
|
-
function clockOf(event: LongPressTouchEvent): EventClock | null {
|
|
97
|
-
const view = event.view as {performance?: EventClock} | null | undefined;
|
|
98
|
-
return (
|
|
99
|
-
view?.performance ??
|
|
100
|
-
(typeof performance === 'undefined' ? null : performance)
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* An event's time on its window's clock. jsdom stamps events with
|
|
106
|
-
* `Date.now()`. The detector reads the age of such a stamp on that clock, so a
|
|
107
|
-
* frozen system time keeps the hold's length. A stamp nearer `Date.now()` than
|
|
108
|
-
* the window's clock is that kind of stamp.
|
|
109
|
-
*/
|
|
110
|
-
function timeOn(
|
|
111
|
-
clock: EventClock | null,
|
|
112
|
-
timeStamp: number | undefined,
|
|
113
|
-
): number | undefined {
|
|
114
|
-
// A stamp of 0 means the event carries no time, so the hold falls back to
|
|
115
|
-
// the full delay on the page's timer.
|
|
116
|
-
if (timeStamp == null || !Number.isFinite(timeStamp) || timeStamp <= 0) {
|
|
117
|
-
return undefined;
|
|
118
|
-
}
|
|
119
|
-
if (
|
|
120
|
-
clock != null &&
|
|
121
|
-
Math.abs(Date.now() - timeStamp) < Math.abs(clock.now() - timeStamp)
|
|
122
|
-
) {
|
|
123
|
-
return clock.now() - (Date.now() - timeStamp);
|
|
124
|
-
}
|
|
125
|
-
return timeStamp;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
94
|
/** @internal A long-press detector with no React (see LongPressDetector). */
|
|
129
95
|
export function createLongPressDetector(
|
|
130
96
|
initial: LongPressDetectorOptions,
|
|
@@ -26,5 +26,9 @@ export {pressGroupItemProps} from '../privateAttributes/pressGroupItem.stylex';
|
|
|
26
26
|
* `:active` paint, so one press never lights two.
|
|
27
27
|
*/
|
|
28
28
|
export const PressGroupContext =
|
|
29
|
-
createLayerScopedContext<ReadonlyArray<string> | null>(
|
|
29
|
+
createLayerScopedContext<ReadonlyArray<string> | null>(
|
|
30
|
+
'PressGroupContext',
|
|
31
|
+
1,
|
|
32
|
+
null,
|
|
33
|
+
);
|
|
30
34
|
PressGroupContext.displayName = 'PressGroupContext';
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* @position Internal hook, not exported from the hooks entry. A long press
|
|
13
13
|
* drives the shared action-group tracker (hooks/actionGroupTracker.ts) for
|
|
14
14
|
* a group that a held pointer slides across. AlertDialog and
|
|
15
|
-
* useGroupPressTracking consume it
|
|
15
|
+
* useGroupPressTracking consume it, and Lab components through the internal
|
|
16
|
+
* touch entry.
|
|
16
17
|
*
|
|
17
18
|
* SYNC: When modified, update useActionGroupTracking.test.tsx
|
|
18
19
|
*/
|
|
@@ -71,6 +72,22 @@ export interface ActionGroupTrackingOptions {
|
|
|
71
72
|
manageStyle?: boolean;
|
|
72
73
|
/** Runs the action under the finger at the lift. @default its own click */
|
|
73
74
|
onActivate?: (item: HTMLElement) => void;
|
|
75
|
+
/**
|
|
76
|
+
* Paint the tracked action with the press attribute. Off, the group draws
|
|
77
|
+
* its own highlight. @default true
|
|
78
|
+
*/
|
|
79
|
+
paintsHighlight?: boolean;
|
|
80
|
+
/** A press began at viewport (x, y) on `action` (null: none). */
|
|
81
|
+
onPressBegin?: (x: number, y: number, action: HTMLElement | null) => void;
|
|
82
|
+
/** The press moved to viewport (x, y), now on `action` (null: none). */
|
|
83
|
+
onPressMove?: (x: number, y: number, action: HTMLElement | null) => void;
|
|
84
|
+
/** The lift, before its action runs, with the tracked action (null: none). */
|
|
85
|
+
onPressEnd?: (action: HTMLElement | null) => void;
|
|
86
|
+
/**
|
|
87
|
+
* The press ended with nothing acting: a cancel, a second finger, or
|
|
88
|
+
* tracking turned off.
|
|
89
|
+
*/
|
|
90
|
+
onPressCancel?: () => void;
|
|
74
91
|
}
|
|
75
92
|
|
|
76
93
|
const PRESS = UIKIT_PRESS;
|
|
@@ -185,6 +202,7 @@ export function useActionGroupTracking(
|
|
|
185
202
|
optionsRef.current.resolveTarget,
|
|
186
203
|
neighboursRef.current,
|
|
187
204
|
),
|
|
205
|
+
paintsHighlight: optionsRef.current.paintsHighlight,
|
|
188
206
|
onActivate: optionsRef.current.onActivate,
|
|
189
207
|
// The browser's own click for a press the group ran is taken, so the
|
|
190
208
|
// action runs once. The gesture host swallows it for a press it claims.
|
|
@@ -196,11 +214,16 @@ export function useActionGroupTracking(
|
|
|
196
214
|
// Synchronizes the tracker with tracking on and mounted. Turning tracking
|
|
197
215
|
// off, or unmounting, drops a tracked press and ends its release fades.
|
|
198
216
|
// The host reports no cancellation to a disabled recognizer, and the lift
|
|
199
|
-
// that runs an action often closes the owner before its fade ends.
|
|
217
|
+
// that runs an action often closes the owner before its fade ends. The
|
|
218
|
+
// group hears the dropped press as a cancel, so its own highlight goes out.
|
|
200
219
|
useEffect(
|
|
201
220
|
() => () => {
|
|
221
|
+
const wasTracking = tracker.isTracking;
|
|
202
222
|
tracker.cancel();
|
|
203
223
|
tracker.dispose();
|
|
224
|
+
if (wasTracking) {
|
|
225
|
+
optionsRef.current.onPressCancel?.();
|
|
226
|
+
}
|
|
204
227
|
},
|
|
205
228
|
[tracker, isEnabled],
|
|
206
229
|
);
|
|
@@ -238,14 +261,17 @@ export function useActionGroupTracking(
|
|
|
238
261
|
? measureNeighbours(ref.current, optionsRef.current)
|
|
239
262
|
: NO_TARGETS;
|
|
240
263
|
tracker.begin(x, y, {landed: landedRef.current});
|
|
264
|
+
optionsRef.current.onPressBegin?.(x, y, tracker.highlighted);
|
|
241
265
|
break;
|
|
242
266
|
}
|
|
243
267
|
case 'changed': {
|
|
244
268
|
const {x, y} = recognizer.location();
|
|
245
269
|
tracker.move(x, y);
|
|
270
|
+
optionsRef.current.onPressMove?.(x, y, tracker.highlighted);
|
|
246
271
|
break;
|
|
247
272
|
}
|
|
248
273
|
case 'ended': {
|
|
274
|
+
optionsRef.current.onPressEnd?.(tracker.highlighted);
|
|
249
275
|
const doc = ref.current?.ownerDocument;
|
|
250
276
|
const focusedBefore = doc?.activeElement ?? null;
|
|
251
277
|
const beganOn = tracker.beganOn;
|
|
@@ -278,6 +304,7 @@ export function useActionGroupTracking(
|
|
|
278
304
|
case 'cancelled':
|
|
279
305
|
neighboursRef.current = NO_TARGETS;
|
|
280
306
|
tracker.cancel();
|
|
307
|
+
optionsRef.current.onPressCancel?.();
|
|
281
308
|
break;
|
|
282
309
|
case 'possible':
|
|
283
310
|
case 'failed':
|
package/src/hooks/useAnnounce.ts
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* - /packages/core/src/hooks/index.ts
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import {use, useCallback, useRef, type RefObject} from 'react';
|
|
19
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Announcement urgency:
|
|
@@ -358,9 +359,12 @@ export interface ModalAnnounceScope {
|
|
|
358
359
|
parent: ModalAnnounceScope | null;
|
|
359
360
|
}
|
|
360
361
|
|
|
361
|
-
export const ModalAnnounceContext =
|
|
362
|
-
null
|
|
363
|
-
|
|
362
|
+
export const ModalAnnounceContext =
|
|
363
|
+
createSharedContext<ModalAnnounceScope | null>(
|
|
364
|
+
'ModalAnnounceContext',
|
|
365
|
+
1,
|
|
366
|
+
null,
|
|
367
|
+
);
|
|
364
368
|
ModalAnnounceContext.displayName = 'ModalAnnounceContext';
|
|
365
369
|
|
|
366
370
|
/** The modal route `modalAnnounce.ts` installs when a provider loads it. */
|
|
@@ -132,6 +132,61 @@ export function getFocusableElements(container: HTMLElement): HTMLElement[] {
|
|
|
132
132
|
).filter(isVisiblyFocusable);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/**
|
|
136
|
+
* The name of a named native radio, or null for any other element and for an
|
|
137
|
+
* unnamed radio, which is its own Tab stop.
|
|
138
|
+
*/
|
|
139
|
+
function radioNameOf(el: Element): string | null {
|
|
140
|
+
if (!el.matches('input[type="radio"][name]')) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return (el as HTMLInputElement).name || null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Whether two radios are one group: the same name and the same form owner (or
|
|
148
|
+
* both with no form).
|
|
149
|
+
*/
|
|
150
|
+
function isSameRadioGroup(a: Element, b: Element): boolean {
|
|
151
|
+
const name = radioNameOf(a);
|
|
152
|
+
return (
|
|
153
|
+
name != null &&
|
|
154
|
+
name === radioNameOf(b) &&
|
|
155
|
+
(a as HTMLInputElement).form === (b as HTMLInputElement).form
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Drop the radios the browser skips for Tab, leaving every other element, and
|
|
161
|
+
* each kept radio, at its own place. In a named group the browser stops only at
|
|
162
|
+
* the focused radio, else the checked one; a group with nothing checked keeps
|
|
163
|
+
* every radio, so a forward entry reaches its first and a backward entry its
|
|
164
|
+
* last.
|
|
165
|
+
*
|
|
166
|
+
* Exported for menus that walk their own Tab stops (DropdownMenu's header and
|
|
167
|
+
* footer), so they skip radios exactly as the focus region does.
|
|
168
|
+
*/
|
|
169
|
+
export function collapseRadioGroups(
|
|
170
|
+
elements: HTMLElement[],
|
|
171
|
+
active: Element | null,
|
|
172
|
+
): HTMLElement[] {
|
|
173
|
+
return elements.filter(el => {
|
|
174
|
+
if (radioNameOf(el) == null) {
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
if (active != null && isSameRadioGroup(el, active)) {
|
|
178
|
+
return el === active;
|
|
179
|
+
}
|
|
180
|
+
return (
|
|
181
|
+
(el as HTMLInputElement).checked ||
|
|
182
|
+
!elements.some(
|
|
183
|
+
other =>
|
|
184
|
+
isSameRadioGroup(el, other) && (other as HTMLInputElement).checked,
|
|
185
|
+
)
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
135
190
|
/**
|
|
136
191
|
* The document a trap lives in: its container's. An app that renders into a
|
|
137
192
|
* same-origin iframe or a Document Picture-in-Picture window through a portal
|
|
@@ -376,8 +431,13 @@ export function useFocusRegionContainment(
|
|
|
376
431
|
return;
|
|
377
432
|
}
|
|
378
433
|
|
|
379
|
-
|
|
380
|
-
const
|
|
434
|
+
// jsdom groups a selector list by selector, not in document order.
|
|
435
|
+
const stops = collapseRadioGroups(
|
|
436
|
+
[...focusable].sort((a, b) => (precedes(a, b) ? -1 : 1)),
|
|
437
|
+
active,
|
|
438
|
+
);
|
|
439
|
+
const first = stops[0];
|
|
440
|
+
const last = stops[stops.length - 1];
|
|
381
441
|
|
|
382
442
|
if (doc.activeElement === container) {
|
|
383
443
|
// Programmatic initial focus can sit on the trap container itself
|
|
@@ -355,6 +355,39 @@ export function useListFocus<T extends HTMLElement = HTMLElement>(
|
|
|
355
355
|
return useInternalListFocus<T>(options);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
+
function isDisabledItem(el: HTMLElement): boolean {
|
|
359
|
+
return (
|
|
360
|
+
el.getAttribute('aria-disabled') === 'true' ||
|
|
361
|
+
(el as HTMLButtonElement).disabled === true ||
|
|
362
|
+
el.hasAttribute('disabled')
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* A `tabStopOrder` for a group whose disabled items stay focusable, such as a
|
|
368
|
+
* row of disabled Buttons. The group keeps one Tab stop while every item is
|
|
369
|
+
* disabled: the item that holds the stop, else the first enabled item, else
|
|
370
|
+
* the first item. With an enabled item it places the stop as the default does.
|
|
371
|
+
*/
|
|
372
|
+
export function oneTabStopAmong(
|
|
373
|
+
itemSelector: string,
|
|
374
|
+
boundarySelector: string,
|
|
375
|
+
): (list: HTMLElement) => HTMLElement[] {
|
|
376
|
+
return list => {
|
|
377
|
+
const items = Array.from(
|
|
378
|
+
list.querySelectorAll<HTMLElement>(itemSelector),
|
|
379
|
+
).filter(
|
|
380
|
+
el => !isHiddenWithin(el, list) && el.closest(boundarySelector) === list,
|
|
381
|
+
);
|
|
382
|
+
const enabled = items.filter(el => !isDisabledItem(el));
|
|
383
|
+
const candidates = enabled.length > 0 ? enabled : items;
|
|
384
|
+
const stop =
|
|
385
|
+
candidates.find(el => el.getAttribute('tabindex') === '0') ??
|
|
386
|
+
candidates[0];
|
|
387
|
+
return stop == null ? items : [stop, ...items.filter(el => el !== stop)];
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
|
|
358
391
|
/**
|
|
359
392
|
* {@link useListFocus} with the Core-only {@link InternalListFocusOptions}.
|
|
360
393
|
* Not re-exported from `hooks/index.ts`.
|
|
@@ -383,13 +416,7 @@ export function useInternalListFocus<T extends HTMLElement = HTMLElement>(
|
|
|
383
416
|
* A `.focus()` call on such an element silently no-ops, so navigation must
|
|
384
417
|
* skip these to avoid freezing on a disabled item (menus-4, navigation-5).
|
|
385
418
|
*/
|
|
386
|
-
const isItemDisabled =
|
|
387
|
-
return (
|
|
388
|
-
el.getAttribute('aria-disabled') === 'true' ||
|
|
389
|
-
(el as HTMLButtonElement).disabled === true ||
|
|
390
|
-
el.hasAttribute('disabled')
|
|
391
|
-
);
|
|
392
|
-
}, []);
|
|
419
|
+
const isItemDisabled = isDisabledItem;
|
|
393
420
|
|
|
394
421
|
/**
|
|
395
422
|
* Get all focusable items in the list.
|
package/src/hooks/usePager.ts
CHANGED
|
@@ -412,6 +412,14 @@ class SettleCatcher extends LongPressGestureRecognizer {
|
|
|
412
412
|
this.clearTimer();
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
+
/**
|
|
416
|
+
* Takes the touch from the content under it: no press and no click. In
|
|
417
|
+
* UIKit, the touch that stops a scroll view never reaches its content.
|
|
418
|
+
*/
|
|
419
|
+
takeFromContent(): void {
|
|
420
|
+
this.cancelTouchesInView();
|
|
421
|
+
}
|
|
422
|
+
|
|
415
423
|
protected override touchesBegan(
|
|
416
424
|
touches: ReadonlyArray<GestureTouch>,
|
|
417
425
|
event: GestureEventContext,
|
|
@@ -650,6 +658,8 @@ export function createPager(
|
|
|
650
658
|
let settled = target;
|
|
651
659
|
let settleHandle: MotionHandle | null = null;
|
|
652
660
|
let isSwipeSettle = false;
|
|
661
|
+
// Whether the running settle follows a release, not the program's `goTo`.
|
|
662
|
+
let isReleaseSettle = false;
|
|
653
663
|
let settleToken = 0;
|
|
654
664
|
let isDragging = false;
|
|
655
665
|
|
|
@@ -721,6 +731,7 @@ export function createPager(
|
|
|
721
731
|
clearCatchTimer();
|
|
722
732
|
flushReport();
|
|
723
733
|
isSwipeSettle = false;
|
|
734
|
+
isReleaseSettle = false;
|
|
724
735
|
if (settleHandle != null) {
|
|
725
736
|
settleToken += 1;
|
|
726
737
|
settleHandle = null;
|
|
@@ -874,10 +885,16 @@ export function createPager(
|
|
|
874
885
|
* travel. A settle that a touch's release starts (`touchRelease`)
|
|
875
886
|
* cross-fades on any pointer. Any other motion, such as `goTo` or a mouse's
|
|
876
887
|
* or a pen's release, cross-fades on a coarse pointer. It lands at once on
|
|
877
|
-
* any other pointer.
|
|
888
|
+
* any other pointer. `isRelease` marks a release's settle, which a finger
|
|
889
|
+
* that catches it takes from the content.
|
|
878
890
|
*/
|
|
879
|
-
function play(
|
|
891
|
+
function play(
|
|
892
|
+
curve: MotionCurve,
|
|
893
|
+
touchRelease = false,
|
|
894
|
+
isRelease = false,
|
|
895
|
+
): void {
|
|
880
896
|
isSwipeSettle = false;
|
|
897
|
+
isReleaseSettle = isRelease;
|
|
881
898
|
if (animator == null) {
|
|
882
899
|
return;
|
|
883
900
|
}
|
|
@@ -925,7 +942,7 @@ export function createPager(
|
|
|
925
942
|
rest();
|
|
926
943
|
return;
|
|
927
944
|
}
|
|
928
|
-
play(curve, touchRelease);
|
|
945
|
+
play(curve, touchRelease, true);
|
|
929
946
|
}
|
|
930
947
|
|
|
931
948
|
function measure(): void {
|
|
@@ -941,7 +958,13 @@ export function createPager(
|
|
|
941
958
|
if (isChildPages()) {
|
|
942
959
|
const offsets = measureChildOffsets();
|
|
943
960
|
if (!sameOffsets(offsets, childOffsets)) {
|
|
961
|
+
// A drag's release moves at most one page from where the drag began.
|
|
962
|
+
// New pages renumber, so the drag keeps the page nearest that offset.
|
|
963
|
+
const dragFrom = isDragging ? offsetOf(dragStartIndex) : null;
|
|
944
964
|
childOffsets = offsets;
|
|
965
|
+
if (dragFrom != null) {
|
|
966
|
+
dragStartIndex = nearestPage(dragFrom);
|
|
967
|
+
}
|
|
945
968
|
changed = true;
|
|
946
969
|
const pageCount = offsets.length;
|
|
947
970
|
deliver(() => options.onPagesChange?.(pageCount));
|
|
@@ -1088,6 +1111,10 @@ export function createPager(
|
|
|
1088
1111
|
function onCatch(recognizer: LongPressGestureRecognizer): void {
|
|
1089
1112
|
if (recognizer.state === 'began') {
|
|
1090
1113
|
holdSelection(true);
|
|
1114
|
+
// A mouse keeps its click. A finger or a pen loses it.
|
|
1115
|
+
if (isReleaseSettle && catcher.pointerType !== 'mouse') {
|
|
1116
|
+
catcher.takeFromContent();
|
|
1117
|
+
}
|
|
1091
1118
|
clearCatchTimer();
|
|
1092
1119
|
caughtSettle = false;
|
|
1093
1120
|
isCatchTimerArmed = true;
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file useScrollOverflow.ts
|
|
7
7
|
* @input React refs, state and effects
|
|
8
|
-
* @output useScrollOverflow, which tracks the overflow at the scroll edges
|
|
8
|
+
* @output useScrollOverflow, which tracks the overflow at the scroll edges,
|
|
9
|
+
* and the internal useShownScrollOverflow, which can also measure from a
|
|
10
|
+
* position its caller reports
|
|
9
11
|
* @position Core hook; used by Carousel and TabList for fade-edge and button
|
|
10
12
|
* state
|
|
11
13
|
*
|
|
@@ -16,6 +18,15 @@
|
|
|
16
18
|
import {useState, useCallback, useEffect, useRef} from 'react';
|
|
17
19
|
import {observeResize} from '../utils/sharedResizeObserver';
|
|
18
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Where the content is shown while something other than scrolling moves it:
|
|
23
|
+
* its offset toward the end, and how far it travels.
|
|
24
|
+
*/
|
|
25
|
+
export interface ShownPosition {
|
|
26
|
+
readonly offset: number;
|
|
27
|
+
readonly travel: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
export interface ScrollOverflowState {
|
|
20
31
|
/** Content overflows the start (left in LTR, right in RTL) */
|
|
21
32
|
overflowStart: boolean;
|
|
@@ -97,8 +108,23 @@ function observeContent(el: HTMLElement, measure: () => void): () => void {
|
|
|
97
108
|
* ```
|
|
98
109
|
*/
|
|
99
110
|
export function useScrollOverflow() {
|
|
111
|
+
const {scrollRef, overflowStart, overflowEnd, hasOverflow} =
|
|
112
|
+
useShownScrollOverflow();
|
|
113
|
+
return {scrollRef, overflowStart, overflowEnd, hasOverflow};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* `useScrollOverflow`, plus `followShown`: while snap paging holds a row, its
|
|
118
|
+
* scroll offset stays where the hold began and its items move. The caller
|
|
119
|
+
* reports where the row is shown, and the edges follow it. Null measures the
|
|
120
|
+
* scroll offset again from the next frame, when the handed-back offset is
|
|
121
|
+
* current. Internal: not exported from the hooks entry.
|
|
122
|
+
*/
|
|
123
|
+
export function useShownScrollOverflow() {
|
|
100
124
|
const elRef = useRef<HTMLElement | null>(null);
|
|
101
125
|
const unobserveRef = useRef<(() => void) | null>(null);
|
|
126
|
+
const shownRef = useRef<ShownPosition | null>(null);
|
|
127
|
+
const releaseFrameRef = useRef(0);
|
|
102
128
|
|
|
103
129
|
const [state, setState] = useState<ScrollOverflowState>({
|
|
104
130
|
overflowStart: false,
|
|
@@ -108,12 +134,13 @@ export function useScrollOverflow() {
|
|
|
108
134
|
|
|
109
135
|
const measureNow = useCallback((el: HTMLElement) => {
|
|
110
136
|
const tolerance = 1;
|
|
111
|
-
const
|
|
112
|
-
const
|
|
137
|
+
const shown = shownRef.current;
|
|
138
|
+
const offset = shown?.offset ?? Math.abs(el.scrollLeft);
|
|
139
|
+
const maxScroll = shown?.travel ?? el.scrollWidth - el.clientWidth;
|
|
113
140
|
|
|
114
|
-
const overflowStart =
|
|
115
|
-
const overflowEnd =
|
|
116
|
-
const hasOverflow =
|
|
141
|
+
const overflowStart = offset > tolerance;
|
|
142
|
+
const overflowEnd = offset < maxScroll - tolerance;
|
|
143
|
+
const hasOverflow = maxScroll > tolerance;
|
|
117
144
|
|
|
118
145
|
setState(prev => {
|
|
119
146
|
if (
|
|
@@ -133,7 +160,9 @@ export function useScrollOverflow() {
|
|
|
133
160
|
// again.
|
|
134
161
|
const measure = useCallback(() => {
|
|
135
162
|
const el = elRef.current;
|
|
136
|
-
|
|
163
|
+
// A held row's edges come from where it is shown, which reads no layout.
|
|
164
|
+
// So the paging's own style writes force no layout here.
|
|
165
|
+
if (el && (shownRef.current != null || isRendered(el))) {
|
|
137
166
|
measureNow(el);
|
|
138
167
|
}
|
|
139
168
|
}, [measureNow]);
|
|
@@ -148,12 +177,39 @@ export function useScrollOverflow() {
|
|
|
148
177
|
}
|
|
149
178
|
}, [measureNow]);
|
|
150
179
|
|
|
180
|
+
const followShown = useCallback(
|
|
181
|
+
(shown: ShownPosition | null) => {
|
|
182
|
+
cancelAnimationFrame(releaseFrameRef.current);
|
|
183
|
+
const el = elRef.current;
|
|
184
|
+
if (shown != null) {
|
|
185
|
+
shownRef.current = shown;
|
|
186
|
+
if (el) {
|
|
187
|
+
measureNow(el);
|
|
188
|
+
}
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (shownRef.current == null || el == null) {
|
|
192
|
+
shownRef.current = null;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
// Keep the reported edges until the next frame, when the scroll offset
|
|
196
|
+
// is current. Otherwise an edge flickers.
|
|
197
|
+
releaseFrameRef.current = requestAnimationFrame(() => {
|
|
198
|
+
shownRef.current = null;
|
|
199
|
+
measure();
|
|
200
|
+
});
|
|
201
|
+
},
|
|
202
|
+
[measure, measureNow],
|
|
203
|
+
);
|
|
204
|
+
|
|
151
205
|
const scrollRef = useCallback(
|
|
152
206
|
(el: HTMLElement | null) => {
|
|
153
207
|
if (elRef.current) {
|
|
154
208
|
unobserveRef.current?.();
|
|
155
209
|
unobserveRef.current = null;
|
|
156
210
|
elRef.current.removeEventListener('scroll', measureOnScroll);
|
|
211
|
+
cancelAnimationFrame(releaseFrameRef.current);
|
|
212
|
+
shownRef.current = null;
|
|
157
213
|
}
|
|
158
214
|
|
|
159
215
|
elRef.current = el;
|
|
@@ -168,6 +224,7 @@ export function useScrollOverflow() {
|
|
|
168
224
|
|
|
169
225
|
useEffect(() => {
|
|
170
226
|
return () => {
|
|
227
|
+
cancelAnimationFrame(releaseFrameRef.current);
|
|
171
228
|
if (elRef.current) {
|
|
172
229
|
unobserveRef.current?.();
|
|
173
230
|
unobserveRef.current = null;
|
|
@@ -178,6 +235,7 @@ export function useScrollOverflow() {
|
|
|
178
235
|
|
|
179
236
|
return {
|
|
180
237
|
scrollRef,
|
|
238
|
+
followShown,
|
|
181
239
|
...state,
|
|
182
240
|
};
|
|
183
241
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file InternationalizationContext.ts
|
|
7
|
-
* @input
|
|
7
|
+
* @input createSharedContext, i18n types
|
|
8
8
|
* @output Exports InternationalizationContext and InternationalizationContextValue
|
|
9
9
|
* @position Context definition for client-side locale + messages
|
|
10
10
|
*
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
* - /packages/core/src/i18n/index.ts
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
-
import {createContext} from 'react';
|
|
26
25
|
import {getResolve} from './resolve';
|
|
27
26
|
import type {Locale, MessagesByLocale, Overrides} from './types';
|
|
28
27
|
import type {CalendarSystem} from '../utils/calendarSystem';
|
|
28
|
+
import {createSharedContext} from '../utils/sharedContext';
|
|
29
29
|
|
|
30
30
|
export interface InternationalizationContextValue {
|
|
31
31
|
locale: Locale;
|
|
@@ -45,10 +45,14 @@ export interface InternationalizationContextValue {
|
|
|
45
45
|
* A consumer that doesn't render a provider still gets English defaults.
|
|
46
46
|
*/
|
|
47
47
|
export const InternationalizationContext =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
createSharedContext<InternationalizationContextValue>(
|
|
49
|
+
'InternationalizationContext',
|
|
50
|
+
1,
|
|
51
|
+
{
|
|
52
|
+
locale: 'en',
|
|
53
|
+
direction: 'ltr',
|
|
54
|
+
messages: {},
|
|
55
|
+
translate: getResolve('en', {}),
|
|
56
|
+
},
|
|
57
|
+
);
|
|
54
58
|
InternationalizationContext.displayName = 'InternationalizationContext';
|
|
@@ -28,8 +28,14 @@
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
import type {RuntimeCatalog} from './types';
|
|
31
|
+
import {realmValue, sharedKey} from '../utils/sharedRealm';
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
// Every copy of Core registers into one map, so a context that one copy
|
|
34
|
+
// created resolves the English of another copy's components.
|
|
35
|
+
const registered = realmValue(
|
|
36
|
+
sharedKey('i18n/english-fallback', 1),
|
|
37
|
+
(): Record<string, string> => ({}),
|
|
38
|
+
);
|
|
33
39
|
|
|
34
40
|
/** The English registered so far, keyed by catalog key. */
|
|
35
41
|
export const englishFallback: RuntimeCatalog = registered;
|