@base-ui/react 1.2.0 → 1.3.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 +148 -1
- package/accordion/header/AccordionHeader.d.ts +4 -2
- package/accordion/item/AccordionItem.d.ts +10 -4
- package/accordion/item/AccordionItemContext.d.ts +2 -2
- package/accordion/item/stateAttributesMapping.d.ts +2 -2
- package/accordion/panel/AccordionPanel.d.ts +6 -3
- package/accordion/root/AccordionRoot.d.ts +19 -10
- package/accordion/root/AccordionRootContext.d.ts +7 -7
- package/accordion/trigger/AccordionTrigger.d.ts +4 -2
- package/accordion/trigger/AccordionTrigger.js +3 -1
- package/alert-dialog/root/AlertDialogRoot.d.ts +2 -0
- package/autocomplete/index.d.ts +1 -0
- package/autocomplete/index.parts.d.ts +1 -0
- package/autocomplete/index.parts.js +7 -0
- package/autocomplete/root/AutocompleteRoot.d.ts +4 -4
- package/autocomplete/root/AutocompleteRoot.js +4 -1
- package/avatar/fallback/AvatarFallback.d.ts +3 -6
- package/avatar/fallback/AvatarFallback.js +4 -32
- package/avatar/image/AvatarImage.d.ts +6 -3
- package/avatar/image/AvatarImage.js +2 -3
- package/avatar/image/AvatarImageDataAttributes.d.ts +10 -0
- package/avatar/image/AvatarImageDataAttributes.js +18 -0
- package/avatar/root/AvatarRoot.d.ts +4 -1
- package/checkbox/indicator/CheckboxIndicator.d.ts +6 -3
- package/checkbox/root/CheckboxRoot.d.ts +3 -3
- package/checkbox/root/CheckboxRoot.js +4 -1
- package/checkbox/root/CheckboxRootContext.d.ts +4 -4
- package/checkbox/utils/useStateAttributesMapping.d.ts +2 -2
- package/checkbox-group/CheckboxGroup.d.ts +3 -3
- package/checkbox-group/CheckboxGroupContext.d.ts +2 -2
- package/checkbox-group/useCheckboxGroupParent.d.ts +2 -5
- package/collapsible/panel/CollapsiblePanel.d.ts +6 -3
- package/collapsible/panel/useCollapsiblePanel.d.ts +2 -5
- package/collapsible/root/CollapsibleRoot.d.ts +3 -3
- package/collapsible/root/CollapsibleRootContext.d.ts +4 -4
- package/collapsible/root/stateAttributesMapping.d.ts +2 -2
- package/collapsible/root/useCollapsibleRoot.d.ts +2 -5
- package/collapsible/trigger/CollapsibleTrigger.d.ts +4 -2
- package/combobox/arrow/ComboboxArrow.d.ts +10 -1
- package/combobox/backdrop/ComboboxBackdrop.d.ts +4 -1
- package/combobox/chip/ComboboxChip.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/combobox/chips/ComboboxChips.d.ts +1 -1
- package/combobox/clear/ComboboxClear.d.ts +4 -1
- package/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/combobox/group/ComboboxGroup.d.ts +1 -1
- package/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/combobox/index.d.ts +2 -0
- package/combobox/index.parts.d.ts +2 -0
- package/combobox/index.parts.js +14 -0
- package/combobox/input/ComboboxInput.d.ts +3 -3
- package/combobox/input/ComboboxInput.js +22 -5
- package/combobox/input-group/ComboboxInputGroup.d.ts +40 -0
- package/combobox/input-group/ComboboxInputGroup.js +68 -0
- package/combobox/input-group/ComboboxInputGroupDataAttributes.d.ts +55 -0
- package/combobox/input-group/ComboboxInputGroupDataAttributes.js +62 -0
- package/combobox/item/ComboboxItem.d.ts +1 -1
- package/combobox/item/ComboboxItem.js +2 -1
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +7 -1
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.d.ts +10 -0
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.js +18 -0
- package/combobox/label/ComboboxLabel.d.ts +16 -0
- package/combobox/label/ComboboxLabel.js +68 -0
- package/combobox/list/ComboboxList.d.ts +1 -1
- package/combobox/popup/ComboboxPopup.d.ts +21 -3
- package/combobox/popup/ComboboxPopup.js +10 -2
- package/combobox/portal/ComboboxPortal.d.ts +3 -4
- package/combobox/positioner/ComboboxPositioner.d.ts +14 -2
- package/combobox/positioner/ComboboxPositioner.js +3 -2
- package/combobox/root/AriaCombobox.d.ts +9 -8
- package/combobox/root/AriaCombobox.js +14 -6
- package/combobox/root/ComboboxRoot.d.ts +4 -4
- package/combobox/row/ComboboxRow.d.ts +1 -1
- package/combobox/status/ComboboxStatus.d.ts +1 -1
- package/combobox/store.d.ts +10 -4
- package/combobox/store.js +2 -0
- package/combobox/trigger/ComboboxTrigger.d.ts +3 -3
- package/combobox/trigger/ComboboxTrigger.js +5 -2
- package/combobox/utils/ComboboxInternalDismissButton.d.ts +5 -0
- package/combobox/utils/ComboboxInternalDismissButton.js +44 -0
- package/composite/item/CompositeItem.d.ts +3 -1
- package/composite/list/CompositeList.d.ts +3 -1
- package/composite/list/useCompositeListItem.d.ts +1 -1
- package/composite/root/CompositeRoot.d.ts +4 -2
- package/composite/root/useCompositeRoot.d.ts +1 -1
- package/context-menu/trigger/ContextMenuTrigger.d.ts +3 -3
- package/dialog/backdrop/DialogBackdrop.d.ts +4 -1
- package/dialog/close/DialogClose.d.ts +1 -1
- package/dialog/description/DialogDescription.d.ts +1 -1
- package/dialog/popup/DialogPopup.d.ts +6 -3
- package/dialog/portal/DialogPortal.d.ts +4 -5
- package/dialog/root/DialogRoot.d.ts +8 -3
- package/dialog/root/useDialogRoot.d.ts +3 -7
- package/dialog/root/useDialogRoot.js +2 -5
- package/dialog/title/DialogTitle.d.ts +1 -1
- package/dialog/trigger/DialogTrigger.d.ts +1 -1
- package/dialog/viewport/DialogViewport.d.ts +3 -0
- package/direction-provider/DirectionProvider.d.ts +2 -0
- package/drawer/backdrop/DrawerBackdrop.d.ts +4 -1
- package/drawer/backdrop/DrawerBackdropDataAttributes.d.ts +18 -0
- package/drawer/backdrop/DrawerBackdropDataAttributes.js +26 -0
- package/drawer/close/DrawerClose.d.ts +1 -1
- package/drawer/content/DrawerContent.d.ts +1 -1
- package/drawer/content/DrawerContent.js +2 -1
- package/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/drawer/content/DrawerContentDataAttributes.js +7 -0
- package/drawer/description/DrawerDescription.d.ts +1 -1
- package/drawer/indent/DrawerIndent.d.ts +3 -2
- package/drawer/indent/DrawerIndent.js +2 -1
- package/drawer/indent-background/DrawerIndentBackground.d.ts +5 -3
- package/drawer/indent-background/DrawerIndentBackground.js +4 -2
- package/drawer/index.d.ts +2 -1
- package/drawer/index.js +3 -3
- package/drawer/index.parts.d.ts +1 -0
- package/drawer/index.parts.js +7 -0
- package/drawer/popup/DrawerPopup.d.ts +6 -3
- package/drawer/popup/DrawerPopup.js +59 -2
- package/drawer/popup/DrawerPopupDataAttributes.d.ts +16 -0
- package/drawer/popup/DrawerPopupDataAttributes.js +18 -1
- package/drawer/portal/DrawerPortal.d.ts +2 -2
- package/drawer/provider/DrawerProvider.d.ts +2 -2
- package/drawer/provider/DrawerProvider.js +2 -2
- package/drawer/root/DrawerRoot.d.ts +5 -3
- package/drawer/root/DrawerRoot.js +6 -2
- package/drawer/swipe-area/DrawerSwipeArea.d.ts +1 -1
- package/drawer/swipe-area/DrawerSwipeArea.js +12 -10
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +23 -0
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.js +31 -0
- package/drawer/title/DrawerTitle.d.ts +1 -1
- package/drawer/trigger/DrawerTrigger.d.ts +1 -1
- package/drawer/viewport/DrawerViewport.d.ts +4 -1
- package/drawer/viewport/DrawerViewport.js +165 -43
- package/drawer/viewport/DrawerViewportDataAttributes.d.ts +22 -0
- package/drawer/viewport/DrawerViewportDataAttributes.js +30 -0
- package/esm/accordion/header/AccordionHeader.d.ts +4 -2
- package/esm/accordion/item/AccordionItem.d.ts +10 -4
- package/esm/accordion/item/AccordionItemContext.d.ts +2 -2
- package/esm/accordion/item/stateAttributesMapping.d.ts +2 -2
- package/esm/accordion/panel/AccordionPanel.d.ts +6 -3
- package/esm/accordion/root/AccordionRoot.d.ts +19 -10
- package/esm/accordion/root/AccordionRootContext.d.ts +7 -7
- package/esm/accordion/trigger/AccordionTrigger.d.ts +4 -2
- package/esm/accordion/trigger/AccordionTrigger.js +3 -1
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +2 -0
- package/esm/autocomplete/index.d.ts +1 -0
- package/esm/autocomplete/index.parts.d.ts +1 -0
- package/esm/autocomplete/index.parts.js +1 -0
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +4 -4
- package/esm/autocomplete/root/AutocompleteRoot.js +4 -1
- package/esm/avatar/fallback/AvatarFallback.d.ts +3 -6
- package/esm/avatar/fallback/AvatarFallback.js +4 -31
- package/esm/avatar/image/AvatarImage.d.ts +6 -3
- package/esm/avatar/image/AvatarImage.js +2 -3
- package/esm/avatar/image/AvatarImageDataAttributes.d.ts +10 -0
- package/esm/avatar/image/AvatarImageDataAttributes.js +12 -0
- package/esm/avatar/root/AvatarRoot.d.ts +4 -1
- package/esm/checkbox/indicator/CheckboxIndicator.d.ts +6 -3
- package/esm/checkbox/root/CheckboxRoot.d.ts +3 -3
- package/esm/checkbox/root/CheckboxRoot.js +4 -1
- package/esm/checkbox/root/CheckboxRootContext.d.ts +4 -4
- package/esm/checkbox/utils/useStateAttributesMapping.d.ts +2 -2
- package/esm/checkbox-group/CheckboxGroup.d.ts +3 -3
- package/esm/checkbox-group/CheckboxGroupContext.d.ts +2 -2
- package/esm/checkbox-group/useCheckboxGroupParent.d.ts +2 -5
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +6 -3
- package/esm/collapsible/panel/useCollapsiblePanel.d.ts +2 -5
- package/esm/collapsible/root/CollapsibleRoot.d.ts +3 -3
- package/esm/collapsible/root/CollapsibleRootContext.d.ts +4 -4
- package/esm/collapsible/root/stateAttributesMapping.d.ts +2 -2
- package/esm/collapsible/root/useCollapsibleRoot.d.ts +2 -5
- package/esm/collapsible/trigger/CollapsibleTrigger.d.ts +4 -2
- package/esm/combobox/arrow/ComboboxArrow.d.ts +10 -1
- package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +4 -1
- package/esm/combobox/chip/ComboboxChip.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/esm/combobox/chips/ComboboxChips.d.ts +1 -1
- package/esm/combobox/clear/ComboboxClear.d.ts +4 -1
- package/esm/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/esm/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
- package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/esm/combobox/index.d.ts +2 -0
- package/esm/combobox/index.parts.d.ts +2 -0
- package/esm/combobox/index.parts.js +2 -0
- package/esm/combobox/input/ComboboxInput.d.ts +3 -3
- package/esm/combobox/input/ComboboxInput.js +22 -5
- package/esm/combobox/input-group/ComboboxInputGroup.d.ts +40 -0
- package/esm/combobox/input-group/ComboboxInputGroup.js +63 -0
- package/esm/combobox/input-group/ComboboxInputGroupDataAttributes.d.ts +55 -0
- package/esm/combobox/input-group/ComboboxInputGroupDataAttributes.js +56 -0
- package/esm/combobox/item/ComboboxItem.d.ts +1 -1
- package/esm/combobox/item/ComboboxItem.js +2 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +7 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.d.ts +10 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.js +12 -0
- package/esm/combobox/label/ComboboxLabel.d.ts +16 -0
- package/esm/combobox/label/ComboboxLabel.js +63 -0
- package/esm/combobox/list/ComboboxList.d.ts +1 -1
- package/esm/combobox/popup/ComboboxPopup.d.ts +21 -3
- package/esm/combobox/popup/ComboboxPopup.js +11 -3
- package/esm/combobox/portal/ComboboxPortal.d.ts +3 -4
- package/esm/combobox/positioner/ComboboxPositioner.d.ts +14 -2
- package/esm/combobox/positioner/ComboboxPositioner.js +3 -2
- package/esm/combobox/root/AriaCombobox.d.ts +9 -8
- package/esm/combobox/root/AriaCombobox.js +14 -6
- package/esm/combobox/root/ComboboxRoot.d.ts +4 -4
- package/esm/combobox/row/ComboboxRow.d.ts +1 -1
- package/esm/combobox/status/ComboboxStatus.d.ts +1 -1
- package/esm/combobox/store.d.ts +10 -4
- package/esm/combobox/store.js +2 -0
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +3 -3
- package/esm/combobox/trigger/ComboboxTrigger.js +5 -2
- package/esm/combobox/utils/ComboboxInternalDismissButton.d.ts +5 -0
- package/esm/combobox/utils/ComboboxInternalDismissButton.js +38 -0
- package/esm/composite/item/CompositeItem.d.ts +3 -1
- package/esm/composite/list/CompositeList.d.ts +3 -1
- package/esm/composite/list/useCompositeListItem.d.ts +1 -1
- package/esm/composite/root/CompositeRoot.d.ts +4 -2
- package/esm/composite/root/useCompositeRoot.d.ts +1 -1
- package/esm/context-menu/trigger/ContextMenuTrigger.d.ts +3 -3
- package/esm/dialog/backdrop/DialogBackdrop.d.ts +4 -1
- package/esm/dialog/close/DialogClose.d.ts +1 -1
- package/esm/dialog/description/DialogDescription.d.ts +1 -1
- package/esm/dialog/popup/DialogPopup.d.ts +6 -3
- package/esm/dialog/portal/DialogPortal.d.ts +4 -5
- package/esm/dialog/root/DialogRoot.d.ts +8 -3
- package/esm/dialog/root/useDialogRoot.d.ts +3 -7
- package/esm/dialog/root/useDialogRoot.js +2 -5
- package/esm/dialog/title/DialogTitle.d.ts +1 -1
- package/esm/dialog/trigger/DialogTrigger.d.ts +1 -1
- package/esm/dialog/viewport/DialogViewport.d.ts +3 -0
- package/esm/direction-provider/DirectionProvider.d.ts +2 -0
- package/esm/drawer/backdrop/DrawerBackdrop.d.ts +4 -1
- package/esm/drawer/backdrop/DrawerBackdropDataAttributes.d.ts +18 -0
- package/esm/drawer/backdrop/DrawerBackdropDataAttributes.js +20 -0
- package/esm/drawer/close/DrawerClose.d.ts +1 -1
- package/esm/drawer/content/DrawerContent.d.ts +1 -1
- package/esm/drawer/content/DrawerContent.js +2 -1
- package/esm/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/esm/drawer/content/DrawerContentDataAttributes.js +1 -0
- package/esm/drawer/description/DrawerDescription.d.ts +1 -1
- package/esm/drawer/indent/DrawerIndent.d.ts +3 -2
- package/esm/drawer/indent/DrawerIndent.js +2 -1
- package/esm/drawer/indent-background/DrawerIndentBackground.d.ts +5 -3
- package/esm/drawer/indent-background/DrawerIndentBackground.js +4 -2
- package/esm/drawer/index.d.ts +2 -1
- package/esm/drawer/index.js +1 -1
- package/esm/drawer/index.parts.d.ts +1 -0
- package/esm/drawer/index.parts.js +1 -0
- package/esm/drawer/popup/DrawerPopup.d.ts +6 -3
- package/esm/drawer/popup/DrawerPopup.js +59 -2
- package/esm/drawer/popup/DrawerPopupDataAttributes.d.ts +16 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.js +18 -1
- package/esm/drawer/portal/DrawerPortal.d.ts +2 -2
- package/esm/drawer/provider/DrawerProvider.d.ts +2 -2
- package/esm/drawer/provider/DrawerProvider.js +2 -2
- package/esm/drawer/root/DrawerRoot.d.ts +5 -3
- package/esm/drawer/root/DrawerRoot.js +6 -2
- package/esm/drawer/swipe-area/DrawerSwipeArea.d.ts +1 -1
- package/esm/drawer/swipe-area/DrawerSwipeArea.js +12 -10
- package/esm/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +23 -0
- package/esm/drawer/swipe-area/DrawerSwipeAreaDataAttributes.js +25 -0
- package/esm/drawer/title/DrawerTitle.d.ts +1 -1
- package/esm/drawer/trigger/DrawerTrigger.d.ts +1 -1
- package/esm/drawer/viewport/DrawerViewport.d.ts +4 -1
- package/esm/drawer/viewport/DrawerViewport.js +165 -43
- package/esm/drawer/viewport/DrawerViewportDataAttributes.d.ts +22 -0
- package/esm/drawer/viewport/DrawerViewportDataAttributes.js +24 -0
- package/esm/field/control/FieldControl.d.ts +3 -3
- package/esm/field/description/FieldDescription.d.ts +3 -3
- package/esm/field/error/FieldError.d.ts +7 -4
- package/esm/field/error/FieldErrorDataAttributes.d.ts +8 -0
- package/esm/field/error/FieldErrorDataAttributes.js +10 -1
- package/esm/field/item/FieldItem.d.ts +4 -3
- package/esm/field/item/FieldItem.js +2 -2
- package/esm/field/label/FieldLabel.d.ts +3 -3
- package/esm/field/label/FieldLabel.js +6 -51
- package/esm/field/root/FieldRoot.d.ts +19 -2
- package/esm/field/root/FieldRoot.js +2 -1
- package/esm/field/root/FieldRootContext.d.ts +2 -2
- package/esm/field/root/FieldRootContext.js +6 -13
- package/esm/field/root/useFieldValidation.js +5 -4
- package/esm/field/utils/constants.d.ts +3 -0
- package/esm/field/utils/constants.js +11 -0
- package/esm/field/validity/FieldValidity.d.ts +7 -1
- package/esm/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/esm/floating-ui-react/components/FloatingDelayGroup.js +1 -1
- package/esm/floating-ui-react/components/FloatingFocusManager.d.ts +12 -7
- package/esm/floating-ui-react/components/FloatingFocusManager.js +31 -27
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +6 -4
- package/esm/floating-ui-react/hooks/useClick.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useClientPoint.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useDismiss.d.ts +8 -12
- package/esm/floating-ui-react/hooks/useDismiss.js +320 -261
- package/esm/floating-ui-react/hooks/useFloatingRootContext.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useFocus.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useHover.d.ts +6 -14
- package/esm/floating-ui-react/hooks/useHover.js +2 -27
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -3
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +55 -71
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +12 -3
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +30 -3
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +8 -3
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +59 -81
- package/esm/floating-ui-react/hooks/useHoverShared.d.ts +28 -0
- package/esm/floating-ui-react/hooks/useHoverShared.js +26 -0
- package/esm/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
- package/esm/floating-ui-react/hooks/useListNavigation.js +7 -3
- package/esm/floating-ui-react/hooks/useRole.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useTypeahead.d.ts +7 -1
- package/esm/floating-ui-react/hooks/useTypeahead.js +30 -14
- package/esm/floating-ui-react/safePolygon.d.ts +2 -6
- package/esm/floating-ui-react/safePolygon.js +149 -119
- package/esm/floating-ui-react/types.d.ts +5 -4
- package/esm/floating-ui-react/utils/composite.d.ts +1 -0
- package/esm/floating-ui-react/utils/composite.js +128 -129
- package/esm/floating-ui-react/utils/markOthers.d.ts +7 -1
- package/esm/floating-ui-react/utils/markOthers.js +119 -81
- package/esm/form/Form.d.ts +1 -1
- package/esm/global.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/input/Input.d.ts +10 -3
- package/esm/labelable-provider/LabelableProvider.d.ts +4 -1
- package/esm/labelable-provider/LabelableProvider.js +3 -2
- package/esm/labelable-provider/useAriaLabelledBy.d.ts +9 -0
- package/esm/labelable-provider/useAriaLabelledBy.js +56 -0
- package/esm/labelable-provider/useLabel.d.ts +25 -0
- package/esm/labelable-provider/useLabel.js +74 -0
- package/esm/labelable-provider/useLabelableId.d.ts +2 -5
- package/esm/menu/arrow/MenuArrow.d.ts +10 -1
- package/esm/menu/backdrop/MenuBackdrop.d.ts +4 -1
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +3 -3
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +7 -1
- package/esm/menu/group/MenuGroup.d.ts +1 -1
- package/esm/menu/group-label/MenuGroupLabel.d.ts +1 -1
- 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 +1 -1
- package/esm/menu/item/useMenuItem.d.ts +8 -7
- package/esm/menu/item/useMenuItem.js +5 -7
- package/esm/menu/item/useMenuItemCommonProps.d.ts +7 -4
- package/esm/menu/item/useMenuItemCommonProps.js +16 -2
- package/esm/menu/link-item/MenuLinkItem.d.ts +1 -1
- package/esm/menu/link-item/MenuLinkItem.js +16 -2
- package/esm/menu/popup/MenuPopup.d.ts +20 -5
- package/esm/menu/popup/MenuPopup.js +4 -1
- package/esm/menu/popup/MenuPopupDataAttributes.d.ts +1 -1
- package/esm/menu/popup/MenuPopupDataAttributes.js +1 -1
- package/esm/menu/portal/MenuPortal.d.ts +3 -4
- package/esm/menu/positioner/MenuPositioner.d.ts +18 -2
- package/esm/menu/positioner/MenuPositioner.js +58 -5
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +6 -3
- package/esm/menu/radio-item/MenuRadioItem.d.ts +3 -3
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +7 -1
- package/esm/menu/root/MenuRoot.d.ts +4 -2
- package/esm/menu/root/MenuRoot.js +2 -3
- package/esm/menu/store/MenuStore.d.ts +4 -2
- package/esm/menu/store/MenuStore.js +15 -1
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +1 -0
- package/esm/menu/trigger/MenuTrigger.d.ts +3 -3
- package/esm/menu/viewport/MenuViewport.d.ts +30 -0
- package/esm/menu/viewport/MenuViewport.js +60 -0
- package/esm/menu/viewport/MenuViewportCssVars.d.ts +14 -0
- package/esm/menu/viewport/MenuViewportCssVars.js +15 -0
- package/esm/menu/viewport/MenuViewportDataAttributes.d.ts +26 -0
- package/esm/menu/viewport/MenuViewportDataAttributes.js +27 -0
- package/esm/menubar/Menubar.d.ts +1 -1
- package/esm/menubar/Menubar.js +1 -7
- package/esm/meter/indicator/MeterIndicator.d.ts +4 -2
- package/esm/meter/label/MeterLabel.d.ts +4 -2
- package/esm/meter/label/MeterLabel.js +4 -8
- package/esm/meter/root/MeterRoot.d.ts +1 -1
- package/esm/meter/root/MeterRoot.js +11 -2
- package/esm/meter/track/MeterTrack.d.ts +4 -2
- package/esm/meter/value/MeterValue.d.ts +5 -3
- package/esm/navigation-menu/arrow/NavigationMenuArrow.d.ts +10 -1
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.js +11 -0
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.js +11 -2
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +4 -5
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.d.ts +11 -2
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +4 -4
- package/esm/navigation-menu/root/NavigationMenuRoot.js +27 -8
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +364 -20
- package/esm/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.js +0 -19
- package/esm/number-field/decrement/NumberFieldDecrement.d.ts +3 -3
- package/esm/number-field/group/NumberFieldGroup.d.ts +3 -3
- package/esm/number-field/increment/NumberFieldIncrement.d.ts +3 -3
- package/esm/number-field/input/NumberFieldInput.d.ts +3 -3
- package/esm/number-field/root/NumberFieldRoot.d.ts +4 -4
- package/esm/number-field/root/NumberFieldRoot.js +1 -1
- package/esm/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/esm/number-field/root/useNumberFieldButton.d.ts +2 -5
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +4 -4
- package/esm/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +3 -3
- package/esm/number-field/utils/stateAttributesMapping.d.ts +2 -2
- package/esm/number-field/utils/types.d.ts +2 -2
- package/esm/popover/arrow/PopoverArrow.d.ts +10 -1
- package/esm/popover/backdrop/PopoverBackdrop.d.ts +4 -1
- package/esm/popover/close/PopoverClose.d.ts +1 -1
- package/esm/popover/close/PopoverClose.js +5 -3
- package/esm/popover/description/PopoverDescription.d.ts +1 -1
- package/esm/popover/popup/PopoverPopup.d.ts +15 -3
- package/esm/popover/popup/PopoverPopup.js +11 -2
- package/esm/popover/portal/PopoverPortal.d.ts +3 -4
- package/esm/popover/positioner/PopoverPositioner.d.ts +11 -2
- package/esm/popover/root/PopoverRoot.d.ts +10 -3
- package/esm/popover/root/PopoverRoot.js +1 -3
- package/esm/popover/title/PopoverTitle.d.ts +1 -1
- package/esm/popover/viewport/PopoverViewport.d.ts +16 -12
- package/esm/preview-card/arrow/PreviewCardArrow.d.ts +10 -1
- package/esm/preview-card/backdrop/PreviewCardBackdrop.d.ts +4 -1
- package/esm/preview-card/popup/PreviewCardPopup.d.ts +13 -1
- package/esm/preview-card/portal/PreviewCardPortal.d.ts +3 -4
- package/esm/preview-card/positioner/PreviewCardPositioner.d.ts +14 -2
- package/esm/preview-card/positioner/PreviewCardPositioner.js +7 -1
- package/esm/preview-card/root/PreviewCardRoot.d.ts +3 -3
- package/esm/preview-card/root/PreviewCardRoot.js +22 -9
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +1 -1
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +16 -9
- package/esm/progress/indicator/ProgressIndicator.d.ts +4 -2
- package/esm/progress/label/ProgressLabel.d.ts +4 -2
- package/esm/progress/label/ProgressLabel.js +4 -8
- package/esm/progress/root/ProgressRoot.d.ts +4 -1
- package/esm/progress/root/ProgressRoot.js +11 -2
- package/esm/progress/root/ProgressRootContext.d.ts +2 -2
- package/esm/progress/root/stateAttributesMapping.d.ts +2 -2
- package/esm/progress/track/ProgressTrack.d.ts +4 -2
- package/esm/progress/value/ProgressValue.d.ts +5 -3
- package/esm/radio/indicator/RadioIndicator.d.ts +4 -1
- package/esm/radio/indicator/RadioIndicatorDataAttributes.d.ts +8 -0
- package/esm/radio/indicator/RadioIndicatorDataAttributes.js +10 -1
- package/esm/radio/root/RadioRoot.d.ts +3 -3
- package/esm/radio/root/RadioRoot.js +4 -1
- package/esm/radio-group/RadioGroup.d.ts +3 -3
- package/esm/scroll-area/content/ScrollAreaContent.d.ts +3 -3
- package/esm/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/esm/scroll-area/root/ScrollAreaRoot.d.ts +27 -11
- package/esm/scroll-area/root/ScrollAreaRoot.js +7 -4
- package/esm/scroll-area/root/ScrollAreaRootContext.d.ts +4 -2
- package/esm/scroll-area/root/stateAttributes.d.ts +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +13 -7
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -1
- package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +5 -2
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +3 -1
- package/esm/scroll-area/viewport/ScrollAreaViewport.d.ts +3 -3
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +46 -27
- package/esm/select/arrow/SelectArrow.d.ts +10 -1
- package/esm/select/backdrop/SelectBackdrop.d.ts +7 -1
- package/esm/select/group/SelectGroup.d.ts +1 -1
- package/esm/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/esm/select/icon/SelectIcon.d.ts +1 -1
- package/esm/select/index.d.ts +1 -0
- package/esm/select/index.parts.d.ts +1 -0
- package/esm/select/index.parts.js +1 -0
- package/esm/select/item/SelectItem.d.ts +1 -1
- package/esm/select/item/SelectItem.js +10 -4
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +10 -2
- package/esm/select/item-indicator/SelectItemIndicatorDataAttributes.d.ts +10 -0
- package/esm/select/item-indicator/SelectItemIndicatorDataAttributes.js +12 -0
- package/esm/select/item-text/SelectItemText.d.ts +1 -1
- package/esm/select/label/SelectLabel.d.ts +16 -0
- package/esm/select/label/SelectLabel.js +49 -0
- package/esm/select/list/SelectList.d.ts +1 -1
- package/esm/select/popup/SelectPopup.d.ts +14 -2
- package/esm/select/popup/SelectPopup.js +23 -9
- package/esm/select/portal/SelectPortal.d.ts +3 -4
- package/esm/select/positioner/SelectPositioner.d.ts +14 -2
- package/esm/select/positioner/SelectPositionerContext.d.ts +2 -2
- package/esm/select/root/SelectRoot.d.ts +5 -4
- package/esm/select/root/SelectRoot.js +5 -6
- package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +13 -1
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/esm/select/store.d.ts +5 -2
- package/esm/select/store.js +1 -0
- package/esm/select/trigger/SelectTrigger.d.ts +6 -4
- package/esm/select/trigger/SelectTrigger.js +5 -2
- package/esm/select/value/SelectValue.d.ts +1 -1
- package/esm/separator/Separator.d.ts +1 -1
- package/esm/slider/control/SliderControl.d.ts +4 -3
- package/esm/slider/control/SliderControl.js +0 -2
- package/esm/slider/index.d.ts +1 -0
- package/esm/slider/index.parts.d.ts +1 -0
- package/esm/slider/index.parts.js +1 -0
- package/esm/slider/indicator/SliderIndicator.d.ts +4 -2
- package/esm/slider/label/SliderLabel.d.ts +16 -0
- package/esm/slider/label/SliderLabel.js +58 -0
- package/esm/slider/root/SliderRoot.d.ts +11 -5
- package/esm/slider/root/SliderRoot.js +8 -3
- package/esm/slider/root/SliderRootContext.d.ts +4 -2
- package/esm/slider/root/stateAttributesMapping.d.ts +2 -2
- package/esm/slider/thumb/SliderThumb.d.ts +5 -5
- package/esm/slider/thumb/SliderThumb.js +3 -2
- package/esm/slider/track/SliderTrack.d.ts +4 -2
- package/esm/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/esm/slider/value/SliderValue.d.ts +5 -3
- package/esm/switch/root/SwitchRoot.d.ts +3 -3
- package/esm/switch/root/SwitchRoot.js +4 -1
- package/esm/switch/root/SwitchRootContext.d.ts +4 -4
- package/esm/switch/stateAttributesMapping.d.ts +2 -2
- package/esm/switch/thumb/SwitchThumb.d.ts +3 -3
- package/esm/tabs/indicator/TabsIndicator.d.ts +12 -3
- package/esm/tabs/indicator/TabsIndicator.js +5 -14
- package/esm/tabs/indicator/TabsIndicatorCssVars.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicatorCssVars.js +1 -1
- package/esm/tabs/list/TabsList.d.ts +3 -3
- package/esm/tabs/list/TabsList.js +48 -3
- package/esm/tabs/list/TabsListContext.d.ts +2 -0
- package/esm/tabs/panel/TabsPanel.d.ts +9 -3
- package/esm/tabs/panel/TabsPanelDataAttributes.d.ts +8 -0
- package/esm/tabs/panel/TabsPanelDataAttributes.js +10 -1
- package/esm/tabs/root/TabsRoot.d.ts +7 -1
- package/esm/tabs/root/TabsRootContext.d.ts +1 -1
- package/esm/tabs/root/stateAttributesMapping.d.ts +2 -2
- package/esm/tabs/tab/TabsTab.d.ts +7 -1
- package/esm/tabs/tab/TabsTab.js +10 -1
- package/esm/toast/action/ToastAction.d.ts +1 -1
- package/esm/toast/arrow/ToastArrow.d.ts +10 -1
- package/esm/toast/close/ToastClose.d.ts +1 -1
- package/esm/toast/content/ToastContent.d.ts +1 -1
- package/esm/toast/createToastManager.d.ts +1 -1
- package/esm/toast/description/ToastDescription.d.ts +1 -1
- package/esm/toast/portal/ToastPortal.d.ts +3 -4
- package/esm/toast/positioner/ToastPositioner.d.ts +12 -3
- package/esm/toast/provider/ToastProvider.d.ts +2 -0
- package/esm/toast/provider/ToastProvider.js +1 -1
- package/esm/toast/root/ToastRoot.d.ts +20 -7
- package/esm/toast/root/ToastRoot.js +3 -1
- package/esm/toast/store.d.ts +1 -1
- package/esm/toast/store.js +37 -8
- package/esm/toast/title/ToastTitle.d.ts +1 -1
- package/esm/toast/useToastManager.d.ts +3 -3
- package/esm/toast/viewport/ToastViewport.d.ts +1 -1
- package/esm/toggle/Toggle.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toolbar/button/ToolbarButton.d.ts +9 -3
- package/esm/toolbar/group/ToolbarGroup.d.ts +4 -2
- package/esm/toolbar/input/ToolbarInput.d.ts +9 -3
- package/esm/toolbar/link/ToolbarLink.d.ts +4 -1
- package/esm/toolbar/root/ToolbarRoot.d.ts +7 -1
- package/esm/toolbar/separator/ToolbarSeparator.d.ts +4 -2
- package/esm/tooltip/arrow/TooltipArrow.d.ts +13 -1
- package/esm/tooltip/popup/TooltipPopup.d.ts +13 -1
- package/esm/tooltip/portal/TooltipPortal.d.ts +3 -4
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +11 -2
- package/esm/tooltip/provider/TooltipProvider.d.ts +2 -0
- package/esm/tooltip/root/TooltipRoot.d.ts +3 -3
- package/esm/tooltip/root/TooltipRoot.js +1 -1
- package/esm/tooltip/store/TooltipStore.d.ts +2 -0
- package/esm/tooltip/store/TooltipStore.js +2 -0
- package/esm/tooltip/trigger/TooltipTrigger.d.ts +6 -1
- package/esm/tooltip/trigger/TooltipTrigger.js +5 -0
- package/esm/tooltip/viewport/TooltipViewport.d.ts +16 -12
- package/esm/types/index.d.ts +16 -1
- package/esm/unstable-use-media-query/index.d.ts +2 -0
- package/esm/use-button/useButton.d.ts +8 -5
- package/esm/use-button/useButton.js +49 -20
- package/esm/use-render/useRender.d.ts +7 -5
- package/esm/utils/FloatingPortalLite.d.ts +4 -2
- package/esm/utils/InternalBackdrop.d.ts +3 -1
- package/esm/utils/closePart.d.ts +16 -0
- package/esm/utils/closePart.js +40 -0
- package/esm/utils/constants.d.ts +4 -0
- package/esm/utils/constants.js +4 -0
- package/esm/utils/createBaseUIEventDetails.d.ts +1 -1
- package/esm/utils/getElementAtPoint.d.ts +1 -0
- package/esm/utils/getElementAtPoint.js +3 -0
- package/esm/utils/resolveAriaLabelledBy.d.ts +2 -0
- package/esm/utils/resolveAriaLabelledBy.js +8 -0
- package/esm/utils/resolveValueLabel.d.ts +4 -4
- package/esm/utils/resolveValueLabel.js +7 -5
- package/esm/utils/types.d.ts +7 -20
- package/esm/utils/useAnchorPositioning.d.ts +53 -18
- package/esm/utils/useAnchorPositioning.js +15 -6
- package/esm/utils/useFocusableWhenDisabled.d.ts +2 -5
- package/esm/utils/useMixedToggleClickHandler.d.ts +2 -4
- package/esm/utils/useOpenChangeComplete.d.ts +2 -4
- package/esm/utils/useOpenInteractionType.d.ts +0 -1
- package/esm/utils/useOpenInteractionType.js +7 -5
- package/esm/utils/usePopupAutoResize.js +1 -2
- package/esm/utils/usePopupViewport.js +11 -8
- package/esm/utils/useRegisteredLabelId.d.ts +1 -0
- package/esm/utils/useRegisteredLabelId.js +14 -0
- package/esm/utils/useRenderElement.d.ts +6 -9
- package/esm/utils/useRenderElement.js +15 -0
- package/esm/utils/useSwipeDismiss.d.ts +91 -92
- package/esm/utils/useSwipeDismiss.js +2 -1
- package/field/control/FieldControl.d.ts +3 -3
- package/field/description/FieldDescription.d.ts +3 -3
- package/field/error/FieldError.d.ts +7 -4
- package/field/error/FieldErrorDataAttributes.d.ts +8 -0
- package/field/error/FieldErrorDataAttributes.js +10 -1
- package/field/item/FieldItem.d.ts +4 -3
- package/field/item/FieldItem.js +2 -2
- package/field/label/FieldLabel.d.ts +3 -3
- package/field/label/FieldLabel.js +6 -51
- package/field/root/FieldRoot.d.ts +19 -2
- package/field/root/FieldRoot.js +2 -1
- package/field/root/FieldRootContext.d.ts +2 -2
- package/field/root/FieldRootContext.js +5 -12
- package/field/root/useFieldValidation.js +5 -4
- package/field/utils/constants.d.ts +3 -0
- package/field/utils/constants.js +12 -1
- package/field/validity/FieldValidity.d.ts +7 -1
- package/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/floating-ui-react/components/FloatingDelayGroup.js +2 -2
- package/floating-ui-react/components/FloatingFocusManager.d.ts +12 -7
- package/floating-ui-react/components/FloatingFocusManager.js +29 -25
- package/floating-ui-react/components/FloatingPortal.d.ts +6 -4
- package/floating-ui-react/hooks/useClick.d.ts +2 -2
- package/floating-ui-react/hooks/useClientPoint.d.ts +1 -1
- package/floating-ui-react/hooks/useDismiss.d.ts +8 -12
- package/floating-ui-react/hooks/useDismiss.js +319 -260
- package/floating-ui-react/hooks/useFloatingRootContext.d.ts +2 -2
- package/floating-ui-react/hooks/useFocus.d.ts +1 -1
- package/floating-ui-react/hooks/useHover.d.ts +6 -14
- package/floating-ui-react/hooks/useHover.js +6 -32
- package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -3
- package/floating-ui-react/hooks/useHoverFloatingInteraction.js +53 -70
- package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +12 -3
- package/floating-ui-react/hooks/useHoverInteractionSharedState.js +32 -4
- package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +8 -3
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +60 -82
- package/floating-ui-react/hooks/useHoverShared.d.ts +28 -0
- package/floating-ui-react/hooks/useHoverShared.js +34 -0
- package/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
- package/floating-ui-react/hooks/useListNavigation.js +7 -3
- package/floating-ui-react/hooks/useRole.d.ts +1 -1
- package/floating-ui-react/hooks/useTypeahead.d.ts +7 -1
- package/floating-ui-react/hooks/useTypeahead.js +29 -13
- package/floating-ui-react/safePolygon.d.ts +2 -6
- package/floating-ui-react/safePolygon.js +149 -119
- package/floating-ui-react/types.d.ts +5 -4
- package/floating-ui-react/utils/composite.d.ts +1 -0
- package/floating-ui-react/utils/composite.js +129 -129
- package/floating-ui-react/utils/markOthers.d.ts +7 -1
- package/floating-ui-react/utils/markOthers.js +118 -80
- package/form/Form.d.ts +1 -1
- package/global.d.ts +1 -1
- package/index.js +1 -1
- package/input/Input.d.ts +10 -3
- package/labelable-provider/LabelableProvider.d.ts +4 -1
- package/labelable-provider/LabelableProvider.js +3 -2
- package/labelable-provider/useAriaLabelledBy.d.ts +9 -0
- package/labelable-provider/useAriaLabelledBy.js +61 -0
- package/labelable-provider/useLabel.d.ts +25 -0
- package/labelable-provider/useLabel.js +80 -0
- package/labelable-provider/useLabelableId.d.ts +2 -5
- package/menu/arrow/MenuArrow.d.ts +10 -1
- package/menu/backdrop/MenuBackdrop.d.ts +4 -1
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +3 -3
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +7 -1
- package/menu/group/MenuGroup.d.ts +1 -1
- package/menu/group-label/MenuGroupLabel.d.ts +1 -1
- 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 +1 -1
- package/menu/item/useMenuItem.d.ts +8 -7
- package/menu/item/useMenuItem.js +5 -7
- package/menu/item/useMenuItemCommonProps.d.ts +7 -4
- package/menu/item/useMenuItemCommonProps.js +16 -2
- package/menu/link-item/MenuLinkItem.d.ts +1 -1
- package/menu/link-item/MenuLinkItem.js +16 -2
- package/menu/popup/MenuPopup.d.ts +20 -5
- package/menu/popup/MenuPopup.js +4 -1
- package/menu/popup/MenuPopupDataAttributes.d.ts +1 -1
- package/menu/popup/MenuPopupDataAttributes.js +1 -1
- package/menu/portal/MenuPortal.d.ts +3 -4
- package/menu/positioner/MenuPositioner.d.ts +18 -2
- package/menu/positioner/MenuPositioner.js +56 -4
- package/menu/radio-group/MenuRadioGroup.d.ts +6 -3
- package/menu/radio-item/MenuRadioItem.d.ts +3 -3
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +7 -1
- package/menu/root/MenuRoot.d.ts +4 -2
- package/menu/root/MenuRoot.js +2 -3
- package/menu/store/MenuStore.d.ts +4 -2
- package/menu/store/MenuStore.js +15 -1
- package/menu/submenu-trigger/MenuSubmenuTrigger.js +1 -0
- package/menu/trigger/MenuTrigger.d.ts +3 -3
- package/menu/viewport/MenuViewport.d.ts +30 -0
- package/menu/viewport/MenuViewport.js +66 -0
- package/menu/viewport/MenuViewportCssVars.d.ts +14 -0
- package/menu/viewport/MenuViewportCssVars.js +21 -0
- package/menu/viewport/MenuViewportDataAttributes.d.ts +26 -0
- package/menu/viewport/MenuViewportDataAttributes.js +33 -0
- package/menubar/Menubar.d.ts +1 -1
- package/menubar/Menubar.js +1 -7
- package/meter/indicator/MeterIndicator.d.ts +4 -2
- package/meter/label/MeterLabel.d.ts +4 -2
- package/meter/label/MeterLabel.js +4 -8
- package/meter/root/MeterRoot.d.ts +1 -1
- package/meter/root/MeterRoot.js +10 -1
- package/meter/track/MeterTrack.d.ts +4 -2
- package/meter/value/MeterValue.d.ts +5 -3
- package/navigation-menu/arrow/NavigationMenuArrow.d.ts +10 -1
- package/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.js +11 -0
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.js +10 -1
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +4 -5
- package/navigation-menu/positioner/NavigationMenuPositioner.d.ts +11 -2
- package/navigation-menu/root/NavigationMenuRoot.d.ts +4 -4
- package/navigation-menu/root/NavigationMenuRoot.js +26 -7
- package/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/navigation-menu/trigger/NavigationMenuTrigger.js +362 -17
- package/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.js +0 -19
- package/number-field/decrement/NumberFieldDecrement.d.ts +3 -3
- package/number-field/group/NumberFieldGroup.d.ts +3 -3
- package/number-field/increment/NumberFieldIncrement.d.ts +3 -3
- package/number-field/input/NumberFieldInput.d.ts +3 -3
- package/number-field/root/NumberFieldRoot.d.ts +4 -4
- package/number-field/root/NumberFieldRoot.js +1 -1
- package/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/number-field/root/useNumberFieldButton.d.ts +2 -5
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +4 -4
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +3 -3
- package/number-field/utils/stateAttributesMapping.d.ts +2 -2
- package/number-field/utils/types.d.ts +2 -2
- package/package.json +183 -7
- package/popover/arrow/PopoverArrow.d.ts +10 -1
- package/popover/backdrop/PopoverBackdrop.d.ts +4 -1
- package/popover/close/PopoverClose.d.ts +1 -1
- package/popover/close/PopoverClose.js +5 -3
- package/popover/description/PopoverDescription.d.ts +1 -1
- package/popover/popup/PopoverPopup.d.ts +15 -3
- package/popover/popup/PopoverPopup.js +11 -2
- package/popover/portal/PopoverPortal.d.ts +3 -4
- package/popover/positioner/PopoverPositioner.d.ts +11 -2
- package/popover/root/PopoverRoot.d.ts +10 -3
- package/popover/root/PopoverRoot.js +1 -3
- package/popover/title/PopoverTitle.d.ts +1 -1
- package/popover/viewport/PopoverViewport.d.ts +16 -12
- package/preview-card/arrow/PreviewCardArrow.d.ts +10 -1
- package/preview-card/backdrop/PreviewCardBackdrop.d.ts +4 -1
- package/preview-card/popup/PreviewCardPopup.d.ts +13 -1
- package/preview-card/portal/PreviewCardPortal.d.ts +3 -4
- package/preview-card/positioner/PreviewCardPositioner.d.ts +14 -2
- package/preview-card/positioner/PreviewCardPositioner.js +7 -1
- package/preview-card/root/PreviewCardRoot.d.ts +3 -3
- package/preview-card/root/PreviewCardRoot.js +20 -7
- package/preview-card/trigger/PreviewCardTrigger.d.ts +1 -1
- package/preview-card/viewport/PreviewCardViewport.d.ts +16 -9
- package/progress/indicator/ProgressIndicator.d.ts +4 -2
- package/progress/label/ProgressLabel.d.ts +4 -2
- package/progress/label/ProgressLabel.js +4 -8
- package/progress/root/ProgressRoot.d.ts +4 -1
- package/progress/root/ProgressRoot.js +10 -1
- package/progress/root/ProgressRootContext.d.ts +2 -2
- package/progress/root/stateAttributesMapping.d.ts +2 -2
- package/progress/track/ProgressTrack.d.ts +4 -2
- package/progress/value/ProgressValue.d.ts +5 -3
- package/radio/indicator/RadioIndicator.d.ts +4 -1
- package/radio/indicator/RadioIndicatorDataAttributes.d.ts +8 -0
- package/radio/indicator/RadioIndicatorDataAttributes.js +10 -1
- package/radio/root/RadioRoot.d.ts +3 -3
- package/radio/root/RadioRoot.js +4 -1
- package/radio-group/RadioGroup.d.ts +3 -3
- package/scroll-area/content/ScrollAreaContent.d.ts +3 -3
- package/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/scroll-area/root/ScrollAreaRoot.d.ts +27 -11
- package/scroll-area/root/ScrollAreaRoot.js +7 -4
- package/scroll-area/root/ScrollAreaRootContext.d.ts +4 -2
- package/scroll-area/root/stateAttributes.d.ts +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +13 -7
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -1
- package/scroll-area/thumb/ScrollAreaThumb.d.ts +5 -2
- package/scroll-area/thumb/ScrollAreaThumb.js +3 -1
- package/scroll-area/viewport/ScrollAreaViewport.d.ts +3 -3
- package/scroll-area/viewport/ScrollAreaViewport.js +46 -27
- package/select/arrow/SelectArrow.d.ts +10 -1
- package/select/backdrop/SelectBackdrop.d.ts +7 -1
- package/select/group/SelectGroup.d.ts +1 -1
- package/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/select/icon/SelectIcon.d.ts +1 -1
- package/select/index.d.ts +1 -0
- package/select/index.parts.d.ts +1 -0
- package/select/index.parts.js +7 -0
- package/select/item/SelectItem.d.ts +1 -1
- package/select/item/SelectItem.js +10 -4
- package/select/item-indicator/SelectItemIndicator.d.ts +10 -2
- package/select/item-indicator/SelectItemIndicatorDataAttributes.d.ts +10 -0
- package/select/item-indicator/SelectItemIndicatorDataAttributes.js +18 -0
- package/select/item-text/SelectItemText.d.ts +1 -1
- package/select/label/SelectLabel.d.ts +16 -0
- package/select/label/SelectLabel.js +54 -0
- package/select/list/SelectList.d.ts +1 -1
- package/select/popup/SelectPopup.d.ts +14 -2
- package/select/popup/SelectPopup.js +26 -12
- package/select/portal/SelectPortal.d.ts +3 -4
- package/select/positioner/SelectPositioner.d.ts +14 -2
- package/select/positioner/SelectPositionerContext.d.ts +2 -2
- package/select/root/SelectRoot.d.ts +5 -4
- package/select/root/SelectRoot.js +5 -6
- package/select/scroll-arrow/SelectScrollArrow.d.ts +13 -1
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/select/store.d.ts +5 -2
- package/select/store.js +1 -0
- package/select/trigger/SelectTrigger.d.ts +6 -4
- package/select/trigger/SelectTrigger.js +5 -2
- package/select/value/SelectValue.d.ts +1 -1
- package/separator/Separator.d.ts +1 -1
- package/slider/control/SliderControl.d.ts +4 -3
- package/slider/control/SliderControl.js +0 -2
- package/slider/index.d.ts +1 -0
- package/slider/index.parts.d.ts +1 -0
- package/slider/index.parts.js +7 -0
- package/slider/indicator/SliderIndicator.d.ts +4 -2
- package/slider/label/SliderLabel.d.ts +16 -0
- package/slider/label/SliderLabel.js +63 -0
- package/slider/root/SliderRoot.d.ts +11 -5
- package/slider/root/SliderRoot.js +8 -3
- package/slider/root/SliderRootContext.d.ts +4 -2
- package/slider/root/stateAttributesMapping.d.ts +2 -2
- package/slider/thumb/SliderThumb.d.ts +5 -5
- package/slider/thumb/SliderThumb.js +3 -2
- package/slider/track/SliderTrack.d.ts +4 -2
- package/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/slider/value/SliderValue.d.ts +5 -3
- package/switch/root/SwitchRoot.d.ts +3 -3
- package/switch/root/SwitchRoot.js +4 -1
- package/switch/root/SwitchRootContext.d.ts +4 -4
- package/switch/stateAttributesMapping.d.ts +2 -2
- package/switch/thumb/SwitchThumb.d.ts +3 -3
- package/tabs/indicator/TabsIndicator.d.ts +12 -3
- package/tabs/indicator/TabsIndicator.js +5 -14
- package/tabs/indicator/TabsIndicatorCssVars.d.ts +1 -1
- package/tabs/indicator/TabsIndicatorCssVars.js +1 -1
- package/tabs/list/TabsList.d.ts +3 -3
- package/tabs/list/TabsList.js +48 -3
- package/tabs/list/TabsListContext.d.ts +2 -0
- package/tabs/panel/TabsPanel.d.ts +9 -3
- package/tabs/panel/TabsPanelDataAttributes.d.ts +8 -0
- package/tabs/panel/TabsPanelDataAttributes.js +10 -1
- package/tabs/root/TabsRoot.d.ts +7 -1
- package/tabs/root/TabsRootContext.d.ts +1 -1
- package/tabs/root/stateAttributesMapping.d.ts +2 -2
- package/tabs/tab/TabsTab.d.ts +7 -1
- package/tabs/tab/TabsTab.js +10 -1
- package/toast/action/ToastAction.d.ts +1 -1
- package/toast/arrow/ToastArrow.d.ts +10 -1
- package/toast/close/ToastClose.d.ts +1 -1
- package/toast/content/ToastContent.d.ts +1 -1
- package/toast/createToastManager.d.ts +1 -1
- package/toast/description/ToastDescription.d.ts +1 -1
- package/toast/portal/ToastPortal.d.ts +3 -4
- package/toast/positioner/ToastPositioner.d.ts +12 -3
- package/toast/provider/ToastProvider.d.ts +2 -0
- package/toast/provider/ToastProvider.js +1 -1
- package/toast/root/ToastRoot.d.ts +20 -7
- package/toast/root/ToastRoot.js +3 -1
- package/toast/store.d.ts +1 -1
- package/toast/store.js +37 -8
- package/toast/title/ToastTitle.d.ts +1 -1
- package/toast/useToastManager.d.ts +3 -3
- package/toast/viewport/ToastViewport.d.ts +1 -1
- package/toggle/Toggle.d.ts +1 -1
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toolbar/button/ToolbarButton.d.ts +9 -3
- package/toolbar/group/ToolbarGroup.d.ts +4 -2
- package/toolbar/input/ToolbarInput.d.ts +9 -3
- package/toolbar/link/ToolbarLink.d.ts +4 -1
- package/toolbar/root/ToolbarRoot.d.ts +7 -1
- package/toolbar/separator/ToolbarSeparator.d.ts +4 -2
- package/tooltip/arrow/TooltipArrow.d.ts +13 -1
- package/tooltip/popup/TooltipPopup.d.ts +13 -1
- package/tooltip/portal/TooltipPortal.d.ts +3 -4
- package/tooltip/positioner/TooltipPositioner.d.ts +11 -2
- package/tooltip/provider/TooltipProvider.d.ts +2 -0
- package/tooltip/root/TooltipRoot.d.ts +3 -3
- package/tooltip/root/TooltipRoot.js +1 -1
- package/tooltip/store/TooltipStore.d.ts +2 -0
- package/tooltip/store/TooltipStore.js +2 -0
- package/tooltip/trigger/TooltipTrigger.d.ts +6 -1
- package/tooltip/trigger/TooltipTrigger.js +5 -0
- package/tooltip/viewport/TooltipViewport.d.ts +16 -12
- package/types/index.d.ts +16 -1
- package/unstable-use-media-query/index.d.ts +2 -0
- package/use-button/useButton.d.ts +8 -5
- package/use-button/useButton.js +49 -20
- package/use-render/useRender.d.ts +7 -5
- package/utils/FloatingPortalLite.d.ts +4 -2
- package/utils/InternalBackdrop.d.ts +3 -1
- package/utils/closePart.d.ts +16 -0
- package/utils/closePart.js +48 -0
- package/utils/constants.d.ts +4 -0
- package/utils/constants.js +6 -2
- package/utils/createBaseUIEventDetails.d.ts +1 -1
- package/utils/getElementAtPoint.d.ts +1 -0
- package/utils/getElementAtPoint.js +9 -0
- package/utils/resolveAriaLabelledBy.d.ts +2 -0
- package/utils/resolveAriaLabelledBy.js +14 -0
- package/utils/resolveValueLabel.d.ts +4 -4
- package/utils/resolveValueLabel.js +7 -5
- package/utils/types.d.ts +7 -20
- package/utils/useAnchorPositioning.d.ts +53 -18
- package/utils/useAnchorPositioning.js +15 -6
- package/utils/useFocusableWhenDisabled.d.ts +2 -5
- package/utils/useMixedToggleClickHandler.d.ts +2 -4
- package/utils/useOpenChangeComplete.d.ts +2 -4
- package/utils/useOpenInteractionType.d.ts +0 -1
- package/utils/useOpenInteractionType.js +7 -5
- package/utils/usePopupAutoResize.js +1 -2
- package/utils/usePopupViewport.js +11 -8
- package/utils/useRegisteredLabelId.d.ts +1 -0
- package/utils/useRegisteredLabelId.js +19 -0
- package/utils/useRenderElement.d.ts +6 -9
- package/utils/useRenderElement.js +15 -0
- package/utils/useSwipeDismiss.d.ts +91 -92
- package/utils/useSwipeDismiss.js +2 -1
- package/esm/navigation-menu/utils/setFixedSize.d.ts +0 -1
- package/esm/navigation-menu/utils/setFixedSize.js +0 -11
- package/navigation-menu/utils/setFixedSize.d.ts +0 -1
- package/navigation-menu/utils/setFixedSize.js +0 -17
|
@@ -19,50 +19,65 @@ export type OffsetFunction = (data: {
|
|
|
19
19
|
interface SideFlipMode {
|
|
20
20
|
/**
|
|
21
21
|
* How to avoid collisions on the side axis.
|
|
22
|
+
* - `'flip'`: If there is not enough space, place the popup on the opposite side.
|
|
23
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
22
24
|
*/
|
|
23
|
-
side?:
|
|
25
|
+
side?: 'flip' | 'none' | undefined;
|
|
24
26
|
/**
|
|
25
27
|
* How to avoid collisions on the align axis.
|
|
28
|
+
* - `'flip'`: If there is not enough space, swap `'start'` and `'end'` alignment.
|
|
29
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
30
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
26
31
|
*/
|
|
27
|
-
align?:
|
|
32
|
+
align?: 'flip' | 'shift' | 'none' | undefined;
|
|
28
33
|
/**
|
|
29
34
|
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
30
35
|
* to a side on the perpendicular axis and which logical side to prefer.
|
|
36
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
37
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
38
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
31
39
|
*/
|
|
32
|
-
fallbackAxisSide?:
|
|
40
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
33
41
|
}
|
|
34
42
|
interface SideShiftMode {
|
|
35
43
|
/**
|
|
36
44
|
* How to avoid collisions on the side axis.
|
|
45
|
+
* - `'shift'`: Keep the preferred side and shift the popup to fit within the boundary.
|
|
46
|
+
* - `'none'`: Keep the preferred side even if it overflows.
|
|
37
47
|
*/
|
|
38
|
-
side?:
|
|
48
|
+
side?: 'shift' | 'none' | undefined;
|
|
39
49
|
/**
|
|
40
50
|
* How to avoid collisions on the align axis.
|
|
51
|
+
* - `'shift'`: Keep the alignment and shift the popup to fit within the boundary.
|
|
52
|
+
* - `'none'`: Keep the preferred alignment even if it overflows.
|
|
41
53
|
*/
|
|
42
|
-
align?:
|
|
54
|
+
align?: 'shift' | 'none' | undefined;
|
|
43
55
|
/**
|
|
44
56
|
* If both sides on the preferred axis do not fit, determines whether to fallback
|
|
45
57
|
* to a side on the perpendicular axis and which logical side to prefer.
|
|
58
|
+
* - `'start'`: Prefer the logical start side on the perpendicular axis.
|
|
59
|
+
* - `'end'`: Prefer the logical end side on the perpendicular axis.
|
|
60
|
+
* - `'none'`: Do not fallback to the perpendicular axis.
|
|
46
61
|
*/
|
|
47
|
-
fallbackAxisSide?:
|
|
62
|
+
fallbackAxisSide?: 'start' | 'end' | 'none' | undefined;
|
|
48
63
|
}
|
|
49
64
|
export type CollisionAvoidance = SideFlipMode | SideShiftMode;
|
|
50
65
|
/**
|
|
51
66
|
* Provides standardized anchor positioning behavior for floating elements. Wraps Floating UI's
|
|
52
67
|
* `useFloating` hook.
|
|
53
68
|
*/
|
|
54
|
-
export declare function useAnchorPositioning(params:
|
|
69
|
+
export declare function useAnchorPositioning(params: UseAnchorPositioningParameters): UseAnchorPositioningReturnValue;
|
|
55
70
|
export interface UseAnchorPositioningSharedParameters {
|
|
56
71
|
/**
|
|
57
72
|
* An element to position the popup against.
|
|
58
73
|
* By default, the popup will be positioned against the trigger.
|
|
59
74
|
*/
|
|
60
|
-
anchor?:
|
|
75
|
+
anchor?: Element | null | VirtualElement | React.RefObject<Element | null> | (() => Element | VirtualElement | null) | undefined;
|
|
61
76
|
/**
|
|
62
77
|
* Determines which CSS `position` property to use.
|
|
63
78
|
* @default 'absolute'
|
|
64
79
|
*/
|
|
65
|
-
positionMethod?:
|
|
80
|
+
positionMethod?: 'absolute' | 'fixed' | undefined;
|
|
66
81
|
/**
|
|
67
82
|
* Which side of the anchor element to align the popup against.
|
|
68
83
|
* May automatically change to avoid collisions.
|
|
@@ -93,7 +108,7 @@ export interface UseAnchorPositioningSharedParameters {
|
|
|
93
108
|
*
|
|
94
109
|
* @default 0
|
|
95
110
|
*/
|
|
96
|
-
sideOffset?:
|
|
111
|
+
sideOffset?: number | OffsetFunction | undefined;
|
|
97
112
|
/**
|
|
98
113
|
* How to align the popup relative to the specified side.
|
|
99
114
|
* @default 'center'
|
|
@@ -123,7 +138,7 @@ export interface UseAnchorPositioningSharedParameters {
|
|
|
123
138
|
*
|
|
124
139
|
* @default 0
|
|
125
140
|
*/
|
|
126
|
-
alignOffset?:
|
|
141
|
+
alignOffset?: number | OffsetFunction | undefined;
|
|
127
142
|
/**
|
|
128
143
|
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
129
144
|
* @default 'clipping-ancestors'
|
|
@@ -155,6 +170,30 @@ export interface UseAnchorPositioningSharedParameters {
|
|
|
155
170
|
/**
|
|
156
171
|
* Determines how to handle collisions when positioning the popup.
|
|
157
172
|
*
|
|
173
|
+
* `side` controls overflow on the preferred placement axis (`top`/`bottom` or `left`/`right`):
|
|
174
|
+
* - `'flip'`: keep the requested side when it fits; otherwise try the opposite side
|
|
175
|
+
* (`top` and `bottom`, or `left` and `right`).
|
|
176
|
+
* - `'shift'`: never change side; keep the requested side and move the popup within
|
|
177
|
+
* the clipping boundary so it stays visible.
|
|
178
|
+
* - `'none'`: do not correct side-axis overflow.
|
|
179
|
+
*
|
|
180
|
+
* `align` controls overflow on the alignment axis (`start`/`center`/`end`):
|
|
181
|
+
* - `'flip'`: keep side, but swap `start` and `end` when the requested alignment overflows.
|
|
182
|
+
* - `'shift'`: keep side and requested alignment, then nudge the popup along the
|
|
183
|
+
* alignment axis to fit.
|
|
184
|
+
* - `'none'`: do not correct alignment-axis overflow.
|
|
185
|
+
*
|
|
186
|
+
* `fallbackAxisSide` controls fallback behavior on the perpendicular axis when the
|
|
187
|
+
* preferred axis cannot fit:
|
|
188
|
+
* - `'start'`: allow perpendicular fallback and try the logical start side first
|
|
189
|
+
* (`top` before `bottom`, or `left` before `right` in LTR).
|
|
190
|
+
* - `'end'`: allow perpendicular fallback and try the logical end side first
|
|
191
|
+
* (`bottom` before `top`, or `right` before `left` in LTR).
|
|
192
|
+
* - `'none'`: do not fallback to the perpendicular axis.
|
|
193
|
+
*
|
|
194
|
+
* When `side` is `'shift'`, explicitly setting `align` only supports `'shift'` or `'none'`.
|
|
195
|
+
* If `align` is omitted, it defaults to `'flip'`.
|
|
196
|
+
*
|
|
158
197
|
* @example
|
|
159
198
|
* ```jsx
|
|
160
199
|
* <Positioner
|
|
@@ -169,9 +208,9 @@ export interface UseAnchorPositioningSharedParameters {
|
|
|
169
208
|
*/
|
|
170
209
|
collisionAvoidance?: CollisionAvoidance | undefined;
|
|
171
210
|
}
|
|
172
|
-
export interface UseAnchorPositioningParameters extends
|
|
211
|
+
export interface UseAnchorPositioningParameters extends UseAnchorPositioningSharedParameters {
|
|
173
212
|
keepMounted?: boolean | undefined;
|
|
174
|
-
trackCursorAxis?:
|
|
213
|
+
trackCursorAxis?: 'none' | 'x' | 'y' | 'both' | undefined;
|
|
175
214
|
floatingRootContext?: FloatingRootContext | undefined;
|
|
176
215
|
mounted: boolean;
|
|
177
216
|
disableAnchorTracking: boolean;
|
|
@@ -196,9 +235,5 @@ export interface UseAnchorPositioningReturnValue {
|
|
|
196
235
|
isPositioned: boolean;
|
|
197
236
|
update: () => void;
|
|
198
237
|
}
|
|
199
|
-
export
|
|
200
|
-
type SharedParameters = UseAnchorPositioningSharedParameters;
|
|
201
|
-
type Parameters = UseAnchorPositioningParameters;
|
|
202
|
-
type ReturnValue = UseAnchorPositioningReturnValue;
|
|
203
|
-
}
|
|
238
|
+
export interface UseAnchorPositioningState {}
|
|
204
239
|
export {};
|
|
@@ -202,17 +202,26 @@ export function useAnchorPositioning(params) {
|
|
|
202
202
|
elements: {
|
|
203
203
|
floating
|
|
204
204
|
},
|
|
205
|
-
rects: {
|
|
206
|
-
reference
|
|
207
|
-
},
|
|
208
205
|
availableWidth,
|
|
209
|
-
availableHeight
|
|
206
|
+
availableHeight,
|
|
207
|
+
rects
|
|
210
208
|
}) {
|
|
211
209
|
const floatingStyle = floating.style;
|
|
212
210
|
floatingStyle.setProperty('--available-width', `${availableWidth}px`);
|
|
213
211
|
floatingStyle.setProperty('--available-height', `${availableHeight}px`);
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
|
|
213
|
+
// Snap anchor dimensions to device pixels to ensure the popup's visual width matches the anchor's one.
|
|
214
|
+
const dpr = window.devicePixelRatio || 1;
|
|
215
|
+
const {
|
|
216
|
+
x,
|
|
217
|
+
y,
|
|
218
|
+
width,
|
|
219
|
+
height
|
|
220
|
+
} = rects.reference;
|
|
221
|
+
const anchorWidth = (Math.round((x + width) * dpr) - Math.round(x * dpr)) / dpr;
|
|
222
|
+
const anchorHeight = (Math.round((y + height) * dpr) - Math.round(y * dpr)) / dpr;
|
|
223
|
+
floatingStyle.setProperty('--anchor-width', `${anchorWidth}px`);
|
|
224
|
+
floatingStyle.setProperty('--anchor-height', `${anchorHeight}px`);
|
|
216
225
|
}
|
|
217
226
|
}), arrow(() => ({
|
|
218
227
|
// `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare function useFocusableWhenDisabled(parameters:
|
|
2
|
+
export declare function useFocusableWhenDisabled(parameters: UseFocusableWhenDisabledParameters): UseFocusableWhenDisabledReturnValue;
|
|
3
3
|
interface FocusableWhenDisabledProps {
|
|
4
4
|
'aria-disabled'?: boolean | undefined;
|
|
5
5
|
disabled?: boolean | undefined;
|
|
@@ -33,8 +33,5 @@ export interface UseFocusableWhenDisabledParameters {
|
|
|
33
33
|
export interface UseFocusableWhenDisabledReturnValue {
|
|
34
34
|
props: FocusableWhenDisabledProps;
|
|
35
35
|
}
|
|
36
|
-
export
|
|
37
|
-
type Parameters = UseFocusableWhenDisabledParameters;
|
|
38
|
-
type ReturnValue = UseFocusableWhenDisabledReturnValue;
|
|
39
|
-
}
|
|
36
|
+
export interface UseFocusableWhenDisabledState {}
|
|
40
37
|
export {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* For example, a button that opens a popup on mousedown and closes it on click.
|
|
4
4
|
* This hook prevents the popup from closing immediately after the mouse button is released.
|
|
5
5
|
*/
|
|
6
|
-
export declare function useMixedToggleClickHandler(params:
|
|
6
|
+
export declare function useMixedToggleClickHandler(params: UseMixedToggleClickHandlerParameters): Readonly<{}>;
|
|
7
7
|
export interface UseMixedToggleClickHandlerParameters {
|
|
8
8
|
/**
|
|
9
9
|
* Whether the mixed toggle click handler is enabled.
|
|
@@ -19,6 +19,4 @@ export interface UseMixedToggleClickHandlerParameters {
|
|
|
19
19
|
*/
|
|
20
20
|
open: boolean;
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
type Parameters = UseMixedToggleClickHandlerParameters;
|
|
24
|
-
}
|
|
22
|
+
export interface UseMixedToggleClickHandlerState {}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
/**
|
|
3
3
|
* Calls the provided function when the CSS open/close animation or transition completes.
|
|
4
4
|
*/
|
|
5
|
-
export declare function useOpenChangeComplete(parameters:
|
|
5
|
+
export declare function useOpenChangeComplete(parameters: UseOpenChangeCompleteParameters): void;
|
|
6
6
|
export interface UseOpenChangeCompleteParameters {
|
|
7
7
|
/**
|
|
8
8
|
* Whether the hook is enabled.
|
|
@@ -22,6 +22,4 @@ export interface UseOpenChangeCompleteParameters {
|
|
|
22
22
|
*/
|
|
23
23
|
onComplete: () => void;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
type Parameters = UseOpenChangeCompleteParameters;
|
|
27
|
-
}
|
|
25
|
+
export interface UseOpenChangeCompleteState {}
|
|
@@ -7,7 +7,6 @@ import { InteractionType } from '@base-ui/utils/useEnhancedClickHandler';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function useOpenInteractionType(open: boolean): {
|
|
9
9
|
openMethod: InteractionType | null;
|
|
10
|
-
reset: () => void;
|
|
11
10
|
triggerProps: {
|
|
12
11
|
onClick: (event: React.MouseEvent | React.PointerEvent) => void;
|
|
13
12
|
onPointerDown: (event: React.PointerEvent) => void;
|
|
@@ -4,6 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
5
5
|
import { useEnhancedClickHandler } from '@base-ui/utils/useEnhancedClickHandler';
|
|
6
6
|
import { isIOS } from '@base-ui/utils/detectBrowser';
|
|
7
|
+
import { useValueChanged } from "./useValueChanged.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
|
|
@@ -21,19 +22,20 @@ export function useOpenInteractionType(open) {
|
|
|
21
22
|
isIOS ? 'touch' : ''));
|
|
22
23
|
}
|
|
23
24
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
useValueChanged(open, previousOpen => {
|
|
26
|
+
if (previousOpen && !open) {
|
|
27
|
+
setOpenMethod(null);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
27
30
|
const {
|
|
28
31
|
onClick,
|
|
29
32
|
onPointerDown
|
|
30
33
|
} = useEnhancedClickHandler(handleTriggerClick);
|
|
31
34
|
return React.useMemo(() => ({
|
|
32
35
|
openMethod,
|
|
33
|
-
reset,
|
|
34
36
|
triggerProps: {
|
|
35
37
|
onClick,
|
|
36
38
|
onPointerDown
|
|
37
39
|
}
|
|
38
|
-
}), [openMethod,
|
|
40
|
+
}), [openMethod, onClick, onPointerDown]);
|
|
39
41
|
}
|
|
@@ -8,7 +8,6 @@ import { NOOP } from '@base-ui/utils/empty';
|
|
|
8
8
|
import { useAnimationsFinished } from "./useAnimationsFinished.js";
|
|
9
9
|
import { getCssDimensions } from "./getCssDimensions.js";
|
|
10
10
|
import { EMPTY_OBJECT } from "./constants.js";
|
|
11
|
-
const supportsResizeObserver = typeof ResizeObserver !== 'undefined';
|
|
12
11
|
const DEFAULT_ENABLED = () => true;
|
|
13
12
|
|
|
14
13
|
/**
|
|
@@ -53,7 +52,7 @@ export function usePopupAutoResize(parameters) {
|
|
|
53
52
|
}, [side, direction]);
|
|
54
53
|
useIsoLayoutEffect(() => {
|
|
55
54
|
// Reset the state when the popup is closed.
|
|
56
|
-
if (!mounted || !enabled() ||
|
|
55
|
+
if (!mounted || !enabled() || typeof ResizeObserver !== 'function') {
|
|
57
56
|
restoreAnchoringStylesRef.current = NOOP;
|
|
58
57
|
isInitialRenderRef.current = true;
|
|
59
58
|
committedDimensionsRef.current = null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
|
+
import * as ReactDOM from 'react-dom';
|
|
4
5
|
import { inertValue } from '@base-ui/utils/inertValue';
|
|
5
6
|
import { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';
|
|
6
7
|
import { usePreviousValue } from '@base-ui/utils/usePreviousValue';
|
|
@@ -74,13 +75,13 @@ export function usePopupViewport(parameters) {
|
|
|
74
75
|
const offset = calculateRelativePosition(previousActiveTrigger, activeTrigger);
|
|
75
76
|
setNewTriggerOffset(offset);
|
|
76
77
|
cleanupFrame.request(() => {
|
|
77
|
-
|
|
78
|
+
ReactDOM.flushSync(() => {
|
|
78
79
|
setShowStartingStyleAttribute(false);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
});
|
|
81
|
+
onAnimationsFinished(() => {
|
|
82
|
+
setPreviousContentNode(null);
|
|
83
|
+
setPreviousContentDimensions(null);
|
|
84
|
+
capturedNodeRef.current = null;
|
|
84
85
|
});
|
|
85
86
|
});
|
|
86
87
|
lastHandledTriggerRef.current = activeTrigger;
|
|
@@ -121,8 +122,10 @@ export function usePopupViewport(parameters) {
|
|
|
121
122
|
inert: inertValue(true),
|
|
122
123
|
ref: previousContainerRef,
|
|
123
124
|
style: {
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
...(previousContentDimensions ? {
|
|
126
|
+
[cssVars.popupWidth]: `${previousContentDimensions.width}px`,
|
|
127
|
+
[cssVars.popupHeight]: `${previousContentDimensions.height}px`
|
|
128
|
+
} : null),
|
|
126
129
|
position: 'absolute'
|
|
127
130
|
},
|
|
128
131
|
"data-ending-style": showStartingStyleAttribute ? undefined : ''
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useRegisteredLabelId(idProp: string | undefined, setLabelId: (id: string | undefined) => void): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
4
|
+
import { useBaseUiId } from "./useBaseUiId.js";
|
|
5
|
+
export function useRegisteredLabelId(idProp, setLabelId) {
|
|
6
|
+
const id = useBaseUiId(idProp);
|
|
7
|
+
useIsoLayoutEffect(() => {
|
|
8
|
+
setLabelId(id);
|
|
9
|
+
return () => {
|
|
10
|
+
setLabelId(undefined);
|
|
11
|
+
};
|
|
12
|
+
}, [id, setLabelId]);
|
|
13
|
+
return id;
|
|
14
|
+
}
|
|
@@ -9,7 +9,7 @@ type IntrinsicTagName = keyof React.JSX.IntrinsicElements;
|
|
|
9
9
|
* @param componentProps An object containing the `render` and `className` props to be used for element customization. Other props are ignored.
|
|
10
10
|
* @param params Additional parameters for rendering the element.
|
|
11
11
|
*/
|
|
12
|
-
export declare function useRenderElement<State extends Record<string, any>, RenderedElementType extends Element, TagName extends IntrinsicTagName | undefined, Enabled extends boolean | undefined = undefined>(element: TagName, componentProps:
|
|
12
|
+
export declare function useRenderElement<State extends Record<string, any>, RenderedElementType extends Element, TagName extends IntrinsicTagName | undefined, Enabled extends boolean | undefined = undefined>(element: TagName, componentProps: UseRenderElementComponentProps<State>, params?: UseRenderElementParameters<State, RenderedElementType, TagName, Enabled>): Enabled extends false ? null : React.ReactElement;
|
|
13
13
|
type RenderFunctionProps<TagName> = TagName extends keyof React.JSX.IntrinsicElements ? React.JSX.IntrinsicElements[TagName] : React.HTMLAttributes<any>;
|
|
14
14
|
export type UseRenderElementParameters<State, RenderedElementType extends Element, TagName, Enabled extends boolean | undefined> = {
|
|
15
15
|
/**
|
|
@@ -25,7 +25,7 @@ export type UseRenderElementParameters<State, RenderedElementType extends Elemen
|
|
|
25
25
|
/**
|
|
26
26
|
* The ref to apply to the rendered element.
|
|
27
27
|
*/
|
|
28
|
-
ref?:
|
|
28
|
+
ref?: React.Ref<RenderedElementType> | (React.Ref<RenderedElementType> | undefined)[] | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* The state of the component.
|
|
31
31
|
*/
|
|
@@ -33,7 +33,7 @@ export type UseRenderElementParameters<State, RenderedElementType extends Elemen
|
|
|
33
33
|
/**
|
|
34
34
|
* Intrinsic props to be spread on the rendered element.
|
|
35
35
|
*/
|
|
36
|
-
props?:
|
|
36
|
+
props?: RenderFunctionProps<TagName> | Array<RenderFunctionProps<TagName> | undefined | ((props: RenderFunctionProps<TagName>) => RenderFunctionProps<TagName>)> | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* A mapping of state to `data-*` attributes.
|
|
39
39
|
*/
|
|
@@ -44,7 +44,7 @@ export interface UseRenderElementComponentProps<State> {
|
|
|
44
44
|
* The class name to apply to the rendered element.
|
|
45
45
|
* Can be a string or a function that accepts the state and returns a string.
|
|
46
46
|
*/
|
|
47
|
-
className?:
|
|
47
|
+
className?: string | ((state: State) => string | undefined) | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* The render prop or React element to override the default element.
|
|
50
50
|
*/
|
|
@@ -53,10 +53,7 @@ export interface UseRenderElementComponentProps<State> {
|
|
|
53
53
|
* The style to apply to the rendered element.
|
|
54
54
|
* Can be a style object or a function that accepts the state and returns a style object.
|
|
55
55
|
*/
|
|
56
|
-
style?:
|
|
57
|
-
}
|
|
58
|
-
export declare namespace useRenderElement {
|
|
59
|
-
type Parameters<State, RenderedElementType extends Element, TagName, Enabled extends boolean | undefined> = UseRenderElementParameters<State, RenderedElementType, TagName, Enabled>;
|
|
60
|
-
type ComponentProps<State> = UseRenderElementComponentProps<State>;
|
|
56
|
+
style?: React.CSSProperties | ((state: State) => React.CSSProperties | undefined) | undefined;
|
|
61
57
|
}
|
|
58
|
+
export interface UseRenderElementState {}
|
|
62
59
|
export {};
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useMergedRefs, useMergedRefsN } from '@base-ui/utils/useMergedRefs';
|
|
4
4
|
import { getReactElementRef } from '@base-ui/utils/getReactElementRef';
|
|
5
5
|
import { mergeObjects } from '@base-ui/utils/mergeObjects';
|
|
6
|
+
import { warn } from '@base-ui/utils/warn';
|
|
6
7
|
import { getStateAttributesProps } from "./getStateAttributesProps.js";
|
|
7
8
|
import { resolveClassName } from "./resolveClassName.js";
|
|
8
9
|
import { resolveStyle } from "./resolveStyle.js";
|
|
@@ -82,6 +83,9 @@ const REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
|
82
83
|
function evaluateRenderProp(element, render, props, state) {
|
|
83
84
|
if (render) {
|
|
84
85
|
if (typeof render === 'function') {
|
|
86
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
87
|
+
warnIfRenderPropLooksLikeComponent(render);
|
|
88
|
+
}
|
|
85
89
|
return render(props, state);
|
|
86
90
|
}
|
|
87
91
|
const mergedProps = mergeProps(props, render.props);
|
|
@@ -118,6 +122,17 @@ function evaluateRenderProp(element, render, props, state) {
|
|
|
118
122
|
// to annotate it correctly.
|
|
119
123
|
throw new Error(process.env.NODE_ENV !== "production" ? 'Base UI: Render element or function are not defined.' : _formatErrorMessage(8));
|
|
120
124
|
}
|
|
125
|
+
function warnIfRenderPropLooksLikeComponent(renderFn) {
|
|
126
|
+
const functionName = renderFn.name;
|
|
127
|
+
if (functionName.length === 0) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const firstCharacterCode = functionName.charCodeAt(0);
|
|
131
|
+
if (firstCharacterCode < 65 || firstCharacterCode > 90) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, 'This usually means a React component was passed directly as `render={Component}`.', 'Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.', 'If this is an intentional render callback, rename it to start with a lowercase letter.', 'Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.', 'https://base-ui.com/r/invalid-render-prop');
|
|
135
|
+
}
|
|
121
136
|
function renderTag(Tag, props) {
|
|
122
137
|
if (Tag === 'button') {
|
|
123
138
|
return /*#__PURE__*/_createElement("button", {
|
|
@@ -11,98 +11,97 @@ export declare function getElementTransform(element: HTMLElement): {
|
|
|
11
11
|
y: number;
|
|
12
12
|
scale: number;
|
|
13
13
|
};
|
|
14
|
-
export declare function useSwipeDismiss(options:
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export declare function useSwipeDismiss(options: UseSwipeDismissOptions): UseSwipeDismissReturnValue;
|
|
15
|
+
export interface UseSwipeDismissState {}
|
|
16
|
+
export interface UseSwipeDismissDetails {
|
|
17
|
+
nativeEvent: PointerEvent | TouchEvent;
|
|
18
|
+
direction: SwipeDirection | undefined;
|
|
19
|
+
}
|
|
20
|
+
export type UseSwipeDismissProgressDetails = SwipeProgressDetailsInternal;
|
|
21
|
+
export interface UseSwipeDismissOptions {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
directions: SwipeDirection[];
|
|
24
|
+
elementRef: React.RefObject<HTMLElement | null>;
|
|
25
|
+
movementCssVars: {
|
|
26
|
+
x: string;
|
|
27
|
+
y: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The minimum distance (in pixels) the pointer must travel from the initial swipe point
|
|
31
|
+
* before the gesture is considered a dismiss.
|
|
32
|
+
* @default 40
|
|
33
|
+
*/
|
|
34
|
+
swipeThreshold?: number | ((details: {
|
|
35
|
+
element: HTMLElement;
|
|
36
|
+
direction: SwipeDirection;
|
|
37
|
+
}) => number) | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* If provided, swiping will only begin once this returns true.
|
|
40
|
+
* The predicate is evaluated on start and on subsequent move events while the pointer is down.
|
|
41
|
+
*/
|
|
42
|
+
canStart?: ((position: {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}, details: UseSwipeDismissDetails) => boolean) | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* If true, swiping won't start when the gesture begins within a scrollable element.
|
|
48
|
+
* This helps avoid conflicts between scrolling content and swipe-to-dismiss.
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
ignoreScrollableAncestors?: boolean | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* If false, touch interactions can start swiping on interactive elements
|
|
54
|
+
* that are ignored during pointer swipes.
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
ignoreSelectorWhenTouch?: boolean | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Whether to update drag offsets in React state on every move.
|
|
60
|
+
* Disable for event-only usage to avoid re-renders.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
trackDrag?: boolean | undefined;
|
|
64
|
+
onSwipeStart?: ((event: PointerEvent | TouchEvent) => void) | undefined;
|
|
65
|
+
onProgress?: ((progress: number, details?: UseSwipeDismissProgressDetails) => void) | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Called when the swipe interaction starts or ends.
|
|
68
|
+
*/
|
|
69
|
+
onSwipingChange?: ((swiping: boolean) => void) | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Called when the swipe interaction ends. Returning `true` or `false`
|
|
72
|
+
* overrides the default dismissal behavior.
|
|
73
|
+
*/
|
|
74
|
+
onRelease?: ((details: {
|
|
75
|
+
event: PointerEvent | TouchEvent;
|
|
18
76
|
direction: SwipeDirection | undefined;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
* This helps avoid conflicts between scrolling content and swipe-to-dismiss.
|
|
49
|
-
* @default false
|
|
50
|
-
*/
|
|
51
|
-
ignoreScrollableAncestors?: boolean | undefined;
|
|
52
|
-
/**
|
|
53
|
-
* If false, touch interactions can start swiping on interactive elements
|
|
54
|
-
* that are ignored during pointer swipes.
|
|
55
|
-
* @default true
|
|
56
|
-
*/
|
|
57
|
-
ignoreSelectorWhenTouch?: boolean | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* Whether to update drag offsets in React state on every move.
|
|
60
|
-
* Disable for event-only usage to avoid re-renders.
|
|
61
|
-
* @default true
|
|
62
|
-
*/
|
|
63
|
-
trackDrag?: boolean | undefined;
|
|
64
|
-
onSwipeStart?: ((event: PointerEvent | TouchEvent) => void) | undefined;
|
|
65
|
-
onProgress?: ((progress: number, details?: SwipeProgressDetailsInternal) => void) | undefined;
|
|
66
|
-
/**
|
|
67
|
-
* Called when the swipe interaction starts or ends.
|
|
68
|
-
*/
|
|
69
|
-
onSwipingChange?: ((swiping: boolean) => void) | undefined;
|
|
70
|
-
/**
|
|
71
|
-
* Called when the swipe interaction ends. Returning `true` or `false`
|
|
72
|
-
* overrides the default dismissal behavior.
|
|
73
|
-
*/
|
|
74
|
-
onRelease?: ((details: {
|
|
75
|
-
event: PointerEvent | TouchEvent;
|
|
76
|
-
direction: SwipeDirection | undefined;
|
|
77
|
-
deltaX: number;
|
|
78
|
-
deltaY: number;
|
|
79
|
-
velocityX: number;
|
|
80
|
-
velocityY: number;
|
|
81
|
-
releaseVelocityX: number;
|
|
82
|
-
releaseVelocityY: number;
|
|
83
|
-
}) => boolean | void) | undefined;
|
|
84
|
-
onDismiss?: ((event: PointerEvent | TouchEvent, details: {
|
|
85
|
-
direction: SwipeDirection;
|
|
86
|
-
}) => void) | undefined;
|
|
87
|
-
}
|
|
88
|
-
interface ReturnValue {
|
|
89
|
-
swiping: boolean;
|
|
90
|
-
swipeDirection: SwipeDirection | undefined;
|
|
91
|
-
dragDismissed: boolean;
|
|
92
|
-
getPointerProps: () => {
|
|
93
|
-
onPointerDown?: ((event: React.PointerEvent) => void) | undefined;
|
|
94
|
-
onPointerMove?: ((event: React.PointerEvent) => void) | undefined;
|
|
95
|
-
onPointerUp?: ((event: React.PointerEvent) => void) | undefined;
|
|
96
|
-
onPointerCancel?: ((event: React.PointerEvent) => void) | undefined;
|
|
97
|
-
};
|
|
98
|
-
getTouchProps: () => {
|
|
99
|
-
onTouchStart?: ((event: React.TouchEvent) => void) | undefined;
|
|
100
|
-
onTouchMove?: ((event: React.TouchEvent) => void) | undefined;
|
|
101
|
-
onTouchEnd?: ((event: React.TouchEvent) => void) | undefined;
|
|
102
|
-
onTouchCancel?: ((event: React.TouchEvent) => void) | undefined;
|
|
103
|
-
};
|
|
104
|
-
getDragStyles: () => React.CSSProperties;
|
|
105
|
-
reset: () => void;
|
|
106
|
-
}
|
|
77
|
+
deltaX: number;
|
|
78
|
+
deltaY: number;
|
|
79
|
+
velocityX: number;
|
|
80
|
+
velocityY: number;
|
|
81
|
+
releaseVelocityX: number;
|
|
82
|
+
releaseVelocityY: number;
|
|
83
|
+
}) => boolean | void) | undefined;
|
|
84
|
+
onDismiss?: ((event: PointerEvent | TouchEvent, details: {
|
|
85
|
+
direction: SwipeDirection;
|
|
86
|
+
}) => void) | undefined;
|
|
87
|
+
}
|
|
88
|
+
export interface UseSwipeDismissReturnValue {
|
|
89
|
+
swiping: boolean;
|
|
90
|
+
swipeDirection: SwipeDirection | undefined;
|
|
91
|
+
dragDismissed: boolean;
|
|
92
|
+
getPointerProps: () => {
|
|
93
|
+
onPointerDown?: ((event: React.PointerEvent) => void) | undefined;
|
|
94
|
+
onPointerMove?: ((event: React.PointerEvent) => void) | undefined;
|
|
95
|
+
onPointerUp?: ((event: React.PointerEvent) => void) | undefined;
|
|
96
|
+
onPointerCancel?: ((event: React.PointerEvent) => void) | undefined;
|
|
97
|
+
};
|
|
98
|
+
getTouchProps: () => {
|
|
99
|
+
onTouchStart?: ((event: React.TouchEvent) => void) | undefined;
|
|
100
|
+
onTouchMove?: ((event: React.TouchEvent) => void) | undefined;
|
|
101
|
+
onTouchEnd?: ((event: React.TouchEvent) => void) | undefined;
|
|
102
|
+
onTouchCancel?: ((event: React.TouchEvent) => void) | undefined;
|
|
103
|
+
};
|
|
104
|
+
getDragStyles: () => React.CSSProperties;
|
|
105
|
+
reset: () => void;
|
|
107
106
|
}
|
|
108
107
|
export {};
|
|
@@ -6,6 +6,7 @@ import { ownerDocument } from '@base-ui/utils/owner';
|
|
|
6
6
|
import { contains, getTarget } from "../floating-ui-react/utils.js";
|
|
7
7
|
import { findScrollableTouchTarget, hasScrollableAncestor } from "./scrollable.js";
|
|
8
8
|
import { clamp } from "./clamp.js";
|
|
9
|
+
import { getElementAtPoint } from "./getElementAtPoint.js";
|
|
9
10
|
const DEFAULT_SWIPE_THRESHOLD = 40;
|
|
10
11
|
const REVERSE_CANCEL_THRESHOLD = 10;
|
|
11
12
|
const MIN_DRAG_THRESHOLD = 1;
|
|
@@ -308,7 +309,7 @@ export function useSwipeDismiss(options) {
|
|
|
308
309
|
}
|
|
309
310
|
function getTargetAtPoint(position, nativeEvent) {
|
|
310
311
|
const doc = ownerDocument(elementRef.current);
|
|
311
|
-
const elementAtPoint =
|
|
312
|
+
const elementAtPoint = getElementAtPoint(doc, position.x, position.y);
|
|
312
313
|
const target = elementAtPoint ?? getTarget(nativeEvent);
|
|
313
314
|
return target;
|
|
314
315
|
}
|