@base-ui/react 1.1.0 → 1.2.0
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 +173 -0
- package/accordion/item/AccordionItem.d.ts +1 -1
- package/accordion/item/AccordionItemContext.d.ts +1 -1
- package/accordion/root/AccordionRoot.d.ts +9 -9
- package/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/alert-dialog/root/AlertDialogRoot.js +6 -4
- package/autocomplete/index.parts.d.ts +2 -1
- package/autocomplete/index.parts.js +8 -1
- package/autocomplete/root/AutocompleteRoot.d.ts +19 -14
- package/autocomplete/root/AutocompleteRoot.js +4 -6
- package/avatar/fallback/AvatarFallback.d.ts +7 -2
- package/avatar/fallback/AvatarFallback.js +34 -6
- package/avatar/image/AvatarImage.d.ts +7 -2
- package/avatar/image/AvatarImage.js +35 -6
- package/avatar/image/useImageLoadingStatus.d.ts +2 -2
- package/avatar/root/AvatarRoot.js +2 -2
- package/button/Button.d.ts +1 -1
- package/button/Button.js +2 -2
- package/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/checkbox/indicator/CheckboxIndicator.js +4 -4
- package/checkbox/root/CheckboxRoot.d.ts +13 -13
- package/checkbox/root/CheckboxRoot.js +31 -8
- package/checkbox-group/CheckboxGroup.d.ts +5 -5
- package/checkbox-group/CheckboxGroup.js +2 -2
- package/checkbox-group/useCheckboxGroupParent.d.ts +3 -3
- package/collapsible/panel/CollapsiblePanel.d.ts +2 -2
- package/collapsible/root/CollapsibleRoot.d.ts +4 -4
- package/collapsible/root/useCollapsibleRoot.d.ts +2 -2
- package/combobox/arrow/ComboboxArrow.js +2 -2
- package/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
- package/combobox/backdrop/ComboboxBackdrop.js +2 -2
- package/combobox/chip/ComboboxChip.js +6 -3
- package/combobox/chip/ComboboxChipContext.js +1 -0
- package/combobox/chip-remove/ComboboxChipRemove.js +28 -33
- package/combobox/chips/ComboboxChipsContext.js +1 -0
- package/combobox/clear/ComboboxClear.d.ts +2 -2
- package/combobox/clear/ComboboxClear.js +2 -3
- package/combobox/group/ComboboxGroup.d.ts +1 -1
- package/combobox/group/ComboboxGroupContext.d.ts +1 -1
- package/combobox/group/ComboboxGroupContext.js +1 -0
- package/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/combobox/index.parts.d.ts +2 -1
- package/combobox/index.parts.js +8 -1
- package/combobox/input/ComboboxInput.d.ts +1 -1
- package/combobox/input/ComboboxInput.js +38 -8
- package/combobox/item/ComboboxItem.d.ts +3 -3
- package/combobox/item/ComboboxItem.js +15 -15
- package/combobox/item/ComboboxItemContext.js +1 -0
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
- package/combobox/list/ComboboxList.js +2 -2
- package/combobox/popup/ComboboxPopup.d.ts +2 -2
- package/combobox/popup/ComboboxPopup.js +3 -4
- package/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
- package/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/combobox/portal/ComboboxPortalContext.js +1 -0
- package/combobox/positioner/ComboboxPositioner.js +5 -3
- package/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
- package/combobox/root/AriaCombobox.d.ts +49 -44
- package/combobox/root/AriaCombobox.js +44 -62
- package/combobox/root/ComboboxRoot.d.ts +19 -14
- package/combobox/root/ComboboxRoot.js +3 -1
- package/combobox/root/ComboboxRootContext.d.ts +1 -0
- package/combobox/root/ComboboxRootContext.js +1 -0
- package/combobox/root/utils/useFilter.d.ts +2 -2
- package/combobox/root/utils/useFilteredItems.d.ts +4 -0
- package/combobox/root/utils/useFilteredItems.js +14 -0
- package/combobox/row/ComboboxRowContext.js +1 -0
- package/combobox/store.d.ts +11 -11
- package/combobox/store.js +3 -3
- package/combobox/trigger/ComboboxTrigger.d.ts +1 -1
- package/combobox/trigger/ComboboxTrigger.js +3 -4
- package/composite/item/CompositeItem.d.ts +6 -6
- package/composite/list/CompositeList.d.ts +3 -3
- package/composite/list/CompositeListContext.d.ts +1 -1
- package/composite/list/useCompositeListItem.d.ts +5 -5
- package/composite/root/CompositeRoot.d.ts +19 -19
- package/composite/root/useCompositeRoot.d.ts +12 -12
- package/context-menu/index.d.ts +1 -0
- package/context-menu/index.parts.d.ts +1 -0
- package/context-menu/index.parts.js +7 -0
- package/context-menu/root/ContextMenuRoot.d.ts +1 -1
- package/context-menu/root/ContextMenuRootContext.js +1 -0
- package/context-menu/trigger/ContextMenuTrigger.js +13 -3
- package/csp-provider/CSPContext.d.ts +2 -2
- package/csp-provider/CSPProvider.d.ts +2 -2
- package/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dialog/backdrop/DialogBackdrop.js +2 -2
- package/dialog/close/DialogClose.js +2 -2
- package/dialog/popup/DialogPopup.d.ts +2 -2
- package/dialog/popup/DialogPopup.js +2 -2
- package/dialog/portal/DialogPortal.d.ts +2 -2
- package/dialog/portal/DialogPortalContext.js +1 -0
- package/dialog/root/DialogRoot.d.ts +10 -10
- package/dialog/root/DialogRoot.js +17 -4
- package/dialog/root/useDialogRoot.d.ts +3 -3
- package/dialog/root/useDialogRoot.js +4 -0
- package/dialog/store/DialogStore.d.ts +258 -17
- package/dialog/store/DialogStore.js +3 -0
- package/dialog/trigger/DialogTrigger.d.ts +3 -3
- package/dialog/trigger/DialogTrigger.js +3 -3
- package/dialog/viewport/DialogViewport.js +5 -2
- package/direction-provider/DirectionProvider.d.ts +1 -1
- package/drawer/backdrop/DrawerBackdrop.d.ts +28 -0
- package/drawer/backdrop/DrawerBackdrop.js +63 -0
- package/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
- package/drawer/backdrop/DrawerBackdropCssVars.js +14 -0
- package/drawer/close/DrawerClose.d.ts +23 -0
- package/drawer/close/DrawerClose.js +15 -0
- package/drawer/content/DrawerContent.d.ts +15 -0
- package/drawer/content/DrawerContent.js +32 -0
- package/drawer/description/DrawerDescription.d.ts +18 -0
- package/drawer/description/DrawerDescription.js +15 -0
- package/drawer/indent/DrawerIndent.d.ts +20 -0
- package/drawer/indent/DrawerIndent.js +87 -0
- package/drawer/indent-background/DrawerIndentBackground.d.ts +18 -0
- package/drawer/indent-background/DrawerIndentBackground.js +47 -0
- package/drawer/index.d.ts +14 -0
- package/drawer/index.js +9 -0
- package/drawer/index.parts.d.ts +14 -0
- package/drawer/index.parts.js +109 -0
- package/drawer/popup/DrawerPopup.d.ts +69 -0
- package/drawer/popup/DrawerPopup.js +291 -0
- package/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
- package/drawer/popup/DrawerPopupCssVars.js +44 -0
- package/drawer/popup/DrawerPopupDataAttributes.d.ts +27 -0
- package/drawer/popup/DrawerPopupDataAttributes.js +34 -0
- package/drawer/portal/DrawerPortal.d.ts +29 -0
- package/drawer/portal/DrawerPortal.js +16 -0
- package/drawer/provider/DrawerProvider.d.ts +16 -0
- package/drawer/provider/DrawerProvider.js +100 -0
- package/drawer/provider/DrawerProviderContext.d.ts +19 -0
- package/drawer/provider/DrawerProviderContext.js +21 -0
- package/drawer/root/DrawerRoot.d.ts +124 -0
- package/drawer/root/DrawerRoot.js +235 -0
- package/drawer/root/DrawerRootContext.d.ts +89 -0
- package/drawer/root/DrawerRootContext.js +21 -0
- package/drawer/root/useDrawerSnapPoints.d.ts +15 -0
- package/drawer/root/useDrawerSnapPoints.js +155 -0
- package/drawer/swipe-area/DrawerSwipeArea.d.ts +45 -0
- package/drawer/swipe-area/DrawerSwipeArea.js +385 -0
- package/drawer/title/DrawerTitle.d.ts +18 -0
- package/drawer/title/DrawerTitle.js +15 -0
- package/drawer/trigger/DrawerTrigger.d.ts +43 -0
- package/drawer/trigger/DrawerTrigger.js +15 -0
- package/drawer/viewport/DrawerViewport.d.ts +30 -0
- package/drawer/viewport/DrawerViewport.js +873 -0
- package/drawer/viewport/DrawerViewportContext.d.ts +11 -0
- package/drawer/viewport/DrawerViewportContext.js +21 -0
- package/esm/accordion/item/AccordionItem.d.ts +1 -1
- package/esm/accordion/item/AccordionItemContext.d.ts +1 -1
- package/esm/accordion/root/AccordionRoot.d.ts +9 -9
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/esm/alert-dialog/root/AlertDialogRoot.js +6 -4
- package/esm/autocomplete/index.parts.d.ts +2 -1
- package/esm/autocomplete/index.parts.js +2 -1
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +19 -14
- package/esm/autocomplete/root/AutocompleteRoot.js +4 -6
- package/esm/avatar/fallback/AvatarFallback.d.ts +7 -2
- package/esm/avatar/fallback/AvatarFallback.js +33 -6
- package/esm/avatar/image/AvatarImage.d.ts +7 -2
- package/esm/avatar/image/AvatarImage.js +34 -6
- package/esm/avatar/image/useImageLoadingStatus.d.ts +2 -2
- package/esm/avatar/root/AvatarRoot.js +2 -2
- package/esm/button/Button.d.ts +1 -1
- package/esm/button/Button.js +2 -2
- package/esm/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/esm/checkbox/indicator/CheckboxIndicator.js +4 -4
- package/esm/checkbox/root/CheckboxRoot.d.ts +13 -13
- package/esm/checkbox/root/CheckboxRoot.js +31 -8
- package/esm/checkbox-group/CheckboxGroup.d.ts +5 -5
- package/esm/checkbox-group/CheckboxGroup.js +2 -2
- package/esm/checkbox-group/useCheckboxGroupParent.d.ts +3 -3
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +2 -2
- package/esm/collapsible/root/CollapsibleRoot.d.ts +4 -4
- package/esm/collapsible/root/useCollapsibleRoot.d.ts +2 -2
- package/esm/combobox/arrow/ComboboxArrow.js +2 -2
- package/esm/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
- package/esm/combobox/backdrop/ComboboxBackdrop.js +2 -2
- package/esm/combobox/chip/ComboboxChip.js +6 -3
- package/esm/combobox/chip/ComboboxChipContext.js +2 -0
- package/esm/combobox/chip-remove/ComboboxChipRemove.js +28 -33
- package/esm/combobox/chips/ComboboxChipsContext.js +2 -0
- package/esm/combobox/clear/ComboboxClear.d.ts +2 -2
- package/esm/combobox/clear/ComboboxClear.js +2 -3
- package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroupContext.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroupContext.js +2 -0
- package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/esm/combobox/index.parts.d.ts +2 -1
- package/esm/combobox/index.parts.js +2 -1
- package/esm/combobox/input/ComboboxInput.d.ts +1 -1
- package/esm/combobox/input/ComboboxInput.js +38 -8
- package/esm/combobox/item/ComboboxItem.d.ts +3 -3
- package/esm/combobox/item/ComboboxItem.js +15 -15
- package/esm/combobox/item/ComboboxItemContext.js +2 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
- package/esm/combobox/list/ComboboxList.js +2 -2
- package/esm/combobox/popup/ComboboxPopup.d.ts +2 -2
- package/esm/combobox/popup/ComboboxPopup.js +3 -4
- package/esm/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
- package/esm/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/esm/combobox/portal/ComboboxPortalContext.js +2 -0
- package/esm/combobox/positioner/ComboboxPositioner.js +5 -3
- package/esm/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
- package/esm/combobox/root/AriaCombobox.d.ts +49 -44
- package/esm/combobox/root/AriaCombobox.js +45 -63
- package/esm/combobox/root/ComboboxRoot.d.ts +19 -14
- package/esm/combobox/root/ComboboxRoot.js +3 -1
- package/esm/combobox/root/ComboboxRootContext.d.ts +1 -0
- package/esm/combobox/root/ComboboxRootContext.js +2 -0
- package/esm/combobox/root/utils/useFilter.d.ts +2 -2
- package/esm/combobox/root/utils/useFilteredItems.d.ts +4 -0
- package/esm/combobox/root/utils/useFilteredItems.js +9 -0
- package/esm/combobox/row/ComboboxRowContext.js +2 -0
- package/esm/combobox/store.d.ts +11 -11
- package/esm/combobox/store.js +3 -3
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +1 -1
- package/esm/combobox/trigger/ComboboxTrigger.js +3 -4
- package/esm/composite/item/CompositeItem.d.ts +6 -6
- package/esm/composite/list/CompositeList.d.ts +3 -3
- package/esm/composite/list/CompositeListContext.d.ts +1 -1
- package/esm/composite/list/useCompositeListItem.d.ts +5 -5
- package/esm/composite/root/CompositeRoot.d.ts +19 -19
- package/esm/composite/root/useCompositeRoot.d.ts +12 -12
- package/esm/context-menu/index.d.ts +1 -0
- package/esm/context-menu/index.parts.d.ts +1 -0
- package/esm/context-menu/index.parts.js +1 -0
- package/esm/context-menu/root/ContextMenuRoot.d.ts +1 -1
- package/esm/context-menu/root/ContextMenuRootContext.js +2 -0
- package/esm/context-menu/trigger/ContextMenuTrigger.js +13 -3
- package/esm/csp-provider/CSPContext.d.ts +2 -2
- package/esm/csp-provider/CSPProvider.d.ts +2 -2
- package/esm/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/esm/dialog/backdrop/DialogBackdrop.js +2 -2
- package/esm/dialog/close/DialogClose.js +2 -2
- package/esm/dialog/popup/DialogPopup.d.ts +2 -2
- package/esm/dialog/popup/DialogPopup.js +2 -2
- package/esm/dialog/portal/DialogPortal.d.ts +2 -2
- package/esm/dialog/portal/DialogPortalContext.js +2 -0
- package/esm/dialog/root/DialogRoot.d.ts +10 -10
- package/esm/dialog/root/DialogRoot.js +17 -4
- package/esm/dialog/root/useDialogRoot.d.ts +3 -3
- package/esm/dialog/root/useDialogRoot.js +4 -0
- package/esm/dialog/store/DialogStore.d.ts +258 -17
- package/esm/dialog/store/DialogStore.js +3 -0
- package/esm/dialog/trigger/DialogTrigger.d.ts +3 -3
- package/esm/dialog/trigger/DialogTrigger.js +2 -2
- package/esm/dialog/viewport/DialogViewport.js +5 -2
- package/esm/direction-provider/DirectionProvider.d.ts +1 -1
- package/esm/drawer/backdrop/DrawerBackdrop.d.ts +28 -0
- package/esm/drawer/backdrop/DrawerBackdrop.js +57 -0
- package/esm/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
- package/esm/drawer/backdrop/DrawerBackdropCssVars.js +8 -0
- package/esm/drawer/close/DrawerClose.d.ts +23 -0
- package/esm/drawer/close/DrawerClose.js +10 -0
- package/esm/drawer/content/DrawerContent.d.ts +15 -0
- package/esm/drawer/content/DrawerContent.js +27 -0
- package/esm/drawer/description/DrawerDescription.d.ts +18 -0
- package/esm/drawer/description/DrawerDescription.js +10 -0
- package/esm/drawer/indent/DrawerIndent.d.ts +20 -0
- package/esm/drawer/indent/DrawerIndent.js +81 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.d.ts +18 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.js +41 -0
- package/esm/drawer/index.d.ts +14 -0
- package/esm/drawer/index.js +1 -0
- package/esm/drawer/index.parts.d.ts +14 -0
- package/esm/drawer/index.parts.js +14 -0
- package/esm/drawer/popup/DrawerPopup.d.ts +69 -0
- package/esm/drawer/popup/DrawerPopup.js +285 -0
- package/esm/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
- package/esm/drawer/popup/DrawerPopupCssVars.js +38 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.d.ts +27 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.js +28 -0
- package/esm/drawer/portal/DrawerPortal.d.ts +29 -0
- package/esm/drawer/portal/DrawerPortal.js +11 -0
- package/esm/drawer/provider/DrawerProvider.d.ts +16 -0
- package/esm/drawer/provider/DrawerProvider.js +95 -0
- package/esm/drawer/provider/DrawerProviderContext.d.ts +19 -0
- package/esm/drawer/provider/DrawerProviderContext.js +13 -0
- package/esm/drawer/root/DrawerRoot.d.ts +124 -0
- package/esm/drawer/root/DrawerRoot.js +229 -0
- package/esm/drawer/root/DrawerRootContext.d.ts +89 -0
- package/esm/drawer/root/DrawerRootContext.js +13 -0
- package/esm/drawer/root/useDrawerSnapPoints.d.ts +15 -0
- package/esm/drawer/root/useDrawerSnapPoints.js +149 -0
- package/esm/drawer/swipe-area/DrawerSwipeArea.d.ts +45 -0
- package/esm/drawer/swipe-area/DrawerSwipeArea.js +379 -0
- package/esm/drawer/title/DrawerTitle.d.ts +18 -0
- package/esm/drawer/title/DrawerTitle.js +10 -0
- package/esm/drawer/trigger/DrawerTrigger.d.ts +43 -0
- package/esm/drawer/trigger/DrawerTrigger.js +10 -0
- package/esm/drawer/viewport/DrawerViewport.d.ts +30 -0
- package/esm/drawer/viewport/DrawerViewport.js +867 -0
- package/esm/drawer/viewport/DrawerViewportContext.d.ts +11 -0
- package/esm/drawer/viewport/DrawerViewportContext.js +13 -0
- package/esm/field/control/FieldControl.d.ts +3 -3
- package/esm/field/control/FieldControl.js +22 -20
- package/esm/field/error/FieldError.d.ts +5 -2
- package/esm/field/error/FieldError.js +50 -7
- package/esm/field/item/FieldItem.d.ts +1 -1
- package/esm/field/item/FieldItemContext.js +2 -0
- package/esm/field/label/FieldLabel.d.ts +1 -1
- package/esm/field/label/FieldLabel.js +7 -2
- package/esm/field/root/FieldRoot.d.ts +9 -9
- package/esm/field/root/FieldRootContext.d.ts +1 -1
- package/esm/field/useField.d.ts +1 -1
- package/esm/field/useField.js +2 -0
- package/esm/field/validity/FieldValidity.d.ts +2 -0
- package/esm/field/validity/FieldValidity.js +11 -4
- package/esm/fieldset/legend/FieldsetLegend.js +2 -2
- package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/esm/fieldset/root/FieldsetRoot.js +3 -3
- package/esm/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
- package/esm/floating-ui-react/components/FloatingDelayGroup.js +2 -9
- package/esm/floating-ui-react/components/FloatingFocusManager.d.ts +11 -21
- package/esm/floating-ui-react/components/FloatingFocusManager.js +63 -76
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +8 -9
- package/esm/floating-ui-react/components/FloatingPortal.js +1 -3
- package/esm/floating-ui-react/components/FloatingTree.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useClick.d.ts +12 -6
- package/esm/floating-ui-react/hooks/useClick.js +6 -5
- package/esm/floating-ui-react/hooks/useClientPoint.d.ts +2 -12
- package/esm/floating-ui-react/hooks/useClientPoint.js +5 -16
- package/esm/floating-ui-react/hooks/useDismiss.d.ts +15 -15
- package/esm/floating-ui-react/hooks/useDismiss.js +6 -3
- package/esm/floating-ui-react/hooks/useFloating.js +2 -0
- package/esm/floating-ui-react/hooks/useFloatingRootContext.d.ts +4 -10
- package/esm/floating-ui-react/hooks/useFloatingRootContext.js +5 -3
- package/esm/floating-ui-react/hooks/useFocus.d.ts +2 -8
- package/esm/floating-ui-react/hooks/useFocus.js +11 -12
- package/esm/floating-ui-react/hooks/useHover.d.ts +7 -30
- package/esm/floating-ui-react/hooks/useHover.js +20 -37
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -7
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +35 -40
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +17 -14
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +36 -30
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +7 -3
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +57 -60
- package/esm/floating-ui-react/hooks/useInteractions.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
- package/esm/floating-ui-react/hooks/useListNavigation.js +13 -12
- package/esm/floating-ui-react/hooks/useRole.d.ts +1 -7
- package/esm/floating-ui-react/hooks/useRole.js +2 -3
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +2 -0
- package/esm/floating-ui-react/hooks/useTypeahead.d.ts +6 -16
- package/esm/floating-ui-react/hooks/useTypeahead.js +48 -16
- package/esm/floating-ui-react/middleware/arrow.d.ts +1 -1
- package/esm/floating-ui-react/safePolygon.d.ts +3 -3
- package/esm/floating-ui-react/types.d.ts +14 -14
- package/esm/floating-ui-react/utils/composite.d.ts +5 -5
- package/esm/floating-ui-react/utils/composite.js +1 -2
- package/esm/floating-ui-react/utils/element.d.ts +2 -1
- package/esm/floating-ui-react/utils/element.js +16 -4
- package/esm/floating-ui-react/utils/enqueueFocus.d.ts +3 -3
- package/esm/floating-ui-react/utils/event.js +2 -4
- package/esm/floating-ui-react/utils/markOthers.js +2 -2
- package/esm/floating-ui-react/utils/tabbable.js +6 -5
- package/esm/form/Form.d.ts +5 -5
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/input/Input.d.ts +3 -3
- package/esm/labelable-provider/LabelableContext.d.ts +1 -1
- package/esm/labelable-provider/LabelableContext.js +1 -1
- package/esm/labelable-provider/LabelableProvider.js +33 -3
- package/esm/labelable-provider/useLabelableId.d.ts +3 -2
- package/esm/labelable-provider/useLabelableId.js +38 -12
- package/esm/menu/arrow/MenuArrow.js +2 -2
- package/esm/menu/arrow/MenuArrowDataAttributes.js +2 -2
- package/esm/menu/backdrop/MenuBackdrop.js +2 -2
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +8 -8
- package/esm/menu/checkbox-item/MenuCheckboxItemContext.js +2 -0
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +2 -2
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
- package/esm/menu/group/MenuGroupContext.js +2 -0
- package/esm/menu/index.d.ts +2 -1
- package/esm/menu/index.parts.d.ts +1 -0
- package/esm/menu/index.parts.js +1 -0
- package/esm/menu/item/MenuItem.d.ts +5 -5
- package/esm/menu/item/MenuItem.js +2 -2
- package/esm/menu/item/useMenuItem.js +12 -48
- package/esm/menu/item/useMenuItemCommonProps.d.ts +43 -0
- package/esm/menu/item/useMenuItemCommonProps.js +66 -0
- package/esm/menu/link-item/MenuLinkItem.d.ts +34 -0
- package/esm/menu/link-item/MenuLinkItem.js +55 -0
- package/esm/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
- package/esm/menu/link-item/MenuLinkItemDataAttributes.js +7 -0
- package/esm/menu/popup/MenuPopup.d.ts +3 -2
- package/esm/menu/popup/MenuPopup.js +2 -2
- package/esm/menu/popup/MenuPopupDataAttributes.js +2 -2
- package/esm/menu/portal/MenuPortal.d.ts +1 -1
- package/esm/menu/portal/MenuPortalContext.js +2 -0
- package/esm/menu/positioner/MenuPositioner.js +6 -12
- package/esm/menu/positioner/MenuPositionerDataAttributes.js +2 -2
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +2 -2
- package/esm/menu/radio-group/MenuRadioGroup.js +2 -2
- package/esm/menu/radio-group/MenuRadioGroupContext.js +2 -0
- package/esm/menu/radio-item/MenuRadioItem.d.ts +5 -5
- package/esm/menu/radio-item/MenuRadioItemContext.js +2 -0
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +2 -2
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
- package/esm/menu/root/MenuRoot.d.ts +15 -15
- package/esm/menu/root/MenuRoot.js +38 -36
- package/esm/menu/store/MenuStore.d.ts +255 -15
- package/esm/menu/store/MenuStore.js +2 -11
- package/esm/menu/submenu-root/MenuSubmenuRoot.d.ts +2 -2
- package/esm/menu/submenu-root/MenuSubmenuRootContext.js +2 -0
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +22 -22
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +9 -7
- package/esm/menu/trigger/MenuTrigger.d.ts +10 -6
- package/esm/menu/trigger/MenuTrigger.js +4 -3
- package/esm/menubar/Menubar.d.ts +4 -4
- package/esm/menubar/Menubar.js +2 -2
- package/esm/meter/root/MeterRoot.d.ts +6 -6
- package/esm/meter/root/MeterRoot.js +3 -11
- package/esm/meter/value/MeterValue.d.ts +1 -1
- package/esm/navigation-menu/arrow/NavigationMenuArrow.js +2 -2
- package/esm/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
- package/esm/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
- package/esm/navigation-menu/content/NavigationMenuContent.js +26 -5
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/esm/navigation-menu/icon/NavigationMenuIcon.js +2 -2
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/esm/navigation-menu/item/NavigationMenuItemContext.js +2 -0
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +2 -2
- package/esm/navigation-menu/link/NavigationMenuLink.js +2 -2
- package/esm/navigation-menu/list/NavigationMenuDismissContext.js +2 -0
- package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.js +2 -2
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +13 -0
- package/esm/navigation-menu/popup/NavigationMenuPopup.js +2 -2
- package/esm/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
- package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +2 -2
- package/esm/navigation-menu/portal/NavigationMenuPortalContext.js +2 -0
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
- package/esm/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +6 -6
- package/esm/navigation-menu/root/NavigationMenuRoot.js +2 -2
- package/esm/navigation-menu/root/NavigationMenuRootContext.js +2 -0
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +8 -124
- package/esm/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.js +21 -1
- package/esm/number-field/input/NumberFieldInput.js +3 -11
- package/esm/number-field/root/NumberFieldRoot.d.ts +27 -20
- package/esm/number-field/root/NumberFieldRoot.js +22 -7
- package/esm/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/esm/number-field/root/useNumberFieldButton.d.ts +3 -3
- package/esm/number-field/root/useNumberFieldButton.js +12 -7
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +2 -2
- package/esm/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
- package/esm/number-field/scrub-area/NumberFieldScrubAreaContext.js +2 -0
- package/esm/number-field/utils/stateAttributesMapping.js +3 -1
- package/esm/number-field/utils/subscribeToVisualViewportResize.d.ts +1 -1
- package/esm/number-field/utils/types.d.ts +5 -5
- package/esm/number-field/utils/validate.d.ts +3 -1
- package/esm/number-field/utils/validate.js +3 -2
- package/esm/popover/arrow/PopoverArrow.js +2 -2
- package/esm/popover/arrow/PopoverArrowDataAttributes.js +2 -2
- package/esm/popover/backdrop/PopoverBackdrop.js +2 -2
- package/esm/popover/popup/PopoverPopup.d.ts +3 -2
- package/esm/popover/popup/PopoverPopup.js +2 -2
- package/esm/popover/portal/PopoverPortal.d.ts +1 -1
- package/esm/popover/portal/PopoverPortal.js +1 -2
- package/esm/popover/portal/PopoverPortalContext.js +2 -0
- package/esm/popover/positioner/PopoverPositioner.js +3 -3
- package/esm/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
- package/esm/popover/root/PopoverRoot.d.ts +9 -9
- package/esm/popover/root/PopoverRoot.js +18 -5
- package/esm/popover/store/PopoverStore.d.ts +255 -15
- package/esm/popover/trigger/PopoverTrigger.d.ts +7 -7
- package/esm/popover/trigger/PopoverTrigger.js +2 -2
- package/esm/popover/viewport/PopoverViewport.d.ts +9 -1
- package/esm/popover/viewport/PopoverViewport.js +19 -196
- package/esm/popover/viewport/PopoverViewportDataAttributes.d.ts +5 -0
- package/esm/popover/viewport/PopoverViewportDataAttributes.js +5 -0
- package/esm/preview-card/arrow/PreviewCardArrow.js +2 -2
- package/esm/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
- package/esm/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
- package/esm/preview-card/popup/PreviewCardPopup.js +2 -2
- package/esm/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
- package/esm/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/esm/preview-card/portal/PreviewCardPortalContext.js +2 -0
- package/esm/preview-card/positioner/PreviewCardPositioner.js +2 -2
- package/esm/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
- package/esm/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
- package/esm/preview-card/root/PreviewCardRoot.d.ts +8 -8
- package/esm/preview-card/root/PreviewCardRoot.js +17 -4
- package/esm/preview-card/store/PreviewCardStore.d.ts +255 -15
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +4 -4
- package/esm/preview-card/trigger/PreviewCardTrigger.js +2 -2
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +6 -1
- package/esm/preview-card/viewport/PreviewCardViewport.js +14 -230
- package/esm/progress/root/ProgressRoot.d.ts +6 -6
- package/esm/progress/root/ProgressRoot.js +2 -13
- package/esm/progress/value/ProgressValue.d.ts +1 -1
- package/esm/radio/indicator/RadioIndicator.d.ts +1 -1
- package/esm/radio/indicator/RadioIndicator.js +4 -4
- package/esm/radio/root/RadioRoot.d.ts +37 -17
- package/esm/radio/root/RadioRoot.js +45 -11
- package/esm/radio-group/RadioGroup.d.ts +18 -12
- package/esm/radio-group/RadioGroup.js +69 -62
- package/esm/radio-group/RadioGroupContext.d.ts +9 -8
- package/esm/radio-group/RadioGroupContext.js +1 -13
- package/esm/scroll-area/root/ScrollAreaRoot.d.ts +4 -2
- package/esm/scroll-area/root/ScrollAreaRoot.js +2 -1
- package/esm/scroll-area/root/ScrollAreaRootContext.js +2 -0
- package/esm/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +4 -0
- package/esm/scroll-area/root/ScrollAreaRootDataAttributes.js +4 -0
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbarContext.js +2 -0
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +1 -1
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +1 -1
- package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +2 -2
- package/esm/scroll-area/utils/scrollEdges.d.ts +2 -0
- package/esm/scroll-area/utils/scrollEdges.js +22 -0
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +18 -15
- package/esm/scroll-area/viewport/ScrollAreaViewportContext.js +2 -0
- package/esm/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +4 -0
- package/esm/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +4 -0
- package/esm/select/arrow/SelectArrow.js +2 -2
- package/esm/select/arrow/SelectArrowDataAttributes.js +2 -2
- package/esm/select/backdrop/SelectBackdrop.js +2 -2
- package/esm/select/group/SelectGroupContext.js +2 -0
- package/esm/select/icon/SelectIcon.js +2 -2
- package/esm/select/item/SelectItem.d.ts +2 -2
- package/esm/select/item/SelectItem.js +13 -13
- package/esm/select/item/SelectItemContext.js +2 -0
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/esm/select/item-indicator/SelectItemIndicator.js +2 -2
- package/esm/select/popup/SelectPopup.d.ts +11 -0
- package/esm/select/popup/SelectPopup.js +64 -35
- package/esm/select/popup/SelectPopupDataAttributes.js +2 -2
- package/esm/select/portal/SelectPortalContext.js +2 -0
- package/esm/select/positioner/SelectPositioner.d.ts +1 -1
- package/esm/select/positioner/SelectPositioner.js +14 -11
- package/esm/select/positioner/SelectPositionerContext.js +2 -0
- package/esm/select/positioner/SelectPositionerDataAttributes.js +2 -2
- package/esm/select/root/SelectRoot.d.ts +27 -22
- package/esm/select/root/SelectRoot.js +2 -0
- package/esm/select/root/SelectRootContext.d.ts +14 -14
- package/esm/select/root/SelectRootContext.js +2 -0
- package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/esm/select/scroll-arrow/SelectScrollArrow.js +2 -2
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/esm/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
- package/esm/select/store.d.ts +3 -3
- package/esm/select/store.js +3 -3
- package/esm/select/trigger/SelectTrigger.d.ts +1 -1
- package/esm/select/trigger/SelectTrigger.js +2 -2
- package/esm/select/value/SelectValue.d.ts +4 -0
- package/esm/select/value/SelectValue.js +2 -2
- package/esm/separator/Separator.d.ts +1 -1
- package/esm/separator/Separator.js +2 -2
- package/esm/slider/root/SliderRoot.d.ts +17 -17
- package/esm/slider/root/SliderRoot.js +3 -2
- package/esm/slider/root/SliderRootContext.d.ts +2 -2
- package/esm/slider/root/stateAttributesMapping.js +3 -1
- package/esm/slider/thumb/SliderThumb.d.ts +7 -7
- package/esm/slider/utils/getPushedThumbValues.d.ts +1 -1
- package/esm/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/esm/slider/value/SliderValue.d.ts +1 -1
- package/esm/switch/root/SwitchRoot.d.ts +11 -11
- package/esm/switch/root/SwitchRoot.js +7 -1
- package/esm/switch/root/SwitchRootContext.js +2 -0
- package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.js +2 -2
- package/esm/tabs/list/TabsList.d.ts +2 -2
- package/esm/tabs/list/TabsList.js +2 -2
- package/esm/tabs/panel/TabsPanel.d.ts +4 -2
- package/esm/tabs/panel/TabsPanel.js +35 -9
- package/esm/tabs/root/TabsRoot.d.ts +4 -4
- package/esm/tabs/root/TabsRootContext.d.ts +1 -1
- package/esm/tabs/tab/TabsTab.d.ts +1 -1
- package/esm/tabs/tab/TabsTab.js +2 -2
- package/esm/toast/action/ToastAction.js +2 -2
- package/esm/toast/arrow/ToastArrow.js +2 -2
- package/esm/toast/arrow/ToastArrowDataAttributes.js +4 -3
- package/esm/toast/close/ToastClose.js +6 -8
- package/esm/toast/content/ToastContent.js +2 -2
- package/esm/toast/createToastManager.d.ts +5 -5
- package/esm/toast/createToastManager.js +3 -6
- package/esm/toast/description/ToastDescription.js +4 -6
- package/esm/toast/positioner/ToastPositioner.d.ts +2 -2
- package/esm/toast/positioner/ToastPositioner.js +6 -7
- package/esm/toast/positioner/ToastPositionerDataAttributes.js +2 -2
- package/esm/toast/provider/ToastProvider.d.ts +3 -3
- package/esm/toast/provider/ToastProvider.js +26 -285
- package/esm/toast/provider/ToastProviderContext.d.ts +4 -25
- package/esm/toast/provider/ToastProviderContext.js +3 -1
- package/esm/toast/root/ToastRoot.d.ts +1 -1
- package/esm/toast/root/ToastRoot.js +19 -27
- package/esm/toast/root/ToastRootContext.js +2 -0
- package/esm/toast/store.d.ts +51 -0
- package/esm/toast/store.js +355 -0
- package/esm/toast/title/ToastTitle.js +4 -6
- package/esm/toast/useToastManager.d.ts +20 -21
- package/esm/toast/useToastManager.js +8 -14
- package/esm/toast/viewport/ToastViewport.js +66 -92
- package/esm/toggle/Toggle.d.ts +10 -8
- package/esm/toggle/Toggle.js +13 -3
- package/esm/toggle-group/ToggleGroup.d.ts +22 -10
- package/esm/toggle-group/ToggleGroup.js +8 -5
- package/esm/toggle-group/ToggleGroupContext.d.ts +10 -5
- package/esm/toolbar/button/ToolbarButton.d.ts +2 -2
- package/esm/toolbar/button/ToolbarButton.js +2 -2
- package/esm/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/esm/toolbar/group/ToolbarGroup.js +2 -2
- package/esm/toolbar/group/ToolbarGroupContext.js +2 -0
- package/esm/toolbar/input/ToolbarInput.d.ts +3 -3
- package/esm/toolbar/input/ToolbarInput.js +2 -2
- package/esm/toolbar/link/ToolbarLink.js +2 -2
- package/esm/toolbar/root/ToolbarRoot.d.ts +3 -3
- package/esm/toolbar/root/ToolbarRoot.js +2 -2
- package/esm/tooltip/arrow/TooltipArrow.d.ts +1 -0
- package/esm/tooltip/arrow/TooltipArrow.js +2 -2
- package/esm/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
- package/esm/tooltip/popup/TooltipPopup.js +2 -2
- package/esm/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
- package/esm/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/esm/tooltip/portal/TooltipPortalContext.js +2 -0
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
- package/esm/tooltip/provider/TooltipProvider.d.ts +3 -3
- package/esm/tooltip/provider/TooltipProviderContext.js +2 -0
- package/esm/tooltip/root/TooltipRoot.d.ts +12 -12
- package/esm/tooltip/root/TooltipRoot.js +23 -11
- package/esm/tooltip/store/TooltipStore.d.ts +256 -16
- package/esm/tooltip/trigger/TooltipTrigger.d.ts +11 -4
- package/esm/tooltip/trigger/TooltipTrigger.js +12 -6
- package/esm/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
- package/esm/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
- package/esm/tooltip/viewport/TooltipViewport.d.ts +9 -1
- package/esm/tooltip/viewport/TooltipViewport.js +14 -195
- package/esm/unstable-use-media-query/index.d.ts +5 -5
- package/esm/use-button/useButton.d.ts +4 -4
- package/esm/use-button/useButton.js +7 -2
- package/esm/use-render/useRender.d.ts +9 -9
- package/esm/utils/InternalBackdrop.d.ts +1 -1
- package/esm/utils/createBaseUIEventDetails.d.ts +3 -0
- package/esm/utils/formatNumber.d.ts +2 -1
- package/esm/utils/formatNumber.js +11 -0
- package/esm/utils/getDisabledMountTransitionStyles.d.ts +1 -1
- package/esm/utils/getPseudoElementBounds.js +1 -1
- package/esm/utils/itemEquality.d.ts +5 -5
- package/esm/utils/itemEquality.js +17 -17
- package/esm/utils/popupStateMapping.d.ts +10 -0
- package/esm/utils/popupStateMapping.js +10 -0
- package/esm/utils/popups/popupStoreUtils.js +2 -0
- package/esm/utils/popups/popupTriggerMap.d.ts +14 -1
- package/esm/utils/popups/popupTriggerMap.js +27 -9
- package/esm/utils/popups/store.d.ts +28 -18
- package/esm/utils/popups/store.js +8 -5
- package/esm/utils/reason-parts.d.ts +3 -0
- package/esm/utils/reason-parts.js +3 -0
- package/esm/utils/scrollable.d.ts +4 -0
- package/esm/utils/scrollable.js +32 -0
- package/esm/utils/types.d.ts +6 -6
- package/esm/utils/useAnchorPositioning.d.ts +26 -26
- package/esm/utils/useAnchorPositioning.js +19 -16
- package/esm/utils/useFocusableWhenDisabled.d.ts +4 -4
- package/esm/utils/useMixedToggleClickHandler.d.ts +1 -1
- package/esm/utils/useMixedToggleClickHandler.js +2 -0
- package/esm/utils/useOpenChangeComplete.d.ts +2 -2
- package/esm/utils/usePopupAutoResize.d.ts +3 -3
- package/esm/utils/usePopupAutoResize.js +3 -1
- package/esm/utils/usePopupViewport.d.ts +58 -0
- package/esm/utils/usePopupViewport.js +247 -0
- package/esm/utils/useRenderElement.d.ts +9 -9
- package/esm/utils/useRenderElement.js +28 -1
- package/esm/utils/useSwipeDismiss.d.ts +108 -0
- package/esm/utils/useSwipeDismiss.js +944 -0
- package/esm/utils/useValueChanged.js +2 -0
- package/field/control/FieldControl.d.ts +3 -3
- package/field/control/FieldControl.js +21 -20
- package/field/error/FieldError.d.ts +5 -2
- package/field/error/FieldError.js +51 -7
- package/field/item/FieldItem.d.ts +1 -1
- package/field/item/FieldItemContext.js +1 -0
- package/field/label/FieldLabel.d.ts +1 -1
- package/field/label/FieldLabel.js +7 -2
- package/field/root/FieldRoot.d.ts +9 -9
- package/field/root/FieldRootContext.d.ts +1 -1
- package/field/useField.d.ts +1 -1
- package/field/useField.js +1 -0
- package/field/validity/FieldValidity.d.ts +2 -0
- package/field/validity/FieldValidity.js +9 -3
- package/fieldset/legend/FieldsetLegend.js +2 -2
- package/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/fieldset/root/FieldsetRoot.js +3 -3
- package/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
- package/floating-ui-react/components/FloatingDelayGroup.js +2 -9
- package/floating-ui-react/components/FloatingFocusManager.d.ts +11 -21
- package/floating-ui-react/components/FloatingFocusManager.js +61 -74
- package/floating-ui-react/components/FloatingPortal.d.ts +8 -9
- package/floating-ui-react/components/FloatingPortal.js +1 -3
- package/floating-ui-react/components/FloatingTree.d.ts +1 -1
- package/floating-ui-react/hooks/useClick.d.ts +12 -6
- package/floating-ui-react/hooks/useClick.js +6 -5
- package/floating-ui-react/hooks/useClientPoint.d.ts +2 -12
- package/floating-ui-react/hooks/useClientPoint.js +4 -16
- package/floating-ui-react/hooks/useDismiss.d.ts +15 -15
- package/floating-ui-react/hooks/useDismiss.js +4 -2
- package/floating-ui-react/hooks/useFloating.js +1 -0
- package/floating-ui-react/hooks/useFloatingRootContext.d.ts +4 -10
- package/floating-ui-react/hooks/useFloatingRootContext.js +4 -3
- package/floating-ui-react/hooks/useFocus.d.ts +2 -8
- package/floating-ui-react/hooks/useFocus.js +9 -11
- package/floating-ui-react/hooks/useHover.d.ts +7 -30
- package/floating-ui-react/hooks/useHover.js +18 -36
- package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -7
- package/floating-ui-react/hooks/useHoverFloatingInteraction.js +33 -39
- package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +17 -14
- package/floating-ui-react/hooks/useHoverInteractionSharedState.js +36 -30
- package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +7 -3
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +55 -59
- package/floating-ui-react/hooks/useInteractions.d.ts +2 -2
- package/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
- package/floating-ui-react/hooks/useListNavigation.js +11 -11
- package/floating-ui-react/hooks/useRole.d.ts +1 -7
- package/floating-ui-react/hooks/useRole.js +2 -3
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +2 -2
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +1 -0
- package/floating-ui-react/hooks/useTypeahead.d.ts +6 -16
- package/floating-ui-react/hooks/useTypeahead.js +46 -15
- package/floating-ui-react/middleware/arrow.d.ts +1 -1
- package/floating-ui-react/safePolygon.d.ts +3 -3
- package/floating-ui-react/types.d.ts +14 -14
- package/floating-ui-react/utils/composite.d.ts +5 -5
- package/floating-ui-react/utils/composite.js +1 -3
- package/floating-ui-react/utils/element.d.ts +2 -1
- package/floating-ui-react/utils/element.js +16 -4
- package/floating-ui-react/utils/enqueueFocus.d.ts +3 -3
- package/floating-ui-react/utils/event.js +2 -4
- package/floating-ui-react/utils/markOthers.js +2 -2
- package/floating-ui-react/utils/tabbable.js +5 -4
- package/form/Form.d.ts +5 -5
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/input/Input.d.ts +3 -3
- package/labelable-provider/LabelableContext.d.ts +1 -1
- package/labelable-provider/LabelableContext.js +1 -1
- package/labelable-provider/LabelableProvider.js +33 -3
- package/labelable-provider/useLabelableId.d.ts +3 -2
- package/labelable-provider/useLabelableId.js +39 -12
- package/menu/arrow/MenuArrow.js +2 -2
- package/menu/arrow/MenuArrowDataAttributes.js +2 -2
- package/menu/backdrop/MenuBackdrop.js +2 -2
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +8 -8
- package/menu/checkbox-item/MenuCheckboxItemContext.js +1 -0
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +2 -2
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
- package/menu/group/MenuGroupContext.js +1 -0
- package/menu/index.d.ts +2 -1
- package/menu/index.parts.d.ts +1 -0
- package/menu/index.parts.js +7 -0
- package/menu/item/MenuItem.d.ts +5 -5
- package/menu/item/MenuItem.js +2 -2
- package/menu/item/useMenuItem.js +12 -48
- package/menu/item/useMenuItemCommonProps.d.ts +43 -0
- package/menu/item/useMenuItemCommonProps.js +72 -0
- package/menu/link-item/MenuLinkItem.d.ts +34 -0
- package/menu/link-item/MenuLinkItem.js +60 -0
- package/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
- package/menu/link-item/MenuLinkItemDataAttributes.js +13 -0
- package/menu/popup/MenuPopup.d.ts +3 -2
- package/menu/popup/MenuPopup.js +2 -2
- package/menu/popup/MenuPopupDataAttributes.js +2 -2
- package/menu/portal/MenuPortal.d.ts +1 -1
- package/menu/portal/MenuPortalContext.js +1 -0
- package/menu/positioner/MenuPositioner.js +6 -12
- package/menu/positioner/MenuPositionerDataAttributes.js +2 -2
- package/menu/radio-group/MenuRadioGroup.d.ts +2 -2
- package/menu/radio-group/MenuRadioGroup.js +2 -2
- package/menu/radio-group/MenuRadioGroupContext.js +1 -0
- package/menu/radio-item/MenuRadioItem.d.ts +5 -5
- package/menu/radio-item/MenuRadioItemContext.js +1 -0
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +2 -2
- package/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
- package/menu/root/MenuRoot.d.ts +15 -15
- package/menu/root/MenuRoot.js +39 -37
- package/menu/store/MenuStore.d.ts +255 -15
- package/menu/store/MenuStore.js +2 -11
- package/menu/submenu-root/MenuSubmenuRoot.d.ts +2 -2
- package/menu/submenu-root/MenuSubmenuRootContext.js +1 -0
- package/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +22 -22
- package/menu/submenu-trigger/MenuSubmenuTrigger.js +10 -8
- package/menu/trigger/MenuTrigger.d.ts +10 -6
- package/menu/trigger/MenuTrigger.js +5 -4
- package/menubar/Menubar.d.ts +4 -4
- package/menubar/Menubar.js +2 -2
- package/meter/root/MeterRoot.d.ts +6 -6
- package/meter/root/MeterRoot.js +1 -10
- package/meter/value/MeterValue.d.ts +1 -1
- package/navigation-menu/arrow/NavigationMenuArrow.js +2 -2
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
- package/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
- package/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
- package/navigation-menu/content/NavigationMenuContent.js +26 -5
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/navigation-menu/icon/NavigationMenuIcon.js +2 -2
- package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/navigation-menu/item/NavigationMenuItemContext.js +1 -0
- package/navigation-menu/link/NavigationMenuLink.d.ts +2 -2
- package/navigation-menu/link/NavigationMenuLink.js +2 -2
- package/navigation-menu/list/NavigationMenuDismissContext.js +1 -0
- package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.js +2 -2
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +13 -0
- package/navigation-menu/popup/NavigationMenuPopup.js +2 -2
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +2 -2
- package/navigation-menu/portal/NavigationMenuPortalContext.js +1 -0
- package/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
- package/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
- package/navigation-menu/root/NavigationMenuRoot.d.ts +6 -6
- package/navigation-menu/root/NavigationMenuRoot.js +2 -2
- package/navigation-menu/root/NavigationMenuRootContext.js +1 -0
- package/navigation-menu/trigger/NavigationMenuTrigger.js +7 -124
- package/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.js +21 -1
- package/number-field/input/NumberFieldInput.js +3 -11
- package/number-field/root/NumberFieldRoot.d.ts +27 -20
- package/number-field/root/NumberFieldRoot.js +22 -7
- package/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/number-field/root/useNumberFieldButton.d.ts +3 -3
- package/number-field/root/useNumberFieldButton.js +12 -7
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +2 -2
- package/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
- package/number-field/scrub-area/NumberFieldScrubAreaContext.js +1 -0
- package/number-field/utils/stateAttributesMapping.js +3 -1
- package/number-field/utils/subscribeToVisualViewportResize.d.ts +1 -1
- package/number-field/utils/types.d.ts +5 -5
- package/number-field/utils/validate.d.ts +3 -1
- package/number-field/utils/validate.js +3 -2
- package/package.json +13 -4
- package/popover/arrow/PopoverArrow.js +2 -2
- package/popover/arrow/PopoverArrowDataAttributes.js +2 -2
- package/popover/backdrop/PopoverBackdrop.js +2 -2
- package/popover/popup/PopoverPopup.d.ts +3 -2
- package/popover/popup/PopoverPopup.js +2 -2
- package/popover/portal/PopoverPortal.d.ts +1 -1
- package/popover/portal/PopoverPortal.js +1 -2
- package/popover/portal/PopoverPortalContext.js +1 -0
- package/popover/positioner/PopoverPositioner.js +3 -3
- package/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
- package/popover/root/PopoverRoot.d.ts +9 -9
- package/popover/root/PopoverRoot.js +18 -5
- package/popover/store/PopoverStore.d.ts +255 -15
- package/popover/trigger/PopoverTrigger.d.ts +7 -7
- package/popover/trigger/PopoverTrigger.js +3 -3
- package/popover/viewport/PopoverViewport.d.ts +9 -1
- package/popover/viewport/PopoverViewport.js +19 -196
- package/popover/viewport/PopoverViewportDataAttributes.d.ts +5 -0
- package/popover/viewport/PopoverViewportDataAttributes.js +5 -0
- package/preview-card/arrow/PreviewCardArrow.js +2 -2
- package/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
- package/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
- package/preview-card/popup/PreviewCardPopup.js +2 -2
- package/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
- package/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/preview-card/portal/PreviewCardPortalContext.js +1 -0
- package/preview-card/positioner/PreviewCardPositioner.js +2 -2
- package/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
- package/preview-card/root/PreviewCardRoot.d.ts +8 -8
- package/preview-card/root/PreviewCardRoot.js +17 -4
- package/preview-card/store/PreviewCardStore.d.ts +255 -15
- package/preview-card/trigger/PreviewCardTrigger.d.ts +4 -4
- package/preview-card/trigger/PreviewCardTrigger.js +3 -3
- package/preview-card/viewport/PreviewCardViewport.d.ts +6 -1
- package/preview-card/viewport/PreviewCardViewport.js +14 -230
- package/progress/root/ProgressRoot.d.ts +6 -6
- package/progress/root/ProgressRoot.js +1 -12
- package/progress/value/ProgressValue.d.ts +1 -1
- package/radio/indicator/RadioIndicator.d.ts +1 -1
- package/radio/indicator/RadioIndicator.js +4 -4
- package/radio/root/RadioRoot.d.ts +37 -17
- package/radio/root/RadioRoot.js +45 -11
- package/radio-group/RadioGroup.d.ts +18 -12
- package/radio-group/RadioGroup.js +68 -61
- package/radio-group/RadioGroupContext.d.ts +9 -8
- package/radio-group/RadioGroupContext.js +1 -13
- package/scroll-area/root/ScrollAreaRoot.d.ts +4 -2
- package/scroll-area/root/ScrollAreaRoot.js +2 -1
- package/scroll-area/root/ScrollAreaRootContext.js +1 -0
- package/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +4 -0
- package/scroll-area/root/ScrollAreaRootDataAttributes.js +4 -0
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbarContext.js +1 -0
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +1 -1
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +1 -1
- package/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/scroll-area/thumb/ScrollAreaThumb.js +2 -2
- package/scroll-area/utils/scrollEdges.d.ts +2 -0
- package/scroll-area/utils/scrollEdges.js +29 -0
- package/scroll-area/viewport/ScrollAreaViewport.js +18 -15
- package/scroll-area/viewport/ScrollAreaViewportContext.js +1 -0
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +4 -0
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +4 -0
- package/select/arrow/SelectArrow.js +2 -2
- package/select/arrow/SelectArrowDataAttributes.js +2 -2
- package/select/backdrop/SelectBackdrop.js +2 -2
- package/select/group/SelectGroupContext.js +1 -0
- package/select/icon/SelectIcon.js +2 -2
- package/select/item/SelectItem.d.ts +2 -2
- package/select/item/SelectItem.js +13 -13
- package/select/item/SelectItemContext.js +1 -0
- package/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/select/item-indicator/SelectItemIndicator.js +2 -2
- package/select/popup/SelectPopup.d.ts +11 -0
- package/select/popup/SelectPopup.js +64 -35
- package/select/popup/SelectPopupDataAttributes.js +2 -2
- package/select/portal/SelectPortalContext.js +1 -0
- package/select/positioner/SelectPositioner.d.ts +1 -1
- package/select/positioner/SelectPositioner.js +13 -10
- package/select/positioner/SelectPositionerContext.js +1 -0
- package/select/positioner/SelectPositionerDataAttributes.js +2 -2
- package/select/root/SelectRoot.d.ts +27 -22
- package/select/root/SelectRoot.js +2 -0
- package/select/root/SelectRootContext.d.ts +14 -14
- package/select/root/SelectRootContext.js +1 -0
- package/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/select/scroll-arrow/SelectScrollArrow.js +2 -2
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
- package/select/store.d.ts +3 -3
- package/select/store.js +3 -3
- package/select/trigger/SelectTrigger.d.ts +1 -1
- package/select/trigger/SelectTrigger.js +2 -2
- package/select/value/SelectValue.d.ts +4 -0
- package/select/value/SelectValue.js +2 -2
- package/separator/Separator.d.ts +1 -1
- package/separator/Separator.js +2 -2
- package/slider/root/SliderRoot.d.ts +17 -17
- package/slider/root/SliderRoot.js +3 -2
- package/slider/root/SliderRootContext.d.ts +2 -2
- package/slider/root/stateAttributesMapping.js +3 -1
- package/slider/thumb/SliderThumb.d.ts +7 -7
- package/slider/utils/getPushedThumbValues.d.ts +1 -1
- package/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/slider/value/SliderValue.d.ts +1 -1
- package/switch/root/SwitchRoot.d.ts +11 -11
- package/switch/root/SwitchRoot.js +7 -1
- package/switch/root/SwitchRootContext.js +1 -0
- package/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.js +2 -2
- package/tabs/list/TabsList.d.ts +2 -2
- package/tabs/list/TabsList.js +2 -2
- package/tabs/panel/TabsPanel.d.ts +4 -2
- package/tabs/panel/TabsPanel.js +37 -10
- package/tabs/root/TabsRoot.d.ts +4 -4
- package/tabs/root/TabsRootContext.d.ts +1 -1
- package/tabs/tab/TabsTab.d.ts +1 -1
- package/tabs/tab/TabsTab.js +2 -2
- package/toast/action/ToastAction.js +2 -2
- package/toast/arrow/ToastArrow.js +2 -2
- package/toast/arrow/ToastArrowDataAttributes.js +4 -3
- package/toast/close/ToastClose.js +5 -7
- package/toast/content/ToastContent.js +2 -2
- package/toast/createToastManager.d.ts +5 -5
- package/toast/createToastManager.js +3 -6
- package/toast/description/ToastDescription.js +4 -6
- package/toast/positioner/ToastPositioner.d.ts +2 -2
- package/toast/positioner/ToastPositioner.js +5 -6
- package/toast/positioner/ToastPositionerDataAttributes.js +2 -2
- package/toast/provider/ToastProvider.d.ts +3 -3
- package/toast/provider/ToastProvider.js +24 -284
- package/toast/provider/ToastProviderContext.d.ts +4 -25
- package/toast/provider/ToastProviderContext.js +3 -2
- package/toast/root/ToastRoot.d.ts +1 -1
- package/toast/root/ToastRoot.js +18 -26
- package/toast/root/ToastRootContext.js +1 -0
- package/toast/store.d.ts +51 -0
- package/toast/store.js +362 -0
- package/toast/title/ToastTitle.js +4 -6
- package/toast/useToastManager.d.ts +20 -21
- package/toast/useToastManager.js +8 -14
- package/toast/viewport/ToastViewport.js +65 -91
- package/toggle/Toggle.d.ts +10 -8
- package/toggle/Toggle.js +13 -3
- package/toggle-group/ToggleGroup.d.ts +22 -10
- package/toggle-group/ToggleGroup.js +8 -5
- package/toggle-group/ToggleGroupContext.d.ts +10 -5
- package/toolbar/button/ToolbarButton.d.ts +2 -2
- package/toolbar/button/ToolbarButton.js +2 -2
- package/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/toolbar/group/ToolbarGroup.js +2 -2
- package/toolbar/group/ToolbarGroupContext.js +1 -0
- package/toolbar/input/ToolbarInput.d.ts +3 -3
- package/toolbar/input/ToolbarInput.js +2 -2
- package/toolbar/link/ToolbarLink.js +2 -2
- package/toolbar/root/ToolbarRoot.d.ts +3 -3
- package/toolbar/root/ToolbarRoot.js +2 -2
- package/tooltip/arrow/TooltipArrow.d.ts +1 -0
- package/tooltip/arrow/TooltipArrow.js +2 -2
- package/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
- package/tooltip/popup/TooltipPopup.js +2 -2
- package/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
- package/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/tooltip/portal/TooltipPortalContext.js +1 -0
- package/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
- package/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
- package/tooltip/provider/TooltipProvider.d.ts +3 -3
- package/tooltip/provider/TooltipProviderContext.js +1 -0
- package/tooltip/root/TooltipRoot.d.ts +12 -12
- package/tooltip/root/TooltipRoot.js +23 -11
- package/tooltip/store/TooltipStore.d.ts +256 -16
- package/tooltip/trigger/TooltipTrigger.d.ts +11 -4
- package/tooltip/trigger/TooltipTrigger.js +12 -6
- package/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
- package/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
- package/tooltip/viewport/TooltipViewport.d.ts +9 -1
- package/tooltip/viewport/TooltipViewport.js +14 -195
- package/unstable-use-media-query/index.d.ts +5 -5
- package/use-button/useButton.d.ts +4 -4
- package/use-button/useButton.js +7 -2
- package/use-render/useRender.d.ts +9 -9
- package/utils/InternalBackdrop.d.ts +1 -1
- package/utils/createBaseUIEventDetails.d.ts +3 -0
- package/utils/formatNumber.d.ts +2 -1
- package/utils/formatNumber.js +12 -0
- package/utils/getDisabledMountTransitionStyles.d.ts +1 -1
- package/utils/getPseudoElementBounds.js +1 -1
- package/utils/itemEquality.d.ts +5 -5
- package/utils/itemEquality.js +18 -18
- package/utils/popupStateMapping.d.ts +10 -0
- package/utils/popupStateMapping.js +10 -0
- package/utils/popups/popupStoreUtils.js +1 -0
- package/utils/popups/popupTriggerMap.d.ts +14 -1
- package/utils/popups/popupTriggerMap.js +27 -10
- package/utils/popups/store.d.ts +28 -18
- package/utils/popups/store.js +8 -5
- package/utils/reason-parts.d.ts +3 -0
- package/utils/reason-parts.js +4 -1
- package/utils/scrollable.d.ts +4 -0
- package/utils/scrollable.js +40 -0
- package/utils/types.d.ts +6 -6
- package/utils/useAnchorPositioning.d.ts +26 -26
- package/utils/useAnchorPositioning.js +19 -16
- package/utils/useFocusableWhenDisabled.d.ts +4 -4
- package/utils/useMixedToggleClickHandler.d.ts +1 -1
- package/utils/useMixedToggleClickHandler.js +1 -0
- package/utils/useOpenChangeComplete.d.ts +2 -2
- package/utils/usePopupAutoResize.d.ts +3 -3
- package/utils/usePopupAutoResize.js +2 -1
- package/utils/usePopupViewport.d.ts +58 -0
- package/utils/usePopupViewport.js +253 -0
- package/utils/useRenderElement.d.ts +9 -9
- package/utils/useRenderElement.js +28 -1
- package/utils/useSwipeDismiss.d.ts +108 -0
- package/utils/useSwipeDismiss.js +952 -0
- package/utils/useValueChanged.js +1 -0
- package/esm/toast/viewport/ToastViewportContext.d.ts +0 -6
- package/esm/toast/viewport/ToastViewportContext.js +0 -11
- package/toast/viewport/ToastViewportContext.d.ts +0 -6
- package/toast/viewport/ToastViewportContext.js +0 -20
|
@@ -11,19 +11,14 @@ export interface FloatingFocusManagerProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* The interaction type used to open the floating element.
|
|
13
13
|
*/
|
|
14
|
-
openInteractionType?: InteractionType | null;
|
|
14
|
+
openInteractionType?: (InteractionType | null) | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Whether or not the focus manager should be disabled. Useful to delay focus
|
|
17
17
|
* management until after a transition completes or some other conditional
|
|
18
18
|
* state.
|
|
19
19
|
* @default false
|
|
20
20
|
*/
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* The order in which focus cycles.
|
|
24
|
-
* @default ['content']
|
|
25
|
-
*/
|
|
26
|
-
order?: Array<'reference' | 'floating' | 'content'>;
|
|
21
|
+
disabled?: boolean | undefined;
|
|
27
22
|
/**
|
|
28
23
|
* Determines the element to focus when the floating element is opened.
|
|
29
24
|
*
|
|
@@ -35,7 +30,7 @@ export interface FloatingFocusManagerProps {
|
|
|
35
30
|
* or `false`/`undefined` to do nothing.
|
|
36
31
|
* @default true
|
|
37
32
|
*/
|
|
38
|
-
initialFocus?: boolean | React.RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void);
|
|
33
|
+
initialFocus?: (boolean | React.RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | HTMLElement | null | void)) | undefined;
|
|
39
34
|
/**
|
|
40
35
|
* Determines the element to focus when the floating element is closed.
|
|
41
36
|
*
|
|
@@ -47,7 +42,7 @@ export interface FloatingFocusManagerProps {
|
|
|
47
42
|
* or `false`/`undefined` to do nothing.
|
|
48
43
|
* @default true
|
|
49
44
|
*/
|
|
50
|
-
returnFocus?: boolean | React.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void);
|
|
45
|
+
returnFocus?: (boolean | React.RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | HTMLElement | null | void)) | undefined;
|
|
51
46
|
/**
|
|
52
47
|
* Determines where focus should be restored if focus inside the floating element is lost
|
|
53
48
|
* (such as due to the removal of the currently focused element from the DOM).
|
|
@@ -58,14 +53,14 @@ export interface FloatingFocusManagerProps {
|
|
|
58
53
|
* - `false`: do not restore focus
|
|
59
54
|
* @default false
|
|
60
55
|
*/
|
|
61
|
-
restoreFocus?: boolean | 'popup';
|
|
56
|
+
restoreFocus?: (boolean | 'popup') | undefined;
|
|
62
57
|
/**
|
|
63
58
|
* Determines if focus is “modal”, meaning focus is fully trapped inside the
|
|
64
59
|
* floating element and outside content cannot be accessed. This includes
|
|
65
60
|
* screen reader virtual cursors.
|
|
66
61
|
* @default true
|
|
67
62
|
*/
|
|
68
|
-
modal?: boolean;
|
|
63
|
+
modal?: boolean | undefined;
|
|
69
64
|
/**
|
|
70
65
|
* Determines whether `focusout` event listeners that control whether the
|
|
71
66
|
* floating element should be closed if the focus moves outside of it are
|
|
@@ -73,29 +68,24 @@ export interface FloatingFocusManagerProps {
|
|
|
73
68
|
* focus management.
|
|
74
69
|
* @default true
|
|
75
70
|
*/
|
|
76
|
-
closeOnFocusOut?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Returns a list of elements that should be considered part of the
|
|
79
|
-
* floating element.
|
|
80
|
-
*/
|
|
81
|
-
getInsideElements?: () => Element[];
|
|
71
|
+
closeOnFocusOut?: boolean | undefined;
|
|
82
72
|
/**
|
|
83
73
|
* Overrides the element to focus when tabbing forward out of the floating element.
|
|
84
74
|
*/
|
|
85
|
-
nextFocusableElement?: HTMLElement | React.RefObject<HTMLElement | null> | null;
|
|
75
|
+
nextFocusableElement?: (HTMLElement | React.RefObject<HTMLElement | null> | null) | undefined;
|
|
86
76
|
/**
|
|
87
77
|
* Overrides the element to focus when tabbing backward out of the floating element.
|
|
88
78
|
*/
|
|
89
|
-
previousFocusableElement?: HTMLElement | React.RefObject<HTMLElement | null> | null;
|
|
79
|
+
previousFocusableElement?: (HTMLElement | React.RefObject<HTMLElement | null> | null) | undefined;
|
|
90
80
|
/**
|
|
91
81
|
* Ref to the focus guard preceding the floating element content.
|
|
92
82
|
* Can be useful to focus the popup progammatically.
|
|
93
83
|
*/
|
|
94
|
-
beforeContentFocusGuardRef?: React.RefObject<HTMLSpanElement | null
|
|
84
|
+
beforeContentFocusGuardRef?: React.RefObject<HTMLSpanElement | null> | undefined;
|
|
95
85
|
/**
|
|
96
86
|
* External FlatingTree to use when the one provided by context can't be used.
|
|
97
87
|
*/
|
|
98
|
-
externalTree?: FloatingTreeStore;
|
|
88
|
+
externalTree?: FloatingTreeStore | undefined;
|
|
99
89
|
}
|
|
100
90
|
/**
|
|
101
91
|
* Provides focus management for the floating element.
|
|
@@ -9,10 +9,11 @@ import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
|
9
9
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
10
10
|
import { visuallyHidden } from '@base-ui/utils/visuallyHidden';
|
|
11
11
|
import { useTimeout } from '@base-ui/utils/useTimeout';
|
|
12
|
+
import { isWebKit } from '@base-ui/utils/detectBrowser';
|
|
12
13
|
import { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';
|
|
13
|
-
import { ownerWindow } from '@base-ui/utils/owner';
|
|
14
|
+
import { ownerDocument, ownerWindow } from '@base-ui/utils/owner';
|
|
14
15
|
import { FocusGuard } from "../../utils/FocusGuard.js";
|
|
15
|
-
import { activeElement, contains,
|
|
16
|
+
import { activeElement, contains, getTarget, isTypeableCombobox, isVirtualClick, isVirtualPointerEvent, stopEvent, getNodeAncestors, getNodeChildren, getFloatingFocusElement, getTabbableOptions, isOutsideEvent, getNextTabbable, getPreviousTabbable, isTypeableElement } from "../utils.js";
|
|
16
17
|
import { createChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
17
18
|
import { REASONS } from "../../utils/reasons.js";
|
|
18
19
|
import { createAttribute } from "../utils/createAttribute.js";
|
|
@@ -48,12 +49,14 @@ function getEventType(event, lastInteractionType) {
|
|
|
48
49
|
const LIST_LIMIT = 20;
|
|
49
50
|
let previouslyFocusedElements = [];
|
|
50
51
|
function clearDisconnectedPreviouslyFocusedElements() {
|
|
51
|
-
previouslyFocusedElements = previouslyFocusedElements.filter(
|
|
52
|
+
previouslyFocusedElements = previouslyFocusedElements.filter(entry => {
|
|
53
|
+
return entry.deref()?.isConnected;
|
|
54
|
+
});
|
|
52
55
|
}
|
|
53
56
|
function addPreviouslyFocusedElement(element) {
|
|
54
57
|
clearDisconnectedPreviouslyFocusedElements();
|
|
55
58
|
if (element && getNodeName(element) !== 'body') {
|
|
56
|
-
previouslyFocusedElements.push(element);
|
|
59
|
+
previouslyFocusedElements.push(new WeakRef(element));
|
|
57
60
|
if (previouslyFocusedElements.length > LIST_LIMIT) {
|
|
58
61
|
previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);
|
|
59
62
|
}
|
|
@@ -61,7 +64,7 @@ function addPreviouslyFocusedElement(element) {
|
|
|
61
64
|
}
|
|
62
65
|
function getPreviouslyFocusedElement() {
|
|
63
66
|
clearDisconnectedPreviouslyFocusedElements();
|
|
64
|
-
return previouslyFocusedElements[previouslyFocusedElements.length - 1];
|
|
67
|
+
return previouslyFocusedElements[previouslyFocusedElements.length - 1]?.deref();
|
|
65
68
|
}
|
|
66
69
|
function getFirstTabbableElement(container) {
|
|
67
70
|
if (!container) {
|
|
@@ -112,14 +115,12 @@ export function FloatingFocusManager(props) {
|
|
|
112
115
|
context,
|
|
113
116
|
children,
|
|
114
117
|
disabled = false,
|
|
115
|
-
order = ['content'],
|
|
116
118
|
initialFocus = true,
|
|
117
119
|
returnFocus = true,
|
|
118
120
|
restoreFocus = false,
|
|
119
121
|
modal = true,
|
|
120
122
|
closeOnFocusOut = true,
|
|
121
123
|
openInteractionType = '',
|
|
122
|
-
getInsideElements: getInsideElementsProp = () => [],
|
|
123
124
|
nextFocusableElement,
|
|
124
125
|
previousFocusableElement,
|
|
125
126
|
beforeContentFocusGuardRef,
|
|
@@ -134,7 +135,6 @@ export function FloatingFocusManager(props) {
|
|
|
134
135
|
dataRef
|
|
135
136
|
} = store.context;
|
|
136
137
|
const getNodeId = useStableCallback(() => dataRef.current.floatingContext?.nodeId);
|
|
137
|
-
const getInsideElements = useStableCallback(getInsideElementsProp);
|
|
138
138
|
const ignoreInitialFocus = initialFocus === false;
|
|
139
139
|
// If the reference is a combobox and is typeable (e.g. input/textarea),
|
|
140
140
|
// there are different focus semantics. The guards should not be rendered, but
|
|
@@ -142,7 +142,7 @@ export function FloatingFocusManager(props) {
|
|
|
142
142
|
// hidden dismiss button should only appear at the end of the list, not the
|
|
143
143
|
// start.
|
|
144
144
|
const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;
|
|
145
|
-
const orderRef =
|
|
145
|
+
const orderRef = React.useRef(['content']);
|
|
146
146
|
const initialFocusRef = useValueAsRef(initialFocus);
|
|
147
147
|
const returnFocusRef = useValueAsRef(returnFocus);
|
|
148
148
|
const openInteractionTypeRef = useValueAsRef(openInteractionType);
|
|
@@ -172,54 +172,33 @@ export function FloatingFocusManager(props) {
|
|
|
172
172
|
const content = getTabbableContent(container);
|
|
173
173
|
return orderRef.current.map(() => content).filter(Boolean).flat();
|
|
174
174
|
});
|
|
175
|
+
|
|
176
|
+
// Prevent Tab from escaping the modal when there are no tabbable elements.
|
|
175
177
|
React.useEffect(() => {
|
|
176
|
-
if (disabled) {
|
|
177
|
-
return undefined;
|
|
178
|
-
}
|
|
179
|
-
if (!modal) {
|
|
178
|
+
if (disabled || !modal) {
|
|
180
179
|
return undefined;
|
|
181
180
|
}
|
|
182
181
|
function onKeyDown(event) {
|
|
183
182
|
if (event.key === 'Tab') {
|
|
184
183
|
// The focus guards have nothing to focus, so we need to stop the event.
|
|
185
|
-
if (contains(floatingFocusElement, activeElement(
|
|
184
|
+
if (contains(floatingFocusElement, activeElement(ownerDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
|
|
186
185
|
stopEvent(event);
|
|
187
186
|
}
|
|
188
187
|
}
|
|
189
188
|
}
|
|
190
|
-
const doc =
|
|
189
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
191
190
|
doc.addEventListener('keydown', onKeyDown);
|
|
192
191
|
return () => {
|
|
193
192
|
doc.removeEventListener('keydown', onKeyDown);
|
|
194
193
|
};
|
|
195
194
|
}, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]);
|
|
196
|
-
React.useEffect(() => {
|
|
197
|
-
if (disabled) {
|
|
198
|
-
return undefined;
|
|
199
|
-
}
|
|
200
|
-
if (!floating) {
|
|
201
|
-
return undefined;
|
|
202
|
-
}
|
|
203
|
-
function handleFocusIn(event) {
|
|
204
|
-
const target = getTarget(event);
|
|
205
|
-
const tabbableContent = getTabbableContent();
|
|
206
|
-
const tabbableIndex = tabbableContent.indexOf(target);
|
|
207
|
-
if (tabbableIndex !== -1) {
|
|
208
|
-
tabbableIndexRef.current = tabbableIndex;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
floating.addEventListener('focusin', handleFocusIn);
|
|
212
|
-
return () => {
|
|
213
|
-
floating.removeEventListener('focusin', handleFocusIn);
|
|
214
|
-
};
|
|
215
|
-
}, [disabled, floating, getTabbableContent]);
|
|
216
195
|
|
|
217
|
-
// Track
|
|
196
|
+
// Track pointer/keyboard interactions to disambiguate focus and outside presses.
|
|
218
197
|
React.useEffect(() => {
|
|
219
198
|
if (disabled || !open) {
|
|
220
199
|
return undefined;
|
|
221
200
|
}
|
|
222
|
-
const doc =
|
|
201
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
223
202
|
function clearPointerDownOutside() {
|
|
224
203
|
pointerDownOutsideRef.current = false;
|
|
225
204
|
}
|
|
@@ -228,6 +207,9 @@ export function FloatingFocusManager(props) {
|
|
|
228
207
|
const pointerTargetInside = contains(floating, target) || contains(domReference, target) || contains(portalContext?.portalNode, target);
|
|
229
208
|
pointerDownOutsideRef.current = !pointerTargetInside;
|
|
230
209
|
lastInteractionTypeRef.current = event.pointerType || 'keyboard';
|
|
210
|
+
if (target?.closest(`[${CLICK_TRIGGER_IDENTIFIER}]`)) {
|
|
211
|
+
isPointerDownRef.current = true;
|
|
212
|
+
}
|
|
231
213
|
}
|
|
232
214
|
function onKeyDown() {
|
|
233
215
|
lastInteractionTypeRef.current = 'keyboard';
|
|
@@ -243,13 +225,13 @@ export function FloatingFocusManager(props) {
|
|
|
243
225
|
doc.removeEventListener('keydown', onKeyDown, true);
|
|
244
226
|
};
|
|
245
227
|
}, [disabled, floating, domReference, floatingFocusElement, open, portalContext]);
|
|
228
|
+
|
|
229
|
+
// Close on focus out and restore focus within the floating tree when needed.
|
|
246
230
|
React.useEffect(() => {
|
|
247
|
-
if (disabled) {
|
|
248
|
-
return undefined;
|
|
249
|
-
}
|
|
250
|
-
if (!closeOnFocusOut) {
|
|
231
|
+
if (disabled || !closeOnFocusOut) {
|
|
251
232
|
return undefined;
|
|
252
233
|
}
|
|
234
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
253
235
|
|
|
254
236
|
// In Safari, buttons lose focus when pressing them.
|
|
255
237
|
function handlePointerDown() {
|
|
@@ -258,6 +240,14 @@ export function FloatingFocusManager(props) {
|
|
|
258
240
|
isPointerDownRef.current = false;
|
|
259
241
|
});
|
|
260
242
|
}
|
|
243
|
+
function handleFocusIn(event) {
|
|
244
|
+
const target = getTarget(event);
|
|
245
|
+
const tabbableContent = getTabbableContent();
|
|
246
|
+
const tabbableIndex = tabbableContent.indexOf(target);
|
|
247
|
+
if (tabbableIndex !== -1) {
|
|
248
|
+
tabbableIndexRef.current = tabbableIndex;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
261
251
|
function handleFocusOutside(event) {
|
|
262
252
|
const relatedTarget = event.relatedTarget;
|
|
263
253
|
const currentTarget = event.currentTarget;
|
|
@@ -273,7 +263,7 @@ export function FloatingFocusManager(props) {
|
|
|
273
263
|
|
|
274
264
|
// Restore focus to the previous tabbable element index to prevent
|
|
275
265
|
// focus from being lost outside the floating tree.
|
|
276
|
-
if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && activeElement(
|
|
266
|
+
if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && activeElement(doc) === doc.body) {
|
|
277
267
|
// Let `FloatingPortal` effect knows that focus is still inside the
|
|
278
268
|
// floating tree.
|
|
279
269
|
if (isHTMLElement(floatingFocusElement)) {
|
|
@@ -344,6 +334,7 @@ export function FloatingFocusManager(props) {
|
|
|
344
334
|
});
|
|
345
335
|
}
|
|
346
336
|
if (floating) {
|
|
337
|
+
floating.addEventListener('focusin', handleFocusIn);
|
|
347
338
|
floating.addEventListener('focusout', handleFocusOutside);
|
|
348
339
|
if (portalContext) {
|
|
349
340
|
floating.addEventListener('focusout', markInsideReactTree, true);
|
|
@@ -352,6 +343,7 @@ export function FloatingFocusManager(props) {
|
|
|
352
343
|
});
|
|
353
344
|
}
|
|
354
345
|
cleanups.push(() => {
|
|
346
|
+
floating.removeEventListener('focusin', handleFocusIn);
|
|
355
347
|
floating.removeEventListener('focusout', handleFocusOutside);
|
|
356
348
|
});
|
|
357
349
|
}
|
|
@@ -361,6 +353,8 @@ export function FloatingFocusManager(props) {
|
|
|
361
353
|
});
|
|
362
354
|
};
|
|
363
355
|
}, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement]);
|
|
356
|
+
|
|
357
|
+
// Hide everything outside the floating tree from assistive tech while open.
|
|
364
358
|
React.useEffect(() => {
|
|
365
359
|
if (disabled || !floating || !open) {
|
|
366
360
|
return undefined;
|
|
@@ -370,17 +364,16 @@ export function FloatingFocusManager(props) {
|
|
|
370
364
|
const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${createAttribute('portal')}]`) || []);
|
|
371
365
|
const ancestors = tree ? getNodeAncestors(tree.nodesRef.current, getNodeId()) : [];
|
|
372
366
|
const rootAncestorComboboxDomReference = ancestors.find(node => isTypeableCombobox(node.context?.elements.domReference || null))?.context?.elements.domReference;
|
|
373
|
-
const insideElements = [floating, rootAncestorComboboxDomReference, ...portalNodes,
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}, [open, disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, getInsideElements, nextFocusableElement, previousFocusableElement]);
|
|
367
|
+
const insideElements = [floating, rootAncestorComboboxDomReference, ...portalNodes, startDismissButtonRef.current, endDismissButtonRef.current, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, resolveRef(previousFocusableElement), resolveRef(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);
|
|
368
|
+
return markOthers(insideElements, modal || isUntrappedTypeableCombobox);
|
|
369
|
+
}, [open, disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, tree, getNodeId, nextFocusableElement, previousFocusableElement]);
|
|
370
|
+
|
|
371
|
+
// Focus the initial element when the floating element opens.
|
|
379
372
|
useIsoLayoutEffect(() => {
|
|
380
373
|
if (!open || disabled || !isHTMLElement(floatingFocusElement)) {
|
|
381
374
|
return;
|
|
382
375
|
}
|
|
383
|
-
const doc =
|
|
376
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
384
377
|
const previouslyFocusedElement = activeElement(doc);
|
|
385
378
|
|
|
386
379
|
// Wait for any layout effect state setters to execute to set `tabIndex`.
|
|
@@ -409,11 +402,13 @@ export function FloatingFocusManager(props) {
|
|
|
409
402
|
});
|
|
410
403
|
});
|
|
411
404
|
}, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef, openInteractionTypeRef]);
|
|
405
|
+
|
|
406
|
+
// Track return focus targets and restore focus on unmount/close.
|
|
412
407
|
useIsoLayoutEffect(() => {
|
|
413
408
|
if (disabled || !floatingFocusElement) {
|
|
414
409
|
return undefined;
|
|
415
410
|
}
|
|
416
|
-
const doc =
|
|
411
|
+
const doc = ownerDocument(floatingFocusElement);
|
|
417
412
|
const previouslyFocusedElement = activeElement(doc);
|
|
418
413
|
addPreviouslyFocusedElement(previouslyFocusedElement);
|
|
419
414
|
|
|
@@ -495,40 +490,30 @@ export function FloatingFocusManager(props) {
|
|
|
495
490
|
});
|
|
496
491
|
}
|
|
497
492
|
fallbackEl.remove();
|
|
493
|
+
preventReturnFocusRef.current = false;
|
|
498
494
|
});
|
|
499
495
|
};
|
|
500
496
|
}, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, events, tree, isInsidePortal, domReference, getNodeId]);
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
React.useEffect(() => {
|
|
509
|
-
if (disabled || !open) {
|
|
510
|
-
return undefined;
|
|
497
|
+
|
|
498
|
+
// Safari may randomly scroll to the bottom of the page if an input inside a popup has focus
|
|
499
|
+
// when the popup unmounts from the DOM.
|
|
500
|
+
// By blurring it before the popup unmounts, we can prevent this behavior.
|
|
501
|
+
useIsoLayoutEffect(() => {
|
|
502
|
+
if (!isWebKit || open || !floating) {
|
|
503
|
+
return;
|
|
511
504
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
isPointerDownRef.current = true;
|
|
516
|
-
}
|
|
505
|
+
const activeEl = activeElement(ownerDocument(floating));
|
|
506
|
+
if (!isHTMLElement(activeEl) || !isTypeableElement(activeEl)) {
|
|
507
|
+
return;
|
|
517
508
|
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
};
|
|
523
|
-
}, [disabled, open, floatingFocusElement]);
|
|
524
|
-
|
|
509
|
+
if (contains(floating, activeEl)) {
|
|
510
|
+
activeEl.blur();
|
|
511
|
+
}
|
|
512
|
+
}, [open, floating]);
|
|
525
513
|
// Synchronize the `context` & `modal` value to the FloatingPortal context.
|
|
526
514
|
// It will decide whether or not it needs to render its own guards.
|
|
527
515
|
useIsoLayoutEffect(() => {
|
|
528
|
-
if (disabled) {
|
|
529
|
-
return undefined;
|
|
530
|
-
}
|
|
531
|
-
if (!portalContext) {
|
|
516
|
+
if (disabled || !portalContext) {
|
|
532
517
|
return undefined;
|
|
533
518
|
}
|
|
534
519
|
portalContext.setFocusManagerState({
|
|
@@ -542,6 +527,8 @@ export function FloatingFocusManager(props) {
|
|
|
542
527
|
portalContext.setFocusManagerState(null);
|
|
543
528
|
};
|
|
544
529
|
}, [disabled, portalContext, modal, open, store, closeOnFocusOut, domReference]);
|
|
530
|
+
|
|
531
|
+
// Keep the floating element tabIndex in sync and clear stale focus records.
|
|
545
532
|
useIsoLayoutEffect(() => {
|
|
546
533
|
if (disabled || !floatingFocusElement) {
|
|
547
534
|
return undefined;
|
|
@@ -5,8 +5,8 @@ type FocusManagerState = null | {
|
|
|
5
5
|
modal: boolean;
|
|
6
6
|
open: boolean;
|
|
7
7
|
onOpenChange(open: boolean, data?: {
|
|
8
|
-
reason?: string;
|
|
9
|
-
event?: Event;
|
|
8
|
+
reason?: string | undefined;
|
|
9
|
+
event?: Event | undefined;
|
|
10
10
|
}): void;
|
|
11
11
|
domReference: Element | null;
|
|
12
12
|
closeOnFocusOut: boolean;
|
|
@@ -20,11 +20,10 @@ export declare const usePortalContext: () => {
|
|
|
20
20
|
afterOutsideRef: React.RefObject<HTMLSpanElement | null>;
|
|
21
21
|
} | null;
|
|
22
22
|
export interface UseFloatingPortalNodeProps {
|
|
23
|
-
ref?: React.Ref<HTMLDivElement
|
|
24
|
-
container?: HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null
|
|
25
|
-
componentProps?: useRenderElement.ComponentProps<any
|
|
26
|
-
elementProps?: React.HTMLAttributes<HTMLDivElement
|
|
27
|
-
elementState?: Record<string, unknown>;
|
|
23
|
+
ref?: React.Ref<HTMLDivElement> | undefined;
|
|
24
|
+
container?: (HTMLElement | ShadowRoot | null | React.RefObject<HTMLElement | ShadowRoot | null>) | undefined;
|
|
25
|
+
componentProps?: useRenderElement.ComponentProps<any> | undefined;
|
|
26
|
+
elementProps?: React.HTMLAttributes<HTMLDivElement> | undefined;
|
|
28
27
|
}
|
|
29
28
|
export interface UseFloatingPortalNodeResult {
|
|
30
29
|
portalNode: HTMLElement | null;
|
|
@@ -41,14 +40,14 @@ export declare function useFloatingPortalNode(props?: UseFloatingPortalNodeProps
|
|
|
41
40
|
* @internal
|
|
42
41
|
*/
|
|
43
42
|
export declare const FloatingPortal: React.ForwardRefExoticComponent<Omit<FloatingPortal.Props<any> & {
|
|
44
|
-
renderGuards?: boolean;
|
|
43
|
+
renderGuards?: boolean | undefined;
|
|
45
44
|
}, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
46
45
|
export declare namespace FloatingPortal {
|
|
47
46
|
interface Props<State> extends BaseUIComponentProps<'div', State> {
|
|
48
47
|
/**
|
|
49
48
|
* A parent element to render the portal element into.
|
|
50
49
|
*/
|
|
51
|
-
container?: UseFloatingPortalNodeProps['container'];
|
|
50
|
+
container?: UseFloatingPortalNodeProps['container'] | undefined;
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
export {};
|
|
@@ -23,8 +23,7 @@ export function useFloatingPortalNode(props = {}) {
|
|
|
23
23
|
ref,
|
|
24
24
|
container: containerProp,
|
|
25
25
|
componentProps = EMPTY_OBJECT,
|
|
26
|
-
elementProps
|
|
27
|
-
elementState
|
|
26
|
+
elementProps
|
|
28
27
|
} = props;
|
|
29
28
|
const uniqueId = useId();
|
|
30
29
|
const portalContext = usePortalContext();
|
|
@@ -72,7 +71,6 @@ export function useFloatingPortalNode(props = {}) {
|
|
|
72
71
|
}, [containerProp, parentPortalNode, uniqueId]);
|
|
73
72
|
const portalElement = useRenderElement('div', componentProps, {
|
|
74
73
|
ref: [ref, setPortalNodeRef],
|
|
75
|
-
state: elementState,
|
|
76
74
|
props: [{
|
|
77
75
|
id: uniqueId,
|
|
78
76
|
[attr]: ''
|
|
@@ -27,7 +27,7 @@ export interface FloatingNodeProps {
|
|
|
27
27
|
export declare function FloatingNode(props: FloatingNodeProps): React.JSX.Element;
|
|
28
28
|
export interface FloatingTreeProps {
|
|
29
29
|
children?: React.ReactNode;
|
|
30
|
-
externalTree?: FloatingTreeStore;
|
|
30
|
+
externalTree?: FloatingTreeStore | undefined;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Provides context for nested floating elements when they are not children of
|
|
@@ -1,40 +1,46 @@
|
|
|
1
1
|
import type { ElementProps, FloatingContext, FloatingRootContext } from "../types.js";
|
|
2
|
+
import { REASONS } from "../../utils/reasons.js";
|
|
2
3
|
export interface UseClickProps {
|
|
3
4
|
/**
|
|
4
5
|
* Whether the Hook is enabled, including all internal Effects and event
|
|
5
6
|
* handlers.
|
|
6
7
|
* @default true
|
|
7
8
|
*/
|
|
8
|
-
enabled?: boolean;
|
|
9
|
+
enabled?: boolean | undefined;
|
|
9
10
|
/**
|
|
10
11
|
* The type of event to use to determine a “click” with mouse input.
|
|
11
12
|
* Keyboard clicks work as normal.
|
|
12
13
|
* @default 'click'
|
|
13
14
|
*/
|
|
14
|
-
event?: 'click' | 'mousedown' | 'mousedown-only';
|
|
15
|
+
event?: ('click' | 'mousedown' | 'mousedown-only') | undefined;
|
|
15
16
|
/**
|
|
16
17
|
* Whether to toggle the open state with repeated clicks.
|
|
17
18
|
* @default true
|
|
18
19
|
*/
|
|
19
|
-
toggle?: boolean;
|
|
20
|
+
toggle?: boolean | undefined;
|
|
20
21
|
/**
|
|
21
22
|
* Whether to ignore the logic for mouse input (for example, if `useHover()`
|
|
22
23
|
* is also being used).
|
|
23
24
|
* @default false
|
|
24
25
|
*/
|
|
25
|
-
ignoreMouse?: boolean;
|
|
26
|
+
ignoreMouse?: boolean | undefined;
|
|
26
27
|
/**
|
|
27
28
|
* If already open from another event such as the `useHover()` Hook,
|
|
28
29
|
* determines whether to keep the floating element open when clicking the
|
|
29
30
|
* reference element for the first time.
|
|
30
31
|
* @default true
|
|
31
32
|
*/
|
|
32
|
-
stickIfOpen?: boolean;
|
|
33
|
+
stickIfOpen?: boolean | undefined;
|
|
33
34
|
/**
|
|
34
35
|
* Touch-only delay (ms) before opening. Useful to allow mobile viewport/keyboard to settle.
|
|
35
36
|
* @default 0
|
|
36
37
|
*/
|
|
37
|
-
touchOpenDelay?: number;
|
|
38
|
+
touchOpenDelay?: number | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The reason for the click.
|
|
41
|
+
* @default REASONS.triggerPress
|
|
42
|
+
*/
|
|
43
|
+
reason?: (typeof REASONS.triggerPress | typeof REASONS.inputPress) | undefined;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Opens or closes the floating element when clicking the reference element.
|
|
@@ -20,7 +20,8 @@ export function useClick(context, props = {}) {
|
|
|
20
20
|
toggle = true,
|
|
21
21
|
ignoreMouse = false,
|
|
22
22
|
stickIfOpen = true,
|
|
23
|
-
touchOpenDelay = 0
|
|
23
|
+
touchOpenDelay = 0,
|
|
24
|
+
reason = REASONS.triggerPress
|
|
24
25
|
} = props;
|
|
25
26
|
const pointerTypeRef = React.useRef(undefined);
|
|
26
27
|
const frame = useAnimationFrame();
|
|
@@ -47,7 +48,7 @@ export function useClick(context, props = {}) {
|
|
|
47
48
|
// Animations sometimes won't run on a typeable element if using a rAF.
|
|
48
49
|
// Focus is always set on these elements. For touch, we may delay opening.
|
|
49
50
|
if (isTypeableElement(nativeEvent.target)) {
|
|
50
|
-
const details = createChangeEventDetails(
|
|
51
|
+
const details = createChangeEventDetails(reason, nativeEvent, nativeEvent.target);
|
|
51
52
|
if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
|
|
52
53
|
touchOpenTimeout.start(touchOpenDelay, () => {
|
|
53
54
|
store.setOpen(true, details);
|
|
@@ -65,7 +66,7 @@ export function useClick(context, props = {}) {
|
|
|
65
66
|
// Wait until focus is set on the element. This is an alternative to
|
|
66
67
|
// `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.
|
|
67
68
|
frame.request(() => {
|
|
68
|
-
const details = createChangeEventDetails(
|
|
69
|
+
const details = createChangeEventDetails(reason, nativeEvent, eventCurrentTarget);
|
|
69
70
|
if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
|
|
70
71
|
touchOpenTimeout.start(touchOpenDelay, () => {
|
|
71
72
|
store.setOpen(true, details);
|
|
@@ -91,7 +92,7 @@ export function useClick(context, props = {}) {
|
|
|
91
92
|
const openEvent = dataRef.current.openEvent;
|
|
92
93
|
const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== event.currentTarget;
|
|
93
94
|
const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? isClickLikeEvent(openEvent) : true));
|
|
94
|
-
const details = createChangeEventDetails(
|
|
95
|
+
const details = createChangeEventDetails(reason, event.nativeEvent, event.currentTarget);
|
|
95
96
|
if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
|
|
96
97
|
touchOpenTimeout.start(touchOpenDelay, () => {
|
|
97
98
|
store.setOpen(true, details);
|
|
@@ -103,7 +104,7 @@ export function useClick(context, props = {}) {
|
|
|
103
104
|
onKeyDown() {
|
|
104
105
|
pointerTypeRef.current = undefined;
|
|
105
106
|
}
|
|
106
|
-
}), [dataRef, eventOption, ignoreMouse, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay]);
|
|
107
|
+
}), [dataRef, eventOption, ignoreMouse, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay, reason]);
|
|
107
108
|
return React.useMemo(() => enabled ? {
|
|
108
109
|
reference
|
|
109
110
|
} : EMPTY_OBJECT, [enabled, reference]);
|
|
@@ -5,24 +5,14 @@ export interface UseClientPointProps {
|
|
|
5
5
|
* handlers.
|
|
6
6
|
* @default true
|
|
7
7
|
*/
|
|
8
|
-
enabled?: boolean;
|
|
8
|
+
enabled?: boolean | undefined;
|
|
9
9
|
/**
|
|
10
10
|
* Whether to restrict the client point to an axis and use the reference
|
|
11
11
|
* element (if it exists) as the other axis. This can be useful if the
|
|
12
12
|
* floating element is also interactive.
|
|
13
13
|
* @default 'both'
|
|
14
14
|
*/
|
|
15
|
-
axis?: 'x' | 'y' | 'both';
|
|
16
|
-
/**
|
|
17
|
-
* An explicitly defined `x` client coordinate.
|
|
18
|
-
* @default null
|
|
19
|
-
*/
|
|
20
|
-
x?: number | null;
|
|
21
|
-
/**
|
|
22
|
-
* An explicitly defined `y` client coordinate.
|
|
23
|
-
* @default null
|
|
24
|
-
*/
|
|
25
|
-
y?: number | null;
|
|
15
|
+
axis?: ('x' | 'y' | 'both') | undefined;
|
|
26
16
|
}
|
|
27
17
|
/**
|
|
28
18
|
* Positions the floating element relative to a client point (in the viewport),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { getWindow } from '@floating-ui/utils/dom';
|
|
3
5
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
4
|
-
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
5
6
|
import { contains, getTarget, isMouseLikePointerType } from "../utils.js";
|
|
6
7
|
function createVirtualElement(domElement, data) {
|
|
7
8
|
let offsetX = null;
|
|
@@ -72,9 +73,7 @@ export function useClientPoint(context, props = {}) {
|
|
|
72
73
|
const dataRef = store.context.dataRef;
|
|
73
74
|
const {
|
|
74
75
|
enabled = true,
|
|
75
|
-
axis = 'both'
|
|
76
|
-
x = null,
|
|
77
|
-
y = null
|
|
76
|
+
axis = 'both'
|
|
78
77
|
} = props;
|
|
79
78
|
const initialRef = React.useRef(false);
|
|
80
79
|
const cleanupListenerRef = React.useRef(null);
|
|
@@ -100,9 +99,6 @@ export function useClientPoint(context, props = {}) {
|
|
|
100
99
|
}));
|
|
101
100
|
});
|
|
102
101
|
const handleReferenceEnterOrMove = useStableCallback(event => {
|
|
103
|
-
if (x != null || y != null) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
102
|
if (!open) {
|
|
107
103
|
setReference(event.clientX, event.clientY, event.currentTarget);
|
|
108
104
|
} else if (!cleanupListenerRef.current) {
|
|
@@ -119,8 +115,7 @@ export function useClientPoint(context, props = {}) {
|
|
|
119
115
|
// the dismissal touch point.
|
|
120
116
|
const openCheck = isMouseLikePointerType(pointerType) ? floating : open;
|
|
121
117
|
const addListener = React.useCallback(() => {
|
|
122
|
-
|
|
123
|
-
if (!openCheck || !enabled || x != null || y != null) {
|
|
118
|
+
if (!openCheck || !enabled) {
|
|
124
119
|
return undefined;
|
|
125
120
|
}
|
|
126
121
|
const win = getWindow(floating);
|
|
@@ -144,7 +139,7 @@ export function useClientPoint(context, props = {}) {
|
|
|
144
139
|
}
|
|
145
140
|
store.set('positionReference', domReference);
|
|
146
141
|
return undefined;
|
|
147
|
-
}, [openCheck, enabled,
|
|
142
|
+
}, [openCheck, enabled, floating, dataRef, domReference, store, setReference]);
|
|
148
143
|
React.useEffect(() => {
|
|
149
144
|
return addListener();
|
|
150
145
|
}, [addListener, reactive]);
|
|
@@ -158,12 +153,6 @@ export function useClientPoint(context, props = {}) {
|
|
|
158
153
|
initialRef.current = true;
|
|
159
154
|
}
|
|
160
155
|
}, [enabled, open]);
|
|
161
|
-
useIsoLayoutEffect(() => {
|
|
162
|
-
if (enabled && (x != null || y != null)) {
|
|
163
|
-
initialRef.current = false;
|
|
164
|
-
setReference(x, y);
|
|
165
|
-
}
|
|
166
|
-
}, [enabled, x, y, setReference]);
|
|
167
156
|
const reference = React.useMemo(() => {
|
|
168
157
|
function setPointerTypeRef(event) {
|
|
169
158
|
setPointerType(event.pointerType);
|