@astryxdesign/core 0.7.5-canary.fccd771 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +211 -10
- package/README.md +15 -12
- package/dist/AlertDialog/AlertDialog.js +1 -1
- package/dist/AppShell/AppShell.d.ts +0 -22
- package/dist/AppShell/AppShell.d.ts.map +1 -1
- package/dist/AppShell/AppShell.js +155 -1
- package/dist/Avatar/AvatarStatusDot.js +2 -2
- package/dist/Badge/Badge.d.ts.map +1 -1
- package/dist/Badge/Badge.js +18 -2
- package/dist/Banner/Banner.d.ts +1 -0
- package/dist/Banner/Banner.d.ts.map +1 -1
- package/dist/Banner/Banner.js +64 -9
- package/dist/BottomSheet/BottomSheet.d.ts +53 -5
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +435 -198
- package/dist/BottomSheet/BottomSheetHostContext.d.ts +8 -0
- package/dist/BottomSheet/BottomSheetHostContext.d.ts.map +1 -0
- package/dist/BottomSheet/BottomSheetHostContext.js +35 -0
- package/dist/BottomSheet/BottomSheetPanel.d.ts +9 -1
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +77 -23
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts +53 -14
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +229 -27
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts +6 -0
- package/dist/BottomSheet/BottomSheetSwitcherContext.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetEscape.d.ts +3 -0
- package/dist/BottomSheet/bottomSheetEscape.d.ts.map +1 -0
- package/dist/BottomSheet/bottomSheetEscape.js +20 -0
- package/dist/BottomSheet/bottomSheetStack.d.ts +262 -0
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -0
- package/dist/BottomSheet/bottomSheetStack.js +1675 -0
- package/dist/BottomSheet/useSheetGestures.d.ts +19 -3
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +43 -14
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +36 -3
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +18 -7
- package/dist/Chat/ChatComposer.d.ts.map +1 -1
- package/dist/Chat/ChatComposer.js +25 -32
- package/dist/Chat/ChatComposerInput.d.ts.map +1 -1
- package/dist/Chat/ChatComposerInput.js +55 -16
- package/dist/Chat/ChatMessageMetadata.js +2 -2
- package/dist/Chat/ChatPastedTextToken.d.ts.map +1 -1
- package/dist/Chat/ChatPastedTextToken.js +7 -6
- package/dist/Chat/ChatToolCalls.js +4 -4
- package/dist/ClickableCard/ClickableCard.d.ts.map +1 -1
- package/dist/ClickableCard/ClickableCard.js +10 -6
- package/dist/CodeBlock/CodeBlock.d.ts +25 -2
- package/dist/CodeBlock/CodeBlock.d.ts.map +1 -1
- package/dist/CodeBlock/CodeBlock.js +58 -19
- package/dist/CodeBlock/grammar.d.ts +134 -0
- package/dist/CodeBlock/grammar.d.ts.map +1 -0
- package/dist/CodeBlock/grammar.js +219 -0
- package/dist/CodeBlock/index.d.ts +2 -0
- package/dist/CodeBlock/index.d.ts.map +1 -1
- package/dist/CodeBlock/index.js +1 -0
- package/dist/CodeBlock/languages/dockerfile.d.ts +3 -0
- package/dist/CodeBlock/languages/dockerfile.d.ts.map +1 -0
- package/dist/CodeBlock/languages/dockerfile.js +45 -0
- package/dist/CodeBlock/languages/graphql.d.ts +3 -0
- package/dist/CodeBlock/languages/graphql.d.ts.map +1 -0
- package/dist/CodeBlock/languages/graphql.js +27 -0
- package/dist/CodeBlock/languages/java.d.ts +3 -0
- package/dist/CodeBlock/languages/java.d.ts.map +1 -0
- package/dist/CodeBlock/languages/java.js +24 -0
- package/dist/CodeBlock/languages/lua.d.ts +3 -0
- package/dist/CodeBlock/languages/lua.d.ts.map +1 -0
- package/dist/CodeBlock/languages/lua.js +21 -0
- package/dist/CodeBlock/languages/objective-c.d.ts +3 -0
- package/dist/CodeBlock/languages/objective-c.d.ts.map +1 -0
- package/dist/CodeBlock/languages/objective-c.js +27 -0
- package/dist/CodeBlock/languages/powershell.d.ts +3 -0
- package/dist/CodeBlock/languages/powershell.d.ts.map +1 -0
- package/dist/CodeBlock/languages/powershell.js +30 -0
- package/dist/CodeBlock/languages/ruby.d.ts +3 -0
- package/dist/CodeBlock/languages/ruby.d.ts.map +1 -0
- package/dist/CodeBlock/languages/ruby.js +24 -0
- package/dist/CodeBlock/languages/thrift.d.ts +3 -0
- package/dist/CodeBlock/languages/thrift.d.ts.map +1 -0
- package/dist/CodeBlock/languages/thrift.js +18 -0
- package/dist/CodeBlock/languages/toml.d.ts +3 -0
- package/dist/CodeBlock/languages/toml.d.ts.map +1 -0
- package/dist/CodeBlock/languages/toml.js +53 -0
- package/dist/CodeBlock/tokenizer.d.ts +8 -4
- package/dist/CodeBlock/tokenizer.d.ts.map +1 -1
- package/dist/CodeBlock/tokenizer.js +158 -8
- package/dist/Collapsible/Collapsible.d.ts +8 -1
- package/dist/Collapsible/Collapsible.d.ts.map +1 -1
- package/dist/Collapsible/Collapsible.js +84 -2
- package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPalette.js +15 -1
- package/dist/CommandPalette/CommandPaletteEmpty.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteEmpty.js +1 -0
- package/dist/CommandPalette/CommandPaletteInput.d.ts.map +1 -1
- package/dist/CommandPalette/CommandPaletteInput.js +14 -2
- package/dist/CommandPalette/busyStartSettle.d.ts +4 -0
- package/dist/CommandPalette/busyStartSettle.d.ts.map +1 -0
- package/dist/CommandPalette/busyStartSettle.js +23 -0
- package/dist/ComplexSelector/ComplexSelector.d.ts +20 -2
- package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
- package/dist/ComplexSelector/ComplexSelector.js +42 -7
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +48 -13
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +12 -5
- package/dist/DateInput/NativeDateField.d.ts.map +1 -1
- package/dist/DateInput/NativeDateField.js +2 -1
- package/dist/DateInput/TouchDateField.d.ts.map +1 -1
- package/dist/DateInput/TouchDateField.js +2 -1
- package/dist/DateInput/Wheel.d.ts.map +1 -1
- package/dist/DateInput/Wheel.js +1 -1
- package/dist/Dialog/Dialog.d.ts +4 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +20 -8
- package/dist/Drawer/Drawer.d.ts.map +1 -1
- package/dist/Drawer/Drawer.js +18 -13
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +34 -30
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts +7 -4
- package/dist/DropdownMenu/DropdownMenuGroup.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuGroup.js +10 -4
- package/dist/DropdownMenu/DropdownMenuItem.js +3 -3
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts +10 -5
- package/dist/DropdownMenu/DropdownMenuRadioItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuRadioItem.js +13 -5
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -6
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +0 -3
- package/dist/DropdownMenu/MenuBottomSheet.d.ts +11 -4
- package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/MenuBottomSheet.js +35 -9
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +3 -3
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts +2 -0
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +25 -3
- package/dist/DropdownMenu/menuBottomSheet.stylex.d.ts +23 -0
- package/dist/DropdownMenu/menuBottomSheet.stylex.d.ts.map +1 -0
- package/dist/DropdownMenu/menuBottomSheet.stylex.js +29 -0
- package/dist/DropdownMenu/menuItemHover.d.ts +3 -0
- package/dist/DropdownMenu/menuItemHover.d.ts.map +1 -1
- package/dist/DropdownMenu/menuItemHover.js +14 -1
- package/dist/DropdownMenu/menuTouchAction.stylex.d.ts +25 -0
- package/dist/DropdownMenu/menuTouchAction.stylex.d.ts.map +1 -0
- package/dist/DropdownMenu/menuTouchAction.stylex.js +29 -0
- package/dist/DropdownMenu/useMenuDrillIn.d.ts.map +1 -1
- package/dist/DropdownMenu/useMenuDrillIn.js +7 -5
- package/dist/EmptyState/EmptyState.d.ts +4 -2
- package/dist/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/EmptyState/EmptyState.js +6 -4
- package/dist/Field/Field.js +1 -1
- package/dist/Field/FieldLabel.js +1 -1
- package/dist/Field/PanelSearchInput.d.ts +9 -1
- package/dist/Field/PanelSearchInput.d.ts.map +1 -1
- package/dist/Field/PanelSearchInput.js +31 -22
- package/dist/Field/inputDisabledFocus.d.ts +14 -0
- package/dist/Field/inputDisabledFocus.d.ts.map +1 -0
- package/dist/Field/inputDisabledFocus.js +19 -0
- package/dist/Field/inputStyles.stylex.d.ts +9 -9
- package/dist/Field/inputStyles.stylex.js +9 -9
- package/dist/FieldStatus/FieldStatus.d.ts.map +1 -1
- package/dist/FieldStatus/FieldStatus.js +7 -3
- package/dist/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +22 -12
- package/dist/Icon/Icon.d.ts +37 -5
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +65 -11
- package/dist/Icon/IconSize.stylex.d.ts +16 -11
- package/dist/Icon/IconSize.stylex.d.ts.map +1 -1
- package/dist/Icon/IconSize.stylex.js +27 -11
- package/dist/Icon/globalIconRegistry.d.ts +71 -4
- package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
- package/dist/Icon/globalIconRegistry.js +163 -23
- package/dist/Icon/index.d.ts +26 -2
- package/dist/Icon/index.d.ts.map +1 -1
- package/dist/Icon/index.js +24 -1
- package/dist/Icon/useIcon.d.ts +5 -1
- package/dist/Icon/useIcon.d.ts.map +1 -1
- package/dist/Icon/useIcon.js +5 -1
- package/dist/InputGroup/InputGroup.d.ts +1 -1
- package/dist/InputGroup/InputGroup.d.ts.map +1 -1
- package/dist/InputGroup/InputGroup.js +46 -36
- package/dist/InputGroup/InputGroupInternalContext.d.ts +4 -0
- package/dist/InputGroup/InputGroupInternalContext.d.ts.map +1 -0
- package/dist/InputGroup/InputGroupInternalContext.js +15 -0
- package/dist/InputGroup/InputGroupText.d.ts.map +1 -1
- package/dist/InputGroup/InputGroupText.js +2 -0
- package/dist/InputGroup/groupStyles.d.ts +9 -0
- package/dist/InputGroup/groupStyles.d.ts.map +1 -1
- package/dist/InputGroup/groupStyles.js +28 -14
- package/dist/Item/Item.d.ts +5 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +23 -7
- package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.d.ts +2 -0
- package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/Item/ItemMarkerColumns.a11y.chromium.spec.js +132 -0
- package/dist/Item/ItemMarkerColumnsContext.d.ts +14 -0
- package/dist/Item/ItemMarkerColumnsContext.d.ts.map +1 -0
- package/dist/Item/ItemMarkerColumnsContext.js +18 -0
- package/dist/Item/ItemSwipeLayer.d.ts.map +1 -1
- package/dist/Item/ItemSwipeLayer.js +3 -0
- package/dist/Item/useSwipeAction.d.ts.map +1 -1
- package/dist/Item/useSwipeAction.js +60 -5
- package/dist/Kbd/Kbd.d.ts +2 -2
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +18 -11
- package/dist/Layer/layerAnimations.stylex.d.ts +9 -5
- package/dist/Layer/layerAnimations.stylex.d.ts.map +1 -1
- package/dist/Layer/layerAnimations.stylex.js +23 -10
- package/dist/Layer/layerSlideRules.d.ts +62 -2
- package/dist/Layer/layerSlideRules.d.ts.map +1 -1
- package/dist/Layer/layerSlideRules.js +124 -3
- package/dist/Layer/layerStack.d.ts +12 -9
- package/dist/Layer/layerStack.d.ts.map +1 -1
- package/dist/Layer/layerStack.js +116 -53
- package/dist/Layer/modalOutlet.d.ts +44 -6
- package/dist/Layer/modalOutlet.d.ts.map +1 -1
- package/dist/Layer/modalOutlet.js +150 -14
- package/dist/Layer/preserveAnimations.d.ts +11 -0
- package/dist/Layer/preserveAnimations.d.ts.map +1 -0
- package/dist/Layer/preserveAnimations.js +245 -0
- package/dist/Layer/useLayer.d.ts +19 -2
- package/dist/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +531 -44
- package/dist/Layer/useLayerDismissal.d.ts +10 -7
- package/dist/Layer/useLayerDismissal.d.ts.map +1 -1
- package/dist/Layer/useLayerDismissal.js +8 -8
- package/dist/Layer/useTouchTrigger.d.ts +14 -1
- package/dist/Layer/useTouchTrigger.d.ts.map +1 -1
- package/dist/Layer/useTouchTrigger.js +72 -17
- package/dist/Layout/Layout.d.ts.map +1 -1
- package/dist/Layout/Layout.js +4 -0
- package/dist/Layout/LayoutContent.d.ts.map +1 -1
- package/dist/Layout/LayoutContent.js +2 -2
- package/dist/Layout/LayoutFooter.d.ts.map +1 -1
- package/dist/Layout/LayoutFooter.js +2 -1
- package/dist/Layout/LayoutHeader.d.ts.map +1 -1
- package/dist/Layout/LayoutHeader.js +2 -1
- package/dist/Layout/layoutEdges.stylex.d.ts +20 -0
- package/dist/Layout/layoutEdges.stylex.d.ts.map +1 -0
- package/dist/Layout/layoutEdges.stylex.js +28 -0
- package/dist/Lightbox/Lightbox.d.ts +5 -2
- package/dist/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/Lightbox/Lightbox.js +111 -89
- package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.d.ts +2 -0
- package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.d.ts.map +1 -0
- package/dist/Lightbox/LightboxKeyboard.a11y.browser.spec.js +78 -0
- package/dist/Lightbox/LightboxViewport.a11y.browser.spec.d.ts +2 -0
- package/dist/Lightbox/LightboxViewport.a11y.browser.spec.d.ts.map +1 -0
- package/dist/Lightbox/LightboxViewport.a11y.browser.spec.js +65 -0
- package/dist/List/List.d.ts +2 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +9 -2
- package/dist/List/ListContext.d.ts +16 -4
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +10 -5
- package/dist/List/ListItem.d.ts +7 -1
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +52 -8
- package/dist/List/ListMarkers.a11y.chromium.spec.d.ts +2 -0
- package/dist/List/ListMarkers.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/List/ListMarkers.a11y.chromium.spec.js +677 -0
- package/dist/Markdown/Markdown.d.ts +11 -1
- package/dist/Markdown/Markdown.d.ts.map +1 -1
- package/dist/Markdown/Markdown.fr23.bench.js +3 -1
- package/dist/Markdown/Markdown.fr23.sampling.d.ts +16 -0
- package/dist/Markdown/Markdown.fr23.sampling.d.ts.map +1 -1
- package/dist/Markdown/Markdown.fr23.sampling.js +13 -4
- package/dist/Markdown/Markdown.js +41 -14
- package/dist/Markdown/MarkdownTable.a11y.chromium.spec.js +1 -0
- package/dist/MobileNav/MobileNav.d.ts +2 -1
- package/dist/MobileNav/MobileNav.d.ts.map +1 -1
- package/dist/MobileNav/MobileNav.js +46 -37
- package/dist/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.js +1 -0
- package/dist/MobileNav/MobileNavToggle.d.ts +7 -3
- package/dist/MobileNav/MobileNavToggle.d.ts.map +1 -1
- package/dist/MobileNav/MobileNavToggle.js +11 -3
- package/dist/MultiSelector/CreateRow.a11y.chromium.spec.js +53 -6
- package/dist/MultiSelector/MultiSelector.d.ts +1 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.js +1 -0
- package/dist/MultiSelector/MultiSelector.js +21 -5
- package/dist/MultiSelector/OptionActions.a11y.chromium.spec.js +1 -0
- package/dist/NavMenu/NavHeadingMenu.d.ts +1 -1
- package/dist/NavMenu/NavHeadingMenu.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenu.js +29 -5
- package/dist/NavMenu/NavHeadingMenuItem.d.ts.map +1 -1
- package/dist/NavMenu/NavHeadingMenuItem.js +51 -7
- package/dist/NavMenu/NavMenuContext.d.ts +9 -0
- package/dist/NavMenu/NavMenuContext.d.ts.map +1 -1
- package/dist/NavMenu/NavMenuContext.js +9 -0
- package/dist/NumberInput/NumberInput.d.ts +4 -4
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +61 -24
- package/dist/Overlay/Overlay.d.ts +3 -3
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +12 -5
- package/dist/Popover/Popover.d.ts +41 -2
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +276 -44
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.d.ts.map +1 -1
- package/dist/Popover/lazyPopoverBottomSheet.d.ts +23 -0
- package/dist/Popover/lazyPopoverBottomSheet.d.ts.map +1 -0
- package/dist/Popover/lazyPopoverBottomSheet.js +40 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +11 -5
- package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
- package/dist/PowerSearch/PowerSearch.js +7 -5
- package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/ProgressBar/ProgressBar.js +8 -0
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +10 -2
- package/dist/ScrollableArea/ScrollableArea.d.ts.map +1 -1
- package/dist/ScrollableArea/ScrollableArea.js +1 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +6 -2
- package/dist/SelectableCard/SelectableCard.d.ts +5 -5
- package/dist/SelectableCard/SelectableCard.d.ts.map +1 -1
- package/dist/SelectableCard/SelectableCard.js +15 -11
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +27 -8
- package/dist/Selector/hooks.d.ts +52 -6
- package/dist/Selector/hooks.d.ts.map +1 -1
- package/dist/Selector/hooks.js +145 -2
- package/dist/SideNav/SideNav.d.ts.map +1 -1
- package/dist/SideNav/SideNav.js +58 -2
- package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +79 -3
- package/dist/SideNav/SideNavItem.d.ts +5 -1
- package/dist/SideNav/SideNavItem.d.ts.map +1 -1
- package/dist/SideNav/SideNavItem.js +36 -13
- package/dist/SideNav/railMotion.d.ts +54 -0
- package/dist/SideNav/railMotion.d.ts.map +1 -0
- package/dist/SideNav/railMotion.js +253 -0
- package/dist/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/Skeleton/Skeleton.js +12 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +52 -15
- package/dist/StatusDot/StatusDot.d.ts.map +1 -1
- package/dist/StatusDot/StatusDot.js +12 -0
- package/dist/Stepper/Step.d.ts.map +1 -1
- package/dist/Stepper/Step.js +10 -6
- package/dist/Switch/Switch.d.ts.map +1 -1
- package/dist/Switch/Switch.js +5 -5
- package/dist/Switch/switch.markers.stylex.d.ts +7 -2
- package/dist/Switch/switch.markers.stylex.d.ts.map +1 -1
- package/dist/Switch/switch.markers.stylex.js +8 -3
- package/dist/TabList/Tab.d.ts.map +1 -1
- package/dist/TabList/Tab.js +5 -1
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +25 -3
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +5 -1
- package/dist/Table/TableHeaderCell.d.ts.map +1 -1
- package/dist/Table/TableHeaderCell.js +1 -0
- package/dist/Table/TableRow.d.ts.map +1 -1
- package/dist/Table/TableRow.js +3 -0
- package/dist/Table/glidingDivider.d.ts +96 -0
- package/dist/Table/glidingDivider.d.ts.map +1 -0
- package/dist/Table/glidingDivider.js +275 -0
- package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
- package/dist/Table/plugins/columnResize/useTableColumnResize.js +11 -2
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts +8 -0
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +374 -13
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +244 -6
- package/dist/Table/rowDivider.d.ts +34 -0
- package/dist/Table/rowDivider.d.ts.map +1 -0
- package/dist/Table/rowDivider.js +118 -0
- package/dist/TextArea/TextArea.d.ts +6 -4
- package/dist/TextArea/TextArea.d.ts.map +1 -1
- package/dist/TextArea/TextArea.js +15 -12
- package/dist/TextInput/TextInput.d.ts +7 -5
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +43 -22
- package/dist/Thumbnail/Thumbnail.d.ts.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +45 -11
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +12 -4
- package/dist/TimeInput/TouchTimeField.d.ts.map +1 -1
- package/dist/TimeInput/TouchTimeField.js +2 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +62 -6
- package/dist/Tokenizer/Tokenizer.d.ts +71 -4
- package/dist/Tokenizer/Tokenizer.d.ts.map +1 -1
- package/dist/Tokenizer/Tokenizer.js +430 -45
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts +98 -0
- package/dist/Tokenizer/TokenizerBottomSheet.d.ts.map +1 -0
- package/dist/Tokenizer/TokenizerBottomSheet.js +721 -0
- package/dist/Tooltip/useTooltip.d.ts.map +1 -1
- package/dist/Tooltip/useTooltip.js +9 -3
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +26 -0
- package/dist/TopNav/TopNavMegaMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMegaMenu.js +4 -4
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +32 -4
- package/dist/TreeList/TreeList.d.ts +8 -23
- package/dist/TreeList/TreeList.d.ts.map +1 -1
- package/dist/TreeList/TreeList.js +175 -3
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +7 -5
- package/dist/TreeList/TreeListItem.d.ts +7 -1
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +5 -3
- package/dist/Typeahead/BaseTypeahead.d.ts +1 -1
- package/dist/Typeahead/BaseTypeahead.d.ts.map +1 -1
- package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.d.ts +2 -0
- package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.d.ts.map +1 -0
- package/dist/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.js +118 -0
- package/dist/Typeahead/BaseTypeahead.js +27 -11
- package/dist/Typeahead/Typeahead.d.ts +1 -1
- package/dist/Typeahead/Typeahead.d.ts.map +1 -1
- package/dist/Typeahead/Typeahead.js +31 -14
- package/dist/astryx.css +164 -41
- package/dist/gestures/GestureArena.d.ts +175 -0
- package/dist/gestures/GestureArena.d.ts.map +1 -0
- package/dist/gestures/GestureArena.js +816 -0
- package/dist/gestures/GestureRecognizer.d.ts +239 -0
- package/dist/gestures/GestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/GestureRecognizer.js +487 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts +32 -0
- package/dist/gestures/LongPressGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/LongPressGestureRecognizer.js +135 -0
- package/dist/gestures/PanGestureRecognizer.d.ts +117 -0
- package/dist/gestures/PanGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/PanGestureRecognizer.js +349 -0
- package/dist/gestures/TapGestureRecognizer.d.ts +39 -0
- package/dist/gestures/TapGestureRecognizer.d.ts.map +1 -0
- package/dist/gestures/TapGestureRecognizer.js +151 -0
- package/dist/gestures/VelocityTracker.d.ts +51 -0
- package/dist/gestures/VelocityTracker.d.ts.map +1 -0
- package/dist/gestures/VelocityTracker.js +186 -0
- package/dist/gestures/geometry.d.ts +17 -0
- package/dist/gestures/geometry.d.ts.map +1 -0
- package/dist/gestures/geometry.js +55 -0
- package/dist/gestures/types.d.ts +139 -0
- package/dist/gestures/types.d.ts.map +1 -0
- package/dist/gestures/types.js +67 -0
- package/dist/hooks/AnnounceRenderedText.d.ts +17 -0
- package/dist/hooks/AnnounceRenderedText.d.ts.map +1 -0
- package/dist/hooks/AnnounceRenderedText.js +32 -0
- package/dist/hooks/ModalAnnounceProvider.d.ts +41 -0
- package/dist/hooks/ModalAnnounceProvider.d.ts.map +1 -0
- package/dist/hooks/ModalAnnounceProvider.js +133 -0
- package/dist/hooks/actionGroupTracker.d.ts +98 -0
- package/dist/hooks/actionGroupTracker.d.ts.map +1 -0
- package/dist/hooks/actionGroupTracker.js +338 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/menuPressOnItems.d.ts +19 -0
- package/dist/hooks/menuPressOnItems.d.ts.map +1 -0
- package/dist/hooks/menuPressOnItems.js +32 -0
- package/dist/hooks/modalAnnounce.d.ts +18 -0
- package/dist/hooks/modalAnnounce.d.ts.map +1 -0
- package/dist/hooks/modalAnnounce.js +382 -0
- package/dist/hooks/scrollGeometry.d.ts +28 -0
- package/dist/hooks/scrollGeometry.d.ts.map +1 -1
- package/dist/hooks/scrollGeometry.js +36 -2
- package/dist/hooks/useAdaptivePresentation.d.ts +9 -1
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -1
- package/dist/hooks/useAdaptivePresentation.js +33 -8
- package/dist/hooks/useAnimatedLayout.d.ts +42 -0
- package/dist/hooks/useAnimatedLayout.d.ts.map +1 -0
- package/dist/hooks/useAnimatedLayout.js +46 -0
- package/dist/hooks/useAnnounce.d.ts +132 -1
- package/dist/hooks/useAnnounce.d.ts.map +1 -1
- package/dist/hooks/useAnnounce.js +356 -27
- package/dist/hooks/useAnnounceRenderedText.d.ts +19 -2
- package/dist/hooks/useAnnounceRenderedText.d.ts.map +1 -1
- package/dist/hooks/useAnnounceRenderedText.js +52 -11
- package/dist/hooks/useBusyAnnouncement.d.ts +9 -5
- package/dist/hooks/useBusyAnnouncement.d.ts.map +1 -1
- package/dist/hooks/useBusyAnnouncement.js +58 -46
- package/dist/hooks/useFocusTrap.d.ts +1 -1
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +57 -26
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +6 -2
- package/dist/hooks/useMenuPress.d.ts +4 -2
- package/dist/hooks/useMenuPress.d.ts.map +1 -1
- package/dist/hooks/useMenuPress.js +58 -33
- package/dist/hooks/usePressFeedback.d.ts +5 -2
- package/dist/hooks/usePressFeedback.d.ts.map +1 -1
- package/dist/hooks/usePressFeedback.js +5 -2
- package/dist/hooks/useScrollableArea.d.ts +5 -0
- package/dist/hooks/useScrollableArea.d.ts.map +1 -1
- package/dist/hooks/useScrollableArea.js +104 -11
- package/dist/i18n/generated-locales/en.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/en.generated.js +33 -0
- package/dist/i18n/generated-locales/pseudo.generated.d.ts.map +1 -1
- package/dist/i18n/generated-locales/pseudo.generated.js +33 -0
- package/dist/internal/tokenizer-presentation.d.ts +21 -0
- package/dist/internal/tokenizer-presentation.d.ts.map +1 -0
- package/dist/internal/tokenizer-presentation.js +21 -0
- package/dist/internal/touch.d.ts +26 -0
- package/dist/internal/touch.d.ts.map +1 -0
- package/dist/internal/touch.js +28 -0
- package/dist/motion/LayoutChangeSnapshot.d.ts +33 -0
- package/dist/motion/LayoutChangeSnapshot.d.ts.map +1 -0
- package/dist/motion/LayoutChangeSnapshot.js +37 -0
- package/dist/motion/animatedLayout.d.ts +190 -0
- package/dist/motion/animatedLayout.d.ts.map +1 -0
- package/dist/motion/animatedLayout.js +1502 -0
- package/dist/motion/animator.d.ts +240 -0
- package/dist/motion/animator.d.ts.map +1 -0
- package/dist/motion/animator.js +2203 -0
- package/dist/motion/bezier.d.ts +18 -0
- package/dist/motion/bezier.d.ts.map +1 -0
- package/dist/motion/bezier.js +60 -0
- package/dist/motion/coast.d.ts +61 -0
- package/dist/motion/coast.d.ts.map +1 -0
- package/dist/motion/coast.js +107 -0
- package/dist/motion/decay.d.ts +41 -0
- package/dist/motion/decay.d.ts.map +1 -0
- package/dist/motion/decay.js +90 -0
- package/dist/motion/projection.d.ts +36 -0
- package/dist/motion/projection.d.ts.map +1 -0
- package/dist/motion/projection.js +92 -0
- package/dist/motion/reducedMotion.d.ts +25 -0
- package/dist/motion/reducedMotion.d.ts.map +1 -0
- package/dist/motion/reducedMotion.js +85 -0
- package/dist/motion/reducedMotion.stylex.d.ts +19 -0
- package/dist/motion/reducedMotion.stylex.d.ts.map +1 -0
- package/dist/motion/reducedMotion.stylex.js +37 -0
- package/dist/motion/reducedMotionPlan.d.ts +89 -0
- package/dist/motion/reducedMotionPlan.d.ts.map +1 -0
- package/dist/motion/reducedMotionPlan.js +194 -0
- package/dist/motion/resolveSnapPoint.d.ts +52 -0
- package/dist/motion/resolveSnapPoint.d.ts.map +1 -0
- package/dist/motion/resolveSnapPoint.js +135 -0
- package/dist/motion/roleValue.d.ts +33 -0
- package/dist/motion/roleValue.d.ts.map +1 -0
- package/dist/motion/roleValue.js +84 -0
- package/dist/motion/roles.d.ts +79 -0
- package/dist/motion/roles.d.ts.map +1 -0
- package/dist/motion/roles.js +199 -0
- package/dist/motion/rubberBand.d.ts +20 -0
- package/dist/motion/rubberBand.d.ts.map +1 -0
- package/dist/motion/rubberBand.js +91 -0
- package/dist/motion/selectPage.d.ts +26 -0
- package/dist/motion/selectPage.d.ts.map +1 -0
- package/dist/motion/selectPage.js +55 -0
- package/dist/motion/spring.d.ts +193 -0
- package/dist/motion/spring.d.ts.map +1 -0
- package/dist/motion/spring.js +442 -0
- package/dist/motion/transientCopy.d.ts +33 -0
- package/dist/motion/transientCopy.d.ts.map +1 -0
- package/dist/motion/transientCopy.js +314 -0
- package/dist/motion/uikit/gestures.d.ts +642 -0
- package/dist/motion/uikit/gestures.d.ts.map +1 -0
- package/dist/motion/uikit/gestures.js +428 -0
- package/dist/motion/uikit/index.d.ts +24 -0
- package/dist/motion/uikit/index.d.ts.map +1 -0
- package/dist/motion/uikit/index.js +26 -0
- package/dist/motion/uikit/navigation.d.ts +54 -0
- package/dist/motion/uikit/navigation.d.ts.map +1 -0
- package/dist/motion/uikit/navigation.js +83 -0
- package/dist/motion/uikit/scroll.d.ts +116 -0
- package/dist/motion/uikit/scroll.d.ts.map +1 -0
- package/dist/motion/uikit/scroll.js +146 -0
- package/dist/motion/uikit/springs.d.ts +545 -0
- package/dist/motion/uikit/springs.d.ts.map +1 -0
- package/dist/motion/uikit/springs.js +548 -0
- package/dist/motion/uikit/timing.d.ts +202 -0
- package/dist/motion/uikit/timing.d.ts.map +1 -0
- package/dist/motion/uikit/timing.js +201 -0
- package/dist/reset.a11y.chromium.spec.js +1 -0
- package/dist/reset.until-found.a11y.browser.spec.js +1 -0
- package/dist/theme/declarationBoundary.d.ts +13 -0
- package/dist/theme/declarationBoundary.d.ts.map +1 -1
- package/dist/theme/declarationBoundary.js +264 -1
- package/dist/theme/defineTheme.d.ts +111 -11
- package/dist/theme/defineTheme.d.ts.map +1 -1
- package/dist/theme/defineTheme.js +97 -7
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +9 -0
- package/dist/theme/generateThemeRules.d.ts +6 -2
- package/dist/theme/generateThemeRules.d.ts.map +1 -1
- package/dist/theme/generateThemeRules.js +468 -24
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/statusColor.d.ts +48 -0
- package/dist/theme/statusColor.d.ts.map +1 -0
- package/dist/theme/statusColor.js +203 -0
- package/dist/theme/statusRoleDerivation.d.ts +11 -0
- package/dist/theme/statusRoleDerivation.d.ts.map +1 -0
- package/dist/theme/statusRoleDerivation.js +236 -0
- package/dist/theme/syntax/SyntaxTheme.d.ts +1 -1
- package/dist/theme/syntax/SyntaxTheme.js +1 -1
- package/dist/theme/syntax/defineSyntaxTheme.js +1 -1
- package/dist/theme/syntax/presets.d.ts +1 -1
- package/dist/theme/syntax/presets.js +1 -1
- package/dist/theme/syntax/tokens.d.ts +1 -1
- package/dist/theme/syntax/tokens.js +1 -1
- package/dist/theme/themeAdaptations.d.ts +25 -1
- package/dist/theme/themeAdaptations.d.ts.map +1 -1
- package/dist/theme/themeAdaptations.js +30 -1
- package/dist/theme/tokens.d.ts.map +1 -1
- package/dist/theme/tokens.js +16 -1
- package/dist/theme/tokens.stylex.d.ts +42 -2
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +54 -3
- package/dist/theme/useTheme.d.ts +4 -2
- package/dist/theme/useTheme.d.ts.map +1 -1
- package/dist/theme/useTheme.js +10 -4
- package/dist/utils/edgeAutoscroll.d.ts +53 -0
- package/dist/utils/edgeAutoscroll.d.ts.map +1 -0
- package/dist/utils/edgeAutoscroll.js +81 -0
- package/dist/utils/hitArea.d.ts +72 -0
- package/dist/utils/hitArea.d.ts.map +1 -0
- package/dist/utils/hitArea.js +681 -0
- package/dist/utils/interactionOverlay.stylex.d.ts +4 -1
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +4 -1
- package/dist/utils/pressFeedback.d.ts +5 -1
- package/dist/utils/pressFeedback.d.ts.map +1 -1
- package/dist/utils/pressFeedback.js +285 -54
- package/dist/utils/pressGesture.d.ts +13 -1
- package/dist/utils/pressGesture.d.ts.map +1 -1
- package/dist/utils/pressGesture.js +40 -1
- package/dist/utils/touchPresentation.d.ts +48 -0
- package/dist/utils/touchPresentation.d.ts.map +1 -0
- package/dist/utils/touchPresentation.js +133 -0
- package/locales/af-ZA.json +1 -1
- package/locales/ar-SA.json +1 -1
- package/locales/ca-ES.json +1 -1
- package/locales/cs-CZ.json +1 -1
- package/locales/da-DK.json +1 -1
- package/locales/de-DE.json +1 -1
- package/locales/el-GR.json +1 -1
- package/locales/en.json +132 -0
- package/locales/es-ES.json +1 -1
- package/locales/fi-FI.json +1 -1
- package/locales/fr-FR.json +1 -1
- package/locales/he-IL.json +1 -1
- package/locales/hu-HU.json +1 -1
- package/locales/it-IT.json +1 -1
- package/locales/ja-JP.json +1 -1
- package/locales/ko-KR.json +1 -1
- package/locales/nl-NL.json +1 -1
- package/locales/no-NO.json +1 -1
- package/locales/pl-PL.json +1 -1
- package/locales/pseudo.json +99 -0
- package/locales/pt-BR.json +1 -1
- package/locales/pt-PT.json +1 -1
- package/locales/ro-RO.json +1 -1
- package/locales/ru-RU.json +1 -1
- package/locales/sr-SP.json +1 -1
- package/locales/sv-SE.json +1 -1
- package/locales/tr-TR.json +1 -1
- package/locales/uk-UA.json +1 -1
- package/locales/vi-VN.json +1 -1
- package/locales/zh-CN.json +1 -1
- package/locales/zh-TW.json +1 -1
- package/package.json +63 -8
- package/src/AlertDialog/AlertDialog.spec.md +85 -31
- package/src/AlertDialog/AlertDialog.tsx +1 -1
- package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +1 -0
- package/src/AppShell/AppShell.spec.md +334 -0
- package/src/AppShell/AppShell.tsx +170 -2
- package/src/AspectRatio/AspectRatio.spec.md +179 -0
- package/src/AspectRatio/__tests__/AspectRatioFitLayers.a11y.browser.spec.ts +1 -0
- package/src/Avatar/Avatar.spec.md +253 -0
- package/src/Avatar/AvatarStatusDot.spec.md +93 -79
- package/src/Avatar/AvatarStatusDot.test.tsx +22 -0
- package/src/Avatar/AvatarStatusDot.tsx +2 -2
- package/src/AvatarGroup/AvatarGroup.spec.md +205 -0
- package/src/AvatarGroup/AvatarGroupOverflow.spec.md +123 -120
- package/src/Badge/Badge.spec.md +207 -0
- package/src/Badge/Badge.test.tsx +13 -0
- package/src/Badge/Badge.tsx +38 -2
- package/src/Banner/Banner.spec.md +41 -28
- package/src/Banner/Banner.test.tsx +118 -16
- package/src/Banner/Banner.tsx +94 -7
- package/src/Blockquote/Blockquote.spec.md +171 -0
- package/src/BottomSheet/BottomSheet.doc.mjs +106 -24
- package/src/BottomSheet/BottomSheet.spec.md +271 -40
- package/src/BottomSheet/BottomSheet.test.tsx +491 -5
- package/src/BottomSheet/BottomSheet.tsx +544 -145
- package/src/BottomSheet/BottomSheetHostContext.ts +44 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +73 -19
- package/src/BottomSheet/BottomSheetPanel.tsx +178 -63
- package/src/BottomSheet/BottomSheetReplace.test.tsx +1638 -0
- package/src/BottomSheet/BottomSheetStacking.announce.test.tsx +246 -0
- package/src/BottomSheet/BottomSheetStacking.test.tsx +3184 -0
- package/src/BottomSheet/BottomSheetSwitcher.doc.mjs +27 -31
- package/src/BottomSheet/BottomSheetSwitcher.spec.md +138 -43
- package/src/BottomSheet/BottomSheetSwitcher.tsx +275 -26
- package/src/BottomSheet/BottomSheetSwitcherContext.ts +6 -0
- package/src/BottomSheet/__tests__/BottomSheetDrag.a11y.chromium.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetFocusReturn.a11y.browser.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts +4 -1
- package/src/BottomSheet/__tests__/BottomSheetNativeModal.a11y.browser.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetPinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/BottomSheet/__tests__/BottomSheetToastOutlet.a11y.chromium.spec.ts +83 -0
- package/src/BottomSheet/bottomSheetEscape.ts +21 -0
- package/src/BottomSheet/bottomSheetStack.ts +2054 -0
- package/src/BottomSheet/useSheetGestures.ts +68 -12
- package/src/Breadcrumbs/BreadcrumbItem.spec.md +104 -60
- package/src/Breadcrumbs/BreadcrumbItem.tsx +30 -1
- package/src/Breadcrumbs/Breadcrumbs.spec.md +165 -0
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +90 -0
- package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +1 -0
- package/src/Button/Button.spec.md +322 -0
- package/src/Button/Button.test.tsx +8 -1
- package/src/Button/Button.tsx +36 -7
- package/src/Button/__tests__/Button.a11y.chromium.spec.ts +1 -0
- package/src/ButtonGroup/ButtonGroup.spec.md +220 -0
- package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +1 -0
- package/src/Card/Card.spec.md +205 -0
- package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +1 -0
- package/src/Center/Center.spec.md +104 -124
- package/src/Chat/ChatComposer.test.tsx +54 -0
- package/src/Chat/ChatComposer.tsx +41 -27
- package/src/Chat/ChatComposerInput.test.tsx +165 -21
- package/src/Chat/ChatComposerInput.tsx +73 -16
- package/src/Chat/ChatMessageMetadata.tsx +1 -1
- package/src/Chat/ChatPastedTextToken.test.tsx +71 -0
- package/src/Chat/ChatPastedTextToken.tsx +8 -7
- package/src/Chat/ChatToolCalls.tsx +5 -5
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +22 -4
- package/src/Chat/__tests__/ChatLayoutScrollButtonSurface.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatMessageList.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatMessageMetadata.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatSendButton.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatSystemMessage.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/ChatTokenizedText.a11y.chromium.spec.ts +1 -0
- package/src/Chat/__tests__/useChatStreamScroll.a11y.chromium.spec.ts +1 -0
- package/src/CheckboxInput/CheckboxInput.spec.md +97 -66
- package/src/CheckboxInput/__tests__/Checkbox.a11y.chromium.spec.ts +1 -0
- package/src/CheckboxList/CheckboxList.spec.md +92 -78
- package/src/CheckboxList/CheckboxListItem.spec.md +86 -60
- package/src/CheckboxList/__tests__/CheckboxList.a11y.chromium.spec.ts +1 -0
- package/src/ClickableCard/ClickableCard.doc.mjs +1 -2
- package/src/ClickableCard/ClickableCard.spec.md +124 -128
- package/src/ClickableCard/ClickableCard.test.tsx +14 -3
- package/src/ClickableCard/ClickableCard.tsx +44 -28
- package/src/Code/Code.spec.md +30 -32
- package/src/CodeBlock/CodeBlock.doc.mjs +21 -4
- package/src/CodeBlock/CodeBlock.spec.md +96 -61
- package/src/CodeBlock/CodeBlock.test.tsx +97 -1
- package/src/CodeBlock/CodeBlock.tsx +132 -22
- package/src/CodeBlock/CodeLanguage.test.tsx +173 -0
- package/src/CodeBlock/__tests__/CodeBlockCopyClearance.a11y.chromium.spec.ts +290 -0
- package/src/CodeBlock/__tests__/CodeBlockLanguages.a11y.chromium.spec.ts +64 -0
- package/src/CodeBlock/__tests__/CodeBlockOverflowStop.a11y.chromium.spec.ts +1 -0
- package/src/CodeBlock/__tests__/DiffRowPaint.a11y.chromium.spec.ts +1 -0
- package/src/CodeBlock/grammar.ts +291 -0
- package/src/CodeBlock/index.ts +7 -0
- package/src/CodeBlock/languages/dockerfile.ts +43 -0
- package/src/CodeBlock/languages/graphql.ts +30 -0
- package/src/CodeBlock/languages/java.ts +28 -0
- package/src/CodeBlock/languages/lua.ts +21 -0
- package/src/CodeBlock/languages/objective-c.ts +26 -0
- package/src/CodeBlock/languages/powershell.ts +31 -0
- package/src/CodeBlock/languages/ruby.ts +29 -0
- package/src/CodeBlock/languages/thrift.ts +32 -0
- package/src/CodeBlock/languages/toml.ts +36 -0
- package/src/CodeBlock/languages.test.ts +402 -0
- package/src/CodeBlock/tokenizer.ts +176 -16
- package/src/CodeBlock/tokenizerBudget.test.ts +112 -0
- package/src/Collapsible/Collapsible.doc.mjs +6 -0
- package/src/Collapsible/Collapsible.spec.md +26 -23
- package/src/Collapsible/Collapsible.tsx +121 -2
- package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +1 -0
- package/src/Collapsible/__tests__/CollapsibleGroup.a11y.chromium.spec.ts +1 -0
- package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/CommandPalette.perf.test.ts +8 -4
- package/src/CommandPalette/CommandPalette.tsx +17 -1
- package/src/CommandPalette/CommandPaletteEmpty.doc.mjs +6 -3
- package/src/CommandPalette/CommandPaletteEmpty.spec.md +190 -0
- package/src/CommandPalette/CommandPaletteEmpty.tsx +4 -0
- package/src/CommandPalette/CommandPaletteInput.tsx +21 -2
- package/src/CommandPalette/__tests__/CommandPalette.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/__tests__/CommandPaletteEmptyAudit.a11y.chromium.spec.ts +715 -0
- package/src/CommandPalette/__tests__/CommandPaletteFooter.a11y.chromium.spec.ts +3 -2
- package/src/CommandPalette/__tests__/CommandPaletteInputAudit.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/__tests__/CommandPaletteItemAudit.a11y.chromium.spec.ts +1 -0
- package/src/CommandPalette/busyStartSettle.ts +26 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +1 -1
- package/src/ComplexSelector/ComplexSelector.focusableDisabled.test.tsx +1 -1
- package/src/ComplexSelector/ComplexSelector.fr10.test.tsx +9 -9
- package/src/ComplexSelector/ComplexSelector.spec.md +161 -107
- package/src/ComplexSelector/ComplexSelector.test.tsx +236 -17
- package/src/ComplexSelector/ComplexSelector.tsx +69 -4
- package/src/ComplexSelector/__tests__/ComplexSelector.a11y.chromium.spec.ts +965 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +1 -1
- package/src/ContextMenu/ContextMenu.spec.md +38 -30
- package/src/ContextMenu/ContextMenu.test.tsx +189 -11
- package/src/ContextMenu/ContextMenu.tsx +75 -17
- package/src/ContextMenu/__tests__/ContextMenuAudit.a11y.chromium.spec.ts +1 -0
- package/src/ContextMenu/__tests__/ContextMenuCursorAnchor.a11y.browser.spec.ts +1 -0
- package/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts +117 -0
- package/src/DateInput/DateInput.tsx +9 -4
- package/src/DateInput/DateInputTouch.test.tsx +10 -1
- package/src/DateInput/NativeDateField.tsx +2 -1
- package/src/DateInput/TouchDateField.tsx +2 -1
- package/src/DateInput/Wheel.tsx +4 -1
- package/src/DateInput/__tests__/DateInputAudit.a11y.chromium.spec.ts +1 -0
- package/src/DateInput/__tests__/WheelPinchZoom.a11y.chromium.spec.ts +171 -0
- package/src/Dialog/Dialog.doc.mjs +201 -47
- package/src/Dialog/Dialog.spec.md +20 -4
- package/src/Dialog/Dialog.tsx +37 -10
- package/src/Dialog/__tests__/Dialog.a11y.browser.spec.ts +1 -0
- package/src/Dialog/__tests__/Dialog.a11y.chromium.spec.ts +1 -0
- package/src/Dialog/__tests__/Dialog.reduced-motion.a11y.browser.spec.ts +252 -0
- package/src/Divider/Divider.spec.md +79 -70
- package/src/Drawer/Drawer.tsx +38 -35
- package/src/Drawer/__tests__/DrawerAudit.a11y.chromium.spec.ts +1 -0
- package/src/Drawer/__tests__/DrawerHeaderAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/DropdownMenu.spec.md +14 -6
- package/src/DropdownMenu/DropdownMenu.ssr.test.tsx +44 -8
- package/src/DropdownMenu/DropdownMenu.test.tsx +107 -5
- package/src/DropdownMenu/DropdownMenu.tsx +51 -34
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuGroup.tsx +12 -6
- package/src/DropdownMenu/DropdownMenuItem.tsx +5 -5
- package/src/DropdownMenu/DropdownMenuRadioItem.doc.mjs +5 -2
- package/src/DropdownMenu/DropdownMenuRadioItem.spec.md +226 -0
- package/src/DropdownMenu/DropdownMenuRadioItem.tsx +32 -16
- package/src/DropdownMenu/DropdownMenuSelectable.test.tsx +158 -0
- package/src/DropdownMenu/DropdownMenuSheetFirstOpen.test.tsx +72 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +9 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.spec.md +225 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +105 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +6 -6
- package/src/DropdownMenu/MenuBottomSheet.tsx +42 -7
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +3 -3
- package/src/DropdownMenu/__tests__/DropdownMenuDividerAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuDrillIn.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuFocusReturn.a11y.browser.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuGroupAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuItemAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuRadioGroupAudit.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/DropdownMenuRadioItemAudit.a11y.chromium.spec.ts +540 -0
- package/src/DropdownMenu/__tests__/DropdownMenuSubMenuAudit.a11y.chromium.spec.ts +671 -0
- package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuHeaderFooter.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuHoverFocus.a11y.chromium.spec.ts +238 -0
- package/src/DropdownMenu/__tests__/MenuPinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/MenuPress.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/__tests__/SubMenuHeaderFooter.a11y.chromium.spec.ts +1 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +28 -2
- package/src/DropdownMenu/menuBottomSheet.stylex.ts +33 -0
- package/src/DropdownMenu/menuItemHover.ts +13 -1
- package/src/DropdownMenu/menuTouchAction.stylex.ts +28 -0
- package/src/DropdownMenu/modules/useMenuPress.spec.md +90 -62
- package/src/DropdownMenu/useMenuDrillIn.tsx +7 -5
- package/src/EmptyState/EmptyState.announce.test.tsx +227 -0
- package/src/EmptyState/EmptyState.doc.mjs +1 -1
- package/src/EmptyState/EmptyState.spec.md +22 -14
- package/src/EmptyState/EmptyState.test.tsx +8 -8
- package/src/EmptyState/EmptyState.tsx +7 -5
- package/src/Field/Field.spec.md +57 -48
- package/src/Field/Field.tsx +1 -1
- package/src/Field/FieldLabel.spec.md +70 -59
- package/src/Field/FieldLabel.tsx +1 -1
- package/src/Field/PanelSearchInput.tsx +23 -13
- package/src/Field/__tests__/FieldLabelAudit.a11y.chromium.spec.ts +1 -0
- package/src/Field/inputDisabledFocus.ts +28 -0
- package/src/Field/inputStyles.stylex.ts +15 -15
- package/src/FieldStatus/FieldStatus.test.tsx +12 -0
- package/src/FieldStatus/FieldStatus.tsx +12 -3
- package/src/FieldStatus/__tests__/StatusMessage.a11y.chromium.spec.ts +1 -0
- package/src/FileInput/FileInput.doc.mjs +1 -1
- package/src/FileInput/FileInput.test.tsx +102 -0
- package/src/FileInput/FileInput.tsx +18 -12
- package/src/FormLayout/FormLayout.spec.md +69 -51
- package/src/Grid/Grid.spec.md +72 -69
- package/src/Grid/GridSpan.spec.md +158 -0
- package/src/Heading/Heading.spec.md +198 -0
- package/src/HoverCard/HoverCard.spec.md +244 -0
- package/src/HoverCard/HoverCard.test.tsx +93 -3
- package/src/Icon/Icon.doc.mjs +67 -5
- package/src/Icon/Icon.test.tsx +548 -9
- package/src/Icon/Icon.tsx +79 -15
- package/src/Icon/IconSize.stylex.ts +27 -11
- package/src/Icon/globalIconRegistry.test.tsx +395 -3
- package/src/Icon/globalIconRegistry.tsx +184 -36
- package/src/Icon/index.ts +29 -1
- package/src/Icon/useIcon.ts +5 -1
- package/src/IconButton/IconButton.spec.md +197 -0
- package/src/IconButton/IconButton.test.tsx +5 -2
- package/src/InputGroup/InputGroup.spec.md +199 -0
- package/src/InputGroup/InputGroup.test.tsx +120 -0
- package/src/InputGroup/InputGroup.tsx +59 -52
- package/src/InputGroup/InputGroupInternalContext.ts +15 -0
- package/src/InputGroup/InputGroupText.spec.md +139 -0
- package/src/InputGroup/InputGroupText.tsx +2 -0
- package/src/InputGroup/groupStyles.ts +22 -11
- package/src/Item/Item.test.tsx +158 -1
- package/src/Item/Item.tsx +42 -7
- package/src/Item/ItemMarkerColumns.a11y.chromium.spec.ts +211 -0
- package/src/Item/ItemMarkerColumnsContext.tsx +20 -0
- package/src/Item/ItemSwipeLayer.tsx +9 -0
- package/src/Item/__tests__/ItemSwipeActions.a11y.chromium.spec.ts +1 -0
- package/src/Item/__tests__/ItemSwipePinchZoom.a11y.chromium.spec.ts +186 -0
- package/src/Item/useSwipeAction.ts +71 -5
- package/src/Kbd/Kbd.test.tsx +95 -0
- package/src/Kbd/Kbd.tsx +30 -23
- package/src/Layer/LayerProvider.spec.md +149 -0
- package/src/Layer/__tests__/LayerReducedMotion.a11y.chromium.spec.ts +176 -0
- package/src/Layer/__tests__/TouchTrigger.a11y.chromium.spec.ts +200 -0
- package/src/Layer/layerAnimations.stylex.ts +22 -2
- package/src/Layer/layerDismissalInvariants.test.tsx +9 -0
- package/src/Layer/layerSlideRules.ts +141 -8
- package/src/Layer/layerStack.ts +129 -62
- package/src/Layer/modalOutlet.ts +156 -15
- package/src/Layer/preserveAnimations.ts +304 -0
- package/src/Layer/useLayer.doc.mjs +1 -1
- package/src/Layer/useLayer.test.tsx +850 -0
- package/src/Layer/useLayer.tsx +644 -58
- package/src/Layer/useLayerDismissal.test.tsx +85 -2
- package/src/Layer/useLayerDismissal.ts +12 -9
- package/src/Layer/useTouchTrigger.ts +95 -41
- package/src/Layout/Layout.tsx +18 -0
- package/src/Layout/LayoutContent.tsx +5 -14
- package/src/Layout/LayoutFooter.tsx +2 -0
- package/src/Layout/LayoutHeader.tsx +2 -0
- package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +1 -0
- package/src/Layout/layoutEdges.stylex.ts +25 -0
- package/src/Lightbox/Lightbox.spec.md +9 -8
- package/src/Lightbox/Lightbox.test.tsx +83 -0
- package/src/Lightbox/Lightbox.tsx +149 -125
- package/src/Lightbox/LightboxKeyboard.a11y.browser.spec.ts +78 -0
- package/src/Lightbox/LightboxViewport.a11y.browser.spec.ts +70 -0
- package/src/Link/Link.spec.md +229 -0
- package/src/Link/LinkProvider.spec.md +167 -0
- package/src/Link/__tests__/Link.a11y.chromium.spec.ts +1 -0
- package/src/Link/__tests__/Link.navigation.a11y.chromium.spec.ts +1 -0
- package/src/List/List.spec.md +113 -34
- package/src/List/List.tsx +13 -1
- package/src/List/ListContext.tsx +19 -5
- package/src/List/ListItem.doc.mjs +3 -3
- package/src/List/ListItem.tsx +97 -28
- package/src/List/ListMarkers.a11y.chromium.spec.ts +904 -0
- package/src/Markdown/Markdown.codeLanguages.test.tsx +137 -0
- package/src/Markdown/Markdown.doc.mjs +12 -0
- package/src/Markdown/Markdown.fr23.bench.ts +3 -1
- package/src/Markdown/Markdown.fr23.perf.test.ts +45 -3
- package/src/Markdown/Markdown.fr23.sampling.ts +13 -4
- package/src/Markdown/Markdown.spec.md +71 -59
- package/src/Markdown/Markdown.test.tsx +50 -0
- package/src/Markdown/Markdown.tsx +61 -8
- package/src/Markdown/MarkdownTable.a11y.chromium.spec.ts +1 -0
- package/src/Markdown/__tests__/MarkdownNesting.a11y.chromium.spec.ts +1 -0
- package/src/MobileNav/MobileNav.doc.mjs +2 -2
- package/src/MobileNav/MobileNav.spec.md +161 -64
- package/src/MobileNav/MobileNav.test.tsx +27 -10
- package/src/MobileNav/MobileNav.tsx +51 -38
- package/src/MobileNav/MobileNavPinchZoom.a11y.chromium.spec.ts +1 -0
- package/src/MobileNav/MobileNavToggle.test.tsx +63 -0
- package/src/MobileNav/MobileNavToggle.tsx +13 -5
- package/src/MobileNav/__tests__/MobileNavWidth.a11y.chromium.spec.ts +103 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +2 -2
- package/src/MoreMenu/MoreMenu.spec.md +88 -53
- package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +67 -9
- package/src/MultiSelector/MultiSelector.disabledFocus.a11y.chromium.spec.ts +1 -0
- package/src/MultiSelector/MultiSelector.test.tsx +122 -10
- package/src/MultiSelector/MultiSelector.tsx +24 -4
- package/src/MultiSelector/OptionActions.a11y.chromium.spec.ts +1 -0
- package/src/MultiSelector/__tests__/MultiSelector.a11y.chromium.spec.ts +1 -0
- package/src/NavIcon/NavIcon.spec.md +66 -38
- package/src/NavMenu/NavHeadingMenu.spec.md +104 -46
- package/src/NavMenu/NavHeadingMenu.test.tsx +276 -2
- package/src/NavMenu/NavHeadingMenu.tsx +42 -4
- package/src/NavMenu/NavHeadingMenuItem.tsx +60 -6
- package/src/NavMenu/NavMenuContext.tsx +11 -0
- package/src/NavMenu/__tests__/NavMenusSlideSelection.a11y.chromium.spec.ts +137 -0
- package/src/NumberInput/NumberInput.doc.mjs +6 -6
- package/src/NumberInput/NumberInput.spec.md +248 -0
- package/src/NumberInput/NumberInput.test.tsx +187 -14
- package/src/NumberInput/NumberInput.tsx +86 -24
- package/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts +1 -0
- package/src/Overlay/Overlay.doc.mjs +2 -2
- package/src/Overlay/Overlay.test.tsx +72 -4
- package/src/Overlay/Overlay.tsx +18 -8
- package/src/Pagination/Pagination.test.tsx +2 -2
- package/src/Popover/Popover.doc.mjs +38 -2
- package/src/Popover/Popover.spec.md +90 -11
- package/src/Popover/Popover.test.tsx +340 -2
- package/src/Popover/Popover.tsx +401 -35
- package/src/Popover/PopoverPresentation.test.tsx +952 -0
- package/src/Popover/__tests__/PopoverSecondDocument.a11y.chromium.spec.ts +205 -0
- package/src/Popover/index.ts +5 -1
- package/src/Popover/lazyPopoverBottomSheet.ts +57 -0
- package/src/Popover/usePopover.tsx +11 -5
- package/src/PowerSearch/PowerSearch.spec.md +423 -53
- package/src/PowerSearch/PowerSearch.test.tsx +77 -1
- package/src/PowerSearch/PowerSearch.tsx +7 -5
- package/src/ProgressBar/ProgressBar.test.tsx +12 -0
- package/src/ProgressBar/ProgressBar.tsx +18 -0
- package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +1 -0
- package/src/RadioList/RadioList.spec.md +227 -0
- package/src/RadioList/RadioList.test.tsx +34 -7
- package/src/RadioList/RadioListItem.press.source-build.test.mjs +80 -0
- package/src/RadioList/RadioListItem.spec.md +223 -0
- package/src/RadioList/RadioListItem.tsx +26 -12
- package/src/RadioList/__tests__/RadioGroup.a11y.chromium.spec.ts +1 -0
- package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +1 -0
- package/src/ScrollableArea/ScrollableArea.spec.md +6 -5
- package/src/ScrollableArea/ScrollableArea.test.tsx +5 -0
- package/src/ScrollableArea/ScrollableArea.tsx +4 -0
- package/src/Section/Section.spec.md +102 -44
- package/src/SegmentedControl/SegmentedControl.spec.md +162 -53
- package/src/SegmentedControl/SegmentedControl.test.tsx +46 -0
- package/src/SegmentedControl/SegmentedControl.tsx +7 -3
- package/src/SegmentedControl/SegmentedControlItem.spec.md +206 -0
- package/src/SelectableCard/SelectableCard.doc.mjs +7 -6
- package/src/SelectableCard/SelectableCard.spec.md +230 -0
- package/src/SelectableCard/SelectableCard.test.tsx +11 -1
- package/src/SelectableCard/SelectableCard.tsx +49 -33
- package/src/Selector/Selector.sheetActiveDescendant.test.tsx +95 -0
- package/src/Selector/Selector.spec.md +12 -4
- package/src/Selector/Selector.test.tsx +114 -8
- package/src/Selector/Selector.tsx +30 -6
- package/src/Selector/__tests__/ComboboxField.a11y.chromium.spec.ts +458 -0
- package/src/Selector/__tests__/EmptyStateAnnouncement.a11y.chromium.spec.ts +1 -0
- package/src/Selector/__tests__/Listbox.a11y.chromium.spec.ts +1 -0
- package/src/Selector/__tests__/Selector.a11y.chromium.spec.ts +1 -0
- package/src/Selector/__tests__/Selector.combobox.a11y.chromium.spec.ts +1 -0
- package/src/Selector/hooks.ts +234 -10
- package/src/Selector/useCombobox.doc.mjs +156 -9
- package/src/Selector/useCombobox.public.test.tsx +89 -0
- package/src/Selector/useCombobox.test.tsx +444 -0
- package/src/SideNav/SideNav.spec.md +50 -30
- package/src/SideNav/SideNav.test.tsx +425 -25
- package/src/SideNav/SideNav.tsx +85 -1
- package/src/SideNav/SideNavCollapseButton.spec.md +161 -0
- package/src/SideNav/SideNavHeading.spec.md +226 -0
- package/src/SideNav/SideNavHeading.tsx +102 -6
- package/src/SideNav/SideNavItem.spec.md +246 -0
- package/src/SideNav/SideNavItem.tsx +40 -9
- package/src/SideNav/SideNavRailMotion.test.tsx +620 -0
- package/src/SideNav/SideNavSection.spec.md +153 -0
- package/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts +417 -0
- package/src/SideNav/railMotion.ts +315 -0
- package/src/Skeleton/Skeleton.spec.md +99 -42
- package/src/Skeleton/Skeleton.test.tsx +108 -1
- package/src/Skeleton/Skeleton.tsx +30 -2
- package/src/Slider/Slider.fr10.test.tsx +34 -0
- package/src/Slider/Slider.test.tsx +172 -0
- package/src/Slider/Slider.tsx +70 -14
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +1 -0
- package/src/Spinner/Spinner.spec.md +231 -0
- package/src/Stack/Stack.spec.md +104 -56
- package/src/StatusDot/StatusDot.spec.md +139 -51
- package/src/StatusDot/StatusDot.test.tsx +13 -0
- package/src/StatusDot/StatusDot.tsx +27 -0
- package/src/Stepper/Step.spec.md +206 -0
- package/src/Stepper/Step.tsx +19 -3
- package/src/Stepper/Stepper.test.tsx +50 -0
- package/src/Switch/Switch.focusRing.source-build.test.mjs +81 -0
- package/src/Switch/Switch.spec.md +150 -66
- package/src/Switch/Switch.tsx +11 -9
- package/src/Switch/__tests__/Switch.a11y.chromium.spec.ts +1 -0
- package/src/Switch/switch.markers.stylex.ts +7 -2
- package/src/TabList/Tab.spec.md +201 -0
- package/src/TabList/Tab.tsx +7 -1
- package/src/TabList/TabList.doc.mjs +3 -3
- package/src/TabList/TabList.test.tsx +27 -0
- package/src/TabList/TabMenu.spec.md +198 -0
- package/src/TabList/TabMenu.tsx +24 -1
- package/src/TabList/__tests__/TabListOverflow.interaction.browser.spec.ts +99 -0
- package/src/TabList/__tests__/Tabs.a11y.chromium.spec.ts +1 -0
- package/src/Table/Table.spec.md +54 -30
- package/src/Table/TableCell.tsx +9 -0
- package/src/Table/TableHeaderCell.tsx +2 -0
- package/src/Table/TableRow.tsx +3 -0
- package/src/Table/__tests__/Table.a11y.chromium.spec.ts +129 -0
- package/src/Table/__tests__/Table.a11y.contracts.ts +35 -0
- package/src/Table/__tests__/Table.a11y.renders.tsx +112 -0
- package/src/Table/__tests__/Table.a11y.states.ts +140 -0
- package/src/Table/__tests__/Table.a11y.test.tsx +198 -0
- package/src/Table/__tests__/TableMinWidth.a11y.chromium.spec.ts +1 -0
- package/src/Table/__tests__/TableRowGlide.a11y.browser.spec.ts +382 -0
- package/src/Table/__tests__/TableScroll.a11y.chromium.spec.ts +1 -0
- package/src/Table/__tests__/TableStickyDividers.a11y.browser.spec.ts +560 -0
- package/src/Table/glidingDivider.ts +336 -0
- package/src/Table/plugins/columnResize/useTableColumnResize.tsx +23 -8
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.glide.test.tsx +280 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx +91 -9
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +471 -10
- package/src/Table/plugins/rowStatus/useTableRowStatus.spec.md +4 -4
- package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.test.tsx +174 -0
- package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.ts +86 -0
- package/src/Table/plugins/sortable/useTableSortable.test.tsx +0 -12
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.test.tsx +51 -1
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +312 -12
- package/src/Table/rowDivider.ts +154 -0
- package/src/Table/useTableRowExpansion.doc.mjs +8 -0
- package/src/Text/Text.spec.md +114 -127
- package/src/TextArea/TextArea.doc.mjs +6 -6
- package/src/TextArea/TextArea.spec.md +164 -64
- package/src/TextArea/TextArea.test.tsx +65 -6
- package/src/TextArea/TextArea.tsx +27 -15
- package/src/TextInput/TextInput.doc.mjs +8 -8
- package/src/TextInput/TextInput.spec.md +260 -0
- package/src/TextInput/TextInput.test.tsx +126 -10
- package/src/TextInput/TextInput.tsx +57 -23
- package/src/TextInput/__tests__/TextInput.a11y.chromium.spec.ts +1 -0
- package/src/Thumbnail/Thumbnail.doc.mjs +1 -2
- package/src/Thumbnail/Thumbnail.spec.md +244 -0
- package/src/Thumbnail/Thumbnail.test.tsx +120 -7
- package/src/Thumbnail/Thumbnail.tsx +77 -31
- package/src/TimeInput/TimeInput.spec.md +273 -0
- package/src/TimeInput/TimeInput.tsx +12 -4
- package/src/TimeInput/TouchTimeField.tsx +2 -1
- package/src/Timestamp/Timestamp.spec.md +252 -0
- package/src/Toast/Toast.spec.md +300 -0
- package/src/Toast/ToastViewport.modalHost.test.tsx +630 -5
- package/src/Toast/ToastViewport.test.tsx +137 -0
- package/src/Toast/ToastViewport.tsx +63 -6
- package/src/ToggleButton/ToggleButton.spec.md +256 -0
- package/src/ToggleButton/ToggleButtonGroup.spec.md +195 -0
- package/src/ToggleButton/__tests__/ToggleButton.a11y.chromium.spec.ts +1 -0
- package/src/Token/Token.spec.md +271 -0
- package/src/Token/__tests__/TokenRemoveTarget.a11y.chromium.spec.ts +1 -0
- package/src/Tokenizer/Tokenizer.props-type.test.tsx +126 -0
- package/src/Tokenizer/Tokenizer.spec.md +313 -72
- package/src/Tokenizer/Tokenizer.ssr.test.tsx +196 -0
- package/src/Tokenizer/Tokenizer.test.tsx +44 -8
- package/src/Tokenizer/Tokenizer.tsx +586 -41
- package/src/Tokenizer/TokenizerBottomSheet.test.tsx +2719 -0
- package/src/Tokenizer/TokenizerBottomSheet.tsx +957 -0
- package/src/Tokenizer/__tests__/TokenizerEndLane.a11y.chromium.spec.ts +61 -27
- package/src/Toolbar/Toolbar.spec.md +103 -49
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/Tooltip.spec.md +161 -36
- package/src/Tooltip/Tooltip.test.tsx +171 -3
- package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/__tests__/Tooltip.a11y.states.ts +2 -2
- package/src/Tooltip/__tests__/TooltipFocusReturn.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/__tests__/TooltipHoverBridge.a11y.chromium.spec.ts +1 -0
- package/src/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts +673 -0
- package/src/Tooltip/__tests__/TooltipTallContentTracking.a11y.browser.spec.ts +1162 -0
- package/src/Tooltip/useTooltip.tsx +7 -2
- package/src/TopNav/TopNav.spec.md +190 -0
- package/src/TopNav/TopNav.test.tsx +89 -0
- package/src/TopNav/TopNavHeading.spec.md +211 -0
- package/src/TopNav/TopNavHeading.tsx +35 -2
- package/src/TopNav/TopNavItem.spec.md +189 -0
- package/src/TopNav/TopNavMegaMenu.reduced-motion.source-build.test.mjs +83 -0
- package/src/TopNav/TopNavMegaMenu.spec.md +190 -0
- package/src/TopNav/TopNavMegaMenu.tsx +21 -4
- package/src/TopNav/TopNavMegaMenuFeaturedCard.spec.md +150 -0
- package/src/TopNav/TopNavMegaMenuItem.spec.md +155 -0
- package/src/TopNav/TopNavMenu.spec.md +202 -0
- package/src/TopNav/TopNavMenu.test.tsx +65 -1
- package/src/TopNav/TopNavMenu.tsx +30 -1
- package/src/TopNav/__tests__/TopNavMobileLongHeading.a11y.chromium.spec.ts +1 -0
- package/src/TreeList/TreeList.doc.mjs +13 -0
- package/src/TreeList/TreeList.spec.md +54 -35
- package/src/TreeList/TreeList.tsx +234 -2
- package/src/TreeList/TreeListBranches.tsx +8 -6
- package/src/TreeList/TreeListItem.tsx +12 -6
- package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +19 -6
- package/src/TreeList/__tests__/TreeListGuideAlignment.interaction.browser.spec.ts +127 -0
- package/src/TreeList/__tests__/TreeListRowNames.a11y.chromium.spec.ts +1 -0
- package/src/Typeahead/BaseTypeahead.emptyState.a11y.chromium.spec.ts +138 -0
- package/src/Typeahead/BaseTypeahead.test.tsx +201 -4
- package/src/Typeahead/BaseTypeahead.tsx +26 -10
- package/src/Typeahead/Typeahead.test.tsx +114 -1
- package/src/Typeahead/Typeahead.tsx +34 -16
- package/src/VisuallyHidden/VisuallyHidden.spec.md +170 -0
- package/src/__tests__/BusyOwnerAnnouncement.test.tsx +66 -5
- package/src/__tests__/CardPress.a11y.chromium.spec.ts +353 -0
- package/src/__tests__/DisabledTriggerFocus.a11y.chromium.spec.ts +2 -1
- package/src/__tests__/PressModality.a11y.chromium.spec.ts +392 -0
- package/src/__tests__/PressedState.a11y.chromium.spec.ts +1 -0
- package/src/__tests__/pressState.ts +43 -1
- package/src/__tests__/unthemedLength.ts +34 -0
- package/src/gestures/GestureArena.ts +966 -0
- package/src/gestures/GestureRecognizer.ts +626 -0
- package/src/gestures/LongPressGestureRecognizer.ts +186 -0
- package/src/gestures/PanGestureRecognizer.ts +410 -0
- package/src/gestures/TapGestureRecognizer.ts +192 -0
- package/src/gestures/VelocityTracker.ts +194 -0
- package/src/gestures/__tests__/LongPressGestureRecognizer.test.ts +141 -0
- package/src/gestures/__tests__/PanGestureRecognizer.test.ts +327 -0
- package/src/gestures/__tests__/TapGestureRecognizer.test.ts +154 -0
- package/src/gestures/__tests__/VelocityTracker.streams.test.ts +243 -0
- package/src/gestures/__tests__/VelocityTracker.test.ts +261 -0
- package/src/gestures/__tests__/arena.test.ts +824 -0
- package/src/gestures/__tests__/arenaContinuous.test.ts +207 -0
- package/src/gestures/__tests__/arenaTapLongPress.test.ts +211 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/README.md +82 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-fling.json +130 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-slow.json +860 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/android-chromium-stop-release.json +357 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-fling.json +66 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-slow.json +268 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/android-firefox-stop-release.json +128 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/capture.html +123 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-fling.json +64 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-slow.json +268 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-mouse-stop-release.json +124 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-fling.json +64 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-slow.json +268 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-pen-stop-release.json +124 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-fling.json +84 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-slow.json +381 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/desktop-chromium-touch-stop-release.json +171 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-fling.json +45 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-slow.json +101 -0
- package/src/gestures/__tests__/fixtures/pointer-streams/ios-safari-stop-release.json +130 -0
- package/src/gestures/__tests__/harness.ts +204 -0
- package/src/gestures/geometry.ts +55 -0
- package/src/gestures/types.ts +161 -0
- package/src/hooks/AnnounceRenderedText.tsx +27 -0
- package/src/hooks/ModalAnnounceProvider.tsx +155 -0
- package/src/hooks/__tests__/MenuPressShadowRoot.a11y.chromium.spec.ts +98 -4
- package/src/hooks/__tests__/menuLinkClicks.ts +71 -0
- package/src/hooks/actionGroupTracker.exports.test.ts +28 -0
- package/src/hooks/actionGroupTracker.test.ts +510 -0
- package/src/hooks/actionGroupTracker.ts +449 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/menuPressOnItems.ts +40 -0
- package/src/hooks/modalAnnounce.ts +439 -0
- package/src/hooks/scrollGeometry.ts +71 -4
- package/src/hooks/useAdaptivePresentation.ts +46 -9
- package/src/hooks/useAnimatedLayout.doc.mjs +101 -0
- package/src/hooks/useAnimatedLayout.ts +61 -0
- package/src/hooks/useAnnounce.doc.mjs +4 -4
- package/src/hooks/useAnnounce.modal.test.tsx +1291 -0
- package/src/hooks/useAnnounce.test.tsx +64 -4
- package/src/hooks/useAnnounce.ts +452 -28
- package/src/hooks/useAnnounceRenderedText.adopters.test.tsx +226 -0
- package/src/hooks/useAnnounceRenderedText.ts +81 -11
- package/src/hooks/useBusyAnnouncement.adopters.test.tsx +69 -0
- package/src/hooks/useBusyAnnouncement.test.tsx +112 -0
- package/src/hooks/useBusyAnnouncement.ts +64 -54
- package/src/hooks/useFocusTrap.doc.mjs +3 -3
- package/src/hooks/useFocusTrap.test.tsx +135 -2
- package/src/hooks/useFocusTrap.ts +59 -27
- package/src/hooks/useMenuHover.ts +6 -2
- package/src/hooks/useMenuPress.doc.mjs +2 -2
- package/src/hooks/useMenuPress.test.tsx +5 -2
- package/src/hooks/useMenuPress.ts +72 -37
- package/src/hooks/usePressFeedback.doc.mjs +4 -4
- package/src/hooks/usePressFeedback.ts +5 -2
- package/src/hooks/useScrollableArea.test.tsx +344 -3
- package/src/hooks/useScrollableArea.ts +120 -12
- package/src/i18n/generated-locales/en.generated.ts +35 -0
- package/src/i18n/generated-locales/pseudo.generated.ts +37 -0
- package/src/internal/tokenizer-presentation.test.ts +29 -0
- package/src/internal/tokenizer-presentation.ts +25 -0
- package/src/internal/touch.test.ts +44 -0
- package/src/internal/touch.ts +41 -0
- package/src/motion/LayoutChangeSnapshot.tsx +50 -0
- package/src/motion/MEASUREMENTS.md +271 -0
- package/src/motion/README.md +218 -0
- package/src/motion/__tests__/animatedLayout.interaction.browser.spec.ts +1613 -0
- package/src/motion/__tests__/animatedLayoutAdopters.interaction.browser.spec.ts +217 -0
- package/src/motion/__tests__/animatedLayoutBundle.ts +17 -0
- package/src/motion/animatedLayout.boundary.test.ts +155 -0
- package/src/motion/animatedLayout.swap.test.ts +827 -0
- package/src/motion/animatedLayout.test.ts +1154 -0
- package/src/motion/animatedLayout.ts +1801 -0
- package/src/motion/animatedLayoutAdopters.test.tsx +500 -0
- package/src/motion/animator.test.ts +2653 -0
- package/src/motion/animator.ts +2794 -0
- package/src/motion/bezier.test.ts +52 -0
- package/src/motion/bezier.ts +64 -0
- package/src/motion/coast.test.ts +99 -0
- package/src/motion/coast.ts +150 -0
- package/src/motion/decay.test.ts +120 -0
- package/src/motion/decay.ts +126 -0
- package/src/motion/projection.test.ts +107 -0
- package/src/motion/projection.ts +116 -0
- package/src/motion/reducedMotion.stylex.ts +41 -0
- package/src/motion/reducedMotion.test.ts +129 -0
- package/src/motion/reducedMotion.ts +94 -0
- package/src/motion/reducedMotionPlan.test.ts +182 -0
- package/src/motion/reducedMotionPlan.ts +263 -0
- package/src/motion/resolveSnapPoint.test.ts +189 -0
- package/src/motion/resolveSnapPoint.ts +169 -0
- package/src/motion/roleValue.ts +105 -0
- package/src/motion/roles.test.ts +256 -0
- package/src/motion/roles.ts +262 -0
- package/src/motion/rubberBand.test.ts +88 -0
- package/src/motion/rubberBand.ts +115 -0
- package/src/motion/selectPage.test.ts +31 -0
- package/src/motion/selectPage.ts +55 -0
- package/src/motion/spring.test.ts +650 -0
- package/src/motion/spring.ts +551 -0
- package/src/motion/transientCopy.ts +374 -0
- package/src/motion/uikit/gestures.test.ts +89 -0
- package/src/motion/uikit/gestures.ts +359 -0
- package/src/motion/uikit/index.ts +80 -0
- package/src/motion/uikit/navigation.ts +83 -0
- package/src/motion/uikit/scroll.ts +141 -0
- package/src/motion/uikit/springRows.test.ts +71 -0
- package/src/motion/uikit/springs.ts +514 -0
- package/src/motion/uikit/timing.ts +210 -0
- package/src/motion/uikit/uikit.test.ts +364 -0
- package/src/motion/uikit/values.test.ts +110 -0
- package/src/reset.a11y.chromium.spec.ts +1 -0
- package/src/reset.until-found.a11y.browser.spec.ts +1 -0
- package/src/serverSafeComponents.test.ts +10 -0
- package/src/tailwind-theme.css +51 -1
- package/src/tailwind-theme.test.ts +51 -0
- package/src/theme/Theme.test.tsx +28 -0
- package/src/theme/__tests__/SpacingRootFontSize.a11y.chromium.spec.ts +1 -0
- package/src/theme/declarationBoundary.ts +282 -1
- package/src/theme/defineTheme.test.ts +529 -12
- package/src/theme/defineTheme.ts +231 -19
- package/src/theme/derivedVarRegistry.test.ts +34 -5
- package/src/theme/derivedVarRegistry.ts +4 -0
- package/src/theme/expandMotionScale.test.ts +17 -0
- package/src/theme/extensibleAxes.test.ts +74 -29
- package/src/theme/generateThemeRules.ts +772 -35
- package/src/theme/index.ts +3 -0
- package/src/theme/onMediaTokens.test.ts +186 -0
- package/src/theme/statusColor.ts +189 -0
- package/src/theme/statusRoleDerivation.ts +289 -0
- package/src/theme/syntax/SyntaxTheme.tsx +1 -1
- package/src/theme/syntax/defineSyntaxTheme.ts +1 -1
- package/src/theme/syntax/presets.ts +1 -1
- package/src/theme/syntax/tokens.ts +1 -1
- package/src/theme/themeAdaptations.test.ts +412 -0
- package/src/theme/themeAdaptations.ts +43 -1
- package/src/theme/tokens.stylex.ts +36 -2
- package/src/theme/tokens.test.ts +111 -1
- package/src/theme/tokens.ts +23 -1
- package/src/theme/useTheme.ts +10 -4
- package/src/utils/customPropertyArmLayering.test.ts +131 -0
- package/src/utils/edgeAutoscroll.test.ts +192 -0
- package/src/utils/edgeAutoscroll.ts +111 -0
- package/src/utils/hitArea.test.ts +628 -0
- package/src/utils/hitArea.ts +770 -0
- package/src/utils/interactionOverlay.stylex.ts +4 -1
- package/src/utils/pressFeedback.test.ts +310 -2
- package/src/utils/pressFeedback.ts +306 -54
- package/src/utils/pressGesture.test.ts +50 -0
- package/src/utils/pressGesture.ts +40 -2
- package/src/utils/touchPresentation.test.ts +323 -0
- package/src/utils/touchPresentation.ts +153 -0
package/src/Layer/useLayer.tsx
CHANGED
|
@@ -21,6 +21,7 @@ import React, {
|
|
|
21
21
|
useMemo,
|
|
22
22
|
useRef,
|
|
23
23
|
useState,
|
|
24
|
+
useSyncExternalStore,
|
|
24
25
|
type ReactNode,
|
|
25
26
|
type RefCallback,
|
|
26
27
|
} from 'react';
|
|
@@ -37,9 +38,15 @@ import {layerViewportInset} from './layerViewportInset.stylex';
|
|
|
37
38
|
import {layerInsetProperties} from './layerInset';
|
|
38
39
|
import {
|
|
39
40
|
LAYER_CLEARANCE_PROPERTY,
|
|
41
|
+
LAYER_CLEARS_ANCHOR_ATTRIBUTE,
|
|
42
|
+
LAYER_SCROLLS_ATTRIBUTE,
|
|
43
|
+
LAYER_CLEAR_FALLBACKS_PROPERTY,
|
|
44
|
+
LAYER_TRY_FALLBACKS_PROPERTY,
|
|
40
45
|
ensureSlideRules,
|
|
46
|
+
getAnchorClearFallbacks,
|
|
41
47
|
slideRuleName,
|
|
42
48
|
} from './layerSlideRules';
|
|
49
|
+
import {preserveAnimations} from './preserveAnimations';
|
|
43
50
|
import {useLayerContext} from './LayerContext';
|
|
44
51
|
import {useIsomorphicLayoutEffect} from '../hooks/useIsomorphicLayoutEffect';
|
|
45
52
|
import {overlayPaddingReset} from '../Layout/padding.stylex';
|
|
@@ -416,6 +423,21 @@ interface InternalLayerFields {
|
|
|
416
423
|
wasJustDismissed: () => boolean;
|
|
417
424
|
}
|
|
418
425
|
|
|
426
|
+
/**
|
|
427
|
+
* Context-mode options a core component may pass through `useLayerInternal`;
|
|
428
|
+
* not part of the public `useLayer` options.
|
|
429
|
+
*/
|
|
430
|
+
interface InternalContextLayerOptions extends ContextLayerOptions {
|
|
431
|
+
/**
|
|
432
|
+
* The layer must never settle over its anchor (spec:AST-059 FR4). When the
|
|
433
|
+
* standard fallback list settles it over its anchor, it switches to its
|
|
434
|
+
* anchor-clear list: beside the trigger, then whichever block side is
|
|
435
|
+
* roomier, sized to its room. For a hover-summoned layer, which the hover on
|
|
436
|
+
* its trigger keeps open.
|
|
437
|
+
*/
|
|
438
|
+
keepsAnchorClear?: boolean;
|
|
439
|
+
}
|
|
440
|
+
|
|
419
441
|
type InternalContextLayerReturn = ContextLayerReturn & InternalLayerFields;
|
|
420
442
|
type InternalFixedLayerReturn = FixedLayerReturn & InternalLayerFields;
|
|
421
443
|
|
|
@@ -423,6 +445,369 @@ function toCssLength(value: number | string): string {
|
|
|
423
445
|
return typeof value === 'number' ? `${value}px` : value;
|
|
424
446
|
}
|
|
425
447
|
|
|
448
|
+
/**
|
|
449
|
+
* Make the engine choose a shown layer's position option afresh: a browser
|
|
450
|
+
* keeps a laid-out layer on the option it last used until the layer stops
|
|
451
|
+
* being rendered, so the layer is taken out of rendering for one forced
|
|
452
|
+
* layout and restored, in the same task. No frame paints in between and the
|
|
453
|
+
* popover stays open, so no toggle event fires and focus and hover are
|
|
454
|
+
* untouched. Every CSS animation and transition of the layer and its content
|
|
455
|
+
* is put back in the state it was in (`preserveAnimations`).
|
|
456
|
+
*/
|
|
457
|
+
function placeAfresh(layer: HTMLElement): void {
|
|
458
|
+
preserveAnimations(layer, () => {
|
|
459
|
+
const display = layer.style.display;
|
|
460
|
+
layer.style.display = 'none';
|
|
461
|
+
layer.getBoundingClientRect();
|
|
462
|
+
layer.style.display = display;
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
const TRANSFORM_PROPERTIES = ['transform', 'translate', 'scale', 'rotate'];
|
|
467
|
+
|
|
468
|
+
function hasTransform(style: CSSStyleDeclaration): boolean {
|
|
469
|
+
return TRANSFORM_PROPERTIES.some(name => {
|
|
470
|
+
const value = style.getPropertyValue(name);
|
|
471
|
+
return value !== '' && value !== 'none';
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* `rect`, the box of an element whose computed style still carries a 2D
|
|
477
|
+
* transform, with that transform undone: the transformed box's centre is the
|
|
478
|
+
* image of the element's centre, so undoing the transform about its origin on
|
|
479
|
+
* that centre gives the untransformed box, at the element's layout size. A
|
|
480
|
+
* transform this cannot undo (3D, or a rotation in another unit) leaves `rect`
|
|
481
|
+
* as it is.
|
|
482
|
+
*/
|
|
483
|
+
function untransform(
|
|
484
|
+
rect: DOMRect,
|
|
485
|
+
layer: HTMLElement,
|
|
486
|
+
style: CSSStyleDeclaration,
|
|
487
|
+
): DOMRect {
|
|
488
|
+
const set = (value: string) => value !== '' && value !== 'none';
|
|
489
|
+
if (typeof DOMMatrix === 'undefined' || layer.offsetWidth <= 0) {
|
|
490
|
+
return rect;
|
|
491
|
+
}
|
|
492
|
+
// The individual transform properties apply before `transform`, in this
|
|
493
|
+
// order (CSS Transforms 2).
|
|
494
|
+
let matrix = new DOMMatrix();
|
|
495
|
+
if (set(style.translate)) {
|
|
496
|
+
const [x = '0', y = '0', z] = style.translate.split(' ');
|
|
497
|
+
if (z != null) {
|
|
498
|
+
return rect;
|
|
499
|
+
}
|
|
500
|
+
matrix = matrix.translate(parseFloat(x), parseFloat(y));
|
|
501
|
+
}
|
|
502
|
+
if (set(style.rotate)) {
|
|
503
|
+
if (!/^-?[\d.]+deg$/.test(style.rotate)) {
|
|
504
|
+
return rect;
|
|
505
|
+
}
|
|
506
|
+
matrix = matrix.rotate(parseFloat(style.rotate));
|
|
507
|
+
}
|
|
508
|
+
if (set(style.scale)) {
|
|
509
|
+
const [x = '1', y = x, z] = style.scale.split(' ');
|
|
510
|
+
if (z != null) {
|
|
511
|
+
return rect;
|
|
512
|
+
}
|
|
513
|
+
matrix = matrix.scale(parseFloat(x), parseFloat(y));
|
|
514
|
+
}
|
|
515
|
+
if (set(style.transform)) {
|
|
516
|
+
matrix = matrix.multiply(new DOMMatrix(style.transform));
|
|
517
|
+
}
|
|
518
|
+
if (!matrix.is2D) {
|
|
519
|
+
return rect;
|
|
520
|
+
}
|
|
521
|
+
const [originX = 0, originY = 0] = style.transformOrigin
|
|
522
|
+
.split(' ')
|
|
523
|
+
.map(value => parseFloat(value));
|
|
524
|
+
const width = layer.offsetWidth;
|
|
525
|
+
const height = layer.offsetHeight;
|
|
526
|
+
const centre = matrix.transformPoint(
|
|
527
|
+
new DOMPoint(width / 2 - originX, height / 2 - originY),
|
|
528
|
+
);
|
|
529
|
+
const left = rect.left + rect.width / 2 - centre.x - originX;
|
|
530
|
+
const top = rect.top + rect.height / 2 - centre.y - originY;
|
|
531
|
+
return new DOMRect(left, top, width, height);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* The layer's box where its position option put it, without the transform an
|
|
536
|
+
* entry animation (or anything else) applies to it: a Tooltip enters from a
|
|
537
|
+
* few pixels toward its trigger, scaled down, so the transformed box of a
|
|
538
|
+
* tooltip that fits beside its trigger can read as covering it while it
|
|
539
|
+
* enters. The layer's transforms are overridden with `none !important`, which
|
|
540
|
+
* outranks an animation, for this one read and then restored, in the same
|
|
541
|
+
* task: no frame paints in between and the animation keeps running. Where the
|
|
542
|
+
* engine still applies an animated transform under that override (WebKit),
|
|
543
|
+
* the read box has that transform undone instead (`untransform`). A layer
|
|
544
|
+
* that transitions a transform property is not overridden, since restoring the
|
|
545
|
+
* value would start that transition; its box has its transform undone.
|
|
546
|
+
*/
|
|
547
|
+
function settledBox(layer: HTMLElement): DOMRect {
|
|
548
|
+
const view = layer.ownerDocument.defaultView;
|
|
549
|
+
const style = view?.getComputedStyle(layer);
|
|
550
|
+
if (style == null || !hasTransform(style)) {
|
|
551
|
+
return layer.getBoundingClientRect();
|
|
552
|
+
}
|
|
553
|
+
const transitions = style.transitionProperty.split(',').map(p => p.trim());
|
|
554
|
+
const durations = style.transitionDuration.split(',').map(parseFloat);
|
|
555
|
+
const transitioned = transitions.some(
|
|
556
|
+
(name, index) =>
|
|
557
|
+
(name === 'all' || TRANSFORM_PROPERTIES.includes(name)) &&
|
|
558
|
+
(durations[index % durations.length] ?? 0) > 0,
|
|
559
|
+
);
|
|
560
|
+
if (transitioned) {
|
|
561
|
+
return untransform(layer.getBoundingClientRect(), layer, style);
|
|
562
|
+
}
|
|
563
|
+
const saved = TRANSFORM_PROPERTIES.map(
|
|
564
|
+
name =>
|
|
565
|
+
[
|
|
566
|
+
name,
|
|
567
|
+
layer.style.getPropertyValue(name),
|
|
568
|
+
layer.style.getPropertyPriority(name),
|
|
569
|
+
] as const,
|
|
570
|
+
);
|
|
571
|
+
for (const name of TRANSFORM_PROPERTIES) {
|
|
572
|
+
layer.style.setProperty(name, 'none', 'important');
|
|
573
|
+
}
|
|
574
|
+
const box = layer.getBoundingClientRect();
|
|
575
|
+
const under = view?.getComputedStyle(layer);
|
|
576
|
+
const settled =
|
|
577
|
+
under != null && hasTransform(under) ? untransform(box, layer, under) : box;
|
|
578
|
+
for (const [name, value, priority] of saved) {
|
|
579
|
+
if (value === '') {
|
|
580
|
+
layer.style.removeProperty(name);
|
|
581
|
+
} else {
|
|
582
|
+
layer.style.setProperty(name, value, priority);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return settled;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Whether the standard list has failed a layer that must keep its anchor
|
|
590
|
+
* clear: its box covers the anchor or, while the anchor is in view, leaves the
|
|
591
|
+
* viewport on the block axis. Only a box that overlaps the anchor counts; a
|
|
592
|
+
* layer flush against it does not.
|
|
593
|
+
*/
|
|
594
|
+
function failsAnchor(layer: HTMLElement, anchor: HTMLElement): boolean {
|
|
595
|
+
const a = anchor.getBoundingClientRect();
|
|
596
|
+
const l = settledBox(layer);
|
|
597
|
+
if (l.width <= 0 || l.height <= 0) {
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
600
|
+
const covers =
|
|
601
|
+
l.left < a.right &&
|
|
602
|
+
a.left < l.right &&
|
|
603
|
+
l.top < a.bottom &&
|
|
604
|
+
a.top < l.bottom;
|
|
605
|
+
// The viewport's block extent, as the layer's anchor positioning sees it.
|
|
606
|
+
const viewportBlock = layer.ownerDocument.documentElement.clientHeight;
|
|
607
|
+
const anchorInView = a.bottom > 0 && a.top < viewportBlock;
|
|
608
|
+
return covers || (anchorInView && (l.top < 0 || l.bottom > viewportBlock));
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* For a layer that must never settle over its anchor (spec:AST-059 FR4): read
|
|
613
|
+
* where its fallback list settled it and, if its box covers the anchor or,
|
|
614
|
+
* while the anchor is in view, leaves the viewport on the block axis, switch it
|
|
615
|
+
* to its anchor-clear list; then let it scroll only if its content overflows
|
|
616
|
+
* the box it was given (FR3). Engines differ in where they leave a box that
|
|
617
|
+
* fits no option: Chromium shifts it into the viewport, over the anchor; WebKit
|
|
618
|
+
* keeps it at its preferred position, partly off-screen. Either way the
|
|
619
|
+
* standard list has failed it. The runtime calls this in the same task as
|
|
620
|
+
* every show and remount, and while the layer is open whenever its size, its
|
|
621
|
+
* content's size, its anchor's size or the viewport changes; each of those
|
|
622
|
+
* reads lands before the next frame paints. A same-size anchor that moves on
|
|
623
|
+
* screen, in layout or because something scrolled, is read after paint, from
|
|
624
|
+
* the anchor-move observer (FR8). Scroll events are not read: during one the
|
|
625
|
+
* anchor has moved but the layer anchored to it not yet, so the read would
|
|
626
|
+
* compare a moved anchor with a stale layer. Once switched, a layer keeps its
|
|
627
|
+
* anchor-clear list until it next opens, so it never jumps back over its
|
|
628
|
+
* trigger while open; it is placed afresh (`placeAfresh`) only when the switch
|
|
629
|
+
* does not take effect at once, or when a later read finds it failing again.
|
|
630
|
+
*/
|
|
631
|
+
function keepAnchorClear(layer: HTMLElement, anchor: HTMLElement | null): void {
|
|
632
|
+
if (anchor && failsAnchor(layer, anchor)) {
|
|
633
|
+
const switching = !layer.hasAttribute(LAYER_CLEARS_ANCHOR_ATTRIBUTE);
|
|
634
|
+
layer.setAttribute(LAYER_CLEARS_ANCHOR_ATTRIBUTE, '');
|
|
635
|
+
// A switch usually takes effect at once. The engine may instead keep the
|
|
636
|
+
// option it last used, even one the new list does not contain or one a
|
|
637
|
+
// scroll has since made fail: then, and on any later read that finds the
|
|
638
|
+
// switched layer failing again, place it afresh.
|
|
639
|
+
if (!switching || failsAnchor(layer, anchor)) {
|
|
640
|
+
placeAfresh(layer);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
// A layer that fits has no scroll range and stays a plain box, so a wheel
|
|
644
|
+
// over it still scrolls the page.
|
|
645
|
+
layer.toggleAttribute(
|
|
646
|
+
LAYER_SCROLLS_ATTRIBUTE,
|
|
647
|
+
layer.scrollHeight > layer.clientHeight + 1,
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Call `onMove` when an element moves on screen without changing size: in
|
|
653
|
+
* layout (a sibling above it grows, a margin changes) or because something
|
|
654
|
+
* scrolled. ResizeObserver sees only size. The element is observed by an
|
|
655
|
+
* IntersectionObserver whose root is the viewport shrunk, through
|
|
656
|
+
* `rootMargin`, to the element's own rectangle (the layout-shift technique of
|
|
657
|
+
* `@floating-ui/dom`'s `observeMove`), so any move changes the intersection
|
|
658
|
+
* ratio and fires the callback, which calls `onMove` and re-arms on the new
|
|
659
|
+
* rectangle. Intersection callbacks run after the frame that moved the
|
|
660
|
+
* element has painted, so the caller corrects that move in the next frame.
|
|
661
|
+
*
|
|
662
|
+
* A fresh observer's first report can already differ from its threshold: the
|
|
663
|
+
* element is partly outside the viewport, or it kept moving between the
|
|
664
|
+
* rectangle read and the observer's first check, as it does every frame of a
|
|
665
|
+
* smooth scroll. Any such report calls `onMove` and re-arms, at the reported
|
|
666
|
+
* ratio, or at once on the element's new rectangle when the report is 0 and
|
|
667
|
+
* the element moved, so a move that spans many frames is followed frame by
|
|
668
|
+
* frame. A report of 0 for an element that has not moved means a scrolled
|
|
669
|
+
* container clips it wholly; re-arming then would report 0 again every frame.
|
|
670
|
+
* Instead a second IntersectionObserver, rooted at the viewport with a
|
|
671
|
+
* threshold of 0 (it counts every ancestor's overflow clip), waits for the
|
|
672
|
+
* element to come back into view, then calls `onMove` and re-arms. Nothing
|
|
673
|
+
* runs on a timer. Returns the function that stops observing.
|
|
674
|
+
*/
|
|
675
|
+
function observeMove(element: HTMLElement, onMove: () => void): () => void {
|
|
676
|
+
const doc = element.ownerDocument;
|
|
677
|
+
if (typeof IntersectionObserver === 'undefined') {
|
|
678
|
+
return () => {};
|
|
679
|
+
}
|
|
680
|
+
let observer: IntersectionObserver | null = null;
|
|
681
|
+
let visibility: IntersectionObserver | null = null;
|
|
682
|
+
const stop = () => {
|
|
683
|
+
observer?.disconnect();
|
|
684
|
+
observer = null;
|
|
685
|
+
visibility?.disconnect();
|
|
686
|
+
visibility = null;
|
|
687
|
+
};
|
|
688
|
+
const moved = (threshold: number) => {
|
|
689
|
+
onMove();
|
|
690
|
+
arm(threshold);
|
|
691
|
+
};
|
|
692
|
+
const arm = (threshold: number) => {
|
|
693
|
+
stop();
|
|
694
|
+
const root = doc.documentElement;
|
|
695
|
+
const rect = element.getBoundingClientRect();
|
|
696
|
+
if (rect.width === 0 || rect.height === 0) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
const top = Math.floor(rect.top);
|
|
700
|
+
const left = Math.floor(rect.left);
|
|
701
|
+
const right = Math.floor(root.clientWidth - rect.right);
|
|
702
|
+
const bottom = Math.floor(root.clientHeight - rect.bottom);
|
|
703
|
+
const hasMoved = () => {
|
|
704
|
+
const now = element.getBoundingClientRect();
|
|
705
|
+
return (
|
|
706
|
+
now.top !== rect.top ||
|
|
707
|
+
now.left !== rect.left ||
|
|
708
|
+
now.width !== rect.width ||
|
|
709
|
+
now.height !== rect.height
|
|
710
|
+
);
|
|
711
|
+
};
|
|
712
|
+
// Clipped by a scrolled container: wait, without a timer, for the
|
|
713
|
+
// element to come back into view. A first report that already finds it
|
|
714
|
+
// in view only counts if it has moved, so a clip the move observer and
|
|
715
|
+
// this one judge differently cannot re-arm every frame.
|
|
716
|
+
const awaitVisible = () => {
|
|
717
|
+
let isFirstVisible = true;
|
|
718
|
+
visibility = new IntersectionObserver(
|
|
719
|
+
entries => {
|
|
720
|
+
const visible = entries[entries.length - 1]?.isIntersecting ?? false;
|
|
721
|
+
const firstVisible = isFirstVisible;
|
|
722
|
+
isFirstVisible = false;
|
|
723
|
+
if (visible && (!firstVisible || hasMoved())) {
|
|
724
|
+
moved(1);
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
{root: doc, threshold: 0},
|
|
728
|
+
);
|
|
729
|
+
visibility.observe(element);
|
|
730
|
+
};
|
|
731
|
+
let isFirst = true;
|
|
732
|
+
observer = new IntersectionObserver(
|
|
733
|
+
entries => {
|
|
734
|
+
const ratio = entries[entries.length - 1]?.intersectionRatio ?? 0;
|
|
735
|
+
const first = isFirst;
|
|
736
|
+
isFirst = false;
|
|
737
|
+
if (ratio === threshold) {
|
|
738
|
+
// Still over its own rectangle, but a move smaller than the
|
|
739
|
+
// rounding of the root margin can leave the ratio at 1.
|
|
740
|
+
if (ratio === 1 && hasMoved()) {
|
|
741
|
+
moved(1);
|
|
742
|
+
}
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
if (!first || ratio > 0) {
|
|
746
|
+
moved(first ? ratio : 1);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
if (hasMoved()) {
|
|
750
|
+
moved(1);
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
if (visibility === null) {
|
|
754
|
+
awaitVisible();
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
root: doc,
|
|
759
|
+
rootMargin: `${-top}px ${-right}px ${-bottom}px ${-left}px`,
|
|
760
|
+
threshold,
|
|
761
|
+
},
|
|
762
|
+
);
|
|
763
|
+
observer.observe(element);
|
|
764
|
+
};
|
|
765
|
+
arm(1);
|
|
766
|
+
return stop;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Watch an open layer that keeps its anchor clear, and its anchor, for every
|
|
771
|
+
* change that can re-settle the layer over the anchor or give it a scroll
|
|
772
|
+
* range (spec:AST-059 FR4, FR8): the layer, its content or the anchor
|
|
773
|
+
* resizing (ResizeObserver, before paint), the viewport resizing (before
|
|
774
|
+
* paint), and the anchor moving on screen without resizing, in layout or by a
|
|
775
|
+
* scroll (`observeMove`, after paint). Each calls `keepAnchorClear` for this layer and anchor while
|
|
776
|
+
* `isCurrent` says they are still the live pair. Returns the function that
|
|
777
|
+
* removes every observer and listener it added.
|
|
778
|
+
*/
|
|
779
|
+
function observeAnchorClearance(
|
|
780
|
+
layer: HTMLElement,
|
|
781
|
+
anchor: HTMLElement,
|
|
782
|
+
isCurrent: () => boolean,
|
|
783
|
+
): () => void {
|
|
784
|
+
const view = layer.ownerDocument.defaultView;
|
|
785
|
+
if (!view) {
|
|
786
|
+
return () => {};
|
|
787
|
+
}
|
|
788
|
+
const reread = () => {
|
|
789
|
+
if (isCurrent()) {
|
|
790
|
+
keepAnchorClear(layer, anchor);
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
let observer: ResizeObserver | null = null;
|
|
794
|
+
if (typeof ResizeObserver !== 'undefined') {
|
|
795
|
+
observer = new ResizeObserver(reread);
|
|
796
|
+
observer.observe(layer);
|
|
797
|
+
for (const child of Array.from(layer.children)) {
|
|
798
|
+
observer.observe(child);
|
|
799
|
+
}
|
|
800
|
+
observer.observe(anchor);
|
|
801
|
+
}
|
|
802
|
+
const stopObservingMove = observeMove(anchor, reread);
|
|
803
|
+
view.addEventListener('resize', reread);
|
|
804
|
+
return () => {
|
|
805
|
+
observer?.disconnect();
|
|
806
|
+
stopObservingMove();
|
|
807
|
+
view.removeEventListener('resize', reread);
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
|
|
426
811
|
/**
|
|
427
812
|
* Popover operations in flight, per document.
|
|
428
813
|
*
|
|
@@ -463,8 +848,88 @@ function isPopoverOperationInFlight(doc: Document): boolean {
|
|
|
463
848
|
interface ContextLayerMount {
|
|
464
849
|
/** Null means the marker's parent is safe and the layer stays inline. */
|
|
465
850
|
portalTarget: HTMLElement | null;
|
|
466
|
-
/**
|
|
467
|
-
|
|
851
|
+
/**
|
|
852
|
+
* Logical writing context lost when moving outside an unsafe ancestor, or
|
|
853
|
+
* null until it is read. A closed layer mounted ahead of its first show
|
|
854
|
+
* reads it in `show()`, before the layer opens: reading computed style for
|
|
855
|
+
* every closed layer on mount forces a style recalculation per layer.
|
|
856
|
+
*/
|
|
857
|
+
portalStyle: React.CSSProperties | null;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Where a context layer is hosted, published to the one component that
|
|
862
|
+
* renders it. The hook resolves the mount from the marker's parent once the
|
|
863
|
+
* marker is in the DOM, and the slot below subscribes to it, so the render
|
|
864
|
+
* that places the layer re-renders the slot alone: the hook's host (a
|
|
865
|
+
* Tooltip, a Popover, a menu) and everything under it render once on mount.
|
|
866
|
+
*/
|
|
867
|
+
interface ContextLayerMountStore {
|
|
868
|
+
readonly get: () => ContextLayerMount | null;
|
|
869
|
+
readonly set: (mount: ContextLayerMount | null) => void;
|
|
870
|
+
readonly subscribe: (onChange: () => void) => () => void;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
function createContextLayerMountStore(): ContextLayerMountStore {
|
|
874
|
+
let mount: ContextLayerMount | null = null;
|
|
875
|
+
const listeners = new Set<() => void>();
|
|
876
|
+
return {
|
|
877
|
+
get: () => mount,
|
|
878
|
+
set: next => {
|
|
879
|
+
if (next === mount) {
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
mount = next;
|
|
883
|
+
for (const listener of listeners) {
|
|
884
|
+
listener();
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
subscribe: onChange => {
|
|
888
|
+
listeners.add(onChange);
|
|
889
|
+
return () => {
|
|
890
|
+
listeners.delete(onChange);
|
|
891
|
+
};
|
|
892
|
+
},
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
const readNoMount = (): ContextLayerMount | null => null;
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* The marker and, once the hook has resolved where it goes, the layer. The
|
|
900
|
+
* server and the hydrating render carry the marker alone, so block content
|
|
901
|
+
* never enters server markup inside `<p>` and its kin; the mount arrives from
|
|
902
|
+
* the marker's ref callback, and only this component re-renders to place the
|
|
903
|
+
* layer.
|
|
904
|
+
*/
|
|
905
|
+
function ContextLayerSlot({
|
|
906
|
+
mountStore,
|
|
907
|
+
renderLayer,
|
|
908
|
+
sentinelRef,
|
|
909
|
+
}: {
|
|
910
|
+
readonly mountStore: ContextLayerMountStore;
|
|
911
|
+
readonly renderLayer: (mount: ContextLayerMount) => ReactNode;
|
|
912
|
+
readonly sentinelRef: RefCallback<HTMLTemplateElement>;
|
|
913
|
+
}) {
|
|
914
|
+
const mount = useSyncExternalStore(
|
|
915
|
+
mountStore.subscribe,
|
|
916
|
+
mountStore.get,
|
|
917
|
+
readNoMount,
|
|
918
|
+
);
|
|
919
|
+
// Keep the marker mounted after resolving the layer. Apart from giving
|
|
920
|
+
// us the real JSX parent on first show, this lets its ref report when a
|
|
921
|
+
// persistent hook's render call moves to a different host.
|
|
922
|
+
const sentinel = <template ref={sentinelRef} />;
|
|
923
|
+
if (mount === null) {
|
|
924
|
+
return <>{sentinel}</>;
|
|
925
|
+
}
|
|
926
|
+
const layer = renderLayer(mount);
|
|
927
|
+
return (
|
|
928
|
+
<>
|
|
929
|
+
{sentinel}
|
|
930
|
+
{mount.portalTarget ? createPortal(layer, mount.portalTarget) : layer}
|
|
931
|
+
</>
|
|
932
|
+
);
|
|
468
933
|
}
|
|
469
934
|
|
|
470
935
|
function readPortalWritingContext(
|
|
@@ -691,10 +1156,12 @@ export function useKeepLayerOpenProps(
|
|
|
691
1156
|
* ```
|
|
692
1157
|
*/
|
|
693
1158
|
function useLayerImplementation(
|
|
694
|
-
options:
|
|
1159
|
+
options: InternalContextLayerOptions | FixedLayerOptions,
|
|
695
1160
|
): InternalContextLayerReturn | InternalFixedLayerReturn {
|
|
696
1161
|
const {mode, onShow, onHide, lightDismiss = false} = options;
|
|
697
1162
|
const lazyMount = mode === 'context' ? (options.lazyMount ?? false) : false;
|
|
1163
|
+
const keepsAnchorClear =
|
|
1164
|
+
mode === 'context' ? (options.keepsAnchorClear ?? false) : false;
|
|
698
1165
|
const id = useId();
|
|
699
1166
|
const anchorId = `--astryx-layer-${id.replace(/:/g, '')}`;
|
|
700
1167
|
|
|
@@ -727,9 +1194,13 @@ function useLayerImplementation(
|
|
|
727
1194
|
// corrective portal, including after the render call moves.
|
|
728
1195
|
const sentinelRef = useRef<HTMLTemplateElement | null>(null);
|
|
729
1196
|
const contextMountRef = useRef<ContextLayerMount | null>(null);
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
1197
|
+
// The resolved mount reaches the slot through this store, never through
|
|
1198
|
+
// state on this hook, so placing the layer renders the slot alone. The
|
|
1199
|
+
// generation counts mounts that REPLACE a resolved one (a render call that
|
|
1200
|
+
// moved to another host): the layer element is recreated then, and the
|
|
1201
|
+
// effects below that bind to it re-run.
|
|
1202
|
+
const [mountStore] = useState(createContextLayerMountStore);
|
|
1203
|
+
const [mountGeneration, setMountGeneration] = useState(0);
|
|
733
1204
|
// A show() that cannot run yet is remembered here and replayed: one that
|
|
734
1205
|
// arrives before the final layer mounts runs when its popover ref attaches;
|
|
735
1206
|
// one that arrives while another popover is mid show/hide runs once that
|
|
@@ -766,12 +1237,18 @@ function useLayerImplementation(
|
|
|
766
1237
|
// trigger is an `SVGElement`, whose dictionary conversion throws
|
|
767
1238
|
// before the popover opens. Omitting the option for it still anchors
|
|
768
1239
|
// the layer, because positioning reads the anchor-name pair, and only
|
|
769
|
-
// gives up the invoker's focus order.
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
1240
|
+
// gives up the invoker's focus order. The check asks the trigger's own
|
|
1241
|
+
// window: an HTML trigger rendered into another document (an iframe,
|
|
1242
|
+
// a Picture-in-Picture window) is not an instance of this window's
|
|
1243
|
+
// `HTMLElement`, and keeps its source.
|
|
1244
|
+
const trigger = triggerRef.current;
|
|
1245
|
+
const triggerView = trigger?.ownerDocument.defaultView;
|
|
1246
|
+
popover.showPopover({
|
|
1247
|
+
source:
|
|
1248
|
+
triggerView != null && trigger instanceof triggerView.HTMLElement
|
|
1249
|
+
? trigger
|
|
1250
|
+
: undefined,
|
|
1251
|
+
});
|
|
775
1252
|
});
|
|
776
1253
|
} else {
|
|
777
1254
|
popover.style.display = 'block';
|
|
@@ -806,24 +1283,74 @@ function useLayerImplementation(
|
|
|
806
1283
|
return;
|
|
807
1284
|
}
|
|
808
1285
|
|
|
1286
|
+
// The slide options' `@position-try` rules (FR4) are installed in the
|
|
1287
|
+
// layer's document before its first paint, here where the mount resolves:
|
|
1288
|
+
// the marker's arrival is the one event every mount has, whether the
|
|
1289
|
+
// render call mounts with its host or later. One sheet serves every layer.
|
|
1290
|
+
ensureSlideRules(sentinel.ownerDocument);
|
|
1291
|
+
|
|
809
1292
|
const portalTarget = resolveLayerPortalTarget(inlineParent);
|
|
1293
|
+
// A mount for a layer that is opening or open reads its writing context
|
|
1294
|
+
// now; a closed layer's waits for its first show.
|
|
1295
|
+
const opening = pendingShowRef.current || isOpenRef.current;
|
|
810
1296
|
const mount: ContextLayerMount = {
|
|
811
1297
|
portalTarget,
|
|
812
|
-
portalStyle:
|
|
813
|
-
|
|
814
|
-
|
|
1298
|
+
portalStyle:
|
|
1299
|
+
portalTarget == null
|
|
1300
|
+
? {}
|
|
1301
|
+
: opening
|
|
1302
|
+
? readPortalWritingContext(sentinel, portalTarget)
|
|
1303
|
+
: null,
|
|
815
1304
|
};
|
|
1305
|
+
const replaced = contextMountRef.current !== null;
|
|
816
1306
|
contextMountRef.current = mount;
|
|
817
|
-
|
|
818
|
-
|
|
1307
|
+
mountStore.set(mount);
|
|
1308
|
+
if (replaced) {
|
|
1309
|
+
setMountGeneration(generation => generation + 1);
|
|
1310
|
+
}
|
|
1311
|
+
}, [mode, mountStore]);
|
|
1312
|
+
|
|
1313
|
+
// Reads the writing context a closed layer's mount deferred, before the
|
|
1314
|
+
// layer opens. It is written on the popover at once, so the first open frame
|
|
1315
|
+
// already has it (layer-runtime INV12), and published to the slot, whose
|
|
1316
|
+
// render writes the same values. A value the caller's own `style` sets is
|
|
1317
|
+
// already inline and wins, as it does in render.
|
|
1318
|
+
const applyDeferredWritingContext = useCallback(
|
|
1319
|
+
(popover: HTMLElement) => {
|
|
1320
|
+
const mount = contextMountRef.current;
|
|
1321
|
+
const sentinel = sentinelRef.current;
|
|
1322
|
+
if (
|
|
1323
|
+
mount === null ||
|
|
1324
|
+
mount.portalTarget === null ||
|
|
1325
|
+
mount.portalStyle !== null ||
|
|
1326
|
+
sentinel === null
|
|
1327
|
+
) {
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
const portalStyle = readPortalWritingContext(
|
|
1331
|
+
sentinel,
|
|
1332
|
+
mount.portalTarget,
|
|
1333
|
+
);
|
|
1334
|
+
if (portalStyle.direction != null && popover.style.direction === '') {
|
|
1335
|
+
popover.style.direction = portalStyle.direction;
|
|
1336
|
+
}
|
|
1337
|
+
if (portalStyle.writingMode != null && popover.style.writingMode === '') {
|
|
1338
|
+
popover.style.writingMode = portalStyle.writingMode;
|
|
1339
|
+
}
|
|
1340
|
+
const next: ContextLayerMount = {...mount, portalStyle};
|
|
1341
|
+
contextMountRef.current = next;
|
|
1342
|
+
mountStore.set(next);
|
|
1343
|
+
},
|
|
1344
|
+
[mountStore],
|
|
1345
|
+
);
|
|
819
1346
|
|
|
820
1347
|
const clearContextMount = useCallback(() => {
|
|
821
1348
|
if (mode !== 'context' || !lazyMount) {
|
|
822
1349
|
return;
|
|
823
1350
|
}
|
|
824
1351
|
contextMountRef.current = null;
|
|
825
|
-
|
|
826
|
-
}, [mode, lazyMount]);
|
|
1352
|
+
mountStore.set(null);
|
|
1353
|
+
}, [mode, lazyMount, mountStore]);
|
|
827
1354
|
|
|
828
1355
|
const show = useCallback(() => {
|
|
829
1356
|
// Every caller lands here, so this is where the dismissing press is
|
|
@@ -855,14 +1382,22 @@ function useLayerImplementation(
|
|
|
855
1382
|
});
|
|
856
1383
|
return;
|
|
857
1384
|
}
|
|
1385
|
+
popover.removeAttribute(LAYER_CLEARS_ANCHOR_ATTRIBUTE);
|
|
1386
|
+
popover.removeAttribute(LAYER_SCROLLS_ATTRIBUTE);
|
|
1387
|
+
applyDeferredWritingContext(popover);
|
|
858
1388
|
showPopoverElement(popover);
|
|
1389
|
+
if (keepsAnchorClear) {
|
|
1390
|
+
keepAnchorClear(popover, triggerRef.current);
|
|
1391
|
+
}
|
|
859
1392
|
isOpenRef.current = true;
|
|
860
1393
|
setIsOpen(true);
|
|
861
1394
|
onShow?.();
|
|
862
1395
|
}
|
|
863
1396
|
}, [
|
|
864
1397
|
onShow,
|
|
1398
|
+
keepsAnchorClear,
|
|
865
1399
|
requestContextMount,
|
|
1400
|
+
applyDeferredWritingContext,
|
|
866
1401
|
showPopoverElement,
|
|
867
1402
|
isCurrentContextPopover,
|
|
868
1403
|
wasJustDismissed,
|
|
@@ -903,6 +1438,12 @@ function useLayerImplementation(
|
|
|
903
1438
|
const showRef = useRef(show);
|
|
904
1439
|
showRef.current = show;
|
|
905
1440
|
|
|
1441
|
+
// The open-state geometry observers of a layer that keeps its anchor clear
|
|
1442
|
+
// (`observeAnchorClearance`), as their teardown. The open-state layout
|
|
1443
|
+
// effect binds them; the trigger callback ref rebinds them when a caller
|
|
1444
|
+
// replaces the trigger element while the layer stays open.
|
|
1445
|
+
const clearObserversRef = useRef<(() => void) | null>(null);
|
|
1446
|
+
|
|
906
1447
|
// Stable ref for the trigger element (context mode only).
|
|
907
1448
|
const contextRef = useCallback(
|
|
908
1449
|
(el: HTMLElement | null) => {
|
|
@@ -916,9 +1457,28 @@ function useLayerImplementation(
|
|
|
916
1457
|
addAnchorName(el, anchorId);
|
|
917
1458
|
}
|
|
918
1459
|
|
|
1460
|
+
const previous = triggerRef.current;
|
|
919
1461
|
triggerRef.current = el;
|
|
1462
|
+
|
|
1463
|
+
// A trigger replaced while the layer is open (React detaches the old
|
|
1464
|
+
// node with `null`, then attaches the new one): the old trigger's
|
|
1465
|
+
// observers are removed before the new trigger's are added (INV6), and
|
|
1466
|
+
// binding them reads the new trigger's geometry at once.
|
|
1467
|
+
if (keepsAnchorClear && isOpenRef.current && el !== previous) {
|
|
1468
|
+
clearObserversRef.current?.();
|
|
1469
|
+
clearObserversRef.current = null;
|
|
1470
|
+
const layer = popoverRef.current;
|
|
1471
|
+
if (el && layer) {
|
|
1472
|
+
clearObserversRef.current = observeAnchorClearance(
|
|
1473
|
+
layer,
|
|
1474
|
+
el,
|
|
1475
|
+
() => popoverRef.current === layer && triggerRef.current === el,
|
|
1476
|
+
);
|
|
1477
|
+
keepAnchorClear(layer, el);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
920
1480
|
},
|
|
921
|
-
[anchorId],
|
|
1481
|
+
[anchorId, keepsAnchorClear],
|
|
922
1482
|
);
|
|
923
1483
|
|
|
924
1484
|
// Arm only when the dismissing gesture's click is still ahead of us. Some
|
|
@@ -1040,6 +1600,9 @@ function useLayerImplementation(
|
|
|
1040
1600
|
// Changing a portal target remounts the popover. Preserve the logical
|
|
1041
1601
|
// open state without firing onShow again for the replacement element.
|
|
1042
1602
|
showPopoverElement(el);
|
|
1603
|
+
if (keepsAnchorClear) {
|
|
1604
|
+
keepAnchorClear(el, triggerRef.current);
|
|
1605
|
+
}
|
|
1043
1606
|
}
|
|
1044
1607
|
},
|
|
1045
1608
|
[
|
|
@@ -1048,6 +1611,7 @@ function useLayerImplementation(
|
|
|
1048
1611
|
show,
|
|
1049
1612
|
showPopoverElement,
|
|
1050
1613
|
isCurrentContextPopover,
|
|
1614
|
+
keepsAnchorClear,
|
|
1051
1615
|
],
|
|
1052
1616
|
);
|
|
1053
1617
|
|
|
@@ -1082,19 +1646,6 @@ function useLayerImplementation(
|
|
|
1082
1646
|
};
|
|
1083
1647
|
}, [handleToggle, bindToggleListener]);
|
|
1084
1648
|
|
|
1085
|
-
// The slide options' `@position-try` rules (FR4) are installed in the
|
|
1086
|
-
// layer's document before its first paint; one sheet serves every layer.
|
|
1087
|
-
useIsomorphicLayoutEffect(() => {
|
|
1088
|
-
if (mode !== 'context') {
|
|
1089
|
-
return;
|
|
1090
|
-
}
|
|
1091
|
-
const doc =
|
|
1092
|
-
popoverRef.current?.ownerDocument ?? sentinelRef.current?.ownerDocument;
|
|
1093
|
-
if (doc) {
|
|
1094
|
-
ensureSlideRules(doc);
|
|
1095
|
-
}
|
|
1096
|
-
}, [mode, contextMount]);
|
|
1097
|
-
|
|
1098
1649
|
// Anchor visibility (FR5). The first frame must already be right (FR8), so
|
|
1099
1650
|
// the opening read is synchronous — a layout effect runs before paint, and a
|
|
1100
1651
|
// state change inside it re-renders before paint — against the visual
|
|
@@ -1134,18 +1685,39 @@ function useLayerImplementation(
|
|
|
1134
1685
|
return () => observer.disconnect();
|
|
1135
1686
|
}, [isOpen, mode, updateAnchorInView]);
|
|
1136
1687
|
|
|
1688
|
+
// A layer that keeps its anchor clear (FR4) re-reads its geometry while it
|
|
1689
|
+
// is open: content that grows, an anchor that resizes or moves (in layout or
|
|
1690
|
+
// by a scroll) or a viewport resize can each re-settle the standard list over the anchor or
|
|
1691
|
+
// give the layer a scroll range (`observeAnchorClearance`). The external
|
|
1692
|
+
// systems are those browser observers and listeners; this effect binds them
|
|
1693
|
+
// while the layer is open and removes them when it closes, unmounts or is
|
|
1694
|
+
// remounted by a moved render call (`mountGeneration`). A trigger replaced
|
|
1695
|
+
// while open is rebound by the trigger callback ref, so no DOM node enters
|
|
1696
|
+
// state.
|
|
1697
|
+
useIsomorphicLayoutEffect(() => {
|
|
1698
|
+
if (!keepsAnchorClear || !isOpen || mode !== 'context') {
|
|
1699
|
+
return;
|
|
1700
|
+
}
|
|
1701
|
+
const layer = popoverRef.current;
|
|
1702
|
+
const anchor = triggerRef.current;
|
|
1703
|
+
if (!layer || !anchor) {
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
clearObserversRef.current?.();
|
|
1707
|
+
clearObserversRef.current = observeAnchorClearance(
|
|
1708
|
+
layer,
|
|
1709
|
+
anchor,
|
|
1710
|
+
() => popoverRef.current === layer && triggerRef.current === anchor,
|
|
1711
|
+
);
|
|
1712
|
+
return () => {
|
|
1713
|
+
clearObserversRef.current?.();
|
|
1714
|
+
clearObserversRef.current = null;
|
|
1715
|
+
};
|
|
1716
|
+
}, [keepsAnchorClear, isOpen, mode, mountGeneration]);
|
|
1717
|
+
|
|
1137
1718
|
// Render function for context mode
|
|
1138
1719
|
const renderContext = useCallback(
|
|
1139
1720
|
(children: ReactNode, props?: ContextRenderProps) => {
|
|
1140
|
-
// Keep the marker mounted after resolving the layer. Apart from giving
|
|
1141
|
-
// us the real JSX parent on first show, this lets its ref report when a
|
|
1142
|
-
// persistent hook's render call moves to a different host.
|
|
1143
|
-
const sentinel = <template ref={sentinelRefCallback} />;
|
|
1144
|
-
|
|
1145
|
-
if (contextMount === null) {
|
|
1146
|
-
return <>{sentinel}</>;
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
1721
|
const {
|
|
1150
1722
|
placement = 'above',
|
|
1151
1723
|
alignment = 'center',
|
|
@@ -1162,6 +1734,16 @@ function useLayerImplementation(
|
|
|
1162
1734
|
} = props || {};
|
|
1163
1735
|
|
|
1164
1736
|
// CSS anchor positioning (dynamic, not in StyleX)
|
|
1737
|
+
const standardFallbacks = getPositionTryFallbacks(placement, alignment);
|
|
1738
|
+
// A layer that keeps its anchor clear carries a second list; `show()`
|
|
1739
|
+
// switches to it when the standard list settles over the anchor (FR4).
|
|
1740
|
+
const clearFallbacks =
|
|
1741
|
+
keepsAnchorClear && positioning === 'anchor'
|
|
1742
|
+
? getAnchorClearFallbacks(placement)
|
|
1743
|
+
: '';
|
|
1744
|
+
const clearFallbacksProperty: Record<string, string> = clearFallbacks
|
|
1745
|
+
? {[LAYER_CLEAR_FALLBACKS_PROPERTY]: clearFallbacks}
|
|
1746
|
+
: {};
|
|
1165
1747
|
const anchorStyle: React.CSSProperties =
|
|
1166
1748
|
positioning === 'custom'
|
|
1167
1749
|
? // Consumer authors its own position styles via `style` — keep
|
|
@@ -1170,10 +1752,9 @@ function useLayerImplementation(
|
|
|
1170
1752
|
: {
|
|
1171
1753
|
positionAnchor: anchorId,
|
|
1172
1754
|
positionArea: getPositionArea(placement, alignment),
|
|
1173
|
-
positionTryFallbacks:
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
),
|
|
1755
|
+
positionTryFallbacks: clearFallbacks
|
|
1756
|
+
? `var(${LAYER_TRY_FALLBACKS_PROPERTY}, ${standardFallbacks})`
|
|
1757
|
+
: standardFallbacks,
|
|
1177
1758
|
...getSelfAlignment(placement, alignment, isAnchorInView),
|
|
1178
1759
|
};
|
|
1179
1760
|
|
|
@@ -1222,7 +1803,8 @@ function useLayerImplementation(
|
|
|
1222
1803
|
// The marker gives us the actual JSX parent without mounting arbitrary
|
|
1223
1804
|
// children there. Safe positions preserve the existing DOM order and
|
|
1224
1805
|
// cascade; unsafe positions use the nearest corrective portal target.
|
|
1225
|
-
|
|
1806
|
+
// The slot renders the layer once the hook has resolved that mount.
|
|
1807
|
+
const renderLayer = (mount: ContextLayerMount) => (
|
|
1226
1808
|
<Container
|
|
1227
1809
|
ref={popoverRefCallback}
|
|
1228
1810
|
id={id}
|
|
@@ -1234,8 +1816,9 @@ function useLayerImplementation(
|
|
|
1234
1816
|
...stylexResult.style,
|
|
1235
1817
|
...anchorStyle,
|
|
1236
1818
|
...clearanceProperty,
|
|
1819
|
+
...clearFallbacksProperty,
|
|
1237
1820
|
...layerInsetProperties(declaredInset),
|
|
1238
|
-
...
|
|
1821
|
+
...mount.portalStyle,
|
|
1239
1822
|
...extraStyle,
|
|
1240
1823
|
}}
|
|
1241
1824
|
onMouseEnter={onMouseEnter}
|
|
@@ -1245,21 +1828,21 @@ function useLayerImplementation(
|
|
|
1245
1828
|
);
|
|
1246
1829
|
|
|
1247
1830
|
return (
|
|
1248
|
-
|
|
1249
|
-
{
|
|
1250
|
-
{
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
</>
|
|
1831
|
+
<ContextLayerSlot
|
|
1832
|
+
mountStore={mountStore}
|
|
1833
|
+
renderLayer={renderLayer}
|
|
1834
|
+
sentinelRef={sentinelRefCallback}
|
|
1835
|
+
/>
|
|
1254
1836
|
);
|
|
1255
1837
|
},
|
|
1256
1838
|
[
|
|
1257
1839
|
anchorId,
|
|
1258
|
-
contextMount,
|
|
1259
1840
|
declaredInset,
|
|
1260
1841
|
id,
|
|
1261
1842
|
isAnchorInView,
|
|
1843
|
+
keepsAnchorClear,
|
|
1262
1844
|
lightDismiss,
|
|
1845
|
+
mountStore,
|
|
1263
1846
|
popoverRefCallback,
|
|
1264
1847
|
sentinelRefCallback,
|
|
1265
1848
|
],
|
|
@@ -1358,15 +1941,18 @@ export function useLayer(
|
|
|
1358
1941
|
}, [internalLayer]);
|
|
1359
1942
|
}
|
|
1360
1943
|
|
|
1361
|
-
/**
|
|
1944
|
+
/**
|
|
1945
|
+
* @internal Shared with usePopover and useTooltip; not exported from the
|
|
1946
|
+
* package barrel.
|
|
1947
|
+
*/
|
|
1362
1948
|
export function useLayerInternal(
|
|
1363
|
-
options:
|
|
1949
|
+
options: InternalContextLayerOptions,
|
|
1364
1950
|
): InternalContextLayerReturn;
|
|
1365
1951
|
export function useLayerInternal(
|
|
1366
1952
|
options: FixedLayerOptions,
|
|
1367
1953
|
): InternalFixedLayerReturn;
|
|
1368
1954
|
export function useLayerInternal(
|
|
1369
|
-
options:
|
|
1955
|
+
options: InternalContextLayerOptions | FixedLayerOptions,
|
|
1370
1956
|
): InternalContextLayerReturn | InternalFixedLayerReturn {
|
|
1371
1957
|
return useLayerImplementation(options);
|
|
1372
1958
|
}
|