@base-ui/react 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +173 -0
- package/accordion/item/AccordionItem.d.ts +1 -1
- package/accordion/item/AccordionItemContext.d.ts +1 -1
- package/accordion/root/AccordionRoot.d.ts +9 -9
- package/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/alert-dialog/root/AlertDialogRoot.js +6 -4
- package/autocomplete/index.parts.d.ts +2 -1
- package/autocomplete/index.parts.js +8 -1
- package/autocomplete/root/AutocompleteRoot.d.ts +19 -14
- package/autocomplete/root/AutocompleteRoot.js +4 -6
- package/avatar/fallback/AvatarFallback.d.ts +7 -2
- package/avatar/fallback/AvatarFallback.js +34 -6
- package/avatar/image/AvatarImage.d.ts +7 -2
- package/avatar/image/AvatarImage.js +35 -6
- package/avatar/image/useImageLoadingStatus.d.ts +2 -2
- package/avatar/root/AvatarRoot.js +2 -2
- package/button/Button.d.ts +1 -1
- package/button/Button.js +2 -2
- package/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/checkbox/indicator/CheckboxIndicator.js +4 -4
- package/checkbox/root/CheckboxRoot.d.ts +13 -13
- package/checkbox/root/CheckboxRoot.js +31 -8
- package/checkbox-group/CheckboxGroup.d.ts +5 -5
- package/checkbox-group/CheckboxGroup.js +2 -2
- package/checkbox-group/useCheckboxGroupParent.d.ts +3 -3
- package/collapsible/panel/CollapsiblePanel.d.ts +2 -2
- package/collapsible/root/CollapsibleRoot.d.ts +4 -4
- package/collapsible/root/useCollapsibleRoot.d.ts +2 -2
- package/combobox/arrow/ComboboxArrow.js +2 -2
- package/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
- package/combobox/backdrop/ComboboxBackdrop.js +2 -2
- package/combobox/chip/ComboboxChip.js +6 -3
- package/combobox/chip/ComboboxChipContext.js +1 -0
- package/combobox/chip-remove/ComboboxChipRemove.js +28 -33
- package/combobox/chips/ComboboxChipsContext.js +1 -0
- package/combobox/clear/ComboboxClear.d.ts +2 -2
- package/combobox/clear/ComboboxClear.js +2 -3
- package/combobox/group/ComboboxGroup.d.ts +1 -1
- package/combobox/group/ComboboxGroupContext.d.ts +1 -1
- package/combobox/group/ComboboxGroupContext.js +1 -0
- package/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/combobox/index.parts.d.ts +2 -1
- package/combobox/index.parts.js +8 -1
- package/combobox/input/ComboboxInput.d.ts +1 -1
- package/combobox/input/ComboboxInput.js +38 -8
- package/combobox/item/ComboboxItem.d.ts +3 -3
- package/combobox/item/ComboboxItem.js +15 -15
- package/combobox/item/ComboboxItemContext.js +1 -0
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
- package/combobox/list/ComboboxList.js +2 -2
- package/combobox/popup/ComboboxPopup.d.ts +2 -2
- package/combobox/popup/ComboboxPopup.js +3 -4
- package/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
- package/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/combobox/portal/ComboboxPortalContext.js +1 -0
- package/combobox/positioner/ComboboxPositioner.js +5 -3
- package/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
- package/combobox/root/AriaCombobox.d.ts +49 -44
- package/combobox/root/AriaCombobox.js +44 -62
- package/combobox/root/ComboboxRoot.d.ts +19 -14
- package/combobox/root/ComboboxRoot.js +3 -1
- package/combobox/root/ComboboxRootContext.d.ts +1 -0
- package/combobox/root/ComboboxRootContext.js +1 -0
- package/combobox/root/utils/useFilter.d.ts +2 -2
- package/combobox/root/utils/useFilteredItems.d.ts +4 -0
- package/combobox/root/utils/useFilteredItems.js +14 -0
- package/combobox/row/ComboboxRowContext.js +1 -0
- package/combobox/store.d.ts +11 -11
- package/combobox/store.js +3 -3
- package/combobox/trigger/ComboboxTrigger.d.ts +1 -1
- package/combobox/trigger/ComboboxTrigger.js +3 -4
- package/composite/item/CompositeItem.d.ts +6 -6
- package/composite/list/CompositeList.d.ts +3 -3
- package/composite/list/CompositeListContext.d.ts +1 -1
- package/composite/list/useCompositeListItem.d.ts +5 -5
- package/composite/root/CompositeRoot.d.ts +19 -19
- package/composite/root/useCompositeRoot.d.ts +12 -12
- package/context-menu/index.d.ts +1 -0
- package/context-menu/index.parts.d.ts +1 -0
- package/context-menu/index.parts.js +7 -0
- package/context-menu/root/ContextMenuRoot.d.ts +1 -1
- package/context-menu/root/ContextMenuRootContext.js +1 -0
- package/context-menu/trigger/ContextMenuTrigger.js +13 -3
- package/csp-provider/CSPContext.d.ts +2 -2
- package/csp-provider/CSPProvider.d.ts +2 -2
- package/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dialog/backdrop/DialogBackdrop.js +2 -2
- package/dialog/close/DialogClose.js +2 -2
- package/dialog/popup/DialogPopup.d.ts +2 -2
- package/dialog/popup/DialogPopup.js +2 -2
- package/dialog/portal/DialogPortal.d.ts +2 -2
- package/dialog/portal/DialogPortalContext.js +1 -0
- package/dialog/root/DialogRoot.d.ts +10 -10
- package/dialog/root/DialogRoot.js +17 -4
- package/dialog/root/useDialogRoot.d.ts +3 -3
- package/dialog/root/useDialogRoot.js +4 -0
- package/dialog/store/DialogStore.d.ts +258 -17
- package/dialog/store/DialogStore.js +3 -0
- package/dialog/trigger/DialogTrigger.d.ts +3 -3
- package/dialog/trigger/DialogTrigger.js +3 -3
- package/dialog/viewport/DialogViewport.js +5 -2
- package/direction-provider/DirectionProvider.d.ts +1 -1
- package/drawer/backdrop/DrawerBackdrop.d.ts +28 -0
- package/drawer/backdrop/DrawerBackdrop.js +63 -0
- package/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
- package/drawer/backdrop/DrawerBackdropCssVars.js +14 -0
- package/drawer/close/DrawerClose.d.ts +23 -0
- package/drawer/close/DrawerClose.js +15 -0
- package/drawer/content/DrawerContent.d.ts +15 -0
- package/drawer/content/DrawerContent.js +32 -0
- package/drawer/description/DrawerDescription.d.ts +18 -0
- package/drawer/description/DrawerDescription.js +15 -0
- package/drawer/indent/DrawerIndent.d.ts +20 -0
- package/drawer/indent/DrawerIndent.js +87 -0
- package/drawer/indent-background/DrawerIndentBackground.d.ts +18 -0
- package/drawer/indent-background/DrawerIndentBackground.js +47 -0
- package/drawer/index.d.ts +14 -0
- package/drawer/index.js +9 -0
- package/drawer/index.parts.d.ts +14 -0
- package/drawer/index.parts.js +109 -0
- package/drawer/popup/DrawerPopup.d.ts +69 -0
- package/drawer/popup/DrawerPopup.js +291 -0
- package/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
- package/drawer/popup/DrawerPopupCssVars.js +44 -0
- package/drawer/popup/DrawerPopupDataAttributes.d.ts +27 -0
- package/drawer/popup/DrawerPopupDataAttributes.js +34 -0
- package/drawer/portal/DrawerPortal.d.ts +29 -0
- package/drawer/portal/DrawerPortal.js +16 -0
- package/drawer/provider/DrawerProvider.d.ts +16 -0
- package/drawer/provider/DrawerProvider.js +100 -0
- package/drawer/provider/DrawerProviderContext.d.ts +19 -0
- package/drawer/provider/DrawerProviderContext.js +21 -0
- package/drawer/root/DrawerRoot.d.ts +124 -0
- package/drawer/root/DrawerRoot.js +235 -0
- package/drawer/root/DrawerRootContext.d.ts +89 -0
- package/drawer/root/DrawerRootContext.js +21 -0
- package/drawer/root/useDrawerSnapPoints.d.ts +15 -0
- package/drawer/root/useDrawerSnapPoints.js +155 -0
- package/drawer/swipe-area/DrawerSwipeArea.d.ts +45 -0
- package/drawer/swipe-area/DrawerSwipeArea.js +385 -0
- package/drawer/title/DrawerTitle.d.ts +18 -0
- package/drawer/title/DrawerTitle.js +15 -0
- package/drawer/trigger/DrawerTrigger.d.ts +43 -0
- package/drawer/trigger/DrawerTrigger.js +15 -0
- package/drawer/viewport/DrawerViewport.d.ts +30 -0
- package/drawer/viewport/DrawerViewport.js +873 -0
- package/drawer/viewport/DrawerViewportContext.d.ts +11 -0
- package/drawer/viewport/DrawerViewportContext.js +21 -0
- package/esm/accordion/item/AccordionItem.d.ts +1 -1
- package/esm/accordion/item/AccordionItemContext.d.ts +1 -1
- package/esm/accordion/root/AccordionRoot.d.ts +9 -9
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/esm/alert-dialog/root/AlertDialogRoot.js +6 -4
- package/esm/autocomplete/index.parts.d.ts +2 -1
- package/esm/autocomplete/index.parts.js +2 -1
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +19 -14
- package/esm/autocomplete/root/AutocompleteRoot.js +4 -6
- package/esm/avatar/fallback/AvatarFallback.d.ts +7 -2
- package/esm/avatar/fallback/AvatarFallback.js +33 -6
- package/esm/avatar/image/AvatarImage.d.ts +7 -2
- package/esm/avatar/image/AvatarImage.js +34 -6
- package/esm/avatar/image/useImageLoadingStatus.d.ts +2 -2
- package/esm/avatar/root/AvatarRoot.js +2 -2
- package/esm/button/Button.d.ts +1 -1
- package/esm/button/Button.js +2 -2
- package/esm/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/esm/checkbox/indicator/CheckboxIndicator.js +4 -4
- package/esm/checkbox/root/CheckboxRoot.d.ts +13 -13
- package/esm/checkbox/root/CheckboxRoot.js +31 -8
- package/esm/checkbox-group/CheckboxGroup.d.ts +5 -5
- package/esm/checkbox-group/CheckboxGroup.js +2 -2
- package/esm/checkbox-group/useCheckboxGroupParent.d.ts +3 -3
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +2 -2
- package/esm/collapsible/root/CollapsibleRoot.d.ts +4 -4
- package/esm/collapsible/root/useCollapsibleRoot.d.ts +2 -2
- package/esm/combobox/arrow/ComboboxArrow.js +2 -2
- package/esm/combobox/arrow/ComboboxArrowDataAttributes.js +2 -2
- package/esm/combobox/backdrop/ComboboxBackdrop.js +2 -2
- package/esm/combobox/chip/ComboboxChip.js +6 -3
- package/esm/combobox/chip/ComboboxChipContext.js +2 -0
- package/esm/combobox/chip-remove/ComboboxChipRemove.js +28 -33
- package/esm/combobox/chips/ComboboxChipsContext.js +2 -0
- package/esm/combobox/clear/ComboboxClear.d.ts +2 -2
- package/esm/combobox/clear/ComboboxClear.js +2 -3
- package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroupContext.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroupContext.js +2 -0
- package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/esm/combobox/index.parts.d.ts +2 -1
- package/esm/combobox/index.parts.js +2 -1
- package/esm/combobox/input/ComboboxInput.d.ts +1 -1
- package/esm/combobox/input/ComboboxInput.js +38 -8
- package/esm/combobox/item/ComboboxItem.d.ts +3 -3
- package/esm/combobox/item/ComboboxItem.js +15 -15
- package/esm/combobox/item/ComboboxItemContext.js +2 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicator.js +2 -2
- package/esm/combobox/list/ComboboxList.js +2 -2
- package/esm/combobox/popup/ComboboxPopup.d.ts +2 -2
- package/esm/combobox/popup/ComboboxPopup.js +3 -4
- package/esm/combobox/popup/ComboboxPopupDataAttributes.js +2 -2
- package/esm/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/esm/combobox/portal/ComboboxPortalContext.js +2 -0
- package/esm/combobox/positioner/ComboboxPositioner.js +5 -3
- package/esm/combobox/positioner/ComboboxPositionerDataAttributes.js +2 -2
- package/esm/combobox/root/AriaCombobox.d.ts +49 -44
- package/esm/combobox/root/AriaCombobox.js +45 -63
- package/esm/combobox/root/ComboboxRoot.d.ts +19 -14
- package/esm/combobox/root/ComboboxRoot.js +3 -1
- package/esm/combobox/root/ComboboxRootContext.d.ts +1 -0
- package/esm/combobox/root/ComboboxRootContext.js +2 -0
- package/esm/combobox/root/utils/useFilter.d.ts +2 -2
- package/esm/combobox/root/utils/useFilteredItems.d.ts +4 -0
- package/esm/combobox/root/utils/useFilteredItems.js +9 -0
- package/esm/combobox/row/ComboboxRowContext.js +2 -0
- package/esm/combobox/store.d.ts +11 -11
- package/esm/combobox/store.js +3 -3
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +1 -1
- package/esm/combobox/trigger/ComboboxTrigger.js +3 -4
- package/esm/composite/item/CompositeItem.d.ts +6 -6
- package/esm/composite/list/CompositeList.d.ts +3 -3
- package/esm/composite/list/CompositeListContext.d.ts +1 -1
- package/esm/composite/list/useCompositeListItem.d.ts +5 -5
- package/esm/composite/root/CompositeRoot.d.ts +19 -19
- package/esm/composite/root/useCompositeRoot.d.ts +12 -12
- package/esm/context-menu/index.d.ts +1 -0
- package/esm/context-menu/index.parts.d.ts +1 -0
- package/esm/context-menu/index.parts.js +1 -0
- package/esm/context-menu/root/ContextMenuRoot.d.ts +1 -1
- package/esm/context-menu/root/ContextMenuRootContext.js +2 -0
- package/esm/context-menu/trigger/ContextMenuTrigger.js +13 -3
- package/esm/csp-provider/CSPContext.d.ts +2 -2
- package/esm/csp-provider/CSPProvider.d.ts +2 -2
- package/esm/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/esm/dialog/backdrop/DialogBackdrop.js +2 -2
- package/esm/dialog/close/DialogClose.js +2 -2
- package/esm/dialog/popup/DialogPopup.d.ts +2 -2
- package/esm/dialog/popup/DialogPopup.js +2 -2
- package/esm/dialog/portal/DialogPortal.d.ts +2 -2
- package/esm/dialog/portal/DialogPortalContext.js +2 -0
- package/esm/dialog/root/DialogRoot.d.ts +10 -10
- package/esm/dialog/root/DialogRoot.js +17 -4
- package/esm/dialog/root/useDialogRoot.d.ts +3 -3
- package/esm/dialog/root/useDialogRoot.js +4 -0
- package/esm/dialog/store/DialogStore.d.ts +258 -17
- package/esm/dialog/store/DialogStore.js +3 -0
- package/esm/dialog/trigger/DialogTrigger.d.ts +3 -3
- package/esm/dialog/trigger/DialogTrigger.js +2 -2
- package/esm/dialog/viewport/DialogViewport.js +5 -2
- package/esm/direction-provider/DirectionProvider.d.ts +1 -1
- package/esm/drawer/backdrop/DrawerBackdrop.d.ts +28 -0
- package/esm/drawer/backdrop/DrawerBackdrop.js +57 -0
- package/esm/drawer/backdrop/DrawerBackdropCssVars.d.ts +7 -0
- package/esm/drawer/backdrop/DrawerBackdropCssVars.js +8 -0
- package/esm/drawer/close/DrawerClose.d.ts +23 -0
- package/esm/drawer/close/DrawerClose.js +10 -0
- package/esm/drawer/content/DrawerContent.d.ts +15 -0
- package/esm/drawer/content/DrawerContent.js +27 -0
- package/esm/drawer/description/DrawerDescription.d.ts +18 -0
- package/esm/drawer/description/DrawerDescription.js +10 -0
- package/esm/drawer/indent/DrawerIndent.d.ts +20 -0
- package/esm/drawer/indent/DrawerIndent.js +81 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.d.ts +18 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.js +41 -0
- package/esm/drawer/index.d.ts +14 -0
- package/esm/drawer/index.js +1 -0
- package/esm/drawer/index.parts.d.ts +14 -0
- package/esm/drawer/index.parts.js +14 -0
- package/esm/drawer/popup/DrawerPopup.d.ts +69 -0
- package/esm/drawer/popup/DrawerPopup.js +285 -0
- package/esm/drawer/popup/DrawerPopupCssVars.d.ts +37 -0
- package/esm/drawer/popup/DrawerPopupCssVars.js +38 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.d.ts +27 -0
- package/esm/drawer/popup/DrawerPopupDataAttributes.js +28 -0
- package/esm/drawer/portal/DrawerPortal.d.ts +29 -0
- package/esm/drawer/portal/DrawerPortal.js +11 -0
- package/esm/drawer/provider/DrawerProvider.d.ts +16 -0
- package/esm/drawer/provider/DrawerProvider.js +95 -0
- package/esm/drawer/provider/DrawerProviderContext.d.ts +19 -0
- package/esm/drawer/provider/DrawerProviderContext.js +13 -0
- package/esm/drawer/root/DrawerRoot.d.ts +124 -0
- package/esm/drawer/root/DrawerRoot.js +229 -0
- package/esm/drawer/root/DrawerRootContext.d.ts +89 -0
- package/esm/drawer/root/DrawerRootContext.js +13 -0
- package/esm/drawer/root/useDrawerSnapPoints.d.ts +15 -0
- package/esm/drawer/root/useDrawerSnapPoints.js +149 -0
- package/esm/drawer/swipe-area/DrawerSwipeArea.d.ts +45 -0
- package/esm/drawer/swipe-area/DrawerSwipeArea.js +379 -0
- package/esm/drawer/title/DrawerTitle.d.ts +18 -0
- package/esm/drawer/title/DrawerTitle.js +10 -0
- package/esm/drawer/trigger/DrawerTrigger.d.ts +43 -0
- package/esm/drawer/trigger/DrawerTrigger.js +10 -0
- package/esm/drawer/viewport/DrawerViewport.d.ts +30 -0
- package/esm/drawer/viewport/DrawerViewport.js +867 -0
- package/esm/drawer/viewport/DrawerViewportContext.d.ts +11 -0
- package/esm/drawer/viewport/DrawerViewportContext.js +13 -0
- package/esm/field/control/FieldControl.d.ts +3 -3
- package/esm/field/control/FieldControl.js +22 -20
- package/esm/field/error/FieldError.d.ts +5 -2
- package/esm/field/error/FieldError.js +50 -7
- package/esm/field/item/FieldItem.d.ts +1 -1
- package/esm/field/item/FieldItemContext.js +2 -0
- package/esm/field/label/FieldLabel.d.ts +1 -1
- package/esm/field/label/FieldLabel.js +7 -2
- package/esm/field/root/FieldRoot.d.ts +9 -9
- package/esm/field/root/FieldRootContext.d.ts +1 -1
- package/esm/field/useField.d.ts +1 -1
- package/esm/field/useField.js +2 -0
- package/esm/field/validity/FieldValidity.d.ts +2 -0
- package/esm/field/validity/FieldValidity.js +11 -4
- package/esm/fieldset/legend/FieldsetLegend.js +2 -2
- package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/esm/fieldset/root/FieldsetRoot.js +3 -3
- package/esm/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
- package/esm/floating-ui-react/components/FloatingDelayGroup.js +2 -9
- package/esm/floating-ui-react/components/FloatingFocusManager.d.ts +11 -21
- package/esm/floating-ui-react/components/FloatingFocusManager.js +63 -76
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +8 -9
- package/esm/floating-ui-react/components/FloatingPortal.js +1 -3
- package/esm/floating-ui-react/components/FloatingTree.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useClick.d.ts +12 -6
- package/esm/floating-ui-react/hooks/useClick.js +6 -5
- package/esm/floating-ui-react/hooks/useClientPoint.d.ts +2 -12
- package/esm/floating-ui-react/hooks/useClientPoint.js +5 -16
- package/esm/floating-ui-react/hooks/useDismiss.d.ts +15 -15
- package/esm/floating-ui-react/hooks/useDismiss.js +6 -3
- package/esm/floating-ui-react/hooks/useFloating.js +2 -0
- package/esm/floating-ui-react/hooks/useFloatingRootContext.d.ts +4 -10
- package/esm/floating-ui-react/hooks/useFloatingRootContext.js +5 -3
- package/esm/floating-ui-react/hooks/useFocus.d.ts +2 -8
- package/esm/floating-ui-react/hooks/useFocus.js +11 -12
- package/esm/floating-ui-react/hooks/useHover.d.ts +7 -30
- package/esm/floating-ui-react/hooks/useHover.js +20 -37
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -7
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +35 -40
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +17 -14
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +36 -30
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +7 -3
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +57 -60
- package/esm/floating-ui-react/hooks/useInteractions.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
- package/esm/floating-ui-react/hooks/useListNavigation.js +13 -12
- package/esm/floating-ui-react/hooks/useRole.d.ts +1 -7
- package/esm/floating-ui-react/hooks/useRole.js +2 -3
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +2 -2
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +2 -0
- package/esm/floating-ui-react/hooks/useTypeahead.d.ts +6 -16
- package/esm/floating-ui-react/hooks/useTypeahead.js +48 -16
- package/esm/floating-ui-react/middleware/arrow.d.ts +1 -1
- package/esm/floating-ui-react/safePolygon.d.ts +3 -3
- package/esm/floating-ui-react/types.d.ts +14 -14
- package/esm/floating-ui-react/utils/composite.d.ts +5 -5
- package/esm/floating-ui-react/utils/composite.js +1 -2
- package/esm/floating-ui-react/utils/element.d.ts +2 -1
- package/esm/floating-ui-react/utils/element.js +16 -4
- package/esm/floating-ui-react/utils/enqueueFocus.d.ts +3 -3
- package/esm/floating-ui-react/utils/event.js +2 -4
- package/esm/floating-ui-react/utils/markOthers.js +2 -2
- package/esm/floating-ui-react/utils/tabbable.js +6 -5
- package/esm/form/Form.d.ts +5 -5
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/input/Input.d.ts +3 -3
- package/esm/labelable-provider/LabelableContext.d.ts +1 -1
- package/esm/labelable-provider/LabelableContext.js +1 -1
- package/esm/labelable-provider/LabelableProvider.js +33 -3
- package/esm/labelable-provider/useLabelableId.d.ts +3 -2
- package/esm/labelable-provider/useLabelableId.js +38 -12
- package/esm/menu/arrow/MenuArrow.js +2 -2
- package/esm/menu/arrow/MenuArrowDataAttributes.js +2 -2
- package/esm/menu/backdrop/MenuBackdrop.js +2 -2
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +8 -8
- package/esm/menu/checkbox-item/MenuCheckboxItemContext.js +2 -0
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +2 -2
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
- package/esm/menu/group/MenuGroupContext.js +2 -0
- package/esm/menu/index.d.ts +2 -1
- package/esm/menu/index.parts.d.ts +1 -0
- package/esm/menu/index.parts.js +1 -0
- package/esm/menu/item/MenuItem.d.ts +5 -5
- package/esm/menu/item/MenuItem.js +2 -2
- package/esm/menu/item/useMenuItem.js +12 -48
- package/esm/menu/item/useMenuItemCommonProps.d.ts +43 -0
- package/esm/menu/item/useMenuItemCommonProps.js +66 -0
- package/esm/menu/link-item/MenuLinkItem.d.ts +34 -0
- package/esm/menu/link-item/MenuLinkItem.js +55 -0
- package/esm/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
- package/esm/menu/link-item/MenuLinkItemDataAttributes.js +7 -0
- package/esm/menu/popup/MenuPopup.d.ts +3 -2
- package/esm/menu/popup/MenuPopup.js +2 -2
- package/esm/menu/popup/MenuPopupDataAttributes.js +2 -2
- package/esm/menu/portal/MenuPortal.d.ts +1 -1
- package/esm/menu/portal/MenuPortalContext.js +2 -0
- package/esm/menu/positioner/MenuPositioner.js +6 -12
- package/esm/menu/positioner/MenuPositionerDataAttributes.js +2 -2
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +2 -2
- package/esm/menu/radio-group/MenuRadioGroup.js +2 -2
- package/esm/menu/radio-group/MenuRadioGroupContext.js +2 -0
- package/esm/menu/radio-item/MenuRadioItem.d.ts +5 -5
- package/esm/menu/radio-item/MenuRadioItemContext.js +2 -0
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +2 -2
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
- package/esm/menu/root/MenuRoot.d.ts +15 -15
- package/esm/menu/root/MenuRoot.js +38 -36
- package/esm/menu/store/MenuStore.d.ts +255 -15
- package/esm/menu/store/MenuStore.js +2 -11
- package/esm/menu/submenu-root/MenuSubmenuRoot.d.ts +2 -2
- package/esm/menu/submenu-root/MenuSubmenuRootContext.js +2 -0
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +22 -22
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +9 -7
- package/esm/menu/trigger/MenuTrigger.d.ts +10 -6
- package/esm/menu/trigger/MenuTrigger.js +4 -3
- package/esm/menubar/Menubar.d.ts +4 -4
- package/esm/menubar/Menubar.js +2 -2
- package/esm/meter/root/MeterRoot.d.ts +6 -6
- package/esm/meter/root/MeterRoot.js +3 -11
- package/esm/meter/value/MeterValue.d.ts +1 -1
- package/esm/navigation-menu/arrow/NavigationMenuArrow.js +2 -2
- package/esm/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
- package/esm/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
- package/esm/navigation-menu/content/NavigationMenuContent.js +26 -5
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/esm/navigation-menu/icon/NavigationMenuIcon.js +2 -2
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/esm/navigation-menu/item/NavigationMenuItemContext.js +2 -0
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +2 -2
- package/esm/navigation-menu/link/NavigationMenuLink.js +2 -2
- package/esm/navigation-menu/list/NavigationMenuDismissContext.js +2 -0
- package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.js +2 -2
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +13 -0
- package/esm/navigation-menu/popup/NavigationMenuPopup.js +2 -2
- package/esm/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
- package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +2 -2
- package/esm/navigation-menu/portal/NavigationMenuPortalContext.js +2 -0
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
- package/esm/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +6 -6
- package/esm/navigation-menu/root/NavigationMenuRoot.js +2 -2
- package/esm/navigation-menu/root/NavigationMenuRootContext.js +2 -0
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +8 -124
- package/esm/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.js +21 -1
- package/esm/number-field/input/NumberFieldInput.js +3 -11
- package/esm/number-field/root/NumberFieldRoot.d.ts +27 -20
- package/esm/number-field/root/NumberFieldRoot.js +22 -7
- package/esm/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/esm/number-field/root/useNumberFieldButton.d.ts +3 -3
- package/esm/number-field/root/useNumberFieldButton.js +12 -7
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +2 -2
- package/esm/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
- package/esm/number-field/scrub-area/NumberFieldScrubAreaContext.js +2 -0
- package/esm/number-field/utils/stateAttributesMapping.js +3 -1
- package/esm/number-field/utils/subscribeToVisualViewportResize.d.ts +1 -1
- package/esm/number-field/utils/types.d.ts +5 -5
- package/esm/number-field/utils/validate.d.ts +3 -1
- package/esm/number-field/utils/validate.js +3 -2
- package/esm/popover/arrow/PopoverArrow.js +2 -2
- package/esm/popover/arrow/PopoverArrowDataAttributes.js +2 -2
- package/esm/popover/backdrop/PopoverBackdrop.js +2 -2
- package/esm/popover/popup/PopoverPopup.d.ts +3 -2
- package/esm/popover/popup/PopoverPopup.js +2 -2
- package/esm/popover/portal/PopoverPortal.d.ts +1 -1
- package/esm/popover/portal/PopoverPortal.js +1 -2
- package/esm/popover/portal/PopoverPortalContext.js +2 -0
- package/esm/popover/positioner/PopoverPositioner.js +3 -3
- package/esm/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
- package/esm/popover/root/PopoverRoot.d.ts +9 -9
- package/esm/popover/root/PopoverRoot.js +18 -5
- package/esm/popover/store/PopoverStore.d.ts +255 -15
- package/esm/popover/trigger/PopoverTrigger.d.ts +7 -7
- package/esm/popover/trigger/PopoverTrigger.js +2 -2
- package/esm/popover/viewport/PopoverViewport.d.ts +9 -1
- package/esm/popover/viewport/PopoverViewport.js +19 -196
- package/esm/popover/viewport/PopoverViewportDataAttributes.d.ts +5 -0
- package/esm/popover/viewport/PopoverViewportDataAttributes.js +5 -0
- package/esm/preview-card/arrow/PreviewCardArrow.js +2 -2
- package/esm/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
- package/esm/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
- package/esm/preview-card/popup/PreviewCardPopup.js +2 -2
- package/esm/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
- package/esm/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/esm/preview-card/portal/PreviewCardPortalContext.js +2 -0
- package/esm/preview-card/positioner/PreviewCardPositioner.js +2 -2
- package/esm/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
- package/esm/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
- package/esm/preview-card/root/PreviewCardRoot.d.ts +8 -8
- package/esm/preview-card/root/PreviewCardRoot.js +17 -4
- package/esm/preview-card/store/PreviewCardStore.d.ts +255 -15
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +4 -4
- package/esm/preview-card/trigger/PreviewCardTrigger.js +2 -2
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +6 -1
- package/esm/preview-card/viewport/PreviewCardViewport.js +14 -230
- package/esm/progress/root/ProgressRoot.d.ts +6 -6
- package/esm/progress/root/ProgressRoot.js +2 -13
- package/esm/progress/value/ProgressValue.d.ts +1 -1
- package/esm/radio/indicator/RadioIndicator.d.ts +1 -1
- package/esm/radio/indicator/RadioIndicator.js +4 -4
- package/esm/radio/root/RadioRoot.d.ts +37 -17
- package/esm/radio/root/RadioRoot.js +45 -11
- package/esm/radio-group/RadioGroup.d.ts +18 -12
- package/esm/radio-group/RadioGroup.js +69 -62
- package/esm/radio-group/RadioGroupContext.d.ts +9 -8
- package/esm/radio-group/RadioGroupContext.js +1 -13
- package/esm/scroll-area/root/ScrollAreaRoot.d.ts +4 -2
- package/esm/scroll-area/root/ScrollAreaRoot.js +2 -1
- package/esm/scroll-area/root/ScrollAreaRootContext.js +2 -0
- package/esm/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +4 -0
- package/esm/scroll-area/root/ScrollAreaRootDataAttributes.js +4 -0
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +2 -2
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbarContext.js +2 -0
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +1 -1
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +1 -1
- package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +2 -2
- package/esm/scroll-area/utils/scrollEdges.d.ts +2 -0
- package/esm/scroll-area/utils/scrollEdges.js +22 -0
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +18 -15
- package/esm/scroll-area/viewport/ScrollAreaViewportContext.js +2 -0
- package/esm/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +4 -0
- package/esm/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +4 -0
- package/esm/select/arrow/SelectArrow.js +2 -2
- package/esm/select/arrow/SelectArrowDataAttributes.js +2 -2
- package/esm/select/backdrop/SelectBackdrop.js +2 -2
- package/esm/select/group/SelectGroupContext.js +2 -0
- package/esm/select/icon/SelectIcon.js +2 -2
- package/esm/select/item/SelectItem.d.ts +2 -2
- package/esm/select/item/SelectItem.js +13 -13
- package/esm/select/item/SelectItemContext.js +2 -0
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/esm/select/item-indicator/SelectItemIndicator.js +2 -2
- package/esm/select/popup/SelectPopup.d.ts +11 -0
- package/esm/select/popup/SelectPopup.js +64 -35
- package/esm/select/popup/SelectPopupDataAttributes.js +2 -2
- package/esm/select/portal/SelectPortalContext.js +2 -0
- package/esm/select/positioner/SelectPositioner.d.ts +1 -1
- package/esm/select/positioner/SelectPositioner.js +14 -11
- package/esm/select/positioner/SelectPositionerContext.js +2 -0
- package/esm/select/positioner/SelectPositionerDataAttributes.js +2 -2
- package/esm/select/root/SelectRoot.d.ts +27 -22
- package/esm/select/root/SelectRoot.js +2 -0
- package/esm/select/root/SelectRootContext.d.ts +14 -14
- package/esm/select/root/SelectRootContext.js +2 -0
- package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/esm/select/scroll-arrow/SelectScrollArrow.js +2 -2
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/esm/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
- package/esm/select/store.d.ts +3 -3
- package/esm/select/store.js +3 -3
- package/esm/select/trigger/SelectTrigger.d.ts +1 -1
- package/esm/select/trigger/SelectTrigger.js +2 -2
- package/esm/select/value/SelectValue.d.ts +4 -0
- package/esm/select/value/SelectValue.js +2 -2
- package/esm/separator/Separator.d.ts +1 -1
- package/esm/separator/Separator.js +2 -2
- package/esm/slider/root/SliderRoot.d.ts +17 -17
- package/esm/slider/root/SliderRoot.js +3 -2
- package/esm/slider/root/SliderRootContext.d.ts +2 -2
- package/esm/slider/root/stateAttributesMapping.js +3 -1
- package/esm/slider/thumb/SliderThumb.d.ts +7 -7
- package/esm/slider/utils/getPushedThumbValues.d.ts +1 -1
- package/esm/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/esm/slider/value/SliderValue.d.ts +1 -1
- package/esm/switch/root/SwitchRoot.d.ts +11 -11
- package/esm/switch/root/SwitchRoot.js +7 -1
- package/esm/switch/root/SwitchRootContext.js +2 -0
- package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.js +2 -2
- package/esm/tabs/list/TabsList.d.ts +2 -2
- package/esm/tabs/list/TabsList.js +2 -2
- package/esm/tabs/panel/TabsPanel.d.ts +4 -2
- package/esm/tabs/panel/TabsPanel.js +35 -9
- package/esm/tabs/root/TabsRoot.d.ts +4 -4
- package/esm/tabs/root/TabsRootContext.d.ts +1 -1
- package/esm/tabs/tab/TabsTab.d.ts +1 -1
- package/esm/tabs/tab/TabsTab.js +2 -2
- package/esm/toast/action/ToastAction.js +2 -2
- package/esm/toast/arrow/ToastArrow.js +2 -2
- package/esm/toast/arrow/ToastArrowDataAttributes.js +4 -3
- package/esm/toast/close/ToastClose.js +6 -8
- package/esm/toast/content/ToastContent.js +2 -2
- package/esm/toast/createToastManager.d.ts +5 -5
- package/esm/toast/createToastManager.js +3 -6
- package/esm/toast/description/ToastDescription.js +4 -6
- package/esm/toast/positioner/ToastPositioner.d.ts +2 -2
- package/esm/toast/positioner/ToastPositioner.js +6 -7
- package/esm/toast/positioner/ToastPositionerDataAttributes.js +2 -2
- package/esm/toast/provider/ToastProvider.d.ts +3 -3
- package/esm/toast/provider/ToastProvider.js +26 -285
- package/esm/toast/provider/ToastProviderContext.d.ts +4 -25
- package/esm/toast/provider/ToastProviderContext.js +3 -1
- package/esm/toast/root/ToastRoot.d.ts +1 -1
- package/esm/toast/root/ToastRoot.js +19 -27
- package/esm/toast/root/ToastRootContext.js +2 -0
- package/esm/toast/store.d.ts +51 -0
- package/esm/toast/store.js +355 -0
- package/esm/toast/title/ToastTitle.js +4 -6
- package/esm/toast/useToastManager.d.ts +20 -21
- package/esm/toast/useToastManager.js +8 -14
- package/esm/toast/viewport/ToastViewport.js +66 -92
- package/esm/toggle/Toggle.d.ts +10 -8
- package/esm/toggle/Toggle.js +13 -3
- package/esm/toggle-group/ToggleGroup.d.ts +22 -10
- package/esm/toggle-group/ToggleGroup.js +8 -5
- package/esm/toggle-group/ToggleGroupContext.d.ts +10 -5
- package/esm/toolbar/button/ToolbarButton.d.ts +2 -2
- package/esm/toolbar/button/ToolbarButton.js +2 -2
- package/esm/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/esm/toolbar/group/ToolbarGroup.js +2 -2
- package/esm/toolbar/group/ToolbarGroupContext.js +2 -0
- package/esm/toolbar/input/ToolbarInput.d.ts +3 -3
- package/esm/toolbar/input/ToolbarInput.js +2 -2
- package/esm/toolbar/link/ToolbarLink.js +2 -2
- package/esm/toolbar/root/ToolbarRoot.d.ts +3 -3
- package/esm/toolbar/root/ToolbarRoot.js +2 -2
- package/esm/tooltip/arrow/TooltipArrow.d.ts +1 -0
- package/esm/tooltip/arrow/TooltipArrow.js +2 -2
- package/esm/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
- package/esm/tooltip/popup/TooltipPopup.js +2 -2
- package/esm/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
- package/esm/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/esm/tooltip/portal/TooltipPortalContext.js +2 -0
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
- package/esm/tooltip/provider/TooltipProvider.d.ts +3 -3
- package/esm/tooltip/provider/TooltipProviderContext.js +2 -0
- package/esm/tooltip/root/TooltipRoot.d.ts +12 -12
- package/esm/tooltip/root/TooltipRoot.js +23 -11
- package/esm/tooltip/store/TooltipStore.d.ts +256 -16
- package/esm/tooltip/trigger/TooltipTrigger.d.ts +11 -4
- package/esm/tooltip/trigger/TooltipTrigger.js +12 -6
- package/esm/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
- package/esm/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
- package/esm/tooltip/viewport/TooltipViewport.d.ts +9 -1
- package/esm/tooltip/viewport/TooltipViewport.js +14 -195
- package/esm/unstable-use-media-query/index.d.ts +5 -5
- package/esm/use-button/useButton.d.ts +4 -4
- package/esm/use-button/useButton.js +7 -2
- package/esm/use-render/useRender.d.ts +9 -9
- package/esm/utils/InternalBackdrop.d.ts +1 -1
- package/esm/utils/createBaseUIEventDetails.d.ts +3 -0
- package/esm/utils/formatNumber.d.ts +2 -1
- package/esm/utils/formatNumber.js +11 -0
- package/esm/utils/getDisabledMountTransitionStyles.d.ts +1 -1
- package/esm/utils/getPseudoElementBounds.js +1 -1
- package/esm/utils/itemEquality.d.ts +5 -5
- package/esm/utils/itemEquality.js +17 -17
- package/esm/utils/popupStateMapping.d.ts +10 -0
- package/esm/utils/popupStateMapping.js +10 -0
- package/esm/utils/popups/popupStoreUtils.js +2 -0
- package/esm/utils/popups/popupTriggerMap.d.ts +14 -1
- package/esm/utils/popups/popupTriggerMap.js +27 -9
- package/esm/utils/popups/store.d.ts +28 -18
- package/esm/utils/popups/store.js +8 -5
- package/esm/utils/reason-parts.d.ts +3 -0
- package/esm/utils/reason-parts.js +3 -0
- package/esm/utils/scrollable.d.ts +4 -0
- package/esm/utils/scrollable.js +32 -0
- package/esm/utils/types.d.ts +6 -6
- package/esm/utils/useAnchorPositioning.d.ts +26 -26
- package/esm/utils/useAnchorPositioning.js +19 -16
- package/esm/utils/useFocusableWhenDisabled.d.ts +4 -4
- package/esm/utils/useMixedToggleClickHandler.d.ts +1 -1
- package/esm/utils/useMixedToggleClickHandler.js +2 -0
- package/esm/utils/useOpenChangeComplete.d.ts +2 -2
- package/esm/utils/usePopupAutoResize.d.ts +3 -3
- package/esm/utils/usePopupAutoResize.js +3 -1
- package/esm/utils/usePopupViewport.d.ts +58 -0
- package/esm/utils/usePopupViewport.js +247 -0
- package/esm/utils/useRenderElement.d.ts +9 -9
- package/esm/utils/useRenderElement.js +28 -1
- package/esm/utils/useSwipeDismiss.d.ts +108 -0
- package/esm/utils/useSwipeDismiss.js +944 -0
- package/esm/utils/useValueChanged.js +2 -0
- package/field/control/FieldControl.d.ts +3 -3
- package/field/control/FieldControl.js +21 -20
- package/field/error/FieldError.d.ts +5 -2
- package/field/error/FieldError.js +51 -7
- package/field/item/FieldItem.d.ts +1 -1
- package/field/item/FieldItemContext.js +1 -0
- package/field/label/FieldLabel.d.ts +1 -1
- package/field/label/FieldLabel.js +7 -2
- package/field/root/FieldRoot.d.ts +9 -9
- package/field/root/FieldRootContext.d.ts +1 -1
- package/field/useField.d.ts +1 -1
- package/field/useField.js +1 -0
- package/field/validity/FieldValidity.d.ts +2 -0
- package/field/validity/FieldValidity.js +9 -3
- package/fieldset/legend/FieldsetLegend.js +2 -2
- package/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/fieldset/root/FieldsetRoot.js +3 -3
- package/floating-ui-react/components/FloatingDelayGroup.d.ts +2 -7
- package/floating-ui-react/components/FloatingDelayGroup.js +2 -9
- package/floating-ui-react/components/FloatingFocusManager.d.ts +11 -21
- package/floating-ui-react/components/FloatingFocusManager.js +61 -74
- package/floating-ui-react/components/FloatingPortal.d.ts +8 -9
- package/floating-ui-react/components/FloatingPortal.js +1 -3
- package/floating-ui-react/components/FloatingTree.d.ts +1 -1
- package/floating-ui-react/hooks/useClick.d.ts +12 -6
- package/floating-ui-react/hooks/useClick.js +6 -5
- package/floating-ui-react/hooks/useClientPoint.d.ts +2 -12
- package/floating-ui-react/hooks/useClientPoint.js +4 -16
- package/floating-ui-react/hooks/useDismiss.d.ts +15 -15
- package/floating-ui-react/hooks/useDismiss.js +4 -2
- package/floating-ui-react/hooks/useFloating.js +1 -0
- package/floating-ui-react/hooks/useFloatingRootContext.d.ts +4 -10
- package/floating-ui-react/hooks/useFloatingRootContext.js +4 -3
- package/floating-ui-react/hooks/useFocus.d.ts +2 -8
- package/floating-ui-react/hooks/useFocus.js +9 -11
- package/floating-ui-react/hooks/useHover.d.ts +7 -30
- package/floating-ui-react/hooks/useHover.js +18 -36
- package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +2 -7
- package/floating-ui-react/hooks/useHoverFloatingInteraction.js +33 -39
- package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +17 -14
- package/floating-ui-react/hooks/useHoverInteractionSharedState.js +36 -30
- package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +7 -3
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +55 -59
- package/floating-ui-react/hooks/useInteractions.d.ts +2 -2
- package/floating-ui-react/hooks/useListNavigation.d.ts +19 -35
- package/floating-ui-react/hooks/useListNavigation.js +11 -11
- package/floating-ui-react/hooks/useRole.d.ts +1 -7
- package/floating-ui-react/hooks/useRole.js +2 -3
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +2 -2
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +1 -0
- package/floating-ui-react/hooks/useTypeahead.d.ts +6 -16
- package/floating-ui-react/hooks/useTypeahead.js +46 -15
- package/floating-ui-react/middleware/arrow.d.ts +1 -1
- package/floating-ui-react/safePolygon.d.ts +3 -3
- package/floating-ui-react/types.d.ts +14 -14
- package/floating-ui-react/utils/composite.d.ts +5 -5
- package/floating-ui-react/utils/composite.js +1 -3
- package/floating-ui-react/utils/element.d.ts +2 -1
- package/floating-ui-react/utils/element.js +16 -4
- package/floating-ui-react/utils/enqueueFocus.d.ts +3 -3
- package/floating-ui-react/utils/event.js +2 -4
- package/floating-ui-react/utils/markOthers.js +2 -2
- package/floating-ui-react/utils/tabbable.js +5 -4
- package/form/Form.d.ts +5 -5
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/input/Input.d.ts +3 -3
- package/labelable-provider/LabelableContext.d.ts +1 -1
- package/labelable-provider/LabelableContext.js +1 -1
- package/labelable-provider/LabelableProvider.js +33 -3
- package/labelable-provider/useLabelableId.d.ts +3 -2
- package/labelable-provider/useLabelableId.js +39 -12
- package/menu/arrow/MenuArrow.js +2 -2
- package/menu/arrow/MenuArrowDataAttributes.js +2 -2
- package/menu/backdrop/MenuBackdrop.js +2 -2
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +8 -8
- package/menu/checkbox-item/MenuCheckboxItemContext.js +1 -0
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +2 -2
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +3 -3
- package/menu/group/MenuGroupContext.js +1 -0
- package/menu/index.d.ts +2 -1
- package/menu/index.parts.d.ts +1 -0
- package/menu/index.parts.js +7 -0
- package/menu/item/MenuItem.d.ts +5 -5
- package/menu/item/MenuItem.js +2 -2
- package/menu/item/useMenuItem.js +12 -48
- package/menu/item/useMenuItemCommonProps.d.ts +43 -0
- package/menu/item/useMenuItemCommonProps.js +72 -0
- package/menu/link-item/MenuLinkItem.d.ts +34 -0
- package/menu/link-item/MenuLinkItem.js +60 -0
- package/menu/link-item/MenuLinkItemDataAttributes.d.ts +6 -0
- package/menu/link-item/MenuLinkItemDataAttributes.js +13 -0
- package/menu/popup/MenuPopup.d.ts +3 -2
- package/menu/popup/MenuPopup.js +2 -2
- package/menu/popup/MenuPopupDataAttributes.js +2 -2
- package/menu/portal/MenuPortal.d.ts +1 -1
- package/menu/portal/MenuPortalContext.js +1 -0
- package/menu/positioner/MenuPositioner.js +6 -12
- package/menu/positioner/MenuPositionerDataAttributes.js +2 -2
- package/menu/radio-group/MenuRadioGroup.d.ts +2 -2
- package/menu/radio-group/MenuRadioGroup.js +2 -2
- package/menu/radio-group/MenuRadioGroupContext.js +1 -0
- package/menu/radio-item/MenuRadioItem.d.ts +5 -5
- package/menu/radio-item/MenuRadioItemContext.js +1 -0
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +2 -2
- package/menu/radio-item-indicator/MenuRadioItemIndicator.js +3 -3
- package/menu/root/MenuRoot.d.ts +15 -15
- package/menu/root/MenuRoot.js +39 -37
- package/menu/store/MenuStore.d.ts +255 -15
- package/menu/store/MenuStore.js +2 -11
- package/menu/submenu-root/MenuSubmenuRoot.d.ts +2 -2
- package/menu/submenu-root/MenuSubmenuRootContext.js +1 -0
- package/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +22 -22
- package/menu/submenu-trigger/MenuSubmenuTrigger.js +10 -8
- package/menu/trigger/MenuTrigger.d.ts +10 -6
- package/menu/trigger/MenuTrigger.js +5 -4
- package/menubar/Menubar.d.ts +4 -4
- package/menubar/Menubar.js +2 -2
- package/meter/root/MeterRoot.d.ts +6 -6
- package/meter/root/MeterRoot.js +1 -10
- package/meter/value/MeterValue.d.ts +1 -1
- package/navigation-menu/arrow/NavigationMenuArrow.js +2 -2
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +2 -2
- package/navigation-menu/backdrop/NavigationMenuBackdrop.js +2 -2
- package/navigation-menu/content/NavigationMenuContent.d.ts +8 -1
- package/navigation-menu/content/NavigationMenuContent.js +26 -5
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/navigation-menu/icon/NavigationMenuIcon.js +2 -2
- package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/navigation-menu/item/NavigationMenuItemContext.js +1 -0
- package/navigation-menu/link/NavigationMenuLink.d.ts +2 -2
- package/navigation-menu/link/NavigationMenuLink.js +2 -2
- package/navigation-menu/list/NavigationMenuDismissContext.js +1 -0
- package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.js +2 -2
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +13 -0
- package/navigation-menu/popup/NavigationMenuPopup.js +2 -2
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +2 -2
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +2 -2
- package/navigation-menu/portal/NavigationMenuPortalContext.js +1 -0
- package/navigation-menu/positioner/NavigationMenuPositioner.js +2 -2
- package/navigation-menu/positioner/NavigationPositionerDataAttributes.js +2 -2
- package/navigation-menu/root/NavigationMenuRoot.d.ts +6 -6
- package/navigation-menu/root/NavigationMenuRoot.js +2 -2
- package/navigation-menu/root/NavigationMenuRootContext.js +1 -0
- package/navigation-menu/trigger/NavigationMenuTrigger.js +7 -124
- package/navigation-menu/utils/isOutsideMenuEvent.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.js +21 -1
- package/number-field/input/NumberFieldInput.js +3 -11
- package/number-field/root/NumberFieldRoot.d.ts +27 -20
- package/number-field/root/NumberFieldRoot.js +22 -7
- package/number-field/root/NumberFieldRootContext.d.ts +2 -2
- package/number-field/root/useNumberFieldButton.d.ts +3 -3
- package/number-field/root/useNumberFieldButton.js +12 -7
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +2 -2
- package/number-field/scrub-area/NumberFieldScrubArea.js +16 -0
- package/number-field/scrub-area/NumberFieldScrubAreaContext.js +1 -0
- package/number-field/utils/stateAttributesMapping.js +3 -1
- package/number-field/utils/subscribeToVisualViewportResize.d.ts +1 -1
- package/number-field/utils/types.d.ts +5 -5
- package/number-field/utils/validate.d.ts +3 -1
- package/number-field/utils/validate.js +3 -2
- package/package.json +13 -4
- package/popover/arrow/PopoverArrow.js +2 -2
- package/popover/arrow/PopoverArrowDataAttributes.js +2 -2
- package/popover/backdrop/PopoverBackdrop.js +2 -2
- package/popover/popup/PopoverPopup.d.ts +3 -2
- package/popover/popup/PopoverPopup.js +2 -2
- package/popover/portal/PopoverPortal.d.ts +1 -1
- package/popover/portal/PopoverPortal.js +1 -2
- package/popover/portal/PopoverPortalContext.js +1 -0
- package/popover/positioner/PopoverPositioner.js +3 -3
- package/popover/positioner/PopoverPositionerDataAttributes.js +2 -2
- package/popover/root/PopoverRoot.d.ts +9 -9
- package/popover/root/PopoverRoot.js +18 -5
- package/popover/store/PopoverStore.d.ts +255 -15
- package/popover/trigger/PopoverTrigger.d.ts +7 -7
- package/popover/trigger/PopoverTrigger.js +3 -3
- package/popover/viewport/PopoverViewport.d.ts +9 -1
- package/popover/viewport/PopoverViewport.js +19 -196
- package/popover/viewport/PopoverViewportDataAttributes.d.ts +5 -0
- package/popover/viewport/PopoverViewportDataAttributes.js +5 -0
- package/preview-card/arrow/PreviewCardArrow.js +2 -2
- package/preview-card/arrow/PreviewCardArrowDataAttributes.js +2 -2
- package/preview-card/backdrop/PreviewCardBackdrop.js +2 -2
- package/preview-card/popup/PreviewCardPopup.js +2 -2
- package/preview-card/popup/PreviewCardPopupDataAttributes.js +2 -2
- package/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/preview-card/portal/PreviewCardPortalContext.js +1 -0
- package/preview-card/positioner/PreviewCardPositioner.js +2 -2
- package/preview-card/positioner/PreviewCardPositionerContext.d.ts +1 -1
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.js +2 -2
- package/preview-card/root/PreviewCardRoot.d.ts +8 -8
- package/preview-card/root/PreviewCardRoot.js +17 -4
- package/preview-card/store/PreviewCardStore.d.ts +255 -15
- package/preview-card/trigger/PreviewCardTrigger.d.ts +4 -4
- package/preview-card/trigger/PreviewCardTrigger.js +3 -3
- package/preview-card/viewport/PreviewCardViewport.d.ts +6 -1
- package/preview-card/viewport/PreviewCardViewport.js +14 -230
- package/progress/root/ProgressRoot.d.ts +6 -6
- package/progress/root/ProgressRoot.js +1 -12
- package/progress/value/ProgressValue.d.ts +1 -1
- package/radio/indicator/RadioIndicator.d.ts +1 -1
- package/radio/indicator/RadioIndicator.js +4 -4
- package/radio/root/RadioRoot.d.ts +37 -17
- package/radio/root/RadioRoot.js +45 -11
- package/radio-group/RadioGroup.d.ts +18 -12
- package/radio-group/RadioGroup.js +68 -61
- package/radio-group/RadioGroupContext.d.ts +9 -8
- package/radio-group/RadioGroupContext.js +1 -13
- package/scroll-area/root/ScrollAreaRoot.d.ts +4 -2
- package/scroll-area/root/ScrollAreaRoot.js +2 -1
- package/scroll-area/root/ScrollAreaRootContext.js +1 -0
- package/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +4 -0
- package/scroll-area/root/ScrollAreaRootDataAttributes.js +4 -0
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +2 -2
- package/scroll-area/scrollbar/ScrollAreaScrollbarContext.js +1 -0
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +1 -1
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +1 -1
- package/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/scroll-area/thumb/ScrollAreaThumb.js +2 -2
- package/scroll-area/utils/scrollEdges.d.ts +2 -0
- package/scroll-area/utils/scrollEdges.js +29 -0
- package/scroll-area/viewport/ScrollAreaViewport.js +18 -15
- package/scroll-area/viewport/ScrollAreaViewportContext.js +1 -0
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +4 -0
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +4 -0
- package/select/arrow/SelectArrow.js +2 -2
- package/select/arrow/SelectArrowDataAttributes.js +2 -2
- package/select/backdrop/SelectBackdrop.js +2 -2
- package/select/group/SelectGroupContext.js +1 -0
- package/select/icon/SelectIcon.js +2 -2
- package/select/item/SelectItem.d.ts +2 -2
- package/select/item/SelectItem.js +13 -13
- package/select/item/SelectItemContext.js +1 -0
- package/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/select/item-indicator/SelectItemIndicator.js +2 -2
- package/select/popup/SelectPopup.d.ts +11 -0
- package/select/popup/SelectPopup.js +64 -35
- package/select/popup/SelectPopupDataAttributes.js +2 -2
- package/select/portal/SelectPortalContext.js +1 -0
- package/select/positioner/SelectPositioner.d.ts +1 -1
- package/select/positioner/SelectPositioner.js +13 -10
- package/select/positioner/SelectPositionerContext.js +1 -0
- package/select/positioner/SelectPositionerDataAttributes.js +2 -2
- package/select/root/SelectRoot.d.ts +27 -22
- package/select/root/SelectRoot.js +2 -0
- package/select/root/SelectRootContext.d.ts +14 -14
- package/select/root/SelectRootContext.js +1 -0
- package/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/select/scroll-arrow/SelectScrollArrow.js +2 -2
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +1 -1
- package/select/store.d.ts +3 -3
- package/select/store.js +3 -3
- package/select/trigger/SelectTrigger.d.ts +1 -1
- package/select/trigger/SelectTrigger.js +2 -2
- package/select/value/SelectValue.d.ts +4 -0
- package/select/value/SelectValue.js +2 -2
- package/separator/Separator.d.ts +1 -1
- package/separator/Separator.js +2 -2
- package/slider/root/SliderRoot.d.ts +17 -17
- package/slider/root/SliderRoot.js +3 -2
- package/slider/root/SliderRootContext.d.ts +2 -2
- package/slider/root/stateAttributesMapping.js +3 -1
- package/slider/thumb/SliderThumb.d.ts +7 -7
- package/slider/utils/getPushedThumbValues.d.ts +1 -1
- package/slider/utils/resolveThumbCollision.d.ts +2 -2
- package/slider/value/SliderValue.d.ts +1 -1
- package/switch/root/SwitchRoot.d.ts +11 -11
- package/switch/root/SwitchRoot.js +7 -1
- package/switch/root/SwitchRootContext.js +1 -0
- package/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.js +2 -2
- package/tabs/list/TabsList.d.ts +2 -2
- package/tabs/list/TabsList.js +2 -2
- package/tabs/panel/TabsPanel.d.ts +4 -2
- package/tabs/panel/TabsPanel.js +37 -10
- package/tabs/root/TabsRoot.d.ts +4 -4
- package/tabs/root/TabsRootContext.d.ts +1 -1
- package/tabs/tab/TabsTab.d.ts +1 -1
- package/tabs/tab/TabsTab.js +2 -2
- package/toast/action/ToastAction.js +2 -2
- package/toast/arrow/ToastArrow.js +2 -2
- package/toast/arrow/ToastArrowDataAttributes.js +4 -3
- package/toast/close/ToastClose.js +5 -7
- package/toast/content/ToastContent.js +2 -2
- package/toast/createToastManager.d.ts +5 -5
- package/toast/createToastManager.js +3 -6
- package/toast/description/ToastDescription.js +4 -6
- package/toast/positioner/ToastPositioner.d.ts +2 -2
- package/toast/positioner/ToastPositioner.js +5 -6
- package/toast/positioner/ToastPositionerDataAttributes.js +2 -2
- package/toast/provider/ToastProvider.d.ts +3 -3
- package/toast/provider/ToastProvider.js +24 -284
- package/toast/provider/ToastProviderContext.d.ts +4 -25
- package/toast/provider/ToastProviderContext.js +3 -2
- package/toast/root/ToastRoot.d.ts +1 -1
- package/toast/root/ToastRoot.js +18 -26
- package/toast/root/ToastRootContext.js +1 -0
- package/toast/store.d.ts +51 -0
- package/toast/store.js +362 -0
- package/toast/title/ToastTitle.js +4 -6
- package/toast/useToastManager.d.ts +20 -21
- package/toast/useToastManager.js +8 -14
- package/toast/viewport/ToastViewport.js +65 -91
- package/toggle/Toggle.d.ts +10 -8
- package/toggle/Toggle.js +13 -3
- package/toggle-group/ToggleGroup.d.ts +22 -10
- package/toggle-group/ToggleGroup.js +8 -5
- package/toggle-group/ToggleGroupContext.d.ts +10 -5
- package/toolbar/button/ToolbarButton.d.ts +2 -2
- package/toolbar/button/ToolbarButton.js +2 -2
- package/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/toolbar/group/ToolbarGroup.js +2 -2
- package/toolbar/group/ToolbarGroupContext.js +1 -0
- package/toolbar/input/ToolbarInput.d.ts +3 -3
- package/toolbar/input/ToolbarInput.js +2 -2
- package/toolbar/link/ToolbarLink.js +2 -2
- package/toolbar/root/ToolbarRoot.d.ts +3 -3
- package/toolbar/root/ToolbarRoot.js +2 -2
- package/tooltip/arrow/TooltipArrow.d.ts +1 -0
- package/tooltip/arrow/TooltipArrow.js +2 -2
- package/tooltip/arrow/TooltipArrowDataAttributes.js +2 -2
- package/tooltip/popup/TooltipPopup.js +2 -2
- package/tooltip/popup/TooltipPopupDataAttributes.js +2 -2
- package/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/tooltip/portal/TooltipPortalContext.js +1 -0
- package/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/tooltip/positioner/TooltipPositionerContext.d.ts +1 -1
- package/tooltip/positioner/TooltipPositionerDataAttributes.js +2 -2
- package/tooltip/provider/TooltipProvider.d.ts +3 -3
- package/tooltip/provider/TooltipProviderContext.js +1 -0
- package/tooltip/root/TooltipRoot.d.ts +12 -12
- package/tooltip/root/TooltipRoot.js +23 -11
- package/tooltip/store/TooltipStore.d.ts +256 -16
- package/tooltip/trigger/TooltipTrigger.d.ts +11 -4
- package/tooltip/trigger/TooltipTrigger.js +12 -6
- package/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +4 -0
- package/tooltip/trigger/TooltipTriggerDataAttributes.js +4 -0
- package/tooltip/viewport/TooltipViewport.d.ts +9 -1
- package/tooltip/viewport/TooltipViewport.js +14 -195
- package/unstable-use-media-query/index.d.ts +5 -5
- package/use-button/useButton.d.ts +4 -4
- package/use-button/useButton.js +7 -2
- package/use-render/useRender.d.ts +9 -9
- package/utils/InternalBackdrop.d.ts +1 -1
- package/utils/createBaseUIEventDetails.d.ts +3 -0
- package/utils/formatNumber.d.ts +2 -1
- package/utils/formatNumber.js +12 -0
- package/utils/getDisabledMountTransitionStyles.d.ts +1 -1
- package/utils/getPseudoElementBounds.js +1 -1
- package/utils/itemEquality.d.ts +5 -5
- package/utils/itemEquality.js +18 -18
- package/utils/popupStateMapping.d.ts +10 -0
- package/utils/popupStateMapping.js +10 -0
- package/utils/popups/popupStoreUtils.js +1 -0
- package/utils/popups/popupTriggerMap.d.ts +14 -1
- package/utils/popups/popupTriggerMap.js +27 -10
- package/utils/popups/store.d.ts +28 -18
- package/utils/popups/store.js +8 -5
- package/utils/reason-parts.d.ts +3 -0
- package/utils/reason-parts.js +4 -1
- package/utils/scrollable.d.ts +4 -0
- package/utils/scrollable.js +40 -0
- package/utils/types.d.ts +6 -6
- package/utils/useAnchorPositioning.d.ts +26 -26
- package/utils/useAnchorPositioning.js +19 -16
- package/utils/useFocusableWhenDisabled.d.ts +4 -4
- package/utils/useMixedToggleClickHandler.d.ts +1 -1
- package/utils/useMixedToggleClickHandler.js +1 -0
- package/utils/useOpenChangeComplete.d.ts +2 -2
- package/utils/usePopupAutoResize.d.ts +3 -3
- package/utils/usePopupAutoResize.js +2 -1
- package/utils/usePopupViewport.d.ts +58 -0
- package/utils/usePopupViewport.js +253 -0
- package/utils/useRenderElement.d.ts +9 -9
- package/utils/useRenderElement.js +28 -1
- package/utils/useSwipeDismiss.d.ts +108 -0
- package/utils/useSwipeDismiss.js +952 -0
- package/utils/useValueChanged.js +1 -0
- package/esm/toast/viewport/ToastViewportContext.d.ts +0 -6
- package/esm/toast/viewport/ToastViewportContext.js +0 -11
- package/toast/viewport/ToastViewportContext.d.ts +0 -6
- package/toast/viewport/ToastViewportContext.js +0 -20
|
@@ -23,11 +23,11 @@ export interface NavigationMenuRootProps extends BaseUIComponentProps<'nav', Nav
|
|
|
23
23
|
/**
|
|
24
24
|
* A ref to imperative actions.
|
|
25
25
|
*/
|
|
26
|
-
actionsRef?: React.RefObject<NavigationMenuRoot.Actions | null
|
|
26
|
+
actionsRef?: React.RefObject<NavigationMenuRoot.Actions | null> | undefined;
|
|
27
27
|
/**
|
|
28
28
|
* Event handler called after any animations complete when the navigation menu is closed.
|
|
29
29
|
*/
|
|
30
|
-
onOpenChangeComplete?: (open: boolean) => void;
|
|
30
|
+
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* The controlled value of the navigation menu item that should be currently open.
|
|
33
33
|
* When non-nullish, the menu will be open. When nullish, the menu will be closed.
|
|
@@ -46,22 +46,22 @@ export interface NavigationMenuRootProps extends BaseUIComponentProps<'nav', Nav
|
|
|
46
46
|
/**
|
|
47
47
|
* Callback fired when the value changes.
|
|
48
48
|
*/
|
|
49
|
-
onValueChange?: (value: any, eventDetails: NavigationMenuRoot.ChangeEventDetails) => void;
|
|
49
|
+
onValueChange?: ((value: any, eventDetails: NavigationMenuRoot.ChangeEventDetails) => void) | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* How long to wait before opening the navigation menu. Specified in milliseconds.
|
|
52
52
|
* @default 50
|
|
53
53
|
*/
|
|
54
|
-
delay?: number;
|
|
54
|
+
delay?: number | undefined;
|
|
55
55
|
/**
|
|
56
56
|
* How long to wait before closing the navigation menu. Specified in milliseconds.
|
|
57
57
|
* @default 50
|
|
58
58
|
*/
|
|
59
|
-
closeDelay?: number;
|
|
59
|
+
closeDelay?: number | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* The orientation of the navigation menu.
|
|
62
62
|
* @default 'horizontal'
|
|
63
63
|
*/
|
|
64
|
-
orientation?: 'horizontal' | 'vertical';
|
|
64
|
+
orientation?: ('horizontal' | 'vertical') | undefined;
|
|
65
65
|
}
|
|
66
66
|
export interface NavigationMenuRootActions {
|
|
67
67
|
unmount: () => void;
|
|
@@ -196,10 +196,10 @@ function TreeContext(props) {
|
|
|
196
196
|
const {
|
|
197
197
|
open
|
|
198
198
|
} = useNavigationMenuRootContext();
|
|
199
|
-
const state =
|
|
199
|
+
const state = {
|
|
200
200
|
open,
|
|
201
201
|
nested
|
|
202
|
-
}
|
|
202
|
+
};
|
|
203
203
|
const element = useRenderElement(nested ? 'div' : 'nav', props.componentProps, {
|
|
204
204
|
state,
|
|
205
205
|
ref: [props.forwardedRef, rootRef],
|
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
5
|
import { isTabbable } from 'tabbable';
|
|
6
|
-
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
7
6
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
8
7
|
import { useTimeout } from '@base-ui/utils/useTimeout';
|
|
9
8
|
import { useAnimationFrame } from '@base-ui/utils/useAnimationFrame';
|
|
10
|
-
import { useValueAsRef } from '@base-ui/utils/useValueAsRef';
|
|
11
9
|
import { safePolygon, useClick, useFloatingRootContext, useFloatingTree, useHover, useInteractions } from "../../floating-ui-react/index.js";
|
|
12
10
|
import { contains, getNextTabbable, getPreviousTabbable, isOutsideEvent, stopEvent } from "../../floating-ui-react/utils.js";
|
|
13
11
|
import { useNavigationMenuItemContext } from "../item/NavigationMenuItemContext.js";
|
|
@@ -18,19 +16,10 @@ import { EMPTY_ARRAY, ownerVisuallyHidden, PATIENT_CLICK_THRESHOLD } from "../..
|
|
|
18
16
|
import { FocusGuard } from "../../utils/FocusGuard.js";
|
|
19
17
|
import { pressableTriggerOpenStateMapping } from "../../utils/popupStateMapping.js";
|
|
20
18
|
import { isOutsideMenuEvent } from "../utils/isOutsideMenuEvent.js";
|
|
21
|
-
import { useAnimationsFinished } from "../../utils/useAnimationsFinished.js";
|
|
22
|
-
import { NavigationMenuPopupCssVars } from "../popup/NavigationMenuPopupCssVars.js";
|
|
23
|
-
import { NavigationMenuPositionerCssVars } from "../positioner/NavigationMenuPositionerCssVars.js";
|
|
24
19
|
import { CompositeItem } from "../../composite/item/CompositeItem.js";
|
|
25
20
|
import { useButton } from "../../use-button/index.js";
|
|
26
|
-
import { getCssDimensions } from "../../utils/getCssDimensions.js";
|
|
27
21
|
import { NAVIGATION_MENU_TRIGGER_IDENTIFIER } from "../utils/constants.js";
|
|
28
22
|
import { useNavigationMenuDismissContext } from "../list/NavigationMenuDismissContext.js";
|
|
29
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
-
const DEFAULT_SIZE = {
|
|
31
|
-
width: 0,
|
|
32
|
-
height: 0
|
|
33
|
-
};
|
|
34
23
|
|
|
35
24
|
/**
|
|
36
25
|
* Opens the navigation menu popup when hovered or clicked, revealing the
|
|
@@ -39,6 +28,7 @@ const DEFAULT_SIZE = {
|
|
|
39
28
|
*
|
|
40
29
|
* Documentation: [Base UI Navigation Menu](https://base-ui.com/react/components/navigation-menu)
|
|
41
30
|
*/
|
|
31
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
32
|
export const NavigationMenuTrigger = /*#__PURE__*/React.forwardRef(function NavigationMenuTrigger(componentProps, forwardedRef) {
|
|
43
33
|
const {
|
|
44
34
|
className,
|
|
@@ -77,104 +67,17 @@ export const NavigationMenuTrigger = /*#__PURE__*/React.forwardRef(function Navi
|
|
|
77
67
|
const dismissProps = useNavigationMenuDismissContext();
|
|
78
68
|
const stickIfOpenTimeout = useTimeout();
|
|
79
69
|
const focusFrame = useAnimationFrame();
|
|
80
|
-
const sizeFrame1 = useAnimationFrame();
|
|
81
|
-
const sizeFrame2 = useAnimationFrame();
|
|
82
70
|
const [triggerElement, setTriggerElement] = React.useState(null);
|
|
83
71
|
const [stickIfOpen, setStickIfOpen] = React.useState(true);
|
|
84
72
|
const [pointerType, setPointerType] = React.useState('');
|
|
85
73
|
const allowFocusRef = React.useRef(false);
|
|
86
|
-
const prevSizeRef = React.useRef(DEFAULT_SIZE);
|
|
87
|
-
const animationAbortControllerRef = React.useRef(null);
|
|
88
74
|
const isActiveItem = open && value === itemValue;
|
|
89
|
-
const isActiveItemRef = useValueAsRef(isActiveItem);
|
|
90
75
|
const interactionsEnabled = positionerElement ? true : !value;
|
|
91
|
-
const runOnceAnimationsFinish = useAnimationsFinished(popupElement);
|
|
92
|
-
React.useEffect(() => {
|
|
93
|
-
animationAbortControllerRef.current?.abort();
|
|
94
|
-
}, [isActiveItem]);
|
|
95
|
-
function setAutoSizes() {
|
|
96
|
-
if (!popupElement) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, 'auto');
|
|
100
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, 'auto');
|
|
101
|
-
}
|
|
102
|
-
const handleValueChange = useStableCallback((currentWidth, currentHeight) => {
|
|
103
|
-
if (!popupElement || !positionerElement) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
popupElement.style.removeProperty(NavigationMenuPopupCssVars.popupWidth);
|
|
107
|
-
popupElement.style.removeProperty(NavigationMenuPopupCssVars.popupHeight);
|
|
108
|
-
positionerElement.style.removeProperty(NavigationMenuPositionerCssVars.positionerWidth);
|
|
109
|
-
positionerElement.style.removeProperty(NavigationMenuPositionerCssVars.positionerHeight);
|
|
110
|
-
const {
|
|
111
|
-
width,
|
|
112
|
-
height
|
|
113
|
-
} = getCssDimensions(popupElement);
|
|
114
|
-
const measuredWidth = width || prevSizeRef.current.width;
|
|
115
|
-
const measuredHeight = height || prevSizeRef.current.height;
|
|
116
|
-
if (currentHeight === 0 || currentWidth === 0) {
|
|
117
|
-
currentWidth = measuredWidth;
|
|
118
|
-
currentHeight = measuredHeight;
|
|
119
|
-
}
|
|
120
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, `${currentWidth}px`);
|
|
121
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, `${currentHeight}px`);
|
|
122
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerWidth, `${measuredWidth}px`);
|
|
123
|
-
positionerElement.style.setProperty(NavigationMenuPositionerCssVars.positionerHeight, `${measuredHeight}px`);
|
|
124
|
-
sizeFrame1.request(() => {
|
|
125
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupWidth, `${measuredWidth}px`);
|
|
126
|
-
popupElement.style.setProperty(NavigationMenuPopupCssVars.popupHeight, `${measuredHeight}px`);
|
|
127
|
-
sizeFrame2.request(() => {
|
|
128
|
-
animationAbortControllerRef.current = new AbortController();
|
|
129
|
-
runOnceAnimationsFinish(setAutoSizes, animationAbortControllerRef.current.signal);
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
76
|
React.useEffect(() => {
|
|
134
77
|
if (!open) {
|
|
135
78
|
stickIfOpenTimeout.clear();
|
|
136
|
-
sizeFrame1.cancel();
|
|
137
|
-
sizeFrame2.cancel();
|
|
138
79
|
}
|
|
139
|
-
}, [stickIfOpenTimeout, open
|
|
140
|
-
React.useEffect(() => {
|
|
141
|
-
if (!mounted) {
|
|
142
|
-
prevSizeRef.current = DEFAULT_SIZE;
|
|
143
|
-
}
|
|
144
|
-
}, [mounted]);
|
|
145
|
-
React.useEffect(() => {
|
|
146
|
-
if (!popupElement || typeof ResizeObserver !== 'function') {
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
150
|
-
// Using `getCssDimensions` here causes issues due to fractional values.
|
|
151
|
-
prevSizeRef.current = {
|
|
152
|
-
width: popupElement.offsetWidth,
|
|
153
|
-
height: popupElement.offsetHeight
|
|
154
|
-
};
|
|
155
|
-
});
|
|
156
|
-
resizeObserver.observe(popupElement);
|
|
157
|
-
return () => {
|
|
158
|
-
resizeObserver.disconnect();
|
|
159
|
-
};
|
|
160
|
-
}, [popupElement]);
|
|
161
|
-
React.useEffect(() => {
|
|
162
|
-
if (!popupElement || !isActiveItem || typeof MutationObserver !== 'function') {
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
const mutationObserver = new MutationObserver(() => {
|
|
166
|
-
animationAbortControllerRef.current?.abort();
|
|
167
|
-
handleValueChange(prevSizeRef.current.width, prevSizeRef.current.height);
|
|
168
|
-
});
|
|
169
|
-
mutationObserver.observe(popupElement, {
|
|
170
|
-
childList: true,
|
|
171
|
-
subtree: true,
|
|
172
|
-
characterData: true
|
|
173
|
-
});
|
|
174
|
-
return () => {
|
|
175
|
-
mutationObserver.disconnect();
|
|
176
|
-
};
|
|
177
|
-
}, [popupElement, positionerElement, isActiveItem, handleValueChange]);
|
|
80
|
+
}, [stickIfOpenTimeout, open]);
|
|
178
81
|
React.useEffect(() => {
|
|
179
82
|
if (isActiveItem && open && popupElement && allowFocusRef.current) {
|
|
180
83
|
allowFocusRef.current = false;
|
|
@@ -185,12 +88,7 @@ export const NavigationMenuTrigger = /*#__PURE__*/React.forwardRef(function Navi
|
|
|
185
88
|
return () => {
|
|
186
89
|
focusFrame.cancel();
|
|
187
90
|
};
|
|
188
|
-
}, [beforeOutsideRef, focusFrame,
|
|
189
|
-
useIsoLayoutEffect(() => {
|
|
190
|
-
if (isActiveItemRef.current && open && popupElement) {
|
|
191
|
-
handleValueChange(0, 0);
|
|
192
|
-
}
|
|
193
|
-
}, [isActiveItemRef, open, popupElement, handleValueChange]);
|
|
91
|
+
}, [beforeOutsideRef, focusFrame, isActiveItem, open, popupElement]);
|
|
194
92
|
function handleOpenChange(nextOpen, eventDetails) {
|
|
195
93
|
const isHover = eventDetails.reason === REASONS.triggerHover;
|
|
196
94
|
if (!interactionsEnabled) {
|
|
@@ -285,30 +183,16 @@ export const NavigationMenuTrigger = /*#__PURE__*/React.forwardRef(function Navi
|
|
|
285
183
|
}
|
|
286
184
|
});
|
|
287
185
|
}
|
|
288
|
-
const
|
|
289
|
-
// For nested scenarios without positioner/popup, we can still open the menu
|
|
290
|
-
// but we can't do size calculations
|
|
291
|
-
if (!popupElement || !positionerElement) {
|
|
292
|
-
handleActivation(event);
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
const {
|
|
296
|
-
width,
|
|
297
|
-
height
|
|
298
|
-
} = getCssDimensions(popupElement);
|
|
299
|
-
handleActivation(event);
|
|
300
|
-
handleValueChange(width, height);
|
|
301
|
-
});
|
|
302
|
-
const state = React.useMemo(() => ({
|
|
186
|
+
const state = {
|
|
303
187
|
open: isActiveItem
|
|
304
|
-
}
|
|
188
|
+
};
|
|
305
189
|
function handleSetPointerType(event) {
|
|
306
190
|
setPointerType(event.pointerType);
|
|
307
191
|
}
|
|
308
192
|
const defaultProps = {
|
|
309
193
|
tabIndex: 0,
|
|
310
|
-
onMouseEnter:
|
|
311
|
-
onClick:
|
|
194
|
+
onMouseEnter: handleActivation,
|
|
195
|
+
onClick: handleActivation,
|
|
312
196
|
onPointerEnter: handleSetPointerType,
|
|
313
197
|
onPointerDown: handleSetPointerType,
|
|
314
198
|
'aria-expanded': isActiveItem,
|
|
@@ -336,7 +220,7 @@ export const NavigationMenuTrigger = /*#__PURE__*/React.forwardRef(function Navi
|
|
|
336
220
|
const openVertical = orientation === 'vertical' && event.key === 'ArrowRight';
|
|
337
221
|
if (openHorizontal || openVertical) {
|
|
338
222
|
setValue(itemValue, createChangeEventDetails(REASONS.listNavigation, event.nativeEvent));
|
|
339
|
-
|
|
223
|
+
handleActivation(event);
|
|
340
224
|
stopEvent(event);
|
|
341
225
|
}
|
|
342
226
|
},
|
|
@@ -5,7 +5,7 @@ interface Targets {
|
|
|
5
5
|
}
|
|
6
6
|
interface Params {
|
|
7
7
|
popupElement: HTMLElement | null;
|
|
8
|
-
viewportElement?: HTMLElement | null;
|
|
8
|
+
viewportElement?: (HTMLElement | null) | undefined;
|
|
9
9
|
rootRef: React.RefObject<HTMLDivElement | null>;
|
|
10
10
|
tree: FloatingTreeType | null;
|
|
11
11
|
nodeId: string | undefined;
|
|
@@ -4,12 +4,15 @@ import * as React from 'react';
|
|
|
4
4
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
5
5
|
import { useId } from '@base-ui/utils/useId';
|
|
6
6
|
import { inertValue } from '@base-ui/utils/inertValue';
|
|
7
|
+
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
7
8
|
import { useRenderElement } from "../../utils/useRenderElement.js";
|
|
8
9
|
import { useNavigationMenuRootContext } from "../root/NavigationMenuRootContext.js";
|
|
9
10
|
import { FocusGuard } from "../../utils/FocusGuard.js";
|
|
11
|
+
import { usePopupAutoResize } from "../../utils/usePopupAutoResize.js";
|
|
10
12
|
import { getNextTabbable, getPreviousTabbable, isOutsideEvent, contains } from "../../floating-ui-react/utils.js";
|
|
11
13
|
import { getEmptyRootContext } from "../../floating-ui-react/utils/getEmptyRootContext.js";
|
|
12
14
|
import { useNavigationMenuPositionerContext } from "../positioner/NavigationMenuPositionerContext.js";
|
|
15
|
+
import { useDirection } from "../../direction-provider/DirectionContext.js";
|
|
13
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
17
|
const EMPTY_ROOT_CONTEXT = getEmptyRootContext();
|
|
15
18
|
function Guards({
|
|
@@ -69,6 +72,11 @@ export const NavigationMenuViewport = /*#__PURE__*/React.forwardRef(function Nav
|
|
|
69
72
|
} = componentProps;
|
|
70
73
|
const id = useId(idProp);
|
|
71
74
|
const {
|
|
75
|
+
open,
|
|
76
|
+
mounted,
|
|
77
|
+
value,
|
|
78
|
+
popupElement,
|
|
79
|
+
positionerElement,
|
|
72
80
|
setViewportElement,
|
|
73
81
|
setViewportTargetElement,
|
|
74
82
|
floatingRootContext,
|
|
@@ -76,7 +84,19 @@ export const NavigationMenuViewport = /*#__PURE__*/React.forwardRef(function Nav
|
|
|
76
84
|
viewportInert,
|
|
77
85
|
setViewportInert
|
|
78
86
|
} = useNavigationMenuRootContext();
|
|
79
|
-
const
|
|
87
|
+
const positioning = useNavigationMenuPositionerContext(true);
|
|
88
|
+
const hasPositioner = Boolean(positioning);
|
|
89
|
+
const direction = useDirection();
|
|
90
|
+
const enableAutoResize = useStableCallback(() => open);
|
|
91
|
+
usePopupAutoResize({
|
|
92
|
+
popupElement,
|
|
93
|
+
positionerElement,
|
|
94
|
+
mounted,
|
|
95
|
+
content: value,
|
|
96
|
+
enabled: enableAutoResize,
|
|
97
|
+
side: positioning?.side ?? 'bottom',
|
|
98
|
+
direction
|
|
99
|
+
});
|
|
80
100
|
const domReference = (floatingRootContext || EMPTY_ROOT_CONTEXT).useState('domReferenceElement');
|
|
81
101
|
useIsoLayoutEffect(() => {
|
|
82
102
|
if (domReference) {
|
|
@@ -194,8 +194,8 @@ export const NumberFieldInput = /*#__PURE__*/React.forwardRef(function NumberFie
|
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
//
|
|
198
|
-
//
|
|
197
|
+
// Update the input text immediately and only fire onValueChange if the typed value is
|
|
198
|
+
// currently parseable into a number. This preserves good UX for IME
|
|
199
199
|
// composition/partial input while still providing live numeric updates when possible.
|
|
200
200
|
const allowedNonNumericKeys = getAllowedNonNumericKeys();
|
|
201
201
|
const isValidCharacterString = Array.from(targetValue).every(ch => {
|
|
@@ -210,17 +210,9 @@ export const NumberFieldInput = /*#__PURE__*/React.forwardRef(function NumberFie
|
|
|
210
210
|
if (!isValidCharacterString) {
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
if (event.isTrusted) {
|
|
214
|
-
setInputValue(targetValue);
|
|
215
|
-
const parsedValue = parseNumber(targetValue, locale, formatOptionsRef.current);
|
|
216
|
-
if (parsedValue !== null) {
|
|
217
|
-
setValue(parsedValue, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));
|
|
218
|
-
}
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
213
|
const parsedValue = parseNumber(targetValue, locale, formatOptionsRef.current);
|
|
214
|
+
setInputValue(targetValue);
|
|
222
215
|
if (parsedValue !== null) {
|
|
223
|
-
setInputValue(targetValue);
|
|
224
216
|
setValue(parsedValue, createChangeEventDetails(REASONS.inputChange, event.nativeEvent));
|
|
225
217
|
}
|
|
226
218
|
},
|
|
@@ -15,92 +15,99 @@ export interface NumberFieldRootProps extends Omit<BaseUIComponentProps<'div', N
|
|
|
15
15
|
/**
|
|
16
16
|
* The id of the input element.
|
|
17
17
|
*/
|
|
18
|
-
id?: string;
|
|
18
|
+
id?: string | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* The minimum value of the input element.
|
|
21
21
|
*/
|
|
22
|
-
min?: number;
|
|
22
|
+
min?: number | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* The maximum value of the input element.
|
|
25
25
|
*/
|
|
26
|
-
max?: number;
|
|
26
|
+
max?: number | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* When true, direct text entry may be outside the `min`/`max` range without clamping,
|
|
29
|
+
* so native range underflow/overflow validation can occur.
|
|
30
|
+
* Step-based interactions (keyboard arrows, buttons, wheel, scrub) still clamp.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
allowOutOfRange?: boolean | undefined;
|
|
27
34
|
/**
|
|
28
35
|
* The small step value of the input element when incrementing while the meta key is held. Snaps
|
|
29
36
|
* to multiples of this value.
|
|
30
37
|
* @default 0.1
|
|
31
38
|
*/
|
|
32
|
-
smallStep?: number;
|
|
39
|
+
smallStep?: number | undefined;
|
|
33
40
|
/**
|
|
34
41
|
* Amount to increment and decrement with the buttons and arrow keys, or to scrub with pointer movement in the scrub area.
|
|
35
42
|
* To always enable step validation on form submission, specify the `min` prop explicitly in conjunction with this prop.
|
|
36
43
|
* Specify `step="any"` to always disable step validation.
|
|
37
44
|
* @default 1
|
|
38
45
|
*/
|
|
39
|
-
step?: number | 'any';
|
|
46
|
+
step?: (number | 'any') | undefined;
|
|
40
47
|
/**
|
|
41
48
|
* The large step value of the input element when incrementing while the shift key is held. Snaps
|
|
42
49
|
* to multiples of this value.
|
|
43
50
|
* @default 10
|
|
44
51
|
*/
|
|
45
|
-
largeStep?: number;
|
|
52
|
+
largeStep?: number | undefined;
|
|
46
53
|
/**
|
|
47
54
|
* Whether the user must enter a value before submitting a form.
|
|
48
55
|
* @default false
|
|
49
56
|
*/
|
|
50
|
-
required?: boolean;
|
|
57
|
+
required?: boolean | undefined;
|
|
51
58
|
/**
|
|
52
59
|
* Whether the component should ignore user interaction.
|
|
53
60
|
* @default false
|
|
54
61
|
*/
|
|
55
|
-
disabled?: boolean;
|
|
62
|
+
disabled?: boolean | undefined;
|
|
56
63
|
/**
|
|
57
64
|
* Whether the user should be unable to change the field value.
|
|
58
65
|
* @default false
|
|
59
66
|
*/
|
|
60
|
-
readOnly?: boolean;
|
|
67
|
+
readOnly?: boolean | undefined;
|
|
61
68
|
/**
|
|
62
69
|
* Identifies the field when a form is submitted.
|
|
63
70
|
*/
|
|
64
|
-
name?: string;
|
|
71
|
+
name?: string | undefined;
|
|
65
72
|
/**
|
|
66
73
|
* The raw numeric value of the field.
|
|
67
74
|
*/
|
|
68
|
-
value?: number | null;
|
|
75
|
+
value?: (number | null) | undefined;
|
|
69
76
|
/**
|
|
70
77
|
* The uncontrolled value of the field when it’s initially rendered.
|
|
71
78
|
*
|
|
72
79
|
* To render a controlled number field, use the `value` prop instead.
|
|
73
80
|
*/
|
|
74
|
-
defaultValue?: number;
|
|
81
|
+
defaultValue?: number | undefined;
|
|
75
82
|
/**
|
|
76
83
|
* Whether to allow the user to scrub the input value with the mouse wheel while focused and
|
|
77
84
|
* hovering over the input.
|
|
78
85
|
* @default false
|
|
79
86
|
*/
|
|
80
|
-
allowWheelScrub?: boolean;
|
|
87
|
+
allowWheelScrub?: boolean | undefined;
|
|
81
88
|
/**
|
|
82
89
|
* Whether the value should snap to the nearest step when incrementing or decrementing.
|
|
83
90
|
* @default false
|
|
84
91
|
*/
|
|
85
|
-
snapOnStep?: boolean;
|
|
92
|
+
snapOnStep?: boolean | undefined;
|
|
86
93
|
/**
|
|
87
94
|
* Options to format the input value.
|
|
88
95
|
*/
|
|
89
|
-
format?: Intl.NumberFormatOptions;
|
|
96
|
+
format?: Intl.NumberFormatOptions | undefined;
|
|
90
97
|
/**
|
|
91
98
|
* Callback fired when the number value changes.
|
|
92
99
|
*
|
|
93
100
|
* The `eventDetails.reason` indicates what triggered the change:
|
|
94
101
|
* - `'input-change'` for parseable typing or programmatic text updates
|
|
95
102
|
* - `'input-clear'` when the field becomes empty
|
|
96
|
-
* - `'input-blur'` when formatting
|
|
103
|
+
* - `'input-blur'` when formatting (and clamping, if enabled) occurs on blur
|
|
97
104
|
* - `'input-paste'` for paste interactions
|
|
98
105
|
* - `'keyboard'` for keyboard input
|
|
99
106
|
* - `'increment-press'` / `'decrement-press'` for button presses on the increment and decrement controls
|
|
100
107
|
* - `'wheel'` for wheel-based scrubbing
|
|
101
108
|
* - `'scrub'` for scrub area drags
|
|
102
109
|
*/
|
|
103
|
-
onValueChange?: (value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void;
|
|
110
|
+
onValueChange?: ((value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void) | undefined;
|
|
104
111
|
/**
|
|
105
112
|
* Callback function that is fired when the value is committed.
|
|
106
113
|
* It runs later than `onValueChange`, when:
|
|
@@ -111,16 +118,16 @@ export interface NumberFieldRootProps extends Omit<BaseUIComponentProps<'div', N
|
|
|
111
118
|
*
|
|
112
119
|
* **Warning**: This is a generic event not a change event.
|
|
113
120
|
*/
|
|
114
|
-
onValueCommitted?: (value: number | null, eventDetails: NumberFieldRoot.CommitEventDetails) => void;
|
|
121
|
+
onValueCommitted?: ((value: number | null, eventDetails: NumberFieldRoot.CommitEventDetails) => void) | undefined;
|
|
115
122
|
/**
|
|
116
123
|
* The locale of the input element.
|
|
117
124
|
* Defaults to the user's runtime locale.
|
|
118
125
|
*/
|
|
119
|
-
locale?: Intl.LocalesArgument;
|
|
126
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
120
127
|
/**
|
|
121
128
|
* A ref to access the hidden input element.
|
|
122
129
|
*/
|
|
123
|
-
inputRef?: React.Ref<HTMLInputElement
|
|
130
|
+
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
124
131
|
}
|
|
125
132
|
export interface NumberFieldRootState extends FieldRoot.State {
|
|
126
133
|
/**
|
|
@@ -49,6 +49,7 @@ export const NumberFieldRoot = /*#__PURE__*/React.forwardRef(function NumberFiel
|
|
|
49
49
|
onValueCommitted: onValueCommittedProp,
|
|
50
50
|
allowWheelScrub = false,
|
|
51
51
|
snapOnStep = false,
|
|
52
|
+
allowOutOfRange = false,
|
|
52
53
|
format,
|
|
53
54
|
locale,
|
|
54
55
|
render,
|
|
@@ -175,6 +176,10 @@ export const NumberFieldRoot = /*#__PURE__*/React.forwardRef(function NumberFiel
|
|
|
175
176
|
const setValue = useStableCallback((unvalidatedValue, details) => {
|
|
176
177
|
const eventWithOptionalKeyState = details.event;
|
|
177
178
|
const dir = details.direction;
|
|
179
|
+
const reason = details.reason;
|
|
180
|
+
// Only allow out-of-range values for direct text entry (native-like behavior).
|
|
181
|
+
// Step-based interactions (keyboard arrows, buttons, wheel, scrub) still clamp to min/max.
|
|
182
|
+
const shouldClampValue = !allowOutOfRange || !(reason === REASONS.inputChange || reason === REASONS.inputBlur || reason === REASONS.inputPaste || reason === REASONS.inputClear || reason === REASONS.none);
|
|
178
183
|
const validatedValue = toValidatedNumber(unvalidatedValue, {
|
|
179
184
|
step: dir ? getStepAmount(eventWithOptionalKeyState) * dir : undefined,
|
|
180
185
|
format: formatOptionsRef.current,
|
|
@@ -182,18 +187,20 @@ export const NumberFieldRoot = /*#__PURE__*/React.forwardRef(function NumberFiel
|
|
|
182
187
|
maxWithDefault,
|
|
183
188
|
minWithZeroDefault,
|
|
184
189
|
snapOnStep,
|
|
185
|
-
small: eventWithOptionalKeyState?.altKey ?? false
|
|
190
|
+
small: eventWithOptionalKeyState?.altKey ?? false,
|
|
191
|
+
clamp: shouldClampValue
|
|
186
192
|
});
|
|
187
193
|
|
|
188
194
|
// Determine whether we should notify about a change even if the numeric value is unchanged.
|
|
189
195
|
// This is needed when the user input is clamped/snapped to the same current value, or when
|
|
190
196
|
// the source value differs but validation normalizes to the existing value.
|
|
191
|
-
const
|
|
197
|
+
const isInputReason = details.reason === REASONS.inputChange || details.reason === REASONS.inputClear || details.reason === REASONS.inputBlur || details.reason === REASONS.inputPaste || details.reason === REASONS.none;
|
|
198
|
+
const shouldFireChange = validatedValue !== value || isInputReason && (unvalidatedValue !== value || allowInputSyncRef.current === false);
|
|
192
199
|
if (shouldFireChange) {
|
|
193
200
|
lastChangedValueRef.current = validatedValue;
|
|
194
201
|
onValueChangeProp?.(validatedValue, details);
|
|
195
202
|
if (details.isCanceled) {
|
|
196
|
-
return;
|
|
203
|
+
return shouldFireChange;
|
|
197
204
|
}
|
|
198
205
|
setValueUnwrapped(validatedValue);
|
|
199
206
|
setDirty(validatedValue !== validityData.initialValue);
|
|
@@ -210,6 +217,7 @@ export const NumberFieldRoot = /*#__PURE__*/React.forwardRef(function NumberFiel
|
|
|
210
217
|
|
|
211
218
|
// Formatting can change even if the numeric value hasn't, so ensure a re-render when needed.
|
|
212
219
|
forceRender();
|
|
220
|
+
return shouldFireChange;
|
|
213
221
|
});
|
|
214
222
|
const incrementValue = useStableCallback((amount, {
|
|
215
223
|
direction,
|
|
@@ -220,7 +228,7 @@ export const NumberFieldRoot = /*#__PURE__*/React.forwardRef(function NumberFiel
|
|
|
220
228
|
const prevValue = currentValue == null ? valueRef.current : currentValue;
|
|
221
229
|
const nextValue = typeof prevValue === 'number' ? prevValue + amount * direction : Math.max(0, min ?? 0);
|
|
222
230
|
const nativeEvent = event;
|
|
223
|
-
setValue(nextValue, createChangeEventDetails(reason, nativeEvent, undefined, {
|
|
231
|
+
return setValue(nextValue, createChangeEventDetails(reason, nativeEvent, undefined, {
|
|
224
232
|
direction
|
|
225
233
|
}));
|
|
226
234
|
});
|
|
@@ -258,15 +266,22 @@ export const NumberFieldRoot = /*#__PURE__*/React.forwardRef(function NumberFiel
|
|
|
258
266
|
});
|
|
259
267
|
function tick() {
|
|
260
268
|
const amount = getStepAmount(triggerEvent) ?? DEFAULT_STEP;
|
|
261
|
-
incrementValue(amount, {
|
|
269
|
+
return incrementValue(amount, {
|
|
262
270
|
direction: isIncrement ? 1 : -1,
|
|
263
271
|
event: triggerEvent,
|
|
264
272
|
reason: isIncrement ? 'increment-press' : 'decrement-press'
|
|
265
273
|
});
|
|
266
274
|
}
|
|
267
|
-
tick()
|
|
275
|
+
if (!tick()) {
|
|
276
|
+
stopAutoChange();
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
268
279
|
startTickTimeout.start(START_AUTO_CHANGE_DELAY, () => {
|
|
269
|
-
tickInterval.start(CHANGE_VALUE_TICK_DELAY,
|
|
280
|
+
tickInterval.start(CHANGE_VALUE_TICK_DELAY, () => {
|
|
281
|
+
if (!tick()) {
|
|
282
|
+
stopAutoChange();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
270
285
|
});
|
|
271
286
|
});
|
|
272
287
|
|
|
@@ -14,9 +14,9 @@ export interface NumberFieldRootContext {
|
|
|
14
14
|
disabled: boolean;
|
|
15
15
|
readOnly: boolean;
|
|
16
16
|
id: string | undefined;
|
|
17
|
-
setValue: (value: number | null, details: NumberFieldRoot.ChangeEventDetails) =>
|
|
17
|
+
setValue: (value: number | null, details: NumberFieldRoot.ChangeEventDetails) => boolean;
|
|
18
18
|
getStepAmount: (event?: EventWithOptionalKeyState) => number | undefined;
|
|
19
|
-
incrementValue: (amount: number, params: IncrementValueParameters) =>
|
|
19
|
+
incrementValue: (amount: number, params: IncrementValueParameters) => boolean;
|
|
20
20
|
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
21
21
|
allowInputSyncRef: React.RefObject<boolean | null>;
|
|
22
22
|
formatOptionsRef: React.RefObject<Intl.NumberFormatOptions | undefined>;
|
|
@@ -10,16 +10,16 @@ export interface UseNumberFieldButtonParameters {
|
|
|
10
10
|
formatOptionsRef: React.RefObject<Intl.NumberFormatOptions | undefined>;
|
|
11
11
|
getStepAmount: (event?: EventWithOptionalKeyState) => number | undefined;
|
|
12
12
|
id: string | undefined;
|
|
13
|
-
incrementValue: (amount: number, params: IncrementValueParameters) =>
|
|
13
|
+
incrementValue: (amount: number, params: IncrementValueParameters) => boolean;
|
|
14
14
|
inputRef: React.RefObject<HTMLInputElement | null>;
|
|
15
15
|
inputValue: string;
|
|
16
16
|
intentionalTouchCheckTimeout: Timeout;
|
|
17
17
|
isIncrement: boolean;
|
|
18
18
|
isPressedRef: React.RefObject<boolean | null>;
|
|
19
|
-
locale?: Intl.LocalesArgument;
|
|
19
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
20
20
|
movesAfterTouchRef: React.RefObject<number | null>;
|
|
21
21
|
readOnly: boolean;
|
|
22
|
-
setValue: (value: number | null, details: NumberFieldRoot.ChangeEventDetails) =>
|
|
22
|
+
setValue: (value: number | null, details: NumberFieldRoot.ChangeEventDetails) => boolean;
|
|
23
23
|
startAutoChange: (isIncrement: boolean, event?: React.MouseEvent | Event) => void;
|
|
24
24
|
stopAutoChange: () => void;
|
|
25
25
|
valueRef: React.RefObject<number | null>;
|
|
@@ -4,6 +4,12 @@ import * as React from 'react';
|
|
|
4
4
|
import { DEFAULT_STEP, MAX_POINTER_MOVES_AFTER_TOUCH, SCROLLING_POINTER_MOVE_DISTANCE, TOUCH_TIMEOUT } from "../utils/constants.js";
|
|
5
5
|
import { parseNumber } from "../utils/parse.js";
|
|
6
6
|
import { createChangeEventDetails, createGenericEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
7
|
+
// Treat pen as touch-like to avoid forcing the software keyboard on stylus taps.
|
|
8
|
+
// Linux Chrome may emit "pen" historically for mouse usage due to a bug, but the touch path
|
|
9
|
+
// still works with minor behavioral differences.
|
|
10
|
+
function isTouchLikePointerType(pointerType) {
|
|
11
|
+
return pointerType === 'touch' || pointerType === 'pen';
|
|
12
|
+
}
|
|
7
13
|
export function useNumberFieldButton(params) {
|
|
8
14
|
const {
|
|
9
15
|
allowInputSyncRef,
|
|
@@ -72,7 +78,7 @@ export function useNumberFieldButton(params) {
|
|
|
72
78
|
const isDisabled = disabled || readOnly;
|
|
73
79
|
if (event.defaultPrevented || isDisabled || (
|
|
74
80
|
// If it's not a keyboard/virtual click, ignore.
|
|
75
|
-
pointerTypeRef.current
|
|
81
|
+
isTouchLikePointerType(pointerTypeRef.current) ? ignoreClickRef.current : event.detail !== 0)) {
|
|
76
82
|
return;
|
|
77
83
|
}
|
|
78
84
|
commitValue(event.nativeEvent);
|
|
@@ -101,9 +107,8 @@ export function useNumberFieldButton(params) {
|
|
|
101
107
|
y: event.clientY
|
|
102
108
|
};
|
|
103
109
|
commitValue(event.nativeEvent);
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (event.pointerType !== 'touch') {
|
|
110
|
+
const isTouchPointer = isTouchLikePointerType(event.pointerType);
|
|
111
|
+
if (!isTouchPointer) {
|
|
107
112
|
event.preventDefault();
|
|
108
113
|
inputRef.current?.focus();
|
|
109
114
|
startAutoChange(isIncrement, event);
|
|
@@ -131,13 +136,13 @@ export function useNumberFieldButton(params) {
|
|
|
131
136
|
onPointerUp(event) {
|
|
132
137
|
// Ensure we mark the press as released for touch flows even if auto-change never started,
|
|
133
138
|
// so the delayed auto-change check won’t start after a quick tap.
|
|
134
|
-
if (event.pointerType
|
|
139
|
+
if (isTouchLikePointerType(event.pointerType)) {
|
|
135
140
|
isPressedRef.current = false;
|
|
136
141
|
}
|
|
137
142
|
},
|
|
138
143
|
onPointerMove(event) {
|
|
139
144
|
const isDisabled = disabled || readOnly;
|
|
140
|
-
if (isDisabled || event.pointerType
|
|
145
|
+
if (isDisabled || !isTouchLikePointerType(event.pointerType) || !isPressedRef.current) {
|
|
141
146
|
return;
|
|
142
147
|
}
|
|
143
148
|
if (movesAfterTouchRef.current != null) {
|
|
@@ -158,7 +163,7 @@ export function useNumberFieldButton(params) {
|
|
|
158
163
|
},
|
|
159
164
|
onMouseEnter(event) {
|
|
160
165
|
const isDisabled = disabled || readOnly;
|
|
161
|
-
if (event.defaultPrevented || isDisabled || !isPressedRef.current || isTouchingButtonRef.current || pointerTypeRef.current
|
|
166
|
+
if (event.defaultPrevented || isDisabled || !isPressedRef.current || isTouchingButtonRef.current || isTouchLikePointerType(pointerTypeRef.current)) {
|
|
162
167
|
return;
|
|
163
168
|
}
|
|
164
169
|
startAutoChange(isIncrement, event);
|