@base-ui/react 1.0.0 → 1.1.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 +144 -1
- package/README.md +2 -3
- package/accordion/header/AccordionHeader.d.ts +1 -1
- package/accordion/item/AccordionItem.d.ts +1 -1
- package/accordion/panel/AccordionPanel.d.ts +1 -1
- package/accordion/root/AccordionRoot.d.ts +1 -1
- package/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/accordion/trigger/AccordionTrigger.js +3 -4
- package/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/autocomplete/root/AutocompleteRoot.d.ts +1 -1
- package/avatar/fallback/AvatarFallback.d.ts +1 -1
- package/avatar/image/AvatarImage.d.ts +1 -1
- package/avatar/root/AvatarRoot.d.ts +1 -1
- package/button/Button.d.ts +4 -17
- package/button/Button.js +1 -2
- package/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.d.ts +4 -0
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.js +4 -0
- package/checkbox/root/CheckboxRoot.d.ts +1 -1
- package/checkbox/root/CheckboxRoot.js +5 -4
- package/checkbox/root/CheckboxRootDataAttributes.d.ts +4 -0
- package/checkbox/root/CheckboxRootDataAttributes.js +4 -0
- package/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/collapsible/trigger/CollapsibleTrigger.js +1 -2
- package/combobox/arrow/ComboboxArrow.d.ts +1 -1
- package/combobox/backdrop/ComboboxBackdrop.d.ts +1 -1
- package/combobox/chip/ComboboxChip.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.js +3 -2
- package/combobox/chips/ComboboxChips.d.ts +1 -1
- package/combobox/chips/ComboboxChips.js +7 -1
- package/combobox/clear/ComboboxClear.d.ts +1 -1
- package/combobox/clear/ComboboxClear.js +2 -2
- package/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/combobox/group/ComboboxGroup.d.ts +1 -1
- package/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/combobox/input/ComboboxInput.d.ts +1 -1
- package/combobox/input/ComboboxInput.js +12 -18
- package/combobox/item/ComboboxItem.d.ts +1 -1
- package/combobox/item/ComboboxItem.js +0 -1
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/combobox/list/ComboboxList.d.ts +1 -1
- package/combobox/popup/ComboboxPopup.d.ts +1 -1
- package/combobox/popup/ComboboxPopup.js +2 -1
- package/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/combobox/positioner/ComboboxPositioner.d.ts +1 -1
- package/combobox/root/AriaCombobox.d.ts +8 -1
- package/combobox/root/AriaCombobox.js +19 -16
- package/combobox/root/ComboboxRoot.d.ts +1 -1
- package/combobox/row/ComboboxRow.d.ts +1 -1
- package/combobox/status/ComboboxStatus.d.ts +1 -1
- package/combobox/store.d.ts +3 -0
- package/combobox/store.js +21 -0
- package/combobox/trigger/ComboboxTrigger.d.ts +14 -1
- package/combobox/trigger/ComboboxTrigger.js +31 -11
- package/combobox/trigger/ComboboxTriggerDataAttributes.d.ts +13 -0
- package/combobox/trigger/ComboboxTriggerDataAttributes.js +13 -0
- package/combobox/utils/stateAttributesMapping.d.ts +14 -0
- package/combobox/utils/stateAttributesMapping.js +18 -0
- package/combobox/value/ComboboxValue.d.ts +5 -0
- package/combobox/value/ComboboxValue.js +15 -6
- package/composite/root/useCompositeRoot.d.ts +1 -1
- package/context-menu/trigger/ContextMenuTrigger.d.ts +1 -1
- package/csp-provider/CSPContext.d.ts +13 -0
- package/csp-provider/CSPContext.js +25 -0
- package/csp-provider/CSPProvider.d.ts +25 -0
- package/csp-provider/CSPProvider.js +32 -0
- package/csp-provider/index.d.ts +2 -0
- package/csp-provider/index.js +12 -0
- package/csp-provider/index.parts.d.ts +1 -0
- package/csp-provider/index.parts.js +12 -0
- package/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dialog/close/DialogClose.d.ts +1 -1
- package/dialog/description/DialogDescription.d.ts +1 -1
- package/dialog/popup/DialogPopup.d.ts +1 -1
- package/dialog/portal/DialogPortal.d.ts +1 -1
- package/dialog/portal/DialogPortal.js +1 -0
- package/dialog/root/DialogRoot.d.ts +4 -4
- package/dialog/store/DialogStore.d.ts +2 -2
- package/dialog/title/DialogTitle.d.ts +1 -1
- package/dialog/viewport/DialogViewport.d.ts +1 -1
- package/esm/accordion/header/AccordionHeader.d.ts +1 -1
- package/esm/accordion/item/AccordionItem.d.ts +1 -1
- package/esm/accordion/panel/AccordionPanel.d.ts +1 -1
- package/esm/accordion/root/AccordionRoot.d.ts +1 -1
- package/esm/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/esm/accordion/trigger/AccordionTrigger.js +3 -4
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +1 -1
- package/esm/avatar/fallback/AvatarFallback.d.ts +1 -1
- package/esm/avatar/image/AvatarImage.d.ts +1 -1
- package/esm/avatar/root/AvatarRoot.d.ts +1 -1
- package/esm/button/Button.d.ts +4 -17
- package/esm/button/Button.js +1 -2
- package/esm/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/esm/checkbox/indicator/CheckboxIndicatorDataAttributes.d.ts +4 -0
- package/esm/checkbox/indicator/CheckboxIndicatorDataAttributes.js +4 -0
- package/esm/checkbox/root/CheckboxRoot.d.ts +1 -1
- package/esm/checkbox/root/CheckboxRoot.js +6 -5
- package/esm/checkbox/root/CheckboxRootDataAttributes.d.ts +4 -0
- package/esm/checkbox/root/CheckboxRootDataAttributes.js +4 -0
- package/esm/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/esm/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/esm/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/esm/collapsible/trigger/CollapsibleTrigger.js +1 -2
- package/esm/combobox/arrow/ComboboxArrow.d.ts +1 -1
- package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +1 -1
- package/esm/combobox/chip/ComboboxChip.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.js +3 -2
- package/esm/combobox/chips/ComboboxChips.d.ts +1 -1
- package/esm/combobox/chips/ComboboxChips.js +7 -1
- package/esm/combobox/clear/ComboboxClear.d.ts +1 -1
- package/esm/combobox/clear/ComboboxClear.js +2 -2
- package/esm/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
- package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/esm/combobox/input/ComboboxInput.d.ts +1 -1
- package/esm/combobox/input/ComboboxInput.js +12 -17
- package/esm/combobox/item/ComboboxItem.d.ts +1 -1
- package/esm/combobox/item/ComboboxItem.js +0 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/esm/combobox/list/ComboboxList.d.ts +1 -1
- package/esm/combobox/popup/ComboboxPopup.d.ts +1 -1
- package/esm/combobox/popup/ComboboxPopup.js +2 -1
- package/esm/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/esm/combobox/positioner/ComboboxPositioner.d.ts +1 -1
- package/esm/combobox/root/AriaCombobox.d.ts +8 -1
- package/esm/combobox/root/AriaCombobox.js +20 -17
- package/esm/combobox/root/ComboboxRoot.d.ts +1 -1
- package/esm/combobox/row/ComboboxRow.d.ts +1 -1
- package/esm/combobox/status/ComboboxStatus.d.ts +1 -1
- package/esm/combobox/store.d.ts +3 -0
- package/esm/combobox/store.js +21 -0
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +14 -1
- package/esm/combobox/trigger/ComboboxTrigger.js +32 -12
- package/esm/combobox/trigger/ComboboxTriggerDataAttributes.d.ts +13 -0
- package/esm/combobox/trigger/ComboboxTriggerDataAttributes.js +13 -0
- package/esm/combobox/utils/stateAttributesMapping.d.ts +14 -0
- package/esm/combobox/utils/stateAttributesMapping.js +12 -0
- package/esm/combobox/value/ComboboxValue.d.ts +5 -0
- package/esm/combobox/value/ComboboxValue.js +16 -7
- package/esm/composite/root/useCompositeRoot.d.ts +1 -1
- package/esm/context-menu/trigger/ContextMenuTrigger.d.ts +1 -1
- package/esm/csp-provider/CSPContext.d.ts +13 -0
- package/esm/csp-provider/CSPContext.js +18 -0
- package/esm/csp-provider/CSPProvider.d.ts +25 -0
- package/esm/csp-provider/CSPProvider.js +27 -0
- package/esm/csp-provider/index.d.ts +2 -0
- package/esm/csp-provider/index.js +1 -0
- package/esm/csp-provider/index.parts.d.ts +1 -0
- package/esm/csp-provider/index.parts.js +1 -0
- package/esm/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/esm/dialog/close/DialogClose.d.ts +1 -1
- package/esm/dialog/description/DialogDescription.d.ts +1 -1
- package/esm/dialog/popup/DialogPopup.d.ts +1 -1
- package/esm/dialog/portal/DialogPortal.d.ts +1 -1
- package/esm/dialog/portal/DialogPortal.js +1 -0
- package/esm/dialog/root/DialogRoot.d.ts +4 -4
- package/esm/dialog/store/DialogStore.d.ts +2 -2
- package/esm/dialog/title/DialogTitle.d.ts +1 -1
- package/esm/dialog/viewport/DialogViewport.d.ts +1 -1
- package/esm/field/control/FieldControl.d.ts +1 -1
- package/esm/field/description/FieldDescription.d.ts +1 -1
- package/esm/field/error/FieldError.d.ts +1 -1
- package/esm/field/index.d.ts +2 -1
- package/esm/field/item/FieldItem.d.ts +1 -1
- package/esm/field/label/FieldLabel.d.ts +11 -2
- package/esm/field/label/FieldLabel.js +51 -11
- package/esm/field/root/FieldRoot.d.ts +10 -1
- package/esm/field/root/FieldRoot.js +8 -0
- package/esm/field/useField.js +7 -3
- package/esm/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/esm/floating-ui-react/components/FloatingFocusManager.js +7 -6
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +2 -2
- package/esm/floating-ui-react/components/FloatingPortal.js +11 -2
- package/esm/floating-ui-react/hooks/useClientPoint.js +5 -4
- package/esm/floating-ui-react/hooks/useDismiss.js +16 -3
- package/esm/floating-ui-react/hooks/useFocus.d.ts +5 -0
- package/esm/floating-ui-react/hooks/useFocus.js +43 -9
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +17 -4
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -0
- package/esm/form/Form.d.ts +18 -1
- package/esm/form/Form.js +17 -0
- package/esm/form/FormContext.d.ts +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/input/Input.d.ts +1 -1
- package/esm/menu/arrow/MenuArrow.d.ts +1 -1
- package/esm/menu/backdrop/MenuBackdrop.d.ts +1 -1
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +1 -1
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +1 -1
- package/esm/menu/group/MenuGroup.d.ts +1 -1
- package/esm/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/esm/menu/item/MenuItem.d.ts +1 -1
- package/esm/menu/popup/MenuPopup.d.ts +1 -1
- package/esm/menu/popup/MenuPopup.js +4 -3
- package/esm/menu/portal/MenuPortal.d.ts +1 -1
- package/esm/menu/positioner/MenuPositioner.d.ts +1 -1
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +1 -1
- package/esm/menu/radio-item/MenuRadioItem.d.ts +1 -1
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +1 -1
- package/esm/menu/root/MenuRoot.d.ts +7 -6
- package/esm/menu/root/MenuRoot.js +4 -2
- package/esm/menu/store/MenuStore.js +3 -3
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +1 -1
- package/esm/menu/trigger/MenuTrigger.js +13 -13
- package/esm/menubar/Menubar.d.ts +1 -1
- package/esm/merge-props/mergeProps.d.ts +31 -11
- package/esm/merge-props/mergeProps.js +29 -8
- package/esm/meter/indicator/MeterIndicator.d.ts +1 -1
- package/esm/meter/label/MeterLabel.d.ts +1 -1
- package/esm/meter/root/MeterRoot.d.ts +1 -1
- package/esm/meter/track/MeterTrack.d.ts +1 -1
- package/esm/meter/value/MeterValue.d.ts +1 -1
- package/esm/navigation-menu/arrow/NavigationMenuArrow.d.ts +1 -1
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.js +6 -0
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +1 -1
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.d.ts +1 -1
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +2 -2
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/esm/number-field/decrement/NumberFieldDecrement.d.ts +1 -1
- package/esm/number-field/decrement/NumberFieldDecrement.js +4 -6
- package/esm/number-field/group/NumberFieldGroup.d.ts +1 -1
- package/esm/number-field/increment/NumberFieldIncrement.d.ts +1 -1
- package/esm/number-field/increment/NumberFieldIncrement.js +4 -6
- package/esm/number-field/input/NumberFieldInput.d.ts +1 -1
- package/esm/number-field/input/NumberFieldInput.js +5 -2
- package/esm/number-field/root/NumberFieldRoot.d.ts +5 -4
- package/esm/number-field/root/NumberFieldRoot.js +12 -5
- package/esm/number-field/root/useNumberFieldButton.d.ts +0 -3
- package/esm/number-field/root/useNumberFieldButton.js +5 -11
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +1 -1
- package/esm/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +1 -1
- package/esm/popover/arrow/PopoverArrow.d.ts +1 -1
- package/esm/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/esm/popover/close/PopoverClose.d.ts +1 -1
- package/esm/popover/description/PopoverDescription.d.ts +1 -1
- package/esm/popover/popup/PopoverPopup.d.ts +1 -1
- package/esm/popover/popup/PopoverPopup.js +0 -30
- package/esm/popover/portal/PopoverPortal.d.ts +1 -1
- package/esm/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/esm/popover/positioner/PopoverPositioner.js +2 -1
- package/esm/popover/root/PopoverRoot.d.ts +2 -2
- package/esm/popover/store/PopoverStore.d.ts +4 -2
- package/esm/popover/store/PopoverStore.js +8 -5
- package/esm/popover/title/PopoverTitle.d.ts +1 -1
- package/esm/popover/trigger/PopoverTrigger.js +2 -2
- package/esm/popover/viewport/PopoverViewport.d.ts +1 -1
- package/esm/popover/viewport/PopoverViewport.js +28 -12
- package/esm/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/esm/preview-card/arrow/PreviewCardArrow.js +2 -3
- package/esm/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/esm/preview-card/backdrop/PreviewCardBackdrop.js +4 -5
- package/esm/preview-card/index.parts.d.ts +3 -1
- package/esm/preview-card/index.parts.js +3 -1
- package/esm/preview-card/popup/PreviewCardPopup.d.ts +2 -1
- package/esm/preview-card/popup/PreviewCardPopup.js +17 -11
- package/esm/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/esm/preview-card/portal/PreviewCardPortal.js +2 -3
- package/esm/preview-card/positioner/PreviewCardPositioner.d.ts +2 -1
- package/esm/preview-card/positioner/PreviewCardPositioner.js +16 -11
- package/esm/preview-card/root/PreviewCardContext.d.ts +5 -26
- package/esm/preview-card/root/PreviewCardContext.js +2 -2
- package/esm/preview-card/root/PreviewCardRoot.d.ts +35 -10
- package/esm/preview-card/root/PreviewCardRoot.js +61 -116
- package/esm/preview-card/store/PreviewCardHandle.d.ts +33 -0
- package/esm/preview-card/store/PreviewCardHandle.js +55 -0
- package/esm/preview-card/store/PreviewCardStore.d.ts +36 -0
- package/esm/preview-card/store/PreviewCardStore.js +97 -0
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +15 -3
- package/esm/preview-card/trigger/PreviewCardTrigger.js +49 -13
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +22 -0
- package/esm/preview-card/viewport/PreviewCardViewport.js +272 -0
- package/esm/preview-card/viewport/PreviewCardViewportCssVars.d.ts +14 -0
- package/esm/preview-card/viewport/PreviewCardViewportCssVars.js +15 -0
- package/esm/preview-card/viewport/PreviewCardViewportDataAttributes.d.ts +26 -0
- package/esm/preview-card/viewport/PreviewCardViewportDataAttributes.js +27 -0
- package/esm/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/esm/progress/label/ProgressLabel.d.ts +1 -1
- package/esm/progress/root/ProgressRoot.d.ts +1 -1
- package/esm/progress/track/ProgressTrack.d.ts +1 -1
- package/esm/progress/value/ProgressValue.d.ts +1 -1
- package/esm/radio/indicator/RadioIndicator.d.ts +1 -1
- package/esm/radio/root/RadioRoot.d.ts +1 -1
- package/esm/radio/root/RadioRoot.js +9 -9
- package/esm/radio-group/RadioGroup.d.ts +4 -4
- package/esm/radio-group/RadioGroup.js +2 -2
- package/esm/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/esm/scroll-area/content/ScrollAreaContent.js +10 -1
- package/esm/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/esm/scroll-area/corner/ScrollAreaCorner.js +1 -1
- package/esm/scroll-area/root/ScrollAreaRoot.d.ts +26 -2
- package/esm/scroll-area/root/ScrollAreaRoot.js +33 -29
- package/esm/scroll-area/root/ScrollAreaRootContext.d.ts +10 -43
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -4
- package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +2 -2
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +1 -1
- package/esm/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +51 -25
- package/esm/select/arrow/SelectArrow.d.ts +1 -1
- package/esm/select/backdrop/SelectBackdrop.d.ts +1 -1
- package/esm/select/group/SelectGroup.d.ts +1 -1
- package/esm/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/esm/select/icon/SelectIcon.d.ts +1 -1
- package/esm/select/item/SelectItem.d.ts +1 -1
- package/esm/select/item/SelectItem.js +0 -1
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/esm/select/item-text/SelectItemText.d.ts +1 -1
- package/esm/select/list/SelectList.d.ts +1 -1
- package/esm/select/popup/SelectPopup.d.ts +1 -1
- package/esm/select/popup/SelectPopup.js +154 -95
- package/esm/select/portal/SelectPortal.d.ts +1 -1
- package/esm/select/positioner/SelectPositioner.d.ts +1 -1
- package/esm/select/root/SelectRoot.d.ts +2 -2
- package/esm/select/root/SelectRoot.js +26 -13
- package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/esm/select/store.d.ts +2 -1
- package/esm/select/store.js +19 -13
- package/esm/select/trigger/SelectTrigger.d.ts +14 -4
- package/esm/select/trigger/SelectTrigger.js +50 -18
- package/esm/select/value/SelectValue.d.ts +6 -1
- package/esm/select/value/SelectValue.js +19 -5
- package/esm/separator/Separator.d.ts +1 -1
- package/esm/slider/control/SliderControl.d.ts +1 -1
- package/esm/slider/control/SliderControl.js +1 -1
- package/esm/slider/control/SliderControlDataAttributes.d.ts +0 -8
- package/esm/slider/control/SliderControlDataAttributes.js +0 -8
- package/esm/slider/indicator/SliderIndicator.d.ts +1 -1
- package/esm/slider/indicator/SliderIndicatorDataAttributes.d.ts +0 -8
- package/esm/slider/indicator/SliderIndicatorDataAttributes.js +0 -8
- package/esm/slider/root/SliderRootDataAttributes.d.ts +0 -8
- package/esm/slider/root/SliderRootDataAttributes.js +0 -8
- package/esm/slider/thumb/SliderThumb.d.ts +2 -2
- package/esm/slider/thumb/SliderThumb.js +7 -1
- package/esm/slider/thumb/SliderThumbDataAttributes.d.ts +0 -8
- package/esm/slider/thumb/SliderThumbDataAttributes.js +0 -8
- package/esm/slider/track/SliderTrack.d.ts +1 -1
- package/esm/slider/track/SliderTrackDataAttributes.d.ts +0 -8
- package/esm/slider/track/SliderTrackDataAttributes.js +0 -8
- package/esm/slider/value/SliderValue.d.ts +1 -1
- package/esm/slider/value/SliderValueDataAttributes.d.ts +0 -8
- package/esm/slider/value/SliderValueDataAttributes.js +0 -8
- package/esm/switch/root/SwitchRoot.d.ts +6 -1
- package/esm/switch/root/SwitchRoot.js +15 -6
- package/esm/switch/thumb/SwitchThumb.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.js +6 -0
- package/esm/tabs/list/TabsList.d.ts +1 -1
- package/esm/tabs/panel/TabsPanel.d.ts +1 -1
- package/esm/tabs/root/TabsRoot.d.ts +1 -1
- package/esm/tabs/tab/TabsTab.d.ts +1 -1
- package/esm/toast/action/ToastAction.d.ts +1 -1
- package/esm/toast/arrow/ToastArrow.d.ts +1 -1
- package/esm/toast/close/ToastClose.d.ts +1 -1
- package/esm/toast/content/ToastContent.d.ts +1 -1
- package/esm/toast/description/ToastDescription.d.ts +1 -1
- package/esm/toast/portal/ToastPortal.d.ts +1 -1
- package/esm/toast/positioner/ToastPositioner.d.ts +1 -1
- package/esm/toast/provider/ToastProvider.js +46 -19
- package/esm/toast/root/ToastRoot.d.ts +1 -1
- package/esm/toast/title/ToastTitle.d.ts +1 -1
- package/esm/toast/viewport/ToastViewport.d.ts +1 -1
- package/esm/toggle/Toggle.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toolbar/button/ToolbarButton.d.ts +1 -1
- package/esm/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/esm/toolbar/input/ToolbarInput.d.ts +1 -1
- package/esm/toolbar/link/ToolbarLink.d.ts +1 -1
- package/esm/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/esm/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/esm/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/esm/tooltip/popup/TooltipPopup.d.ts +1 -1
- package/esm/tooltip/popup/TooltipPopup.js +0 -31
- package/esm/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositioner.js +2 -1
- package/esm/tooltip/root/TooltipRoot.d.ts +4 -6
- package/esm/tooltip/root/TooltipRoot.js +1 -2
- package/esm/tooltip/store/TooltipStore.d.ts +4 -2
- package/esm/tooltip/store/TooltipStore.js +7 -4
- package/esm/tooltip/trigger/TooltipTrigger.js +1 -1
- package/esm/tooltip/viewport/TooltipViewport.d.ts +1 -1
- package/esm/tooltip/viewport/TooltipViewport.js +28 -12
- package/esm/use-render/index.d.ts +2 -1
- package/esm/use-render/index.js +2 -1
- package/esm/utils/FloatingPortalLite.d.ts +1 -1
- package/esm/utils/popups/popupStoreUtils.js +21 -2
- package/esm/utils/resolveValueLabel.d.ts +5 -1
- package/esm/utils/resolveValueLabel.js +46 -22
- package/esm/utils/styles.d.ts +1 -1
- package/esm/utils/styles.js +10 -6
- package/esm/utils/types.d.ts +1 -1
- package/esm/utils/useAnimationsFinished.d.ts +2 -2
- package/esm/utils/useAnimationsFinished.js +56 -33
- package/esm/utils/useOpenChangeComplete.js +8 -10
- package/esm/utils/useOpenInteractionType.js +6 -1
- package/esm/utils/usePopupAutoResize.js +82 -46
- package/field/control/FieldControl.d.ts +1 -1
- package/field/description/FieldDescription.d.ts +1 -1
- package/field/error/FieldError.d.ts +1 -1
- package/field/index.d.ts +2 -1
- package/field/item/FieldItem.d.ts +1 -1
- package/field/label/FieldLabel.d.ts +11 -2
- package/field/label/FieldLabel.js +51 -11
- package/field/root/FieldRoot.d.ts +10 -1
- package/field/root/FieldRoot.js +8 -0
- package/field/useField.js +7 -3
- package/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/floating-ui-react/components/FloatingFocusManager.js +7 -6
- package/floating-ui-react/components/FloatingPortal.d.ts +2 -2
- package/floating-ui-react/components/FloatingPortal.js +11 -2
- package/floating-ui-react/hooks/useClientPoint.js +5 -4
- package/floating-ui-react/hooks/useDismiss.js +16 -3
- package/floating-ui-react/hooks/useFocus.d.ts +5 -0
- package/floating-ui-react/hooks/useFocus.js +43 -9
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +17 -4
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -0
- package/form/Form.d.ts +18 -1
- package/form/Form.js +17 -0
- package/form/FormContext.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/input/Input.d.ts +1 -1
- package/menu/arrow/MenuArrow.d.ts +1 -1
- package/menu/backdrop/MenuBackdrop.d.ts +1 -1
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +1 -1
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +1 -1
- package/menu/group/MenuGroup.d.ts +1 -1
- package/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/menu/item/MenuItem.d.ts +1 -1
- package/menu/popup/MenuPopup.d.ts +1 -1
- package/menu/popup/MenuPopup.js +4 -3
- package/menu/portal/MenuPortal.d.ts +1 -1
- package/menu/positioner/MenuPositioner.d.ts +1 -1
- package/menu/radio-group/MenuRadioGroup.d.ts +1 -1
- package/menu/radio-item/MenuRadioItem.d.ts +1 -1
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +1 -1
- package/menu/root/MenuRoot.d.ts +7 -6
- package/menu/root/MenuRoot.js +4 -2
- package/menu/store/MenuStore.js +3 -3
- package/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +1 -1
- package/menu/trigger/MenuTrigger.js +14 -14
- package/menubar/Menubar.d.ts +1 -1
- package/merge-props/mergeProps.d.ts +31 -11
- package/merge-props/mergeProps.js +29 -8
- package/meter/indicator/MeterIndicator.d.ts +1 -1
- package/meter/label/MeterLabel.d.ts +1 -1
- package/meter/root/MeterRoot.d.ts +1 -1
- package/meter/track/MeterTrack.d.ts +1 -1
- package/meter/value/MeterValue.d.ts +1 -1
- package/navigation-menu/arrow/NavigationMenuArrow.d.ts +1 -1
- package/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.js +6 -0
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +1 -1
- package/navigation-menu/positioner/NavigationMenuPositioner.d.ts +1 -1
- package/navigation-menu/root/NavigationMenuRoot.d.ts +2 -2
- package/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/number-field/decrement/NumberFieldDecrement.d.ts +1 -1
- package/number-field/decrement/NumberFieldDecrement.js +4 -6
- package/number-field/group/NumberFieldGroup.d.ts +1 -1
- package/number-field/increment/NumberFieldIncrement.d.ts +1 -1
- package/number-field/increment/NumberFieldIncrement.js +4 -6
- package/number-field/input/NumberFieldInput.d.ts +1 -1
- package/number-field/input/NumberFieldInput.js +5 -2
- package/number-field/root/NumberFieldRoot.d.ts +5 -4
- package/number-field/root/NumberFieldRoot.js +11 -4
- package/number-field/root/useNumberFieldButton.d.ts +0 -3
- package/number-field/root/useNumberFieldButton.js +5 -11
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +1 -1
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +1 -1
- package/package.json +13 -3
- package/popover/arrow/PopoverArrow.d.ts +1 -1
- package/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/popover/close/PopoverClose.d.ts +1 -1
- package/popover/description/PopoverDescription.d.ts +1 -1
- package/popover/popup/PopoverPopup.d.ts +1 -1
- package/popover/popup/PopoverPopup.js +0 -30
- package/popover/portal/PopoverPortal.d.ts +1 -1
- package/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/popover/positioner/PopoverPositioner.js +2 -1
- package/popover/root/PopoverRoot.d.ts +2 -2
- package/popover/store/PopoverStore.d.ts +4 -2
- package/popover/store/PopoverStore.js +8 -5
- package/popover/title/PopoverTitle.d.ts +1 -1
- package/popover/trigger/PopoverTrigger.js +2 -2
- package/popover/viewport/PopoverViewport.d.ts +1 -1
- package/popover/viewport/PopoverViewport.js +28 -12
- package/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/preview-card/arrow/PreviewCardArrow.js +2 -3
- package/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/preview-card/backdrop/PreviewCardBackdrop.js +4 -5
- package/preview-card/index.parts.d.ts +3 -1
- package/preview-card/index.parts.js +21 -1
- package/preview-card/popup/PreviewCardPopup.d.ts +2 -1
- package/preview-card/popup/PreviewCardPopup.js +17 -11
- package/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/preview-card/portal/PreviewCardPortal.js +2 -3
- package/preview-card/positioner/PreviewCardPositioner.d.ts +2 -1
- package/preview-card/positioner/PreviewCardPositioner.js +16 -11
- package/preview-card/root/PreviewCardContext.d.ts +5 -26
- package/preview-card/root/PreviewCardContext.js +2 -2
- package/preview-card/root/PreviewCardRoot.d.ts +35 -10
- package/preview-card/root/PreviewCardRoot.js +59 -113
- package/preview-card/store/PreviewCardHandle.d.ts +33 -0
- package/preview-card/store/PreviewCardHandle.js +63 -0
- package/preview-card/store/PreviewCardStore.d.ts +36 -0
- package/preview-card/store/PreviewCardStore.js +105 -0
- package/preview-card/trigger/PreviewCardTrigger.d.ts +15 -3
- package/preview-card/trigger/PreviewCardTrigger.js +50 -13
- package/preview-card/viewport/PreviewCardViewport.d.ts +22 -0
- package/preview-card/viewport/PreviewCardViewport.js +278 -0
- package/preview-card/viewport/PreviewCardViewportCssVars.d.ts +14 -0
- package/preview-card/viewport/PreviewCardViewportCssVars.js +21 -0
- package/preview-card/viewport/PreviewCardViewportDataAttributes.d.ts +26 -0
- package/preview-card/viewport/PreviewCardViewportDataAttributes.js +33 -0
- package/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/progress/label/ProgressLabel.d.ts +1 -1
- package/progress/root/ProgressRoot.d.ts +1 -1
- package/progress/track/ProgressTrack.d.ts +1 -1
- package/progress/value/ProgressValue.d.ts +1 -1
- package/radio/indicator/RadioIndicator.d.ts +1 -1
- package/radio/root/RadioRoot.d.ts +1 -1
- package/radio/root/RadioRoot.js +8 -8
- package/radio-group/RadioGroup.d.ts +4 -4
- package/radio-group/RadioGroup.js +1 -1
- package/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/scroll-area/content/ScrollAreaContent.js +10 -1
- package/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/scroll-area/corner/ScrollAreaCorner.js +1 -1
- package/scroll-area/root/ScrollAreaRoot.d.ts +26 -2
- package/scroll-area/root/ScrollAreaRoot.js +33 -29
- package/scroll-area/root/ScrollAreaRootContext.d.ts +10 -43
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -4
- package/scroll-area/thumb/ScrollAreaThumb.d.ts +2 -2
- package/scroll-area/thumb/ScrollAreaThumb.js +1 -1
- package/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/scroll-area/viewport/ScrollAreaViewport.js +51 -25
- package/select/arrow/SelectArrow.d.ts +1 -1
- package/select/backdrop/SelectBackdrop.d.ts +1 -1
- package/select/group/SelectGroup.d.ts +1 -1
- package/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/select/icon/SelectIcon.d.ts +1 -1
- package/select/item/SelectItem.d.ts +1 -1
- package/select/item/SelectItem.js +0 -1
- package/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/select/item-text/SelectItemText.d.ts +1 -1
- package/select/list/SelectList.d.ts +1 -1
- package/select/popup/SelectPopup.d.ts +1 -1
- package/select/popup/SelectPopup.js +154 -95
- package/select/portal/SelectPortal.d.ts +1 -1
- package/select/positioner/SelectPositioner.d.ts +1 -1
- package/select/root/SelectRoot.d.ts +2 -2
- package/select/root/SelectRoot.js +24 -11
- package/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/select/store.d.ts +2 -1
- package/select/store.js +18 -12
- package/select/trigger/SelectTrigger.d.ts +14 -4
- package/select/trigger/SelectTrigger.js +50 -18
- package/select/value/SelectValue.d.ts +6 -1
- package/select/value/SelectValue.js +18 -4
- package/separator/Separator.d.ts +1 -1
- package/slider/control/SliderControl.d.ts +1 -1
- package/slider/control/SliderControl.js +1 -1
- package/slider/control/SliderControlDataAttributes.d.ts +0 -8
- package/slider/control/SliderControlDataAttributes.js +0 -8
- package/slider/indicator/SliderIndicator.d.ts +1 -1
- package/slider/indicator/SliderIndicatorDataAttributes.d.ts +0 -8
- package/slider/indicator/SliderIndicatorDataAttributes.js +0 -8
- package/slider/root/SliderRootDataAttributes.d.ts +0 -8
- package/slider/root/SliderRootDataAttributes.js +0 -8
- package/slider/thumb/SliderThumb.d.ts +2 -2
- package/slider/thumb/SliderThumb.js +7 -1
- package/slider/thumb/SliderThumbDataAttributes.d.ts +0 -8
- package/slider/thumb/SliderThumbDataAttributes.js +0 -8
- package/slider/track/SliderTrack.d.ts +1 -1
- package/slider/track/SliderTrackDataAttributes.d.ts +0 -8
- package/slider/track/SliderTrackDataAttributes.js +0 -8
- package/slider/value/SliderValue.d.ts +1 -1
- package/slider/value/SliderValueDataAttributes.d.ts +0 -8
- package/slider/value/SliderValueDataAttributes.js +0 -8
- package/switch/root/SwitchRoot.d.ts +6 -1
- package/switch/root/SwitchRoot.js +14 -5
- package/switch/thumb/SwitchThumb.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.js +6 -0
- package/tabs/list/TabsList.d.ts +1 -1
- package/tabs/panel/TabsPanel.d.ts +1 -1
- package/tabs/root/TabsRoot.d.ts +1 -1
- package/tabs/tab/TabsTab.d.ts +1 -1
- package/toast/action/ToastAction.d.ts +1 -1
- package/toast/arrow/ToastArrow.d.ts +1 -1
- package/toast/close/ToastClose.d.ts +1 -1
- package/toast/content/ToastContent.d.ts +1 -1
- package/toast/description/ToastDescription.d.ts +1 -1
- package/toast/portal/ToastPortal.d.ts +1 -1
- package/toast/positioner/ToastPositioner.d.ts +1 -1
- package/toast/provider/ToastProvider.js +46 -19
- package/toast/root/ToastRoot.d.ts +1 -1
- package/toast/title/ToastTitle.d.ts +1 -1
- package/toast/viewport/ToastViewport.d.ts +1 -1
- package/toggle/Toggle.d.ts +1 -1
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toolbar/button/ToolbarButton.d.ts +1 -1
- package/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/toolbar/input/ToolbarInput.d.ts +1 -1
- package/toolbar/link/ToolbarLink.d.ts +1 -1
- package/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/tooltip/popup/TooltipPopup.d.ts +1 -1
- package/tooltip/popup/TooltipPopup.js +0 -31
- package/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/tooltip/positioner/TooltipPositioner.js +2 -1
- package/tooltip/root/TooltipRoot.d.ts +4 -6
- package/tooltip/root/TooltipRoot.js +1 -2
- package/tooltip/store/TooltipStore.d.ts +4 -2
- package/tooltip/store/TooltipStore.js +7 -4
- package/tooltip/trigger/TooltipTrigger.js +1 -1
- package/tooltip/viewport/TooltipViewport.d.ts +1 -1
- package/tooltip/viewport/TooltipViewport.js +28 -12
- package/use-render/index.d.ts +2 -1
- package/utils/FloatingPortalLite.d.ts +1 -1
- package/utils/popups/popupStoreUtils.js +21 -2
- package/utils/resolveValueLabel.d.ts +5 -1
- package/utils/resolveValueLabel.js +48 -22
- package/utils/styles.d.ts +1 -1
- package/utils/styles.js +10 -6
- package/utils/types.d.ts +1 -1
- package/utils/useAnimationsFinished.d.ts +2 -2
- package/utils/useAnimationsFinished.js +56 -33
- package/utils/useOpenChangeComplete.js +8 -10
- package/utils/useOpenInteractionType.js +6 -1
- package/utils/usePopupAutoResize.js +82 -46
- package/esm/utils/interactions/useFocusWithDelay.d.ts +0 -9
- package/esm/utils/interactions/useFocusWithDelay.js +0 -81
- package/utils/interactions/useFocusWithDelay.d.ts +0 -9
- package/utils/interactions/useFocusWithDelay.js +0 -87
- /package/esm/utils/{useMixedToggleClickHander.d.ts → useMixedToggleClickHandler.d.ts} +0 -0
- /package/esm/utils/{useMixedToggleClickHander.js → useMixedToggleClickHandler.js} +0 -0
- /package/utils/{useMixedToggleClickHander.d.ts → useMixedToggleClickHandler.d.ts} +0 -0
- /package/utils/{useMixedToggleClickHander.js → useMixedToggleClickHandler.js} +0 -0
|
@@ -46,6 +46,7 @@ const ComboboxClear = exports.ComboboxClear = /*#__PURE__*/React.forwardRef(func
|
|
|
46
46
|
const readOnly = (0, _store.useStore)(store, _store2.selectors.readOnly);
|
|
47
47
|
const open = (0, _store.useStore)(store, _store2.selectors.open);
|
|
48
48
|
const selectedValue = (0, _store.useStore)(store, _store2.selectors.selectedValue);
|
|
49
|
+
const hasSelectionChips = (0, _store.useStore)(store, _store2.selectors.hasSelectionChips);
|
|
49
50
|
const inputValue = (0, _ComboboxRootContext.useComboboxInputValueContext)();
|
|
50
51
|
let visible = false;
|
|
51
52
|
if (selectionMode === 'none') {
|
|
@@ -53,7 +54,7 @@ const ComboboxClear = exports.ComboboxClear = /*#__PURE__*/React.forwardRef(func
|
|
|
53
54
|
} else if (selectionMode === 'single') {
|
|
54
55
|
visible = selectedValue != null;
|
|
55
56
|
} else {
|
|
56
|
-
visible =
|
|
57
|
+
visible = hasSelectionChips;
|
|
57
58
|
}
|
|
58
59
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
59
60
|
const {
|
|
@@ -88,7 +89,6 @@ const ComboboxClear = exports.ComboboxClear = /*#__PURE__*/React.forwardRef(func
|
|
|
88
89
|
props: [{
|
|
89
90
|
tabIndex: -1,
|
|
90
91
|
children: 'x',
|
|
91
|
-
disabled,
|
|
92
92
|
'aria-readonly': readOnly || undefined,
|
|
93
93
|
// Avoid stealing focus from the input.
|
|
94
94
|
onMouseDown(event) {
|
|
@@ -6,7 +6,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
6
6
|
* Announces changes politely to screen readers.
|
|
7
7
|
* Renders a `<div>` element.
|
|
8
8
|
*/
|
|
9
|
-
export declare const ComboboxEmpty: React.ForwardRefExoticComponent<ComboboxEmptyProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const ComboboxEmpty: React.ForwardRefExoticComponent<Omit<ComboboxEmptyProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export interface ComboboxEmptyState {}
|
|
11
11
|
export interface ComboboxEmptyProps extends BaseUIComponentProps<'div', ComboboxEmpty.State> {}
|
|
12
12
|
export declare namespace ComboboxEmpty {
|
|
@@ -4,7 +4,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
4
4
|
* Groups related items with the corresponding label.
|
|
5
5
|
* Renders a `<div>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxGroup: React.ForwardRefExoticComponent<ComboboxGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxGroup: React.ForwardRefExoticComponent<Omit<ComboboxGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxGroupState {}
|
|
9
9
|
export interface ComboboxGroupProps extends BaseUIComponentProps<'div', ComboboxGroup.State> {
|
|
10
10
|
/**
|
|
@@ -4,7 +4,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
4
4
|
* An accessible label that is automatically associated with its parent group.
|
|
5
5
|
* Renders a `<div>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxGroupLabel: React.ForwardRefExoticComponent<ComboboxGroupLabelProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxGroupLabel: React.ForwardRefExoticComponent<Omit<ComboboxGroupLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxGroupLabelState {}
|
|
9
9
|
export interface ComboboxGroupLabelProps extends BaseUIComponentProps<'div', ComboboxGroupLabel.State> {}
|
|
10
10
|
export declare namespace ComboboxGroupLabel {
|
|
@@ -4,7 +4,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
4
4
|
* An icon that indicates that the trigger button opens the popup.
|
|
5
5
|
* Renders a `<span>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxIcon: React.ForwardRefExoticComponent<ComboboxIconProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxIcon: React.ForwardRefExoticComponent<Omit<ComboboxIconProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxIconState {}
|
|
9
9
|
export interface ComboboxIconProps extends BaseUIComponentProps<'span', ComboboxIcon.State> {}
|
|
10
10
|
export declare namespace ComboboxIcon {
|
|
@@ -6,7 +6,7 @@ import type { Side } from "../../utils/useAnchorPositioning.js";
|
|
|
6
6
|
* A text input to search for items in the list.
|
|
7
7
|
* Renders an `<input>` element.
|
|
8
8
|
*/
|
|
9
|
-
export declare const ComboboxInput: React.ForwardRefExoticComponent<ComboboxInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export declare const ComboboxInput: React.ForwardRefExoticComponent<Omit<ComboboxInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
10
10
|
export interface ComboboxInputState extends FieldRoot.State {
|
|
11
11
|
/**
|
|
12
12
|
* Whether the corresponding popup is open.
|
|
@@ -13,10 +13,9 @@ var _detectBrowser = require("@base-ui/utils/detectBrowser");
|
|
|
13
13
|
var _useBaseUiId = require("../../utils/useBaseUiId");
|
|
14
14
|
var _useRenderElement = require("../../utils/useRenderElement");
|
|
15
15
|
var _ComboboxRootContext = require("../root/ComboboxRootContext");
|
|
16
|
+
var _stateAttributesMapping = require("../utils/stateAttributesMapping");
|
|
16
17
|
var _store2 = require("../store");
|
|
17
|
-
var _popupStateMapping = require("../../utils/popupStateMapping");
|
|
18
18
|
var _FieldRootContext = require("../../field/root/FieldRootContext");
|
|
19
|
-
var _constants = require("../../field/utils/constants");
|
|
20
19
|
var _LabelableContext = require("../../labelable-provider/LabelableContext");
|
|
21
20
|
var _ComboboxChipsContext = require("../chips/ComboboxChipsContext");
|
|
22
21
|
var _utils = require("../../floating-ui-react/utils");
|
|
@@ -24,17 +23,6 @@ var _ComboboxPositionerContext = require("../positioner/ComboboxPositionerContex
|
|
|
24
23
|
var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
|
|
25
24
|
var _reasons = require("../../utils/reasons");
|
|
26
25
|
var _DirectionContext = require("../../direction-provider/DirectionContext");
|
|
27
|
-
const stateAttributesMapping = {
|
|
28
|
-
..._popupStateMapping.pressableTriggerOpenStateMapping,
|
|
29
|
-
..._constants.fieldValidityMapping,
|
|
30
|
-
popupSide: side => side ? {
|
|
31
|
-
'data-popup-side': side
|
|
32
|
-
} : null,
|
|
33
|
-
listEmpty: empty => empty ? {
|
|
34
|
-
'data-list-empty': ''
|
|
35
|
-
} : null
|
|
36
|
-
};
|
|
37
|
-
|
|
38
26
|
/**
|
|
39
27
|
* A text input to search for items in the list.
|
|
40
28
|
* Renders an `<input>` element.
|
|
@@ -68,7 +56,7 @@ const ComboboxInput = exports.ComboboxInput = /*#__PURE__*/React.forwardRef(func
|
|
|
68
56
|
// `inputValue` can't be placed in the store.
|
|
69
57
|
// https://github.com/mui/base-ui/issues/2703
|
|
70
58
|
const inputValue = (0, _ComboboxRootContext.useComboboxInputValueContext)();
|
|
71
|
-
const
|
|
59
|
+
const required = (0, _store.useStore)(store, _store2.selectors.required);
|
|
72
60
|
const direction = (0, _DirectionContext.useDirection)();
|
|
73
61
|
const comboboxDisabled = (0, _store.useStore)(store, _store2.selectors.disabled);
|
|
74
62
|
const readOnly = (0, _store.useStore)(store, _store2.selectors.readOnly);
|
|
@@ -82,20 +70,24 @@ const ComboboxInput = exports.ComboboxInput = /*#__PURE__*/React.forwardRef(func
|
|
|
82
70
|
const selectedValue = (0, _store.useStore)(store, _store2.selectors.selectedValue);
|
|
83
71
|
const popupSideValue = (0, _store.useStore)(store, _store2.selectors.popupSide);
|
|
84
72
|
const positionerElement = (0, _store.useStore)(store, _store2.selectors.positionerElement);
|
|
73
|
+
const rootId = (0, _store.useStore)(store, _store2.selectors.id);
|
|
74
|
+
const inline = (0, _store.useStore)(store, _store2.selectors.inline);
|
|
85
75
|
const autoHighlightEnabled = Boolean(autoHighlightMode);
|
|
86
76
|
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
87
77
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
88
78
|
const listEmpty = filteredItems.length === 0;
|
|
79
|
+
const isInsidePopup = hasPositionerParent || inline;
|
|
80
|
+
const id = (0, _useBaseUiId.useBaseUiId)(idProp ?? (!isInsidePopup ? rootId : undefined));
|
|
89
81
|
const [composingValue, setComposingValue] = React.useState(null);
|
|
90
82
|
const isComposingRef = React.useRef(false);
|
|
91
83
|
const setInputElement = (0, _useStableCallback.useStableCallback)(element => {
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
84
|
+
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
|
|
85
|
+
if (nextIsInsidePopup && !store.state.hasInputValue) {
|
|
94
86
|
store.state.setInputValue('', (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.none));
|
|
95
87
|
}
|
|
96
88
|
store.update({
|
|
97
89
|
inputElement: element,
|
|
98
|
-
inputInsidePopup:
|
|
90
|
+
inputInsidePopup: nextIsInsidePopup
|
|
99
91
|
});
|
|
100
92
|
});
|
|
101
93
|
const state = React.useMemo(() => ({
|
|
@@ -166,9 +158,11 @@ const ComboboxInput = exports.ComboboxInput = /*#__PURE__*/React.forwardRef(func
|
|
|
166
158
|
type: 'text',
|
|
167
159
|
value: componentProps.value ?? composingValue ?? inputValue,
|
|
168
160
|
'aria-readonly': readOnly || undefined,
|
|
161
|
+
'aria-required': required || undefined,
|
|
169
162
|
'aria-labelledby': labelId,
|
|
170
163
|
disabled,
|
|
171
164
|
readOnly,
|
|
165
|
+
required: selectionMode === 'none' ? required : undefined,
|
|
172
166
|
...(selectionMode === 'none' && name && {
|
|
173
167
|
name
|
|
174
168
|
}),
|
|
@@ -355,7 +349,7 @@ const ComboboxInput = exports.ComboboxInput = /*#__PURE__*/React.forwardRef(func
|
|
|
355
349
|
store.state.keyboardActiveRef.current = false;
|
|
356
350
|
}
|
|
357
351
|
}, validation ? validation.getValidationProps(elementProps) : elementProps],
|
|
358
|
-
stateAttributesMapping
|
|
352
|
+
stateAttributesMapping: _stateAttributesMapping.triggerStateAttributesMapping
|
|
359
353
|
});
|
|
360
354
|
return element;
|
|
361
355
|
});
|
|
@@ -4,7 +4,7 @@ import type { BaseUIComponentProps, NonNativeButtonProps } from "../../utils/typ
|
|
|
4
4
|
* An individual item in the list.
|
|
5
5
|
* Renders a `<div>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxItem: React.NamedExoticComponent<ComboboxItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxItem: React.NamedExoticComponent<Omit<ComboboxItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxItemState {
|
|
9
9
|
/**
|
|
10
10
|
* Whether the item should ignore user interaction.
|
|
@@ -136,7 +136,6 @@ const ComboboxItem = exports.ComboboxItem = /*#__PURE__*/React.memo(/*#__PURE__*
|
|
|
136
136
|
const defaultProps = {
|
|
137
137
|
id,
|
|
138
138
|
role: isRow ? 'gridcell' : 'option',
|
|
139
|
-
'aria-disabled': disabled || undefined,
|
|
140
139
|
'aria-selected': selectable ? selected : undefined,
|
|
141
140
|
// Focusable items steal focus from the input upon mouseup.
|
|
142
141
|
// Warn if the user renders a natively focusable element like `<button>`,
|
|
@@ -5,7 +5,7 @@ import { type TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
5
5
|
* Indicates whether the item is selected.
|
|
6
6
|
* Renders a `<span>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxItemIndicator: React.ForwardRefExoticComponent<ComboboxItemIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export declare const ComboboxItemIndicator: React.ForwardRefExoticComponent<Omit<ComboboxItemIndicatorProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
9
9
|
export interface ComboboxItemIndicatorProps extends BaseUIComponentProps<'span', ComboboxItemIndicator.State> {
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
/**
|
|
@@ -4,7 +4,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
4
4
|
* A list container for the items.
|
|
5
5
|
* Renders a `<div>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxList: React.ForwardRefExoticComponent<ComboboxListProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxList: React.ForwardRefExoticComponent<Omit<ComboboxListProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxListState {
|
|
9
9
|
/**
|
|
10
10
|
* Whether the list is empty.
|
|
@@ -7,7 +7,7 @@ import type { TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
7
7
|
* A container for the list.
|
|
8
8
|
* Renders a `<div>` element.
|
|
9
9
|
*/
|
|
10
|
-
export declare const ComboboxPopup: React.ForwardRefExoticComponent<ComboboxPopupProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const ComboboxPopup: React.ForwardRefExoticComponent<Omit<ComboboxPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export interface ComboboxPopupState {
|
|
12
12
|
open: boolean;
|
|
13
13
|
side: Side;
|
|
@@ -48,6 +48,7 @@ const ComboboxPopup = exports.ComboboxPopup = /*#__PURE__*/React.forwardRef(func
|
|
|
48
48
|
const transitionStatus = (0, _store.useStore)(store, _store2.selectors.transitionStatus);
|
|
49
49
|
const inputInsidePopup = (0, _store.useStore)(store, _store2.selectors.inputInsidePopup);
|
|
50
50
|
const inputElement = (0, _store.useStore)(store, _store2.selectors.inputElement);
|
|
51
|
+
const modal = (0, _store.useStore)(store, _store2.selectors.modal);
|
|
51
52
|
const empty = filteredItems.length === 0;
|
|
52
53
|
(0, _useOpenChangeComplete.useOpenChangeComplete)({
|
|
53
54
|
open,
|
|
@@ -96,7 +97,7 @@ const ComboboxPopup = exports.ComboboxPopup = /*#__PURE__*/React.forwardRef(func
|
|
|
96
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_floatingUiReact.FloatingFocusManager, {
|
|
97
98
|
context: floatingRootContext,
|
|
98
99
|
disabled: !mounted,
|
|
99
|
-
modal:
|
|
100
|
+
modal: inputInsidePopup ? modal : false,
|
|
100
101
|
openInteractionType: openMethod,
|
|
101
102
|
initialFocus: resolvedInitialFocus,
|
|
102
103
|
returnFocus: resolvedFinalFocus,
|
|
@@ -5,7 +5,7 @@ import { FloatingPortal } from "../../floating-ui-react/index.js";
|
|
|
5
5
|
* By default, the portal element is appended to `<body>`.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxPortal: React.ForwardRefExoticComponent<ComboboxPortalProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxPortal: React.ForwardRefExoticComponent<Omit<ComboboxPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export declare namespace ComboboxPortal {
|
|
10
10
|
interface State {}
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
5
5
|
* Positions the popup against the trigger.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxPositioner: React.ForwardRefExoticComponent<ComboboxPositionerProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxPositioner: React.ForwardRefExoticComponent<Omit<ComboboxPositionerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export interface ComboboxPositionerState {
|
|
10
10
|
/**
|
|
11
11
|
* Whether the popup is currently open.
|
|
@@ -81,6 +81,13 @@ interface ComboboxRootProps<ItemValue> {
|
|
|
81
81
|
* @default true
|
|
82
82
|
*/
|
|
83
83
|
highlightItemOnHover?: boolean;
|
|
84
|
+
/**
|
|
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
|
+
* The input is always included in the focus loop per [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).
|
|
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
|
+
* @default true
|
|
89
|
+
*/
|
|
90
|
+
loopFocus?: boolean;
|
|
84
91
|
/**
|
|
85
92
|
* The input value of the combobox. Use when controlled.
|
|
86
93
|
*/
|
|
@@ -101,7 +108,7 @@ interface ComboboxRootProps<ItemValue> {
|
|
|
101
108
|
* Instead, the `unmount` function must be called to unmount the combobox manually.
|
|
102
109
|
* Useful when the combobox's animation is controlled by an external library.
|
|
103
110
|
*/
|
|
104
|
-
actionsRef?: React.RefObject<AriaCombobox.Actions>;
|
|
111
|
+
actionsRef?: React.RefObject<AriaCombobox.Actions | null>;
|
|
105
112
|
/**
|
|
106
113
|
* Callback fired when an item is highlighted or unhighlighted.
|
|
107
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.
|
|
@@ -66,6 +66,7 @@ function AriaCombobox(props) {
|
|
|
66
66
|
autoHighlight = false,
|
|
67
67
|
keepHighlight = false,
|
|
68
68
|
highlightItemOnHover = true,
|
|
69
|
+
loopFocus = true,
|
|
69
70
|
itemToStringLabel,
|
|
70
71
|
itemToStringValue,
|
|
71
72
|
isItemEqualToValue = _itemEquality.defaultItemEquality,
|
|
@@ -88,6 +89,9 @@ function AriaCombobox(props) {
|
|
|
88
89
|
setFilled,
|
|
89
90
|
name: fieldName,
|
|
90
91
|
disabled: fieldDisabled,
|
|
92
|
+
setTouched,
|
|
93
|
+
setFocused,
|
|
94
|
+
validationMode,
|
|
91
95
|
validation
|
|
92
96
|
} = (0, _FieldRootContext.useFieldRootContext)();
|
|
93
97
|
const id = (0, _useLabelableId.useLabelableId)({
|
|
@@ -453,6 +457,14 @@ function AriaCombobox(props) {
|
|
|
453
457
|
}
|
|
454
458
|
}
|
|
455
459
|
setOpenUnwrapped(nextOpen);
|
|
460
|
+
if (!nextOpen && inputInsidePopup && (eventDetails.reason === _reasons.REASONS.focusOut || eventDetails.reason === _reasons.REASONS.outsidePress)) {
|
|
461
|
+
setTouched(true);
|
|
462
|
+
setFocused(false);
|
|
463
|
+
if (validationMode === 'onBlur') {
|
|
464
|
+
const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;
|
|
465
|
+
validation.commit(valueToValidate);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
456
468
|
});
|
|
457
469
|
const setSelectedValue = (0, _useStableCallback.useStableCallback)((nextValue, eventDetails) => {
|
|
458
470
|
// Cast to `any` due to conditional value type (single vs. multiple).
|
|
@@ -679,11 +691,11 @@ function AriaCombobox(props) {
|
|
|
679
691
|
const current = Array.isArray(selectedValue) ? selectedValue : _constants.EMPTY_ARRAY;
|
|
680
692
|
const next = current.filter(v => (0, _itemEquality.itemIncludes)(registry, v, store.state.isItemEqualToValue));
|
|
681
693
|
if (next.length !== current.length) {
|
|
682
|
-
|
|
694
|
+
setSelectedValue(next, (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.none));
|
|
683
695
|
}
|
|
684
696
|
return;
|
|
685
697
|
}
|
|
686
|
-
const isStillPresent = selectedValue == null
|
|
698
|
+
const isStillPresent = selectedValue == null || (0, _itemEquality.itemIncludes)(registry, selectedValue, store.state.isItemEqualToValue);
|
|
687
699
|
if (isStillPresent) {
|
|
688
700
|
return;
|
|
689
701
|
}
|
|
@@ -691,16 +703,8 @@ function AriaCombobox(props) {
|
|
|
691
703
|
if (defaultSelectedValue != null && (0, _itemEquality.itemIncludes)(registry, defaultSelectedValue, store.state.isItemEqualToValue)) {
|
|
692
704
|
fallback = defaultSelectedValue;
|
|
693
705
|
}
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
// Keep the input text in sync when the input is rendered outside the popup.
|
|
697
|
-
if (!store.state.inputInsidePopup) {
|
|
698
|
-
const stringVal = (0, _resolveValueLabel.stringifyAsLabel)(fallback, itemToStringLabel);
|
|
699
|
-
if (inputRef.current && inputRef.current.value !== stringVal) {
|
|
700
|
-
setInputValue(stringVal, (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.none));
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
}, [items, flatItems, multiple, selectionMode, selectedValue, defaultSelectedValue, setSelectedValueUnwrapped, itemToStringLabel, store, setInputValue]);
|
|
706
|
+
setSelectedValue(fallback, (0, _createBaseUIEventDetails.createChangeEventDetails)(_reasons.REASONS.none));
|
|
707
|
+
}, [items, flatItems, multiple, selectionMode, selectedValue, defaultSelectedValue, store, setSelectedValue]);
|
|
704
708
|
(0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
|
|
705
709
|
if (selectionMode === 'none') {
|
|
706
710
|
setFilled(String(inputValue) !== '');
|
|
@@ -837,8 +841,8 @@ function AriaCombobox(props) {
|
|
|
837
841
|
activeIndex,
|
|
838
842
|
selectedIndex,
|
|
839
843
|
virtual: true,
|
|
840
|
-
loopFocus
|
|
841
|
-
allowEscape: !autoHighlightMode,
|
|
844
|
+
loopFocus,
|
|
845
|
+
allowEscape: loopFocus && !autoHighlightMode,
|
|
842
846
|
focusItemOnOpen: queryChangedAfterOpen || selectionMode === 'none' && !autoHighlightMode ? false : 'auto',
|
|
843
847
|
focusItemOnHover: highlightItemOnHover,
|
|
844
848
|
resetOnPointerLeave: !keepHighlight,
|
|
@@ -1002,14 +1006,13 @@ function AriaCombobox(props) {
|
|
|
1002
1006
|
}
|
|
1003
1007
|
}
|
|
1004
1008
|
}),
|
|
1005
|
-
id: id,
|
|
1006
1009
|
name: multiple || selectionMode === 'none' ? undefined : name,
|
|
1007
1010
|
disabled: disabled,
|
|
1008
1011
|
required: required && !hasMultipleSelection,
|
|
1009
1012
|
readOnly: readOnly,
|
|
1010
1013
|
value: serializedValue,
|
|
1011
1014
|
ref: hiddenInputRef,
|
|
1012
|
-
style: _visuallyHidden.visuallyHidden,
|
|
1015
|
+
style: name ? _visuallyHidden.visuallyHiddenInput : _visuallyHidden.visuallyHidden,
|
|
1013
1016
|
tabIndex: -1,
|
|
1014
1017
|
"aria-hidden": true
|
|
1015
1018
|
}), hiddenInputs]
|
|
@@ -53,7 +53,7 @@ export type ComboboxRootProps<Value, Multiple extends boolean | undefined = fals
|
|
|
53
53
|
* Instead, the `unmount` function must be called to unmount the combobox manually.
|
|
54
54
|
* Useful when the combobox's animation is controlled by an external library.
|
|
55
55
|
*/
|
|
56
|
-
actionsRef?: React.RefObject<ComboboxRoot.Actions>;
|
|
56
|
+
actionsRef?: React.RefObject<ComboboxRoot.Actions | null>;
|
|
57
57
|
/**
|
|
58
58
|
* Event handler called when the popup is opened or closed.
|
|
59
59
|
*/
|
|
@@ -5,7 +5,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
5
5
|
* Enable `grid` on the root component to turn the listbox into a grid.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxRow: React.ForwardRefExoticComponent<ComboboxRowProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxRow: React.ForwardRefExoticComponent<Omit<ComboboxRowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export interface ComboboxRowState {}
|
|
10
10
|
export interface ComboboxRowProps extends BaseUIComponentProps<'div', ComboboxRow.State> {}
|
|
11
11
|
export declare namespace ComboboxRow {
|
|
@@ -5,7 +5,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
5
5
|
* Useful for conveying the status of an asynchronously loaded list.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxStatus: React.ForwardRefExoticComponent<ComboboxStatusProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxStatus: React.ForwardRefExoticComponent<Omit<ComboboxStatusProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export interface ComboboxStatusState {}
|
|
10
10
|
export interface ComboboxStatusProps extends BaseUIComponentProps<'div', ComboboxStatus.State> {}
|
|
11
11
|
export declare namespace ComboboxStatus {
|
package/combobox/store.d.ts
CHANGED
|
@@ -77,6 +77,9 @@ export declare const selectors: {
|
|
|
77
77
|
query: (state: State) => string;
|
|
78
78
|
items: (state: State) => readonly any[] | undefined;
|
|
79
79
|
selectedValue: (state: State) => any;
|
|
80
|
+
hasSelectionChips: (state: State) => boolean;
|
|
81
|
+
hasSelectedValue: (state: State) => boolean;
|
|
82
|
+
hasNullItemLabel: (state: State, enabled: boolean) => boolean;
|
|
80
83
|
open: (state: State) => boolean;
|
|
81
84
|
mounted: (state: State) => boolean;
|
|
82
85
|
forceMounted: (state: State) => boolean;
|
package/combobox/store.js
CHANGED
|
@@ -6,11 +6,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.selectors = void 0;
|
|
7
7
|
var _store = require("@base-ui/utils/store");
|
|
8
8
|
var _itemEquality = require("../utils/itemEquality");
|
|
9
|
+
var _resolveValueLabel = require("../utils/resolveValueLabel");
|
|
9
10
|
const selectors = exports.selectors = {
|
|
10
11
|
id: (0, _store.createSelector)(state => state.id),
|
|
11
12
|
query: (0, _store.createSelector)(state => state.query),
|
|
12
13
|
items: (0, _store.createSelector)(state => state.items),
|
|
13
14
|
selectedValue: (0, _store.createSelector)(state => state.selectedValue),
|
|
15
|
+
hasSelectionChips: (0, _store.createSelector)(state => {
|
|
16
|
+
const selectedValue = state.selectedValue;
|
|
17
|
+
return Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
18
|
+
}),
|
|
19
|
+
hasSelectedValue: (0, _store.createSelector)(state => {
|
|
20
|
+
const {
|
|
21
|
+
selectedValue,
|
|
22
|
+
selectionMode
|
|
23
|
+
} = state;
|
|
24
|
+
if (selectedValue == null) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (selectionMode === 'multiple' && Array.isArray(selectedValue)) {
|
|
28
|
+
return selectedValue.length > 0;
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
}),
|
|
32
|
+
hasNullItemLabel: (0, _store.createSelector)((state, enabled) => {
|
|
33
|
+
return enabled ? (0, _resolveValueLabel.hasNullItemLabel)(state.items) : false;
|
|
34
|
+
}),
|
|
14
35
|
open: (0, _store.createSelector)(state => state.open),
|
|
15
36
|
mounted: (0, _store.createSelector)(state => state.mounted),
|
|
16
37
|
forceMounted: (0, _store.createSelector)(state => state.forceMounted),
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseUIComponentProps, NativeButtonProps } from "../../utils/types.js";
|
|
3
3
|
import type { FieldRoot } from "../../field/root/FieldRoot.js";
|
|
4
|
+
import type { Side } from "../../utils/useAnchorPositioning.js";
|
|
4
5
|
/**
|
|
5
6
|
* A button that opens the popup.
|
|
6
7
|
* Renders a `<button>` element.
|
|
7
8
|
*/
|
|
8
|
-
export declare const ComboboxTrigger: React.ForwardRefExoticComponent<ComboboxTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export declare const ComboboxTrigger: React.ForwardRefExoticComponent<Omit<ComboboxTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
10
|
export interface ComboboxTriggerState extends FieldRoot.State {
|
|
10
11
|
/**
|
|
11
12
|
* Whether the popup is open.
|
|
@@ -15,6 +16,18 @@ export interface ComboboxTriggerState extends FieldRoot.State {
|
|
|
15
16
|
* Whether the component should ignore user interaction.
|
|
16
17
|
*/
|
|
17
18
|
disabled: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
21
|
+
*/
|
|
22
|
+
popupSide: Side | null;
|
|
23
|
+
/**
|
|
24
|
+
* Present when the corresponding items list is empty.
|
|
25
|
+
*/
|
|
26
|
+
listEmpty: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the combobox doesn't have a value.
|
|
29
|
+
*/
|
|
30
|
+
placeholder: boolean;
|
|
18
31
|
}
|
|
19
32
|
export interface ComboboxTriggerProps extends NativeButtonProps, BaseUIComponentProps<'button', ComboboxTrigger.State> {
|
|
20
33
|
/**
|
|
@@ -14,21 +14,17 @@ var _owner = require("@base-ui/utils/owner");
|
|
|
14
14
|
var _useRenderElement = require("../../utils/useRenderElement");
|
|
15
15
|
var _useButton = require("../../use-button");
|
|
16
16
|
var _ComboboxRootContext = require("../root/ComboboxRootContext");
|
|
17
|
+
var _stateAttributesMapping = require("../utils/stateAttributesMapping");
|
|
17
18
|
var _store2 = require("../store");
|
|
18
19
|
var _FieldRootContext = require("../../field/root/FieldRootContext");
|
|
19
20
|
var _LabelableContext = require("../../labelable-provider/LabelableContext");
|
|
20
|
-
var _popupStateMapping = require("../../utils/popupStateMapping");
|
|
21
21
|
var _utils = require("../../floating-ui-react/utils");
|
|
22
22
|
var _getPseudoElementBounds = require("../../utils/getPseudoElementBounds");
|
|
23
23
|
var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
|
|
24
24
|
var _reasons = require("../../utils/reasons");
|
|
25
|
-
var _constants = require("../../field/utils/constants");
|
|
26
25
|
var _floatingUiReact = require("../../floating-ui-react");
|
|
26
|
+
var _useLabelableId = require("../../labelable-provider/useLabelableId");
|
|
27
27
|
const BOUNDARY_OFFSET = 2;
|
|
28
|
-
const stateAttributesMapping = {
|
|
29
|
-
..._popupStateMapping.pressableTriggerOpenStateMapping,
|
|
30
|
-
..._constants.fieldValidityMapping
|
|
31
|
-
};
|
|
32
28
|
|
|
33
29
|
/**
|
|
34
30
|
* A button that opens the popup.
|
|
@@ -40,6 +36,7 @@ const ComboboxTrigger = exports.ComboboxTrigger = /*#__PURE__*/React.forwardRef(
|
|
|
40
36
|
className,
|
|
41
37
|
nativeButton = true,
|
|
42
38
|
disabled: disabledProp = false,
|
|
39
|
+
id: idProp,
|
|
43
40
|
...elementProps
|
|
44
41
|
} = componentProps;
|
|
45
42
|
const {
|
|
@@ -54,21 +51,36 @@ const ComboboxTrigger = exports.ComboboxTrigger = /*#__PURE__*/React.forwardRef(
|
|
|
54
51
|
labelId
|
|
55
52
|
} = (0, _LabelableContext.useLabelableContext)();
|
|
56
53
|
const store = (0, _ComboboxRootContext.useComboboxRootContext)();
|
|
54
|
+
const {
|
|
55
|
+
filteredItems
|
|
56
|
+
} = (0, _ComboboxRootContext.useComboboxDerivedItemsContext)();
|
|
57
57
|
const selectionMode = (0, _store.useStore)(store, _store2.selectors.selectionMode);
|
|
58
58
|
const comboboxDisabled = (0, _store.useStore)(store, _store2.selectors.disabled);
|
|
59
59
|
const readOnly = (0, _store.useStore)(store, _store2.selectors.readOnly);
|
|
60
|
+
const required = (0, _store.useStore)(store, _store2.selectors.required);
|
|
61
|
+
const mounted = (0, _store.useStore)(store, _store2.selectors.mounted);
|
|
62
|
+
const popupSideValue = (0, _store.useStore)(store, _store2.selectors.popupSide);
|
|
63
|
+
const positionerElement = (0, _store.useStore)(store, _store2.selectors.positionerElement);
|
|
60
64
|
const listElement = (0, _store.useStore)(store, _store2.selectors.listElement);
|
|
61
65
|
const triggerProps = (0, _store.useStore)(store, _store2.selectors.triggerProps);
|
|
62
66
|
const triggerElement = (0, _store.useStore)(store, _store2.selectors.triggerElement);
|
|
63
67
|
const inputInsidePopup = (0, _store.useStore)(store, _store2.selectors.inputInsidePopup);
|
|
68
|
+
const rootId = (0, _store.useStore)(store, _store2.selectors.id);
|
|
64
69
|
const open = (0, _store.useStore)(store, _store2.selectors.open);
|
|
65
70
|
const selectedValue = (0, _store.useStore)(store, _store2.selectors.selectedValue);
|
|
66
71
|
const activeIndex = (0, _store.useStore)(store, _store2.selectors.activeIndex);
|
|
67
72
|
const selectedIndex = (0, _store.useStore)(store, _store2.selectors.selectedIndex);
|
|
73
|
+
const hasSelectedValue = (0, _store.useStore)(store, _store2.selectors.hasSelectedValue);
|
|
68
74
|
const floatingRootContext = (0, _ComboboxRootContext.useComboboxFloatingContext)();
|
|
69
75
|
const inputValue = (0, _ComboboxRootContext.useComboboxInputValueContext)();
|
|
70
76
|
const focusTimeout = (0, _useTimeout.useTimeout)();
|
|
71
77
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
78
|
+
const listEmpty = filteredItems.length === 0;
|
|
79
|
+
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
80
|
+
(0, _useLabelableId.useLabelableId)({
|
|
81
|
+
id: inputInsidePopup ? idProp : undefined
|
|
82
|
+
});
|
|
83
|
+
const id = inputInsidePopup ? idProp ?? rootId : idProp;
|
|
72
84
|
const currentPointerTypeRef = React.useRef('');
|
|
73
85
|
function trackPointerType(event) {
|
|
74
86
|
currentPointerTypeRef.current = event.pointerType;
|
|
@@ -115,8 +127,11 @@ const ComboboxTrigger = exports.ComboboxTrigger = /*#__PURE__*/React.forwardRef(
|
|
|
115
127
|
const state = React.useMemo(() => ({
|
|
116
128
|
...fieldState,
|
|
117
129
|
open,
|
|
118
|
-
disabled
|
|
119
|
-
|
|
130
|
+
disabled,
|
|
131
|
+
popupSide,
|
|
132
|
+
listEmpty,
|
|
133
|
+
placeholder: !hasSelectedValue
|
|
134
|
+
}), [fieldState, open, disabled, popupSide, listEmpty, hasSelectedValue]);
|
|
120
135
|
const setTriggerElement = (0, _useStableCallback.useStableCallback)(element => {
|
|
121
136
|
store.set('triggerElement', element);
|
|
122
137
|
});
|
|
@@ -124,13 +139,14 @@ const ComboboxTrigger = exports.ComboboxTrigger = /*#__PURE__*/React.forwardRef(
|
|
|
124
139
|
ref: [forwardedRef, buttonRef, setTriggerElement],
|
|
125
140
|
state,
|
|
126
141
|
props: [triggerProps, triggerClickProps, triggerTypeaheadProps, {
|
|
142
|
+
id,
|
|
127
143
|
tabIndex: inputInsidePopup ? 0 : -1,
|
|
128
|
-
disabled,
|
|
129
144
|
role: inputInsidePopup ? 'combobox' : undefined,
|
|
130
145
|
'aria-expanded': open ? 'true' : 'false',
|
|
131
146
|
'aria-haspopup': inputInsidePopup ? 'dialog' : 'listbox',
|
|
132
147
|
'aria-controls': open ? listElement?.id : undefined,
|
|
133
148
|
'aria-readonly': readOnly || undefined,
|
|
149
|
+
'aria-required': inputInsidePopup ? required || undefined : undefined,
|
|
134
150
|
'aria-labelledby': labelId,
|
|
135
151
|
onPointerDown: trackPointerType,
|
|
136
152
|
onPointerEnter: trackPointerType,
|
|
@@ -141,7 +157,11 @@ const ComboboxTrigger = exports.ComboboxTrigger = /*#__PURE__*/React.forwardRef(
|
|
|
141
157
|
}
|
|
142
158
|
focusTimeout.start(0, store.state.forceMount);
|
|
143
159
|
},
|
|
144
|
-
onBlur() {
|
|
160
|
+
onBlur(event) {
|
|
161
|
+
// If focus is moving into the popup, don't count it as a blur.
|
|
162
|
+
if ((0, _utils.contains)(positionerElement, event.relatedTarget)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
145
165
|
setTouched(true);
|
|
146
166
|
setFocused(false);
|
|
147
167
|
if (validationMode === 'onBlur') {
|
|
@@ -204,7 +224,7 @@ const ComboboxTrigger = exports.ComboboxTrigger = /*#__PURE__*/React.forwardRef(
|
|
|
204
224
|
}
|
|
205
225
|
}
|
|
206
226
|
}, validation ? validation.getValidationProps(elementProps) : elementProps, getButtonProps],
|
|
207
|
-
stateAttributesMapping
|
|
227
|
+
stateAttributesMapping: _stateAttributesMapping.triggerStateAttributesMapping
|
|
208
228
|
});
|
|
209
229
|
return element;
|
|
210
230
|
});
|
|
@@ -15,6 +15,11 @@ export declare enum ComboboxTriggerDataAttributes {
|
|
|
15
15
|
* Present when the component is readonly.
|
|
16
16
|
*/
|
|
17
17
|
readonly = "data-readonly",
|
|
18
|
+
/**
|
|
19
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
20
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
21
|
+
*/
|
|
22
|
+
popupSide = "data-popup-side",
|
|
18
23
|
/**
|
|
19
24
|
* Present when the component is required.
|
|
20
25
|
*/
|
|
@@ -43,4 +48,12 @@ export declare enum ComboboxTriggerDataAttributes {
|
|
|
43
48
|
* Present when the trigger is focused (when wrapped in Field.Root).
|
|
44
49
|
*/
|
|
45
50
|
focused = "data-focused",
|
|
51
|
+
/**
|
|
52
|
+
* Present when the corresponding items list is empty.
|
|
53
|
+
*/
|
|
54
|
+
listEmpty = "data-list-empty",
|
|
55
|
+
/**
|
|
56
|
+
* Present when the combobox doesn't have a value.
|
|
57
|
+
*/
|
|
58
|
+
placeholder = "data-placeholder",
|
|
46
59
|
}
|