@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
|
@@ -5,11 +5,11 @@ import { Group } from "../../utils/resolveValueLabel.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export declare function AriaCombobox<Value, Mode extends SelectionMode = 'none'>(props: Omit<
|
|
8
|
+
export declare function AriaCombobox<Value, Mode extends SelectionMode = 'none'>(props: Omit<AriaComboboxProps<Value, Mode>, 'items'> & {
|
|
9
9
|
items: readonly Group<any>[];
|
|
10
10
|
}): React.JSX.Element;
|
|
11
|
-
export declare function AriaCombobox<Value, Mode extends SelectionMode = 'none'>(props: Omit<
|
|
12
|
-
items?: readonly any[];
|
|
11
|
+
export declare function AriaCombobox<Value, Mode extends SelectionMode = 'none'>(props: Omit<AriaComboboxProps<Value, Mode>, 'items'> & {
|
|
12
|
+
items?: readonly any[] | undefined;
|
|
13
13
|
}): React.JSX.Element;
|
|
14
14
|
type SelectionMode = 'single' | 'multiple' | 'none';
|
|
15
15
|
type ComboboxItemValueType<ItemValue, Mode extends SelectionMode> = Mode extends 'multiple' ? ItemValue[] : ItemValue;
|
|
@@ -18,50 +18,50 @@ interface ComboboxRootProps<ItemValue> {
|
|
|
18
18
|
/**
|
|
19
19
|
* Identifies the field when a form is submitted.
|
|
20
20
|
*/
|
|
21
|
-
name?: string;
|
|
21
|
+
name?: string | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* The id of the component.
|
|
24
24
|
*/
|
|
25
|
-
id?: string;
|
|
25
|
+
id?: string | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Whether the user must choose a value before submitting a form.
|
|
28
28
|
* @default false
|
|
29
29
|
*/
|
|
30
|
-
required?: boolean;
|
|
30
|
+
required?: boolean | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Whether the user should be unable to choose a different option from the popup.
|
|
33
33
|
* @default false
|
|
34
34
|
*/
|
|
35
|
-
readOnly?: boolean;
|
|
35
|
+
readOnly?: boolean | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* Whether the component should ignore user interaction.
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
|
-
disabled?: boolean;
|
|
40
|
+
disabled?: boolean | undefined;
|
|
41
41
|
/**
|
|
42
42
|
* Whether the popup is initially open.
|
|
43
43
|
*
|
|
44
44
|
* To render a controlled popup, use the `open` prop instead.
|
|
45
45
|
* @default false
|
|
46
46
|
*/
|
|
47
|
-
defaultOpen?: boolean;
|
|
47
|
+
defaultOpen?: boolean | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* Whether the popup is currently open. Use when controlled.
|
|
50
50
|
*/
|
|
51
|
-
open?: boolean;
|
|
51
|
+
open?: boolean | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* Event handler called when the popup is opened or closed.
|
|
54
54
|
*/
|
|
55
|
-
onOpenChange?: (open: boolean, eventDetails: AriaCombobox.ChangeEventDetails) => void;
|
|
55
|
+
onOpenChange?: ((open: boolean, eventDetails: AriaCombobox.ChangeEventDetails) => void) | undefined;
|
|
56
56
|
/**
|
|
57
57
|
* Event handler called after any animations complete when the popup is opened or closed.
|
|
58
58
|
*/
|
|
59
|
-
onOpenChangeComplete?: (open: boolean) => void;
|
|
59
|
+
onOpenChangeComplete?: ((open: boolean) => void) | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* Whether the popup opens when clicking the input.
|
|
62
62
|
* @default true
|
|
63
63
|
*/
|
|
64
|
-
openOnInputClick?: boolean;
|
|
64
|
+
openOnInputClick?: boolean | undefined;
|
|
65
65
|
/**
|
|
66
66
|
* Whether the first matching item is highlighted automatically.
|
|
67
67
|
* - `false`: do not highlight automatically.
|
|
@@ -69,46 +69,46 @@ interface ComboboxRootProps<ItemValue> {
|
|
|
69
69
|
* - `'always'`: highlight the first item as soon as the list opens.
|
|
70
70
|
* @default false
|
|
71
71
|
*/
|
|
72
|
-
autoHighlight?: boolean | 'always';
|
|
72
|
+
autoHighlight?: (boolean | 'always') | undefined;
|
|
73
73
|
/**
|
|
74
74
|
* Whether the highlighted item should be preserved when the pointer leaves the list.
|
|
75
75
|
* @default false
|
|
76
76
|
*/
|
|
77
|
-
keepHighlight?: boolean;
|
|
77
|
+
keepHighlight?: boolean | undefined;
|
|
78
78
|
/**
|
|
79
79
|
* Whether moving the pointer over items should highlight them.
|
|
80
80
|
* Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
|
|
81
81
|
* @default true
|
|
82
82
|
*/
|
|
83
|
-
highlightItemOnHover?: boolean;
|
|
83
|
+
highlightItemOnHover?: boolean | undefined;
|
|
84
84
|
/**
|
|
85
85
|
* Whether to loop keyboard focus back to the input when the end of the list is reached while using the arrow keys. The first item can then be reached by pressing <kbd>ArrowDown</kbd> again from the input, or the last item can be reached by pressing <kbd>ArrowUp</kbd> from the input.
|
|
86
86
|
* The input is always included in the focus loop per [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).
|
|
87
87
|
* When disabled, focus does not move when on the last element and the user presses <kbd>ArrowDown</kbd>, or when on the first element and the user presses <kbd>ArrowUp</kbd>.
|
|
88
88
|
* @default true
|
|
89
89
|
*/
|
|
90
|
-
loopFocus?: boolean;
|
|
90
|
+
loopFocus?: boolean | undefined;
|
|
91
91
|
/**
|
|
92
92
|
* The input value of the combobox. Use when controlled.
|
|
93
93
|
*/
|
|
94
|
-
inputValue?: React.ComponentProps<'input'>['value'];
|
|
94
|
+
inputValue?: React.ComponentProps<'input'>['value'] | undefined;
|
|
95
95
|
/**
|
|
96
96
|
* Callback fired when the input value of the combobox changes.
|
|
97
97
|
*/
|
|
98
|
-
onInputValueChange?: (value: string, eventDetails: AriaCombobox.ChangeEventDetails) => void;
|
|
98
|
+
onInputValueChange?: ((value: string, eventDetails: AriaCombobox.ChangeEventDetails) => void) | undefined;
|
|
99
99
|
/**
|
|
100
100
|
* The uncontrolled input value when initially rendered.
|
|
101
101
|
*
|
|
102
102
|
* To render a controlled input, use the `inputValue` prop instead.
|
|
103
103
|
*/
|
|
104
|
-
defaultInputValue?: React.ComponentProps<'input'>['defaultValue'];
|
|
104
|
+
defaultInputValue?: React.ComponentProps<'input'>['defaultValue'] | undefined;
|
|
105
105
|
/**
|
|
106
106
|
* A ref to imperative actions.
|
|
107
107
|
* - `unmount`: When specified, the combobox will not be unmounted when closed.
|
|
108
108
|
* Instead, the `unmount` function must be called to unmount the combobox manually.
|
|
109
109
|
* Useful when the combobox's animation is controlled by an external library.
|
|
110
110
|
*/
|
|
111
|
-
actionsRef?: React.RefObject<AriaCombobox.Actions | null
|
|
111
|
+
actionsRef?: React.RefObject<AriaCombobox.Actions | null> | undefined;
|
|
112
112
|
/**
|
|
113
113
|
* Callback fired when an item is highlighted or unhighlighted.
|
|
114
114
|
* Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
|
|
@@ -117,69 +117,69 @@ interface ComboboxRootProps<ItemValue> {
|
|
|
117
117
|
* - `'pointer'`: the highlight changed due to pointer hovering.
|
|
118
118
|
* - `'none'`: the highlight changed programmatically.
|
|
119
119
|
*/
|
|
120
|
-
onItemHighlighted?: (itemValue: ItemValue | undefined, eventDetails: AriaCombobox.HighlightEventDetails) => void;
|
|
120
|
+
onItemHighlighted?: ((itemValue: ItemValue | undefined, eventDetails: AriaCombobox.HighlightEventDetails) => void) | undefined;
|
|
121
121
|
/**
|
|
122
122
|
* A ref to the hidden input element.
|
|
123
123
|
*/
|
|
124
|
-
inputRef?: React.Ref<HTMLInputElement
|
|
124
|
+
inputRef?: React.Ref<HTMLInputElement> | undefined;
|
|
125
125
|
/**
|
|
126
126
|
* Whether list items are presented in a grid layout.
|
|
127
127
|
* When enabled, arrow keys navigate across rows and columns inferred from DOM rows.
|
|
128
128
|
* @default false
|
|
129
129
|
*/
|
|
130
|
-
grid?: boolean;
|
|
130
|
+
grid?: boolean | undefined;
|
|
131
131
|
/**
|
|
132
132
|
* The items to be displayed in the list.
|
|
133
133
|
* Can be either a flat array of items or an array of groups with items.
|
|
134
134
|
*/
|
|
135
|
-
items?: readonly any[] | readonly Group<any>[];
|
|
135
|
+
items?: (readonly any[] | readonly Group<any>[]) | undefined;
|
|
136
136
|
/**
|
|
137
137
|
* Filtered items to display in the list.
|
|
138
138
|
* When provided, the list will use these items instead of filtering the `items` prop internally.
|
|
139
139
|
* Use when you want to control filtering logic externally with the `useFilter()` hook.
|
|
140
140
|
*/
|
|
141
|
-
filteredItems?: readonly any[] | readonly Group<any>[];
|
|
141
|
+
filteredItems?: (readonly any[] | readonly Group<any>[]) | undefined;
|
|
142
142
|
/**
|
|
143
143
|
* Filter function used to match items vs input query.
|
|
144
144
|
*/
|
|
145
|
-
filter?: null | ((itemValue: ItemValue, query: string, itemToString?: (itemValue: ItemValue) => string) => boolean);
|
|
145
|
+
filter?: (null | ((itemValue: ItemValue, query: string, itemToString?: (itemValue: ItemValue) => string) => boolean)) | undefined;
|
|
146
146
|
/**
|
|
147
147
|
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input.
|
|
148
148
|
* If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
|
|
149
149
|
*/
|
|
150
|
-
itemToStringLabel?: (itemValue: ItemValue) => string;
|
|
150
|
+
itemToStringLabel?: ((itemValue: ItemValue) => string) | undefined;
|
|
151
151
|
/**
|
|
152
152
|
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission.
|
|
153
153
|
* If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
|
|
154
154
|
*/
|
|
155
|
-
itemToStringValue?: (itemValue: ItemValue) => string;
|
|
155
|
+
itemToStringValue?: ((itemValue: ItemValue) => string) | undefined;
|
|
156
156
|
/**
|
|
157
157
|
* Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially.
|
|
158
158
|
* Defaults to `Object.is` comparison.
|
|
159
159
|
*/
|
|
160
|
-
isItemEqualToValue?: (itemValue: ItemValue,
|
|
160
|
+
isItemEqualToValue?: ((itemValue: ItemValue, value: ItemValue) => boolean) | undefined;
|
|
161
161
|
/**
|
|
162
162
|
* Whether the items are being externally virtualized.
|
|
163
163
|
* @default false
|
|
164
164
|
*/
|
|
165
|
-
virtualized?: boolean;
|
|
165
|
+
virtualized?: boolean | undefined;
|
|
166
166
|
/**
|
|
167
167
|
* Whether the list is rendered inline without using the popup.
|
|
168
168
|
* @default false
|
|
169
169
|
*/
|
|
170
|
-
inline?: boolean;
|
|
170
|
+
inline?: boolean | undefined;
|
|
171
171
|
/**
|
|
172
172
|
* Determines if the popup enters a modal state when open.
|
|
173
173
|
* - `true`: user interaction is limited to the popup: document page scroll is locked and pointer interactions on outside elements are disabled.
|
|
174
174
|
* - `false`: user interaction with the rest of the document is allowed.
|
|
175
175
|
* @default false
|
|
176
176
|
*/
|
|
177
|
-
modal?: boolean;
|
|
177
|
+
modal?: boolean | undefined;
|
|
178
178
|
/**
|
|
179
179
|
* The maximum number of items to display in the list.
|
|
180
180
|
* @default -1
|
|
181
181
|
*/
|
|
182
|
-
limit?: number;
|
|
182
|
+
limit?: number | undefined;
|
|
183
183
|
/**
|
|
184
184
|
* Controls how the component behaves with respect to list filtering and inline autocompletion.
|
|
185
185
|
* - `list` (default): items are dynamically filtered based on the input value. The input value does not change based on the active item.
|
|
@@ -188,23 +188,28 @@ interface ComboboxRootProps<ItemValue> {
|
|
|
188
188
|
* - `none`: items are static (not filtered), and the input value will not change based on the active item.
|
|
189
189
|
* @default 'list'
|
|
190
190
|
*/
|
|
191
|
-
autoComplete?: 'list' | 'both' | 'inline' | 'none';
|
|
191
|
+
autoComplete?: ('list' | 'both' | 'inline' | 'none') | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* Provides a hint to the browser for autofill on the hidden input element.
|
|
194
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete
|
|
195
|
+
*/
|
|
196
|
+
formAutoComplete?: string | undefined;
|
|
192
197
|
/**
|
|
193
198
|
* The locale to use for string comparison.
|
|
194
199
|
* Defaults to the user's runtime locale.
|
|
195
200
|
*/
|
|
196
|
-
locale?: Intl.LocalesArgument;
|
|
201
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
197
202
|
/**
|
|
198
203
|
* Whether clicking an item should submit the owning form.
|
|
199
204
|
* @default false
|
|
200
205
|
*/
|
|
201
|
-
submitOnItemClick?: boolean;
|
|
206
|
+
submitOnItemClick?: boolean | undefined;
|
|
202
207
|
/**
|
|
203
208
|
* INTERNAL: When `selectionMode` is `none`, controls whether selecting an item fills the input.
|
|
204
209
|
*/
|
|
205
|
-
fillInputOnItemPress?: boolean;
|
|
210
|
+
fillInputOnItemPress?: boolean | undefined;
|
|
206
211
|
}
|
|
207
|
-
export type
|
|
212
|
+
export type AriaComboboxProps<Value, Mode extends SelectionMode = 'none'> = ComboboxRootProps<Value> & {
|
|
208
213
|
/**
|
|
209
214
|
* How the combobox should remember the selected value.
|
|
210
215
|
* - `single`: Remembers the last selected value.
|
|
@@ -212,24 +217,24 @@ export type ComboboxRootConditionalProps<Value, Mode extends SelectionMode = 'no
|
|
|
212
217
|
* - `none`: Do not remember the selected value.
|
|
213
218
|
* @default 'none'
|
|
214
219
|
*/
|
|
215
|
-
selectionMode?: Mode;
|
|
220
|
+
selectionMode?: Mode | undefined;
|
|
216
221
|
/**
|
|
217
222
|
* The selected value of the combobox. Use when controlled.
|
|
218
223
|
*/
|
|
219
|
-
selectedValue?: ComboboxItemValueType<Value, Mode
|
|
224
|
+
selectedValue?: ComboboxItemValueType<Value, Mode> | undefined;
|
|
220
225
|
/**
|
|
221
226
|
* The uncontrolled selected value of the combobox when it's initially rendered.
|
|
222
227
|
*
|
|
223
228
|
* To render a controlled combobox, use the `selectedValue` prop instead.
|
|
224
229
|
*/
|
|
225
|
-
defaultSelectedValue?: ComboboxItemValueType<Value, Mode> | null;
|
|
230
|
+
defaultSelectedValue?: (ComboboxItemValueType<Value, Mode> | null) | undefined;
|
|
226
231
|
/**
|
|
227
232
|
* Callback fired when the selected value of the combobox changes.
|
|
228
233
|
*/
|
|
229
|
-
onSelectedValueChange?: (value: ComboboxItemValueType<Value, Mode>, eventDetails: AriaCombobox.ChangeEventDetails) => void;
|
|
234
|
+
onSelectedValueChange?: ((value: ComboboxItemValueType<Value, Mode>, eventDetails: AriaCombobox.ChangeEventDetails) => void) | undefined;
|
|
230
235
|
};
|
|
231
236
|
export declare namespace AriaCombobox {
|
|
232
|
-
type Props<Value, Mode extends SelectionMode = 'none'> =
|
|
237
|
+
type Props<Value, Mode extends SelectionMode = 'none'> = AriaComboboxProps<Value, Mode>;
|
|
233
238
|
interface State {}
|
|
234
239
|
interface Actions {
|
|
235
240
|
unmount: () => void;
|
|
@@ -29,7 +29,7 @@ import { useOpenInteractionType } from "../../utils/useOpenInteractionType.js";
|
|
|
29
29
|
import { useValueChanged } from "../../utils/useValueChanged.js";
|
|
30
30
|
import { NOOP } from "../../utils/noop.js";
|
|
31
31
|
import { stringifyAsLabel, stringifyAsValue, isGroupedItems } from "../../utils/resolveValueLabel.js";
|
|
32
|
-
import { defaultItemEquality, findItemIndex,
|
|
32
|
+
import { compareItemEquality, defaultItemEquality, findItemIndex, removeItem, selectedValueIncludes } from "../../utils/itemEquality.js";
|
|
33
33
|
import { INITIAL_LAST_HIGHLIGHT, NO_ACTIVE_VALUE } from "./utils/constants.js";
|
|
34
34
|
|
|
35
35
|
/**
|
|
@@ -70,6 +70,7 @@ export function AriaCombobox(props) {
|
|
|
70
70
|
modal = false,
|
|
71
71
|
limit = -1,
|
|
72
72
|
autoComplete = 'list',
|
|
73
|
+
formAutoComplete,
|
|
73
74
|
locale,
|
|
74
75
|
submitOnItemClick = false
|
|
75
76
|
} = props;
|
|
@@ -399,17 +400,24 @@ export function AriaCombobox(props) {
|
|
|
399
400
|
// If user is typing, ensure we don't auto-highlight on open due to a race
|
|
400
401
|
// with the post-open effect that sets this flag.
|
|
401
402
|
if (eventDetails.reason === REASONS.inputChange) {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
hasQuery
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
403
|
+
const event = eventDetails.event;
|
|
404
|
+
const inputType = event.inputType;
|
|
405
|
+
// Treat composition commits as typed input; autofill may omit `inputType` or
|
|
406
|
+
// report `insertReplacementText`.
|
|
407
|
+
const isTypedInput = event.type === 'compositionend' || inputType != null && inputType !== '' && inputType !== 'insertReplacementText';
|
|
408
|
+
if (isTypedInput) {
|
|
409
|
+
const hasQuery = next.trim() !== '';
|
|
410
|
+
if (hasQuery) {
|
|
411
|
+
setQueryChangedAfterOpen(true);
|
|
412
|
+
}
|
|
413
|
+
// Defer index updates until after the filtered items have been derived to ensure
|
|
414
|
+
// `onItemHighlighted` receives the latest item.
|
|
415
|
+
pendingQueryHighlightRef.current = {
|
|
416
|
+
hasQuery
|
|
417
|
+
};
|
|
418
|
+
if (hasQuery && autoHighlightMode && store.state.activeIndex == null) {
|
|
419
|
+
store.set('activeIndex', 0);
|
|
420
|
+
}
|
|
413
421
|
}
|
|
414
422
|
}
|
|
415
423
|
setInputValueUnwrapped(next);
|
|
@@ -431,7 +439,9 @@ export function AriaCombobox(props) {
|
|
|
431
439
|
}
|
|
432
440
|
if (!nextOpen && queryChangedAfterOpen) {
|
|
433
441
|
if (single) {
|
|
434
|
-
|
|
442
|
+
if (!inline) {
|
|
443
|
+
setCloseQuery(query);
|
|
444
|
+
}
|
|
435
445
|
// Avoid a flicker when closing the popup with an empty query.
|
|
436
446
|
if (query === '') {
|
|
437
447
|
setQueryChangedAfterOpen(false);
|
|
@@ -472,17 +482,17 @@ export function AriaCombobox(props) {
|
|
|
472
482
|
if (shouldFillInput) {
|
|
473
483
|
setInputValue(stringifyAsLabel(nextValue, itemToStringLabel), createChangeEventDetails(eventDetails.reason, eventDetails.event));
|
|
474
484
|
}
|
|
475
|
-
if (single && nextValue != null && eventDetails.reason !== REASONS.inputChange && queryChangedAfterOpen) {
|
|
485
|
+
if (single && nextValue != null && eventDetails.reason !== REASONS.inputChange && queryChangedAfterOpen && !inline) {
|
|
476
486
|
setCloseQuery(query);
|
|
477
487
|
}
|
|
478
488
|
});
|
|
479
489
|
const handleSelection = useStableCallback((event, passedValue) => {
|
|
480
|
-
let
|
|
481
|
-
if (
|
|
490
|
+
let itemValue = passedValue;
|
|
491
|
+
if (itemValue === undefined) {
|
|
482
492
|
if (activeIndex === null) {
|
|
483
493
|
return;
|
|
484
494
|
}
|
|
485
|
-
|
|
495
|
+
itemValue = valuesRef.current[activeIndex];
|
|
486
496
|
}
|
|
487
497
|
const targetEl = getTarget(event);
|
|
488
498
|
const overrideEvent = selectionEventRef.current ?? event;
|
|
@@ -499,8 +509,8 @@ export function AriaCombobox(props) {
|
|
|
499
509
|
}
|
|
500
510
|
if (multiple) {
|
|
501
511
|
const currentSelectedValue = Array.isArray(selectedValue) ? selectedValue : [];
|
|
502
|
-
const isCurrentlySelected =
|
|
503
|
-
const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue,
|
|
512
|
+
const isCurrentlySelected = selectedValueIncludes(currentSelectedValue, itemValue, store.state.isItemEqualToValue);
|
|
513
|
+
const nextValue = isCurrentlySelected ? removeItem(currentSelectedValue, itemValue, store.state.isItemEqualToValue) : [...currentSelectedValue, itemValue];
|
|
504
514
|
setSelectedValue(nextValue, eventDetails);
|
|
505
515
|
const wasFiltering = inputRef.current ? inputRef.current.value.trim() !== '' : false;
|
|
506
516
|
if (!wasFiltering) {
|
|
@@ -512,7 +522,7 @@ export function AriaCombobox(props) {
|
|
|
512
522
|
setOpen(false, eventDetails);
|
|
513
523
|
}
|
|
514
524
|
} else {
|
|
515
|
-
setSelectedValue(
|
|
525
|
+
setSelectedValue(itemValue, eventDetails);
|
|
516
526
|
setOpen(false, eventDetails);
|
|
517
527
|
}
|
|
518
528
|
});
|
|
@@ -659,46 +669,19 @@ export function AriaCombobox(props) {
|
|
|
659
669
|
store.set('activeIndex', null);
|
|
660
670
|
return;
|
|
661
671
|
}
|
|
662
|
-
const
|
|
663
|
-
const
|
|
664
|
-
const isSameItem =
|
|
672
|
+
const itemValue = candidateItems[storeActiveIndex];
|
|
673
|
+
const previouslyHighlightedItemValue = lastHighlightRef.current.value;
|
|
674
|
+
const isSameItem = previouslyHighlightedItemValue !== NO_ACTIVE_VALUE && compareItemEquality(itemValue, previouslyHighlightedItemValue, store.state.isItemEqualToValue);
|
|
665
675
|
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {
|
|
666
676
|
lastHighlightRef.current = {
|
|
667
|
-
value:
|
|
677
|
+
value: itemValue,
|
|
668
678
|
index: storeActiveIndex
|
|
669
679
|
};
|
|
670
|
-
store.state.onItemHighlighted(
|
|
680
|
+
store.state.onItemHighlighted(itemValue, createGenericEventDetails(REASONS.none, undefined, {
|
|
671
681
|
index: storeActiveIndex
|
|
672
682
|
}));
|
|
673
683
|
}
|
|
674
684
|
}, [activeIndex, autoHighlightMode, hasFilteredItemsProp, hasItems, flatFilteredItems, inline, open, store]);
|
|
675
|
-
|
|
676
|
-
// When the available items change, ensure the selected value(s) remain valid.
|
|
677
|
-
// - Single: if current selection is removed, fall back to defaultSelectedValue if it exists in the list; else null.
|
|
678
|
-
// - Multiple: drop any removed selections.
|
|
679
|
-
useIsoLayoutEffect(() => {
|
|
680
|
-
if (!items || selectionMode === 'none') {
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
const registry = flatItems;
|
|
684
|
-
if (multiple) {
|
|
685
|
-
const current = Array.isArray(selectedValue) ? selectedValue : EMPTY_ARRAY;
|
|
686
|
-
const next = current.filter(v => itemIncludes(registry, v, store.state.isItemEqualToValue));
|
|
687
|
-
if (next.length !== current.length) {
|
|
688
|
-
setSelectedValue(next, createChangeEventDetails(REASONS.none));
|
|
689
|
-
}
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
692
|
-
const isStillPresent = selectedValue == null || itemIncludes(registry, selectedValue, store.state.isItemEqualToValue);
|
|
693
|
-
if (isStillPresent) {
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
let fallback = null;
|
|
697
|
-
if (defaultSelectedValue != null && itemIncludes(registry, defaultSelectedValue, store.state.isItemEqualToValue)) {
|
|
698
|
-
fallback = defaultSelectedValue;
|
|
699
|
-
}
|
|
700
|
-
setSelectedValue(fallback, createChangeEventDetails(REASONS.none));
|
|
701
|
-
}, [items, flatItems, multiple, selectionMode, selectedValue, defaultSelectedValue, store, setSelectedValue]);
|
|
702
685
|
useIsoLayoutEffect(() => {
|
|
703
686
|
if (selectionMode === 'none') {
|
|
704
687
|
setFilled(String(inputValue) !== '');
|
|
@@ -733,12 +716,6 @@ export function AriaCombobox(props) {
|
|
|
733
716
|
} else {
|
|
734
717
|
validation.commit(selectedValue, true);
|
|
735
718
|
}
|
|
736
|
-
if (multiple && store.state.selectedIndex !== null && (!Array.isArray(selectedValue) || selectedValue.length === 0)) {
|
|
737
|
-
setIndices({
|
|
738
|
-
activeIndex: null,
|
|
739
|
-
selectedIndex: null
|
|
740
|
-
});
|
|
741
|
-
}
|
|
742
719
|
if (single && !hasInputValue && !inputInsidePopup) {
|
|
743
720
|
const nextInputValue = stringifyAsLabel(selectedValue, itemToStringLabel);
|
|
744
721
|
if (inputValue !== nextInputValue) {
|
|
@@ -810,7 +787,8 @@ export function AriaCombobox(props) {
|
|
|
810
787
|
toggle: false,
|
|
811
788
|
// Apply a small delay for touch to let iOS viewport centering settle.
|
|
812
789
|
// This avoids top-bottom flip flickers if the preferred position is "top" when first tapping.
|
|
813
|
-
touchOpenDelay: inputInsidePopup ? 0 : 50
|
|
790
|
+
touchOpenDelay: inputInsidePopup ? 0 : 50,
|
|
791
|
+
reason: REASONS.inputPress
|
|
814
792
|
});
|
|
815
793
|
const dismiss = useDismiss(floatingRootContext, {
|
|
816
794
|
enabled: !readOnly && !disabled && !inline,
|
|
@@ -922,9 +900,10 @@ export function AriaCombobox(props) {
|
|
|
922
900
|
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
923
901
|
const itemsContextValue = React.useMemo(() => ({
|
|
924
902
|
query,
|
|
903
|
+
hasItems,
|
|
925
904
|
filteredItems,
|
|
926
905
|
flatFilteredItems
|
|
927
|
-
}), [query, filteredItems, flatFilteredItems]);
|
|
906
|
+
}), [query, hasItems, filteredItems, flatFilteredItems]);
|
|
928
907
|
const serializedValue = React.useMemo(() => {
|
|
929
908
|
if (Array.isArray(fieldRawValue)) {
|
|
930
909
|
return '';
|
|
@@ -932,6 +911,7 @@ export function AriaCombobox(props) {
|
|
|
932
911
|
return stringifyAsValue(fieldRawValue, itemToStringValue);
|
|
933
912
|
}, [fieldRawValue, itemToStringValue]);
|
|
934
913
|
const hasMultipleSelection = multiple && Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
914
|
+
const hiddenInputName = multiple || selectionMode === 'none' ? undefined : name;
|
|
935
915
|
const hiddenInputs = React.useMemo(() => {
|
|
936
916
|
if (!multiple || !Array.isArray(selectedValue) || !name) {
|
|
937
917
|
return null;
|
|
@@ -963,7 +943,7 @@ export function AriaCombobox(props) {
|
|
|
963
943
|
return;
|
|
964
944
|
}
|
|
965
945
|
const nextValue = event.target.value;
|
|
966
|
-
const details = createChangeEventDetails(REASONS.
|
|
946
|
+
const details = createChangeEventDetails(REASONS.none, event.nativeEvent);
|
|
967
947
|
function handleChange() {
|
|
968
948
|
// Browser autofill only writes a single scalar value.
|
|
969
949
|
if (multiple) {
|
|
@@ -1000,13 +980,15 @@ export function AriaCombobox(props) {
|
|
|
1000
980
|
}
|
|
1001
981
|
}
|
|
1002
982
|
}),
|
|
1003
|
-
|
|
983
|
+
id: id && hiddenInputName == null ? `${id}-hidden-input` : undefined,
|
|
984
|
+
name: hiddenInputName,
|
|
985
|
+
autoComplete: formAutoComplete,
|
|
1004
986
|
disabled: disabled,
|
|
1005
987
|
required: required && !hasMultipleSelection,
|
|
1006
988
|
readOnly: readOnly,
|
|
1007
989
|
value: serializedValue,
|
|
1008
990
|
ref: hiddenInputRef,
|
|
1009
|
-
style:
|
|
991
|
+
style: hiddenInputName ? visuallyHiddenInput : visuallyHidden,
|
|
1010
992
|
tabIndex: -1,
|
|
1011
993
|
"aria-hidden": true
|
|
1012
994
|
}), hiddenInputs]
|
|
@@ -9,59 +9,64 @@ import { AriaCombobox } from "./AriaCombobox.js";
|
|
|
9
9
|
export declare function ComboboxRoot<Value, Multiple extends boolean | undefined = false>(props: ComboboxRoot.Props<Value, Multiple>): React.JSX.Element;
|
|
10
10
|
type ModeFromMultiple<Multiple extends boolean | undefined> = Multiple extends true ? 'multiple' : 'single';
|
|
11
11
|
type ComboboxValueType<Value, Multiple extends boolean | undefined> = Multiple extends true ? Value[] : Value;
|
|
12
|
-
export type ComboboxRootProps<Value, Multiple extends boolean | undefined = false> = Omit<AriaCombobox.Props<Value, ModeFromMultiple<Multiple>>, 'fillInputOnItemPress' | 'autoComplete' | 'submitOnItemClick' | 'autoHighlight' | 'keepHighlight' | 'highlightItemOnHover' | 'itemToStringLabel' | 'itemToStringValue' | 'isItemEqualToValue' | 'selectionMode' | 'defaultSelectedValue' | 'selectedValue' | 'onSelectedValueChange' | 'actionsRef' | 'onOpenChange' | 'onInputValueChange' | 'onItemHighlighted'> & {
|
|
12
|
+
export type ComboboxRootProps<Value, Multiple extends boolean | undefined = false> = Omit<AriaCombobox.Props<Value, ModeFromMultiple<Multiple>>, 'fillInputOnItemPress' | 'autoComplete' | 'formAutoComplete' | 'submitOnItemClick' | 'autoHighlight' | 'keepHighlight' | 'highlightItemOnHover' | 'itemToStringLabel' | 'itemToStringValue' | 'isItemEqualToValue' | 'selectionMode' | 'defaultSelectedValue' | 'selectedValue' | 'onSelectedValueChange' | 'actionsRef' | 'onOpenChange' | 'onInputValueChange' | 'onItemHighlighted'> & {
|
|
13
13
|
/**
|
|
14
14
|
* Whether multiple items can be selected.
|
|
15
15
|
* @default false
|
|
16
16
|
*/
|
|
17
|
-
multiple?: Multiple;
|
|
17
|
+
multiple?: Multiple | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Provides a hint to the browser for autofill.
|
|
20
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/autocomplete
|
|
21
|
+
*/
|
|
22
|
+
autoComplete?: string | undefined;
|
|
18
23
|
/**
|
|
19
24
|
* Whether the first matching item is highlighted automatically while filtering.
|
|
20
25
|
* @default false
|
|
21
26
|
*/
|
|
22
|
-
autoHighlight?: boolean;
|
|
27
|
+
autoHighlight?: boolean | undefined;
|
|
23
28
|
/**
|
|
24
29
|
* Whether moving the pointer over items should highlight them.
|
|
25
30
|
* Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state.
|
|
26
31
|
* @default true
|
|
27
32
|
*/
|
|
28
|
-
highlightItemOnHover?: boolean;
|
|
33
|
+
highlightItemOnHover?: boolean | undefined;
|
|
29
34
|
/**
|
|
30
35
|
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input.
|
|
31
36
|
* If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
|
|
32
37
|
*/
|
|
33
|
-
itemToStringLabel?: (itemValue: Value) => string;
|
|
38
|
+
itemToStringLabel?: ((itemValue: Value) => string) | undefined;
|
|
34
39
|
/**
|
|
35
40
|
* When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission.
|
|
36
41
|
* If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
|
|
37
42
|
*/
|
|
38
|
-
itemToStringValue?: (itemValue: Value) => string;
|
|
43
|
+
itemToStringValue?: ((itemValue: Value) => string) | undefined;
|
|
39
44
|
/**
|
|
40
45
|
* Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially.
|
|
41
46
|
* Defaults to `Object.is` comparison.
|
|
42
47
|
*/
|
|
43
|
-
isItemEqualToValue?: (itemValue: Value,
|
|
48
|
+
isItemEqualToValue?: ((itemValue: Value, value: Value) => boolean) | undefined;
|
|
44
49
|
/**
|
|
45
50
|
* The uncontrolled selected value of the combobox when it's initially rendered.
|
|
46
51
|
*
|
|
47
52
|
* To render a controlled combobox, use the `value` prop instead.
|
|
48
53
|
*/
|
|
49
|
-
defaultValue?: ComboboxValueType<Value, Multiple> | null;
|
|
54
|
+
defaultValue?: (ComboboxValueType<Value, Multiple> | null) | undefined;
|
|
50
55
|
/**
|
|
51
56
|
* A ref to imperative actions.
|
|
52
57
|
* - `unmount`: When specified, the combobox will not be unmounted when closed.
|
|
53
58
|
* Instead, the `unmount` function must be called to unmount the combobox manually.
|
|
54
59
|
* Useful when the combobox's animation is controlled by an external library.
|
|
55
60
|
*/
|
|
56
|
-
actionsRef?: React.RefObject<ComboboxRoot.Actions | null
|
|
61
|
+
actionsRef?: React.RefObject<ComboboxRoot.Actions | null> | undefined;
|
|
57
62
|
/**
|
|
58
63
|
* Event handler called when the popup is opened or closed.
|
|
59
64
|
*/
|
|
60
|
-
onOpenChange?: (open: boolean, eventDetails: ComboboxRoot.ChangeEventDetails) => void;
|
|
65
|
+
onOpenChange?: ((open: boolean, eventDetails: ComboboxRoot.ChangeEventDetails) => void) | undefined;
|
|
61
66
|
/**
|
|
62
67
|
* Event handler called when the input value changes.
|
|
63
68
|
*/
|
|
64
|
-
onInputValueChange?: (inputValue: string, eventDetails: ComboboxRoot.ChangeEventDetails) => void;
|
|
69
|
+
onInputValueChange?: ((inputValue: string, eventDetails: ComboboxRoot.ChangeEventDetails) => void) | undefined;
|
|
65
70
|
/**
|
|
66
71
|
* Callback fired when an item is highlighted or unhighlighted.
|
|
67
72
|
* Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
|
|
@@ -70,15 +75,15 @@ export type ComboboxRootProps<Value, Multiple extends boolean | undefined = fals
|
|
|
70
75
|
* - `'pointer'`: the highlight changed due to pointer hovering.
|
|
71
76
|
* - `'none'`: the highlight changed programmatically.
|
|
72
77
|
*/
|
|
73
|
-
onItemHighlighted?: (highlightedValue: Value | undefined, eventDetails: ComboboxRoot.HighlightEventDetails) => void;
|
|
78
|
+
onItemHighlighted?: ((highlightedValue: Value | undefined, eventDetails: ComboboxRoot.HighlightEventDetails) => void) | undefined;
|
|
74
79
|
/**
|
|
75
80
|
* The selected value of the combobox. Use when controlled.
|
|
76
81
|
*/
|
|
77
|
-
value?: ComboboxValueType<Value, Multiple> | null;
|
|
82
|
+
value?: (ComboboxValueType<Value, Multiple> | null) | undefined;
|
|
78
83
|
/**
|
|
79
84
|
* Event handler called when the selected value of the combobox changes.
|
|
80
85
|
*/
|
|
81
|
-
onValueChange?: (value: ComboboxValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: ComboboxRoot.ChangeEventDetails) => void;
|
|
86
|
+
onValueChange?: ((value: ComboboxValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: ComboboxRoot.ChangeEventDetails) => void) | undefined;
|
|
82
87
|
};
|
|
83
88
|
export type ComboboxRootState = AriaCombobox.State;
|
|
84
89
|
export type ComboboxRootActions = AriaCombobox.Actions;
|
|
@@ -16,6 +16,7 @@ export function ComboboxRoot(props) {
|
|
|
16
16
|
defaultValue,
|
|
17
17
|
value,
|
|
18
18
|
onValueChange,
|
|
19
|
+
autoComplete,
|
|
19
20
|
...other
|
|
20
21
|
} = props;
|
|
21
22
|
return /*#__PURE__*/_jsx(AriaCombobox, {
|
|
@@ -23,6 +24,7 @@ export function ComboboxRoot(props) {
|
|
|
23
24
|
selectionMode: multiple ? 'multiple' : 'single',
|
|
24
25
|
selectedValue: value,
|
|
25
26
|
defaultSelectedValue: defaultValue,
|
|
26
|
-
onSelectedValueChange: onValueChange
|
|
27
|
+
onSelectedValueChange: onValueChange,
|
|
28
|
+
formAutoComplete: autoComplete
|
|
27
29
|
});
|
|
28
30
|
}
|
|
@@ -3,7 +3,7 @@ export interface UseFilterOptions extends Intl.CollatorOptions {
|
|
|
3
3
|
* The locale to use for string comparison.
|
|
4
4
|
* Defaults to the user's runtime locale.
|
|
5
5
|
*/
|
|
6
|
-
locale?: Intl.LocalesArgument;
|
|
6
|
+
locale?: Intl.LocalesArgument | undefined;
|
|
7
7
|
}
|
|
8
8
|
export interface Filter {
|
|
9
9
|
contains: <Item>(item: Item, query: string, itemToString?: (item: Item) => string) => boolean;
|
|
@@ -20,7 +20,7 @@ export interface UseComboboxFilterOptions extends UseFilterOptions {
|
|
|
20
20
|
* Whether the combobox is in multiple selection mode.
|
|
21
21
|
* @default false
|
|
22
22
|
*/
|
|
23
|
-
multiple?: boolean;
|
|
23
|
+
multiple?: boolean | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* The current value of the combobox.
|
|
26
26
|
*/
|