@base-ui/react 1.0.0-rc.2 → 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 +156 -5
- 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
|
@@ -8,6 +8,10 @@ export let CheckboxIndicatorDataAttributes = function (CheckboxIndicatorDataAttr
|
|
|
8
8
|
* Present when the checkbox is not checked.
|
|
9
9
|
*/
|
|
10
10
|
CheckboxIndicatorDataAttributes["unchecked"] = "data-unchecked";
|
|
11
|
+
/**
|
|
12
|
+
* Present when the checkbox is in an indeterminate state.
|
|
13
|
+
*/
|
|
14
|
+
CheckboxIndicatorDataAttributes["indeterminate"] = "data-indeterminate";
|
|
11
15
|
/**
|
|
12
16
|
* Present when the checkbox is disabled.
|
|
13
17
|
*/
|
|
@@ -10,7 +10,7 @@ export declare const PARENT_CHECKBOX = "data-parent";
|
|
|
10
10
|
*
|
|
11
11
|
* Documentation: [Base UI Checkbox](https://base-ui.com/react/components/checkbox)
|
|
12
12
|
*/
|
|
13
|
-
export declare const CheckboxRoot: React.ForwardRefExoticComponent<CheckboxRootProps & React.RefAttributes<HTMLElement>>;
|
|
13
|
+
export declare const CheckboxRoot: React.ForwardRefExoticComponent<Omit<CheckboxRootProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
14
14
|
export interface CheckboxRootState extends FieldRoot.State {
|
|
15
15
|
/**
|
|
16
16
|
* Whether the checkbox is currently ticked.
|
|
@@ -6,7 +6,7 @@ import { useControlled } from '@base-ui/utils/useControlled';
|
|
|
6
6
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
7
7
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
8
8
|
import { useMergedRefs } from '@base-ui/utils/useMergedRefs';
|
|
9
|
-
import { visuallyHidden } from '@base-ui/utils/visuallyHidden';
|
|
9
|
+
import { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';
|
|
10
10
|
import { NOOP } from "../../utils/noop.js";
|
|
11
11
|
import { useStateAttributesMapping } from "../utils/useStateAttributesMapping.js";
|
|
12
12
|
import { useRenderElement } from "../../utils/useRenderElement.js";
|
|
@@ -170,11 +170,12 @@ export const CheckboxRoot = /*#__PURE__*/React.forwardRef(function CheckboxRoot(
|
|
|
170
170
|
disabled,
|
|
171
171
|
// parent checkboxes unset `name` to be excluded from form submission
|
|
172
172
|
name: parent ? undefined : name,
|
|
173
|
-
// Set `id` to stop Chrome warning about an unassociated input
|
|
174
|
-
id
|
|
173
|
+
// Set `id` to stop Chrome warning about an unassociated input.
|
|
174
|
+
// When using a native button, the `id` is applied to the button instead.
|
|
175
|
+
id: nativeButton ? undefined : inputId ?? undefined,
|
|
175
176
|
required,
|
|
176
177
|
ref: mergedInputRef,
|
|
177
|
-
style: visuallyHidden,
|
|
178
|
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
178
179
|
tabIndex: -1,
|
|
179
180
|
type: 'checkbox',
|
|
180
181
|
'aria-hidden': true,
|
|
@@ -225,7 +226,7 @@ export const CheckboxRoot = /*#__PURE__*/React.forwardRef(function CheckboxRoot(
|
|
|
225
226
|
state,
|
|
226
227
|
ref: [buttonRef, controlRef, forwardedRef, groupContext?.registerControlRef],
|
|
227
228
|
props: [{
|
|
228
|
-
id,
|
|
229
|
+
id: nativeButton ? inputId ?? undefined : id,
|
|
229
230
|
role: 'checkbox',
|
|
230
231
|
'aria-checked': groupIndeterminate ? 'mixed' : checked,
|
|
231
232
|
'aria-readonly': readOnly || undefined,
|
|
@@ -7,6 +7,10 @@ export declare enum CheckboxRootDataAttributes {
|
|
|
7
7
|
* Present when the checkbox is not checked.
|
|
8
8
|
*/
|
|
9
9
|
unchecked = "data-unchecked",
|
|
10
|
+
/**
|
|
11
|
+
* Present when the checkbox is in an indeterminate state.
|
|
12
|
+
*/
|
|
13
|
+
indeterminate = "data-indeterminate",
|
|
10
14
|
/**
|
|
11
15
|
* Present when the checkbox is disabled.
|
|
12
16
|
*/
|
|
@@ -7,6 +7,10 @@ export let CheckboxRootDataAttributes = /*#__PURE__*/function (CheckboxRootDataA
|
|
|
7
7
|
* Present when the checkbox is not checked.
|
|
8
8
|
*/
|
|
9
9
|
CheckboxRootDataAttributes["unchecked"] = "data-unchecked";
|
|
10
|
+
/**
|
|
11
|
+
* Present when the checkbox is in an indeterminate state.
|
|
12
|
+
*/
|
|
13
|
+
CheckboxRootDataAttributes["indeterminate"] = "data-indeterminate";
|
|
10
14
|
/**
|
|
11
15
|
* Present when the checkbox is disabled.
|
|
12
16
|
*/
|
|
@@ -8,7 +8,7 @@ import { REASONS } from "../utils/reasons.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Documentation: [Base UI Checkbox Group](https://base-ui.com/react/components/checkbox-group)
|
|
10
10
|
*/
|
|
11
|
-
export declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const CheckboxGroup: React.ForwardRefExoticComponent<Omit<CheckboxGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export interface CheckboxGroupState extends FieldRoot.State {
|
|
13
13
|
/**
|
|
14
14
|
* Whether the component should ignore user interaction.
|
|
@@ -8,7 +8,7 @@ import type { TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)
|
|
10
10
|
*/
|
|
11
|
-
export declare const CollapsiblePanel: React.ForwardRefExoticComponent<CollapsiblePanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const CollapsiblePanel: React.ForwardRefExoticComponent<Omit<CollapsiblePanelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export interface CollapsiblePanelState extends CollapsibleRoot.State {
|
|
13
13
|
transitionStatus: TransitionStatus;
|
|
14
14
|
}
|
|
@@ -9,7 +9,7 @@ import { REASONS } from "../../utils/reasons.js";
|
|
|
9
9
|
*
|
|
10
10
|
* Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)
|
|
11
11
|
*/
|
|
12
|
-
export declare const CollapsibleRoot: React.ForwardRefExoticComponent<CollapsibleRootProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const CollapsibleRoot: React.ForwardRefExoticComponent<Omit<CollapsibleRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
13
|
export interface CollapsibleRootState extends Pick<useCollapsibleRoot.ReturnValue, 'open' | 'disabled'> {}
|
|
14
14
|
export interface CollapsibleRootProps extends BaseUIComponentProps<'div', CollapsibleRoot.State> {
|
|
15
15
|
/**
|
|
@@ -7,7 +7,7 @@ import { CollapsibleRoot } from "../root/CollapsibleRoot.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Collapsible](https://base-ui.com/react/components/collapsible)
|
|
9
9
|
*/
|
|
10
|
-
export declare const CollapsibleTrigger: React.ForwardRefExoticComponent<CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export declare const CollapsibleTrigger: React.ForwardRefExoticComponent<Omit<CollapsibleTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
11
|
export interface CollapsibleTriggerProps extends NativeButtonProps, BaseUIComponentProps<'button', CollapsibleRoot.State> {}
|
|
12
12
|
export declare namespace CollapsibleTrigger {
|
|
13
13
|
type Props = CollapsibleTriggerProps;
|
|
@@ -44,9 +44,8 @@ export const CollapsibleTrigger = /*#__PURE__*/React.forwardRef(function Collaps
|
|
|
44
44
|
const props = React.useMemo(() => ({
|
|
45
45
|
'aria-controls': open ? panelId : undefined,
|
|
46
46
|
'aria-expanded': open,
|
|
47
|
-
disabled,
|
|
48
47
|
onClick: handleTrigger
|
|
49
|
-
}), [panelId,
|
|
48
|
+
}), [panelId, open, handleTrigger]);
|
|
50
49
|
const element = useRenderElement('button', componentProps, {
|
|
51
50
|
state,
|
|
52
51
|
ref: [forwardedRef, buttonRef],
|
|
@@ -5,7 +5,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
5
5
|
* Displays an element positioned against the anchor.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxArrow: React.ForwardRefExoticComponent<ComboboxArrowProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxArrow: React.ForwardRefExoticComponent<Omit<ComboboxArrowProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export interface ComboboxArrowState {
|
|
10
10
|
/**
|
|
11
11
|
* Whether the popup is currently open.
|
|
@@ -5,7 +5,7 @@ import type { TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
5
5
|
* An overlay displayed beneath the popup.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxBackdrop: React.ForwardRefExoticComponent<ComboboxBackdropProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxBackdrop: React.ForwardRefExoticComponent<Omit<ComboboxBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export interface ComboboxBackdropProps extends BaseUIComponentProps<'div', ComboboxBackdrop.State> {}
|
|
10
10
|
export interface ComboboxBackdropState {
|
|
11
11
|
/**
|
|
@@ -4,7 +4,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
4
4
|
* An individual chip that represents a value in a multiselectable input.
|
|
5
5
|
* Renders a `<div>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxChip: React.ForwardRefExoticComponent<ComboboxChipProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxChip: React.ForwardRefExoticComponent<Omit<ComboboxChipProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxChipState {
|
|
9
9
|
/**
|
|
10
10
|
* Whether the component should ignore user interaction.
|
|
@@ -4,7 +4,7 @@ import { BaseUIComponentProps, NativeButtonProps } from "../../utils/types.js";
|
|
|
4
4
|
* A button to remove a chip.
|
|
5
5
|
* Renders a `<button>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxChipRemove: React.ForwardRefExoticComponent<ComboboxChipRemoveProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const ComboboxChipRemove: React.ForwardRefExoticComponent<Omit<ComboboxChipRemoveProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
8
|
export interface ComboboxChipRemoveState {
|
|
9
9
|
/**
|
|
10
10
|
* Whether the component should ignore user interaction.
|
|
@@ -20,6 +20,7 @@ export const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function Combobo
|
|
|
20
20
|
const {
|
|
21
21
|
render,
|
|
22
22
|
className,
|
|
23
|
+
disabled: disabledProp = false,
|
|
23
24
|
nativeButton = true,
|
|
24
25
|
...elementProps
|
|
25
26
|
} = componentProps;
|
|
@@ -27,10 +28,11 @@ export const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function Combobo
|
|
|
27
28
|
const {
|
|
28
29
|
index
|
|
29
30
|
} = useComboboxChipContext();
|
|
30
|
-
const
|
|
31
|
+
const comboboxDisabled = useStore(store, selectors.disabled);
|
|
31
32
|
const readOnly = useStore(store, selectors.readOnly);
|
|
32
33
|
const selectedValue = useStore(store, selectors.selectedValue);
|
|
33
34
|
const isItemEqualToValue = useStore(store, selectors.isItemEqualToValue);
|
|
35
|
+
const disabled = comboboxDisabled || disabledProp;
|
|
34
36
|
const {
|
|
35
37
|
buttonRef,
|
|
36
38
|
getButtonProps
|
|
@@ -47,7 +49,6 @@ export const ComboboxChipRemove = /*#__PURE__*/React.forwardRef(function Combobo
|
|
|
47
49
|
state,
|
|
48
50
|
props: [{
|
|
49
51
|
tabIndex: -1,
|
|
50
|
-
disabled,
|
|
51
52
|
'aria-readonly': readOnly || undefined,
|
|
52
53
|
onClick(event) {
|
|
53
54
|
if (disabled || readOnly) {
|
|
@@ -4,7 +4,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
4
4
|
* A container for the chips in a multiselectable input.
|
|
5
5
|
* Renders a `<div>` element.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ComboboxChips: React.ForwardRefExoticComponent<ComboboxChipsProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const ComboboxChips: React.ForwardRefExoticComponent<Omit<ComboboxChipsProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export interface ComboboxChipsState {}
|
|
9
9
|
export interface ComboboxChipsProps extends BaseUIComponentProps<'div', ComboboxChips.State> {}
|
|
10
10
|
export declare namespace ComboboxChips {
|
|
@@ -7,6 +7,7 @@ import { ComboboxChipsContext } from "./ComboboxChipsContext.js";
|
|
|
7
7
|
import { CompositeList } from "../../composite/list/CompositeList.js";
|
|
8
8
|
import { useComboboxRootContext } from "../root/ComboboxRootContext.js";
|
|
9
9
|
import { selectors } from "../store.js";
|
|
10
|
+
import { EMPTY_OBJECT } from "../../utils/constants.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* A container for the chips in a multiselectable input.
|
|
@@ -21,6 +22,7 @@ export const ComboboxChips = /*#__PURE__*/React.forwardRef(function ComboboxChip
|
|
|
21
22
|
} = componentProps;
|
|
22
23
|
const store = useComboboxRootContext();
|
|
23
24
|
const open = useStore(store, selectors.open);
|
|
25
|
+
const hasSelectionChips = useStore(store, selectors.hasSelectionChips);
|
|
24
26
|
const [highlightedChipIndex, setHighlightedChipIndex] = React.useState(undefined);
|
|
25
27
|
if (open && highlightedChipIndex !== undefined) {
|
|
26
28
|
setHighlightedChipIndex(undefined);
|
|
@@ -28,7 +30,11 @@ export const ComboboxChips = /*#__PURE__*/React.forwardRef(function ComboboxChip
|
|
|
28
30
|
const chipsRef = React.useRef([]);
|
|
29
31
|
const element = useRenderElement('div', componentProps, {
|
|
30
32
|
ref: [forwardedRef, store.state.chipsContainerRef],
|
|
31
|
-
|
|
33
|
+
// NVDA enters browse mode instead of staying in focus mode when navigating with
|
|
34
|
+
// arrow keys inside a container unless it has a toolbar role.
|
|
35
|
+
props: [hasSelectionChips ? {
|
|
36
|
+
role: 'toolbar'
|
|
37
|
+
} : EMPTY_OBJECT, elementProps]
|
|
32
38
|
});
|
|
33
39
|
const contextValue = React.useMemo(() => ({
|
|
34
40
|
highlightedChipIndex,
|
|
@@ -5,7 +5,7 @@ import { TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
5
5
|
* Clears the value when clicked.
|
|
6
6
|
* Renders a `<button>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxClear: React.ForwardRefExoticComponent<ComboboxClearProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const ComboboxClear: React.ForwardRefExoticComponent<Omit<ComboboxClearProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
export interface ComboboxClearState {
|
|
10
10
|
/**
|
|
11
11
|
* Whether the popup is open.
|
|
@@ -40,6 +40,7 @@ export const ComboboxClear = /*#__PURE__*/React.forwardRef(function ComboboxClea
|
|
|
40
40
|
const readOnly = useStore(store, selectors.readOnly);
|
|
41
41
|
const open = useStore(store, selectors.open);
|
|
42
42
|
const selectedValue = useStore(store, selectors.selectedValue);
|
|
43
|
+
const hasSelectionChips = useStore(store, selectors.hasSelectionChips);
|
|
43
44
|
const inputValue = useComboboxInputValueContext();
|
|
44
45
|
let visible = false;
|
|
45
46
|
if (selectionMode === 'none') {
|
|
@@ -47,7 +48,7 @@ export const ComboboxClear = /*#__PURE__*/React.forwardRef(function ComboboxClea
|
|
|
47
48
|
} else if (selectionMode === 'single') {
|
|
48
49
|
visible = selectedValue != null;
|
|
49
50
|
} else {
|
|
50
|
-
visible =
|
|
51
|
+
visible = hasSelectionChips;
|
|
51
52
|
}
|
|
52
53
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
53
54
|
const {
|
|
@@ -82,7 +83,6 @@ export const ComboboxClear = /*#__PURE__*/React.forwardRef(function ComboboxClea
|
|
|
82
83
|
props: [{
|
|
83
84
|
tabIndex: -1,
|
|
84
85
|
children: 'x',
|
|
85
|
-
disabled,
|
|
86
86
|
'aria-readonly': readOnly || undefined,
|
|
87
87
|
// Avoid stealing focus from the input.
|
|
88
88
|
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.
|
|
@@ -7,10 +7,9 @@ import { isAndroid, isFirefox } from '@base-ui/utils/detectBrowser';
|
|
|
7
7
|
import { useBaseUiId } from "../../utils/useBaseUiId.js";
|
|
8
8
|
import { useRenderElement } from "../../utils/useRenderElement.js";
|
|
9
9
|
import { useComboboxDerivedItemsContext, useComboboxInputValueContext, useComboboxRootContext } from "../root/ComboboxRootContext.js";
|
|
10
|
+
import { triggerStateAttributesMapping } from "../utils/stateAttributesMapping.js";
|
|
10
11
|
import { selectors } from "../store.js";
|
|
11
|
-
import { pressableTriggerOpenStateMapping } from "../../utils/popupStateMapping.js";
|
|
12
12
|
import { useFieldRootContext } from "../../field/root/FieldRootContext.js";
|
|
13
|
-
import { fieldValidityMapping } from "../../field/utils/constants.js";
|
|
14
13
|
import { useLabelableContext } from "../../labelable-provider/LabelableContext.js";
|
|
15
14
|
import { useComboboxChipsContext } from "../chips/ComboboxChipsContext.js";
|
|
16
15
|
import { stopEvent } from "../../floating-ui-react/utils.js";
|
|
@@ -18,16 +17,6 @@ import { useComboboxPositionerContext } from "../positioner/ComboboxPositionerCo
|
|
|
18
17
|
import { createChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
19
18
|
import { REASONS } from "../../utils/reasons.js";
|
|
20
19
|
import { useDirection } from "../../direction-provider/DirectionContext.js";
|
|
21
|
-
const stateAttributesMapping = {
|
|
22
|
-
...pressableTriggerOpenStateMapping,
|
|
23
|
-
...fieldValidityMapping,
|
|
24
|
-
popupSide: side => side ? {
|
|
25
|
-
'data-popup-side': side
|
|
26
|
-
} : null,
|
|
27
|
-
listEmpty: empty => empty ? {
|
|
28
|
-
'data-list-empty': ''
|
|
29
|
-
} : null
|
|
30
|
-
};
|
|
31
20
|
|
|
32
21
|
/**
|
|
33
22
|
* A text input to search for items in the list.
|
|
@@ -62,7 +51,7 @@ export const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInpu
|
|
|
62
51
|
// `inputValue` can't be placed in the store.
|
|
63
52
|
// https://github.com/mui/base-ui/issues/2703
|
|
64
53
|
const inputValue = useComboboxInputValueContext();
|
|
65
|
-
const
|
|
54
|
+
const required = useStore(store, selectors.required);
|
|
66
55
|
const direction = useDirection();
|
|
67
56
|
const comboboxDisabled = useStore(store, selectors.disabled);
|
|
68
57
|
const readOnly = useStore(store, selectors.readOnly);
|
|
@@ -76,20 +65,24 @@ export const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInpu
|
|
|
76
65
|
const selectedValue = useStore(store, selectors.selectedValue);
|
|
77
66
|
const popupSideValue = useStore(store, selectors.popupSide);
|
|
78
67
|
const positionerElement = useStore(store, selectors.positionerElement);
|
|
68
|
+
const rootId = useStore(store, selectors.id);
|
|
69
|
+
const inline = useStore(store, selectors.inline);
|
|
79
70
|
const autoHighlightEnabled = Boolean(autoHighlightMode);
|
|
80
71
|
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
81
72
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
82
73
|
const listEmpty = filteredItems.length === 0;
|
|
74
|
+
const isInsidePopup = hasPositionerParent || inline;
|
|
75
|
+
const id = useBaseUiId(idProp ?? (!isInsidePopup ? rootId : undefined));
|
|
83
76
|
const [composingValue, setComposingValue] = React.useState(null);
|
|
84
77
|
const isComposingRef = React.useRef(false);
|
|
85
78
|
const setInputElement = useStableCallback(element => {
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
79
|
+
const nextIsInsidePopup = hasPositionerParent || store.state.inline;
|
|
80
|
+
if (nextIsInsidePopup && !store.state.hasInputValue) {
|
|
88
81
|
store.state.setInputValue('', createChangeEventDetails(REASONS.none));
|
|
89
82
|
}
|
|
90
83
|
store.update({
|
|
91
84
|
inputElement: element,
|
|
92
|
-
inputInsidePopup:
|
|
85
|
+
inputInsidePopup: nextIsInsidePopup
|
|
93
86
|
});
|
|
94
87
|
});
|
|
95
88
|
const state = React.useMemo(() => ({
|
|
@@ -160,9 +153,11 @@ export const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInpu
|
|
|
160
153
|
type: 'text',
|
|
161
154
|
value: componentProps.value ?? composingValue ?? inputValue,
|
|
162
155
|
'aria-readonly': readOnly || undefined,
|
|
156
|
+
'aria-required': required || undefined,
|
|
163
157
|
'aria-labelledby': labelId,
|
|
164
158
|
disabled,
|
|
165
159
|
readOnly,
|
|
160
|
+
required: selectionMode === 'none' ? required : undefined,
|
|
166
161
|
...(selectionMode === 'none' && name && {
|
|
167
162
|
name
|
|
168
163
|
}),
|
|
@@ -349,7 +344,7 @@ export const ComboboxInput = /*#__PURE__*/React.forwardRef(function ComboboxInpu
|
|
|
349
344
|
store.state.keyboardActiveRef.current = false;
|
|
350
345
|
}
|
|
351
346
|
}, validation ? validation.getValidationProps(elementProps) : elementProps],
|
|
352
|
-
stateAttributesMapping
|
|
347
|
+
stateAttributesMapping: triggerStateAttributesMapping
|
|
353
348
|
});
|
|
354
349
|
return element;
|
|
355
350
|
});
|
|
@@ -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.
|
|
@@ -131,7 +131,6 @@ export const ComboboxItem = /*#__PURE__*/React.memo(/*#__PURE__*/React.forwardRe
|
|
|
131
131
|
const defaultProps = {
|
|
132
132
|
id,
|
|
133
133
|
role: isRow ? 'gridcell' : 'option',
|
|
134
|
-
'aria-disabled': disabled || undefined,
|
|
135
134
|
'aria-selected': selectable ? selected : undefined,
|
|
136
135
|
// Focusable items steal focus from the input upon mouseup.
|
|
137
136
|
// 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;
|
|
@@ -42,6 +42,7 @@ export const ComboboxPopup = /*#__PURE__*/React.forwardRef(function ComboboxPopu
|
|
|
42
42
|
const transitionStatus = useStore(store, selectors.transitionStatus);
|
|
43
43
|
const inputInsidePopup = useStore(store, selectors.inputInsidePopup);
|
|
44
44
|
const inputElement = useStore(store, selectors.inputElement);
|
|
45
|
+
const modal = useStore(store, selectors.modal);
|
|
45
46
|
const empty = filteredItems.length === 0;
|
|
46
47
|
useOpenChangeComplete({
|
|
47
48
|
open,
|
|
@@ -90,7 +91,7 @@ export const ComboboxPopup = /*#__PURE__*/React.forwardRef(function ComboboxPopu
|
|
|
90
91
|
return /*#__PURE__*/_jsx(FloatingFocusManager, {
|
|
91
92
|
context: floatingRootContext,
|
|
92
93
|
disabled: !mounted,
|
|
93
|
-
modal:
|
|
94
|
+
modal: inputInsidePopup ? modal : false,
|
|
94
95
|
openInteractionType: openMethod,
|
|
95
96
|
initialFocus: resolvedInitialFocus,
|
|
96
97
|
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.
|
|
@@ -6,7 +6,7 @@ import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
|
6
6
|
import { useOnFirstRender } from '@base-ui/utils/useOnFirstRender';
|
|
7
7
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
8
8
|
import { useMergedRefs } from '@base-ui/utils/useMergedRefs';
|
|
9
|
-
import { visuallyHidden } from '@base-ui/utils/visuallyHidden';
|
|
9
|
+
import { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';
|
|
10
10
|
import { useRefWithInit } from '@base-ui/utils/useRefWithInit';
|
|
11
11
|
import { Store, useStore } from '@base-ui/utils/store';
|
|
12
12
|
import { useValueAsRef } from '@base-ui/utils/useValueAsRef';
|
|
@@ -60,6 +60,7 @@ export function AriaCombobox(props) {
|
|
|
60
60
|
autoHighlight = false,
|
|
61
61
|
keepHighlight = false,
|
|
62
62
|
highlightItemOnHover = true,
|
|
63
|
+
loopFocus = true,
|
|
63
64
|
itemToStringLabel,
|
|
64
65
|
itemToStringValue,
|
|
65
66
|
isItemEqualToValue = defaultItemEquality,
|
|
@@ -82,6 +83,9 @@ export function AriaCombobox(props) {
|
|
|
82
83
|
setFilled,
|
|
83
84
|
name: fieldName,
|
|
84
85
|
disabled: fieldDisabled,
|
|
86
|
+
setTouched,
|
|
87
|
+
setFocused,
|
|
88
|
+
validationMode,
|
|
85
89
|
validation
|
|
86
90
|
} = useFieldRootContext();
|
|
87
91
|
const id = useLabelableId({
|
|
@@ -447,6 +451,14 @@ export function AriaCombobox(props) {
|
|
|
447
451
|
}
|
|
448
452
|
}
|
|
449
453
|
setOpenUnwrapped(nextOpen);
|
|
454
|
+
if (!nextOpen && inputInsidePopup && (eventDetails.reason === REASONS.focusOut || eventDetails.reason === REASONS.outsidePress)) {
|
|
455
|
+
setTouched(true);
|
|
456
|
+
setFocused(false);
|
|
457
|
+
if (validationMode === 'onBlur') {
|
|
458
|
+
const valueToValidate = selectionMode === 'none' ? inputValue : selectedValue;
|
|
459
|
+
validation.commit(valueToValidate);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
450
462
|
});
|
|
451
463
|
const setSelectedValue = useStableCallback((nextValue, eventDetails) => {
|
|
452
464
|
// Cast to `any` due to conditional value type (single vs. multiple).
|
|
@@ -673,11 +685,11 @@ export function AriaCombobox(props) {
|
|
|
673
685
|
const current = Array.isArray(selectedValue) ? selectedValue : EMPTY_ARRAY;
|
|
674
686
|
const next = current.filter(v => itemIncludes(registry, v, store.state.isItemEqualToValue));
|
|
675
687
|
if (next.length !== current.length) {
|
|
676
|
-
|
|
688
|
+
setSelectedValue(next, createChangeEventDetails(REASONS.none));
|
|
677
689
|
}
|
|
678
690
|
return;
|
|
679
691
|
}
|
|
680
|
-
const isStillPresent = selectedValue == null
|
|
692
|
+
const isStillPresent = selectedValue == null || itemIncludes(registry, selectedValue, store.state.isItemEqualToValue);
|
|
681
693
|
if (isStillPresent) {
|
|
682
694
|
return;
|
|
683
695
|
}
|
|
@@ -685,16 +697,8 @@ export function AriaCombobox(props) {
|
|
|
685
697
|
if (defaultSelectedValue != null && itemIncludes(registry, defaultSelectedValue, store.state.isItemEqualToValue)) {
|
|
686
698
|
fallback = defaultSelectedValue;
|
|
687
699
|
}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
// Keep the input text in sync when the input is rendered outside the popup.
|
|
691
|
-
if (!store.state.inputInsidePopup) {
|
|
692
|
-
const stringVal = stringifyAsLabel(fallback, itemToStringLabel);
|
|
693
|
-
if (inputRef.current && inputRef.current.value !== stringVal) {
|
|
694
|
-
setInputValue(stringVal, createChangeEventDetails(REASONS.none));
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}, [items, flatItems, multiple, selectionMode, selectedValue, defaultSelectedValue, setSelectedValueUnwrapped, itemToStringLabel, store, setInputValue]);
|
|
700
|
+
setSelectedValue(fallback, createChangeEventDetails(REASONS.none));
|
|
701
|
+
}, [items, flatItems, multiple, selectionMode, selectedValue, defaultSelectedValue, store, setSelectedValue]);
|
|
698
702
|
useIsoLayoutEffect(() => {
|
|
699
703
|
if (selectionMode === 'none') {
|
|
700
704
|
setFilled(String(inputValue) !== '');
|
|
@@ -831,8 +835,8 @@ export function AriaCombobox(props) {
|
|
|
831
835
|
activeIndex,
|
|
832
836
|
selectedIndex,
|
|
833
837
|
virtual: true,
|
|
834
|
-
loopFocus
|
|
835
|
-
allowEscape: !autoHighlightMode,
|
|
838
|
+
loopFocus,
|
|
839
|
+
allowEscape: loopFocus && !autoHighlightMode,
|
|
836
840
|
focusItemOnOpen: queryChangedAfterOpen || selectionMode === 'none' && !autoHighlightMode ? false : 'auto',
|
|
837
841
|
focusItemOnHover: highlightItemOnHover,
|
|
838
842
|
resetOnPointerLeave: !keepHighlight,
|
|
@@ -996,14 +1000,13 @@ export function AriaCombobox(props) {
|
|
|
996
1000
|
}
|
|
997
1001
|
}
|
|
998
1002
|
}),
|
|
999
|
-
id: id,
|
|
1000
1003
|
name: multiple || selectionMode === 'none' ? undefined : name,
|
|
1001
1004
|
disabled: disabled,
|
|
1002
1005
|
required: required && !hasMultipleSelection,
|
|
1003
1006
|
readOnly: readOnly,
|
|
1004
1007
|
value: serializedValue,
|
|
1005
1008
|
ref: hiddenInputRef,
|
|
1006
|
-
style: visuallyHidden,
|
|
1009
|
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
1007
1010
|
tabIndex: -1,
|
|
1008
1011
|
"aria-hidden": true
|
|
1009
1012
|
}), hiddenInputs]
|