@base-ui/react 1.1.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 +321 -1
- package/accordion/header/AccordionHeader.d.ts +4 -2
- package/accordion/item/AccordionItem.d.ts +11 -5
- package/accordion/item/AccordionItemContext.d.ts +3 -3
- package/accordion/item/stateAttributesMapping.d.ts +2 -2
- package/accordion/panel/AccordionPanel.d.ts +6 -3
- package/accordion/root/AccordionRoot.d.ts +25 -16
- 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 +5 -3
- package/alert-dialog/root/AlertDialogRoot.js +6 -4
- package/autocomplete/index.d.ts +1 -0
- package/autocomplete/index.parts.d.ts +3 -1
- package/autocomplete/index.parts.js +15 -1
- package/autocomplete/root/AutocompleteRoot.d.ts +21 -16
- package/autocomplete/root/AutocompleteRoot.js +8 -7
- package/avatar/fallback/AvatarFallback.d.ts +5 -3
- package/avatar/fallback/AvatarFallback.js +2 -2
- package/avatar/image/AvatarImage.d.ts +11 -3
- package/avatar/image/AvatarImage.js +34 -6
- package/avatar/image/AvatarImageDataAttributes.d.ts +10 -0
- package/avatar/image/AvatarImageDataAttributes.js +18 -0
- package/avatar/image/useImageLoadingStatus.d.ts +2 -2
- package/avatar/root/AvatarRoot.d.ts +4 -1
- 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 +7 -4
- package/checkbox/indicator/CheckboxIndicator.js +4 -4
- package/checkbox/root/CheckboxRoot.d.ts +16 -16
- package/checkbox/root/CheckboxRoot.js +35 -9
- package/checkbox/root/CheckboxRootContext.d.ts +4 -4
- package/checkbox/utils/useStateAttributesMapping.d.ts +2 -2
- package/checkbox-group/CheckboxGroup.d.ts +8 -8
- package/checkbox-group/CheckboxGroup.js +2 -2
- package/checkbox-group/CheckboxGroupContext.d.ts +2 -2
- package/checkbox-group/useCheckboxGroupParent.d.ts +5 -8
- package/collapsible/panel/CollapsiblePanel.d.ts +8 -5
- package/collapsible/panel/useCollapsiblePanel.d.ts +2 -5
- package/collapsible/root/CollapsibleRoot.d.ts +7 -7
- package/collapsible/root/CollapsibleRootContext.d.ts +4 -4
- package/collapsible/root/stateAttributesMapping.d.ts +2 -2
- package/collapsible/root/useCollapsibleRoot.d.ts +4 -7
- package/collapsible/trigger/CollapsibleTrigger.d.ts +4 -2
- package/combobox/arrow/ComboboxArrow.d.ts +10 -1
- package/combobox/arrow/ComboboxArrow.js +2 -2
- package/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
- package/combobox/backdrop/ComboboxBackdrop.d.ts +4 -1
- package/combobox/backdrop/ComboboxBackdrop.js +2 -2
- package/combobox/chip/ComboboxChip.d.ts +1 -1
- package/combobox/chip/ComboboxChip.js +6 -3
- package/combobox/chip/ComboboxChipContext.js +1 -0
- package/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.js +28 -33
- package/combobox/chips/ComboboxChips.d.ts +1 -1
- package/combobox/chips/ComboboxChipsContext.js +1 -0
- package/combobox/clear/ComboboxClear.d.ts +6 -3
- package/combobox/clear/ComboboxClear.js +2 -3
- package/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/combobox/group/ComboboxGroup.d.ts +2 -2
- package/combobox/group/ComboboxGroupContext.d.ts +1 -1
- package/combobox/group/ComboboxGroupContext.js +1 -0
- package/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/combobox/icon/ComboboxIcon.d.ts +2 -2
- package/combobox/index.d.ts +2 -0
- package/combobox/index.parts.d.ts +4 -1
- package/combobox/index.parts.js +22 -1
- package/combobox/input/ComboboxInput.d.ts +4 -4
- package/combobox/input/ComboboxInput.js +60 -13
- 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 +4 -4
- package/combobox/item/ComboboxItem.js +17 -16
- package/combobox/item/ComboboxItemContext.js +1 -0
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +8 -2
- package/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
- 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/list/ComboboxList.js +2 -2
- package/combobox/popup/ComboboxPopup.d.ts +21 -3
- package/combobox/popup/ComboboxPopup.js +11 -4
- package/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
- package/combobox/portal/ComboboxPortal.d.ts +4 -5
- package/combobox/portal/ComboboxPortalContext.js +1 -0
- package/combobox/positioner/ComboboxPositioner.d.ts +14 -2
- package/combobox/positioner/ComboboxPositioner.js +8 -5
- package/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
- package/combobox/root/AriaCombobox.d.ts +52 -46
- package/combobox/root/AriaCombobox.js +58 -68
- package/combobox/root/ComboboxRoot.d.ts +21 -16
- 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/ComboboxRow.d.ts +1 -1
- package/combobox/row/ComboboxRowContext.js +1 -0
- package/combobox/status/ComboboxStatus.d.ts +1 -1
- package/combobox/store.d.ts +18 -12
- package/combobox/store.js +5 -3
- package/combobox/trigger/ComboboxTrigger.d.ts +4 -4
- package/combobox/trigger/ComboboxTrigger.js +8 -6
- package/combobox/utils/ComboboxInternalDismissButton.d.ts +5 -0
- package/combobox/utils/ComboboxInternalDismissButton.js +44 -0
- package/composite/item/CompositeItem.d.ts +9 -7
- package/composite/list/CompositeList.d.ts +5 -3
- package/composite/list/CompositeListContext.d.ts +1 -1
- package/composite/list/useCompositeListItem.d.ts +5 -5
- package/composite/root/CompositeRoot.d.ts +22 -20
- 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.d.ts +3 -3
- 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 +5 -2
- package/dialog/backdrop/DialogBackdrop.js +2 -2
- package/dialog/close/DialogClose.d.ts +1 -1
- package/dialog/close/DialogClose.js +2 -2
- package/dialog/description/DialogDescription.d.ts +1 -1
- package/dialog/popup/DialogPopup.d.ts +6 -3
- package/dialog/popup/DialogPopup.js +2 -2
- package/dialog/portal/DialogPortal.d.ts +5 -6
- package/dialog/portal/DialogPortalContext.js +1 -0
- package/dialog/root/DialogRoot.d.ts +15 -10
- package/dialog/root/DialogRoot.js +17 -4
- package/dialog/root/useDialogRoot.d.ts +5 -9
- package/dialog/root/useDialogRoot.js +6 -5
- package/dialog/store/DialogStore.d.ts +258 -17
- package/dialog/store/DialogStore.js +3 -0
- package/dialog/title/DialogTitle.d.ts +1 -1
- package/dialog/trigger/DialogTrigger.d.ts +4 -4
- package/dialog/trigger/DialogTrigger.js +3 -3
- package/dialog/viewport/DialogViewport.d.ts +3 -0
- package/dialog/viewport/DialogViewport.js +5 -2
- package/direction-provider/DirectionProvider.d.ts +3 -1
- package/drawer/backdrop/DrawerBackdrop.d.ts +31 -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/backdrop/DrawerBackdropDataAttributes.d.ts +18 -0
- package/drawer/backdrop/DrawerBackdropDataAttributes.js +26 -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 +33 -0
- package/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/drawer/content/DrawerContentDataAttributes.js +7 -0
- package/drawer/description/DrawerDescription.d.ts +18 -0
- package/drawer/description/DrawerDescription.js +15 -0
- package/drawer/indent/DrawerIndent.d.ts +21 -0
- package/drawer/indent/DrawerIndent.js +88 -0
- package/drawer/indent-background/DrawerIndentBackground.d.ts +20 -0
- package/drawer/indent-background/DrawerIndentBackground.js +49 -0
- package/drawer/index.d.ts +15 -0
- package/drawer/index.js +9 -0
- package/drawer/index.parts.d.ts +15 -0
- package/drawer/index.parts.js +116 -0
- package/drawer/popup/DrawerPopup.d.ts +72 -0
- package/drawer/popup/DrawerPopup.js +348 -0
- package/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
- package/drawer/popup/DrawerPopupCssVars.js +44 -0
- package/drawer/popup/DrawerPopupDataAttributes.d.ts +43 -0
- package/drawer/popup/DrawerPopupDataAttributes.js +51 -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 +126 -0
- package/drawer/root/DrawerRoot.js +239 -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 +387 -0
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +23 -0
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.js +31 -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 +33 -0
- package/drawer/viewport/DrawerViewport.js +995 -0
- package/drawer/viewport/DrawerViewportContext.d.ts +11 -0
- package/drawer/viewport/DrawerViewportContext.js +21 -0
- 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 +11 -5
- package/esm/accordion/item/AccordionItemContext.d.ts +3 -3
- 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 +25 -16
- 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 +5 -3
- package/esm/alert-dialog/root/AlertDialogRoot.js +6 -4
- package/esm/autocomplete/index.d.ts +1 -0
- package/esm/autocomplete/index.parts.d.ts +3 -1
- package/esm/autocomplete/index.parts.js +3 -1
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +21 -16
- package/esm/autocomplete/root/AutocompleteRoot.js +8 -7
- package/esm/avatar/fallback/AvatarFallback.d.ts +5 -3
- package/esm/avatar/fallback/AvatarFallback.js +2 -2
- package/esm/avatar/image/AvatarImage.d.ts +11 -3
- package/esm/avatar/image/AvatarImage.js +33 -6
- package/esm/avatar/image/AvatarImageDataAttributes.d.ts +10 -0
- package/esm/avatar/image/AvatarImageDataAttributes.js +12 -0
- package/esm/avatar/image/useImageLoadingStatus.d.ts +2 -2
- package/esm/avatar/root/AvatarRoot.d.ts +4 -1
- 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 +7 -4
- package/esm/checkbox/indicator/CheckboxIndicator.js +4 -4
- package/esm/checkbox/root/CheckboxRoot.d.ts +16 -16
- package/esm/checkbox/root/CheckboxRoot.js +35 -9
- 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 +8 -8
- package/esm/checkbox-group/CheckboxGroup.js +2 -2
- package/esm/checkbox-group/CheckboxGroupContext.d.ts +2 -2
- package/esm/checkbox-group/useCheckboxGroupParent.d.ts +5 -8
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +8 -5
- package/esm/collapsible/panel/useCollapsiblePanel.d.ts +2 -5
- package/esm/collapsible/root/CollapsibleRoot.d.ts +7 -7
- 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 +4 -7
- package/esm/collapsible/trigger/CollapsibleTrigger.d.ts +4 -2
- package/esm/combobox/arrow/ComboboxArrow.d.ts +10 -1
- package/esm/combobox/arrow/ComboboxArrow.js +2 -2
- package/esm/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
- package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +4 -1
- package/esm/combobox/backdrop/ComboboxBackdrop.js +2 -2
- package/esm/combobox/chip/ComboboxChip.d.ts +1 -1
- package/esm/combobox/chip/ComboboxChip.js +6 -3
- package/esm/combobox/chip/ComboboxChipContext.js +2 -0
- package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.js +28 -33
- package/esm/combobox/chips/ComboboxChips.d.ts +1 -1
- package/esm/combobox/chips/ComboboxChipsContext.js +2 -0
- package/esm/combobox/clear/ComboboxClear.d.ts +6 -3
- package/esm/combobox/clear/ComboboxClear.js +2 -3
- 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 +2 -2
- package/esm/combobox/group/ComboboxGroupContext.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroupContext.js +2 -0
- package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/esm/combobox/icon/ComboboxIcon.d.ts +2 -2
- package/esm/combobox/index.d.ts +2 -0
- package/esm/combobox/index.parts.d.ts +4 -1
- package/esm/combobox/index.parts.js +4 -1
- package/esm/combobox/input/ComboboxInput.d.ts +4 -4
- package/esm/combobox/input/ComboboxInput.js +60 -13
- 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 +4 -4
- package/esm/combobox/item/ComboboxItem.js +17 -16
- package/esm/combobox/item/ComboboxItemContext.js +2 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +8 -2
- package/esm/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
- 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/list/ComboboxList.js +2 -2
- package/esm/combobox/popup/ComboboxPopup.d.ts +21 -3
- package/esm/combobox/popup/ComboboxPopup.js +12 -5
- package/esm/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
- package/esm/combobox/portal/ComboboxPortal.d.ts +4 -5
- package/esm/combobox/portal/ComboboxPortalContext.js +2 -0
- package/esm/combobox/positioner/ComboboxPositioner.d.ts +14 -2
- package/esm/combobox/positioner/ComboboxPositioner.js +8 -5
- package/esm/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
- package/esm/combobox/root/AriaCombobox.d.ts +52 -46
- package/esm/combobox/root/AriaCombobox.js +59 -69
- package/esm/combobox/root/ComboboxRoot.d.ts +21 -16
- 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/ComboboxRow.d.ts +1 -1
- package/esm/combobox/row/ComboboxRowContext.js +2 -0
- package/esm/combobox/status/ComboboxStatus.d.ts +1 -1
- package/esm/combobox/store.d.ts +18 -12
- package/esm/combobox/store.js +5 -3
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +4 -4
- package/esm/combobox/trigger/ComboboxTrigger.js +8 -6
- package/esm/combobox/utils/ComboboxInternalDismissButton.d.ts +5 -0
- package/esm/combobox/utils/ComboboxInternalDismissButton.js +38 -0
- package/esm/composite/item/CompositeItem.d.ts +9 -7
- package/esm/composite/list/CompositeList.d.ts +5 -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 +22 -20
- 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.d.ts +3 -3
- 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 +5 -2
- package/esm/dialog/backdrop/DialogBackdrop.js +2 -2
- package/esm/dialog/close/DialogClose.d.ts +1 -1
- package/esm/dialog/close/DialogClose.js +2 -2
- package/esm/dialog/description/DialogDescription.d.ts +1 -1
- package/esm/dialog/popup/DialogPopup.d.ts +6 -3
- package/esm/dialog/popup/DialogPopup.js +2 -2
- package/esm/dialog/portal/DialogPortal.d.ts +5 -6
- package/esm/dialog/portal/DialogPortalContext.js +2 -0
- package/esm/dialog/root/DialogRoot.d.ts +15 -10
- package/esm/dialog/root/DialogRoot.js +17 -4
- package/esm/dialog/root/useDialogRoot.d.ts +5 -9
- package/esm/dialog/root/useDialogRoot.js +6 -5
- package/esm/dialog/store/DialogStore.d.ts +258 -17
- package/esm/dialog/store/DialogStore.js +3 -0
- package/esm/dialog/title/DialogTitle.d.ts +1 -1
- package/esm/dialog/trigger/DialogTrigger.d.ts +4 -4
- package/esm/dialog/trigger/DialogTrigger.js +2 -2
- package/esm/dialog/viewport/DialogViewport.d.ts +3 -0
- package/esm/dialog/viewport/DialogViewport.js +5 -2
- package/esm/direction-provider/DirectionProvider.d.ts +3 -1
- package/esm/drawer/backdrop/DrawerBackdrop.d.ts +31 -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/backdrop/DrawerBackdropDataAttributes.d.ts +18 -0
- package/esm/drawer/backdrop/DrawerBackdropDataAttributes.js +20 -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 +28 -0
- package/esm/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/esm/drawer/content/DrawerContentDataAttributes.js +1 -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 +21 -0
- package/esm/drawer/indent/DrawerIndent.js +82 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.d.ts +20 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.js +43 -0
- package/esm/drawer/index.d.ts +15 -0
- package/esm/drawer/index.js +1 -0
- package/esm/drawer/index.parts.d.ts +15 -0
- package/esm/drawer/index.parts.js +15 -0
- package/esm/drawer/popup/DrawerPopup.d.ts +72 -0
- package/esm/drawer/popup/DrawerPopup.js +342 -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 +43 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.js +45 -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 +126 -0
- package/esm/drawer/root/DrawerRoot.js +233 -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 +381 -0
- 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 +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 +33 -0
- package/esm/drawer/viewport/DrawerViewport.js +989 -0
- package/esm/drawer/viewport/DrawerViewportContext.d.ts +11 -0
- package/esm/drawer/viewport/DrawerViewportContext.js +13 -0
- package/esm/drawer/viewport/DrawerViewportDataAttributes.d.ts +22 -0
- package/esm/drawer/viewport/DrawerViewportDataAttributes.js +24 -0
- package/esm/field/control/FieldControl.d.ts +6 -6
- package/esm/field/control/FieldControl.js +22 -20
- package/esm/field/description/FieldDescription.d.ts +3 -3
- package/esm/field/error/FieldError.d.ts +10 -4
- package/esm/field/error/FieldError.js +50 -7
- package/esm/field/error/FieldErrorDataAttributes.d.ts +8 -0
- package/esm/field/error/FieldErrorDataAttributes.js +10 -1
- package/esm/field/item/FieldItem.d.ts +5 -4
- package/esm/field/item/FieldItem.js +2 -2
- package/esm/field/item/FieldItemContext.js +2 -0
- package/esm/field/label/FieldLabel.d.ts +4 -4
- package/esm/field/label/FieldLabel.js +13 -53
- package/esm/field/root/FieldRoot.d.ts +28 -11
- package/esm/field/root/FieldRoot.js +2 -1
- package/esm/field/root/FieldRootContext.d.ts +3 -3
- package/esm/field/root/FieldRootContext.js +6 -13
- package/esm/field/root/useFieldValidation.js +5 -4
- package/esm/field/useField.d.ts +1 -1
- package/esm/field/useField.js +2 -0
- package/esm/field/utils/constants.d.ts +3 -0
- package/esm/field/utils/constants.js +11 -0
- package/esm/field/validity/FieldValidity.d.ts +9 -1
- package/esm/field/validity/FieldValidity.js +11 -4
- package/esm/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/esm/fieldset/legend/FieldsetLegend.js +2 -2
- package/esm/fieldset/root/FieldsetRoot.d.ts +2 -2
- 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 +3 -10
- package/esm/floating-ui-react/components/FloatingFocusManager.d.ts +17 -22
- package/esm/floating-ui-react/components/FloatingFocusManager.js +88 -97
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +12 -11
- 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 +14 -18
- package/esm/floating-ui-react/hooks/useDismiss.js +325 -263
- 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 -38
- package/esm/floating-ui-react/hooks/useHover.js +21 -63
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +3 -9
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +70 -91
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +27 -15
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +65 -32
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +14 -5
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +96 -121
- 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/useInteractions.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
- package/esm/floating-ui-react/hooks/useListNavigation.js +20 -15
- 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 +12 -16
- package/esm/floating-ui-react/hooks/useTypeahead.js +74 -26
- package/esm/floating-ui-react/middleware/arrow.d.ts +1 -1
- 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 +16 -15
- package/esm/floating-ui-react/utils/composite.d.ts +6 -5
- package/esm/floating-ui-react/utils/composite.js +129 -131
- 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.d.ts +7 -1
- package/esm/floating-ui-react/utils/markOthers.js +121 -83
- package/esm/floating-ui-react/utils/tabbable.js +6 -5
- package/esm/form/Form.d.ts +6 -6
- package/esm/global.d.ts +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/input/Input.d.ts +13 -6
- package/esm/labelable-provider/LabelableContext.d.ts +1 -1
- package/esm/labelable-provider/LabelableContext.js +1 -1
- package/esm/labelable-provider/LabelableProvider.d.ts +4 -1
- package/esm/labelable-provider/LabelableProvider.js +35 -4
- 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 +5 -7
- package/esm/labelable-provider/useLabelableId.js +38 -12
- package/esm/menu/arrow/MenuArrow.d.ts +10 -1
- package/esm/menu/arrow/MenuArrow.js +2 -2
- package/esm/menu/arrow/MenuArrowDataAttributes.js +2 -2
- package/esm/menu/backdrop/MenuBackdrop.d.ts +4 -1
- package/esm/menu/backdrop/MenuBackdrop.js +2 -2
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +11 -11
- package/esm/menu/checkbox-item/MenuCheckboxItemContext.js +2 -0
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +9 -3
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
- package/esm/menu/group/MenuGroup.d.ts +1 -1
- package/esm/menu/group/MenuGroupContext.js +2 -0
- package/esm/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/esm/menu/index.d.ts +4 -2
- package/esm/menu/index.parts.d.ts +2 -0
- package/esm/menu/index.parts.js +2 -0
- package/esm/menu/item/MenuItem.d.ts +6 -6
- package/esm/menu/item/MenuItem.js +2 -2
- package/esm/menu/item/useMenuItem.d.ts +8 -7
- package/esm/menu/item/useMenuItem.js +16 -54
- package/esm/menu/item/useMenuItemCommonProps.d.ts +46 -0
- package/esm/menu/item/useMenuItemCommonProps.js +80 -0
- package/esm/menu/link-item/MenuLinkItem.d.ts +34 -0
- package/esm/menu/link-item/MenuLinkItem.js +69 -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 +21 -5
- package/esm/menu/popup/MenuPopup.js +6 -3
- package/esm/menu/popup/MenuPopupDataAttributes.d.ts +1 -1
- package/esm/menu/popup/MenuPopupDataAttributes.js +3 -3
- package/esm/menu/portal/MenuPortal.d.ts +4 -5
- package/esm/menu/portal/MenuPortalContext.js +2 -0
- package/esm/menu/positioner/MenuPositioner.d.ts +18 -2
- package/esm/menu/positioner/MenuPositioner.js +64 -17
- package/esm/menu/positioner/MenuPositionerDataAttributes.js +2 -2
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +8 -5
- 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 +8 -8
- package/esm/menu/radio-item/MenuRadioItemContext.js +2 -0
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +9 -3
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
- package/esm/menu/root/MenuRoot.d.ts +17 -15
- package/esm/menu/root/MenuRoot.js +40 -39
- package/esm/menu/store/MenuStore.d.ts +259 -17
- package/esm/menu/store/MenuStore.js +17 -12
- 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 +10 -7
- package/esm/menu/trigger/MenuTrigger.d.ts +13 -9
- package/esm/menu/trigger/MenuTrigger.js +4 -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 +5 -5
- package/esm/menubar/Menubar.js +3 -9
- 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 +7 -7
- package/esm/meter/root/MeterRoot.js +13 -12
- 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/arrow/NavigationMenuArrow.js +2 -2
- package/esm/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- 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 +37 -5
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +2 -2
- package/esm/navigation-menu/icon/NavigationMenuIcon.js +2 -2
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +2 -2
- package/esm/navigation-menu/item/NavigationMenuItemContext.js +2 -0
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +3 -3
- 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 +2 -2
- package/esm/navigation-menu/list/NavigationMenuList.js +13 -4
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +14 -1
- 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 +5 -6
- package/esm/navigation-menu/portal/NavigationMenuPortalContext.js +2 -0
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.d.ts +11 -2
- 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 +9 -9
- package/esm/navigation-menu/root/NavigationMenuRoot.js +29 -10
- package/esm/navigation-menu/root/NavigationMenuRootContext.js +2 -0
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +272 -44
- 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 +2 -1
- 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/input/NumberFieldInput.js +3 -11
- package/esm/number-field/root/NumberFieldRoot.d.ts +29 -22
- package/esm/number-field/root/NumberFieldRoot.js +23 -8
- package/esm/number-field/root/NumberFieldRootContext.d.ts +4 -4
- package/esm/number-field/root/useNumberFieldButton.d.ts +5 -8
- package/esm/number-field/root/useNumberFieldButton.js +12 -7
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +5 -5
- package/esm/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
- package/esm/number-field/scrub-area/NumberFieldScrubAreaContext.js +2 -0
- 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/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.d.ts +10 -1
- package/esm/popover/arrow/PopoverArrow.js +2 -2
- package/esm/popover/arrow/PopoverArrowDataAttributes.js +2 -2
- package/esm/popover/backdrop/PopoverBackdrop.d.ts +4 -1
- package/esm/popover/backdrop/PopoverBackdrop.js +2 -2
- 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 +16 -3
- package/esm/popover/popup/PopoverPopup.js +13 -4
- package/esm/popover/portal/PopoverPortal.d.ts +4 -5
- package/esm/popover/portal/PopoverPortal.js +1 -2
- package/esm/popover/portal/PopoverPortalContext.js +2 -0
- package/esm/popover/positioner/PopoverPositioner.d.ts +11 -2
- package/esm/popover/positioner/PopoverPositioner.js +3 -3
- package/esm/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
- package/esm/popover/root/PopoverRoot.d.ts +16 -9
- package/esm/popover/root/PopoverRoot.js +19 -8
- package/esm/popover/store/PopoverStore.d.ts +255 -15
- package/esm/popover/title/PopoverTitle.d.ts +1 -1
- package/esm/popover/trigger/PopoverTrigger.d.ts +7 -7
- package/esm/popover/trigger/PopoverTrigger.js +2 -2
- package/esm/popover/viewport/PopoverViewport.d.ts +16 -4
- 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.d.ts +10 -1
- package/esm/preview-card/arrow/PreviewCardArrow.js +2 -2
- package/esm/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
- package/esm/preview-card/backdrop/PreviewCardBackdrop.d.ts +4 -1
- package/esm/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
- package/esm/preview-card/popup/PreviewCardPopup.d.ts +13 -1
- 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 +4 -5
- package/esm/preview-card/portal/PreviewCardPortalContext.js +2 -0
- package/esm/preview-card/positioner/PreviewCardPositioner.d.ts +14 -2
- package/esm/preview-card/positioner/PreviewCardPositioner.js +9 -3
- 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 +9 -9
- package/esm/preview-card/root/PreviewCardRoot.js +39 -13
- package/esm/preview-card/store/PreviewCardStore.d.ts +255 -15
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +5 -5
- package/esm/preview-card/trigger/PreviewCardTrigger.js +2 -2
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +16 -4
- package/esm/preview-card/viewport/PreviewCardViewport.js +14 -230
- 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 +10 -7
- package/esm/progress/root/ProgressRoot.js +13 -15
- 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 +5 -2
- package/esm/radio/indicator/RadioIndicator.js +4 -4
- package/esm/radio/indicator/RadioIndicatorDataAttributes.d.ts +8 -0
- package/esm/radio/indicator/RadioIndicatorDataAttributes.js +10 -1
- package/esm/radio/root/RadioRoot.d.ts +39 -19
- package/esm/radio/root/RadioRoot.js +49 -12
- package/esm/radio-group/RadioGroup.d.ts +20 -14
- 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/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 -9
- package/esm/scroll-area/root/ScrollAreaRoot.js +9 -5
- package/esm/scroll-area/root/ScrollAreaRootContext.d.ts +4 -2
- 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/root/stateAttributes.d.ts +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +14 -8
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +6 -3
- 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 +5 -2
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +5 -3
- 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.d.ts +3 -3
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +64 -42
- 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.d.ts +10 -1
- package/esm/select/arrow/SelectArrow.js +2 -2
- package/esm/select/arrow/SelectArrowDataAttributes.js +2 -2
- package/esm/select/backdrop/SelectBackdrop.d.ts +7 -1
- package/esm/select/backdrop/SelectBackdrop.js +2 -2
- package/esm/select/group/SelectGroup.d.ts +1 -1
- package/esm/select/group/SelectGroupContext.js +2 -0
- package/esm/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/esm/select/icon/SelectIcon.d.ts +1 -1
- package/esm/select/icon/SelectIcon.js +2 -2
- 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 +3 -3
- package/esm/select/item/SelectItem.js +23 -17
- package/esm/select/item/SelectItemContext.js +2 -0
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +11 -3
- package/esm/select/item-indicator/SelectItemIndicator.js +2 -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 +24 -1
- package/esm/select/popup/SelectPopup.js +87 -44
- package/esm/select/popup/SelectPopupDataAttributes.js +2 -2
- package/esm/select/portal/SelectPortal.d.ts +3 -4
- package/esm/select/portal/SelectPortalContext.js +2 -0
- package/esm/select/positioner/SelectPositioner.d.ts +15 -3
- package/esm/select/positioner/SelectPositioner.js +14 -11
- package/esm/select/positioner/SelectPositionerContext.d.ts +2 -2
- package/esm/select/positioner/SelectPositionerContext.js +2 -0
- package/esm/select/positioner/SelectPositionerDataAttributes.js +2 -2
- package/esm/select/root/SelectRoot.d.ts +27 -21
- package/esm/select/root/SelectRoot.js +7 -6
- 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 +14 -2
- package/esm/select/scroll-arrow/SelectScrollArrow.js +2 -2
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +2 -2
- package/esm/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +2 -2
- package/esm/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
- package/esm/select/store.d.ts +8 -5
- package/esm/select/store.js +4 -3
- package/esm/select/trigger/SelectTrigger.d.ts +7 -5
- package/esm/select/trigger/SelectTrigger.js +7 -4
- package/esm/select/value/SelectValue.d.ts +5 -1
- package/esm/select/value/SelectValue.js +2 -2
- package/esm/separator/Separator.d.ts +2 -2
- package/esm/separator/Separator.js +2 -2
- 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 +26 -20
- package/esm/slider/root/SliderRoot.js +11 -5
- package/esm/slider/root/SliderRootContext.d.ts +6 -4
- package/esm/slider/root/stateAttributesMapping.d.ts +2 -2
- package/esm/slider/root/stateAttributesMapping.js +3 -1
- package/esm/slider/thumb/SliderThumb.d.ts +10 -10
- package/esm/slider/thumb/SliderThumb.js +3 -2
- package/esm/slider/track/SliderTrack.d.ts +4 -2
- 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 +5 -3
- package/esm/switch/root/SwitchRoot.d.ts +14 -14
- package/esm/switch/root/SwitchRoot.js +11 -2
- package/esm/switch/root/SwitchRootContext.d.ts +4 -4
- package/esm/switch/root/SwitchRootContext.js +2 -0
- package/esm/switch/stateAttributesMapping.d.ts +2 -2
- package/esm/switch/thumb/SwitchThumb.d.ts +3 -3
- package/esm/tabs/indicator/TabsIndicator.d.ts +13 -4
- package/esm/tabs/indicator/TabsIndicator.js +7 -16
- package/esm/tabs/indicator/TabsIndicatorCssVars.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicatorCssVars.js +1 -1
- package/esm/tabs/list/TabsList.d.ts +5 -5
- package/esm/tabs/list/TabsList.js +50 -5
- package/esm/tabs/list/TabsListContext.d.ts +2 -0
- package/esm/tabs/panel/TabsPanel.d.ts +13 -5
- package/esm/tabs/panel/TabsPanel.js +35 -9
- package/esm/tabs/panel/TabsPanelDataAttributes.d.ts +8 -0
- package/esm/tabs/panel/TabsPanelDataAttributes.js +10 -1
- package/esm/tabs/root/TabsRoot.d.ts +11 -5
- 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 +8 -2
- package/esm/tabs/tab/TabsTab.js +12 -3
- package/esm/toast/action/ToastAction.d.ts +1 -1
- package/esm/toast/action/ToastAction.js +2 -2
- package/esm/toast/arrow/ToastArrow.d.ts +10 -1
- package/esm/toast/arrow/ToastArrow.js +2 -2
- package/esm/toast/arrow/ToastArrowDataAttributes.js +4 -3
- package/esm/toast/close/ToastClose.d.ts +1 -1
- package/esm/toast/close/ToastClose.js +6 -8
- package/esm/toast/content/ToastContent.d.ts +1 -1
- package/esm/toast/content/ToastContent.js +2 -2
- package/esm/toast/createToastManager.d.ts +6 -6
- package/esm/toast/createToastManager.js +3 -6
- package/esm/toast/description/ToastDescription.d.ts +1 -1
- package/esm/toast/description/ToastDescription.js +4 -6
- package/esm/toast/portal/ToastPortal.d.ts +3 -4
- package/esm/toast/positioner/ToastPositioner.d.ts +13 -4
- package/esm/toast/positioner/ToastPositioner.js +6 -7
- package/esm/toast/positioner/ToastPositionerDataAttributes.js +2 -2
- package/esm/toast/provider/ToastProvider.d.ts +5 -3
- package/esm/toast/provider/ToastProvider.js +27 -286
- package/esm/toast/provider/ToastProviderContext.d.ts +4 -25
- package/esm/toast/provider/ToastProviderContext.js +3 -1
- package/esm/toast/root/ToastRoot.d.ts +20 -7
- package/esm/toast/root/ToastRoot.js +22 -28
- package/esm/toast/root/ToastRootContext.js +2 -0
- package/esm/toast/store.d.ts +51 -0
- package/esm/toast/store.js +384 -0
- package/esm/toast/title/ToastTitle.d.ts +1 -1
- package/esm/toast/title/ToastTitle.js +4 -6
- package/esm/toast/useToastManager.d.ts +21 -22
- package/esm/toast/useToastManager.js +8 -14
- package/esm/toast/viewport/ToastViewport.d.ts +1 -1
- 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 +11 -5
- package/esm/toolbar/button/ToolbarButton.js +2 -2
- package/esm/toolbar/group/ToolbarGroup.d.ts +5 -3
- package/esm/toolbar/group/ToolbarGroup.js +2 -2
- package/esm/toolbar/group/ToolbarGroupContext.js +2 -0
- package/esm/toolbar/input/ToolbarInput.d.ts +12 -6
- package/esm/toolbar/input/ToolbarInput.js +2 -2
- package/esm/toolbar/link/ToolbarLink.d.ts +4 -1
- package/esm/toolbar/link/ToolbarLink.js +2 -2
- package/esm/toolbar/root/ToolbarRoot.d.ts +10 -4
- package/esm/toolbar/root/ToolbarRoot.js +2 -2
- package/esm/toolbar/separator/ToolbarSeparator.d.ts +4 -2
- package/esm/tooltip/arrow/TooltipArrow.d.ts +14 -1
- package/esm/tooltip/arrow/TooltipArrow.js +2 -2
- package/esm/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
- package/esm/tooltip/popup/TooltipPopup.d.ts +13 -1
- package/esm/tooltip/popup/TooltipPopup.js +2 -2
- package/esm/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
- package/esm/tooltip/portal/TooltipPortal.d.ts +4 -5
- package/esm/tooltip/portal/TooltipPortalContext.js +2 -0
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +12 -3
- package/esm/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
- package/esm/tooltip/provider/TooltipProvider.d.ts +5 -3
- package/esm/tooltip/provider/TooltipProviderContext.js +2 -0
- package/esm/tooltip/root/TooltipRoot.d.ts +12 -12
- package/esm/tooltip/root/TooltipRoot.js +24 -12
- package/esm/tooltip/store/TooltipStore.d.ts +258 -16
- package/esm/tooltip/store/TooltipStore.js +2 -0
- package/esm/tooltip/trigger/TooltipTrigger.d.ts +17 -5
- package/esm/tooltip/trigger/TooltipTrigger.js +17 -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 +16 -4
- package/esm/tooltip/viewport/TooltipViewport.js +14 -195
- package/esm/types/index.d.ts +16 -1
- package/esm/unstable-use-media-query/index.d.ts +7 -5
- package/esm/use-button/useButton.d.ts +12 -9
- package/esm/use-button/useButton.js +56 -22
- package/esm/use-render/useRender.d.ts +14 -12
- 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 +4 -1
- 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/getElementAtPoint.d.ts +1 -0
- package/esm/utils/getElementAtPoint.js +3 -0
- 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/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/scrollable.d.ts +4 -0
- package/esm/utils/scrollable.js +32 -0
- package/esm/utils/types.d.ts +9 -22
- package/esm/utils/useAnchorPositioning.d.ts +68 -33
- package/esm/utils/useAnchorPositioning.js +32 -20
- package/esm/utils/useFocusableWhenDisabled.d.ts +6 -9
- package/esm/utils/useMixedToggleClickHandler.d.ts +3 -5
- package/esm/utils/useMixedToggleClickHandler.js +2 -0
- package/esm/utils/useOpenChangeComplete.d.ts +4 -6
- package/esm/utils/useOpenInteractionType.d.ts +0 -1
- package/esm/utils/useOpenInteractionType.js +7 -5
- package/esm/utils/usePopupAutoResize.d.ts +3 -3
- package/esm/utils/usePopupAutoResize.js +4 -3
- package/esm/utils/usePopupViewport.d.ts +58 -0
- package/esm/utils/usePopupViewport.js +250 -0
- package/esm/utils/useRegisteredLabelId.d.ts +1 -0
- package/esm/utils/useRegisteredLabelId.js +14 -0
- package/esm/utils/useRenderElement.d.ts +11 -14
- package/esm/utils/useRenderElement.js +43 -1
- package/esm/utils/useSwipeDismiss.d.ts +107 -0
- package/esm/utils/useSwipeDismiss.js +945 -0
- package/esm/utils/useValueChanged.js +2 -0
- package/field/control/FieldControl.d.ts +6 -6
- package/field/control/FieldControl.js +21 -20
- package/field/description/FieldDescription.d.ts +3 -3
- package/field/error/FieldError.d.ts +10 -4
- package/field/error/FieldError.js +51 -7
- package/field/error/FieldErrorDataAttributes.d.ts +8 -0
- package/field/error/FieldErrorDataAttributes.js +10 -1
- package/field/item/FieldItem.d.ts +5 -4
- package/field/item/FieldItem.js +2 -2
- package/field/item/FieldItemContext.js +1 -0
- package/field/label/FieldLabel.d.ts +4 -4
- package/field/label/FieldLabel.js +13 -53
- package/field/root/FieldRoot.d.ts +28 -11
- package/field/root/FieldRoot.js +2 -1
- package/field/root/FieldRootContext.d.ts +3 -3
- package/field/root/FieldRootContext.js +5 -12
- package/field/root/useFieldValidation.js +5 -4
- package/field/useField.d.ts +1 -1
- package/field/useField.js +1 -0
- package/field/utils/constants.d.ts +3 -0
- package/field/utils/constants.js +12 -1
- package/field/validity/FieldValidity.d.ts +9 -1
- package/field/validity/FieldValidity.js +9 -3
- package/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/fieldset/legend/FieldsetLegend.js +2 -2
- package/fieldset/root/FieldsetRoot.d.ts +2 -2
- package/fieldset/root/FieldsetRoot.js +3 -3
- package/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
- package/floating-ui-react/components/FloatingDelayGroup.js +4 -11
- package/floating-ui-react/components/FloatingFocusManager.d.ts +17 -22
- package/floating-ui-react/components/FloatingFocusManager.js +85 -94
- package/floating-ui-react/components/FloatingPortal.d.ts +12 -11
- 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 +14 -18
- package/floating-ui-react/hooks/useDismiss.js +322 -261
- 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 -38
- package/floating-ui-react/hooks/useHover.js +23 -67
- package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +3 -9
- package/floating-ui-react/hooks/useHoverFloatingInteraction.js +67 -90
- package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +27 -15
- package/floating-ui-react/hooks/useHoverInteractionSharedState.js +67 -33
- package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +14 -5
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +93 -119
- package/floating-ui-react/hooks/useHoverShared.d.ts +28 -0
- package/floating-ui-react/hooks/useHoverShared.js +34 -0
- 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 +18 -14
- 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 +12 -16
- package/floating-ui-react/hooks/useTypeahead.js +72 -25
- package/floating-ui-react/middleware/arrow.d.ts +1 -1
- package/floating-ui-react/safePolygon.d.ts +2 -6
- package/floating-ui-react/safePolygon.js +149 -119
- package/floating-ui-react/types.d.ts +16 -15
- package/floating-ui-react/utils/composite.d.ts +6 -5
- package/floating-ui-react/utils/composite.js +130 -132
- 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.d.ts +7 -1
- package/floating-ui-react/utils/markOthers.js +120 -82
- package/floating-ui-react/utils/tabbable.js +5 -4
- package/form/Form.d.ts +6 -6
- package/global.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/input/Input.d.ts +13 -6
- package/labelable-provider/LabelableContext.d.ts +1 -1
- package/labelable-provider/LabelableContext.js +1 -1
- package/labelable-provider/LabelableProvider.d.ts +4 -1
- package/labelable-provider/LabelableProvider.js +35 -4
- 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 +5 -7
- package/labelable-provider/useLabelableId.js +39 -12
- package/menu/arrow/MenuArrow.d.ts +10 -1
- package/menu/arrow/MenuArrow.js +2 -2
- package/menu/arrow/MenuArrowDataAttributes.js +2 -2
- package/menu/backdrop/MenuBackdrop.d.ts +4 -1
- package/menu/backdrop/MenuBackdrop.js +2 -2
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +11 -11
- package/menu/checkbox-item/MenuCheckboxItemContext.js +1 -0
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +9 -3
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
- package/menu/group/MenuGroup.d.ts +1 -1
- package/menu/group/MenuGroupContext.js +1 -0
- package/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/menu/index.d.ts +4 -2
- package/menu/index.parts.d.ts +2 -0
- package/menu/index.parts.js +14 -0
- package/menu/item/MenuItem.d.ts +6 -6
- package/menu/item/MenuItem.js +2 -2
- package/menu/item/useMenuItem.d.ts +8 -7
- package/menu/item/useMenuItem.js +16 -54
- package/menu/item/useMenuItemCommonProps.d.ts +46 -0
- package/menu/item/useMenuItemCommonProps.js +86 -0
- package/menu/link-item/MenuLinkItem.d.ts +34 -0
- package/menu/link-item/MenuLinkItem.js +74 -0
- package/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
- package/menu/link-item/MenuLinkItemDataAttributes.js +13 -0
- package/menu/popup/MenuPopup.d.ts +21 -5
- package/menu/popup/MenuPopup.js +6 -3
- package/menu/popup/MenuPopupDataAttributes.d.ts +1 -1
- package/menu/popup/MenuPopupDataAttributes.js +3 -3
- package/menu/portal/MenuPortal.d.ts +4 -5
- package/menu/portal/MenuPortalContext.js +1 -0
- package/menu/positioner/MenuPositioner.d.ts +18 -2
- package/menu/positioner/MenuPositioner.js +62 -16
- package/menu/positioner/MenuPositionerDataAttributes.js +2 -2
- package/menu/radio-group/MenuRadioGroup.d.ts +8 -5
- package/menu/radio-group/MenuRadioGroup.js +2 -2
- package/menu/radio-group/MenuRadioGroupContext.js +1 -0
- package/menu/radio-item/MenuRadioItem.d.ts +8 -8
- package/menu/radio-item/MenuRadioItemContext.js +1 -0
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +9 -3
- package/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
- package/menu/root/MenuRoot.d.ts +17 -15
- package/menu/root/MenuRoot.js +41 -40
- package/menu/store/MenuStore.d.ts +259 -17
- package/menu/store/MenuStore.js +17 -12
- 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 +11 -8
- package/menu/trigger/MenuTrigger.d.ts +13 -9
- package/menu/trigger/MenuTrigger.js +5 -4
- 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 +5 -5
- package/menubar/Menubar.js +3 -9
- 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 +7 -7
- package/meter/root/MeterRoot.js +11 -11
- 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/arrow/NavigationMenuArrow.js +2 -2
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
- package/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
- package/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
- package/navigation-menu/content/NavigationMenuContent.js +37 -5
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +2 -2
- package/navigation-menu/icon/NavigationMenuIcon.js +2 -2
- package/navigation-menu/item/NavigationMenuItem.d.ts +2 -2
- package/navigation-menu/item/NavigationMenuItemContext.js +1 -0
- package/navigation-menu/link/NavigationMenuLink.d.ts +3 -3
- package/navigation-menu/link/NavigationMenuLink.js +2 -2
- package/navigation-menu/list/NavigationMenuDismissContext.js +1 -0
- package/navigation-menu/list/NavigationMenuList.d.ts +2 -2
- package/navigation-menu/list/NavigationMenuList.js +12 -3
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +14 -1
- package/navigation-menu/popup/NavigationMenuPopup.js +2 -2
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +5 -6
- package/navigation-menu/portal/NavigationMenuPortalContext.js +1 -0
- package/navigation-menu/positioner/NavigationMenuPositioner.d.ts +11 -2
- package/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
- package/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
- package/navigation-menu/root/NavigationMenuRoot.d.ts +9 -9
- package/navigation-menu/root/NavigationMenuRoot.js +28 -9
- package/navigation-menu/root/NavigationMenuRootContext.js +1 -0
- package/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/navigation-menu/trigger/NavigationMenuTrigger.js +270 -42
- package/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.js +2 -1
- 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/input/NumberFieldInput.js +3 -11
- package/number-field/root/NumberFieldRoot.d.ts +29 -22
- package/number-field/root/NumberFieldRoot.js +23 -8
- package/number-field/root/NumberFieldRootContext.d.ts +4 -4
- package/number-field/root/useNumberFieldButton.d.ts +5 -8
- package/number-field/root/useNumberFieldButton.js +12 -7
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +5 -5
- package/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
- package/number-field/scrub-area/NumberFieldScrubAreaContext.js +1 -0
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +3 -3
- package/number-field/utils/stateAttributesMapping.d.ts +2 -2
- 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 +194 -9
- package/popover/arrow/PopoverArrow.d.ts +10 -1
- package/popover/arrow/PopoverArrow.js +2 -2
- package/popover/arrow/PopoverArrowDataAttributes.js +2 -2
- package/popover/backdrop/PopoverBackdrop.d.ts +4 -1
- package/popover/backdrop/PopoverBackdrop.js +2 -2
- 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 +16 -3
- package/popover/popup/PopoverPopup.js +13 -4
- package/popover/portal/PopoverPortal.d.ts +4 -5
- package/popover/portal/PopoverPortal.js +1 -2
- package/popover/portal/PopoverPortalContext.js +1 -0
- package/popover/positioner/PopoverPositioner.d.ts +11 -2
- package/popover/positioner/PopoverPositioner.js +3 -3
- package/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
- package/popover/root/PopoverRoot.d.ts +16 -9
- package/popover/root/PopoverRoot.js +19 -8
- package/popover/store/PopoverStore.d.ts +255 -15
- package/popover/title/PopoverTitle.d.ts +1 -1
- package/popover/trigger/PopoverTrigger.d.ts +7 -7
- package/popover/trigger/PopoverTrigger.js +3 -3
- package/popover/viewport/PopoverViewport.d.ts +16 -4
- 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.d.ts +10 -1
- package/preview-card/arrow/PreviewCardArrow.js +2 -2
- package/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
- package/preview-card/backdrop/PreviewCardBackdrop.d.ts +4 -1
- package/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
- package/preview-card/popup/PreviewCardPopup.d.ts +13 -1
- package/preview-card/popup/PreviewCardPopup.js +2 -2
- package/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
- package/preview-card/portal/PreviewCardPortal.d.ts +4 -5
- package/preview-card/portal/PreviewCardPortalContext.js +1 -0
- package/preview-card/positioner/PreviewCardPositioner.d.ts +14 -2
- package/preview-card/positioner/PreviewCardPositioner.js +9 -3
- package/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
- package/preview-card/root/PreviewCardRoot.d.ts +9 -9
- package/preview-card/root/PreviewCardRoot.js +37 -11
- package/preview-card/store/PreviewCardStore.d.ts +255 -15
- package/preview-card/trigger/PreviewCardTrigger.d.ts +5 -5
- package/preview-card/trigger/PreviewCardTrigger.js +3 -3
- package/preview-card/viewport/PreviewCardViewport.d.ts +16 -4
- package/preview-card/viewport/PreviewCardViewport.js +14 -230
- 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 +10 -7
- package/progress/root/ProgressRoot.js +11 -13
- 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 +5 -2
- package/radio/indicator/RadioIndicator.js +4 -4
- package/radio/indicator/RadioIndicatorDataAttributes.d.ts +8 -0
- package/radio/indicator/RadioIndicatorDataAttributes.js +10 -1
- package/radio/root/RadioRoot.d.ts +39 -19
- package/radio/root/RadioRoot.js +49 -12
- package/radio-group/RadioGroup.d.ts +20 -14
- 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/content/ScrollAreaContent.d.ts +3 -3
- package/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/scroll-area/root/ScrollAreaRoot.d.ts +27 -9
- package/scroll-area/root/ScrollAreaRoot.js +9 -5
- package/scroll-area/root/ScrollAreaRootContext.d.ts +4 -2
- 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/root/stateAttributes.d.ts +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +14 -8
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +6 -3
- 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 +5 -2
- package/scroll-area/thumb/ScrollAreaThumb.js +5 -3
- package/scroll-area/utils/scrollEdges.d.ts +2 -0
- package/scroll-area/utils/scrollEdges.js +29 -0
- package/scroll-area/viewport/ScrollAreaViewport.d.ts +3 -3
- package/scroll-area/viewport/ScrollAreaViewport.js +64 -42
- 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.d.ts +10 -1
- package/select/arrow/SelectArrow.js +2 -2
- package/select/arrow/SelectArrowDataAttributes.js +2 -2
- package/select/backdrop/SelectBackdrop.d.ts +7 -1
- package/select/backdrop/SelectBackdrop.js +2 -2
- package/select/group/SelectGroup.d.ts +1 -1
- package/select/group/SelectGroupContext.js +1 -0
- package/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/select/icon/SelectIcon.d.ts +1 -1
- package/select/icon/SelectIcon.js +2 -2
- 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 +3 -3
- package/select/item/SelectItem.js +23 -17
- package/select/item/SelectItemContext.js +1 -0
- package/select/item-indicator/SelectItemIndicator.d.ts +11 -3
- package/select/item-indicator/SelectItemIndicator.js +2 -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 +24 -1
- package/select/popup/SelectPopup.js +90 -47
- package/select/popup/SelectPopupDataAttributes.js +2 -2
- package/select/portal/SelectPortal.d.ts +3 -4
- package/select/portal/SelectPortalContext.js +1 -0
- package/select/positioner/SelectPositioner.d.ts +15 -3
- package/select/positioner/SelectPositioner.js +13 -10
- package/select/positioner/SelectPositionerContext.d.ts +2 -2
- package/select/positioner/SelectPositionerContext.js +1 -0
- package/select/positioner/SelectPositionerDataAttributes.js +2 -2
- package/select/root/SelectRoot.d.ts +27 -21
- package/select/root/SelectRoot.js +7 -6
- package/select/root/SelectRootContext.d.ts +14 -14
- package/select/root/SelectRootContext.js +1 -0
- package/select/scroll-arrow/SelectScrollArrow.d.ts +14 -2
- package/select/scroll-arrow/SelectScrollArrow.js +2 -2
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +2 -2
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +2 -2
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
- package/select/store.d.ts +8 -5
- package/select/store.js +4 -3
- package/select/trigger/SelectTrigger.d.ts +7 -5
- package/select/trigger/SelectTrigger.js +7 -4
- package/select/value/SelectValue.d.ts +5 -1
- package/select/value/SelectValue.js +2 -2
- package/separator/Separator.d.ts +2 -2
- package/separator/Separator.js +2 -2
- 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 +26 -20
- package/slider/root/SliderRoot.js +11 -5
- package/slider/root/SliderRootContext.d.ts +6 -4
- package/slider/root/stateAttributesMapping.d.ts +2 -2
- package/slider/root/stateAttributesMapping.js +3 -1
- package/slider/thumb/SliderThumb.d.ts +10 -10
- package/slider/thumb/SliderThumb.js +3 -2
- package/slider/track/SliderTrack.d.ts +4 -2
- package/slider/utils/getPushedThumbValues.d.ts +1 -1
- package/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/slider/value/SliderValue.d.ts +5 -3
- package/switch/root/SwitchRoot.d.ts +14 -14
- package/switch/root/SwitchRoot.js +11 -2
- package/switch/root/SwitchRootContext.d.ts +4 -4
- package/switch/root/SwitchRootContext.js +1 -0
- package/switch/stateAttributesMapping.d.ts +2 -2
- package/switch/thumb/SwitchThumb.d.ts +3 -3
- package/tabs/indicator/TabsIndicator.d.ts +13 -4
- package/tabs/indicator/TabsIndicator.js +7 -16
- package/tabs/indicator/TabsIndicatorCssVars.d.ts +1 -1
- package/tabs/indicator/TabsIndicatorCssVars.js +1 -1
- package/tabs/list/TabsList.d.ts +5 -5
- package/tabs/list/TabsList.js +50 -5
- package/tabs/list/TabsListContext.d.ts +2 -0
- package/tabs/panel/TabsPanel.d.ts +13 -5
- package/tabs/panel/TabsPanel.js +37 -10
- package/tabs/panel/TabsPanelDataAttributes.d.ts +8 -0
- package/tabs/panel/TabsPanelDataAttributes.js +10 -1
- package/tabs/root/TabsRoot.d.ts +11 -5
- package/tabs/root/TabsRootContext.d.ts +1 -1
- package/tabs/root/stateAttributesMapping.d.ts +2 -2
- package/tabs/tab/TabsTab.d.ts +8 -2
- package/tabs/tab/TabsTab.js +12 -3
- package/toast/action/ToastAction.d.ts +1 -1
- package/toast/action/ToastAction.js +2 -2
- package/toast/arrow/ToastArrow.d.ts +10 -1
- package/toast/arrow/ToastArrow.js +2 -2
- package/toast/arrow/ToastArrowDataAttributes.js +4 -3
- package/toast/close/ToastClose.d.ts +1 -1
- package/toast/close/ToastClose.js +5 -7
- package/toast/content/ToastContent.d.ts +1 -1
- package/toast/content/ToastContent.js +2 -2
- package/toast/createToastManager.d.ts +6 -6
- package/toast/createToastManager.js +3 -6
- package/toast/description/ToastDescription.d.ts +1 -1
- package/toast/description/ToastDescription.js +4 -6
- package/toast/portal/ToastPortal.d.ts +3 -4
- package/toast/positioner/ToastPositioner.d.ts +13 -4
- package/toast/positioner/ToastPositioner.js +5 -6
- package/toast/positioner/ToastPositionerDataAttributes.js +2 -2
- package/toast/provider/ToastProvider.d.ts +5 -3
- package/toast/provider/ToastProvider.js +25 -285
- package/toast/provider/ToastProviderContext.d.ts +4 -25
- package/toast/provider/ToastProviderContext.js +3 -2
- package/toast/root/ToastRoot.d.ts +20 -7
- package/toast/root/ToastRoot.js +21 -27
- package/toast/root/ToastRootContext.js +1 -0
- package/toast/store.d.ts +51 -0
- package/toast/store.js +391 -0
- package/toast/title/ToastTitle.d.ts +1 -1
- package/toast/title/ToastTitle.js +4 -6
- package/toast/useToastManager.d.ts +21 -22
- package/toast/useToastManager.js +8 -14
- package/toast/viewport/ToastViewport.d.ts +1 -1
- 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 +11 -5
- package/toolbar/button/ToolbarButton.js +2 -2
- package/toolbar/group/ToolbarGroup.d.ts +5 -3
- package/toolbar/group/ToolbarGroup.js +2 -2
- package/toolbar/group/ToolbarGroupContext.js +1 -0
- package/toolbar/input/ToolbarInput.d.ts +12 -6
- package/toolbar/input/ToolbarInput.js +2 -2
- package/toolbar/link/ToolbarLink.d.ts +4 -1
- package/toolbar/link/ToolbarLink.js +2 -2
- package/toolbar/root/ToolbarRoot.d.ts +10 -4
- package/toolbar/root/ToolbarRoot.js +2 -2
- package/toolbar/separator/ToolbarSeparator.d.ts +4 -2
- package/tooltip/arrow/TooltipArrow.d.ts +14 -1
- package/tooltip/arrow/TooltipArrow.js +2 -2
- package/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
- package/tooltip/popup/TooltipPopup.d.ts +13 -1
- package/tooltip/popup/TooltipPopup.js +2 -2
- package/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
- package/tooltip/portal/TooltipPortal.d.ts +4 -5
- package/tooltip/portal/TooltipPortalContext.js +1 -0
- package/tooltip/positioner/TooltipPositioner.d.ts +12 -3
- package/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
- package/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
- package/tooltip/provider/TooltipProvider.d.ts +5 -3
- package/tooltip/provider/TooltipProviderContext.js +1 -0
- package/tooltip/root/TooltipRoot.d.ts +12 -12
- package/tooltip/root/TooltipRoot.js +24 -12
- package/tooltip/store/TooltipStore.d.ts +258 -16
- package/tooltip/store/TooltipStore.js +2 -0
- package/tooltip/trigger/TooltipTrigger.d.ts +17 -5
- package/tooltip/trigger/TooltipTrigger.js +17 -6
- package/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
- package/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
- package/tooltip/viewport/TooltipViewport.d.ts +16 -4
- package/tooltip/viewport/TooltipViewport.js +14 -195
- package/types/index.d.ts +16 -1
- package/unstable-use-media-query/index.d.ts +7 -5
- package/use-button/useButton.d.ts +12 -9
- package/use-button/useButton.js +56 -22
- package/use-render/useRender.d.ts +14 -12
- 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 +4 -1
- package/utils/formatNumber.d.ts +2 -1
- package/utils/formatNumber.js +12 -0
- package/utils/getDisabledMountTransitionStyles.d.ts +1 -1
- package/utils/getElementAtPoint.d.ts +1 -0
- package/utils/getElementAtPoint.js +9 -0
- 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/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/scrollable.d.ts +4 -0
- package/utils/scrollable.js +40 -0
- package/utils/types.d.ts +9 -22
- package/utils/useAnchorPositioning.d.ts +68 -33
- package/utils/useAnchorPositioning.js +32 -20
- package/utils/useFocusableWhenDisabled.d.ts +6 -9
- package/utils/useMixedToggleClickHandler.d.ts +3 -5
- package/utils/useMixedToggleClickHandler.js +1 -0
- package/utils/useOpenChangeComplete.d.ts +4 -6
- package/utils/useOpenInteractionType.d.ts +0 -1
- package/utils/useOpenInteractionType.js +7 -5
- package/utils/usePopupAutoResize.d.ts +3 -3
- package/utils/usePopupAutoResize.js +3 -3
- package/utils/usePopupViewport.d.ts +58 -0
- package/utils/usePopupViewport.js +256 -0
- package/utils/useRegisteredLabelId.d.ts +1 -0
- package/utils/useRegisteredLabelId.js +19 -0
- package/utils/useRenderElement.d.ts +11 -14
- package/utils/useRenderElement.js +43 -1
- package/utils/useSwipeDismiss.d.ts +107 -0
- package/utils/useSwipeDismiss.js +953 -0
- package/utils/useValueChanged.js +1 -0
- package/esm/navigation-menu/utils/setFixedSize.d.ts +0 -1
- package/esm/navigation-menu/utils/setFixedSize.js +0 -11
- package/esm/toast/viewport/ToastViewportContext.d.ts +0 -6
- package/esm/toast/viewport/ToastViewportContext.js +0 -11
- package/navigation-menu/utils/setFixedSize.d.ts +0 -1
- package/navigation-menu/utils/setFixedSize.js +0 -17
- package/toast/viewport/ToastViewportContext.d.ts +0 -6
- package/toast/viewport/ToastViewportContext.js +0 -20
|
@@ -0,0 +1,989 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ReactDOM from 'react-dom';
|
|
5
|
+
import { isElement } from '@floating-ui/utils/dom';
|
|
6
|
+
import { ownerDocument, ownerWindow } from '@base-ui/utils/owner';
|
|
7
|
+
import { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';
|
|
8
|
+
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
9
|
+
import { useDialogRootContext } from "../../dialog/root/DialogRootContext.js";
|
|
10
|
+
import { DialogViewport } from "../../dialog/viewport/DialogViewport.js";
|
|
11
|
+
import { mergeProps } from "../../merge-props/index.js";
|
|
12
|
+
import { useDrawerRootContext } from "../root/DrawerRootContext.js";
|
|
13
|
+
import { useDrawerSnapPoints } from "../root/useDrawerSnapPoints.js";
|
|
14
|
+
import { useDrawerProviderContext } from "../provider/DrawerProviderContext.js";
|
|
15
|
+
import { clamp } from "../../utils/clamp.js";
|
|
16
|
+
import { useSwipeDismiss } from "../../utils/useSwipeDismiss.js";
|
|
17
|
+
import { DrawerPopupCssVars } from "../popup/DrawerPopupCssVars.js";
|
|
18
|
+
import { DrawerPopupDataAttributes } from "../popup/DrawerPopupDataAttributes.js";
|
|
19
|
+
import { DrawerBackdropCssVars } from "../backdrop/DrawerBackdropCssVars.js";
|
|
20
|
+
import { DRAWER_CONTENT_ATTRIBUTE } from "../content/DrawerContentDataAttributes.js";
|
|
21
|
+
import { REASONS } from "../../utils/reasons.js";
|
|
22
|
+
import { createChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
23
|
+
import { contains } from "../../floating-ui-react/utils.js";
|
|
24
|
+
import { DrawerViewportContext } from "./DrawerViewportContext.js";
|
|
25
|
+
import { TransitionStatusDataAttributes } from "../../utils/stateAttributesMapping.js";
|
|
26
|
+
import { findScrollableTouchTarget } from "../../utils/scrollable.js";
|
|
27
|
+
import { BASE_UI_SWIPE_IGNORE_SELECTOR } from "../../utils/constants.js";
|
|
28
|
+
import { getElementAtPoint } from "../../utils/getElementAtPoint.js";
|
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
+
const MIN_SWIPE_THRESHOLD = 10;
|
|
31
|
+
const FAST_SWIPE_VELOCITY = 0.5;
|
|
32
|
+
const SNAP_VELOCITY_THRESHOLD = 0.5;
|
|
33
|
+
const SNAP_VELOCITY_MULTIPLIER = 300;
|
|
34
|
+
const MAX_SNAP_VELOCITY = 4;
|
|
35
|
+
const MIN_SWIPE_RELEASE_VELOCITY = 0.2;
|
|
36
|
+
const MAX_SWIPE_RELEASE_VELOCITY = 4;
|
|
37
|
+
const MIN_SWIPE_RELEASE_DURATION_MS = 80;
|
|
38
|
+
const MAX_SWIPE_RELEASE_DURATION_MS = 360;
|
|
39
|
+
const MIN_SWIPE_RELEASE_SCALAR = 0.1;
|
|
40
|
+
const MAX_SWIPE_RELEASE_SCALAR = 1;
|
|
41
|
+
const DRAWER_CONTENT_SELECTOR = `[${DRAWER_CONTENT_ATTRIBUTE}]`;
|
|
42
|
+
/**
|
|
43
|
+
* A positioning container for the drawer popup that can be made scrollable.
|
|
44
|
+
* Renders a `<div>` element.
|
|
45
|
+
*
|
|
46
|
+
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
47
|
+
*/
|
|
48
|
+
export const DrawerViewport = /*#__PURE__*/React.forwardRef(function DrawerViewport(props, forwardedRef) {
|
|
49
|
+
const {
|
|
50
|
+
className,
|
|
51
|
+
render,
|
|
52
|
+
children,
|
|
53
|
+
...elementProps
|
|
54
|
+
} = props;
|
|
55
|
+
const {
|
|
56
|
+
store
|
|
57
|
+
} = useDialogRootContext();
|
|
58
|
+
const {
|
|
59
|
+
swipeDirection,
|
|
60
|
+
notifyParentSwipingChange,
|
|
61
|
+
notifyParentSwipeProgressChange,
|
|
62
|
+
frontmostHeight,
|
|
63
|
+
snapToSequentialPoints
|
|
64
|
+
} = useDrawerRootContext();
|
|
65
|
+
const providerContext = useDrawerProviderContext(true);
|
|
66
|
+
const visualStateStore = providerContext?.visualStateStore;
|
|
67
|
+
const open = store.useState('open');
|
|
68
|
+
const mounted = store.useState('mounted');
|
|
69
|
+
const nested = store.useState('nested');
|
|
70
|
+
const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');
|
|
71
|
+
const viewportElement = store.useState('viewportElement');
|
|
72
|
+
const popupElementState = store.useState('popupElement');
|
|
73
|
+
const nestedDrawerOpen = nestedOpenDialogCount > 0;
|
|
74
|
+
const scrollAxis = swipeDirection === 'left' || swipeDirection === 'right' ? 'horizontal' : 'vertical';
|
|
75
|
+
const isVerticalScrollAxis = scrollAxis === 'vertical';
|
|
76
|
+
const crossScrollAxis = isVerticalScrollAxis ? 'horizontal' : 'vertical';
|
|
77
|
+
const {
|
|
78
|
+
snapPoints,
|
|
79
|
+
resolvedSnapPoints,
|
|
80
|
+
activeSnapPoint,
|
|
81
|
+
activeSnapPointOffset,
|
|
82
|
+
setActiveSnapPoint,
|
|
83
|
+
popupHeight
|
|
84
|
+
} = useDrawerSnapPoints();
|
|
85
|
+
const [swipeRelease, setSwipeRelease] = React.useState(null);
|
|
86
|
+
const pendingSwipeCloseSnapPointRef = React.useRef(undefined);
|
|
87
|
+
const resetSwipeRef = React.useRef(null);
|
|
88
|
+
const controlledDismissFrame = useAnimationFrame();
|
|
89
|
+
const nestedSwipeActiveRef = React.useRef(false);
|
|
90
|
+
const lastPointerTypeRef = React.useRef('');
|
|
91
|
+
const ignoreNextTouchStartFromPenRef = React.useRef(false);
|
|
92
|
+
const ignoreTouchSwipeRef = React.useRef(false);
|
|
93
|
+
const touchScrollStateRef = React.useRef(null);
|
|
94
|
+
const snapPointRange = React.useMemo(() => {
|
|
95
|
+
if (!snapPoints || snapPoints.length < 2) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
if (swipeDirection !== 'down' && swipeDirection !== 'up') {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
if (resolvedSnapPoints.length < 2) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const offsets = resolvedSnapPoints.map(point => point.offset).filter(offset => Number.isFinite(offset)).sort((a, b) => a - b);
|
|
105
|
+
if (offsets.length < 2) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const minOffset = offsets[0];
|
|
109
|
+
const nextOffset = offsets[1];
|
|
110
|
+
const maxOffset = offsets[offsets.length - 1];
|
|
111
|
+
let range = nextOffset - minOffset;
|
|
112
|
+
if (!Number.isFinite(range) || range <= 0) {
|
|
113
|
+
const fallbackRange = maxOffset - minOffset;
|
|
114
|
+
if (!Number.isFinite(fallbackRange) || fallbackRange <= 0) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
range = fallbackRange;
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
minOffset,
|
|
121
|
+
range
|
|
122
|
+
};
|
|
123
|
+
}, [resolvedSnapPoints, snapPoints, swipeDirection]);
|
|
124
|
+
const snapPointProgress = React.useMemo(() => {
|
|
125
|
+
if (!snapPointRange || activeSnapPointOffset === null) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
return clamp((activeSnapPointOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
|
|
129
|
+
}, [activeSnapPointOffset, snapPointRange]);
|
|
130
|
+
const swipeDirections = React.useMemo(() => {
|
|
131
|
+
if (snapPoints && snapPoints.length > 0 && (swipeDirection === 'down' || swipeDirection === 'up')) {
|
|
132
|
+
return swipeDirection === 'down' ? ['down', 'up'] : ['up', 'down'];
|
|
133
|
+
}
|
|
134
|
+
return [swipeDirection];
|
|
135
|
+
}, [snapPoints, swipeDirection]);
|
|
136
|
+
const setSwipeDismissed = useStableCallback(dismissed => {
|
|
137
|
+
setSwipeDismissedElements(store.context.popupRef.current, store.context.backdropRef.current, dismissed);
|
|
138
|
+
});
|
|
139
|
+
const clearSwipeRelease = useStableCallback(() => {
|
|
140
|
+
setSwipeDismissed(false);
|
|
141
|
+
store.context.popupRef.current?.removeAttribute(TransitionStatusDataAttributes.endingStyle);
|
|
142
|
+
setSwipeRelease(null);
|
|
143
|
+
});
|
|
144
|
+
const applySwipeProgress = useStableCallback(({
|
|
145
|
+
resolvedProgress,
|
|
146
|
+
shouldTrackProgress,
|
|
147
|
+
notifyParent
|
|
148
|
+
}) => {
|
|
149
|
+
const isActive = open && !nested && shouldTrackProgress;
|
|
150
|
+
const swipeProgress = isActive ? resolvedProgress : 0;
|
|
151
|
+
if (notifyParent && notifyParentSwipeProgressChange) {
|
|
152
|
+
const nestedSwipeProgress = open && shouldTrackProgress ? resolvedProgress : 0;
|
|
153
|
+
notifyParentSwipeProgressChange(nestedSwipeProgress);
|
|
154
|
+
}
|
|
155
|
+
visualStateStore?.set({
|
|
156
|
+
swipeProgress,
|
|
157
|
+
frontmostHeight: swipeProgress > 0 ? frontmostHeight : 0
|
|
158
|
+
});
|
|
159
|
+
const backdropElement = store.context.backdropRef.current;
|
|
160
|
+
if (!backdropElement) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
if (!isActive || swipeProgress <= 0) {
|
|
164
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');
|
|
165
|
+
backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, `${swipeProgress}`);
|
|
169
|
+
if (frontmostHeight > 0) {
|
|
170
|
+
backdropElement.style.setProperty(DrawerPopupCssVars.height, `${frontmostHeight}px`);
|
|
171
|
+
} else {
|
|
172
|
+
backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
function resolveSwipeRelease({
|
|
176
|
+
direction,
|
|
177
|
+
deltaX,
|
|
178
|
+
deltaY,
|
|
179
|
+
velocityX,
|
|
180
|
+
velocityY,
|
|
181
|
+
releaseVelocityX,
|
|
182
|
+
releaseVelocityY
|
|
183
|
+
}) {
|
|
184
|
+
if (!direction) {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
const popupElement = store.context.popupRef.current;
|
|
188
|
+
if (!popupElement) {
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
const size = direction === 'left' || direction === 'right' ? popupElement.offsetWidth : popupElement.offsetHeight;
|
|
192
|
+
if (!Number.isFinite(size) || size <= 0) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
const axisDelta = direction === 'left' || direction === 'right' ? deltaX : deltaY;
|
|
196
|
+
const snapPointBaseOffset = snapPoints && snapPoints.length > 0 ? activeSnapPointOffset ?? 0 : 0;
|
|
197
|
+
let baseOffset = 0;
|
|
198
|
+
if (direction === 'down') {
|
|
199
|
+
baseOffset = snapPointBaseOffset;
|
|
200
|
+
} else if (direction === 'up') {
|
|
201
|
+
baseOffset = -snapPointBaseOffset;
|
|
202
|
+
}
|
|
203
|
+
const translation = baseOffset + axisDelta;
|
|
204
|
+
const translationAlongDirection = direction === 'left' || direction === 'up' ? -translation : translation;
|
|
205
|
+
const remainingDistance = Math.max(0, size - translationAlongDirection);
|
|
206
|
+
if (!Number.isFinite(remainingDistance) || remainingDistance <= 0) {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
const axisVelocity = direction === 'left' || direction === 'right' ? releaseVelocityX : releaseVelocityY;
|
|
210
|
+
const fallbackVelocity = direction === 'left' || direction === 'right' ? velocityX : velocityY;
|
|
211
|
+
const resolvedVelocity = Math.abs(axisVelocity) > 0 && Number.isFinite(axisVelocity) ? axisVelocity : fallbackVelocity;
|
|
212
|
+
const directionalVelocity = direction === 'left' || direction === 'up' ? -resolvedVelocity : resolvedVelocity;
|
|
213
|
+
if (!Number.isFinite(directionalVelocity) || directionalVelocity <= MIN_SWIPE_RELEASE_VELOCITY) {
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
const clampedVelocity = clamp(directionalVelocity, MIN_SWIPE_RELEASE_VELOCITY, MAX_SWIPE_RELEASE_VELOCITY);
|
|
217
|
+
const durationMs = clamp(remainingDistance / clampedVelocity, MIN_SWIPE_RELEASE_DURATION_MS, MAX_SWIPE_RELEASE_DURATION_MS);
|
|
218
|
+
if (!Number.isFinite(durationMs)) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
const normalizedDuration = (durationMs - MIN_SWIPE_RELEASE_DURATION_MS) / (MAX_SWIPE_RELEASE_DURATION_MS - MIN_SWIPE_RELEASE_DURATION_MS);
|
|
222
|
+
const durationScalar = clamp(MIN_SWIPE_RELEASE_SCALAR + normalizedDuration * (MAX_SWIPE_RELEASE_SCALAR - MIN_SWIPE_RELEASE_SCALAR), MIN_SWIPE_RELEASE_SCALAR, MAX_SWIPE_RELEASE_SCALAR);
|
|
223
|
+
if (!Number.isFinite(durationScalar) || durationScalar <= 0) {
|
|
224
|
+
return null;
|
|
225
|
+
}
|
|
226
|
+
return durationScalar;
|
|
227
|
+
}
|
|
228
|
+
function updateNestedSwipeActive(details) {
|
|
229
|
+
if (nestedSwipeActiveRef.current || !details) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const direction = details.direction ?? swipeDirection;
|
|
233
|
+
const delta = direction === 'left' || direction === 'right' ? details.deltaX : details.deltaY;
|
|
234
|
+
if (!Number.isFinite(delta) || Math.abs(delta) < MIN_SWIPE_THRESHOLD) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
nestedSwipeActiveRef.current = true;
|
|
238
|
+
notifyParentSwipingChange?.(true);
|
|
239
|
+
}
|
|
240
|
+
const swipe = useSwipeDismiss({
|
|
241
|
+
enabled: mounted && !nestedDrawerOpen,
|
|
242
|
+
directions: swipeDirections,
|
|
243
|
+
elementRef: store.context.popupRef,
|
|
244
|
+
ignoreSelectorWhenTouch: false,
|
|
245
|
+
ignoreScrollableAncestors: true,
|
|
246
|
+
movementCssVars: {
|
|
247
|
+
x: DrawerPopupCssVars.swipeMovementX,
|
|
248
|
+
y: DrawerPopupCssVars.swipeMovementY
|
|
249
|
+
},
|
|
250
|
+
onSwipeStart(event) {
|
|
251
|
+
if ('touches' in event || 'pointerType' in event && event.pointerType === 'touch') {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
const popupElement = store.context.popupRef.current;
|
|
255
|
+
if (!popupElement) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const doc = ownerDocument(popupElement);
|
|
259
|
+
const selection = doc.getSelection?.();
|
|
260
|
+
if (!selection || selection.isCollapsed) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;
|
|
264
|
+
const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;
|
|
265
|
+
if (!contains(popupElement, anchorElement) && !contains(popupElement, focusElement)) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
selection.removeAllRanges();
|
|
269
|
+
},
|
|
270
|
+
onSwipingChange(swiping) {
|
|
271
|
+
setBackdropSwipingAttribute(store.context.backdropRef.current, swiping);
|
|
272
|
+
if (!swiping) {
|
|
273
|
+
nestedSwipeActiveRef.current = false;
|
|
274
|
+
notifyParentSwipingChange?.(false);
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
swipeThreshold({
|
|
278
|
+
element,
|
|
279
|
+
direction
|
|
280
|
+
}) {
|
|
281
|
+
return getBaseSwipeThreshold(element, direction);
|
|
282
|
+
},
|
|
283
|
+
canStart(position, details) {
|
|
284
|
+
const popupElement = store.context.popupRef.current;
|
|
285
|
+
if (!popupElement) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
const doc = popupElement.ownerDocument;
|
|
289
|
+
const elementAtPoint = getElementAtPoint(doc, position.x, position.y);
|
|
290
|
+
if (!elementAtPoint || !contains(popupElement, elementAtPoint)) {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
const nativeEvent = details.nativeEvent;
|
|
294
|
+
const touchLike = 'touches' in nativeEvent || 'pointerType' in nativeEvent && nativeEvent.pointerType === 'touch';
|
|
295
|
+
if (touchLike && shouldIgnoreSwipeForTextSelection(doc, popupElement)) {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
if (nativeEvent.type === 'touchstart' && isSwipeIgnoredTarget(elementAtPoint)) {
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
return true;
|
|
302
|
+
},
|
|
303
|
+
onProgress(progress, details) {
|
|
304
|
+
updateNestedSwipeActive(details);
|
|
305
|
+
const currentDirection = details?.direction ?? swipe.swipeDirection;
|
|
306
|
+
const isDismissSwipe = currentDirection === undefined || currentDirection === swipeDirection;
|
|
307
|
+
const hasSnapPoints = Boolean(snapPoints && snapPoints.length > 0);
|
|
308
|
+
const isVerticalSwipe = swipeDirection === 'down' || swipeDirection === 'up';
|
|
309
|
+
const shouldTrackProgress = hasSnapPoints && isVerticalSwipe || !hasSnapPoints || swipeDirection === 'left' || swipeDirection === 'right' || isDismissSwipe;
|
|
310
|
+
let resolvedProgress = progress;
|
|
311
|
+
if (snapPointRange && popupHeight > 0) {
|
|
312
|
+
if (details && Number.isFinite(details.deltaY)) {
|
|
313
|
+
const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;
|
|
314
|
+
const nextOffset = clamp(baseOffset + details.deltaY, 0, popupHeight);
|
|
315
|
+
resolvedProgress = clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
|
|
316
|
+
} else if (snapPointProgress !== null) {
|
|
317
|
+
resolvedProgress = snapPointProgress;
|
|
318
|
+
} else if (currentDirection === 'down' || currentDirection === 'up') {
|
|
319
|
+
const displacement = progress * popupHeight;
|
|
320
|
+
const baseOffset = activeSnapPointOffset ?? snapPointRange.minOffset;
|
|
321
|
+
const nextOffset = currentDirection === 'down' ? baseOffset + displacement : baseOffset - displacement;
|
|
322
|
+
resolvedProgress = clamp((nextOffset - snapPointRange.minOffset) / snapPointRange.range, 0, 1);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
applySwipeProgress({
|
|
326
|
+
resolvedProgress,
|
|
327
|
+
shouldTrackProgress,
|
|
328
|
+
notifyParent: true
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
onRelease({
|
|
332
|
+
event,
|
|
333
|
+
deltaX,
|
|
334
|
+
deltaY,
|
|
335
|
+
direction,
|
|
336
|
+
velocityX,
|
|
337
|
+
velocityY,
|
|
338
|
+
releaseVelocityX,
|
|
339
|
+
releaseVelocityY
|
|
340
|
+
}) {
|
|
341
|
+
const swipeReleasePayload = {
|
|
342
|
+
deltaX,
|
|
343
|
+
deltaY,
|
|
344
|
+
velocityX,
|
|
345
|
+
velocityY,
|
|
346
|
+
releaseVelocityX,
|
|
347
|
+
releaseVelocityY
|
|
348
|
+
};
|
|
349
|
+
function startSwipeRelease(resolvedDirection) {
|
|
350
|
+
// Start ending transition styles earlier and synchronously to prevent a period where
|
|
351
|
+
// the popup appears stuck on release before the actual closing animation starts.
|
|
352
|
+
const popupElement = store.context.popupRef.current;
|
|
353
|
+
if (!popupElement) {
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
notifyParentSwipingChange?.(false);
|
|
357
|
+
setSwipeDismissed(true);
|
|
358
|
+
popupElement.style.removeProperty('transition');
|
|
359
|
+
popupElement.setAttribute(TransitionStatusDataAttributes.endingStyle, '');
|
|
360
|
+
ReactDOM.flushSync(() => {
|
|
361
|
+
setSwipeRelease(resolveSwipeRelease({
|
|
362
|
+
direction: resolvedDirection,
|
|
363
|
+
...swipeReleasePayload
|
|
364
|
+
}));
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
if (!snapPoints || snapPoints.length === 0) {
|
|
368
|
+
if (!direction) {
|
|
369
|
+
clearSwipeRelease();
|
|
370
|
+
return undefined;
|
|
371
|
+
}
|
|
372
|
+
const element = store.context.popupRef.current;
|
|
373
|
+
if (!element) {
|
|
374
|
+
clearSwipeRelease();
|
|
375
|
+
return undefined;
|
|
376
|
+
}
|
|
377
|
+
const baseThreshold = getBaseSwipeThreshold(element, direction);
|
|
378
|
+
const delta = direction === 'left' || direction === 'right' ? deltaX : deltaY;
|
|
379
|
+
if (!Number.isFinite(delta)) {
|
|
380
|
+
clearSwipeRelease();
|
|
381
|
+
return undefined;
|
|
382
|
+
}
|
|
383
|
+
const directionalDelta = direction === 'left' || direction === 'up' ? -delta : delta;
|
|
384
|
+
if (directionalDelta <= 0) {
|
|
385
|
+
clearSwipeRelease();
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
const velocity = direction === 'left' || direction === 'right' ? velocityX : velocityY;
|
|
389
|
+
const directionalVelocity = direction === 'left' || direction === 'up' ? -velocity : velocity;
|
|
390
|
+
if (directionalVelocity >= FAST_SWIPE_VELOCITY && directionalDelta > 0) {
|
|
391
|
+
startSwipeRelease(direction);
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
const shouldClose = directionalDelta > baseThreshold;
|
|
395
|
+
if (shouldClose) {
|
|
396
|
+
startSwipeRelease(direction);
|
|
397
|
+
} else {
|
|
398
|
+
clearSwipeRelease();
|
|
399
|
+
}
|
|
400
|
+
return shouldClose;
|
|
401
|
+
}
|
|
402
|
+
if (swipeDirection !== 'down' && swipeDirection !== 'up') {
|
|
403
|
+
clearSwipeRelease();
|
|
404
|
+
return undefined;
|
|
405
|
+
}
|
|
406
|
+
if (!popupHeight || resolvedSnapPoints.length === 0) {
|
|
407
|
+
clearSwipeRelease();
|
|
408
|
+
return undefined;
|
|
409
|
+
}
|
|
410
|
+
const dragDelta = swipeDirection === 'down' ? deltaY : -deltaY;
|
|
411
|
+
if (!Number.isFinite(dragDelta)) {
|
|
412
|
+
clearSwipeRelease();
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
const dragDirection = Math.sign(dragDelta);
|
|
416
|
+
const releaseDirectionalVelocity = swipeDirection === 'down' ? releaseVelocityY : -releaseVelocityY;
|
|
417
|
+
const fallbackDirectionalVelocity = swipeDirection === 'down' ? velocityY : -velocityY;
|
|
418
|
+
let resolvedDirectionalVelocity = Number.isFinite(releaseDirectionalVelocity) ? releaseDirectionalVelocity : fallbackDirectionalVelocity;
|
|
419
|
+
if (dragDirection !== 0 && Math.abs(dragDelta) >= MIN_SWIPE_THRESHOLD && Number.isFinite(resolvedDirectionalVelocity)) {
|
|
420
|
+
const velocityDirection = Math.sign(resolvedDirectionalVelocity);
|
|
421
|
+
if (velocityDirection !== 0 && velocityDirection !== dragDirection) {
|
|
422
|
+
// Ignore touch reversals that would otherwise flip the snap decision.
|
|
423
|
+
resolvedDirectionalVelocity = fallbackDirectionalVelocity;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
const currentOffset = activeSnapPointOffset ?? 0;
|
|
427
|
+
const dragTargetOffset = clamp(currentOffset + dragDelta, 0, popupHeight);
|
|
428
|
+
const velocityOffset = Number.isFinite(resolvedDirectionalVelocity) && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD ? clamp(resolvedDirectionalVelocity, -MAX_SNAP_VELOCITY, MAX_SNAP_VELOCITY) * SNAP_VELOCITY_MULTIPLIER : 0;
|
|
429
|
+
const targetOffset = snapToSequentialPoints ? dragTargetOffset : clamp(dragTargetOffset + velocityOffset, 0, popupHeight);
|
|
430
|
+
const snapPointEventDetails = createChangeEventDetails(REASONS.swipe, event);
|
|
431
|
+
const closeFromSnapPoints = () => {
|
|
432
|
+
pendingSwipeCloseSnapPointRef.current = activeSnapPoint;
|
|
433
|
+
setActiveSnapPoint?.(null, snapPointEventDetails);
|
|
434
|
+
startSwipeRelease(swipeDirection);
|
|
435
|
+
return true;
|
|
436
|
+
};
|
|
437
|
+
if (snapToSequentialPoints) {
|
|
438
|
+
const orderedSnapPoints = [...resolvedSnapPoints].sort((first, second) => first.offset - second.offset);
|
|
439
|
+
if (orderedSnapPoints.length === 0) {
|
|
440
|
+
clearSwipeRelease();
|
|
441
|
+
return false;
|
|
442
|
+
}
|
|
443
|
+
let currentIndex = 0;
|
|
444
|
+
let closestDistance = Math.abs(currentOffset - orderedSnapPoints[0].offset);
|
|
445
|
+
for (let index = 1; index < orderedSnapPoints.length; index += 1) {
|
|
446
|
+
const distance = Math.abs(currentOffset - orderedSnapPoints[index].offset);
|
|
447
|
+
if (distance < closestDistance) {
|
|
448
|
+
closestDistance = distance;
|
|
449
|
+
currentIndex = index;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
let targetSnapPoint = orderedSnapPoints[0];
|
|
453
|
+
closestDistance = Math.abs(targetOffset - targetSnapPoint.offset);
|
|
454
|
+
for (const snapPoint of orderedSnapPoints) {
|
|
455
|
+
const distance = Math.abs(targetOffset - snapPoint.offset);
|
|
456
|
+
if (distance < closestDistance) {
|
|
457
|
+
closestDistance = distance;
|
|
458
|
+
targetSnapPoint = snapPoint;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
const velocityDirection = Math.sign(resolvedDirectionalVelocity);
|
|
462
|
+
const shouldAdvance = dragDirection !== 0 && velocityDirection !== 0 && velocityDirection === dragDirection && Math.abs(resolvedDirectionalVelocity) >= SNAP_VELOCITY_THRESHOLD;
|
|
463
|
+
let effectiveTargetOffset = targetOffset;
|
|
464
|
+
if (shouldAdvance) {
|
|
465
|
+
const adjacentIndex = clamp(currentIndex + dragDirection, 0, orderedSnapPoints.length - 1);
|
|
466
|
+
if (adjacentIndex !== currentIndex) {
|
|
467
|
+
const adjacentPoint = orderedSnapPoints[adjacentIndex];
|
|
468
|
+
const shouldForceAdjacent = dragDirection > 0 ? targetOffset < adjacentPoint.offset : targetOffset > adjacentPoint.offset;
|
|
469
|
+
if (shouldForceAdjacent) {
|
|
470
|
+
targetSnapPoint = adjacentPoint;
|
|
471
|
+
effectiveTargetOffset = adjacentPoint.offset;
|
|
472
|
+
}
|
|
473
|
+
} else if (dragDirection > 0) {
|
|
474
|
+
return closeFromSnapPoints();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
const closeOffset = popupHeight;
|
|
478
|
+
const closeDistance = Math.abs(effectiveTargetOffset - closeOffset);
|
|
479
|
+
const snapDistance = Math.abs(effectiveTargetOffset - targetSnapPoint.offset);
|
|
480
|
+
if (closeDistance < snapDistance) {
|
|
481
|
+
return closeFromSnapPoints();
|
|
482
|
+
}
|
|
483
|
+
setActiveSnapPoint?.(targetSnapPoint.value, snapPointEventDetails);
|
|
484
|
+
clearSwipeRelease();
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
if (resolvedDirectionalVelocity >= FAST_SWIPE_VELOCITY && dragDelta > 0) {
|
|
488
|
+
return closeFromSnapPoints();
|
|
489
|
+
}
|
|
490
|
+
let closestSnapPoint = resolvedSnapPoints[0];
|
|
491
|
+
let closestDistance = Math.abs(targetOffset - closestSnapPoint.offset);
|
|
492
|
+
for (const snapPoint of resolvedSnapPoints) {
|
|
493
|
+
const distance = Math.abs(targetOffset - snapPoint.offset);
|
|
494
|
+
if (distance < closestDistance) {
|
|
495
|
+
closestDistance = distance;
|
|
496
|
+
closestSnapPoint = snapPoint;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
const closeOffset = popupHeight;
|
|
500
|
+
const closeDistance = Math.abs(targetOffset - closeOffset);
|
|
501
|
+
if (closeDistance < closestDistance) {
|
|
502
|
+
return closeFromSnapPoints();
|
|
503
|
+
}
|
|
504
|
+
setActiveSnapPoint?.(closestSnapPoint.value, snapPointEventDetails);
|
|
505
|
+
clearSwipeRelease();
|
|
506
|
+
return false;
|
|
507
|
+
},
|
|
508
|
+
onDismiss(event) {
|
|
509
|
+
visualStateStore?.set({
|
|
510
|
+
swipeProgress: 0,
|
|
511
|
+
frontmostHeight: 0
|
|
512
|
+
});
|
|
513
|
+
const backdropElement = store.context.backdropRef.current;
|
|
514
|
+
if (backdropElement) {
|
|
515
|
+
backdropElement.style.setProperty(DrawerBackdropCssVars.swipeProgress, '0');
|
|
516
|
+
backdropElement.style.removeProperty(DrawerPopupCssVars.height);
|
|
517
|
+
}
|
|
518
|
+
const dismissEventDetails = createChangeEventDetails(REASONS.swipe, event);
|
|
519
|
+
store.setOpen(false, dismissEventDetails);
|
|
520
|
+
if (dismissEventDetails.isCanceled) {
|
|
521
|
+
const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;
|
|
522
|
+
if (pendingSnapPoint !== undefined) {
|
|
523
|
+
setActiveSnapPoint?.(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, event));
|
|
524
|
+
}
|
|
525
|
+
pendingSwipeCloseSnapPointRef.current = undefined;
|
|
526
|
+
resetSwipeRef.current?.();
|
|
527
|
+
clearSwipeRelease();
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// In controlled mode, the effective open state may not have changed yet
|
|
532
|
+
// (openProp takes precedence over state.open). Proceed optimistically with the
|
|
533
|
+
// dismiss animation — React's Scheduler flushes before the next rAF, so we can
|
|
534
|
+
// reliably check whether the parent accepted or rejected the close.
|
|
535
|
+
// Note: if onOpenChange is asynchronous (e.g., closes the drawer after a network
|
|
536
|
+
// call), the rAF check will see open === true, revert the animation, and the
|
|
537
|
+
// drawer will close without animation when the parent eventually sets open={false}.
|
|
538
|
+
if (store.select('open')) {
|
|
539
|
+
const savedEvent = event;
|
|
540
|
+
controlledDismissFrame.request(() => {
|
|
541
|
+
if (store.select('open')) {
|
|
542
|
+
// Parent rejected: revert animation and restore snap point.
|
|
543
|
+
const pendingSnapPoint = pendingSwipeCloseSnapPointRef.current;
|
|
544
|
+
if (pendingSnapPoint !== undefined) {
|
|
545
|
+
setActiveSnapPoint?.(pendingSnapPoint, createChangeEventDetails(REASONS.swipe, savedEvent));
|
|
546
|
+
}
|
|
547
|
+
pendingSwipeCloseSnapPointRef.current = undefined;
|
|
548
|
+
clearSwipeRelease();
|
|
549
|
+
resetSwipeRef.current?.();
|
|
550
|
+
} else {
|
|
551
|
+
// Parent accepted: clean up the ref.
|
|
552
|
+
pendingSwipeCloseSnapPointRef.current = undefined;
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
pendingSwipeCloseSnapPointRef.current = undefined;
|
|
558
|
+
setSwipeDismissed(true);
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
const swipePointerProps = swipe.getPointerProps();
|
|
562
|
+
const swipeTouchProps = swipe.getTouchProps();
|
|
563
|
+
const resetSwipe = swipe.reset;
|
|
564
|
+
resetSwipeRef.current = resetSwipe;
|
|
565
|
+
React.useEffect(() => {
|
|
566
|
+
const rootElement = viewportElement ?? popupElementState;
|
|
567
|
+
if (!rootElement) {
|
|
568
|
+
return undefined;
|
|
569
|
+
}
|
|
570
|
+
const resolvedRootElement = rootElement;
|
|
571
|
+
const doc = ownerDocument(resolvedRootElement);
|
|
572
|
+
const win = ownerWindow(doc);
|
|
573
|
+
function handleNativeTouchMove(event) {
|
|
574
|
+
if (ignoreTouchSwipeRef.current) {
|
|
575
|
+
return;
|
|
576
|
+
}
|
|
577
|
+
const touchState = touchScrollStateRef.current;
|
|
578
|
+
const touch = event.touches[0];
|
|
579
|
+
if (!touch || !touchState) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const drawerAxisDelta = isVerticalScrollAxis ? touch.clientY - touchState.lastY : touch.clientX - touchState.lastX;
|
|
583
|
+
|
|
584
|
+
// Preserve native range interaction by never locking touchmove for range inputs.
|
|
585
|
+
if (isEventOnRangeInput(event, win)) {
|
|
586
|
+
touchState.allowSwipe = false;
|
|
587
|
+
updateTouchScrollPosition(touchState, touch);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// Avoid blocking pinch zoom or text selection adjustments on iOS Safari.
|
|
592
|
+
if (event.touches.length === 2) {
|
|
593
|
+
updateTouchScrollPosition(touchState, touch);
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
const allowTouchMove = shouldIgnoreSwipeForTextSelection(doc, resolvedRootElement);
|
|
597
|
+
if (allowTouchMove || !open || !mounted || nestedDrawerOpen) {
|
|
598
|
+
updateTouchScrollPosition(touchState, touch);
|
|
599
|
+
return;
|
|
600
|
+
}
|
|
601
|
+
if (preserveNativeCrossAxisScrollOnMove(touchState, touch, isVerticalScrollAxis)) {
|
|
602
|
+
updateTouchScrollPosition(touchState, touch);
|
|
603
|
+
return;
|
|
604
|
+
}
|
|
605
|
+
const scrollTarget = touchState.scrollTarget;
|
|
606
|
+
if (!scrollTarget || scrollTarget === doc.documentElement || scrollTarget === doc.body) {
|
|
607
|
+
if (event.cancelable) {
|
|
608
|
+
event.preventDefault();
|
|
609
|
+
}
|
|
610
|
+
updateTouchScrollPosition(touchState, touch);
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
const hasScrollableContent = hasScrollableContentOnAxis(scrollTarget, scrollAxis);
|
|
614
|
+
if (!hasScrollableContent) {
|
|
615
|
+
// If the scroll container doesn't overflow on the drawer axis, prevent the window from
|
|
616
|
+
// scrolling instead.
|
|
617
|
+
if (event.cancelable) {
|
|
618
|
+
event.preventDefault();
|
|
619
|
+
}
|
|
620
|
+
updateTouchScrollPosition(touchState, touch);
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const delta = drawerAxisDelta;
|
|
624
|
+
if (delta !== 0) {
|
|
625
|
+
const canSwipeFromScrollEdge = canSwipeFromScrollEdgeOnMove(scrollTarget, scrollAxis, swipeDirection, delta);
|
|
626
|
+
if (!touchState.allowSwipe) {
|
|
627
|
+
if (!event.cancelable) {
|
|
628
|
+
touchState.allowSwipe = false;
|
|
629
|
+
} else if (canSwipeFromScrollEdge) {
|
|
630
|
+
touchState.allowSwipe = true;
|
|
631
|
+
event.preventDefault();
|
|
632
|
+
} else {
|
|
633
|
+
touchState.allowSwipe = false;
|
|
634
|
+
}
|
|
635
|
+
} else if (event.cancelable) {
|
|
636
|
+
event.preventDefault();
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
updateTouchScrollPosition(touchState, touch);
|
|
640
|
+
}
|
|
641
|
+
doc.addEventListener('touchmove', handleNativeTouchMove, {
|
|
642
|
+
passive: false,
|
|
643
|
+
capture: true
|
|
644
|
+
});
|
|
645
|
+
return () => {
|
|
646
|
+
doc.removeEventListener('touchmove', handleNativeTouchMove, {
|
|
647
|
+
capture: true
|
|
648
|
+
});
|
|
649
|
+
};
|
|
650
|
+
}, [mounted, nestedDrawerOpen, open, popupElementState, isVerticalScrollAxis, scrollAxis, swipeDirection, viewportElement]);
|
|
651
|
+
React.useEffect(() => {
|
|
652
|
+
if (!snapPointRange || swipe.swiping) {
|
|
653
|
+
return;
|
|
654
|
+
}
|
|
655
|
+
const resolvedProgress = !open || nested ? 0 : snapPointProgress ?? 0;
|
|
656
|
+
applySwipeProgress({
|
|
657
|
+
resolvedProgress,
|
|
658
|
+
shouldTrackProgress: true,
|
|
659
|
+
notifyParent: false
|
|
660
|
+
});
|
|
661
|
+
}, [applySwipeProgress, frontmostHeight, nested, notifyParentSwipeProgressChange, open, snapPointProgress, snapPointRange, swipe.swiping, store, visualStateStore]);
|
|
662
|
+
React.useEffect(() => {
|
|
663
|
+
if (!notifyParentSwipeProgressChange) {
|
|
664
|
+
return undefined;
|
|
665
|
+
}
|
|
666
|
+
if (!open) {
|
|
667
|
+
notifyParentSwipeProgressChange(0);
|
|
668
|
+
}
|
|
669
|
+
return () => {
|
|
670
|
+
notifyParentSwipeProgressChange(0);
|
|
671
|
+
};
|
|
672
|
+
}, [notifyParentSwipeProgressChange, open]);
|
|
673
|
+
React.useEffect(() => {
|
|
674
|
+
if (open) {
|
|
675
|
+
resetSwipe();
|
|
676
|
+
clearSwipeRelease();
|
|
677
|
+
}
|
|
678
|
+
}, [clearSwipeRelease, open, resetSwipe]);
|
|
679
|
+
React.useEffect(() => {
|
|
680
|
+
return () => {
|
|
681
|
+
visualStateStore?.set({
|
|
682
|
+
swipeProgress: 0,
|
|
683
|
+
frontmostHeight: 0
|
|
684
|
+
});
|
|
685
|
+
setBackdropSwipingAttribute(store.context.backdropRef.current, false);
|
|
686
|
+
notifyParentSwipingChange?.(false);
|
|
687
|
+
};
|
|
688
|
+
}, [notifyParentSwipingChange, store, visualStateStore]);
|
|
689
|
+
const swipeProviderValue = React.useMemo(() => ({
|
|
690
|
+
swiping: swipe.swiping,
|
|
691
|
+
getDragStyles: swipe.getDragStyles,
|
|
692
|
+
swipeStrength: swipeRelease ?? null,
|
|
693
|
+
setSwipeDismissed(dismissed) {
|
|
694
|
+
setSwipeDismissedElements(store.context.popupRef.current, store.context.backdropRef.current, dismissed);
|
|
695
|
+
}
|
|
696
|
+
}), [store, swipe.getDragStyles, swipe.swiping, swipeRelease]);
|
|
697
|
+
function resetTouchTrackingState() {
|
|
698
|
+
ignoreTouchSwipeRef.current = false;
|
|
699
|
+
touchScrollStateRef.current = null;
|
|
700
|
+
lastPointerTypeRef.current = '';
|
|
701
|
+
ignoreNextTouchStartFromPenRef.current = false;
|
|
702
|
+
}
|
|
703
|
+
return /*#__PURE__*/_jsx(DialogViewport, {
|
|
704
|
+
ref: forwardedRef,
|
|
705
|
+
className: className,
|
|
706
|
+
render: render,
|
|
707
|
+
...mergeProps(elementProps, {
|
|
708
|
+
onPointerDown(event) {
|
|
709
|
+
lastPointerTypeRef.current = event.pointerType;
|
|
710
|
+
ignoreNextTouchStartFromPenRef.current = event.pointerType === 'pen';
|
|
711
|
+
if (!open || !mounted || nestedDrawerOpen) {
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
const doc = ownerDocument(event.currentTarget);
|
|
715
|
+
const elementAtPoint = getElementAtPoint(doc, event.clientX, event.clientY);
|
|
716
|
+
if (isSwipeIgnoredTarget(elementAtPoint) || isDrawerContentTarget(elementAtPoint)) {
|
|
717
|
+
return;
|
|
718
|
+
}
|
|
719
|
+
if (event.pointerType === 'touch') {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
swipePointerProps.onPointerDown?.(event);
|
|
723
|
+
},
|
|
724
|
+
onPointerMove(event) {
|
|
725
|
+
if (event.pointerType === 'touch') {
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
swipePointerProps.onPointerMove?.(event);
|
|
729
|
+
},
|
|
730
|
+
onPointerUp(event) {
|
|
731
|
+
if (lastPointerTypeRef.current === event.pointerType) {
|
|
732
|
+
lastPointerTypeRef.current = '';
|
|
733
|
+
}
|
|
734
|
+
if (event.pointerType === 'touch') {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
swipePointerProps.onPointerUp?.(event);
|
|
738
|
+
},
|
|
739
|
+
onPointerCancel(event) {
|
|
740
|
+
if (lastPointerTypeRef.current === event.pointerType) {
|
|
741
|
+
lastPointerTypeRef.current = '';
|
|
742
|
+
}
|
|
743
|
+
if (event.pointerType === 'touch') {
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
swipePointerProps.onPointerCancel?.(event);
|
|
747
|
+
},
|
|
748
|
+
onTouchStart(event) {
|
|
749
|
+
const startedFromPenPointerDown = lastPointerTypeRef.current === 'pen' && ignoreNextTouchStartFromPenRef.current;
|
|
750
|
+
if (startedFromPenPointerDown) {
|
|
751
|
+
ignoreNextTouchStartFromPenRef.current = false;
|
|
752
|
+
ignoreTouchSwipeRef.current = false;
|
|
753
|
+
touchScrollStateRef.current = null;
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
if (!open || !mounted || nestedDrawerOpen) {
|
|
757
|
+
ignoreTouchSwipeRef.current = false;
|
|
758
|
+
touchScrollStateRef.current = null;
|
|
759
|
+
return;
|
|
760
|
+
}
|
|
761
|
+
const touch = event.touches[0];
|
|
762
|
+
if (!touch) {
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
if (isReactTouchEventOnRangeInput(event)) {
|
|
766
|
+
ignoreTouchSwipeRef.current = false;
|
|
767
|
+
touchScrollStateRef.current = null;
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
const doc = ownerDocument(event.currentTarget);
|
|
771
|
+
const elementAtPoint = getElementAtPoint(doc, touch.clientX, touch.clientY);
|
|
772
|
+
ignoreTouchSwipeRef.current = isSwipeIgnoredTarget(elementAtPoint);
|
|
773
|
+
if (ignoreTouchSwipeRef.current) {
|
|
774
|
+
touchScrollStateRef.current = null;
|
|
775
|
+
return;
|
|
776
|
+
}
|
|
777
|
+
const rootElement = viewportElement ?? popupElementState;
|
|
778
|
+
const target = isElement(event.target) ? event.target : null;
|
|
779
|
+
let scrollTarget = null;
|
|
780
|
+
let hasCrossAxisScrollableContent = false;
|
|
781
|
+
if (rootElement && target && contains(rootElement, target)) {
|
|
782
|
+
scrollTarget = findScrollableTouchTarget(target, rootElement, scrollAxis);
|
|
783
|
+
hasCrossAxisScrollableContent = findScrollableTouchTarget(target, rootElement, crossScrollAxis) != null;
|
|
784
|
+
}
|
|
785
|
+
let allowSwipe = null;
|
|
786
|
+
if (scrollTarget) {
|
|
787
|
+
const canSwipeFromEdge = isAtSwipeStartEdge(scrollTarget, scrollAxis, swipeDirection);
|
|
788
|
+
allowSwipe = canSwipeFromEdge ? null : false;
|
|
789
|
+
}
|
|
790
|
+
touchScrollStateRef.current = {
|
|
791
|
+
startX: touch.clientX,
|
|
792
|
+
startY: touch.clientY,
|
|
793
|
+
lastX: touch.clientX,
|
|
794
|
+
lastY: touch.clientY,
|
|
795
|
+
scrollTarget,
|
|
796
|
+
hasCrossAxisScrollableContent,
|
|
797
|
+
allowSwipe,
|
|
798
|
+
preserveNativeCrossAxisScroll: false
|
|
799
|
+
};
|
|
800
|
+
swipeTouchProps.onTouchStart?.(event);
|
|
801
|
+
},
|
|
802
|
+
onTouchMove(event) {
|
|
803
|
+
if (ignoreTouchSwipeRef.current) {
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
if (isReactTouchEventOnRangeInput(event)) {
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
const touchState = touchScrollStateRef.current;
|
|
810
|
+
if (touchState?.preserveNativeCrossAxisScroll) {
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
if (touchState?.allowSwipe === false || touchState?.scrollTarget != null && !touchState.allowSwipe) {
|
|
814
|
+
return;
|
|
815
|
+
}
|
|
816
|
+
swipeTouchProps.onTouchMove?.(event);
|
|
817
|
+
},
|
|
818
|
+
onTouchEnd(event) {
|
|
819
|
+
resetTouchTrackingState();
|
|
820
|
+
swipeTouchProps.onTouchEnd?.(event);
|
|
821
|
+
},
|
|
822
|
+
onTouchCancel(event) {
|
|
823
|
+
resetTouchTrackingState();
|
|
824
|
+
swipeTouchProps.onTouchCancel?.(event);
|
|
825
|
+
},
|
|
826
|
+
// Drawer popups use drawer-specific nested state attributes.
|
|
827
|
+
// Suppress DialogViewport's generic nested dialog attribute.
|
|
828
|
+
['data-nested-dialog-open']: undefined
|
|
829
|
+
}),
|
|
830
|
+
children: /*#__PURE__*/_jsx(DrawerViewportContext.Provider, {
|
|
831
|
+
value: swipeProviderValue,
|
|
832
|
+
children: children
|
|
833
|
+
})
|
|
834
|
+
});
|
|
835
|
+
});
|
|
836
|
+
if (process.env.NODE_ENV !== "production") DrawerViewport.displayName = "DrawerViewport";
|
|
837
|
+
function setSwipeDismissedElements(popupElement, backdropElement, dismissed) {
|
|
838
|
+
if (dismissed) {
|
|
839
|
+
popupElement?.setAttribute(DrawerPopupDataAttributes.swipeDismiss, '');
|
|
840
|
+
backdropElement?.setAttribute(DrawerPopupDataAttributes.swipeDismiss, '');
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
popupElement?.removeAttribute(DrawerPopupDataAttributes.swipeDismiss);
|
|
844
|
+
backdropElement?.removeAttribute(DrawerPopupDataAttributes.swipeDismiss);
|
|
845
|
+
}
|
|
846
|
+
function setBackdropSwipingAttribute(backdropElement, swiping) {
|
|
847
|
+
if (!backdropElement) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (swiping) {
|
|
851
|
+
backdropElement.setAttribute(DrawerPopupDataAttributes.swiping, '');
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
backdropElement.removeAttribute(DrawerPopupDataAttributes.swiping);
|
|
855
|
+
}
|
|
856
|
+
function isSwipeIgnoredTarget(target) {
|
|
857
|
+
return Boolean(target?.closest(BASE_UI_SWIPE_IGNORE_SELECTOR));
|
|
858
|
+
}
|
|
859
|
+
function isDrawerContentTarget(target) {
|
|
860
|
+
return Boolean(target?.closest(DRAWER_CONTENT_SELECTOR));
|
|
861
|
+
}
|
|
862
|
+
function getBaseSwipeThreshold(element, direction) {
|
|
863
|
+
const size = direction === 'left' || direction === 'right' ? element.offsetWidth : element.offsetHeight;
|
|
864
|
+
return Math.max(size * 0.5, MIN_SWIPE_THRESHOLD);
|
|
865
|
+
}
|
|
866
|
+
function isRangeInput(target, win) {
|
|
867
|
+
return target instanceof win.HTMLInputElement && target.type === 'range';
|
|
868
|
+
}
|
|
869
|
+
function isTextSelectionControl(target) {
|
|
870
|
+
if (!isElement(target)) {
|
|
871
|
+
return false;
|
|
872
|
+
}
|
|
873
|
+
return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA';
|
|
874
|
+
}
|
|
875
|
+
function hasExpandedSelectionWithinTarget(selection, target) {
|
|
876
|
+
const anchorElement = isElement(selection.anchorNode) ? selection.anchorNode : selection.anchorNode?.parentElement;
|
|
877
|
+
const focusElement = isElement(selection.focusNode) ? selection.focusNode : selection.focusNode?.parentElement;
|
|
878
|
+
return selection.containsNode(target, true) || contains(target, anchorElement) || contains(target, focusElement);
|
|
879
|
+
}
|
|
880
|
+
function shouldIgnoreSwipeForTextSelection(doc, rootElement) {
|
|
881
|
+
const activeElement = doc.activeElement;
|
|
882
|
+
const activeElementWithinRoot = Boolean(activeElement && contains(rootElement, activeElement));
|
|
883
|
+
if (activeElementWithinRoot && isTextSelectionControl(activeElement)) {
|
|
884
|
+
const {
|
|
885
|
+
selectionStart,
|
|
886
|
+
selectionEnd
|
|
887
|
+
} = activeElement;
|
|
888
|
+
if (selectionStart != null && selectionEnd != null && selectionStart < selectionEnd) {
|
|
889
|
+
return true;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
const selection = doc.getSelection?.();
|
|
893
|
+
if (!selection || selection.isCollapsed) {
|
|
894
|
+
return false;
|
|
895
|
+
}
|
|
896
|
+
return hasExpandedSelectionWithinTarget(selection, rootElement);
|
|
897
|
+
}
|
|
898
|
+
function isEventOnRangeInput(event, win) {
|
|
899
|
+
const composedPath = event.composedPath();
|
|
900
|
+
if (composedPath) {
|
|
901
|
+
return composedPath.some(pathTarget => isRangeInput(pathTarget, win));
|
|
902
|
+
}
|
|
903
|
+
return isRangeInput(event.target, win);
|
|
904
|
+
}
|
|
905
|
+
function isReactTouchEventOnRangeInput(event) {
|
|
906
|
+
return isEventOnRangeInput(event.nativeEvent, ownerWindow(event.currentTarget));
|
|
907
|
+
}
|
|
908
|
+
function updateTouchScrollPosition(touchState, touch) {
|
|
909
|
+
touchState.lastX = touch.clientX;
|
|
910
|
+
touchState.lastY = touch.clientY;
|
|
911
|
+
}
|
|
912
|
+
function preserveNativeCrossAxisScrollOnMove(touchState, touch, isVerticalScrollAxis) {
|
|
913
|
+
if (touchState.preserveNativeCrossAxisScroll) {
|
|
914
|
+
return true;
|
|
915
|
+
}
|
|
916
|
+
if (touchState.allowSwipe === true || !touchState.hasCrossAxisScrollableContent) {
|
|
917
|
+
return false;
|
|
918
|
+
}
|
|
919
|
+
const drawerAxisGestureDelta = isVerticalScrollAxis ? touch.clientY - touchState.startY : touch.clientX - touchState.startX;
|
|
920
|
+
const crossAxisGestureDelta = isVerticalScrollAxis ? touch.clientX - touchState.startX : touch.clientY - touchState.startY;
|
|
921
|
+
const absDrawerAxisGestureDelta = Math.abs(drawerAxisGestureDelta);
|
|
922
|
+
const absCrossAxisGestureDelta = Math.abs(crossAxisGestureDelta);
|
|
923
|
+
if (absCrossAxisGestureDelta < 6 || absCrossAxisGestureDelta <= absDrawerAxisGestureDelta + 2) {
|
|
924
|
+
return false;
|
|
925
|
+
}
|
|
926
|
+
touchState.preserveNativeCrossAxisScroll = true;
|
|
927
|
+
return true;
|
|
928
|
+
}
|
|
929
|
+
function hasScrollableContentOnAxis(scrollTarget, axis) {
|
|
930
|
+
return axis === 'vertical' ? scrollTarget.scrollHeight > scrollTarget.clientHeight : scrollTarget.scrollWidth > scrollTarget.clientWidth;
|
|
931
|
+
}
|
|
932
|
+
function getScrollMetrics(scrollTarget, axis) {
|
|
933
|
+
if (axis === 'vertical') {
|
|
934
|
+
const max = Math.max(0, scrollTarget.scrollHeight - scrollTarget.clientHeight);
|
|
935
|
+
return {
|
|
936
|
+
offset: scrollTarget.scrollTop,
|
|
937
|
+
max
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
const max = Math.max(0, scrollTarget.scrollWidth - scrollTarget.clientWidth);
|
|
941
|
+
return {
|
|
942
|
+
offset: scrollTarget.scrollLeft,
|
|
943
|
+
max
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
function isAtSwipeStartEdge(scrollTarget, axis, direction) {
|
|
947
|
+
const {
|
|
948
|
+
offset,
|
|
949
|
+
max
|
|
950
|
+
} = getScrollMetrics(scrollTarget, axis);
|
|
951
|
+
const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);
|
|
952
|
+
if (dismissFromStartEdge === null) {
|
|
953
|
+
return false;
|
|
954
|
+
}
|
|
955
|
+
return dismissFromStartEdge ? offset <= 0 : offset >= max;
|
|
956
|
+
}
|
|
957
|
+
function canSwipeFromScrollEdgeOnMove(scrollTarget, axis, direction, delta) {
|
|
958
|
+
const {
|
|
959
|
+
offset,
|
|
960
|
+
max
|
|
961
|
+
} = getScrollMetrics(scrollTarget, axis);
|
|
962
|
+
const dismissFromStartEdge = shouldDismissFromStartEdge(direction, axis);
|
|
963
|
+
if (dismissFromStartEdge === null) {
|
|
964
|
+
return false;
|
|
965
|
+
}
|
|
966
|
+
const movingTowardDismiss = dismissFromStartEdge ? delta > 0 : delta < 0;
|
|
967
|
+
if (!movingTowardDismiss) {
|
|
968
|
+
return false;
|
|
969
|
+
}
|
|
970
|
+
return dismissFromStartEdge ? offset <= 0 : offset >= max;
|
|
971
|
+
}
|
|
972
|
+
function shouldDismissFromStartEdge(direction, axis) {
|
|
973
|
+
if (axis === 'vertical') {
|
|
974
|
+
if (direction === 'down') {
|
|
975
|
+
return true;
|
|
976
|
+
}
|
|
977
|
+
if (direction === 'up') {
|
|
978
|
+
return false;
|
|
979
|
+
}
|
|
980
|
+
return null;
|
|
981
|
+
}
|
|
982
|
+
if (direction === 'right') {
|
|
983
|
+
return true;
|
|
984
|
+
}
|
|
985
|
+
if (direction === 'left') {
|
|
986
|
+
return false;
|
|
987
|
+
}
|
|
988
|
+
return null;
|
|
989
|
+
}
|