@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
|
@@ -2,8 +2,8 @@ import { FloatingTreeStore } from "../components/FloatingTreeStore.js";
|
|
|
2
2
|
import type { ElementProps, FloatingContext, FloatingRootContext } from "../types.js";
|
|
3
3
|
type PressType = 'intentional' | 'sloppy';
|
|
4
4
|
export declare function normalizeProp(normalizable?: boolean | {
|
|
5
|
-
escapeKey?: boolean;
|
|
6
|
-
outsidePress?: boolean;
|
|
5
|
+
escapeKey?: boolean | undefined;
|
|
6
|
+
outsidePress?: boolean | undefined;
|
|
7
7
|
}): {
|
|
8
8
|
escapeKey: boolean;
|
|
9
9
|
outsidePress: boolean;
|
|
@@ -14,26 +14,26 @@ export interface UseDismissProps {
|
|
|
14
14
|
* handlers.
|
|
15
15
|
* @default true
|
|
16
16
|
*/
|
|
17
|
-
enabled?: boolean;
|
|
17
|
+
enabled?: boolean | undefined;
|
|
18
18
|
/**
|
|
19
19
|
* Whether to dismiss the floating element upon pressing the `esc` key.
|
|
20
20
|
* @default true
|
|
21
21
|
*/
|
|
22
|
-
escapeKey?: boolean;
|
|
22
|
+
escapeKey?: boolean | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Whether to dismiss the floating element upon pressing the reference
|
|
25
25
|
* element. You likely want to ensure the `move` option in the `useHover()`
|
|
26
26
|
* Hook has been disabled when this is in use.
|
|
27
27
|
* @default false
|
|
28
28
|
*/
|
|
29
|
-
referencePress?: boolean;
|
|
29
|
+
referencePress?: boolean | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* The type of event to use to determine a "press".
|
|
32
32
|
* - `down` is `pointerdown` on mouse input, but special iOS-like touch handling on touch input.
|
|
33
33
|
* - `up` is lazy on both mouse + touch input (equivalent to `click`).
|
|
34
34
|
* @default 'down'
|
|
35
35
|
*/
|
|
36
|
-
referencePressEvent?: PressType;
|
|
36
|
+
referencePressEvent?: PressType | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* Whether to dismiss the floating element upon pressing outside of the
|
|
39
39
|
* floating element.
|
|
@@ -47,37 +47,37 @@ export interface UseDismissProps {
|
|
|
47
47
|
* ```
|
|
48
48
|
* @default true
|
|
49
49
|
*/
|
|
50
|
-
outsidePress?: boolean | ((event: MouseEvent | TouchEvent) => boolean);
|
|
50
|
+
outsidePress?: (boolean | ((event: MouseEvent | TouchEvent) => boolean)) | undefined;
|
|
51
51
|
/**
|
|
52
52
|
* The type of event to use to determine an outside "press".
|
|
53
53
|
* - `intentional` requires the user to click outside intentionally, firing on `pointerup` for mouse, and requiring minimal `touchmove`s for touch.
|
|
54
54
|
* - `sloppy` fires on `pointerdown` for mouse, while for touch it fires on `touchend` (within 1 second) or while scrolling away after `touchstart`.
|
|
55
55
|
*/
|
|
56
|
-
outsidePressEvent?: PressType | {
|
|
56
|
+
outsidePressEvent?: (PressType | {
|
|
57
57
|
mouse: PressType;
|
|
58
58
|
touch: PressType;
|
|
59
59
|
} | (() => PressType | {
|
|
60
60
|
mouse: PressType;
|
|
61
61
|
touch: PressType;
|
|
62
|
-
});
|
|
62
|
+
})) | undefined;
|
|
63
63
|
/**
|
|
64
64
|
* Whether to dismiss the floating element upon scrolling an overflow
|
|
65
65
|
* ancestor.
|
|
66
66
|
* @default false
|
|
67
67
|
*/
|
|
68
|
-
ancestorScroll?: boolean;
|
|
68
|
+
ancestorScroll?: boolean | undefined;
|
|
69
69
|
/**
|
|
70
70
|
* Determines whether event listeners bubble upwards through a tree of
|
|
71
71
|
* floating elements.
|
|
72
72
|
*/
|
|
73
|
-
bubbles?: boolean | {
|
|
74
|
-
escapeKey?: boolean;
|
|
75
|
-
outsidePress?: boolean;
|
|
76
|
-
};
|
|
73
|
+
bubbles?: (boolean | {
|
|
74
|
+
escapeKey?: boolean | undefined;
|
|
75
|
+
outsidePress?: boolean | undefined;
|
|
76
|
+
}) | undefined;
|
|
77
77
|
/**
|
|
78
78
|
* External FlatingTree to use when the one provided by context can't be used.
|
|
79
79
|
*/
|
|
80
|
-
externalTree?: FloatingTreeStore;
|
|
80
|
+
externalTree?: FloatingTreeStore | undefined;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* Closes the floating element when a dismissal is requested — by default, when
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { getOverflowAncestors } from '@floating-ui/react-dom';
|
|
3
5
|
import { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isWebKit } from '@floating-ui/utils/dom';
|
|
4
6
|
import { Timeout, useTimeout } from '@base-ui/utils/useTimeout';
|
|
5
7
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
6
|
-
import {
|
|
8
|
+
import { ownerDocument } from '@base-ui/utils/owner';
|
|
9
|
+
import { contains, getTarget, isEventTargetWithin, isReactEvent, isRootElement, getNodeChildren } from "../utils.js";
|
|
7
10
|
|
|
8
11
|
/* eslint-disable no-underscore-dangle */
|
|
9
12
|
|
|
@@ -133,7 +136,7 @@ export function useDismiss(context, props = {}) {
|
|
|
133
136
|
}
|
|
134
137
|
const target = getTarget(event);
|
|
135
138
|
const inertSelector = `[${createAttribute('inert')}]`;
|
|
136
|
-
const markers =
|
|
139
|
+
const markers = ownerDocument(store.select('floatingElement')).querySelectorAll(inertSelector);
|
|
137
140
|
const triggers = store.context.triggerElements;
|
|
138
141
|
|
|
139
142
|
// If another trigger is clicked, don't close the floating element.
|
|
@@ -331,7 +334,7 @@ export function useDismiss(context, props = {}) {
|
|
|
331
334
|
isComposingRef.current = false;
|
|
332
335
|
});
|
|
333
336
|
}
|
|
334
|
-
const doc =
|
|
337
|
+
const doc = ownerDocument(floatingElement);
|
|
335
338
|
doc.addEventListener('pointerdown', trackPointerType, true);
|
|
336
339
|
if (escapeKey) {
|
|
337
340
|
doc.addEventListener('keydown', closeOnEscapeKeyDown);
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import type { ReferenceType } from "../types.js";
|
|
2
2
|
import type { BaseUIChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
3
3
|
import { FloatingRootStore } from "../components/FloatingRootStore.js";
|
|
4
|
-
import { PopupTriggerMap } from "../../utils/popups/index.js";
|
|
5
4
|
export interface UseFloatingRootContextOptions {
|
|
6
|
-
open?: boolean;
|
|
5
|
+
open?: boolean | undefined;
|
|
7
6
|
onOpenChange?(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
|
|
8
7
|
elements?: {
|
|
9
|
-
reference?: ReferenceType | null;
|
|
10
|
-
floating?: HTMLElement | null;
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Whether to prevent the auto-emitted `openchange` event.
|
|
15
|
-
*/
|
|
16
|
-
noEmit?: boolean;
|
|
8
|
+
reference?: (ReferenceType | null) | undefined;
|
|
9
|
+
floating?: (HTMLElement | null) | undefined;
|
|
10
|
+
} | undefined;
|
|
17
11
|
}
|
|
18
12
|
export declare function useFloatingRootContext(options: UseFloatingRootContextOptions): FloatingRootStore;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { isElement } from '@floating-ui/utils/dom';
|
|
2
4
|
import { useId } from '@base-ui/utils/useId';
|
|
3
5
|
import { useRefWithInit } from '@base-ui/utils/useRefWithInit';
|
|
@@ -24,10 +26,10 @@ export function useFloatingRootContext(options) {
|
|
|
24
26
|
onOpenChange,
|
|
25
27
|
referenceElement: elements.reference ?? null,
|
|
26
28
|
floatingElement: elements.floating ?? null,
|
|
27
|
-
triggerElements:
|
|
29
|
+
triggerElements: new PopupTriggerMap(),
|
|
28
30
|
floatingId,
|
|
29
31
|
nested,
|
|
30
|
-
noEmit:
|
|
32
|
+
noEmit: false
|
|
31
33
|
})).current;
|
|
32
34
|
useIsoLayoutEffect(() => {
|
|
33
35
|
const valuesToSync = {
|
|
@@ -47,6 +49,6 @@ export function useFloatingRootContext(options) {
|
|
|
47
49
|
}, [open, floatingId, elements.reference, elements.floating, store]);
|
|
48
50
|
store.context.onOpenChange = onOpenChange;
|
|
49
51
|
store.context.nested = nested;
|
|
50
|
-
store.context.noEmit =
|
|
52
|
+
store.context.noEmit = false;
|
|
51
53
|
return store;
|
|
52
54
|
}
|
|
@@ -5,18 +5,12 @@ export interface UseFocusProps {
|
|
|
5
5
|
* handlers.
|
|
6
6
|
* @default true
|
|
7
7
|
*/
|
|
8
|
-
enabled?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the open state only changes if the focus event is considered
|
|
11
|
-
* visible (`:focus-visible` CSS selector).
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
visibleOnly?: boolean;
|
|
8
|
+
enabled?: boolean | undefined;
|
|
15
9
|
/**
|
|
16
10
|
* Waits for the specified time before opening.
|
|
17
11
|
* @default undefined
|
|
18
12
|
*/
|
|
19
|
-
delay?: number | (() => number | undefined);
|
|
13
|
+
delay?: (number | (() => number | undefined)) | undefined;
|
|
20
14
|
}
|
|
21
15
|
/**
|
|
22
16
|
* Opens the floating element while the reference element has focus, like CSS
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { getWindow, isElement, isHTMLElement } from '@floating-ui/utils/dom';
|
|
3
5
|
import { isMac, isSafari } from '@base-ui/utils/detectBrowser';
|
|
4
6
|
import { useTimeout } from '@base-ui/utils/useTimeout';
|
|
5
|
-
import {
|
|
7
|
+
import { ownerDocument } from '@base-ui/utils/owner';
|
|
8
|
+
import { activeElement, contains, getTarget, isTargetInsideEnabledTrigger, isTypeableElement, matchesFocusVisible } from "../utils.js";
|
|
6
9
|
import { createChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
7
10
|
import { REASONS } from "../../utils/reasons.js";
|
|
8
11
|
import { createAttribute } from "../utils/createAttribute.js";
|
|
@@ -20,7 +23,6 @@ export function useFocus(context, props = {}) {
|
|
|
20
23
|
} = store.context;
|
|
21
24
|
const {
|
|
22
25
|
enabled = true,
|
|
23
|
-
visibleOnly = true,
|
|
24
26
|
delay
|
|
25
27
|
} = props;
|
|
26
28
|
const blockFocusRef = React.useRef(false);
|
|
@@ -40,7 +42,7 @@ export function useFocus(context, props = {}) {
|
|
|
40
42
|
// return to the tab/window.
|
|
41
43
|
function onBlur() {
|
|
42
44
|
const currentDomReference = store.select('domReferenceElement');
|
|
43
|
-
if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(
|
|
45
|
+
if (!store.select('open') && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
|
|
44
46
|
blockFocusRef.current = true;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
@@ -96,7 +98,7 @@ export function useFocus(context, props = {}) {
|
|
|
96
98
|
blockedReferenceRef.current = null;
|
|
97
99
|
}
|
|
98
100
|
const target = getTarget(event.nativeEvent);
|
|
99
|
-
if (
|
|
101
|
+
if (isElement(target)) {
|
|
100
102
|
// Safari fails to match `:focus-visible` if focus was initially
|
|
101
103
|
// outside the document.
|
|
102
104
|
if (isMacSafari && !event.relatedTarget) {
|
|
@@ -107,13 +109,13 @@ export function useFocus(context, props = {}) {
|
|
|
107
109
|
return;
|
|
108
110
|
}
|
|
109
111
|
}
|
|
110
|
-
const
|
|
112
|
+
const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
|
|
111
113
|
const {
|
|
112
114
|
nativeEvent,
|
|
113
115
|
currentTarget
|
|
114
116
|
} = event;
|
|
115
117
|
const delayValue = typeof delay === 'function' ? delay() : delay;
|
|
116
|
-
if (store.select('open') &&
|
|
118
|
+
if (store.select('open') && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === undefined) {
|
|
117
119
|
store.setOpen(true, createChangeEventDetails(REASONS.triggerFocus, nativeEvent, currentTarget));
|
|
118
120
|
return;
|
|
119
121
|
}
|
|
@@ -159,16 +161,13 @@ export function useFocus(context, props = {}) {
|
|
|
159
161
|
// the floating element. The focus handler of that trigger will
|
|
160
162
|
// handle the open state.
|
|
161
163
|
const nextFocusedElement = relatedTarget ?? activeEl;
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
if (triggerElements.hasElement(nextFocusedElement) || triggerElements.hasMatchingElement(trigger => contains(trigger, nextFocusedElement))) {
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
164
|
+
if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {
|
|
165
|
+
return;
|
|
167
166
|
}
|
|
168
167
|
store.setOpen(false, createChangeEventDetails(REASONS.triggerFocus, nativeEvent));
|
|
169
168
|
});
|
|
170
169
|
}
|
|
171
|
-
}), [dataRef, store,
|
|
170
|
+
}), [dataRef, store, timeout, delay]);
|
|
172
171
|
return React.useMemo(() => enabled ? {
|
|
173
172
|
reference,
|
|
174
173
|
trigger: reference
|
|
@@ -1,62 +1,39 @@
|
|
|
1
|
-
import { FloatingTreeStore } from "../components/FloatingTreeStore.js";
|
|
2
1
|
import type { Delay, ElementProps, FloatingContext, FloatingRootContext, FloatingTreeType, SafePolygonOptions } from "../types.js";
|
|
3
2
|
export interface HandleCloseContext extends FloatingContext {
|
|
4
3
|
onClose: () => void;
|
|
5
|
-
tree?: FloatingTreeType | null;
|
|
6
|
-
leave?: boolean;
|
|
4
|
+
tree?: (FloatingTreeType | null) | undefined;
|
|
5
|
+
leave?: boolean | undefined;
|
|
7
6
|
}
|
|
8
7
|
export interface HandleClose {
|
|
9
8
|
(context: HandleCloseContext): (event: MouseEvent) => void;
|
|
10
|
-
__options?: SafePolygonOptions;
|
|
9
|
+
__options?: SafePolygonOptions | undefined;
|
|
11
10
|
}
|
|
12
11
|
export declare function getDelay(value: UseHoverProps['delay'], prop: 'open' | 'close', pointerType?: PointerEvent['pointerType']): number | undefined;
|
|
13
12
|
export interface UseHoverProps {
|
|
14
|
-
/**
|
|
15
|
-
* Whether the Hook is enabled, including all internal Effects and event
|
|
16
|
-
* handlers.
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
enabled?: boolean;
|
|
20
13
|
/**
|
|
21
14
|
* Accepts an event handler that runs on `mousemove` to control when the
|
|
22
15
|
* floating element closes once the cursor leaves the reference element.
|
|
23
16
|
* @default null
|
|
24
17
|
*/
|
|
25
|
-
handleClose?: HandleClose | null;
|
|
18
|
+
handleClose?: (HandleClose | null) | undefined;
|
|
26
19
|
/**
|
|
27
20
|
* Waits until the user’s cursor is at “rest” over the reference element
|
|
28
21
|
* before changing the `open` state.
|
|
29
22
|
* @default 0
|
|
30
23
|
*/
|
|
31
|
-
restMs?: number | (() => number);
|
|
24
|
+
restMs?: (number | (() => number)) | undefined;
|
|
32
25
|
/**
|
|
33
26
|
* Waits for the specified time when the event listener runs before changing
|
|
34
27
|
* the `open` state.
|
|
35
28
|
* @default 0
|
|
36
29
|
*/
|
|
37
|
-
delay?: Delay | (() => Delay);
|
|
38
|
-
/**
|
|
39
|
-
* Whether the logic only runs for mouse input, ignoring touch input.
|
|
40
|
-
* Note: due to a bug with Linux Chrome, "pen" inputs are considered "mouse".
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
mouseOnly?: boolean;
|
|
30
|
+
delay?: (Delay | (() => Delay)) | undefined;
|
|
44
31
|
/**
|
|
45
32
|
* Whether moving the cursor over the floating element will open it, without a
|
|
46
33
|
* regular hover event required.
|
|
47
34
|
* @default true
|
|
48
35
|
*/
|
|
49
|
-
move?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Allows to override the element that will trigger the popup.
|
|
52
|
-
* When it's set, useHover won't read the reference element from the root context.
|
|
53
|
-
* This allows to have multiple triggers per floating element (assuming `useHover` is called per trigger).
|
|
54
|
-
*/
|
|
55
|
-
triggerElement?: HTMLElement | null;
|
|
56
|
-
/**
|
|
57
|
-
* External FlatingTree to use when the one provided by context can't be used.
|
|
58
|
-
*/
|
|
59
|
-
externalTree?: FloatingTreeStore;
|
|
36
|
+
move?: boolean | undefined;
|
|
60
37
|
}
|
|
61
38
|
/**
|
|
62
39
|
* Opens the floating element while hovering over the reference element, like
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import * as React from 'react';
|
|
2
4
|
import { isElement } from '@floating-ui/utils/dom';
|
|
3
5
|
import { useTimeout } from '@base-ui/utils/useTimeout';
|
|
4
6
|
import { useValueAsRef } from '@base-ui/utils/useValueAsRef';
|
|
5
7
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
6
8
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
7
|
-
import {
|
|
9
|
+
import { ownerDocument } from '@base-ui/utils/owner';
|
|
10
|
+
import { contains, getTarget, isMouseLikePointerType } from "../utils.js";
|
|
8
11
|
import { useFloatingParentNodeId, useFloatingTree } from "../components/FloatingTree.js";
|
|
9
12
|
import { createChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
10
13
|
import { REASONS } from "../../utils/reasons.js";
|
|
@@ -52,16 +55,12 @@ export function useHover(context, props = {}) {
|
|
|
52
55
|
events
|
|
53
56
|
} = store.context;
|
|
54
57
|
const {
|
|
55
|
-
enabled = true,
|
|
56
58
|
delay = 0,
|
|
57
59
|
handleClose = null,
|
|
58
|
-
mouseOnly = false,
|
|
59
60
|
restMs = 0,
|
|
60
|
-
move = true
|
|
61
|
-
triggerElement = null,
|
|
62
|
-
externalTree
|
|
61
|
+
move = true
|
|
63
62
|
} = props;
|
|
64
|
-
const tree = useFloatingTree(
|
|
63
|
+
const tree = useFloatingTree();
|
|
65
64
|
const parentId = useFloatingParentNodeId();
|
|
66
65
|
const handleCloseRef = useValueAsRef(handleClose);
|
|
67
66
|
const delayRef = useValueAsRef(delay);
|
|
@@ -89,9 +88,6 @@ export function useHover(context, props = {}) {
|
|
|
89
88
|
// When closing before opening, clear the delay timeouts to cancel it
|
|
90
89
|
// from showing.
|
|
91
90
|
React.useEffect(() => {
|
|
92
|
-
if (!enabled) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
91
|
function onOpenChangeLocal(details) {
|
|
96
92
|
if (!details.open) {
|
|
97
93
|
timeout.clear();
|
|
@@ -104,11 +100,8 @@ export function useHover(context, props = {}) {
|
|
|
104
100
|
return () => {
|
|
105
101
|
events.off('openchange', onOpenChangeLocal);
|
|
106
102
|
};
|
|
107
|
-
}, [
|
|
103
|
+
}, [events, timeout, restTimeout]);
|
|
108
104
|
React.useEffect(() => {
|
|
109
|
-
if (!enabled) {
|
|
110
|
-
return undefined;
|
|
111
|
-
}
|
|
112
105
|
if (!handleCloseRef.current) {
|
|
113
106
|
return undefined;
|
|
114
107
|
}
|
|
@@ -123,12 +116,12 @@ export function useHover(context, props = {}) {
|
|
|
123
116
|
store.setOpen(false, createChangeEventDetails(REASONS.triggerHover, event, event.currentTarget ?? undefined));
|
|
124
117
|
}
|
|
125
118
|
}
|
|
126
|
-
const html =
|
|
119
|
+
const html = ownerDocument(floatingElement).documentElement;
|
|
127
120
|
html.addEventListener('mouseleave', onLeave);
|
|
128
121
|
return () => {
|
|
129
122
|
html.removeEventListener('mouseleave', onLeave);
|
|
130
123
|
};
|
|
131
|
-
}, [floatingElement, open, store,
|
|
124
|
+
}, [floatingElement, open, store, handleCloseRef, isHoverOpen, isClickLikeOpenEvent]);
|
|
132
125
|
const closeWithDelay = React.useCallback((event, runElseBranch = true) => {
|
|
133
126
|
const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);
|
|
134
127
|
if (closeDelay && !handlerRef.current) {
|
|
@@ -144,7 +137,7 @@ export function useHover(context, props = {}) {
|
|
|
144
137
|
});
|
|
145
138
|
const clearPointerEvents = useStableCallback(() => {
|
|
146
139
|
if (performedPointerEventsMutationRef.current) {
|
|
147
|
-
const body =
|
|
140
|
+
const body = ownerDocument(floatingElement).body;
|
|
148
141
|
body.style.pointerEvents = '';
|
|
149
142
|
body.removeAttribute(safePolygonIdentifier);
|
|
150
143
|
performedPointerEventsMutationRef.current = false;
|
|
@@ -163,13 +156,10 @@ export function useHover(context, props = {}) {
|
|
|
163
156
|
// delegation system. If the cursor was on a disabled element and then entered
|
|
164
157
|
// the reference (no gap), `mouseenter` doesn't fire in the delegation system.
|
|
165
158
|
React.useEffect(() => {
|
|
166
|
-
if (!enabled) {
|
|
167
|
-
return undefined;
|
|
168
|
-
}
|
|
169
159
|
function onReferenceMouseEnter(event) {
|
|
170
160
|
timeout.clear();
|
|
171
161
|
blockMouseMoveRef.current = false;
|
|
172
|
-
if (
|
|
162
|
+
if (getRestMs(restMsRef.current) > 0 && !getDelay(delayRef.current, 'open')) {
|
|
173
163
|
return;
|
|
174
164
|
}
|
|
175
165
|
const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);
|
|
@@ -192,7 +182,7 @@ export function useHover(context, props = {}) {
|
|
|
192
182
|
return;
|
|
193
183
|
}
|
|
194
184
|
unbindMouseMoveRef.current();
|
|
195
|
-
const doc =
|
|
185
|
+
const doc = ownerDocument(floatingElement);
|
|
196
186
|
restTimeout.clear();
|
|
197
187
|
restTimeoutPendingRef.current = false;
|
|
198
188
|
const triggers = store.context.triggerElements;
|
|
@@ -272,7 +262,7 @@ export function useHover(context, props = {}) {
|
|
|
272
262
|
closeWithDelay(event, false);
|
|
273
263
|
}
|
|
274
264
|
}
|
|
275
|
-
const trigger =
|
|
265
|
+
const trigger = domReferenceElement;
|
|
276
266
|
if (isElement(trigger)) {
|
|
277
267
|
const floating = floatingElement;
|
|
278
268
|
if (open) {
|
|
@@ -309,23 +299,19 @@ export function useHover(context, props = {}) {
|
|
|
309
299
|
};
|
|
310
300
|
}
|
|
311
301
|
return undefined;
|
|
312
|
-
}, [
|
|
302
|
+
}, [move, domReferenceElement, floatingElement, store, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, open, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent, restMsRef, timeout, restTimeout, handleInteractInside]);
|
|
313
303
|
|
|
314
304
|
// Block pointer-events of every element other than the reference and floating
|
|
315
305
|
// while the floating element is open and has a `handleClose` handler. Also
|
|
316
306
|
// handles nested floating elements.
|
|
317
307
|
// https://github.com/floating-ui/floating-ui/issues/1722
|
|
318
308
|
useIsoLayoutEffect(() => {
|
|
319
|
-
if (!enabled) {
|
|
320
|
-
return undefined;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
309
|
// eslint-disable-next-line no-underscore-dangle
|
|
324
310
|
if (open && handleCloseRef.current?.__options?.blockPointerEvents && isHoverOpen()) {
|
|
325
311
|
performedPointerEventsMutationRef.current = true;
|
|
326
312
|
const floatingEl = floatingElement;
|
|
327
313
|
if (isElement(domReferenceElement) && floatingEl) {
|
|
328
|
-
const body =
|
|
314
|
+
const body = ownerDocument(floatingElement).body;
|
|
329
315
|
body.setAttribute(safePolygonIdentifier, '');
|
|
330
316
|
const ref = domReferenceElement;
|
|
331
317
|
const parentFloating = tree?.nodesRef.current.find(node => node.id === parentId)?.context?.elements.floating;
|
|
@@ -343,7 +329,7 @@ export function useHover(context, props = {}) {
|
|
|
343
329
|
}
|
|
344
330
|
}
|
|
345
331
|
return undefined;
|
|
346
|
-
}, [
|
|
332
|
+
}, [open, parentId, tree, handleCloseRef, isHoverOpen, domReferenceElement, floatingElement]);
|
|
347
333
|
useIsoLayoutEffect(() => {
|
|
348
334
|
if (!open) {
|
|
349
335
|
pointerTypeRef.current = undefined;
|
|
@@ -360,7 +346,7 @@ export function useHover(context, props = {}) {
|
|
|
360
346
|
restTimeout.clear();
|
|
361
347
|
interactedInsideRef.current = false;
|
|
362
348
|
};
|
|
363
|
-
}, [
|
|
349
|
+
}, [domReferenceElement, cleanupMouseMoveHandler, timeout, restTimeout]);
|
|
364
350
|
React.useEffect(() => {
|
|
365
351
|
return clearPointerEvents;
|
|
366
352
|
}, [clearPointerEvents]);
|
|
@@ -385,9 +371,6 @@ export function useHover(context, props = {}) {
|
|
|
385
371
|
store.setOpen(true, createChangeEventDetails(REASONS.triggerHover, nativeEvent, trigger));
|
|
386
372
|
}
|
|
387
373
|
}
|
|
388
|
-
if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {
|
|
389
|
-
return;
|
|
390
|
-
}
|
|
391
374
|
if (store.select('open') && !isOverInactiveTrigger || getRestMs(restMsRef.current) === 0) {
|
|
392
375
|
return;
|
|
393
376
|
}
|
|
@@ -407,8 +390,8 @@ export function useHover(context, props = {}) {
|
|
|
407
390
|
}
|
|
408
391
|
}
|
|
409
392
|
};
|
|
410
|
-
}, [
|
|
411
|
-
return React.useMemo(() =>
|
|
393
|
+
}, [store, restMsRef, restTimeout]);
|
|
394
|
+
return React.useMemo(() => ({
|
|
412
395
|
reference
|
|
413
|
-
}
|
|
396
|
+
}), [reference]);
|
|
414
397
|
}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
import type { FloatingContext, FloatingRootContext } from "../types.js";
|
|
2
|
-
import { FloatingTreeStore } from "../components/FloatingTreeStore.js";
|
|
3
2
|
export type UseHoverFloatingInteractionProps = {
|
|
4
3
|
/**
|
|
5
4
|
* Whether the Hook is enabled, including all internal Effects and event
|
|
6
5
|
* handlers.
|
|
7
6
|
* @default true
|
|
8
7
|
*/
|
|
9
|
-
enabled?: boolean;
|
|
8
|
+
enabled?: boolean | undefined;
|
|
10
9
|
/**
|
|
11
10
|
* Waits for the specified time when the event listener runs before changing
|
|
12
11
|
* the `open` state.
|
|
13
12
|
* @default 0
|
|
14
13
|
*/
|
|
15
|
-
closeDelay?: number | (() => number);
|
|
16
|
-
/**
|
|
17
|
-
* An optional external floating tree to use instead of the default context.
|
|
18
|
-
*/
|
|
19
|
-
externalTree?: FloatingTreeStore;
|
|
14
|
+
closeDelay?: (number | (() => number)) | undefined;
|
|
20
15
|
};
|
|
21
16
|
/**
|
|
22
17
|
* Provides hover interactions that should be attached to the floating element.
|