@base-ui/react 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +148 -1
- package/accordion/header/AccordionHeader.d.ts +4 -2
- package/accordion/item/AccordionItem.d.ts +10 -4
- package/accordion/item/AccordionItemContext.d.ts +2 -2
- package/accordion/item/stateAttributesMapping.d.ts +2 -2
- package/accordion/panel/AccordionPanel.d.ts +6 -3
- package/accordion/root/AccordionRoot.d.ts +19 -10
- package/accordion/root/AccordionRootContext.d.ts +7 -7
- package/accordion/trigger/AccordionTrigger.d.ts +4 -2
- package/accordion/trigger/AccordionTrigger.js +3 -1
- package/alert-dialog/root/AlertDialogRoot.d.ts +2 -0
- package/autocomplete/index.d.ts +1 -0
- package/autocomplete/index.parts.d.ts +1 -0
- package/autocomplete/index.parts.js +7 -0
- package/autocomplete/root/AutocompleteRoot.d.ts +4 -4
- package/autocomplete/root/AutocompleteRoot.js +4 -1
- package/avatar/fallback/AvatarFallback.d.ts +3 -6
- package/avatar/fallback/AvatarFallback.js +4 -32
- package/avatar/image/AvatarImage.d.ts +6 -3
- package/avatar/image/AvatarImage.js +2 -3
- package/avatar/image/AvatarImageDataAttributes.d.ts +10 -0
- package/avatar/image/AvatarImageDataAttributes.js +18 -0
- package/avatar/root/AvatarRoot.d.ts +4 -1
- package/checkbox/indicator/CheckboxIndicator.d.ts +6 -3
- package/checkbox/root/CheckboxRoot.d.ts +3 -3
- package/checkbox/root/CheckboxRoot.js +4 -1
- package/checkbox/root/CheckboxRootContext.d.ts +4 -4
- package/checkbox/utils/useStateAttributesMapping.d.ts +2 -2
- package/checkbox-group/CheckboxGroup.d.ts +3 -3
- package/checkbox-group/CheckboxGroupContext.d.ts +2 -2
- package/checkbox-group/useCheckboxGroupParent.d.ts +2 -5
- package/collapsible/panel/CollapsiblePanel.d.ts +6 -3
- package/collapsible/panel/useCollapsiblePanel.d.ts +2 -5
- package/collapsible/root/CollapsibleRoot.d.ts +3 -3
- package/collapsible/root/CollapsibleRootContext.d.ts +4 -4
- package/collapsible/root/stateAttributesMapping.d.ts +2 -2
- package/collapsible/root/useCollapsibleRoot.d.ts +2 -5
- package/collapsible/trigger/CollapsibleTrigger.d.ts +4 -2
- package/combobox/arrow/ComboboxArrow.d.ts +10 -1
- package/combobox/backdrop/ComboboxBackdrop.d.ts +4 -1
- package/combobox/chip/ComboboxChip.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/combobox/chips/ComboboxChips.d.ts +1 -1
- package/combobox/clear/ComboboxClear.d.ts +4 -1
- package/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/combobox/group/ComboboxGroup.d.ts +1 -1
- package/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/combobox/index.d.ts +2 -0
- package/combobox/index.parts.d.ts +2 -0
- package/combobox/index.parts.js +14 -0
- package/combobox/input/ComboboxInput.d.ts +3 -3
- package/combobox/input/ComboboxInput.js +22 -5
- package/combobox/input-group/ComboboxInputGroup.d.ts +40 -0
- package/combobox/input-group/ComboboxInputGroup.js +68 -0
- package/combobox/input-group/ComboboxInputGroupDataAttributes.d.ts +55 -0
- package/combobox/input-group/ComboboxInputGroupDataAttributes.js +62 -0
- package/combobox/item/ComboboxItem.d.ts +1 -1
- package/combobox/item/ComboboxItem.js +2 -1
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +7 -1
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.d.ts +10 -0
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.js +18 -0
- package/combobox/label/ComboboxLabel.d.ts +16 -0
- package/combobox/label/ComboboxLabel.js +68 -0
- package/combobox/list/ComboboxList.d.ts +1 -1
- package/combobox/popup/ComboboxPopup.d.ts +21 -3
- package/combobox/popup/ComboboxPopup.js +10 -2
- package/combobox/portal/ComboboxPortal.d.ts +3 -4
- package/combobox/positioner/ComboboxPositioner.d.ts +14 -2
- package/combobox/positioner/ComboboxPositioner.js +3 -2
- package/combobox/root/AriaCombobox.d.ts +9 -8
- package/combobox/root/AriaCombobox.js +14 -6
- package/combobox/root/ComboboxRoot.d.ts +4 -4
- package/combobox/row/ComboboxRow.d.ts +1 -1
- package/combobox/status/ComboboxStatus.d.ts +1 -1
- package/combobox/store.d.ts +10 -4
- package/combobox/store.js +2 -0
- package/combobox/trigger/ComboboxTrigger.d.ts +3 -3
- package/combobox/trigger/ComboboxTrigger.js +5 -2
- package/combobox/utils/ComboboxInternalDismissButton.d.ts +5 -0
- package/combobox/utils/ComboboxInternalDismissButton.js +44 -0
- package/composite/item/CompositeItem.d.ts +3 -1
- package/composite/list/CompositeList.d.ts +3 -1
- package/composite/list/useCompositeListItem.d.ts +1 -1
- package/composite/root/CompositeRoot.d.ts +4 -2
- package/composite/root/useCompositeRoot.d.ts +1 -1
- package/context-menu/trigger/ContextMenuTrigger.d.ts +3 -3
- package/dialog/backdrop/DialogBackdrop.d.ts +4 -1
- package/dialog/close/DialogClose.d.ts +1 -1
- package/dialog/description/DialogDescription.d.ts +1 -1
- package/dialog/popup/DialogPopup.d.ts +6 -3
- package/dialog/portal/DialogPortal.d.ts +4 -5
- package/dialog/root/DialogRoot.d.ts +8 -3
- package/dialog/root/useDialogRoot.d.ts +3 -7
- package/dialog/root/useDialogRoot.js +2 -5
- package/dialog/title/DialogTitle.d.ts +1 -1
- package/dialog/trigger/DialogTrigger.d.ts +1 -1
- package/dialog/viewport/DialogViewport.d.ts +3 -0
- package/direction-provider/DirectionProvider.d.ts +2 -0
- package/drawer/backdrop/DrawerBackdrop.d.ts +4 -1
- package/drawer/backdrop/DrawerBackdropDataAttributes.d.ts +18 -0
- package/drawer/backdrop/DrawerBackdropDataAttributes.js +26 -0
- package/drawer/close/DrawerClose.d.ts +1 -1
- package/drawer/content/DrawerContent.d.ts +1 -1
- package/drawer/content/DrawerContent.js +2 -1
- package/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/drawer/content/DrawerContentDataAttributes.js +7 -0
- package/drawer/description/DrawerDescription.d.ts +1 -1
- package/drawer/indent/DrawerIndent.d.ts +3 -2
- package/drawer/indent/DrawerIndent.js +2 -1
- package/drawer/indent-background/DrawerIndentBackground.d.ts +5 -3
- package/drawer/indent-background/DrawerIndentBackground.js +4 -2
- package/drawer/index.d.ts +2 -1
- package/drawer/index.js +3 -3
- package/drawer/index.parts.d.ts +1 -0
- package/drawer/index.parts.js +7 -0
- package/drawer/popup/DrawerPopup.d.ts +6 -3
- package/drawer/popup/DrawerPopup.js +59 -2
- package/drawer/popup/DrawerPopupDataAttributes.d.ts +16 -0
- package/drawer/popup/DrawerPopupDataAttributes.js +18 -1
- package/drawer/portal/DrawerPortal.d.ts +2 -2
- package/drawer/provider/DrawerProvider.d.ts +2 -2
- package/drawer/provider/DrawerProvider.js +2 -2
- package/drawer/root/DrawerRoot.d.ts +5 -3
- package/drawer/root/DrawerRoot.js +6 -2
- package/drawer/swipe-area/DrawerSwipeArea.d.ts +1 -1
- package/drawer/swipe-area/DrawerSwipeArea.js +12 -10
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +23 -0
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.js +31 -0
- package/drawer/title/DrawerTitle.d.ts +1 -1
- package/drawer/trigger/DrawerTrigger.d.ts +1 -1
- package/drawer/viewport/DrawerViewport.d.ts +4 -1
- package/drawer/viewport/DrawerViewport.js +165 -43
- package/drawer/viewport/DrawerViewportDataAttributes.d.ts +22 -0
- package/drawer/viewport/DrawerViewportDataAttributes.js +30 -0
- package/esm/accordion/header/AccordionHeader.d.ts +4 -2
- package/esm/accordion/item/AccordionItem.d.ts +10 -4
- package/esm/accordion/item/AccordionItemContext.d.ts +2 -2
- package/esm/accordion/item/stateAttributesMapping.d.ts +2 -2
- package/esm/accordion/panel/AccordionPanel.d.ts +6 -3
- package/esm/accordion/root/AccordionRoot.d.ts +19 -10
- package/esm/accordion/root/AccordionRootContext.d.ts +7 -7
- package/esm/accordion/trigger/AccordionTrigger.d.ts +4 -2
- package/esm/accordion/trigger/AccordionTrigger.js +3 -1
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +2 -0
- package/esm/autocomplete/index.d.ts +1 -0
- package/esm/autocomplete/index.parts.d.ts +1 -0
- package/esm/autocomplete/index.parts.js +1 -0
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +4 -4
- package/esm/autocomplete/root/AutocompleteRoot.js +4 -1
- package/esm/avatar/fallback/AvatarFallback.d.ts +3 -6
- package/esm/avatar/fallback/AvatarFallback.js +4 -31
- package/esm/avatar/image/AvatarImage.d.ts +6 -3
- package/esm/avatar/image/AvatarImage.js +2 -3
- package/esm/avatar/image/AvatarImageDataAttributes.d.ts +10 -0
- package/esm/avatar/image/AvatarImageDataAttributes.js +12 -0
- package/esm/avatar/root/AvatarRoot.d.ts +4 -1
- package/esm/checkbox/indicator/CheckboxIndicator.d.ts +6 -3
- package/esm/checkbox/root/CheckboxRoot.d.ts +3 -3
- package/esm/checkbox/root/CheckboxRoot.js +4 -1
- package/esm/checkbox/root/CheckboxRootContext.d.ts +4 -4
- package/esm/checkbox/utils/useStateAttributesMapping.d.ts +2 -2
- package/esm/checkbox-group/CheckboxGroup.d.ts +3 -3
- package/esm/checkbox-group/CheckboxGroupContext.d.ts +2 -2
- package/esm/checkbox-group/useCheckboxGroupParent.d.ts +2 -5
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +6 -3
- package/esm/collapsible/panel/useCollapsiblePanel.d.ts +2 -5
- package/esm/collapsible/root/CollapsibleRoot.d.ts +3 -3
- package/esm/collapsible/root/CollapsibleRootContext.d.ts +4 -4
- package/esm/collapsible/root/stateAttributesMapping.d.ts +2 -2
- package/esm/collapsible/root/useCollapsibleRoot.d.ts +2 -5
- package/esm/collapsible/trigger/CollapsibleTrigger.d.ts +4 -2
- package/esm/combobox/arrow/ComboboxArrow.d.ts +10 -1
- package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +4 -1
- package/esm/combobox/chip/ComboboxChip.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/esm/combobox/chips/ComboboxChips.d.ts +1 -1
- package/esm/combobox/clear/ComboboxClear.d.ts +4 -1
- package/esm/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/esm/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
- package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/esm/combobox/index.d.ts +2 -0
- package/esm/combobox/index.parts.d.ts +2 -0
- package/esm/combobox/index.parts.js +2 -0
- package/esm/combobox/input/ComboboxInput.d.ts +3 -3
- package/esm/combobox/input/ComboboxInput.js +22 -5
- package/esm/combobox/input-group/ComboboxInputGroup.d.ts +40 -0
- package/esm/combobox/input-group/ComboboxInputGroup.js +63 -0
- package/esm/combobox/input-group/ComboboxInputGroupDataAttributes.d.ts +55 -0
- package/esm/combobox/input-group/ComboboxInputGroupDataAttributes.js +56 -0
- package/esm/combobox/item/ComboboxItem.d.ts +1 -1
- package/esm/combobox/item/ComboboxItem.js +2 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +7 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.d.ts +10 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.js +12 -0
- package/esm/combobox/label/ComboboxLabel.d.ts +16 -0
- package/esm/combobox/label/ComboboxLabel.js +63 -0
- package/esm/combobox/list/ComboboxList.d.ts +1 -1
- package/esm/combobox/popup/ComboboxPopup.d.ts +21 -3
- package/esm/combobox/popup/ComboboxPopup.js +11 -3
- package/esm/combobox/portal/ComboboxPortal.d.ts +3 -4
- package/esm/combobox/positioner/ComboboxPositioner.d.ts +14 -2
- package/esm/combobox/positioner/ComboboxPositioner.js +3 -2
- package/esm/combobox/root/AriaCombobox.d.ts +9 -8
- package/esm/combobox/root/AriaCombobox.js +14 -6
- package/esm/combobox/root/ComboboxRoot.d.ts +4 -4
- package/esm/combobox/row/ComboboxRow.d.ts +1 -1
- package/esm/combobox/status/ComboboxStatus.d.ts +1 -1
- package/esm/combobox/store.d.ts +10 -4
- package/esm/combobox/store.js +2 -0
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +3 -3
- package/esm/combobox/trigger/ComboboxTrigger.js +5 -2
- package/esm/combobox/utils/ComboboxInternalDismissButton.d.ts +5 -0
- package/esm/combobox/utils/ComboboxInternalDismissButton.js +38 -0
- package/esm/composite/item/CompositeItem.d.ts +3 -1
- package/esm/composite/list/CompositeList.d.ts +3 -1
- package/esm/composite/list/useCompositeListItem.d.ts +1 -1
- package/esm/composite/root/CompositeRoot.d.ts +4 -2
- package/esm/composite/root/useCompositeRoot.d.ts +1 -1
- package/esm/context-menu/trigger/ContextMenuTrigger.d.ts +3 -3
- package/esm/dialog/backdrop/DialogBackdrop.d.ts +4 -1
- package/esm/dialog/close/DialogClose.d.ts +1 -1
- package/esm/dialog/description/DialogDescription.d.ts +1 -1
- package/esm/dialog/popup/DialogPopup.d.ts +6 -3
- package/esm/dialog/portal/DialogPortal.d.ts +4 -5
- package/esm/dialog/root/DialogRoot.d.ts +8 -3
- package/esm/dialog/root/useDialogRoot.d.ts +3 -7
- package/esm/dialog/root/useDialogRoot.js +2 -5
- package/esm/dialog/title/DialogTitle.d.ts +1 -1
- package/esm/dialog/trigger/DialogTrigger.d.ts +1 -1
- package/esm/dialog/viewport/DialogViewport.d.ts +3 -0
- package/esm/direction-provider/DirectionProvider.d.ts +2 -0
- package/esm/drawer/backdrop/DrawerBackdrop.d.ts +4 -1
- package/esm/drawer/backdrop/DrawerBackdropDataAttributes.d.ts +18 -0
- package/esm/drawer/backdrop/DrawerBackdropDataAttributes.js +20 -0
- package/esm/drawer/close/DrawerClose.d.ts +1 -1
- package/esm/drawer/content/DrawerContent.d.ts +1 -1
- package/esm/drawer/content/DrawerContent.js +2 -1
- package/esm/drawer/content/DrawerContentDataAttributes.d.ts +1 -0
- package/esm/drawer/content/DrawerContentDataAttributes.js +1 -0
- package/esm/drawer/description/DrawerDescription.d.ts +1 -1
- package/esm/drawer/indent/DrawerIndent.d.ts +3 -2
- package/esm/drawer/indent/DrawerIndent.js +2 -1
- package/esm/drawer/indent-background/DrawerIndentBackground.d.ts +5 -3
- package/esm/drawer/indent-background/DrawerIndentBackground.js +4 -2
- package/esm/drawer/index.d.ts +2 -1
- package/esm/drawer/index.js +1 -1
- package/esm/drawer/index.parts.d.ts +1 -0
- package/esm/drawer/index.parts.js +1 -0
- package/esm/drawer/popup/DrawerPopup.d.ts +6 -3
- package/esm/drawer/popup/DrawerPopup.js +59 -2
- package/esm/drawer/popup/DrawerPopupDataAttributes.d.ts +16 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.js +18 -1
- package/esm/drawer/portal/DrawerPortal.d.ts +2 -2
- package/esm/drawer/provider/DrawerProvider.d.ts +2 -2
- package/esm/drawer/provider/DrawerProvider.js +2 -2
- package/esm/drawer/root/DrawerRoot.d.ts +5 -3
- package/esm/drawer/root/DrawerRoot.js +6 -2
- package/esm/drawer/swipe-area/DrawerSwipeArea.d.ts +1 -1
- package/esm/drawer/swipe-area/DrawerSwipeArea.js +12 -10
- package/esm/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +23 -0
- package/esm/drawer/swipe-area/DrawerSwipeAreaDataAttributes.js +25 -0
- package/esm/drawer/title/DrawerTitle.d.ts +1 -1
- package/esm/drawer/trigger/DrawerTrigger.d.ts +1 -1
- package/esm/drawer/viewport/DrawerViewport.d.ts +4 -1
- package/esm/drawer/viewport/DrawerViewport.js +165 -43
- package/esm/drawer/viewport/DrawerViewportDataAttributes.d.ts +22 -0
- package/esm/drawer/viewport/DrawerViewportDataAttributes.js +24 -0
- package/esm/field/control/FieldControl.d.ts +3 -3
- package/esm/field/description/FieldDescription.d.ts +3 -3
- package/esm/field/error/FieldError.d.ts +7 -4
- package/esm/field/error/FieldErrorDataAttributes.d.ts +8 -0
- package/esm/field/error/FieldErrorDataAttributes.js +10 -1
- package/esm/field/item/FieldItem.d.ts +4 -3
- package/esm/field/item/FieldItem.js +2 -2
- package/esm/field/label/FieldLabel.d.ts +3 -3
- package/esm/field/label/FieldLabel.js +6 -51
- package/esm/field/root/FieldRoot.d.ts +19 -2
- package/esm/field/root/FieldRoot.js +2 -1
- package/esm/field/root/FieldRootContext.d.ts +2 -2
- package/esm/field/root/FieldRootContext.js +6 -13
- package/esm/field/root/useFieldValidation.js +5 -4
- package/esm/field/utils/constants.d.ts +3 -0
- package/esm/field/utils/constants.js +11 -0
- package/esm/field/validity/FieldValidity.d.ts +7 -1
- package/esm/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/esm/floating-ui-react/components/FloatingDelayGroup.js +1 -1
- package/esm/floating-ui-react/components/FloatingFocusManager.d.ts +12 -7
- package/esm/floating-ui-react/components/FloatingFocusManager.js +31 -27
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +6 -4
- package/esm/floating-ui-react/hooks/useClick.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useClientPoint.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useDismiss.d.ts +8 -12
- package/esm/floating-ui-react/hooks/useDismiss.js +320 -261
- package/esm/floating-ui-react/hooks/useFloatingRootContext.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useFocus.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useHover.d.ts +6 -14
- package/esm/floating-ui-react/hooks/useHover.js +2 -27
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -3
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +55 -71
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +12 -3
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +30 -3
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +8 -3
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +59 -81
- package/esm/floating-ui-react/hooks/useHoverShared.d.ts +28 -0
- package/esm/floating-ui-react/hooks/useHoverShared.js +26 -0
- package/esm/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
- package/esm/floating-ui-react/hooks/useListNavigation.js +7 -3
- package/esm/floating-ui-react/hooks/useRole.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useTypeahead.d.ts +7 -1
- package/esm/floating-ui-react/hooks/useTypeahead.js +30 -14
- package/esm/floating-ui-react/safePolygon.d.ts +2 -6
- package/esm/floating-ui-react/safePolygon.js +149 -119
- package/esm/floating-ui-react/types.d.ts +5 -4
- package/esm/floating-ui-react/utils/composite.d.ts +1 -0
- package/esm/floating-ui-react/utils/composite.js +128 -129
- package/esm/floating-ui-react/utils/markOthers.d.ts +7 -1
- package/esm/floating-ui-react/utils/markOthers.js +119 -81
- package/esm/form/Form.d.ts +1 -1
- package/esm/global.d.ts +1 -1
- package/esm/index.js +1 -1
- package/esm/input/Input.d.ts +10 -3
- package/esm/labelable-provider/LabelableProvider.d.ts +4 -1
- package/esm/labelable-provider/LabelableProvider.js +3 -2
- package/esm/labelable-provider/useAriaLabelledBy.d.ts +9 -0
- package/esm/labelable-provider/useAriaLabelledBy.js +56 -0
- package/esm/labelable-provider/useLabel.d.ts +25 -0
- package/esm/labelable-provider/useLabel.js +74 -0
- package/esm/labelable-provider/useLabelableId.d.ts +2 -5
- package/esm/menu/arrow/MenuArrow.d.ts +10 -1
- package/esm/menu/backdrop/MenuBackdrop.d.ts +4 -1
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +3 -3
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +7 -1
- package/esm/menu/group/MenuGroup.d.ts +1 -1
- package/esm/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/esm/menu/index.d.ts +2 -1
- package/esm/menu/index.parts.d.ts +1 -0
- package/esm/menu/index.parts.js +1 -0
- package/esm/menu/item/MenuItem.d.ts +1 -1
- package/esm/menu/item/useMenuItem.d.ts +8 -7
- package/esm/menu/item/useMenuItem.js +5 -7
- package/esm/menu/item/useMenuItemCommonProps.d.ts +7 -4
- package/esm/menu/item/useMenuItemCommonProps.js +16 -2
- package/esm/menu/link-item/MenuLinkItem.d.ts +1 -1
- package/esm/menu/link-item/MenuLinkItem.js +16 -2
- package/esm/menu/popup/MenuPopup.d.ts +20 -5
- package/esm/menu/popup/MenuPopup.js +4 -1
- package/esm/menu/popup/MenuPopupDataAttributes.d.ts +1 -1
- package/esm/menu/popup/MenuPopupDataAttributes.js +1 -1
- package/esm/menu/portal/MenuPortal.d.ts +3 -4
- package/esm/menu/positioner/MenuPositioner.d.ts +18 -2
- package/esm/menu/positioner/MenuPositioner.js +58 -5
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +6 -3
- package/esm/menu/radio-item/MenuRadioItem.d.ts +3 -3
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +7 -1
- package/esm/menu/root/MenuRoot.d.ts +4 -2
- package/esm/menu/root/MenuRoot.js +2 -3
- package/esm/menu/store/MenuStore.d.ts +4 -2
- package/esm/menu/store/MenuStore.js +15 -1
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +1 -0
- package/esm/menu/trigger/MenuTrigger.d.ts +3 -3
- package/esm/menu/viewport/MenuViewport.d.ts +30 -0
- package/esm/menu/viewport/MenuViewport.js +60 -0
- package/esm/menu/viewport/MenuViewportCssVars.d.ts +14 -0
- package/esm/menu/viewport/MenuViewportCssVars.js +15 -0
- package/esm/menu/viewport/MenuViewportDataAttributes.d.ts +26 -0
- package/esm/menu/viewport/MenuViewportDataAttributes.js +27 -0
- package/esm/menubar/Menubar.d.ts +1 -1
- package/esm/menubar/Menubar.js +1 -7
- package/esm/meter/indicator/MeterIndicator.d.ts +4 -2
- package/esm/meter/label/MeterLabel.d.ts +4 -2
- package/esm/meter/label/MeterLabel.js +4 -8
- package/esm/meter/root/MeterRoot.d.ts +1 -1
- package/esm/meter/root/MeterRoot.js +11 -2
- package/esm/meter/track/MeterTrack.d.ts +4 -2
- package/esm/meter/value/MeterValue.d.ts +5 -3
- package/esm/navigation-menu/arrow/NavigationMenuArrow.d.ts +10 -1
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.js +11 -0
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.js +11 -2
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +4 -5
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.d.ts +11 -2
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +4 -4
- package/esm/navigation-menu/root/NavigationMenuRoot.js +27 -8
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +364 -20
- package/esm/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.js +0 -19
- package/esm/number-field/decrement/NumberFieldDecrement.d.ts +3 -3
- package/esm/number-field/group/NumberFieldGroup.d.ts +3 -3
- package/esm/number-field/increment/NumberFieldIncrement.d.ts +3 -3
- package/esm/number-field/input/NumberFieldInput.d.ts +3 -3
- package/esm/number-field/root/NumberFieldRoot.d.ts +4 -4
- package/esm/number-field/root/NumberFieldRoot.js +1 -1
- package/esm/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/esm/number-field/root/useNumberFieldButton.d.ts +2 -5
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +4 -4
- package/esm/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +3 -3
- package/esm/number-field/utils/stateAttributesMapping.d.ts +2 -2
- package/esm/number-field/utils/types.d.ts +2 -2
- package/esm/popover/arrow/PopoverArrow.d.ts +10 -1
- package/esm/popover/backdrop/PopoverBackdrop.d.ts +4 -1
- package/esm/popover/close/PopoverClose.d.ts +1 -1
- package/esm/popover/close/PopoverClose.js +5 -3
- package/esm/popover/description/PopoverDescription.d.ts +1 -1
- package/esm/popover/popup/PopoverPopup.d.ts +15 -3
- package/esm/popover/popup/PopoverPopup.js +11 -2
- package/esm/popover/portal/PopoverPortal.d.ts +3 -4
- package/esm/popover/positioner/PopoverPositioner.d.ts +11 -2
- package/esm/popover/root/PopoverRoot.d.ts +10 -3
- package/esm/popover/root/PopoverRoot.js +1 -3
- package/esm/popover/title/PopoverTitle.d.ts +1 -1
- package/esm/popover/viewport/PopoverViewport.d.ts +16 -12
- package/esm/preview-card/arrow/PreviewCardArrow.d.ts +10 -1
- package/esm/preview-card/backdrop/PreviewCardBackdrop.d.ts +4 -1
- package/esm/preview-card/popup/PreviewCardPopup.d.ts +13 -1
- package/esm/preview-card/portal/PreviewCardPortal.d.ts +3 -4
- package/esm/preview-card/positioner/PreviewCardPositioner.d.ts +14 -2
- package/esm/preview-card/positioner/PreviewCardPositioner.js +7 -1
- package/esm/preview-card/root/PreviewCardRoot.d.ts +3 -3
- package/esm/preview-card/root/PreviewCardRoot.js +22 -9
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +1 -1
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +16 -9
- package/esm/progress/indicator/ProgressIndicator.d.ts +4 -2
- package/esm/progress/label/ProgressLabel.d.ts +4 -2
- package/esm/progress/label/ProgressLabel.js +4 -8
- package/esm/progress/root/ProgressRoot.d.ts +4 -1
- package/esm/progress/root/ProgressRoot.js +11 -2
- package/esm/progress/root/ProgressRootContext.d.ts +2 -2
- package/esm/progress/root/stateAttributesMapping.d.ts +2 -2
- package/esm/progress/track/ProgressTrack.d.ts +4 -2
- package/esm/progress/value/ProgressValue.d.ts +5 -3
- package/esm/radio/indicator/RadioIndicator.d.ts +4 -1
- package/esm/radio/indicator/RadioIndicatorDataAttributes.d.ts +8 -0
- package/esm/radio/indicator/RadioIndicatorDataAttributes.js +10 -1
- package/esm/radio/root/RadioRoot.d.ts +3 -3
- package/esm/radio/root/RadioRoot.js +4 -1
- package/esm/radio-group/RadioGroup.d.ts +3 -3
- package/esm/scroll-area/content/ScrollAreaContent.d.ts +3 -3
- package/esm/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/esm/scroll-area/root/ScrollAreaRoot.d.ts +27 -11
- package/esm/scroll-area/root/ScrollAreaRoot.js +7 -4
- package/esm/scroll-area/root/ScrollAreaRootContext.d.ts +4 -2
- package/esm/scroll-area/root/stateAttributes.d.ts +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +13 -7
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -1
- package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +5 -2
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +3 -1
- package/esm/scroll-area/viewport/ScrollAreaViewport.d.ts +3 -3
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +46 -27
- package/esm/select/arrow/SelectArrow.d.ts +10 -1
- package/esm/select/backdrop/SelectBackdrop.d.ts +7 -1
- package/esm/select/group/SelectGroup.d.ts +1 -1
- package/esm/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/esm/select/icon/SelectIcon.d.ts +1 -1
- package/esm/select/index.d.ts +1 -0
- package/esm/select/index.parts.d.ts +1 -0
- package/esm/select/index.parts.js +1 -0
- package/esm/select/item/SelectItem.d.ts +1 -1
- package/esm/select/item/SelectItem.js +10 -4
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +10 -2
- package/esm/select/item-indicator/SelectItemIndicatorDataAttributes.d.ts +10 -0
- package/esm/select/item-indicator/SelectItemIndicatorDataAttributes.js +12 -0
- package/esm/select/item-text/SelectItemText.d.ts +1 -1
- package/esm/select/label/SelectLabel.d.ts +16 -0
- package/esm/select/label/SelectLabel.js +49 -0
- package/esm/select/list/SelectList.d.ts +1 -1
- package/esm/select/popup/SelectPopup.d.ts +14 -2
- package/esm/select/popup/SelectPopup.js +23 -9
- package/esm/select/portal/SelectPortal.d.ts +3 -4
- package/esm/select/positioner/SelectPositioner.d.ts +14 -2
- package/esm/select/positioner/SelectPositionerContext.d.ts +2 -2
- package/esm/select/root/SelectRoot.d.ts +5 -4
- package/esm/select/root/SelectRoot.js +5 -6
- package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +13 -1
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/esm/select/store.d.ts +5 -2
- package/esm/select/store.js +1 -0
- package/esm/select/trigger/SelectTrigger.d.ts +6 -4
- package/esm/select/trigger/SelectTrigger.js +5 -2
- package/esm/select/value/SelectValue.d.ts +1 -1
- package/esm/separator/Separator.d.ts +1 -1
- package/esm/slider/control/SliderControl.d.ts +4 -3
- package/esm/slider/control/SliderControl.js +0 -2
- package/esm/slider/index.d.ts +1 -0
- package/esm/slider/index.parts.d.ts +1 -0
- package/esm/slider/index.parts.js +1 -0
- package/esm/slider/indicator/SliderIndicator.d.ts +4 -2
- package/esm/slider/label/SliderLabel.d.ts +16 -0
- package/esm/slider/label/SliderLabel.js +58 -0
- package/esm/slider/root/SliderRoot.d.ts +11 -5
- package/esm/slider/root/SliderRoot.js +8 -3
- package/esm/slider/root/SliderRootContext.d.ts +4 -2
- package/esm/slider/root/stateAttributesMapping.d.ts +2 -2
- package/esm/slider/thumb/SliderThumb.d.ts +5 -5
- package/esm/slider/thumb/SliderThumb.js +3 -2
- package/esm/slider/track/SliderTrack.d.ts +4 -2
- package/esm/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/esm/slider/value/SliderValue.d.ts +5 -3
- package/esm/switch/root/SwitchRoot.d.ts +3 -3
- package/esm/switch/root/SwitchRoot.js +4 -1
- package/esm/switch/root/SwitchRootContext.d.ts +4 -4
- package/esm/switch/stateAttributesMapping.d.ts +2 -2
- package/esm/switch/thumb/SwitchThumb.d.ts +3 -3
- package/esm/tabs/indicator/TabsIndicator.d.ts +12 -3
- package/esm/tabs/indicator/TabsIndicator.js +5 -14
- package/esm/tabs/indicator/TabsIndicatorCssVars.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicatorCssVars.js +1 -1
- package/esm/tabs/list/TabsList.d.ts +3 -3
- package/esm/tabs/list/TabsList.js +48 -3
- package/esm/tabs/list/TabsListContext.d.ts +2 -0
- package/esm/tabs/panel/TabsPanel.d.ts +9 -3
- package/esm/tabs/panel/TabsPanelDataAttributes.d.ts +8 -0
- package/esm/tabs/panel/TabsPanelDataAttributes.js +10 -1
- package/esm/tabs/root/TabsRoot.d.ts +7 -1
- package/esm/tabs/root/TabsRootContext.d.ts +1 -1
- package/esm/tabs/root/stateAttributesMapping.d.ts +2 -2
- package/esm/tabs/tab/TabsTab.d.ts +7 -1
- package/esm/tabs/tab/TabsTab.js +10 -1
- package/esm/toast/action/ToastAction.d.ts +1 -1
- package/esm/toast/arrow/ToastArrow.d.ts +10 -1
- package/esm/toast/close/ToastClose.d.ts +1 -1
- package/esm/toast/content/ToastContent.d.ts +1 -1
- package/esm/toast/createToastManager.d.ts +1 -1
- package/esm/toast/description/ToastDescription.d.ts +1 -1
- package/esm/toast/portal/ToastPortal.d.ts +3 -4
- package/esm/toast/positioner/ToastPositioner.d.ts +12 -3
- package/esm/toast/provider/ToastProvider.d.ts +2 -0
- package/esm/toast/provider/ToastProvider.js +1 -1
- package/esm/toast/root/ToastRoot.d.ts +20 -7
- package/esm/toast/root/ToastRoot.js +3 -1
- package/esm/toast/store.d.ts +1 -1
- package/esm/toast/store.js +37 -8
- package/esm/toast/title/ToastTitle.d.ts +1 -1
- package/esm/toast/useToastManager.d.ts +3 -3
- package/esm/toast/viewport/ToastViewport.d.ts +1 -1
- package/esm/toggle/Toggle.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toolbar/button/ToolbarButton.d.ts +9 -3
- package/esm/toolbar/group/ToolbarGroup.d.ts +4 -2
- package/esm/toolbar/input/ToolbarInput.d.ts +9 -3
- package/esm/toolbar/link/ToolbarLink.d.ts +4 -1
- package/esm/toolbar/root/ToolbarRoot.d.ts +7 -1
- package/esm/toolbar/separator/ToolbarSeparator.d.ts +4 -2
- package/esm/tooltip/arrow/TooltipArrow.d.ts +13 -1
- package/esm/tooltip/popup/TooltipPopup.d.ts +13 -1
- package/esm/tooltip/portal/TooltipPortal.d.ts +3 -4
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +11 -2
- package/esm/tooltip/provider/TooltipProvider.d.ts +2 -0
- package/esm/tooltip/root/TooltipRoot.d.ts +3 -3
- package/esm/tooltip/root/TooltipRoot.js +1 -1
- package/esm/tooltip/store/TooltipStore.d.ts +2 -0
- package/esm/tooltip/store/TooltipStore.js +2 -0
- package/esm/tooltip/trigger/TooltipTrigger.d.ts +6 -1
- package/esm/tooltip/trigger/TooltipTrigger.js +5 -0
- package/esm/tooltip/viewport/TooltipViewport.d.ts +16 -12
- package/esm/types/index.d.ts +16 -1
- package/esm/unstable-use-media-query/index.d.ts +2 -0
- package/esm/use-button/useButton.d.ts +8 -5
- package/esm/use-button/useButton.js +49 -20
- package/esm/use-render/useRender.d.ts +7 -5
- package/esm/utils/FloatingPortalLite.d.ts +4 -2
- package/esm/utils/InternalBackdrop.d.ts +3 -1
- package/esm/utils/closePart.d.ts +16 -0
- package/esm/utils/closePart.js +40 -0
- package/esm/utils/constants.d.ts +4 -0
- package/esm/utils/constants.js +4 -0
- package/esm/utils/createBaseUIEventDetails.d.ts +1 -1
- package/esm/utils/getElementAtPoint.d.ts +1 -0
- package/esm/utils/getElementAtPoint.js +3 -0
- package/esm/utils/resolveAriaLabelledBy.d.ts +2 -0
- package/esm/utils/resolveAriaLabelledBy.js +8 -0
- package/esm/utils/resolveValueLabel.d.ts +4 -4
- package/esm/utils/resolveValueLabel.js +7 -5
- package/esm/utils/types.d.ts +7 -20
- package/esm/utils/useAnchorPositioning.d.ts +53 -18
- package/esm/utils/useAnchorPositioning.js +15 -6
- package/esm/utils/useFocusableWhenDisabled.d.ts +2 -5
- package/esm/utils/useMixedToggleClickHandler.d.ts +2 -4
- package/esm/utils/useOpenChangeComplete.d.ts +2 -4
- package/esm/utils/useOpenInteractionType.d.ts +0 -1
- package/esm/utils/useOpenInteractionType.js +7 -5
- package/esm/utils/usePopupAutoResize.js +1 -2
- package/esm/utils/usePopupViewport.js +11 -8
- package/esm/utils/useRegisteredLabelId.d.ts +1 -0
- package/esm/utils/useRegisteredLabelId.js +14 -0
- package/esm/utils/useRenderElement.d.ts +6 -9
- package/esm/utils/useRenderElement.js +15 -0
- package/esm/utils/useSwipeDismiss.d.ts +91 -92
- package/esm/utils/useSwipeDismiss.js +2 -1
- package/field/control/FieldControl.d.ts +3 -3
- package/field/description/FieldDescription.d.ts +3 -3
- package/field/error/FieldError.d.ts +7 -4
- package/field/error/FieldErrorDataAttributes.d.ts +8 -0
- package/field/error/FieldErrorDataAttributes.js +10 -1
- package/field/item/FieldItem.d.ts +4 -3
- package/field/item/FieldItem.js +2 -2
- package/field/label/FieldLabel.d.ts +3 -3
- package/field/label/FieldLabel.js +6 -51
- package/field/root/FieldRoot.d.ts +19 -2
- package/field/root/FieldRoot.js +2 -1
- package/field/root/FieldRootContext.d.ts +2 -2
- package/field/root/FieldRootContext.js +5 -12
- package/field/root/useFieldValidation.js +5 -4
- package/field/utils/constants.d.ts +3 -0
- package/field/utils/constants.js +12 -1
- package/field/validity/FieldValidity.d.ts +7 -1
- package/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/floating-ui-react/components/FloatingDelayGroup.js +2 -2
- package/floating-ui-react/components/FloatingFocusManager.d.ts +12 -7
- package/floating-ui-react/components/FloatingFocusManager.js +29 -25
- package/floating-ui-react/components/FloatingPortal.d.ts +6 -4
- package/floating-ui-react/hooks/useClick.d.ts +2 -2
- package/floating-ui-react/hooks/useClientPoint.d.ts +1 -1
- package/floating-ui-react/hooks/useDismiss.d.ts +8 -12
- package/floating-ui-react/hooks/useDismiss.js +319 -260
- package/floating-ui-react/hooks/useFloatingRootContext.d.ts +2 -2
- package/floating-ui-react/hooks/useFocus.d.ts +1 -1
- package/floating-ui-react/hooks/useHover.d.ts +6 -14
- package/floating-ui-react/hooks/useHover.js +6 -32
- package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -3
- package/floating-ui-react/hooks/useHoverFloatingInteraction.js +53 -70
- package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +12 -3
- package/floating-ui-react/hooks/useHoverInteractionSharedState.js +32 -4
- package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +8 -3
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +60 -82
- package/floating-ui-react/hooks/useHoverShared.d.ts +28 -0
- package/floating-ui-react/hooks/useHoverShared.js +34 -0
- package/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
- package/floating-ui-react/hooks/useListNavigation.js +7 -3
- package/floating-ui-react/hooks/useRole.d.ts +1 -1
- package/floating-ui-react/hooks/useTypeahead.d.ts +7 -1
- package/floating-ui-react/hooks/useTypeahead.js +29 -13
- package/floating-ui-react/safePolygon.d.ts +2 -6
- package/floating-ui-react/safePolygon.js +149 -119
- package/floating-ui-react/types.d.ts +5 -4
- package/floating-ui-react/utils/composite.d.ts +1 -0
- package/floating-ui-react/utils/composite.js +129 -129
- package/floating-ui-react/utils/markOthers.d.ts +7 -1
- package/floating-ui-react/utils/markOthers.js +118 -80
- package/form/Form.d.ts +1 -1
- package/global.d.ts +1 -1
- package/index.js +1 -1
- package/input/Input.d.ts +10 -3
- package/labelable-provider/LabelableProvider.d.ts +4 -1
- package/labelable-provider/LabelableProvider.js +3 -2
- package/labelable-provider/useAriaLabelledBy.d.ts +9 -0
- package/labelable-provider/useAriaLabelledBy.js +61 -0
- package/labelable-provider/useLabel.d.ts +25 -0
- package/labelable-provider/useLabel.js +80 -0
- package/labelable-provider/useLabelableId.d.ts +2 -5
- package/menu/arrow/MenuArrow.d.ts +10 -1
- package/menu/backdrop/MenuBackdrop.d.ts +4 -1
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +3 -3
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +7 -1
- package/menu/group/MenuGroup.d.ts +1 -1
- package/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/menu/index.d.ts +2 -1
- package/menu/index.parts.d.ts +1 -0
- package/menu/index.parts.js +7 -0
- package/menu/item/MenuItem.d.ts +1 -1
- package/menu/item/useMenuItem.d.ts +8 -7
- package/menu/item/useMenuItem.js +5 -7
- package/menu/item/useMenuItemCommonProps.d.ts +7 -4
- package/menu/item/useMenuItemCommonProps.js +16 -2
- package/menu/link-item/MenuLinkItem.d.ts +1 -1
- package/menu/link-item/MenuLinkItem.js +16 -2
- package/menu/popup/MenuPopup.d.ts +20 -5
- package/menu/popup/MenuPopup.js +4 -1
- package/menu/popup/MenuPopupDataAttributes.d.ts +1 -1
- package/menu/popup/MenuPopupDataAttributes.js +1 -1
- package/menu/portal/MenuPortal.d.ts +3 -4
- package/menu/positioner/MenuPositioner.d.ts +18 -2
- package/menu/positioner/MenuPositioner.js +56 -4
- package/menu/radio-group/MenuRadioGroup.d.ts +6 -3
- package/menu/radio-item/MenuRadioItem.d.ts +3 -3
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +7 -1
- package/menu/root/MenuRoot.d.ts +4 -2
- package/menu/root/MenuRoot.js +2 -3
- package/menu/store/MenuStore.d.ts +4 -2
- package/menu/store/MenuStore.js +15 -1
- package/menu/submenu-trigger/MenuSubmenuTrigger.js +1 -0
- package/menu/trigger/MenuTrigger.d.ts +3 -3
- package/menu/viewport/MenuViewport.d.ts +30 -0
- package/menu/viewport/MenuViewport.js +66 -0
- package/menu/viewport/MenuViewportCssVars.d.ts +14 -0
- package/menu/viewport/MenuViewportCssVars.js +21 -0
- package/menu/viewport/MenuViewportDataAttributes.d.ts +26 -0
- package/menu/viewport/MenuViewportDataAttributes.js +33 -0
- package/menubar/Menubar.d.ts +1 -1
- package/menubar/Menubar.js +1 -7
- package/meter/indicator/MeterIndicator.d.ts +4 -2
- package/meter/label/MeterLabel.d.ts +4 -2
- package/meter/label/MeterLabel.js +4 -8
- package/meter/root/MeterRoot.d.ts +1 -1
- package/meter/root/MeterRoot.js +10 -1
- package/meter/track/MeterTrack.d.ts +4 -2
- package/meter/value/MeterValue.d.ts +5 -3
- package/navigation-menu/arrow/NavigationMenuArrow.d.ts +10 -1
- package/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.js +11 -0
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.js +10 -1
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +4 -5
- package/navigation-menu/positioner/NavigationMenuPositioner.d.ts +11 -2
- package/navigation-menu/root/NavigationMenuRoot.d.ts +4 -4
- package/navigation-menu/root/NavigationMenuRoot.js +26 -7
- package/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/navigation-menu/trigger/NavigationMenuTrigger.js +362 -17
- package/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.js +0 -19
- package/number-field/decrement/NumberFieldDecrement.d.ts +3 -3
- package/number-field/group/NumberFieldGroup.d.ts +3 -3
- package/number-field/increment/NumberFieldIncrement.d.ts +3 -3
- package/number-field/input/NumberFieldInput.d.ts +3 -3
- package/number-field/root/NumberFieldRoot.d.ts +4 -4
- package/number-field/root/NumberFieldRoot.js +1 -1
- package/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/number-field/root/useNumberFieldButton.d.ts +2 -5
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +4 -4
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +3 -3
- package/number-field/utils/stateAttributesMapping.d.ts +2 -2
- package/number-field/utils/types.d.ts +2 -2
- package/package.json +183 -7
- package/popover/arrow/PopoverArrow.d.ts +10 -1
- package/popover/backdrop/PopoverBackdrop.d.ts +4 -1
- package/popover/close/PopoverClose.d.ts +1 -1
- package/popover/close/PopoverClose.js +5 -3
- package/popover/description/PopoverDescription.d.ts +1 -1
- package/popover/popup/PopoverPopup.d.ts +15 -3
- package/popover/popup/PopoverPopup.js +11 -2
- package/popover/portal/PopoverPortal.d.ts +3 -4
- package/popover/positioner/PopoverPositioner.d.ts +11 -2
- package/popover/root/PopoverRoot.d.ts +10 -3
- package/popover/root/PopoverRoot.js +1 -3
- package/popover/title/PopoverTitle.d.ts +1 -1
- package/popover/viewport/PopoverViewport.d.ts +16 -12
- package/preview-card/arrow/PreviewCardArrow.d.ts +10 -1
- package/preview-card/backdrop/PreviewCardBackdrop.d.ts +4 -1
- package/preview-card/popup/PreviewCardPopup.d.ts +13 -1
- package/preview-card/portal/PreviewCardPortal.d.ts +3 -4
- package/preview-card/positioner/PreviewCardPositioner.d.ts +14 -2
- package/preview-card/positioner/PreviewCardPositioner.js +7 -1
- package/preview-card/root/PreviewCardRoot.d.ts +3 -3
- package/preview-card/root/PreviewCardRoot.js +20 -7
- package/preview-card/trigger/PreviewCardTrigger.d.ts +1 -1
- package/preview-card/viewport/PreviewCardViewport.d.ts +16 -9
- package/progress/indicator/ProgressIndicator.d.ts +4 -2
- package/progress/label/ProgressLabel.d.ts +4 -2
- package/progress/label/ProgressLabel.js +4 -8
- package/progress/root/ProgressRoot.d.ts +4 -1
- package/progress/root/ProgressRoot.js +10 -1
- package/progress/root/ProgressRootContext.d.ts +2 -2
- package/progress/root/stateAttributesMapping.d.ts +2 -2
- package/progress/track/ProgressTrack.d.ts +4 -2
- package/progress/value/ProgressValue.d.ts +5 -3
- package/radio/indicator/RadioIndicator.d.ts +4 -1
- package/radio/indicator/RadioIndicatorDataAttributes.d.ts +8 -0
- package/radio/indicator/RadioIndicatorDataAttributes.js +10 -1
- package/radio/root/RadioRoot.d.ts +3 -3
- package/radio/root/RadioRoot.js +4 -1
- package/radio-group/RadioGroup.d.ts +3 -3
- package/scroll-area/content/ScrollAreaContent.d.ts +3 -3
- package/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/scroll-area/root/ScrollAreaRoot.d.ts +27 -11
- package/scroll-area/root/ScrollAreaRoot.js +7 -4
- package/scroll-area/root/ScrollAreaRootContext.d.ts +4 -2
- package/scroll-area/root/stateAttributes.d.ts +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +13 -7
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -1
- package/scroll-area/thumb/ScrollAreaThumb.d.ts +5 -2
- package/scroll-area/thumb/ScrollAreaThumb.js +3 -1
- package/scroll-area/viewport/ScrollAreaViewport.d.ts +3 -3
- package/scroll-area/viewport/ScrollAreaViewport.js +46 -27
- package/select/arrow/SelectArrow.d.ts +10 -1
- package/select/backdrop/SelectBackdrop.d.ts +7 -1
- package/select/group/SelectGroup.d.ts +1 -1
- package/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/select/icon/SelectIcon.d.ts +1 -1
- package/select/index.d.ts +1 -0
- package/select/index.parts.d.ts +1 -0
- package/select/index.parts.js +7 -0
- package/select/item/SelectItem.d.ts +1 -1
- package/select/item/SelectItem.js +10 -4
- package/select/item-indicator/SelectItemIndicator.d.ts +10 -2
- package/select/item-indicator/SelectItemIndicatorDataAttributes.d.ts +10 -0
- package/select/item-indicator/SelectItemIndicatorDataAttributes.js +18 -0
- package/select/item-text/SelectItemText.d.ts +1 -1
- package/select/label/SelectLabel.d.ts +16 -0
- package/select/label/SelectLabel.js +54 -0
- package/select/list/SelectList.d.ts +1 -1
- package/select/popup/SelectPopup.d.ts +14 -2
- package/select/popup/SelectPopup.js +26 -12
- package/select/portal/SelectPortal.d.ts +3 -4
- package/select/positioner/SelectPositioner.d.ts +14 -2
- package/select/positioner/SelectPositionerContext.d.ts +2 -2
- package/select/root/SelectRoot.d.ts +5 -4
- package/select/root/SelectRoot.js +5 -6
- package/select/scroll-arrow/SelectScrollArrow.d.ts +13 -1
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/select/store.d.ts +5 -2
- package/select/store.js +1 -0
- package/select/trigger/SelectTrigger.d.ts +6 -4
- package/select/trigger/SelectTrigger.js +5 -2
- package/select/value/SelectValue.d.ts +1 -1
- package/separator/Separator.d.ts +1 -1
- package/slider/control/SliderControl.d.ts +4 -3
- package/slider/control/SliderControl.js +0 -2
- package/slider/index.d.ts +1 -0
- package/slider/index.parts.d.ts +1 -0
- package/slider/index.parts.js +7 -0
- package/slider/indicator/SliderIndicator.d.ts +4 -2
- package/slider/label/SliderLabel.d.ts +16 -0
- package/slider/label/SliderLabel.js +63 -0
- package/slider/root/SliderRoot.d.ts +11 -5
- package/slider/root/SliderRoot.js +8 -3
- package/slider/root/SliderRootContext.d.ts +4 -2
- package/slider/root/stateAttributesMapping.d.ts +2 -2
- package/slider/thumb/SliderThumb.d.ts +5 -5
- package/slider/thumb/SliderThumb.js +3 -2
- package/slider/track/SliderTrack.d.ts +4 -2
- package/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/slider/value/SliderValue.d.ts +5 -3
- package/switch/root/SwitchRoot.d.ts +3 -3
- package/switch/root/SwitchRoot.js +4 -1
- package/switch/root/SwitchRootContext.d.ts +4 -4
- package/switch/stateAttributesMapping.d.ts +2 -2
- package/switch/thumb/SwitchThumb.d.ts +3 -3
- package/tabs/indicator/TabsIndicator.d.ts +12 -3
- package/tabs/indicator/TabsIndicator.js +5 -14
- package/tabs/indicator/TabsIndicatorCssVars.d.ts +1 -1
- package/tabs/indicator/TabsIndicatorCssVars.js +1 -1
- package/tabs/list/TabsList.d.ts +3 -3
- package/tabs/list/TabsList.js +48 -3
- package/tabs/list/TabsListContext.d.ts +2 -0
- package/tabs/panel/TabsPanel.d.ts +9 -3
- package/tabs/panel/TabsPanelDataAttributes.d.ts +8 -0
- package/tabs/panel/TabsPanelDataAttributes.js +10 -1
- package/tabs/root/TabsRoot.d.ts +7 -1
- package/tabs/root/TabsRootContext.d.ts +1 -1
- package/tabs/root/stateAttributesMapping.d.ts +2 -2
- package/tabs/tab/TabsTab.d.ts +7 -1
- package/tabs/tab/TabsTab.js +10 -1
- package/toast/action/ToastAction.d.ts +1 -1
- package/toast/arrow/ToastArrow.d.ts +10 -1
- package/toast/close/ToastClose.d.ts +1 -1
- package/toast/content/ToastContent.d.ts +1 -1
- package/toast/createToastManager.d.ts +1 -1
- package/toast/description/ToastDescription.d.ts +1 -1
- package/toast/portal/ToastPortal.d.ts +3 -4
- package/toast/positioner/ToastPositioner.d.ts +12 -3
- package/toast/provider/ToastProvider.d.ts +2 -0
- package/toast/provider/ToastProvider.js +1 -1
- package/toast/root/ToastRoot.d.ts +20 -7
- package/toast/root/ToastRoot.js +3 -1
- package/toast/store.d.ts +1 -1
- package/toast/store.js +37 -8
- package/toast/title/ToastTitle.d.ts +1 -1
- package/toast/useToastManager.d.ts +3 -3
- package/toast/viewport/ToastViewport.d.ts +1 -1
- package/toggle/Toggle.d.ts +1 -1
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toolbar/button/ToolbarButton.d.ts +9 -3
- package/toolbar/group/ToolbarGroup.d.ts +4 -2
- package/toolbar/input/ToolbarInput.d.ts +9 -3
- package/toolbar/link/ToolbarLink.d.ts +4 -1
- package/toolbar/root/ToolbarRoot.d.ts +7 -1
- package/toolbar/separator/ToolbarSeparator.d.ts +4 -2
- package/tooltip/arrow/TooltipArrow.d.ts +13 -1
- package/tooltip/popup/TooltipPopup.d.ts +13 -1
- package/tooltip/portal/TooltipPortal.d.ts +3 -4
- package/tooltip/positioner/TooltipPositioner.d.ts +11 -2
- package/tooltip/provider/TooltipProvider.d.ts +2 -0
- package/tooltip/root/TooltipRoot.d.ts +3 -3
- package/tooltip/root/TooltipRoot.js +1 -1
- package/tooltip/store/TooltipStore.d.ts +2 -0
- package/tooltip/store/TooltipStore.js +2 -0
- package/tooltip/trigger/TooltipTrigger.d.ts +6 -1
- package/tooltip/trigger/TooltipTrigger.js +5 -0
- package/tooltip/viewport/TooltipViewport.d.ts +16 -12
- package/types/index.d.ts +16 -1
- package/unstable-use-media-query/index.d.ts +2 -0
- package/use-button/useButton.d.ts +8 -5
- package/use-button/useButton.js +49 -20
- package/use-render/useRender.d.ts +7 -5
- package/utils/FloatingPortalLite.d.ts +4 -2
- package/utils/InternalBackdrop.d.ts +3 -1
- package/utils/closePart.d.ts +16 -0
- package/utils/closePart.js +48 -0
- package/utils/constants.d.ts +4 -0
- package/utils/constants.js +6 -2
- package/utils/createBaseUIEventDetails.d.ts +1 -1
- package/utils/getElementAtPoint.d.ts +1 -0
- package/utils/getElementAtPoint.js +9 -0
- package/utils/resolveAriaLabelledBy.d.ts +2 -0
- package/utils/resolveAriaLabelledBy.js +14 -0
- package/utils/resolveValueLabel.d.ts +4 -4
- package/utils/resolveValueLabel.js +7 -5
- package/utils/types.d.ts +7 -20
- package/utils/useAnchorPositioning.d.ts +53 -18
- package/utils/useAnchorPositioning.js +15 -6
- package/utils/useFocusableWhenDisabled.d.ts +2 -5
- package/utils/useMixedToggleClickHandler.d.ts +2 -4
- package/utils/useOpenChangeComplete.d.ts +2 -4
- package/utils/useOpenInteractionType.d.ts +0 -1
- package/utils/useOpenInteractionType.js +7 -5
- package/utils/usePopupAutoResize.js +1 -2
- package/utils/usePopupViewport.js +11 -8
- package/utils/useRegisteredLabelId.d.ts +1 -0
- package/utils/useRegisteredLabelId.js +19 -0
- package/utils/useRenderElement.d.ts +6 -9
- package/utils/useRenderElement.js +15 -0
- package/utils/useSwipeDismiss.d.ts +91 -92
- package/utils/useSwipeDismiss.js +2 -1
- package/esm/navigation-menu/utils/setFixedSize.d.ts +0 -1
- package/esm/navigation-menu/utils/setFixedSize.js +0 -11
- package/navigation-menu/utils/setFixedSize.d.ts +0 -1
- package/navigation-menu/utils/setFixedSize.js +0 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type Side, type Align, type UseAnchorPositioningSharedParameters } from "../../utils/useAnchorPositioning.js";
|
|
3
3
|
import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
4
4
|
import type { ToastObject } from "../useToastManager.js";
|
|
5
5
|
/**
|
|
@@ -10,15 +10,24 @@ import type { ToastObject } from "../useToastManager.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const ToastPositioner: React.ForwardRefExoticComponent<Omit<ToastPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export interface ToastPositionerState {
|
|
13
|
+
/**
|
|
14
|
+
* The side of the anchor the component is placed on.
|
|
15
|
+
*/
|
|
13
16
|
side: Side;
|
|
17
|
+
/**
|
|
18
|
+
* The alignment of the component relative to the anchor.
|
|
19
|
+
*/
|
|
14
20
|
align: Align;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the anchor element is hidden.
|
|
23
|
+
*/
|
|
15
24
|
anchorHidden: boolean;
|
|
16
25
|
}
|
|
17
|
-
export interface ToastPositionerProps extends BaseUIComponentProps<'div',
|
|
26
|
+
export interface ToastPositionerProps extends BaseUIComponentProps<'div', ToastPositionerState>, Omit<UseAnchorPositioningSharedParameters, 'side' | 'anchor'> {
|
|
18
27
|
/**
|
|
19
28
|
* An element to position the toast against.
|
|
20
29
|
*/
|
|
21
|
-
anchor?:
|
|
30
|
+
anchor?: Element | null | undefined;
|
|
22
31
|
/**
|
|
23
32
|
* Which side of the anchor element to align the toast against.
|
|
24
33
|
* May automatically change to avoid collisions.
|
|
@@ -6,6 +6,7 @@ import type { ToastManager } from "../createToastManager.js";
|
|
|
6
6
|
* Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
|
|
7
7
|
*/
|
|
8
8
|
export declare const ToastProvider: React.FC<ToastProvider.Props>;
|
|
9
|
+
export interface ToastProviderState {}
|
|
9
10
|
export interface ToastProviderProps {
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
/**
|
|
@@ -26,5 +27,6 @@ export interface ToastProviderProps {
|
|
|
26
27
|
toastManager?: ToastManager | undefined;
|
|
27
28
|
}
|
|
28
29
|
export declare namespace ToastProvider {
|
|
30
|
+
type State = ToastProviderState;
|
|
29
31
|
type Props = ToastProviderProps;
|
|
30
32
|
}
|
|
@@ -48,7 +48,7 @@ const ToastProvider = exports.ToastProvider = function ToastProvider(props) {
|
|
|
48
48
|
store.promiseToast(options.promise, options);
|
|
49
49
|
} else if (action === 'update' && id) {
|
|
50
50
|
store.updateToast(id, options);
|
|
51
|
-
} else if (action === 'close'
|
|
51
|
+
} else if (action === 'close') {
|
|
52
52
|
store.closeToast(id);
|
|
53
53
|
} else {
|
|
54
54
|
store.addToast(options);
|
|
@@ -11,19 +11,32 @@ import type { TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
11
11
|
export declare const ToastRoot: React.ForwardRefExoticComponent<Omit<ToastRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export type ToastRootToastObject<Data extends object = any> = ToastObjectType<Data>;
|
|
13
13
|
export interface ToastRootState {
|
|
14
|
+
/**
|
|
15
|
+
* The transition status of the component.
|
|
16
|
+
*/
|
|
14
17
|
transitionStatus: TransitionStatus;
|
|
15
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Whether the toasts in the viewport are expanded.
|
|
20
|
+
*/
|
|
16
21
|
expanded: boolean;
|
|
17
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Whether the toast was removed due to exceeding the limit.
|
|
24
|
+
*/
|
|
18
25
|
limited: boolean;
|
|
19
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The type of the toast.
|
|
28
|
+
*/
|
|
20
29
|
type: string | undefined;
|
|
21
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Whether the toast is being swiped.
|
|
32
|
+
*/
|
|
22
33
|
swiping: boolean;
|
|
23
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The direction the toast is being swiped.
|
|
36
|
+
*/
|
|
24
37
|
swipeDirection: 'up' | 'down' | 'left' | 'right' | undefined;
|
|
25
38
|
}
|
|
26
|
-
export interface ToastRootProps extends BaseUIComponentProps<'div',
|
|
39
|
+
export interface ToastRootProps extends BaseUIComponentProps<'div', ToastRootState> {
|
|
27
40
|
/**
|
|
28
41
|
* The toast to render.
|
|
29
42
|
*/
|
|
@@ -32,7 +45,7 @@ export interface ToastRootProps extends BaseUIComponentProps<'div', ToastRoot.St
|
|
|
32
45
|
* Direction(s) in which the toast can be swiped to dismiss.
|
|
33
46
|
* @default ['down', 'right']
|
|
34
47
|
*/
|
|
35
|
-
swipeDirection?:
|
|
48
|
+
swipeDirection?: 'up' | 'down' | 'left' | 'right' | ('up' | 'down' | 'left' | 'right')[] | undefined;
|
|
36
49
|
}
|
|
37
50
|
export declare namespace ToastRoot {
|
|
38
51
|
type ToastObject<Data extends object = any> = ToastRootToastObject<Data>;
|
package/toast/root/ToastRoot.js
CHANGED
|
@@ -19,6 +19,7 @@ var _ToastProviderContext = require("../provider/ToastProviderContext");
|
|
|
19
19
|
var _useRenderElement = require("../../utils/useRenderElement");
|
|
20
20
|
var _useOpenChangeComplete = require("../../utils/useOpenChangeComplete");
|
|
21
21
|
var _ToastRootCssVars = require("./ToastRootCssVars");
|
|
22
|
+
var _constants = require("../../utils/constants");
|
|
22
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
24
|
const stateAttributesMapping = {
|
|
24
25
|
..._stateAttributesMapping.transitionStatusMapping,
|
|
@@ -32,6 +33,7 @@ const SWIPE_THRESHOLD = 40;
|
|
|
32
33
|
const REVERSE_CANCEL_THRESHOLD = 10;
|
|
33
34
|
const OPPOSITE_DIRECTION_DAMPING_FACTOR = 0.5;
|
|
34
35
|
const MIN_DRAG_THRESHOLD = 1;
|
|
36
|
+
const TOAST_SWIPE_IGNORE_SELECTOR = `${_constants.BASE_UI_SWIPE_IGNORE_SELECTOR},${_constants.LEGACY_SWIPE_IGNORE_SELECTOR}`;
|
|
35
37
|
function getDisplacement(direction, deltaX, deltaY) {
|
|
36
38
|
switch (direction) {
|
|
37
39
|
case 'up':
|
|
@@ -210,7 +212,7 @@ const ToastRoot = exports.ToastRoot = /*#__PURE__*/React.forwardRef(function Toa
|
|
|
210
212
|
store.pauseTimers();
|
|
211
213
|
}
|
|
212
214
|
const target = (0, _utils.getTarget)(event.nativeEvent);
|
|
213
|
-
const isInteractiveElement = target ? target.closest(
|
|
215
|
+
const isInteractiveElement = target ? target.closest(`button,a,input,textarea,[role="button"],${TOAST_SWIPE_IGNORE_SELECTOR}`) : false;
|
|
214
216
|
if (isInteractiveElement) {
|
|
215
217
|
return;
|
|
216
218
|
}
|
package/toast/store.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare class ToastStore extends ReactStore<State, {}, typeof selectors>
|
|
|
38
38
|
addToast: <Data extends object>(toast: ToastManagerAddOptions<Data>) => string;
|
|
39
39
|
updateToast: <Data extends object>(id: string, updates: ToastManagerUpdateOptions<Data>) => void;
|
|
40
40
|
updateToastInternal: <Data extends object>(id: string, updates: ToastInternalUpdateOptions<Data>) => void;
|
|
41
|
-
closeToast: (toastId
|
|
41
|
+
closeToast: (toastId?: string) => void;
|
|
42
42
|
promiseToast: <Value, Data extends object>(promiseValue: Promise<Value>, options: ToastManagerPromiseOptions<Value, Data>) => Promise<Value>;
|
|
43
43
|
pauseTimers(): void;
|
|
44
44
|
resumeTimers(): void;
|
package/toast/store.js
CHANGED
|
@@ -183,15 +183,33 @@ class ToastStore extends _store.ReactStore {
|
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
closeToast = toastId => {
|
|
186
|
-
const
|
|
187
|
-
toast?.onClose?.();
|
|
186
|
+
const closeAll = toastId === undefined;
|
|
188
187
|
const {
|
|
189
188
|
limit,
|
|
190
189
|
toasts
|
|
191
190
|
} = this.state;
|
|
191
|
+
let toastsToClose;
|
|
192
|
+
if (closeAll) {
|
|
193
|
+
toastsToClose = toasts;
|
|
194
|
+
this.timers.forEach(timer => {
|
|
195
|
+
timer.timeout?.clear();
|
|
196
|
+
});
|
|
197
|
+
this.timers.clear();
|
|
198
|
+
} else {
|
|
199
|
+
const toast = selectors.toast(this.state, toastId);
|
|
200
|
+
if (!toast) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
toastsToClose = [toast];
|
|
204
|
+
const timer = this.timers.get(toastId);
|
|
205
|
+
if (timer?.timeout) {
|
|
206
|
+
timer.timeout.clear();
|
|
207
|
+
this.timers.delete(toastId);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
192
210
|
let activeIndex = 0;
|
|
193
211
|
const newToasts = toasts.map(item => {
|
|
194
|
-
if (item.id === toastId) {
|
|
212
|
+
if (closeAll || item.id === toastId) {
|
|
195
213
|
return {
|
|
196
214
|
...item,
|
|
197
215
|
transitionStatus: 'ending',
|
|
@@ -208,13 +226,20 @@ class ToastStore extends _store.ReactStore {
|
|
|
208
226
|
limited: isLimited
|
|
209
227
|
} : item;
|
|
210
228
|
});
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
229
|
+
const updates = {
|
|
230
|
+
toasts: newToasts
|
|
231
|
+
};
|
|
232
|
+
if (closeAll || toasts.length === 1) {
|
|
233
|
+
updates.hovering = false;
|
|
234
|
+
updates.focused = false;
|
|
215
235
|
}
|
|
236
|
+
this.update(updates);
|
|
237
|
+
toastsToClose.forEach(toast => {
|
|
238
|
+
if (toast.transitionStatus !== 'ending') {
|
|
239
|
+
toast.onClose?.();
|
|
240
|
+
}
|
|
241
|
+
});
|
|
216
242
|
this.handleFocusManagement(toastId);
|
|
217
|
-
this.setToasts(newToasts);
|
|
218
243
|
};
|
|
219
244
|
promiseToast = (promiseValue, options) => {
|
|
220
245
|
// Create a loading toast (which does not auto-dismiss).
|
|
@@ -327,6 +352,10 @@ class ToastStore extends _store.ReactStore {
|
|
|
327
352
|
if (!this.state.viewport || !(0, _utils.contains)(this.state.viewport, activeEl) || !(0, _focusVisible.isFocusVisible)(activeEl)) {
|
|
328
353
|
return;
|
|
329
354
|
}
|
|
355
|
+
if (toastId === undefined) {
|
|
356
|
+
this.restoreFocusToPrevElement();
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
330
359
|
const toasts = selectors.toasts(this.state);
|
|
331
360
|
const currentIndex = selectors.toastIndex(this.state, toastId);
|
|
332
361
|
let nextToast = null;
|
|
@@ -13,7 +13,7 @@ export interface ToastTitleState {
|
|
|
13
13
|
*/
|
|
14
14
|
type: string | undefined;
|
|
15
15
|
}
|
|
16
|
-
export interface ToastTitleProps extends BaseUIComponentProps<'h2',
|
|
16
|
+
export interface ToastTitleProps extends BaseUIComponentProps<'h2', ToastTitleState> {}
|
|
17
17
|
export declare namespace ToastTitle {
|
|
18
18
|
type State = ToastTitleState;
|
|
19
19
|
type Props = ToastTitleProps;
|
|
@@ -38,7 +38,7 @@ export interface ToastObject<Data extends object> {
|
|
|
38
38
|
* - `high` - The toast will be announced urgently.
|
|
39
39
|
* @default 'low'
|
|
40
40
|
*/
|
|
41
|
-
priority?:
|
|
41
|
+
priority?: 'low' | 'high' | undefined;
|
|
42
42
|
/**
|
|
43
43
|
* The transition status of the toast.
|
|
44
44
|
*/
|
|
@@ -76,12 +76,12 @@ export interface ToastManagerPositionerProps extends Omit<ToastPositionerProps,
|
|
|
76
76
|
/**
|
|
77
77
|
* An element to position the toast against.
|
|
78
78
|
*/
|
|
79
|
-
anchor?:
|
|
79
|
+
anchor?: Element | null | undefined;
|
|
80
80
|
}
|
|
81
81
|
export interface UseToastManagerReturnValue<Data extends object = any> {
|
|
82
82
|
toasts: ToastObject<Data>[];
|
|
83
83
|
add: <T extends Data = Data>(options: ToastManagerAddOptions<T>) => string;
|
|
84
|
-
close: (toastId
|
|
84
|
+
close: (toastId?: string) => void;
|
|
85
85
|
update: <T extends Data = Data>(toastId: string, options: ToastManagerUpdateOptions<T>) => void;
|
|
86
86
|
promise: <Value, T extends Data = Data>(promise: Promise<Value>, options: ToastManagerPromiseOptions<Value, T>) => Promise<Value>;
|
|
87
87
|
}
|
|
@@ -13,7 +13,7 @@ export interface ToastViewportState {
|
|
|
13
13
|
*/
|
|
14
14
|
expanded: boolean;
|
|
15
15
|
}
|
|
16
|
-
export interface ToastViewportProps extends BaseUIComponentProps<'div',
|
|
16
|
+
export interface ToastViewportProps extends BaseUIComponentProps<'div', ToastViewportState> {}
|
|
17
17
|
export declare namespace ToastViewport {
|
|
18
18
|
type State = ToastViewportState;
|
|
19
19
|
type Props = ToastViewportProps;
|
package/toggle/Toggle.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface ToggleState {
|
|
|
21
21
|
*/
|
|
22
22
|
disabled: boolean;
|
|
23
23
|
}
|
|
24
|
-
export interface ToggleProps<Value extends string> extends NativeButtonProps, BaseUIComponentProps<'button',
|
|
24
|
+
export interface ToggleProps<Value extends string> extends NativeButtonProps, BaseUIComponentProps<'button', ToggleState> {
|
|
25
25
|
/**
|
|
26
26
|
* Whether the toggle button is currently pressed.
|
|
27
27
|
* This is the controlled counterpart of `defaultPressed`.
|
|
@@ -27,7 +27,7 @@ export interface ToggleGroupState {
|
|
|
27
27
|
*/
|
|
28
28
|
orientation: Orientation;
|
|
29
29
|
}
|
|
30
|
-
export interface ToggleGroupProps<Value extends string> extends BaseUIComponentProps<'div',
|
|
30
|
+
export interface ToggleGroupProps<Value extends string> extends BaseUIComponentProps<'div', ToggleGroupState> {
|
|
31
31
|
/**
|
|
32
32
|
* The open state of the toggle group represented by an array of
|
|
33
33
|
* the values of all pressed toggle buttons.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseUIComponentProps, NativeButtonProps } from "../../utils/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToolbarRootState } from "../root/ToolbarRoot.js";
|
|
4
4
|
/**
|
|
5
5
|
* A button that can be used as-is or as a trigger for other components.
|
|
6
6
|
* Renders a `<button>` element.
|
|
@@ -8,11 +8,17 @@ import type { ToolbarRoot } from "../root/ToolbarRoot.js";
|
|
|
8
8
|
* Documentation: [Base UI Toolbar](https://base-ui.com/react/components/toolbar)
|
|
9
9
|
*/
|
|
10
10
|
export declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
-
export interface ToolbarButtonState extends
|
|
11
|
+
export interface ToolbarButtonState extends ToolbarRootState {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the component is disabled.
|
|
14
|
+
*/
|
|
12
15
|
disabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the component remains focusable when disabled.
|
|
18
|
+
*/
|
|
13
19
|
focusable: boolean;
|
|
14
20
|
}
|
|
15
|
-
export interface ToolbarButtonProps extends NativeButtonProps, BaseUIComponentProps<'button',
|
|
21
|
+
export interface ToolbarButtonProps extends NativeButtonProps, BaseUIComponentProps<'button', ToolbarButtonState> {
|
|
16
22
|
/**
|
|
17
23
|
* When `true` the item is disabled.
|
|
18
24
|
* @default false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseUIComponentProps } from "../../utils/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToolbarRootState } from "../root/ToolbarRoot.js";
|
|
4
4
|
/**
|
|
5
5
|
* Groups several toolbar items or toggles.
|
|
6
6
|
* Renders a `<div>` element.
|
|
@@ -8,7 +8,8 @@ import type { ToolbarRoot } from "../root/ToolbarRoot.js";
|
|
|
8
8
|
* Documentation: [Base UI Toolbar](https://base-ui.com/react/components/toolbar)
|
|
9
9
|
*/
|
|
10
10
|
export declare const ToolbarGroup: React.ForwardRefExoticComponent<Omit<ToolbarGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export interface
|
|
11
|
+
export interface ToolbarGroupState extends ToolbarRootState {}
|
|
12
|
+
export interface ToolbarGroupProps extends BaseUIComponentProps<'div', ToolbarGroupState> {
|
|
12
13
|
/**
|
|
13
14
|
* When `true` all toolbar items in the group are disabled.
|
|
14
15
|
* @default false
|
|
@@ -16,5 +17,6 @@ export interface ToolbarGroupProps extends BaseUIComponentProps<'div', ToolbarRo
|
|
|
16
17
|
disabled?: boolean | undefined;
|
|
17
18
|
}
|
|
18
19
|
export declare namespace ToolbarGroup {
|
|
20
|
+
type State = ToolbarGroupState;
|
|
19
21
|
type Props = ToolbarGroupProps;
|
|
20
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseUIComponentProps } from "../../utils/types.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ToolbarRootState } from "../root/ToolbarRoot.js";
|
|
4
4
|
/**
|
|
5
5
|
* A native input element that integrates with Toolbar keyboard navigation.
|
|
6
6
|
* Renders an `<input>` element.
|
|
@@ -8,11 +8,17 @@ import type { ToolbarRoot } from "../root/ToolbarRoot.js";
|
|
|
8
8
|
* Documentation: [Base UI Toolbar](https://base-ui.com/react/components/toolbar)
|
|
9
9
|
*/
|
|
10
10
|
export declare const ToolbarInput: React.ForwardRefExoticComponent<Omit<ToolbarInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
11
|
-
export interface ToolbarInputState extends
|
|
11
|
+
export interface ToolbarInputState extends ToolbarRootState {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the component is disabled.
|
|
14
|
+
*/
|
|
12
15
|
disabled: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the component remains focusable when disabled.
|
|
18
|
+
*/
|
|
13
19
|
focusable: boolean;
|
|
14
20
|
}
|
|
15
|
-
export interface ToolbarInputProps extends BaseUIComponentProps<'input',
|
|
21
|
+
export interface ToolbarInputProps extends BaseUIComponentProps<'input', ToolbarInputState> {
|
|
16
22
|
/**
|
|
17
23
|
* When `true` the item is disabled.
|
|
18
24
|
* @default false
|
|
@@ -9,9 +9,12 @@ import type { ToolbarRoot } from "../root/ToolbarRoot.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const ToolbarLink: React.ForwardRefExoticComponent<Omit<ToolbarLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
11
11
|
export interface ToolbarLinkState {
|
|
12
|
+
/**
|
|
13
|
+
* The component orientation.
|
|
14
|
+
*/
|
|
12
15
|
orientation: ToolbarRoot.Orientation;
|
|
13
16
|
}
|
|
14
|
-
export interface ToolbarLinkProps extends BaseUIComponentProps<'a',
|
|
17
|
+
export interface ToolbarLinkProps extends BaseUIComponentProps<'a', ToolbarLinkState> {}
|
|
15
18
|
export declare namespace ToolbarLink {
|
|
16
19
|
type State = ToolbarLinkState;
|
|
17
20
|
type Props = ToolbarLinkProps;
|
|
@@ -12,10 +12,16 @@ export interface ToolbarRootItemMetadata {
|
|
|
12
12
|
}
|
|
13
13
|
export type ToolbarRootOrientation = BaseOrientation;
|
|
14
14
|
export interface ToolbarRootState {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the component is disabled.
|
|
17
|
+
*/
|
|
15
18
|
disabled: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The component orientation.
|
|
21
|
+
*/
|
|
16
22
|
orientation: ToolbarRoot.Orientation;
|
|
17
23
|
}
|
|
18
|
-
export interface ToolbarRootProps extends BaseUIComponentProps<'div',
|
|
24
|
+
export interface ToolbarRootProps extends BaseUIComponentProps<'div', ToolbarRootState> {
|
|
19
25
|
disabled?: boolean | undefined;
|
|
20
26
|
/**
|
|
21
27
|
* The orientation of the toolbar.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
3
|
-
import { Separator } from "../../separator/index.js";
|
|
3
|
+
import { Separator, type SeparatorState } from "../../separator/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* A separator element accessible to screen readers.
|
|
6
6
|
* Renders a `<div>` element.
|
|
@@ -8,7 +8,9 @@ import { Separator } from "../../separator/index.js";
|
|
|
8
8
|
* Documentation: [Base UI Toolbar](https://base-ui.com/react/components/toolbar)
|
|
9
9
|
*/
|
|
10
10
|
export declare const ToolbarSeparator: React.ForwardRefExoticComponent<Omit<ToolbarSeparatorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export interface
|
|
11
|
+
export interface ToolbarSeparatorState extends SeparatorState {}
|
|
12
|
+
export interface ToolbarSeparatorProps extends BaseUIComponentProps<'div', ToolbarSeparatorState>, Separator.Props {}
|
|
12
13
|
export declare namespace ToolbarSeparator {
|
|
14
|
+
type State = ToolbarSeparatorState;
|
|
13
15
|
type Props = ToolbarSeparatorProps;
|
|
14
16
|
}
|
|
@@ -13,12 +13,24 @@ export interface TooltipArrowState {
|
|
|
13
13
|
* Whether the tooltip is currently open.
|
|
14
14
|
*/
|
|
15
15
|
open: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The side of the anchor the component is placed on.
|
|
18
|
+
*/
|
|
16
19
|
side: Side;
|
|
20
|
+
/**
|
|
21
|
+
* The alignment of the component relative to the anchor.
|
|
22
|
+
*/
|
|
17
23
|
align: Align;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the arrow cannot be centered on the anchor.
|
|
26
|
+
*/
|
|
18
27
|
uncentered: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Whether transitions should be skipped.
|
|
30
|
+
*/
|
|
19
31
|
instant: 'delay' | 'dismiss' | 'focus' | undefined;
|
|
20
32
|
}
|
|
21
|
-
export interface TooltipArrowProps extends BaseUIComponentProps<'div',
|
|
33
|
+
export interface TooltipArrowProps extends BaseUIComponentProps<'div', TooltipArrowState> {}
|
|
22
34
|
export declare namespace TooltipArrow {
|
|
23
35
|
type State = TooltipArrowState;
|
|
24
36
|
type Props = TooltipArrowProps;
|
|
@@ -14,12 +14,24 @@ export interface TooltipPopupState {
|
|
|
14
14
|
* Whether the tooltip is currently open.
|
|
15
15
|
*/
|
|
16
16
|
open: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The side of the anchor the component is placed on.
|
|
19
|
+
*/
|
|
17
20
|
side: Side;
|
|
21
|
+
/**
|
|
22
|
+
* The alignment of the component relative to the anchor.
|
|
23
|
+
*/
|
|
18
24
|
align: Align;
|
|
25
|
+
/**
|
|
26
|
+
* Whether transitions should be skipped.
|
|
27
|
+
*/
|
|
19
28
|
instant: 'delay' | 'focus' | 'dismiss' | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The transition status of the component.
|
|
31
|
+
*/
|
|
20
32
|
transitionStatus: TransitionStatus;
|
|
21
33
|
}
|
|
22
|
-
export interface TooltipPopupProps extends BaseUIComponentProps<'div',
|
|
34
|
+
export interface TooltipPopupProps extends BaseUIComponentProps<'div', TooltipPopupState> {}
|
|
23
35
|
export declare namespace TooltipPopup {
|
|
24
36
|
type State = TooltipPopupState;
|
|
25
37
|
type Props = TooltipPopupProps;
|
|
@@ -8,10 +8,8 @@ import { FloatingPortalLite } from "../../utils/FloatingPortalLite.js";
|
|
|
8
8
|
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
9
9
|
*/
|
|
10
10
|
export declare const TooltipPortal: React.ForwardRefExoticComponent<Omit<TooltipPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
export interface TooltipPortalProps extends FloatingPortalLite.Props<TooltipPortal.State> {
|
|
11
|
+
export interface TooltipPortalState {}
|
|
12
|
+
export interface TooltipPortalProps extends FloatingPortalLite.Props<TooltipPortalState> {
|
|
15
13
|
/**
|
|
16
14
|
* Whether to keep the portal mounted in the DOM while the popup is hidden.
|
|
17
15
|
* @default false
|
|
@@ -19,5 +17,6 @@ export interface TooltipPortalProps extends FloatingPortalLite.Props<TooltipPort
|
|
|
19
17
|
keepMounted?: boolean | undefined;
|
|
20
18
|
}
|
|
21
19
|
export declare namespace TooltipPortal {
|
|
20
|
+
type State = TooltipPortalState;
|
|
22
21
|
type Props = TooltipPortalProps;
|
|
23
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { type Side, type Align, type UseAnchorPositioningSharedParameters } from "../../utils/useAnchorPositioning.js";
|
|
3
3
|
import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Positions the tooltip against the trigger.
|
|
@@ -13,15 +13,24 @@ export interface TooltipPositionerState {
|
|
|
13
13
|
* Whether the tooltip is currently open.
|
|
14
14
|
*/
|
|
15
15
|
open: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* The side of the anchor the component is placed on.
|
|
18
|
+
*/
|
|
16
19
|
side: Side;
|
|
20
|
+
/**
|
|
21
|
+
* The alignment of the component relative to the anchor.
|
|
22
|
+
*/
|
|
17
23
|
align: Align;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the anchor element is hidden.
|
|
26
|
+
*/
|
|
18
27
|
anchorHidden: boolean;
|
|
19
28
|
/**
|
|
20
29
|
* Whether CSS transitions should be disabled.
|
|
21
30
|
*/
|
|
22
31
|
instant: string | undefined;
|
|
23
32
|
}
|
|
24
|
-
export interface TooltipPositionerProps extends BaseUIComponentProps<'div',
|
|
33
|
+
export interface TooltipPositionerProps extends BaseUIComponentProps<'div', TooltipPositionerState>, Omit<UseAnchorPositioningSharedParameters, 'side'> {
|
|
25
34
|
/**
|
|
26
35
|
* Which side of the anchor element to align the popup against.
|
|
27
36
|
* May automatically change to avoid collisions.
|
|
@@ -6,6 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
* Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip)
|
|
7
7
|
*/
|
|
8
8
|
export declare const TooltipProvider: React.FC<TooltipProvider.Props>;
|
|
9
|
+
export interface TooltipProviderState {}
|
|
9
10
|
export interface TooltipProviderProps {
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
/**
|
|
@@ -24,5 +25,6 @@ export interface TooltipProviderProps {
|
|
|
24
25
|
timeout?: number | undefined;
|
|
25
26
|
}
|
|
26
27
|
export declare namespace TooltipProvider {
|
|
28
|
+
type State = TooltipProviderState;
|
|
27
29
|
type Props = TooltipProviderProps;
|
|
28
30
|
}
|
|
@@ -40,7 +40,7 @@ export interface TooltipRootProps<Payload = unknown> {
|
|
|
40
40
|
* Determines which axis the tooltip should track the cursor on.
|
|
41
41
|
* @default 'none'
|
|
42
42
|
*/
|
|
43
|
-
trackCursorAxis?:
|
|
43
|
+
trackCursorAxis?: 'none' | 'x' | 'y' | 'both' | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* A ref to imperative actions.
|
|
46
46
|
* - `unmount`: Unmounts the tooltip popup.
|
|
@@ -68,12 +68,12 @@ export interface TooltipRootProps<Payload = unknown> {
|
|
|
68
68
|
* This is useful in conjunction with the `open` prop to create a controlled tooltip.
|
|
69
69
|
* There's no need to specify this prop when the tooltip is uncontrolled (i.e. when the `open` prop is not set).
|
|
70
70
|
*/
|
|
71
|
-
triggerId?:
|
|
71
|
+
triggerId?: string | null | undefined;
|
|
72
72
|
/**
|
|
73
73
|
* ID of the trigger that the tooltip is associated with.
|
|
74
74
|
* This is useful in conjunction with the `defaultOpen` prop to create an initially open tooltip.
|
|
75
75
|
*/
|
|
76
|
-
defaultTriggerId?:
|
|
76
|
+
defaultTriggerId?: string | null | undefined;
|
|
77
77
|
}
|
|
78
78
|
export interface TooltipRootActions {
|
|
79
79
|
unmount: () => void;
|
|
@@ -118,7 +118,7 @@ const TooltipRoot = exports.TooltipRoot = (0, _fastHooks.fastComponent)(function
|
|
|
118
118
|
const floatingRootContext = store.useState('floatingRootContext');
|
|
119
119
|
const dismiss = (0, _floatingUiReact.useDismiss)(floatingRootContext, {
|
|
120
120
|
enabled: !disabled,
|
|
121
|
-
referencePress:
|
|
121
|
+
referencePress: () => store.select('closeOnClick')
|
|
122
122
|
});
|
|
123
123
|
const clientPoint = (0, _floatingUiReact.useClientPoint)(floatingRootContext, {
|
|
124
124
|
enabled: !disabled && trackCursorAxis !== 'none',
|
|
@@ -9,6 +9,7 @@ export type State<Payload> = PopupStoreState<Payload> & {
|
|
|
9
9
|
trackCursorAxis: 'none' | 'x' | 'y' | 'both';
|
|
10
10
|
disableHoverablePopup: boolean;
|
|
11
11
|
openChangeReason: TooltipRoot.ChangeEventReason | null;
|
|
12
|
+
closeOnClick: boolean;
|
|
12
13
|
closeDelay: number;
|
|
13
14
|
hasViewport: boolean;
|
|
14
15
|
};
|
|
@@ -22,6 +23,7 @@ declare const selectors: {
|
|
|
22
23
|
trackCursorAxis: (state: State<unknown>) => "none" | "both" | "x" | "y";
|
|
23
24
|
disableHoverablePopup: (state: State<unknown>) => boolean;
|
|
24
25
|
lastOpenChangeReason: (state: State<unknown>) => import("../index.js").TooltipRootChangeEventReason | null;
|
|
26
|
+
closeOnClick: (state: State<unknown>) => boolean;
|
|
25
27
|
closeDelay: (state: State<unknown>) => number;
|
|
26
28
|
hasViewport: (state: State<unknown>) => boolean;
|
|
27
29
|
open: (state: {
|
|
@@ -20,6 +20,7 @@ const selectors = {
|
|
|
20
20
|
trackCursorAxis: (0, _store.createSelector)(state => state.trackCursorAxis),
|
|
21
21
|
disableHoverablePopup: (0, _store.createSelector)(state => state.disableHoverablePopup),
|
|
22
22
|
lastOpenChangeReason: (0, _store.createSelector)(state => state.openChangeReason),
|
|
23
|
+
closeOnClick: (0, _store.createSelector)(state => state.closeOnClick),
|
|
23
24
|
closeDelay: (0, _store.createSelector)(state => state.closeDelay),
|
|
24
25
|
hasViewport: (0, _store.createSelector)(state => state.hasViewport)
|
|
25
26
|
};
|
|
@@ -108,6 +109,7 @@ function createInitialState() {
|
|
|
108
109
|
trackCursorAxis: 'none',
|
|
109
110
|
disableHoverablePopup: false,
|
|
110
111
|
openChangeReason: null,
|
|
112
|
+
closeOnClick: true,
|
|
111
113
|
closeDelay: 0,
|
|
112
114
|
hasViewport: false
|
|
113
115
|
};
|
|
@@ -17,7 +17,7 @@ export interface TooltipTriggerState {
|
|
|
17
17
|
*/
|
|
18
18
|
open: boolean;
|
|
19
19
|
}
|
|
20
|
-
export interface TooltipTriggerProps<Payload = unknown> extends BaseUIComponentProps<'button',
|
|
20
|
+
export interface TooltipTriggerProps<Payload = unknown> extends BaseUIComponentProps<'button', TooltipTriggerState> {
|
|
21
21
|
/**
|
|
22
22
|
* A handle to associate the trigger with a tooltip.
|
|
23
23
|
*/
|
|
@@ -31,6 +31,11 @@ export interface TooltipTriggerProps<Payload = unknown> extends BaseUIComponentP
|
|
|
31
31
|
* @default 600
|
|
32
32
|
*/
|
|
33
33
|
delay?: number | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the tooltip should close when this trigger is clicked.
|
|
36
|
+
* @default true
|
|
37
|
+
*/
|
|
38
|
+
closeOnClick?: boolean | undefined;
|
|
34
39
|
/**
|
|
35
40
|
* How long to wait before closing the tooltip. Specified in milliseconds.
|
|
36
41
|
* @default 0
|