@astryxdesign/core 0.7.5-canary.a264f63 → 0.7.5-canary.a2e2bcc
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 +10 -10
- package/README.md +3 -3
- package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetPanel.js +1 -1
- package/dist/BottomSheet/bottomSheetStack.d.ts.map +1 -1
- package/dist/BottomSheet/bottomSheetStack.js +27 -4
- package/dist/BottomSheet/useSheetGestures.d.ts +12 -0
- package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
- package/dist/BottomSheet/useSheetGestures.js +30 -3
- package/dist/Breadcrumbs/BreadcrumbItem.d.ts.map +1 -1
- package/dist/Breadcrumbs/BreadcrumbItem.js +31 -3
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +33 -8
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +2 -10
- 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/lazyMenuBottomSheet.d.ts +10 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.d.ts.map +1 -1
- package/dist/DropdownMenu/lazyMenuBottomSheet.js +16 -2
- 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/FileInput/FileInput.d.ts.map +1 -1
- package/dist/FileInput/FileInput.js +7 -3
- package/dist/Item/Item.d.ts +5 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +22 -6
- 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/Layer/useLayer.d.ts.map +1 -1
- package/dist/Layer/useLayer.js +32 -2
- 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.map +1 -1
- package/dist/Markdown/Markdown.js +18 -5
- 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 +52 -6
- 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 +6 -1
- 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 +3 -1
- package/dist/NumberInput/NumberInput.d.ts.map +1 -1
- package/dist/NumberInput/NumberInput.js +3 -3
- 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/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +6 -2
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +11 -3
- 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/SideNavHeading.d.ts.map +1 -1
- package/dist/SideNav/SideNavHeading.js +45 -3
- package/dist/Slider/Slider.d.ts.map +1 -1
- package/dist/Slider/Slider.js +7 -3
- package/dist/TabList/TabMenu.d.ts.map +1 -1
- package/dist/TabList/TabMenu.js +24 -3
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +4 -1
- 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/rowExpansion/useTableRowExpansion.d.ts +8 -0
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
- package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +274 -12
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.d.ts.map +1 -1
- package/dist/Table/plugins/stickyColumns/useTableStickyColumns.js +16 -5
- package/dist/Text/useTruncation.d.ts.map +1 -1
- package/dist/Text/useTruncation.js +23 -5
- package/dist/TextInput/TextInput.d.ts +1 -1
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +8 -1
- package/dist/Toast/ToastViewport.d.ts.map +1 -1
- package/dist/Toast/ToastViewport.js +34 -4
- package/dist/Tokenizer/Tokenizer.js +4 -2
- package/dist/TopNav/TopNavHeading.d.ts.map +1 -1
- package/dist/TopNav/TopNavHeading.js +26 -0
- package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
- package/dist/TopNav/TopNavMenu.js +32 -4
- package/dist/TreeList/TreeListBranches.d.ts.map +1 -1
- package/dist/TreeList/TreeListBranches.js +7 -5
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +2 -2
- 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 +11 -7
- package/dist/astryx.css +42 -11
- 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/scrollGeometry.d.ts +28 -0
- package/dist/hooks/scrollGeometry.d.ts.map +1 -1
- package/dist/hooks/scrollGeometry.js +36 -2
- package/dist/hooks/useMenuHover.d.ts.map +1 -1
- package/dist/hooks/useMenuHover.js +6 -2
- 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 +67 -6
- package/dist/motion/animatedLayout.d.ts +14 -2
- package/dist/motion/animatedLayout.d.ts.map +1 -1
- package/dist/motion/animatedLayout.js +31 -9
- 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/tokens.stylex.d.ts +2 -0
- package/dist/theme/tokens.stylex.d.ts.map +1 -1
- package/dist/theme/tokens.stylex.js +7 -1
- package/dist/utils/focusReturn.d.ts +17 -1
- package/dist/utils/focusReturn.d.ts.map +1 -1
- package/dist/utils/focusReturn.js +11 -4
- package/dist/utils/interactionModality.d.ts +11 -2
- package/dist/utils/interactionModality.d.ts.map +1 -1
- package/dist/utils/interactionModality.js +58 -5
- 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/locales/en.json +1 -1
- package/package.json +6 -6
- package/src/AlertDialog/AlertDialog.spec.md +2 -2
- package/src/AlertDialog/__tests__/AlertDialog.a11y.chromium.spec.ts +18 -6
- package/src/AppShell/AppShell.spec.md +12 -12
- package/src/BottomSheet/BottomSheet.spec.md +2 -0
- package/src/BottomSheet/BottomSheet.test.tsx +46 -0
- package/src/BottomSheet/BottomSheetPanel.test.tsx +52 -9
- package/src/BottomSheet/BottomSheetPanel.tsx +12 -6
- package/src/BottomSheet/BottomSheetReplace.test.tsx +118 -6
- package/src/BottomSheet/__tests__/BottomSheetKeyboard.a11y.browser.spec.ts +3 -1
- package/src/BottomSheet/bottomSheetStack.ts +29 -6
- package/src/BottomSheet/useSheetGestures.test.ts +52 -0
- package/src/BottomSheet/useSheetGestures.ts +37 -6
- package/src/Breadcrumbs/BreadcrumbItem.spec.md +19 -12
- package/src/Breadcrumbs/BreadcrumbItem.tsx +25 -1
- package/src/Breadcrumbs/Breadcrumbs.test.tsx +70 -2
- package/src/Breadcrumbs/__tests__/Breadcrumbs.a11y.chromium.spec.ts +18 -6
- package/src/Calendar/Calendar.spec.md +87 -48
- package/src/Calendar/__tests__/Calendar.a11y.chromium.spec.ts +21 -7
- package/src/Carousel/__tests__/Carousel.a11y.chromium.spec.ts +21 -7
- package/src/Chat/__tests__/ChatLayoutScrollButton.a11y.chromium.spec.ts +21 -4
- package/src/Collapsible/__tests__/Collapsible.a11y.chromium.spec.ts +18 -7
- package/src/Collapsible/__tests__/CollapsibleGroupAccordion.a11y.chromium.spec.ts +18 -6
- package/src/CommandPalette/__tests__/CommandPaletteFooter.a11y.chromium.spec.ts +2 -2
- package/src/DateTimeInput/DateTimeInput.spec.md +71 -48
- package/src/Dialog/Dialog.spec.md +20 -4
- package/src/Dialog/Dialog.test.tsx +216 -2
- package/src/Dialog/Dialog.tsx +41 -8
- package/src/Dialog/__tests__/Dialog.reduced-motion.a11y.browser.spec.ts +63 -2
- package/src/Dialog/__tests__/DialogSecondDocument.a11y.browser.spec.ts +202 -0
- package/src/Drawer/Drawer.spec.md +111 -80
- package/src/Drawer/DrawerHeader.spec.md +181 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +43 -0
- package/src/DropdownMenu/DropdownMenu.tsx +4 -13
- package/src/DropdownMenu/DropdownMenuGroup.doc.mjs +2 -2
- package/src/DropdownMenu/DropdownMenuGroup.tsx +12 -6
- package/src/DropdownMenu/__tests__/Menu.a11y.chromium.spec.ts +19 -7
- package/src/DropdownMenu/__tests__/MenuButton.a11y.chromium.spec.ts +21 -9
- package/src/DropdownMenu/lazyMenuBottomSheet.test.ts +53 -0
- package/src/DropdownMenu/lazyMenuBottomSheet.ts +23 -6
- package/src/DropdownMenu/menuTouchAction.stylex.ts +28 -0
- package/src/Field/Field.spec.md +57 -48
- package/src/Field/FieldLabel.spec.md +70 -59
- package/src/FileInput/FileInput.doc.mjs +1 -1
- package/src/FileInput/FileInput.test.tsx +24 -0
- package/src/FileInput/FileInput.tsx +7 -3
- 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/Item/Item.test.tsx +40 -1
- package/src/Item/Item.tsx +37 -4
- package/src/Item/ItemMarkerColumns.a11y.chromium.spec.ts +211 -0
- package/src/Item/ItemMarkerColumnsContext.tsx +20 -0
- package/src/Layer/LayerProvider.spec.md +149 -0
- package/src/Layer/useLayer.test.tsx +107 -0
- package/src/Layer/useLayer.tsx +52 -5
- package/src/Layout/__tests__/Layout.a11y.chromium.spec.ts +18 -6
- package/src/Lightbox/Lightbox.spec.md +9 -8
- package/src/Link/__tests__/Link.a11y.chromium.spec.ts +18 -8
- package/src/List/List.spec.md +35 -13
- package/src/List/List.tsx +13 -1
- package/src/List/ListContext.tsx +19 -5
- package/src/List/ListItem.tsx +97 -28
- package/src/List/ListMarkers.a11y.chromium.spec.ts +904 -0
- package/src/Markdown/Markdown.test.tsx +50 -0
- package/src/Markdown/Markdown.tsx +29 -6
- package/src/MobileNav/MobileNav.doc.mjs +2 -2
- package/src/MobileNav/MobileNavToggle.test.tsx +63 -0
- package/src/MobileNav/MobileNavToggle.tsx +13 -5
- package/src/MultiSelector/CreateRow.a11y.chromium.spec.ts +66 -9
- package/src/NavMenu/NavHeadingMenu.spec.md +19 -17
- package/src/NavMenu/NavHeadingMenu.test.tsx +77 -1
- package/src/NavMenu/NavHeadingMenu.tsx +42 -4
- package/src/NavMenu/NavHeadingMenuItem.tsx +6 -0
- package/src/NavMenu/NavMenuContext.tsx +11 -0
- package/src/NavMenu/__tests__/NavMenusSlideSelection.a11y.chromium.spec.ts +137 -0
- package/src/NumberInput/NumberInput.doc.mjs +13 -7
- package/src/NumberInput/NumberInput.spec.md +59 -37
- package/src/NumberInput/NumberInput.tsx +13 -3
- package/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts +102 -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/Popover/Popover.spec.md +1 -1
- package/src/ProgressBar/__tests__/ProgressBar.a11y.chromium.spec.ts +21 -9
- package/src/Resizable/__tests__/ResizeHandle.a11y.chromium.spec.ts +21 -14
- 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/Selector/Selector.sheetActiveDescendant.test.tsx +95 -0
- package/src/Selector/Selector.tsx +11 -2
- package/src/Selector/__tests__/ComboboxField.a11y.chromium.spec.ts +458 -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 +18 -18
- package/src/SideNav/SideNav.test.tsx +135 -0
- package/src/SideNav/SideNavHeading.spec.md +26 -19
- package/src/SideNav/SideNavHeading.tsx +61 -6
- package/src/SideNav/__tests__/SideNavRailMotion.interaction.browser.spec.ts +417 -0
- package/src/Slider/Slider.fr10.test.tsx +34 -0
- package/src/Slider/Slider.tsx +10 -2
- package/src/Slider/__tests__/Slider.a11y.chromium.spec.ts +19 -7
- package/src/Stack/Stack.spec.md +104 -56
- package/src/TabList/TabList.test.tsx +27 -0
- package/src/TabList/TabMenu.spec.md +3 -1
- package/src/TabList/TabMenu.tsx +22 -1
- package/src/Table/TableCell.tsx +3 -0
- package/src/Table/TableRow.tsx +3 -0
- package/src/Table/__tests__/Table.a11y.chromium.spec.ts +18 -6
- package/src/Table/__tests__/TableRowGlide.a11y.browser.spec.ts +382 -0
- package/src/Table/glidingDivider.ts +336 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.glide.test.tsx +280 -0
- package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +353 -7
- package/src/Table/plugins/rowStatus/useTableRowStatus.spec.md +4 -4
- package/src/Table/plugins/sortable/__tests__/useTableSortable.a11y.ts +1 -1
- package/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx +24 -3
- package/src/Table/useTableRowExpansion.doc.mjs +8 -0
- package/src/Text/useTruncation.test.tsx +128 -1
- package/src/Text/useTruncation.ts +23 -5
- package/src/TextInput/TextInput.spec.md +6 -4
- package/src/TextInput/TextInput.test.tsx +43 -0
- package/src/TextInput/TextInput.tsx +11 -1
- package/src/Toast/Toast.spec.md +300 -0
- package/src/Toast/ToastViewport.test.tsx +137 -0
- package/src/Toast/ToastViewport.tsx +36 -4
- package/src/Tokenizer/Tokenizer.spec.md +2 -2
- package/src/Tokenizer/Tokenizer.test.tsx +48 -0
- package/src/Tokenizer/Tokenizer.tsx +2 -2
- package/src/Toolbar/__tests__/Toolbar.a11y.chromium.spec.ts +18 -6
- package/src/Tooltip/__tests__/Tooltip.a11y.chromium.spec.ts +18 -7
- package/src/Tooltip/__tests__/TooltipTallContent.a11y.browser.spec.ts +34 -7
- package/src/TopNav/TopNav.test.tsx +89 -0
- package/src/TopNav/TopNavHeading.spec.md +24 -17
- package/src/TopNav/TopNavHeading.tsx +35 -2
- package/src/TopNav/TopNavMenu.spec.md +27 -20
- package/src/TopNav/TopNavMenu.test.tsx +65 -1
- package/src/TopNav/TopNavMenu.tsx +30 -1
- package/src/TreeList/TreeList.spec.md +3 -0
- package/src/TreeList/TreeListBranches.tsx +8 -6
- package/src/TreeList/TreeListItem.tsx +0 -4
- package/src/TreeList/__tests__/TreeList.a11y.chromium.spec.ts +18 -6
- package/src/TreeList/__tests__/TreeListGuideAlignment.interaction.browser.spec.ts +127 -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 +12 -8
- package/src/__tests__/PressModality.a11y.chromium.spec.ts +392 -0
- package/src/gestures/__tests__/VelocityTracker.streams.test.ts +243 -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/hooks/__tests__/menuLinkClicks.ts +71 -0
- package/src/hooks/menuPressOnItems.ts +40 -0
- package/src/hooks/scrollGeometry.ts +71 -4
- package/src/hooks/useMenuHover.ts +6 -2
- package/src/hooks/usePressFeedback.doc.mjs +4 -4
- package/src/hooks/usePressFeedback.ts +5 -2
- package/src/hooks/useScrollableArea.test.tsx +185 -3
- package/src/hooks/useScrollableArea.ts +81 -7
- package/src/motion/animatedLayout.boundary.test.ts +1 -0
- package/src/motion/animatedLayout.ts +39 -10
- package/src/theme/derivedVarRegistry.test.ts +6 -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/tokens.stylex.ts +5 -0
- package/src/theme/tokens.test.ts +15 -0
- package/src/utils/focusReturn.ts +17 -6
- package/src/utils/interactionModality.test.ts +45 -1
- package/src/utils/interactionModality.ts +64 -5
- 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/CHANGELOG.md
CHANGED
|
@@ -58,7 +58,7 @@ Thanks to everyone who contributed to this release:
|
|
|
58
58
|
|
|
59
59
|
#### Fixes
|
|
60
60
|
|
|
61
|
-
- `TimeInput`'s arrow keys ignore a fractional increment instead of writing a malformed time such as "14:30.5": `adjustTime` returns the time unchanged for a fractional minute delta ([#7823](https://github.com/
|
|
61
|
+
- `TimeInput`'s arrow keys ignore a fractional increment instead of writing a malformed time such as "14:30.5": `adjustTime` returns the time unchanged for a fractional minute delta ([#7823](https://github.com/meta/astryx/pull/7823)).
|
|
62
62
|
- Screen readers now announce a `Button` that is first rendered with `isLoading` (for example after a remount). Its visually hidden loading live region mounts empty and gets "Loading" on the next frame, because screen readers skip a live region that already holds its text when it appears. A Button that becomes loading after it mounts is unchanged, and a Button mounted idle does no extra render.
|
|
63
63
|
- `ChatComposer`: screen readers now announce a status message, errors assertively and warnings politely, once per occasion: a rerender does not repeat it, and a status that clears and then returns is announced again. Before, the status bar mounted as a `role="alert"` or `role="status"` region already holding its text, which screen readers often skip. The message now goes through the shared announcement channel, and the visible bar no longer carries a live role. No API changes.
|
|
64
64
|
- `ChatSystemMessage`: a new chat notice inside a `ChatMessageList` now has one live region announcing it, the list's polite log, instead of also being a second live region nested in it (WCAG 2.2 SC 4.1.3). Its root no longer forces `role="status"`, in either variant, so date and divider rows are no longer presented as status messages, and a `role` passed to the component reaches its root. Tests that found a system message by the `status` role should query it by its text instead.
|
|
@@ -67,12 +67,12 @@ Thanks to everyone who contributed to this release:
|
|
|
67
67
|
- Keyboard and screen-reader users can now reach a disabled `ComplexSelector` and hear that it is unavailable (WCAG 2.2 SC 2.1.1 and 4.1.2). Before, its trigger rendered the native `disabled` attribute, so Tab skipped it and a focused trigger lost focus when disabled; now it exposes `aria-disabled="true"`, keeps focus, shows its keyboard focus outline, and still opens nothing. A press or key on it reaches no handler: not the toggle, not a caller's `onClick` or `onKeyDown`, and not an ancestor's click handler.
|
|
68
68
|
- Keyboard and screen-reader users can now reach a disabled `Calendar` day or `Pagination` dot and hear that it is disabled. Disabled `TreeList` rows' expand toggle and action button, disabled `Pagination` dots and disabled `Calendar` days expose `aria-disabled="true"` instead of the native `disabled` attribute, while clicks, Enter and Space still do nothing and arrow keys still skip disabled days as before. No API changes.
|
|
69
69
|
- `DateInput`: keyboard and screen-reader users can now reach a disabled date field and hear that it is disabled. A disabled or busy field no longer renders native `disabled`: its input and calendar button keep their place in the focus order and expose `aria-disabled`, while typing and opening stay blocked, and a focused disabled field shows its focus ring. Tests that query a disabled DateInput with `toBeDisabled()` or `:disabled` should check `aria-disabled="true"` instead.
|
|
70
|
-
- `DateRangeInput`: keyboard and screen-reader users can now reach a disabled field or preset and hear that it is disabled. A disabled or busy field and a disabled preset no longer render native `disabled`: the trigger, calendar button and presets keep their place in the focus order and expose `aria-disabled`, while opening and selecting stay blocked, and a focused disabled field shows its focus ring. Tests that query them with `toBeDisabled()` or `:disabled` should check `aria-disabled="true"` instead ([#7866](https://github.com/
|
|
70
|
+
- `DateRangeInput`: keyboard and screen-reader users can now reach a disabled field or preset and hear that it is disabled. A disabled or busy field and a disabled preset no longer render native `disabled`: the trigger, calendar button and presets keep their place in the focus order and expose `aria-disabled`, while opening and selecting stay blocked, and a focused disabled field shows its focus ring. Tests that query them with `toBeDisabled()` or `:disabled` should check `aria-disabled="true"` instead ([#7866](https://github.com/meta/astryx/pull/7866)).
|
|
71
71
|
- `DateTimeInput`: keyboard and screen-reader users can now reach a disabled or busy field and hear that it is disabled. It no longer renders native `disabled` on its text, native-picker or touch fields, or on its calendar and clock buttons: they keep their place in the focus order and expose `aria-disabled`, while typing, picking, opening and a caller's `onClick` stay blocked, and a focused disabled field shows its focus ring. `TimeInput`'s native picker button, which shares the time segment and stays out of the tab order, also moves from `disabled` to `aria-disabled` and stays inert. Tests that query a disabled DateTimeInput with `toBeDisabled()` or `:disabled` should check `aria-disabled="true"` instead.
|
|
72
72
|
- Apps that use Core's prebuilt CSS without a StyleX build step now get the default data colors: the prebuilt CSS defines the canonical `dataVars` defaults, so compiled imports and raw CSS references paint correctly.
|
|
73
73
|
- `Dialog`, `BottomSheet` and `BottomSheetSwitcher` stay open when a file picker inside them is dismissed. A file input fires a bubbling `cancel` event when its picker closes without a choice, and all three took that event for a close request of their own and closed (a switcher closed its whole flow). They now act only on a `cancel` aimed at their own `<dialog>`, so Escape and platform close requests (the Android back gesture) behave as before. No API changes.
|
|
74
74
|
- `DropdownMenuRadioGroup` now forwards `ref`, and its docs explain controlled selection, how to name the group, when the menu closes, and how it composes inside a `DropdownMenu`.
|
|
75
|
-
- `astryx init` writes the agent docs at the project root, in files the project commits, so Codex, Gemini CLI, Copilot CLI and Claude Code all read the block from the project root or any folder below it ([#7497](https://github.com/
|
|
75
|
+
- `astryx init` writes the agent docs at the project root, in files the project commits, so Codex, Gemini CLI, Copilot CLI and Claude Code all read the block from the project root or any folder below it ([#7497](https://github.com/meta/astryx/pull/7497)). It no longer writes agent docs into a project's subfolder, the home folder, or a settings folder in it such as `~/.gemini`.
|
|
76
76
|
- `AGENTS.md` holds the block, created when missing. Before, a project with only `CLAUDE.md` got the block only there, so Codex and Gemini CLI never saw it.
|
|
77
77
|
- Claude Code skips `AGENTS.md` in a folder that has a `CLAUDE.md` or `.claude/CLAUDE.md`, so the Claude Code file the project already has keeps a full copy: root `CLAUDE.md`, else `.claude/CLAUDE.md`. It keeps the copy even when it imports `AGENTS.md`, because Claude Code does not follow that import in a session started in a subfolder; started at the root, Claude Code then reads two. When both exist, the copy goes in root `CLAUDE.md`, which projects commit even when they ignore `.claude/`, and a block in `.claude/CLAUDE.md` is removed. Init creates no Claude file. `astryx upgrade` refreshes every copy, except in a project at the top of a home settings folder (see the next entry).
|
|
78
78
|
- Gemini CLI reads only `GEMINI.md`: init adds a one-line import, `@./AGENTS.md`, creating `GEMINI.md` when it is missing. It adds none when `GEMINI.md` already imports `AGENTS.md`, inline or on its own line. It adds the import even when the project's `.gemini/settings.json` has Gemini read `AGENTS.md` through `context.fileName`: Gemini loads those settings only when it starts at the project root, so a session started in a subfolder would otherwise get no copy. Started at the root, Gemini then reads two.
|
|
@@ -95,18 +95,18 @@ Thanks to everyone who contributed to this release:
|
|
|
95
95
|
- `Selector` options in a narrow list now shrink and truncate a long label with an ellipsis instead of being clipped past the list edge.
|
|
96
96
|
- `Switch`: a busy switch announces "Loading" once per busy start. Under React StrictMode the announcement used to be made twice.
|
|
97
97
|
- `TimeInput`: keyboard and screen-reader users can now reach a disabled field, or a busy bottom-sheet field, and hear that it is disabled. It no longer renders native `disabled` on its typed, native-picker or touch input or its picker button: they keep their place in the focus order and expose `aria-disabled`, while typing, arrow-key adjustment, opening, submitting a surrounding form with Enter, and a caller's `onClick` stay blocked, a draft typed before the field became disabled is dropped, and a focused disabled field shows its focus ring. Tests that query a disabled or busy TimeInput with `toBeDisabled()` or `:disabled` should check `aria-disabled="true"` instead.
|
|
98
|
-
- Pages that use `Timestamp` with an absolute format (`date`, `time`, `date_time` and the other fixed formats) now prerender in Next.js with `cacheComponents` turned on, where they used to fail the build: `Timestamp` no longer reads the current time while rendering on the server, and absolute formats never read the clock. `relative`, `relative_short` and `auto` read the clock on the client only: a server render or static prerender shows the full date and time in UTC, labelled, and the client switches to the format's normal output right after hydration, so server and client markup now always match. Client-only rendering is unchanged. No API changes ([#7883](https://github.com/
|
|
98
|
+
- Pages that use `Timestamp` with an absolute format (`date`, `time`, `date_time` and the other fixed formats) now prerender in Next.js with `cacheComponents` turned on, where they used to fail the build: `Timestamp` no longer reads the current time while rendering on the server, and absolute formats never read the clock. `relative`, `relative_short` and `auto` read the clock on the client only: a server render or static prerender shows the full date and time in UTC, labelled, and the client switches to the format's normal output right after hydration, so server and client markup now always match. Client-only rendering is unchanged. No API changes ([#7883](https://github.com/meta/astryx/pull/7883)).
|
|
99
99
|
- `Tooltip`: moving the pointer straight from the trigger onto the tooltip in one step no longer hides it, so it stays open while hovered (WCAG 2.2 SC 1.4.13).
|
|
100
|
-
- A `SideNavItem` in a collapsed `SideNav` now shows its tooltip on hover and gets `aria-describedby`, even when the item first appears inside an already-collapsed `SideNav`, the common case for saved collapse state. Before, only an item that collapsed after it appeared got a tooltip. Fixes [#7692](https://github.com/
|
|
100
|
+
- A `SideNavItem` in a collapsed `SideNav` now shows its tooltip on hover and gets `aria-describedby`, even when the item first appears inside an already-collapsed `SideNav`, the common case for saved collapse state. Before, only an item that collapsed after it appeared got a tooltip. Fixes [#7692](https://github.com/meta/astryx/issues/7692).
|
|
101
101
|
|
|
102
102
|
A `Tooltip` with an `anchorRef` that renders inside the very element the ref points at, as `SideNavItem` does, now attaches however it mounted. The effect now re-checks the anchor once the commit has finished attaching refs; event listeners and the `aria-describedby` merge and restore are unchanged.
|
|
103
103
|
|
|
104
104
|
- `TopNav` on narrow screens: a long `TopNavHeading` now gives way (it truncates with an ellipsis, or wraps when the heading is a link) instead of pushing the end content and the menu toggle past the edge of the bar, and the mobile drawer's close button is back on screen.
|
|
105
|
-
- `Typeahead`: clearing the value while editing it now empties the input and reports `onChangeQuery('')`, instead of leaving the old label in a field with no value. Fixes [#7038](https://github.com/
|
|
105
|
+
- `Typeahead`: clearing the value while editing it now empties the input and reports `onChangeQuery('')`, instead of leaving the old label in a field with no value. Fixes [#7038](https://github.com/meta/astryx/issues/7038).
|
|
106
106
|
|
|
107
107
|
#### Performance
|
|
108
108
|
|
|
109
|
-
- Pages with many code blocks, such as a long Markdown document, paint sooner on first load: `CodeBlock` inserts its syntax-highlight rules before the first layout read instead of after it, which cut first paint by 16–19% in 100–500 KB test documents ([#7875](https://github.com/
|
|
109
|
+
- Pages with many code blocks, such as a long Markdown document, paint sooner on first load: `CodeBlock` inserts its syntax-highlight rules before the first layout read instead of after it, which cut first paint by 16–19% in 100–500 KB test documents ([#7875](https://github.com/meta/astryx/pull/7875)). The rules and the highlighted output are unchanged.
|
|
110
110
|
- Pages that update around a long `Markdown` document stay responsive: Markdown skips re-rendering its document when a parent re-renders without changing the text or any rendering prop, and a link handler passed as a new function on each render no longer forces that work. The rendered output is unchanged.
|
|
111
111
|
|
|
112
112
|
#### Documentation
|
|
@@ -1362,7 +1362,7 @@ Thanks to everyone who contributed to this release:
|
|
|
1362
1362
|
|
|
1363
1363
|
**The horizontal clip mirrors under `dir="rtl"`.** `clip-path: inset()` is physical — top/right/bottom/left, no logical form — while the row itself reverses. Left unflipped, the leading segment sits to the _right_ of the node in RTL and still clipped its right edge, so the hole opened at the join between steps instead of at the indicator. Measured before the fix: `con0 x=622, indicator x=606, clips RIGHT edge`. After: `clips LEFT edge`, with LTR unchanged. The block axis needs no handling — `dir` does not reverse it.
|
|
1364
1364
|
|
|
1365
|
-
**One declaration covers both layers.** The gap has to reach the track (the segment's own background) and the accent fill (an absolutely placed `::before`). Spending it on each separately meant two declarations on two boxes, so a percentage resolved against a different containing block for each and stopped them ~1.2px apart. A single `clip-path: inset(…)` on the segment clips the element and its pseudo-element together against one reference box, so every accepted value behaves identically on both — which is what [#5824](https://github.com/
|
|
1365
|
+
**One declaration covers both layers.** The gap has to reach the track (the segment's own background) and the accent fill (an absolutely placed `::before`). Spending it on each separately meant two declarations on two boxes, so a percentage resolved against a different containing block for each and stopped them ~1.2px apart. A single `clip-path: inset(…)` on the segment clips the element and its pseudo-element together against one reference box, so every accepted value behaves identically on both — which is what [#5824](https://github.com/meta/astryx/pull/5824) requires of a public input across its full value domain. Clipping also cannot change layout, so the node the segment positions cannot move.
|
|
1366
1366
|
|
|
1367
1367
|
**No indicator, no gap.** `indicator="none"` renders no node, so a gap there is a hole in a track that is meant to be continuous.
|
|
1368
1368
|
|
|
@@ -1718,7 +1718,7 @@ Thanks to everyone who contributed to this release:
|
|
|
1718
1718
|
|
|
1719
1719
|
`MetadataListItem` targets its wrapper `<div>` when stacked and its `<dt>` when inline. A `TypeaheadItem` backed by caller-supplied `item.element` remains unchanged and does not receive forwarded props because that value may not be a cloneable element.
|
|
1720
1720
|
|
|
1721
|
-
This completes [#5254](https://github.com/
|
|
1721
|
+
This completes [#5254](https://github.com/meta/astryx/issues/5254) after [#5288](https://github.com/meta/astryx/pull/5288) by @lexs landed `List` and `Markdown` first, followed by [#5493](https://github.com/meta/astryx/pull/5493) by @gonzoblasco for `TreeList`.
|
|
1722
1722
|
|
|
1723
1723
|
- `Button` now reflects `elevation` as a theme target. The prop selected between four StyleX style objects but was missing from the sibling `themeProps('button')` call, so `data-elevation` never reached the DOM and no theme could style the axis — the same defect fixed on `Card` in #5491, and one `ButtonGroup` already had right. A button inside a `ButtonGroup` reports `none`, because the group owns the surface's elevation and the member paints flat. Every wrapper that forwards `ButtonProps` through to `Button` — `IconButton` — picks the reflection up with it. (`ToggleButton` does not: its props extend `BaseProps`, not `ButtonProps`, so it has no `elevation` to forward and keeps reporting `none`.) Nothing about the rendered button changes: 60 of 64 captured frames are byte-identical, and the four that differ do so only inside the loading spinner's own box. (#5552)
|
|
1724
1724
|
- Calendar: announce a cleared range in the provider locale, wrap the two-month layout instead of overflowing a narrow viewport, keep the selected date visible under forced colors (#5453)
|
|
@@ -3459,7 +3459,7 @@ Thanks to everyone who contributed to this release:
|
|
|
3459
3459
|
`height: '100%'`. With no sized parent, the skeleton collapsed to a zero-size
|
|
3460
3460
|
(invisible) element. The doc now sets a `playground.defaults` of
|
|
3461
3461
|
`width: 320` / `height: 80` so the shimmer placeholder renders visibly.
|
|
3462
|
-
- Update stale `facebookexperimental/xds` doc/JSDoc links to the current `facebook/astryx` namespace in source comments (theme/syntax `@see` references). The old org 301-redirects, so these weren't broken — just stale — and this matches the canonical org used elsewhere
|
|
3462
|
+
- Update stale `facebookexperimental/xds` doc/JSDoc links to the then-current `facebook/astryx` namespace in source comments (theme/syntax `@see` references). The old org 301-redirects, so these weren't broken — just stale — and this matches the canonical org used elsewhere
|
|
3463
3463
|
- Document Table's `verticalAlign` and `textOverflow` props, which were supported by the component but missing from the docsite properties tab
|
|
3464
3464
|
- Document TabList's `layout` prop ('hug' | 'fill') for tab sizing, which was supported by the component but missing from the docsite properties tab
|
|
3465
3465
|
- Document Text's `justify` prop, which was supported by the component but missing from the docsite properties tab (same omission previously fixed for Heading) (#2847-adjacent)
|
package/README.md
CHANGED
|
@@ -63,13 +63,13 @@ astryx gap-report # report a missing capability
|
|
|
63
63
|
|
|
64
64
|
| Package | Description |
|
|
65
65
|
| ----------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
|
66
|
-
| [`@astryxdesign/cli`](https://github.com/
|
|
67
|
-
| [`@astryxdesign/theme-neutral`](https://github.com/
|
|
66
|
+
| [`@astryxdesign/cli`](https://github.com/meta/astryx/tree/main/packages/cli) | CLI tooling: component docs, templates, scaffolding, codemods |
|
|
67
|
+
| [`@astryxdesign/theme-neutral`](https://github.com/meta/astryx/tree/main/packages/themes/neutral) | Muted, minimal theme (Lucide icons) |
|
|
68
68
|
|
|
69
69
|
## Resources
|
|
70
70
|
|
|
71
71
|
- [Component Storybook](https://astryx.atmeta.com/storybook/)
|
|
72
|
-
- [GitHub Repository](https://github.com/
|
|
72
|
+
- [GitHub Repository](https://github.com/meta/astryx)
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA8B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAIvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAC5D,YAAY,EAAC,oBAAoB,EAAC,CAAC;AA+CnC,eAAO,MAAM,2BAA2B,2DACkB,CAAC;
|
|
1
|
+
{"version":3,"file":"BottomSheetPanel.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/BottomSheetPanel.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA8B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAIvB,QAAA,MAAM,cAAc;;;;CAIV,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,cAAc,CAAC;AAC5D,YAAY,EAAC,oBAAo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AED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CA8CrE;AAsBD;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,GACV;IAAC,OAAO,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,MAAM,IAAI,CAAA;CAAC,GAAG,IAAI,CAcxD;AAMD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,WAAW,GAAG,IAAI,EACzB,MAAM,EAAE,sBAAsB,EAC9B,OAAO,EAAE,OAAO,GACf,IAAI,CA2CN;AAED,iFAAiF;AACjF,wBAAgB,2BAA2B,CACzC,GAAG,GAAE,QAAmB,EACxB,OAAO,GAAE,OAAc,GACtB,aAAa,CAAC;IACf,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,oBAAoB,CAAC;CAC5B,CAAC,CAMD;AAED,sEAAsE;AACtE,wBAAgB,6BAA6B,IAAI,IAAI,CA+BpD;AAED,+FAA+F;AAC/F,eAAO,MAAM,kCAAkC;;;;sBAI3B,MAAM;IAExB,8DAA8D;iCACjC,QAAQ;CACtC,CAAC"}
|
|
@@ -1126,14 +1126,37 @@ function finishReplace(replaced) {
|
|
|
1126
1126
|
replaced.hide();
|
|
1127
1127
|
replaced.replaceable?.finish();
|
|
1128
1128
|
}
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* The viewport top a panel rests at: its box without the translation it is
|
|
1132
|
+
* still travelling under (an entering panel rises from below the viewport).
|
|
1133
|
+
* Read from the panel itself, never from the element around it: a standalone
|
|
1134
|
+
* sheet's panel sits directly in its dialog, which spans the viewport, so a
|
|
1135
|
+
* parent's top is not where the panel rests.
|
|
1136
|
+
*/
|
|
1137
|
+
function restingTopOfPanel(panel) {
|
|
1138
|
+
const top = panel.getBoundingClientRect().top;
|
|
1139
|
+
const view = panel.ownerDocument.defaultView;
|
|
1140
|
+
if (view == null || typeof view.DOMMatrixReadOnly !== 'function') {
|
|
1141
|
+
return top;
|
|
1142
|
+
}
|
|
1143
|
+
const {
|
|
1144
|
+
transform
|
|
1145
|
+
} = view.getComputedStyle(panel);
|
|
1146
|
+
if (transform === '' || transform === 'none') {
|
|
1147
|
+
return top;
|
|
1148
|
+
}
|
|
1149
|
+
// A sheet panel only ever translates on the block axis (entrance, drag,
|
|
1150
|
+
// alignment); its computed matrix's `m42` is that translation.
|
|
1151
|
+
return top - new view.DOMMatrixReadOnly(transform).m42;
|
|
1152
|
+
}
|
|
1129
1153
|
function alignmentOffsetForPanels(enteringPanel, retainedPanel) {
|
|
1130
1154
|
if (enteringPanel == null || retainedPanel == null) {
|
|
1131
1155
|
return 0;
|
|
1132
1156
|
}
|
|
1133
|
-
// The
|
|
1134
|
-
//
|
|
1135
|
-
|
|
1136
|
-
return Math.max(0, enteringTop - retainedPanel.getBoundingClientRect().top);
|
|
1157
|
+
// The retained panel is at rest; the entering panel is measured where its
|
|
1158
|
+
// entrance will leave it.
|
|
1159
|
+
return Math.max(0, restingTopOfPanel(enteringPanel) - retainedPanel.getBoundingClientRect().top);
|
|
1137
1160
|
}
|
|
1138
1161
|
|
|
1139
1162
|
/**
|
|
@@ -66,6 +66,18 @@
|
|
|
66
66
|
* - /packages/core/src/BottomSheet/useSheetGestures.test.ts
|
|
67
67
|
*/
|
|
68
68
|
import { type CSSProperties, type MouseEvent as ReactMouseEvent, type PointerEvent as ReactPointerEvent, type RefObject, type TouchEvent as ReactTouchEvent, type UIEvent as ReactUIEvent } from 'react';
|
|
69
|
+
/**
|
|
70
|
+
* Whether a gesture that lands on `target` began inside another layer
|
|
71
|
+
* rendered in this sheet's content — a `<dialog>` between the target and the
|
|
72
|
+
* body. A sheet opened from inside a sheet's content, a Dialog opened there,
|
|
73
|
+
* renders its dialog as a descendant of the host's body, so its pointer and
|
|
74
|
+
* touch events bubble through the host's gesture listeners. That gesture is
|
|
75
|
+
* the layer's own: the host must neither arm a drag on it nor take pointer
|
|
76
|
+
* capture for it, which would cancel the drag the layer's own handle began
|
|
77
|
+
* (`component:BottomSheet` FR7: a swipe reaches only the top sheet of a
|
|
78
|
+
* stack; FR6: a covered sheet is blocked).
|
|
79
|
+
*/
|
|
80
|
+
export declare function isInsideNestedLayer(target: EventTarget | null, body: HTMLElement): boolean;
|
|
69
81
|
/**
|
|
70
82
|
* The scrollers a gesture that lands on `target` can scroll, innermost first
|
|
71
83
|
* and the body last: every scrollable box between the target and the body,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetGestures.d.ts","sourceRoot":"","sources":["../../src/BottomSheet/useSheetGestures.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AAEH,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,YAAY,IAAI,iBAAiB,EACtC,KAAK,SAAS,EACd,KAAK,UAAU,IAAI,eAAe,EAClC,KAAK,OAAO,IAAI,YAAY,EAC7B,MAAM,OAAO,CAAC;AAwJf;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,IAAI,EAAE,WAAW,GAChB,WAAW,EAAE,CAaf;AA4BD,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,MAAM,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gFAAgF;IAChF,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,MA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IAC9H,YAAY,EAAE,iBAAiB,CAAC;IAChC,gEAAgE;IAChE,WAAW,EAAE,gBAAgB,CAAC;IAC9B;;;;OAIG;IACH,SAAS,EAAE,cAAc,CAAC;IAC1B;;;;;OAKG;IACH,cAAc,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9C;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,UAAU,EAAE,OAAO,CAAC;IACpB,4EAA4E;IAC5E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,eAAe,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACnC,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,uBAAuB,EAAE,MAAM,CAAC;IAChC,qEAAqE;IACrE,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;;;;;OAOG;IACH,wBAAwB,EAAE,MAAM,IAAI,CAAC;IACrC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AASD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,eAAwB,EACxB,UAAiB,EACjB,sBAA0B,EAC1B,SAAS,EACT,WAAW,EACX,MAAM,EACN,cAAc,GACf,EAAE,uBAAuB,GAAG,sBAAsB,CAgzClD"}
|
|
@@ -200,6 +200,26 @@ function isBlockScroller(element) {
|
|
|
200
200
|
return overflowY === 'auto' || overflowY === 'scroll';
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Whether a gesture that lands on `target` began inside another layer
|
|
205
|
+
* rendered in this sheet's content — a `<dialog>` between the target and the
|
|
206
|
+
* body. A sheet opened from inside a sheet's content, a Dialog opened there,
|
|
207
|
+
* renders its dialog as a descendant of the host's body, so its pointer and
|
|
208
|
+
* touch events bubble through the host's gesture listeners. That gesture is
|
|
209
|
+
* the layer's own: the host must neither arm a drag on it nor take pointer
|
|
210
|
+
* capture for it, which would cancel the drag the layer's own handle began
|
|
211
|
+
* (`component:BottomSheet` FR7: a swipe reaches only the top sheet of a
|
|
212
|
+
* stack; FR6: a covered sheet is blocked).
|
|
213
|
+
*/
|
|
214
|
+
export function isInsideNestedLayer(target, body) {
|
|
215
|
+
for (let element = target instanceof Element ? target : null; element != null && element !== body; element = element.parentElement) {
|
|
216
|
+
if (element.localName === 'dialog') {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
|
|
203
223
|
/**
|
|
204
224
|
* The scrollers a gesture that lands on `target` can scroll, innermost first
|
|
205
225
|
* and the body last: every scrollable box between the target and the body,
|
|
@@ -897,7 +917,13 @@ export function useSheetGestures({
|
|
|
897
917
|
if (event.button !== 0 || !event.isPrimary) {
|
|
898
918
|
return;
|
|
899
919
|
}
|
|
900
|
-
const
|
|
920
|
+
const body = event.currentTarget;
|
|
921
|
+
// A gesture inside a layer this sheet hosts belongs to that layer.
|
|
922
|
+
if (isInsideNestedLayer(event.target, body)) {
|
|
923
|
+
armedBodyRef.current = null;
|
|
924
|
+
return;
|
|
925
|
+
}
|
|
926
|
+
const scrollers = scrollChainUnder(event.target, body);
|
|
901
927
|
if (!chainAtTop(scrollers)) {
|
|
902
928
|
armedBodyRef.current = null;
|
|
903
929
|
return;
|
|
@@ -995,8 +1021,9 @@ export function useSheetGestures({
|
|
|
995
1021
|
// At the top, a pull DOWN hands off (collapse); at the bottom, a pull UP
|
|
996
1022
|
// hands off (expand). A gesture that starts mid-content is an ordinary
|
|
997
1023
|
// scroll, but it is tracked all the same: the scroller can run out of
|
|
998
|
-
// content while the finger is still down (see onTouchMove).
|
|
999
|
-
|
|
1024
|
+
// content while the finger is still down (see onTouchMove). A touch
|
|
1025
|
+
// inside a layer this sheet hosts is that layer's, never tracked here.
|
|
1026
|
+
if (!touch || isInsideNestedLayer(event.target, body)) {
|
|
1000
1027
|
touchDragRef.current = null;
|
|
1001
1028
|
return;
|
|
1002
1029
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"BreadcrumbItem.d.ts","sourceRoot":"","sources":["../../src/Breadcrumbs/BreadcrumbItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,OAAO,CAAC;AAWf,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAErD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAa5C,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,qCAAqC,CAAC;AAM7C,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8BAA8B,CAAC;AAQrE,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAC/C,SAAS,CAAC,aAAa,CAAC,EACxB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;OAIG;IACH,EAAE,CAAC,EAAE,iBAAiB,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC/C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,IAAI,CAAC,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;CAC7B;AAsID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,SAAS,EAAE,aAAa,EACxB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,MAAM,EACrB,GAAG,IAAI,EACR,EAAE,mBAAmB,qBAgMrB;yBA/Me,cAAc"}
|
|
@@ -34,6 +34,10 @@ import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
|
34
34
|
import { Icon } from "../Icon/index.js";
|
|
35
35
|
import { usePopover } from "../Popover/usePopover.js";
|
|
36
36
|
import { useListFocus } from "../hooks/useListFocus.js";
|
|
37
|
+
import { useMenuPress } from "../hooks/useMenuPress.js";
|
|
38
|
+
import { pressOnItemsOnly } from "../hooks/menuPressOnItems.js";
|
|
39
|
+
import { menuTouchActionStyles } from "../DropdownMenu/menuTouchAction.stylex.js";
|
|
40
|
+
import { useMenuOverflow } from "../DropdownMenu/useMenuOverflow.js";
|
|
37
41
|
import { useTypeahead } from "../hooks/useTypeahead.js";
|
|
38
42
|
import { layerAnimations } from "../Layer/layerAnimations.stylex.js";
|
|
39
43
|
import { renderDropdownItems } from "../DropdownMenu/renderDropdownItems.js";
|
|
@@ -119,6 +123,20 @@ function BreadcrumbSeparator({
|
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
125
|
const menuStyles = {
|
|
126
|
+
menu: {
|
|
127
|
+
kB7OPa: "x9f619",
|
|
128
|
+
k1xSpc: "x78zum5",
|
|
129
|
+
kXwgrk: "xdt5ytf",
|
|
130
|
+
kOIVth: "x1lsbc85",
|
|
131
|
+
kskxy: "xuyqlj2",
|
|
132
|
+
kORKVm: "x1odjw0f",
|
|
133
|
+
"--_dropdown-menu-radius": "x1fcsqxe",
|
|
134
|
+
"--_dropdown-menu-padding": "xgory14",
|
|
135
|
+
kmVPX3: "x9epnlk",
|
|
136
|
+
kaIpWk: "x1n97fys",
|
|
137
|
+
kfSwDN: "x87ps6o",
|
|
138
|
+
$$css: true
|
|
139
|
+
},
|
|
122
140
|
popover: {
|
|
123
141
|
k7Eaqz: "x5w4yej",
|
|
124
142
|
kqGvvJ: "xsq74q5",
|
|
@@ -363,6 +381,15 @@ function BreadcrumbMenuTrigger({
|
|
|
363
381
|
wrap: false,
|
|
364
382
|
onEscape: closeMenu
|
|
365
383
|
});
|
|
384
|
+
|
|
385
|
+
// A press that slides across the menu's items acts on the item it lifts on,
|
|
386
|
+
// the highlight following the pointer, as DropdownMenu's does
|
|
387
|
+
// (`family:action-groups` FR1-FR3, FR5); a mouse released outside closes it.
|
|
388
|
+
const menuPress = useMenuPress({
|
|
389
|
+
menuRef: listRef,
|
|
390
|
+
itemSelector: MENU_ITEM_SELECTOR,
|
|
391
|
+
onDismiss: closeMenu
|
|
392
|
+
});
|
|
366
393
|
const typeahead = useTypeahead({
|
|
367
394
|
getItemLabels: () => getMenuItems().map(el => el.textContent),
|
|
368
395
|
onMatch: focusItem,
|
|
@@ -417,6 +444,7 @@ function BreadcrumbMenuTrigger({
|
|
|
417
444
|
menuSize
|
|
418
445
|
}), [closeMenu, menuSize]);
|
|
419
446
|
const menuContent = Array.isArray(menu) ? renderDropdownItems(menu) : menu;
|
|
447
|
+
const hasOverflow = useMenuOverflow(listRef, menuContent, popover.isOpen);
|
|
420
448
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
421
449
|
children: [/*#__PURE__*/_jsxs("button", {
|
|
422
450
|
ref: useMergedRefs(ref, buttonRef, popover.triggerRef),
|
|
@@ -453,10 +481,10 @@ function BreadcrumbMenuTrigger({
|
|
|
453
481
|
id: menuId,
|
|
454
482
|
role: "menu",
|
|
455
483
|
"aria-labelledby": triggerId,
|
|
484
|
+
...menuPress.menuProps,
|
|
485
|
+
onPointerDown: pressOnItemsOnly(menuPress.menuProps.onPointerDown, MENU_ITEM_SELECTOR),
|
|
456
486
|
onKeyDown: listKeyDown,
|
|
457
|
-
...mergeProps(themeProps('breadcrumb-menu'),
|
|
458
|
-
className: "x9f619 x78zum5 xdt5ytf x1lsbc85 xuyqlj2 x1odjw0f x1fcsqxe xgory14 x9epnlk x1n97fys x87ps6o"
|
|
459
|
-
}),
|
|
487
|
+
...mergeProps(themeProps('breadcrumb-menu'), stylex.props(menuStyles.menu, hasOverflow ? menuTouchActionStyles.scrolls : menuTouchActionStyles.fits)),
|
|
460
488
|
children: /*#__PURE__*/_jsx(DropdownMenuContext, {
|
|
461
489
|
value: contextValue,
|
|
462
490
|
children: /*#__PURE__*/_jsx(DropdownMenuRootOpenContext, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA2B5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings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AKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAmB,EACnB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCA2Xb;yBA3Ye,MAAM"}
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -50,7 +50,7 @@ import { devWarn } from "../utils/devWarning.js";
|
|
|
50
50
|
import { DialogContext } from "./DialogContext.js";
|
|
51
51
|
import { themeProps } from "../utils/themeProps.js";
|
|
52
52
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
53
|
-
import { useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
53
|
+
import { getInteractionModality, trackInteractionModalityIn, useInteractionModalityTracking } from "../utils/interactionModality.js";
|
|
54
54
|
import { focusForLastInput } from "../utils/focusReturn.js";
|
|
55
55
|
import { ModalAnnounceProvider } from "../hooks/ModalAnnounceProvider.js";
|
|
56
56
|
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
@@ -62,8 +62,11 @@ import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
|
62
62
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
63
63
|
function getDialogDirection(triggerEl, distance = 16) {
|
|
64
64
|
const rect = triggerEl.getBoundingClientRect();
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
// The trigger's own window: its rect is measured in that window's viewport,
|
|
66
|
+
// which is not the page's when the dialog renders into a second document.
|
|
67
|
+
const view = triggerEl.ownerDocument.defaultView ?? window;
|
|
68
|
+
const dx = rect.left + rect.width / 2 - view.innerWidth / 2;
|
|
69
|
+
const dy = rect.top + rect.height / 2 - view.innerHeight / 2;
|
|
67
70
|
const dist = Math.sqrt(dx * dx + dy * dy) || 1;
|
|
68
71
|
return {
|
|
69
72
|
x: Math.round(dx / dist * distance),
|
|
@@ -358,6 +361,18 @@ export function Dialog({
|
|
|
358
361
|
const triggerElementRef = useRef(null);
|
|
359
362
|
useInteractionModalityTracking();
|
|
360
363
|
|
|
364
|
+
// Input in a second document (a same-origin iframe, a Document
|
|
365
|
+
// Picture-in-Picture window) never reaches the page's listeners, so the
|
|
366
|
+
// dialog's own document keeps its own last input for the focus return while
|
|
367
|
+
// this Dialog is mounted, from before it opens until it unmounts.
|
|
368
|
+
useEffect(() => {
|
|
369
|
+
const ownerDocument = dialogRef.current?.ownerDocument;
|
|
370
|
+
if (ownerDocument == null || ownerDocument === document) {
|
|
371
|
+
return undefined;
|
|
372
|
+
}
|
|
373
|
+
return trackInteractionModalityIn(ownerDocument);
|
|
374
|
+
}, [isInline]);
|
|
375
|
+
|
|
361
376
|
// This runs in a layout effect so the capture lands before any descendant's
|
|
362
377
|
// passive mount effect: all layout effects run before any passive effect,
|
|
363
378
|
// while a child's passive effect runs before this parent's passive effect.
|
|
@@ -369,7 +384,15 @@ export function Dialog({
|
|
|
369
384
|
if (isInline || !isOpen) {
|
|
370
385
|
return;
|
|
371
386
|
}
|
|
372
|
-
|
|
387
|
+
// The dialog's own document while it holds focus: an app can render a
|
|
388
|
+
// dialog into a second document (a same-origin iframe, a Document
|
|
389
|
+
// Picture-in-Picture window) through a portal, and a control there that
|
|
390
|
+
// opens it is focused in that document, which the page's document reports
|
|
391
|
+
// only as the iframe element, or not at all. A control in the page that
|
|
392
|
+
// opens such a dialog leaves focus in the page.
|
|
393
|
+
const dialogDocument = dialogRef.current?.ownerDocument ?? document;
|
|
394
|
+
const doc = dialogDocument.hasFocus() ? dialogDocument : document;
|
|
395
|
+
triggerElementRef.current = doc.activeElement;
|
|
373
396
|
}, [isOpen, isInline]);
|
|
374
397
|
|
|
375
398
|
// Derive dismissal behavior from purpose
|
|
@@ -390,7 +413,7 @@ export function Dialog({
|
|
|
390
413
|
// captured by the layout effect above, before any descendant effect
|
|
391
414
|
// could move focus.
|
|
392
415
|
const trigger = triggerElementRef.current;
|
|
393
|
-
if (trigger && trigger !==
|
|
416
|
+
if (trigger && trigger !== trigger.ownerDocument.body) {
|
|
394
417
|
const dir = getDialogDirection(trigger);
|
|
395
418
|
dialog.style.setProperty('--dialog-dir-x', `${dir.x}px`);
|
|
396
419
|
dialog.style.setProperty('--dialog-dir-y', `${dir.y}px`);
|
|
@@ -412,9 +435,11 @@ export function Dialog({
|
|
|
412
435
|
if (dialog.open) {
|
|
413
436
|
dialog.close();
|
|
414
437
|
}
|
|
415
|
-
// Return focus to the element that opened the dialog
|
|
416
|
-
|
|
417
|
-
|
|
438
|
+
// Return focus to the element that opened the dialog, with the ring
|
|
439
|
+
// the last input in that element's own document calls for.
|
|
440
|
+
const trigger = triggerElementRef.current;
|
|
441
|
+
if (trigger) {
|
|
442
|
+
focusForLastInput(trigger, undefined, getInteractionModality(trigger.ownerDocument));
|
|
418
443
|
}
|
|
419
444
|
triggerElementRef.current = null;
|
|
420
445
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,EAOZ,KAAK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KAAK,EAAE,wBAAwB,KAAK,SAAS,CAAC;IAC/D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,qBAAsB,SAAQ,qBAAqB;IAC3D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,wBAAwB,CAAC;IACxC,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAC3B,qBAAqB,GAAG,yBAAyB,CAAC;AAkwCpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA4CpD;yBA5Ce,YAAY"}
|
|
@@ -55,6 +55,7 @@ import { moveRegionsTab } from "./menuRegionStops.js";
|
|
|
55
55
|
import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
56
56
|
import { useMenuDrillIn } from "./useMenuDrillIn.js";
|
|
57
57
|
import { resolveMenuWidth } from "./menuWidth.js";
|
|
58
|
+
import { menuTouchActionStyles } from "./menuTouchAction.stylex.js";
|
|
58
59
|
import "../Layer/layerViewportInset.stylex.js";
|
|
59
60
|
import { layerViewportInset } from "../Layer/layerViewportInset.stylex.js";
|
|
60
61
|
import { useAdaptivePresentation } from "../hooks/useAdaptivePresentation.js";
|
|
@@ -138,15 +139,6 @@ const styles = {
|
|
|
138
139
|
kAzted: "x2lwn1j",
|
|
139
140
|
$$css: true
|
|
140
141
|
},
|
|
141
|
-
touchPinchZoom: {
|
|
142
|
-
kFalU9: "x1j4r261",
|
|
143
|
-
$$css: true
|
|
144
|
-
},
|
|
145
|
-
touchPanYPinchZoom: {
|
|
146
|
-
kFalU9: "xge0x1e",
|
|
147
|
-
kZeWKH: "xish69e",
|
|
148
|
-
$$css: true
|
|
149
|
-
},
|
|
150
142
|
popoverViewport: {
|
|
151
143
|
kB7OPa: "x9f619",
|
|
152
144
|
kskxy: "x1uh1i8a",
|
|
@@ -1270,7 +1262,7 @@ function DropdownMenuPopover({
|
|
|
1270
1262
|
}
|
|
1271
1263
|
},
|
|
1272
1264
|
...menuPress.menuProps,
|
|
1273
|
-
...mergeProps(themeProps('dropdown-menu'), stylex.props(styles.dropdown, resolvedMaxHeight != null && dynamicStyles.menuMaxHeight(resolvedMaxHeight), hasOverflow ?
|
|
1265
|
+
...mergeProps(themeProps('dropdown-menu'), stylex.props(styles.dropdown, resolvedMaxHeight != null && dynamicStyles.menuMaxHeight(resolvedMaxHeight), hasOverflow ? menuTouchActionStyles.scrolls : menuTouchActionStyles.fits, hasOverflow && styles.scrollable, hasRegions && styles.menuInFrame,
|
|
1274
1266
|
// Between a header and a footer the menu is a Tab stop, so
|
|
1275
1267
|
// keyboard focus on it must be visible (the base style removes
|
|
1276
1268
|
// the ring for the pointer-open focus target).
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file DropdownMenuGroup.tsx
|
|
3
|
-
* @input Uses spacing/typography/color tokens, themeProps (heading target)
|
|
3
|
+
* @input Uses spacing/typography/color tokens, themeProps (heading target);
|
|
4
|
+
* forwards host props to the group element
|
|
4
5
|
* @output Exports DropdownMenuGroup component and DropdownMenuGroupProps
|
|
5
6
|
* @position Sub-component; used inside DropdownMenu
|
|
6
7
|
*
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
*/
|
|
21
22
|
import { type ReactNode } from 'react';
|
|
22
23
|
import type { BaseProps } from '../BaseProps.js';
|
|
23
|
-
export interface DropdownMenuGroupProps extends
|
|
24
|
+
export interface DropdownMenuGroupProps extends Omit<BaseProps<HTMLDivElement>, 'role'> {
|
|
24
25
|
/**
|
|
25
26
|
* Heading shown above the group's rows and used as the group's accessible
|
|
26
27
|
* name (`aria-labelledby`). Omit it for an unnamed group. Keep this content
|
|
@@ -39,7 +40,9 @@ export interface DropdownMenuGroupProps extends Pick<BaseProps, 'xstyle' | 'clas
|
|
|
39
40
|
* `menuitem`, so arrow-key navigation and typeahead skip it. Keep heading
|
|
40
41
|
* content non-interactive; place controls in DropdownMenu's `header` or
|
|
41
42
|
* `footer`. The compound peer of
|
|
42
|
-
* `{type: 'section', title, items}` in the `items` data API.
|
|
43
|
+
* `{type: 'section', title, items}` in the `items` data API. Host attributes
|
|
44
|
+
* (`id`, `data-*`, `aria-*`) and DOM handlers reach the group element; its
|
|
45
|
+
* role, and its name while it has a title, stay component-owned.
|
|
43
46
|
*
|
|
44
47
|
* @example
|
|
45
48
|
* ```
|
|
@@ -53,7 +56,7 @@ export interface DropdownMenuGroupProps extends Pick<BaseProps, 'xstyle' | 'clas
|
|
|
53
56
|
* </DropdownMenu>
|
|
54
57
|
* ```
|
|
55
58
|
*/
|
|
56
|
-
export declare function DropdownMenuGroup({ title, children, xstyle, className, style, ref, }: DropdownMenuGroupProps): import("react").JSX.Element;
|
|
59
|
+
export declare function DropdownMenuGroup({ title, children, xstyle, className, style, ref, 'aria-labelledby': ariaLabelledBy, ...rest }: DropdownMenuGroupProps): import("react").JSX.Element;
|
|
57
60
|
export declare namespace DropdownMenuGroup {
|
|
58
61
|
var displayName: string;
|
|
59
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuGroup.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"DropdownMenuGroup.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuGroup.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQ5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,MAAM,WAAW,sBAAuB,SAAQ,IAAI,CAClD,SAAS,CAAC,cAAc,CAAC,EACzB,MAAM,CACP;IACC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mDAAmD;IACnD,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,iBAAiB,EAAE,cAAc,EACjC,GAAG,IAAI,EACR,EAAE,sBAAsB,+BAwBxB;yBAjCe,iBAAiB"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file DropdownMenuGroup.tsx
|
|
7
|
-
* @input Uses spacing/typography/color tokens, themeProps (heading target)
|
|
7
|
+
* @input Uses spacing/typography/color tokens, themeProps (heading target);
|
|
8
|
+
* forwards host props to the group element
|
|
8
9
|
* @output Exports DropdownMenuGroup component and DropdownMenuGroupProps
|
|
9
10
|
* @position Sub-component; used inside DropdownMenu
|
|
10
11
|
*
|
|
@@ -36,7 +37,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
36
37
|
* `menuitem`, so arrow-key navigation and typeahead skip it. Keep heading
|
|
37
38
|
* content non-interactive; place controls in DropdownMenu's `header` or
|
|
38
39
|
* `footer`. The compound peer of
|
|
39
|
-
* `{type: 'section', title, items}` in the `items` data API.
|
|
40
|
+
* `{type: 'section', title, items}` in the `items` data API. Host attributes
|
|
41
|
+
* (`id`, `data-*`, `aria-*`) and DOM handlers reach the group element; its
|
|
42
|
+
* role, and its name while it has a title, stay component-owned.
|
|
40
43
|
*
|
|
41
44
|
* @example
|
|
42
45
|
* ```
|
|
@@ -56,14 +59,17 @@ export function DropdownMenuGroup({
|
|
|
56
59
|
xstyle,
|
|
57
60
|
className,
|
|
58
61
|
style,
|
|
59
|
-
ref
|
|
62
|
+
ref,
|
|
63
|
+
'aria-labelledby': ariaLabelledBy,
|
|
64
|
+
...rest
|
|
60
65
|
}) {
|
|
61
66
|
const headingId = useId();
|
|
62
67
|
const hasTitle = title != null && title !== '' && title !== false;
|
|
63
68
|
return /*#__PURE__*/_jsxs("div", {
|
|
69
|
+
...rest,
|
|
64
70
|
ref: ref,
|
|
65
71
|
role: "group",
|
|
66
|
-
"aria-labelledby": hasTitle ? headingId :
|
|
72
|
+
"aria-labelledby": hasTitle ? headingId : ariaLabelledBy,
|
|
67
73
|
...mergeProps(stylex.props(xstyle), className, style),
|
|
68
74
|
children: [hasTitle && /*#__PURE__*/_jsx("div", {
|
|
69
75
|
id: headingId,
|