@base-ui/react 1.7.0 → 1.8.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 +143 -0
- package/accordion/header/AccordionHeaderDataAttributes.d.mts +13 -15
- package/accordion/header/AccordionHeaderDataAttributes.d.ts +13 -15
- package/accordion/header/AccordionHeaderDataAttributes.js +14 -17
- package/accordion/header/AccordionHeaderDataAttributes.mjs +13 -16
- package/accordion/item/AccordionItemDataAttributes.d.mts +13 -15
- package/accordion/item/AccordionItemDataAttributes.d.ts +13 -15
- package/accordion/item/AccordionItemDataAttributes.js +14 -17
- package/accordion/item/AccordionItemDataAttributes.mjs +13 -16
- package/accordion/item/stateAttributesMapping.js +3 -2
- package/accordion/item/stateAttributesMapping.mjs +1 -1
- package/accordion/panel/AccordionPanel.js +3 -3
- package/accordion/panel/AccordionPanel.mjs +1 -1
- package/accordion/panel/AccordionPanelCssVars.d.mts +10 -12
- package/accordion/panel/AccordionPanelCssVars.d.ts +10 -12
- package/accordion/panel/AccordionPanelCssVars.js +11 -14
- package/accordion/panel/AccordionPanelCssVars.mjs +10 -13
- package/accordion/panel/AccordionPanelDataAttributes.d.mts +25 -27
- package/accordion/panel/AccordionPanelDataAttributes.d.ts +25 -27
- package/accordion/panel/AccordionPanelDataAttributes.js +26 -29
- package/accordion/panel/AccordionPanelDataAttributes.mjs +26 -28
- package/accordion/root/AccordionRoot.d.mts +1 -0
- package/accordion/root/AccordionRoot.d.ts +1 -0
- package/accordion/root/AccordionRoot.js +2 -9
- package/accordion/root/AccordionRoot.mjs +2 -9
- package/accordion/root/AccordionRootDataAttributes.d.mts +8 -10
- package/accordion/root/AccordionRootDataAttributes.d.ts +8 -10
- package/accordion/root/AccordionRootDataAttributes.js +9 -12
- package/accordion/root/AccordionRootDataAttributes.mjs +8 -11
- package/accordion/trigger/AccordionTriggerDataAttributes.d.mts +8 -10
- package/accordion/trigger/AccordionTriggerDataAttributes.d.ts +8 -10
- package/accordion/trigger/AccordionTriggerDataAttributes.js +9 -12
- package/accordion/trigger/AccordionTriggerDataAttributes.mjs +8 -11
- package/alert-dialog/root/AlertDialogRoot.d.mts +1 -1
- package/alert-dialog/root/AlertDialogRoot.d.ts +1 -1
- package/alert-dialog/trigger/AlertDialogTriggerDataAttributes.d.mts +8 -10
- package/alert-dialog/trigger/AlertDialogTriggerDataAttributes.d.ts +8 -10
- package/alert-dialog/trigger/AlertDialogTriggerDataAttributes.js +9 -12
- package/alert-dialog/trigger/AlertDialogTriggerDataAttributes.mjs +9 -11
- package/autocomplete/clear/AutocompleteClearDataAttributes.d.mts +1 -1
- package/autocomplete/clear/AutocompleteClearDataAttributes.d.ts +1 -1
- package/autocomplete/clear/AutocompleteClearDataAttributes.js +11 -7
- package/autocomplete/clear/AutocompleteClearDataAttributes.mjs +1 -1
- package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.d.mts +49 -51
- package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.d.ts +49 -51
- package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.js +50 -53
- package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.mjs +49 -52
- package/autocomplete/item/AutocompleteItemDataAttributes.d.mts +8 -10
- package/autocomplete/item/AutocompleteItemDataAttributes.d.ts +8 -10
- package/autocomplete/item/AutocompleteItemDataAttributes.js +11 -13
- package/autocomplete/item/AutocompleteItemDataAttributes.mjs +10 -12
- package/autocomplete/root/AutocompleteRoot.d.mts +24 -2
- package/autocomplete/root/AutocompleteRoot.d.ts +24 -2
- package/autocomplete/root/AutocompleteRoot.js +10 -23
- package/autocomplete/root/AutocompleteRoot.mjs +10 -23
- package/autocomplete/trigger/AutocompleteTrigger.d.mts +4 -0
- package/autocomplete/trigger/AutocompleteTrigger.d.ts +4 -0
- package/autocomplete/trigger/AutocompleteTriggerDataAttributes.d.mts +53 -55
- package/autocomplete/trigger/AutocompleteTriggerDataAttributes.d.ts +53 -55
- package/autocomplete/trigger/AutocompleteTriggerDataAttributes.js +54 -57
- package/autocomplete/trigger/AutocompleteTriggerDataAttributes.mjs +54 -56
- package/avatar/image/AvatarImage.d.mts +6 -0
- package/avatar/image/AvatarImage.d.ts +6 -0
- package/avatar/image/AvatarImage.js +75 -9
- package/avatar/image/AvatarImage.mjs +75 -9
- package/avatar/image/AvatarImageDataAttributes.d.mts +16 -10
- package/avatar/image/AvatarImageDataAttributes.d.ts +16 -10
- package/avatar/image/AvatarImageDataAttributes.js +17 -12
- package/avatar/image/AvatarImageDataAttributes.mjs +17 -11
- package/avatar/image/useImageLoadingStatus.d.mts +1 -1
- package/avatar/image/useImageLoadingStatus.d.ts +1 -1
- package/avatar/image/useImageLoadingStatus.js +8 -4
- package/avatar/image/useImageLoadingStatus.mjs +8 -4
- package/button/ButtonDataAttributes.d.mts +4 -6
- package/button/ButtonDataAttributes.d.ts +4 -6
- package/button/ButtonDataAttributes.js +5 -8
- package/button/ButtonDataAttributes.mjs +4 -7
- package/checkbox/indicator/CheckboxIndicator.js +2 -0
- package/checkbox/indicator/CheckboxIndicator.mjs +2 -0
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.d.mts +56 -58
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.d.ts +56 -58
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.js +57 -60
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.mjs +57 -59
- package/checkbox/root/CheckboxRoot.js +32 -44
- package/checkbox/root/CheckboxRoot.mjs +32 -44
- package/checkbox/root/CheckboxRootDataAttributes.d.mts +48 -50
- package/checkbox/root/CheckboxRootDataAttributes.d.ts +48 -50
- package/checkbox/root/CheckboxRootDataAttributes.js +49 -52
- package/checkbox/root/CheckboxRootDataAttributes.mjs +48 -51
- package/checkbox/utils/getCheckboxStateAttributesMapping.js +4 -2
- package/checkbox/utils/getCheckboxStateAttributesMapping.mjs +3 -2
- package/checkbox-group/CheckboxGroup.js +17 -8
- package/checkbox-group/CheckboxGroup.mjs +17 -8
- package/checkbox-group/CheckboxGroupContext.d.mts +6 -0
- package/checkbox-group/CheckboxGroupContext.d.ts +6 -0
- package/checkbox-group/CheckboxGroupDataAttributes.d.mts +4 -6
- package/checkbox-group/CheckboxGroupDataAttributes.d.ts +4 -6
- package/checkbox-group/CheckboxGroupDataAttributes.js +5 -8
- package/checkbox-group/CheckboxGroupDataAttributes.mjs +4 -7
- package/checkbox-group/useCheckboxGroupParent.d.mts +5 -3
- package/checkbox-group/useCheckboxGroupParent.d.ts +5 -3
- package/checkbox-group/useCheckboxGroupParent.js +37 -9
- package/checkbox-group/useCheckboxGroupParent.mjs +37 -9
- package/collapsible/panel/CollapsiblePanel.js +3 -3
- package/collapsible/panel/CollapsiblePanel.mjs +1 -1
- package/collapsible/panel/CollapsiblePanelCssVars.d.mts +10 -12
- package/collapsible/panel/CollapsiblePanelCssVars.d.ts +10 -12
- package/collapsible/panel/CollapsiblePanelCssVars.js +11 -14
- package/collapsible/panel/CollapsiblePanelCssVars.mjs +10 -13
- package/collapsible/panel/CollapsiblePanelDataAttributes.d.mts +16 -18
- package/collapsible/panel/CollapsiblePanelDataAttributes.d.ts +16 -18
- package/collapsible/panel/CollapsiblePanelDataAttributes.js +17 -20
- package/collapsible/panel/CollapsiblePanelDataAttributes.mjs +17 -19
- package/collapsible/panel/useCollapsiblePanel.js +2 -2
- package/collapsible/panel/useCollapsiblePanel.mjs +1 -1
- package/collapsible/root/CollapsibleRootDataAttributes.d.mts +16 -18
- package/collapsible/root/CollapsibleRootDataAttributes.d.ts +16 -18
- package/collapsible/root/CollapsibleRootDataAttributes.js +17 -20
- package/collapsible/root/CollapsibleRootDataAttributes.mjs +17 -19
- package/collapsible/root/useCollapsibleRoot.js +1 -1
- package/collapsible/root/useCollapsibleRoot.mjs +1 -1
- package/collapsible/trigger/CollapsibleTriggerDataAttributes.d.mts +4 -6
- package/collapsible/trigger/CollapsibleTriggerDataAttributes.d.ts +4 -6
- package/collapsible/trigger/CollapsibleTriggerDataAttributes.js +5 -8
- package/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs +4 -7
- package/combobox/arrow/ComboboxArrow.js +1 -3
- package/combobox/arrow/ComboboxArrow.mjs +1 -3
- package/combobox/arrow/ComboboxArrowDataAttributes.d.mts +22 -24
- package/combobox/arrow/ComboboxArrowDataAttributes.d.ts +22 -24
- package/combobox/arrow/ComboboxArrowDataAttributes.js +23 -26
- package/combobox/arrow/ComboboxArrowDataAttributes.mjs +23 -25
- package/combobox/backdrop/ComboboxBackdrop.js +3 -5
- package/combobox/backdrop/ComboboxBackdrop.mjs +3 -5
- package/combobox/backdrop/ComboboxBackdropDataAttributes.d.mts +16 -18
- package/combobox/backdrop/ComboboxBackdropDataAttributes.d.ts +16 -18
- package/combobox/backdrop/ComboboxBackdropDataAttributes.js +17 -20
- package/combobox/backdrop/ComboboxBackdropDataAttributes.mjs +17 -19
- package/combobox/chip/ComboboxChip.js +7 -9
- package/combobox/chip/ComboboxChip.mjs +7 -9
- package/combobox/chip-remove/ComboboxChipRemove.js +9 -11
- package/combobox/chip-remove/ComboboxChipRemove.mjs +9 -11
- package/combobox/chips/ComboboxChips.js +4 -6
- package/combobox/chips/ComboboxChips.mjs +4 -6
- package/combobox/clear/ComboboxClear.js +14 -16
- package/combobox/clear/ComboboxClear.mjs +14 -16
- package/combobox/clear/ComboboxClearDataAttributes.d.mts +20 -22
- package/combobox/clear/ComboboxClearDataAttributes.d.ts +20 -22
- package/combobox/clear/ComboboxClearDataAttributes.js +21 -24
- package/combobox/clear/ComboboxClearDataAttributes.mjs +21 -23
- package/combobox/collection/GroupCollectionContext.d.mts +1 -1
- package/combobox/collection/GroupCollectionContext.d.ts +1 -1
- package/combobox/empty/ComboboxEmpty.js +1 -1
- package/combobox/empty/ComboboxEmpty.mjs +1 -1
- package/combobox/group/ComboboxGroup.js +6 -1
- package/combobox/group/ComboboxGroup.mjs +6 -1
- package/combobox/group-label/ComboboxGroupLabel.js +2 -1
- package/combobox/group-label/ComboboxGroupLabel.mjs +2 -1
- package/combobox/index.d.mts +3 -1
- package/combobox/index.d.ts +3 -1
- package/combobox/index.parts.d.mts +2 -1
- package/combobox/index.parts.d.ts +2 -1
- package/combobox/index.parts.js +8 -1
- package/combobox/index.parts.mjs +2 -1
- package/combobox/input/ComboboxInput.js +44 -40
- package/combobox/input/ComboboxInput.mjs +44 -40
- package/combobox/input/ComboboxInputDataAttributes.d.mts +53 -55
- package/combobox/input/ComboboxInputDataAttributes.d.ts +53 -55
- package/combobox/input/ComboboxInputDataAttributes.js +54 -57
- package/combobox/input/ComboboxInputDataAttributes.mjs +54 -56
- package/combobox/input-group/ComboboxInputGroup.js +7 -9
- package/combobox/input-group/ComboboxInputGroup.mjs +7 -9
- package/combobox/input-group/ComboboxInputGroupDataAttributes.d.mts +53 -55
- package/combobox/input-group/ComboboxInputGroupDataAttributes.d.ts +53 -55
- package/combobox/input-group/ComboboxInputGroupDataAttributes.js +54 -57
- package/combobox/input-group/ComboboxInputGroupDataAttributes.mjs +53 -56
- package/combobox/item/ComboboxItem.js +28 -26
- package/combobox/item/ComboboxItem.mjs +29 -27
- package/combobox/item/ComboboxItemDataAttributes.d.mts +12 -14
- package/combobox/item/ComboboxItemDataAttributes.d.ts +12 -14
- package/combobox/item/ComboboxItemDataAttributes.js +13 -16
- package/combobox/item/ComboboxItemDataAttributes.mjs +12 -15
- package/combobox/item-indicator/ComboboxItemIndicator.js +2 -0
- package/combobox/item-indicator/ComboboxItemIndicator.mjs +2 -0
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.d.mts +8 -10
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.d.ts +8 -10
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.js +9 -12
- package/combobox/item-indicator/ComboboxItemIndicatorDataAttributes.mjs +9 -11
- package/combobox/items/createItems.d.mts +53 -0
- package/combobox/items/createItems.d.ts +53 -0
- package/combobox/items/createItems.js +93 -0
- package/combobox/items/createItems.mjs +88 -0
- package/combobox/items/itemCollection.d.mts +39 -0
- package/combobox/items/itemCollection.d.ts +39 -0
- package/combobox/items/itemCollection.js +33 -0
- package/combobox/items/itemCollection.mjs +27 -0
- package/combobox/label/ComboboxLabel.js +4 -6
- package/combobox/label/ComboboxLabel.mjs +4 -6
- package/combobox/list/ComboboxList.js +13 -11
- package/combobox/list/ComboboxList.mjs +13 -11
- package/combobox/popup/ComboboxPopup.js +17 -19
- package/combobox/popup/ComboboxPopup.mjs +17 -19
- package/combobox/popup/ComboboxPopupDataAttributes.d.mts +34 -37
- package/combobox/popup/ComboboxPopupDataAttributes.d.ts +34 -37
- package/combobox/popup/ComboboxPopupDataAttributes.js +35 -39
- package/combobox/popup/ComboboxPopupDataAttributes.mjs +35 -38
- package/combobox/portal/ComboboxPortal.js +2 -4
- package/combobox/portal/ComboboxPortal.mjs +2 -4
- package/combobox/positioner/ComboboxPositioner.js +10 -12
- package/combobox/positioner/ComboboxPositioner.mjs +10 -12
- package/combobox/positioner/ComboboxPositionerCssVars.d.mts +25 -27
- package/combobox/positioner/ComboboxPositionerCssVars.d.ts +25 -27
- package/combobox/positioner/ComboboxPositionerCssVars.js +26 -29
- package/combobox/positioner/ComboboxPositionerCssVars.mjs +25 -28
- package/combobox/positioner/ComboboxPositionerDataAttributes.d.mts +26 -28
- package/combobox/positioner/ComboboxPositionerDataAttributes.d.ts +26 -28
- package/combobox/positioner/ComboboxPositionerDataAttributes.js +27 -30
- package/combobox/positioner/ComboboxPositionerDataAttributes.mjs +27 -29
- package/combobox/root/AriaCombobox.d.mts +32 -11
- package/combobox/root/AriaCombobox.d.ts +32 -11
- package/combobox/root/AriaCombobox.js +308 -168
- package/combobox/root/AriaCombobox.mjs +310 -171
- package/combobox/root/ComboboxRoot.d.mts +7 -3
- package/combobox/root/ComboboxRoot.d.ts +7 -3
- package/combobox/root/ComboboxRootContext.d.mts +5 -1
- package/combobox/root/ComboboxRootContext.d.ts +5 -1
- package/combobox/root/utils/index.d.mts +5 -2
- package/combobox/root/utils/index.d.ts +5 -2
- package/combobox/root/utils/index.js +2 -1
- package/combobox/root/utils/index.mjs +2 -1
- package/combobox/root/utils/useFilter.d.mts +2 -1
- package/combobox/root/utils/useFilter.d.ts +2 -1
- package/combobox/root/utils/useFilteredItems.d.mts +1 -0
- package/combobox/root/utils/useFilteredItems.d.ts +1 -0
- package/combobox/root/utils/useFilteredItems.js +1 -0
- package/combobox/root/utils/useFilteredItems.mjs +1 -0
- package/combobox/store.d.mts +55 -28
- package/combobox/store.d.ts +55 -28
- package/combobox/store.js +5 -0
- package/combobox/store.mjs +6 -0
- package/combobox/trigger/ComboboxTrigger.d.mts +4 -0
- package/combobox/trigger/ComboboxTrigger.d.ts +4 -0
- package/combobox/trigger/ComboboxTrigger.js +34 -33
- package/combobox/trigger/ComboboxTrigger.mjs +34 -33
- package/combobox/trigger/ComboboxTriggerDataAttributes.d.mts +57 -59
- package/combobox/trigger/ComboboxTriggerDataAttributes.d.ts +57 -59
- package/combobox/trigger/ComboboxTriggerDataAttributes.js +58 -61
- package/combobox/trigger/ComboboxTriggerDataAttributes.mjs +58 -60
- package/combobox/utils/ComboboxInternalDismissButton.js +1 -1
- package/combobox/utils/ComboboxInternalDismissButton.mjs +1 -1
- package/combobox/utils/handleInputPress.d.mts +1 -1
- package/combobox/utils/handleInputPress.d.ts +1 -1
- package/combobox/utils/handleInputPress.js +4 -4
- package/combobox/utils/handleInputPress.mjs +4 -4
- package/combobox/utils/parts.d.mts +1 -1
- package/combobox/utils/parts.d.ts +1 -1
- package/combobox/utils/parts.js +6 -8
- package/combobox/utils/parts.mjs +6 -8
- package/combobox/utils/stateAttributesMapping.d.mts +4 -4
- package/combobox/utils/stateAttributesMapping.d.ts +4 -4
- package/combobox/utils/stateAttributesMapping.js +4 -2
- package/combobox/utils/stateAttributesMapping.mjs +3 -2
- package/combobox/value/ComboboxValue.d.mts +5 -0
- package/combobox/value/ComboboxValue.d.ts +5 -0
- package/combobox/value/ComboboxValue.js +6 -8
- package/combobox/value/ComboboxValue.mjs +6 -8
- package/context-menu/index.d.mts +1 -1
- package/context-menu/index.d.ts +1 -1
- package/context-menu/index.parts.d.mts +1 -1
- package/context-menu/index.parts.d.ts +1 -1
- package/context-menu/index.parts.js +2 -2
- package/context-menu/index.parts.mjs +1 -1
- package/context-menu/positioner/ContextMenuPositioner.d.mts +95 -0
- package/context-menu/positioner/ContextMenuPositioner.d.ts +95 -0
- package/context-menu/positioner/ContextMenuPositioner.js +15 -0
- package/context-menu/positioner/ContextMenuPositioner.mjs +10 -0
- package/context-menu/positioner/ContextMenuPositionerCssVars.d.mts +1 -0
- package/context-menu/positioner/ContextMenuPositionerCssVars.d.ts +1 -0
- package/context-menu/positioner/ContextMenuPositionerCssVars.js +16 -0
- package/context-menu/positioner/ContextMenuPositionerCssVars.mjs +1 -0
- package/context-menu/positioner/ContextMenuPositionerDataAttributes.d.mts +1 -0
- package/context-menu/positioner/ContextMenuPositionerDataAttributes.d.ts +1 -0
- package/context-menu/positioner/ContextMenuPositionerDataAttributes.js +16 -0
- package/context-menu/positioner/ContextMenuPositionerDataAttributes.mjs +1 -0
- package/context-menu/root/ContextMenuRoot.d.mts +7 -2
- package/context-menu/root/ContextMenuRoot.d.ts +7 -2
- package/context-menu/trigger/ContextMenuTriggerDataAttributes.d.mts +8 -10
- package/context-menu/trigger/ContextMenuTriggerDataAttributes.d.ts +8 -10
- package/context-menu/trigger/ContextMenuTriggerDataAttributes.js +9 -12
- package/context-menu/trigger/ContextMenuTriggerDataAttributes.mjs +9 -11
- package/csp-provider/CSPProvider.d.mts +1 -1
- package/csp-provider/CSPProvider.d.ts +1 -1
- package/dialog/backdrop/DialogBackdropDataAttributes.d.mts +16 -18
- package/dialog/backdrop/DialogBackdropDataAttributes.d.ts +16 -18
- package/dialog/backdrop/DialogBackdropDataAttributes.js +17 -20
- package/dialog/backdrop/DialogBackdropDataAttributes.mjs +17 -19
- package/dialog/close/DialogCloseDataAttributes.d.mts +4 -6
- package/dialog/close/DialogCloseDataAttributes.d.ts +4 -6
- package/dialog/close/DialogCloseDataAttributes.js +5 -8
- package/dialog/close/DialogCloseDataAttributes.mjs +4 -7
- package/dialog/popup/DialogPopup.js +2 -1
- package/dialog/popup/DialogPopup.mjs +2 -1
- package/dialog/popup/DialogPopupCssVars.d.mts +5 -7
- package/dialog/popup/DialogPopupCssVars.d.ts +5 -7
- package/dialog/popup/DialogPopupCssVars.js +6 -9
- package/dialog/popup/DialogPopupCssVars.mjs +5 -8
- package/dialog/popup/DialogPopupDataAttributes.d.mts +24 -26
- package/dialog/popup/DialogPopupDataAttributes.d.ts +24 -26
- package/dialog/popup/DialogPopupDataAttributes.js +25 -28
- package/dialog/popup/DialogPopupDataAttributes.mjs +25 -27
- package/dialog/root/DialogRoot.d.mts +1 -1
- package/dialog/root/DialogRoot.d.ts +1 -1
- package/dialog/root/DialogRoot.js +5 -3
- package/dialog/root/DialogRoot.mjs +4 -2
- package/dialog/root/useRenderDialogRoot.d.mts +2 -1
- package/dialog/root/useRenderDialogRoot.d.ts +2 -1
- package/dialog/store/DialogStore.js +2 -7
- package/dialog/store/DialogStore.mjs +3 -8
- package/dialog/trigger/DialogTrigger.js +2 -1
- package/dialog/trigger/DialogTrigger.mjs +2 -1
- package/dialog/trigger/DialogTriggerDataAttributes.d.mts +8 -10
- package/dialog/trigger/DialogTriggerDataAttributes.d.ts +8 -10
- package/dialog/trigger/DialogTriggerDataAttributes.js +9 -12
- package/dialog/trigger/DialogTriggerDataAttributes.mjs +9 -11
- package/dialog/utils/stateAttributesMapping.js +3 -1
- package/dialog/utils/stateAttributesMapping.mjs +3 -1
- package/dialog/viewport/DialogViewportDataAttributes.d.mts +24 -26
- package/dialog/viewport/DialogViewportDataAttributes.d.ts +24 -26
- package/dialog/viewport/DialogViewportDataAttributes.js +25 -28
- package/dialog/viewport/DialogViewportDataAttributes.mjs +25 -27
- package/docs/index.md +2 -1
- package/docs/react/components/accordion.md +326 -5
- package/docs/react/components/alert-dialog.md +376 -16
- package/docs/react/components/autocomplete.md +49 -43
- package/docs/react/components/avatar.md +49 -0
- package/docs/react/components/button.md +7 -3
- package/docs/react/components/collapsible.md +18 -0
- package/docs/react/components/combobox.md +990 -226
- package/docs/react/components/context-menu.md +47 -49
- package/docs/react/components/dialog.md +358 -14
- package/docs/react/components/field.md +14 -14
- package/docs/react/components/menu.md +29 -28
- package/docs/react/components/navigation-menu.md +4 -0
- package/docs/react/components/popover.md +1 -0
- package/docs/react/components/preview-card.md +5 -4
- package/docs/react/components/select.md +7 -7
- package/docs/react/components/slider.md +414 -49
- package/docs/react/components/tabs.md +1 -4
- package/docs/react/components/toast.md +19 -4
- package/docs/react/overview/community.md +2 -5
- package/docs/react/overview/releases/v1-8-0.md +148 -0
- package/docs/react/overview/releases.md +11 -1
- package/docs/react/utils/use-render.md +4 -362
- package/drawer/backdrop/DrawerBackdrop.js +4 -4
- package/drawer/backdrop/DrawerBackdrop.mjs +2 -2
- package/drawer/backdrop/DrawerBackdropCssVars.d.mts +5 -7
- package/drawer/backdrop/DrawerBackdropCssVars.d.ts +5 -7
- package/drawer/backdrop/DrawerBackdropCssVars.js +6 -9
- package/drawer/backdrop/DrawerBackdropCssVars.mjs +5 -8
- package/drawer/backdrop/DrawerBackdropDataAttributes.d.mts +16 -18
- package/drawer/backdrop/DrawerBackdropDataAttributes.d.ts +16 -18
- package/drawer/backdrop/DrawerBackdropDataAttributes.js +17 -20
- package/drawer/backdrop/DrawerBackdropDataAttributes.mjs +17 -19
- package/drawer/content/DrawerContent.js +2 -2
- package/drawer/content/DrawerContent.mjs +1 -1
- package/drawer/indent/DrawerIndent.js +9 -9
- package/drawer/indent/DrawerIndent.mjs +2 -2
- package/drawer/popup/DrawerPopup.js +22 -22
- package/drawer/popup/DrawerPopup.mjs +3 -3
- package/drawer/popup/DrawerPopupCssVars.d.mts +35 -37
- package/drawer/popup/DrawerPopupCssVars.d.ts +35 -37
- package/drawer/popup/DrawerPopupCssVars.js +36 -39
- package/drawer/popup/DrawerPopupCssVars.mjs +35 -38
- package/drawer/popup/DrawerPopupDataAttributes.d.mts +41 -43
- package/drawer/popup/DrawerPopupDataAttributes.d.ts +41 -43
- package/drawer/popup/DrawerPopupDataAttributes.js +42 -45
- package/drawer/popup/DrawerPopupDataAttributes.mjs +42 -44
- package/drawer/provider/DrawerProvider.d.mts +1 -1
- package/drawer/provider/DrawerProvider.d.ts +1 -1
- package/drawer/root/DrawerRoot.d.mts +1 -1
- package/drawer/root/DrawerRoot.d.ts +1 -1
- package/drawer/root/useDrawerSnapPoints.js +1 -1
- package/drawer/root/useDrawerSnapPoints.mjs +1 -1
- package/drawer/swipe-area/DrawerSwipeArea.js +34 -25
- package/drawer/swipe-area/DrawerSwipeArea.mjs +14 -5
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.mts +21 -23
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.d.ts +21 -23
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.js +22 -25
- package/drawer/swipe-area/DrawerSwipeAreaDataAttributes.mjs +22 -24
- package/drawer/viewport/DrawerViewport.js +66 -35
- package/drawer/viewport/DrawerViewport.mjs +54 -23
- package/drawer/viewport/DrawerViewportCssVars.d.mts +6 -8
- package/drawer/viewport/DrawerViewportCssVars.d.ts +6 -8
- package/drawer/viewport/DrawerViewportCssVars.js +7 -10
- package/drawer/viewport/DrawerViewportCssVars.mjs +6 -9
- package/drawer/viewport/DrawerViewportDataAttributes.d.mts +20 -22
- package/drawer/viewport/DrawerViewportDataAttributes.d.ts +20 -22
- package/drawer/viewport/DrawerViewportDataAttributes.js +21 -24
- package/drawer/viewport/DrawerViewportDataAttributes.mjs +21 -23
- package/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.d.mts +1 -1
- package/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.d.ts +1 -1
- package/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.js +4 -4
- package/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardProvider.mjs +2 -2
- package/field/control/FieldControl.js +67 -20
- package/field/control/FieldControl.mjs +67 -20
- package/field/control/FieldControlDataAttributes.d.mts +28 -30
- package/field/control/FieldControlDataAttributes.d.ts +28 -30
- package/field/control/FieldControlDataAttributes.js +29 -32
- package/field/control/FieldControlDataAttributes.mjs +28 -31
- package/field/description/FieldDescriptionDataAttributes.d.mts +28 -30
- package/field/description/FieldDescriptionDataAttributes.d.ts +28 -30
- package/field/description/FieldDescriptionDataAttributes.js +29 -32
- package/field/description/FieldDescriptionDataAttributes.mjs +28 -31
- package/field/error/FieldErrorDataAttributes.d.mts +36 -38
- package/field/error/FieldErrorDataAttributes.d.ts +36 -38
- package/field/error/FieldErrorDataAttributes.js +37 -40
- package/field/error/FieldErrorDataAttributes.mjs +37 -39
- package/field/item/FieldItemDataAttributes.d.mts +28 -30
- package/field/item/FieldItemDataAttributes.d.ts +28 -30
- package/field/item/FieldItemDataAttributes.js +29 -32
- package/field/item/FieldItemDataAttributes.mjs +28 -31
- package/field/label/FieldLabelDataAttributes.d.mts +28 -30
- package/field/label/FieldLabelDataAttributes.d.ts +28 -30
- package/field/label/FieldLabelDataAttributes.js +29 -32
- package/field/label/FieldLabelDataAttributes.mjs +28 -31
- package/field/root/FieldRoot.d.mts +3 -2
- package/field/root/FieldRoot.d.ts +3 -2
- package/field/root/FieldRoot.js +4 -2
- package/field/root/FieldRoot.mjs +4 -2
- package/field/root/FieldRootDataAttributes.d.mts +28 -30
- package/field/root/FieldRootDataAttributes.d.ts +28 -30
- package/field/root/FieldRootDataAttributes.js +29 -32
- package/field/root/FieldRootDataAttributes.mjs +28 -31
- package/field/root/useFieldValidation.d.mts +3 -2
- package/field/root/useFieldValidation.d.ts +3 -2
- package/field/root/useFieldValidation.js +116 -91
- package/field/root/useFieldValidation.mjs +116 -91
- package/floating-ui-react/components/FloatingDelayGroup.js +2 -1
- package/floating-ui-react/components/FloatingDelayGroup.mjs +2 -1
- package/floating-ui-react/components/FloatingPortal.d.mts +5 -0
- package/floating-ui-react/components/FloatingPortal.d.ts +5 -0
- package/floating-ui-react/components/FloatingPortal.js +2 -0
- package/floating-ui-react/components/FloatingPortal.mjs +2 -0
- package/floating-ui-react/hooks/useDismiss.d.mts +1 -1
- package/floating-ui-react/hooks/useDismiss.d.ts +1 -1
- package/floating-ui-react/hooks/useDismiss.js +65 -10
- package/floating-ui-react/hooks/useDismiss.mjs +66 -11
- package/floating-ui-react/hooks/useFloatingRootContext.js +0 -2
- package/floating-ui-react/hooks/useFloatingRootContext.mjs +0 -2
- package/floating-ui-react/hooks/useFocus.js +1 -0
- package/floating-ui-react/hooks/useFocus.mjs +1 -0
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +1 -1
- package/floating-ui-react/hooks/useHoverReferenceInteraction.mjs +1 -1
- package/floating-ui-react/hooks/useListNavigation.js +1 -2
- package/floating-ui-react/hooks/useListNavigation.mjs +1 -2
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.mts +9 -4
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +9 -4
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +5 -0
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs +6 -0
- package/floating-ui-react/middleware/arrow.js +11 -4
- package/floating-ui-react/middleware/arrow.mjs +11 -4
- package/floating-ui-react/utils/element.d.mts +1 -1
- package/floating-ui-react/utils/element.d.ts +1 -1
- package/floating-ui-react/utils/element.js +5 -3
- package/floating-ui-react/utils/element.mjs +4 -3
- package/form/Form.js +13 -7
- package/form/Form.mjs +13 -7
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/input/InputDataAttributes.d.mts +28 -30
- package/input/InputDataAttributes.d.ts +28 -30
- package/input/InputDataAttributes.js +29 -32
- package/input/InputDataAttributes.mjs +28 -31
- package/internals/PrehydrationScript.d.mts +2 -1
- package/internals/PrehydrationScript.d.ts +2 -1
- package/internals/TransitionStatusDataAttributes.d.mts +8 -0
- package/internals/TransitionStatusDataAttributes.d.ts +8 -0
- package/internals/TransitionStatusDataAttributes.js +15 -0
- package/internals/TransitionStatusDataAttributes.mjs +9 -0
- package/internals/composite/list/CompositeList.d.mts +1 -1
- package/internals/composite/list/CompositeList.d.ts +1 -1
- package/internals/composite/list/CompositeList.js +10 -2
- package/internals/composite/list/CompositeList.mjs +10 -2
- package/internals/composite/root/CompositeRoot.d.mts +1 -1
- package/internals/composite/root/CompositeRoot.d.ts +1 -1
- package/internals/composite/root/useCompositeRoot.js +45 -3
- package/internals/composite/root/useCompositeRoot.mjs +44 -2
- package/internals/field-constants/constants.js +4 -2
- package/internals/field-constants/constants.mjs +3 -2
- package/internals/field-register-control/useFieldControlRegistration.d.mts +1 -0
- package/internals/field-register-control/useFieldControlRegistration.d.ts +1 -0
- package/internals/field-register-control/useFieldControlRegistration.js +8 -0
- package/internals/field-register-control/useFieldControlRegistration.mjs +8 -0
- package/internals/filter.js +1 -1
- package/internals/filter.mjs +1 -1
- package/internals/form-context/FormContext.d.mts +1 -1
- package/internals/form-context/FormContext.d.ts +1 -1
- package/internals/form-context/FormContext.js +2 -2
- package/internals/form-context/FormContext.mjs +2 -2
- package/internals/itemEquality.d.mts +4 -1
- package/internals/itemEquality.d.ts +4 -1
- package/internals/itemEquality.js +40 -5
- package/internals/itemEquality.mjs +38 -5
- package/internals/labelable-provider/LabelableContext.d.mts +3 -1
- package/internals/labelable-provider/LabelableContext.d.ts +3 -1
- package/internals/labelable-provider/LabelableContext.js +1 -0
- package/internals/labelable-provider/LabelableContext.mjs +1 -0
- package/internals/labelable-provider/LabelableProvider.d.mts +0 -2
- package/internals/labelable-provider/LabelableProvider.d.ts +0 -2
- package/internals/labelable-provider/LabelableProvider.js +21 -12
- package/internals/labelable-provider/LabelableProvider.mjs +21 -12
- package/internals/labelable-provider/useLabel.d.mts +2 -2
- package/internals/labelable-provider/useLabel.d.ts +2 -2
- package/internals/labelable-provider/useLabel.js +1 -1
- package/internals/labelable-provider/useLabel.mjs +1 -1
- package/internals/labelable-provider/useLabelableId.d.mts +6 -7
- package/internals/labelable-provider/useLabelableId.d.ts +6 -7
- package/internals/labelable-provider/useLabelableId.js +27 -20
- package/internals/labelable-provider/useLabelableId.mjs +27 -20
- package/internals/resolveValueLabel.d.mts +1 -0
- package/internals/resolveValueLabel.d.ts +1 -0
- package/internals/resolveValueLabel.js +13 -3
- package/internals/resolveValueLabel.mjs +12 -3
- package/internals/stateAttributesMapping.d.mts +2 -10
- package/internals/stateAttributesMapping.d.ts +2 -10
- package/internals/stateAttributesMapping.js +5 -13
- package/internals/stateAttributesMapping.mjs +4 -13
- package/internals/temporal-adapter-luxon/TemporalAdapterLuxon.d.mts +1 -1
- package/internals/temporal-adapter-luxon/TemporalAdapterLuxon.d.ts +1 -1
- package/internals/useAnchorPositioning.js +34 -25
- package/internals/useAnchorPositioning.mjs +34 -25
- package/internals/useAnimationsFinished.d.mts +4 -1
- package/internals/useAnimationsFinished.d.ts +4 -1
- package/internals/useAnimationsFinished.js +45 -5
- package/internals/useAnimationsFinished.mjs +44 -5
- package/internals/useOpenChangeComplete.d.mts +6 -0
- package/internals/useOpenChangeComplete.d.ts +6 -0
- package/internals/useOpenChangeComplete.js +2 -1
- package/internals/useOpenChangeComplete.mjs +2 -1
- package/internals/usePressAndHold.js +8 -0
- package/internals/usePressAndHold.mjs +8 -0
- package/internals/useRenderElement.js +27 -15
- package/internals/useRenderElement.mjs +27 -15
- package/internals/useTransitionStatus.d.mts +5 -1
- package/internals/useTransitionStatus.d.ts +5 -1
- package/internals/useTransitionStatus.js +9 -2
- package/internals/useTransitionStatus.mjs +9 -2
- package/menu/arrow/MenuArrowDataAttributes.d.mts +22 -24
- package/menu/arrow/MenuArrowDataAttributes.d.ts +22 -24
- package/menu/arrow/MenuArrowDataAttributes.js +23 -26
- package/menu/arrow/MenuArrowDataAttributes.mjs +23 -25
- package/menu/backdrop/MenuBackdropDataAttributes.d.mts +16 -18
- package/menu/backdrop/MenuBackdropDataAttributes.d.ts +16 -18
- package/menu/backdrop/MenuBackdropDataAttributes.js +17 -20
- package/menu/backdrop/MenuBackdropDataAttributes.mjs +17 -19
- package/menu/checkbox-item/MenuCheckboxItemDataAttributes.d.mts +16 -18
- package/menu/checkbox-item/MenuCheckboxItemDataAttributes.d.ts +16 -18
- package/menu/checkbox-item/MenuCheckboxItemDataAttributes.js +17 -20
- package/menu/checkbox-item/MenuCheckboxItemDataAttributes.mjs +16 -19
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +2 -0
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.mjs +2 -0
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicatorDataAttributes.d.mts +20 -22
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicatorDataAttributes.d.ts +20 -22
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicatorDataAttributes.js +21 -24
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicatorDataAttributes.mjs +21 -23
- package/menu/group-label/MenuGroupLabel.js +1 -1
- package/menu/group-label/MenuGroupLabel.mjs +1 -1
- package/menu/item/MenuItemDataAttributes.d.mts +8 -10
- package/menu/item/MenuItemDataAttributes.d.ts +8 -10
- package/menu/item/MenuItemDataAttributes.js +9 -12
- package/menu/item/MenuItemDataAttributes.mjs +8 -11
- package/menu/link-item/MenuLinkItemDataAttributes.d.mts +4 -6
- package/menu/link-item/MenuLinkItemDataAttributes.d.ts +4 -6
- package/menu/link-item/MenuLinkItemDataAttributes.js +5 -8
- package/menu/link-item/MenuLinkItemDataAttributes.mjs +4 -7
- package/menu/popup/MenuPopupDataAttributes.d.mts +31 -33
- package/menu/popup/MenuPopupDataAttributes.d.ts +31 -33
- package/menu/popup/MenuPopupDataAttributes.js +32 -35
- package/menu/popup/MenuPopupDataAttributes.mjs +32 -34
- package/menu/portal/MenuPortal.js +9 -2
- package/menu/portal/MenuPortal.mjs +9 -2
- package/menu/positioner/MenuPositioner.d.mts +17 -1
- package/menu/positioner/MenuPositioner.d.ts +17 -1
- package/menu/positioner/MenuPositionerCssVars.d.mts +37 -39
- package/menu/positioner/MenuPositionerCssVars.d.ts +37 -39
- package/menu/positioner/MenuPositionerCssVars.js +38 -41
- package/menu/positioner/MenuPositionerCssVars.mjs +37 -40
- package/menu/positioner/MenuPositionerDataAttributes.d.mts +22 -24
- package/menu/positioner/MenuPositionerDataAttributes.d.ts +22 -24
- package/menu/positioner/MenuPositionerDataAttributes.js +23 -26
- package/menu/positioner/MenuPositionerDataAttributes.mjs +23 -25
- package/menu/radio-item/MenuRadioItemDataAttributes.d.mts +16 -18
- package/menu/radio-item/MenuRadioItemDataAttributes.d.ts +16 -18
- package/menu/radio-item/MenuRadioItemDataAttributes.js +17 -20
- package/menu/radio-item/MenuRadioItemDataAttributes.mjs +16 -19
- package/menu/radio-item-indicator/MenuRadioItemIndicator.js +2 -0
- package/menu/radio-item-indicator/MenuRadioItemIndicator.mjs +2 -0
- package/menu/radio-item-indicator/MenuRadioItemIndicatorDataAttributes.d.mts +20 -22
- package/menu/radio-item-indicator/MenuRadioItemIndicatorDataAttributes.d.ts +20 -22
- package/menu/radio-item-indicator/MenuRadioItemIndicatorDataAttributes.js +21 -24
- package/menu/radio-item-indicator/MenuRadioItemIndicatorDataAttributes.mjs +21 -23
- package/menu/root/MenuRoot.d.mts +1 -1
- package/menu/root/MenuRoot.d.ts +1 -1
- package/menu/root/MenuRoot.js +98 -19
- package/menu/root/MenuRoot.mjs +99 -20
- package/menu/store/MenuStore.d.mts +2 -2
- package/menu/store/MenuStore.d.ts +2 -2
- package/menu/store/MenuStore.js +12 -11
- package/menu/store/MenuStore.mjs +12 -11
- package/menu/submenu-root/MenuSubmenuRoot.d.mts +1 -1
- package/menu/submenu-root/MenuSubmenuRoot.d.ts +1 -1
- package/menu/submenu-trigger/MenuSubmenuTrigger.d.mts +1 -0
- package/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +1 -0
- package/menu/submenu-trigger/MenuSubmenuTrigger.js +16 -5
- package/menu/submenu-trigger/MenuSubmenuTrigger.mjs +16 -5
- package/menu/submenu-trigger/MenuSubmenuTriggerDataAttributes.d.mts +12 -14
- package/menu/submenu-trigger/MenuSubmenuTriggerDataAttributes.d.ts +12 -14
- package/menu/submenu-trigger/MenuSubmenuTriggerDataAttributes.js +13 -16
- package/menu/submenu-trigger/MenuSubmenuTriggerDataAttributes.mjs +13 -15
- package/menu/trigger/MenuTriggerDataAttributes.d.mts +12 -10
- package/menu/trigger/MenuTriggerDataAttributes.d.ts +12 -10
- package/menu/trigger/MenuTriggerDataAttributes.js +13 -12
- package/menu/trigger/MenuTriggerDataAttributes.mjs +13 -11
- package/menu/utils/stateAttributesMapping.js +4 -3
- package/menu/utils/stateAttributesMapping.mjs +1 -1
- package/menu/viewport/MenuViewportCssVars.d.mts +12 -14
- package/menu/viewport/MenuViewportCssVars.d.ts +12 -14
- package/menu/viewport/MenuViewportCssVars.js +13 -16
- package/menu/viewport/MenuViewportCssVars.mjs +12 -15
- package/menu/viewport/MenuViewportDataAttributes.d.mts +24 -26
- package/menu/viewport/MenuViewportDataAttributes.d.ts +24 -26
- package/menu/viewport/MenuViewportDataAttributes.js +25 -28
- package/menu/viewport/MenuViewportDataAttributes.mjs +24 -27
- package/menubar/Menubar.js +2 -2
- package/menubar/Menubar.mjs +1 -1
- package/menubar/MenubarDataAttributes.d.mts +13 -15
- package/menubar/MenubarDataAttributes.d.ts +13 -15
- package/menubar/MenubarDataAttributes.js +14 -17
- package/menubar/MenubarDataAttributes.mjs +13 -16
- package/meter/root/MeterRoot.js +2 -2
- package/meter/root/MeterRoot.mjs +2 -2
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.d.mts +22 -24
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.d.ts +22 -24
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.js +23 -26
- package/navigation-menu/arrow/NavigationMenuArrowDataAttributes.mjs +23 -25
- package/navigation-menu/backdrop/NavigationMenuBackdropDataAttributes.d.mts +16 -18
- package/navigation-menu/backdrop/NavigationMenuBackdropDataAttributes.d.ts +16 -18
- package/navigation-menu/backdrop/NavigationMenuBackdropDataAttributes.js +17 -20
- package/navigation-menu/backdrop/NavigationMenuBackdropDataAttributes.mjs +17 -19
- package/navigation-menu/content/NavigationMenuContent.js +2 -1
- package/navigation-menu/content/NavigationMenuContent.mjs +2 -1
- package/navigation-menu/content/NavigationMenuContentDataAttributes.d.mts +21 -23
- package/navigation-menu/content/NavigationMenuContentDataAttributes.d.ts +21 -23
- package/navigation-menu/content/NavigationMenuContentDataAttributes.js +22 -25
- package/navigation-menu/content/NavigationMenuContentDataAttributes.mjs +22 -24
- package/navigation-menu/icon/NavigationMenuIconDataAttributes.d.mts +4 -6
- package/navigation-menu/icon/NavigationMenuIconDataAttributes.d.ts +4 -6
- package/navigation-menu/icon/NavigationMenuIconDataAttributes.js +5 -8
- package/navigation-menu/icon/NavigationMenuIconDataAttributes.mjs +5 -7
- package/navigation-menu/link/NavigationMenuLinkDataAttributes.d.mts +4 -6
- package/navigation-menu/link/NavigationMenuLinkDataAttributes.d.ts +4 -6
- package/navigation-menu/link/NavigationMenuLinkDataAttributes.js +5 -8
- package/navigation-menu/link/NavigationMenuLinkDataAttributes.mjs +4 -7
- package/navigation-menu/popup/NavigationMenuPopupCssVars.d.mts +10 -12
- package/navigation-menu/popup/NavigationMenuPopupCssVars.d.ts +10 -12
- package/navigation-menu/popup/NavigationMenuPopupCssVars.js +11 -14
- package/navigation-menu/popup/NavigationMenuPopupCssVars.mjs +10 -13
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.d.mts +30 -32
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.d.ts +30 -32
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.js +31 -34
- package/navigation-menu/popup/NavigationMenuPopupDataAttributes.mjs +31 -33
- package/navigation-menu/positioner/NavigationMenuPositionerCssVars.d.mts +35 -37
- package/navigation-menu/positioner/NavigationMenuPositionerCssVars.d.ts +35 -37
- package/navigation-menu/positioner/NavigationMenuPositionerCssVars.js +36 -39
- package/navigation-menu/positioner/NavigationMenuPositionerCssVars.mjs +35 -38
- package/navigation-menu/positioner/NavigationMenuPositionerDataAttributes.d.mts +26 -28
- package/navigation-menu/positioner/NavigationMenuPositionerDataAttributes.d.ts +26 -28
- package/navigation-menu/positioner/NavigationMenuPositionerDataAttributes.js +27 -30
- package/navigation-menu/positioner/NavigationMenuPositionerDataAttributes.mjs +27 -29
- package/navigation-menu/root/NavigationMenuRoot.js +3 -3
- package/navigation-menu/root/NavigationMenuRoot.mjs +1 -1
- package/navigation-menu/trigger/NavigationMenuTrigger.d.mts +11 -1
- package/navigation-menu/trigger/NavigationMenuTrigger.d.ts +11 -1
- package/navigation-menu/trigger/NavigationMenuTrigger.js +25 -37
- package/navigation-menu/trigger/NavigationMenuTrigger.mjs +9 -21
- package/navigation-menu/trigger/NavigationMenuTriggerDataAttributes.d.mts +12 -10
- package/navigation-menu/trigger/NavigationMenuTriggerDataAttributes.d.ts +12 -10
- package/navigation-menu/trigger/NavigationMenuTriggerDataAttributes.js +13 -12
- package/navigation-menu/trigger/NavigationMenuTriggerDataAttributes.mjs +13 -11
- package/navigation-menu/utils/setSharedFixedSize.js +7 -6
- package/navigation-menu/utils/setSharedFixedSize.mjs +2 -2
- package/number-field/decrement/NumberFieldDecrementDataAttributes.d.mts +40 -42
- package/number-field/decrement/NumberFieldDecrementDataAttributes.d.ts +40 -42
- package/number-field/decrement/NumberFieldDecrementDataAttributes.js +41 -44
- package/number-field/decrement/NumberFieldDecrementDataAttributes.mjs +40 -43
- package/number-field/group/NumberFieldGroupDataAttributes.d.mts +40 -42
- package/number-field/group/NumberFieldGroupDataAttributes.d.ts +40 -42
- package/number-field/group/NumberFieldGroupDataAttributes.js +41 -44
- package/number-field/group/NumberFieldGroupDataAttributes.mjs +40 -43
- package/number-field/increment/NumberFieldIncrementDataAttributes.d.mts +40 -42
- package/number-field/increment/NumberFieldIncrementDataAttributes.d.ts +40 -42
- package/number-field/increment/NumberFieldIncrementDataAttributes.js +41 -44
- package/number-field/increment/NumberFieldIncrementDataAttributes.mjs +40 -43
- package/number-field/input/NumberFieldInput.js +1 -12
- package/number-field/input/NumberFieldInput.mjs +1 -12
- package/number-field/input/NumberFieldInputDataAttributes.d.mts +40 -42
- package/number-field/input/NumberFieldInputDataAttributes.d.ts +40 -42
- package/number-field/input/NumberFieldInputDataAttributes.js +41 -44
- package/number-field/input/NumberFieldInputDataAttributes.mjs +40 -43
- package/number-field/root/NumberFieldRoot.js +33 -7
- package/number-field/root/NumberFieldRoot.mjs +33 -7
- package/number-field/root/NumberFieldRootContext.d.mts +1 -0
- package/number-field/root/NumberFieldRootContext.d.ts +1 -0
- package/number-field/root/NumberFieldRootDataAttributes.d.mts +40 -42
- package/number-field/root/NumberFieldRootDataAttributes.d.ts +40 -42
- package/number-field/root/NumberFieldRootDataAttributes.js +41 -44
- package/number-field/root/NumberFieldRootDataAttributes.mjs +40 -43
- package/number-field/root/useNumberFieldStepperButton.js +2 -1
- package/number-field/root/useNumberFieldStepperButton.mjs +2 -1
- package/number-field/scrub-area/NumberFieldScrubArea.js +2 -1
- package/number-field/scrub-area/NumberFieldScrubArea.mjs +2 -1
- package/number-field/scrub-area/NumberFieldScrubAreaDataAttributes.d.mts +40 -42
- package/number-field/scrub-area/NumberFieldScrubAreaDataAttributes.d.ts +40 -42
- package/number-field/scrub-area/NumberFieldScrubAreaDataAttributes.js +41 -44
- package/number-field/scrub-area/NumberFieldScrubAreaDataAttributes.mjs +40 -43
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursorDataAttributes.d.mts +40 -42
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursorDataAttributes.d.ts +40 -42
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursorDataAttributes.js +41 -44
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursorDataAttributes.mjs +40 -43
- package/number-field/utils/parse.js +1 -1
- package/number-field/utils/parse.mjs +1 -1
- package/number-field/utils/validate.js +2 -2
- package/number-field/utils/validate.mjs +2 -2
- package/otp-field/input/OTPFieldInputDataAttributes.d.mts +40 -42
- package/otp-field/input/OTPFieldInputDataAttributes.d.ts +40 -42
- package/otp-field/input/OTPFieldInputDataAttributes.js +41 -44
- package/otp-field/input/OTPFieldInputDataAttributes.mjs +40 -43
- package/otp-field/root/OTPFieldRoot.js +1 -1
- package/otp-field/root/OTPFieldRoot.mjs +1 -1
- package/otp-field/root/OTPFieldRootDataAttributes.d.mts +40 -42
- package/otp-field/root/OTPFieldRootDataAttributes.d.ts +40 -42
- package/otp-field/root/OTPFieldRootDataAttributes.js +41 -44
- package/otp-field/root/OTPFieldRootDataAttributes.mjs +40 -43
- package/package.json +3 -45
- package/popover/arrow/PopoverArrowDataAttributes.d.mts +22 -24
- package/popover/arrow/PopoverArrowDataAttributes.d.ts +22 -24
- package/popover/arrow/PopoverArrowDataAttributes.js +23 -26
- package/popover/arrow/PopoverArrowDataAttributes.mjs +23 -25
- package/popover/backdrop/PopoverBackdropDataAttributes.d.mts +16 -18
- package/popover/backdrop/PopoverBackdropDataAttributes.d.ts +16 -18
- package/popover/backdrop/PopoverBackdropDataAttributes.js +17 -20
- package/popover/backdrop/PopoverBackdropDataAttributes.mjs +17 -19
- package/popover/popup/PopoverPopupCssVars.d.mts +8 -10
- package/popover/popup/PopoverPopupCssVars.d.ts +8 -10
- package/popover/popup/PopoverPopupCssVars.js +9 -12
- package/popover/popup/PopoverPopupCssVars.mjs +8 -11
- package/popover/popup/PopoverPopupDataAttributes.d.mts +31 -33
- package/popover/popup/PopoverPopupDataAttributes.d.ts +31 -33
- package/popover/popup/PopoverPopupDataAttributes.js +32 -35
- package/popover/popup/PopoverPopupDataAttributes.mjs +32 -34
- package/popover/positioner/PopoverPositionerCssVars.d.mts +37 -39
- package/popover/positioner/PopoverPositionerCssVars.d.ts +37 -39
- package/popover/positioner/PopoverPositionerCssVars.js +38 -41
- package/popover/positioner/PopoverPositionerCssVars.mjs +37 -40
- package/popover/positioner/PopoverPositionerDataAttributes.d.mts +22 -24
- package/popover/positioner/PopoverPositionerDataAttributes.d.ts +22 -24
- package/popover/positioner/PopoverPositionerDataAttributes.js +23 -26
- package/popover/positioner/PopoverPositionerDataAttributes.mjs +23 -25
- package/popover/root/PopoverRoot.d.mts +1 -1
- package/popover/root/PopoverRoot.d.ts +1 -1
- package/popover/root/PopoverRoot.js +4 -2
- package/popover/root/PopoverRoot.mjs +4 -2
- package/popover/store/PopoverStore.js +4 -8
- package/popover/store/PopoverStore.mjs +5 -9
- package/popover/trigger/PopoverTrigger.js +2 -1
- package/popover/trigger/PopoverTrigger.mjs +2 -1
- package/popover/trigger/PopoverTriggerDataAttributes.d.mts +12 -10
- package/popover/trigger/PopoverTriggerDataAttributes.d.ts +12 -10
- package/popover/trigger/PopoverTriggerDataAttributes.js +13 -12
- package/popover/trigger/PopoverTriggerDataAttributes.mjs +13 -11
- package/popover/viewport/PopoverViewportCssVars.d.mts +12 -14
- package/popover/viewport/PopoverViewportCssVars.d.ts +12 -14
- package/popover/viewport/PopoverViewportCssVars.js +13 -16
- package/popover/viewport/PopoverViewportCssVars.mjs +12 -15
- package/popover/viewport/PopoverViewportDataAttributes.d.mts +24 -26
- package/popover/viewport/PopoverViewportDataAttributes.d.ts +24 -26
- package/popover/viewport/PopoverViewportDataAttributes.js +25 -28
- package/popover/viewport/PopoverViewportDataAttributes.mjs +24 -27
- package/preview-card/arrow/PreviewCardArrowDataAttributes.d.mts +22 -24
- package/preview-card/arrow/PreviewCardArrowDataAttributes.d.ts +22 -24
- package/preview-card/arrow/PreviewCardArrowDataAttributes.js +23 -26
- package/preview-card/arrow/PreviewCardArrowDataAttributes.mjs +23 -25
- package/preview-card/backdrop/PreviewCardBackdropDataAttributes.d.mts +16 -18
- package/preview-card/backdrop/PreviewCardBackdropDataAttributes.d.ts +16 -18
- package/preview-card/backdrop/PreviewCardBackdropDataAttributes.js +17 -20
- package/preview-card/backdrop/PreviewCardBackdropDataAttributes.mjs +17 -19
- package/preview-card/popup/PreviewCardPopupDataAttributes.d.mts +26 -28
- package/preview-card/popup/PreviewCardPopupDataAttributes.d.ts +26 -28
- package/preview-card/popup/PreviewCardPopupDataAttributes.js +27 -30
- package/preview-card/popup/PreviewCardPopupDataAttributes.mjs +27 -29
- package/preview-card/positioner/PreviewCardPositionerCssVars.d.mts +37 -39
- package/preview-card/positioner/PreviewCardPositionerCssVars.d.ts +37 -39
- package/preview-card/positioner/PreviewCardPositionerCssVars.js +38 -41
- package/preview-card/positioner/PreviewCardPositionerCssVars.mjs +37 -40
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.d.mts +22 -24
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.d.ts +22 -24
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.js +23 -26
- package/preview-card/positioner/PreviewCardPositionerDataAttributes.mjs +23 -25
- package/preview-card/root/PreviewCardRoot.d.mts +1 -1
- package/preview-card/root/PreviewCardRoot.d.ts +1 -1
- package/preview-card/store/PreviewCardStore.js +1 -2
- package/preview-card/store/PreviewCardStore.mjs +2 -3
- package/preview-card/trigger/PreviewCardTriggerDataAttributes.d.mts +4 -6
- package/preview-card/trigger/PreviewCardTriggerDataAttributes.d.ts +4 -6
- package/preview-card/trigger/PreviewCardTriggerDataAttributes.js +5 -8
- package/preview-card/trigger/PreviewCardTriggerDataAttributes.mjs +5 -7
- package/preview-card/viewport/PreviewCardViewportCssVars.d.mts +12 -14
- package/preview-card/viewport/PreviewCardViewportCssVars.d.ts +12 -14
- package/preview-card/viewport/PreviewCardViewportCssVars.js +13 -16
- package/preview-card/viewport/PreviewCardViewportCssVars.mjs +12 -15
- package/preview-card/viewport/PreviewCardViewportDataAttributes.d.mts +24 -26
- package/preview-card/viewport/PreviewCardViewportDataAttributes.d.ts +24 -26
- package/preview-card/viewport/PreviewCardViewportDataAttributes.js +25 -28
- package/preview-card/viewport/PreviewCardViewportDataAttributes.mjs +24 -27
- package/progress/indicator/ProgressIndicatorDataAttributes.d.mts +12 -14
- package/progress/indicator/ProgressIndicatorDataAttributes.d.ts +12 -14
- package/progress/indicator/ProgressIndicatorDataAttributes.js +13 -16
- package/progress/indicator/ProgressIndicatorDataAttributes.mjs +12 -15
- package/progress/label/ProgressLabelDataAttributes.d.mts +12 -14
- package/progress/label/ProgressLabelDataAttributes.d.ts +12 -14
- package/progress/label/ProgressLabelDataAttributes.js +13 -16
- package/progress/label/ProgressLabelDataAttributes.mjs +12 -15
- package/progress/root/ProgressRoot.js +2 -2
- package/progress/root/ProgressRoot.mjs +2 -2
- package/progress/root/ProgressRootDataAttributes.d.mts +12 -14
- package/progress/root/ProgressRootDataAttributes.d.ts +12 -14
- package/progress/root/ProgressRootDataAttributes.js +13 -16
- package/progress/root/ProgressRootDataAttributes.mjs +12 -15
- package/progress/root/stateAttributesMapping.js +18 -3
- package/progress/root/stateAttributesMapping.mjs +17 -3
- package/progress/track/ProgressTrackDataAttributes.d.mts +12 -14
- package/progress/track/ProgressTrackDataAttributes.d.ts +12 -14
- package/progress/track/ProgressTrackDataAttributes.js +13 -16
- package/progress/track/ProgressTrackDataAttributes.mjs +12 -15
- package/progress/value/ProgressValueDataAttributes.d.mts +12 -14
- package/progress/value/ProgressValueDataAttributes.d.ts +12 -14
- package/progress/value/ProgressValueDataAttributes.js +13 -16
- package/progress/value/ProgressValueDataAttributes.mjs +12 -15
- package/radio/indicator/RadioIndicator.js +2 -0
- package/radio/indicator/RadioIndicator.mjs +2 -0
- package/radio/indicator/RadioIndicatorDataAttributes.d.mts +52 -54
- package/radio/indicator/RadioIndicatorDataAttributes.d.ts +52 -54
- package/radio/indicator/RadioIndicatorDataAttributes.js +53 -56
- package/radio/indicator/RadioIndicatorDataAttributes.mjs +53 -55
- package/radio/root/RadioRoot.js +1 -3
- package/radio/root/RadioRoot.mjs +1 -3
- package/radio/root/RadioRootDataAttributes.d.mts +44 -46
- package/radio/root/RadioRootDataAttributes.d.ts +44 -46
- package/radio/root/RadioRootDataAttributes.js +45 -48
- package/radio/root/RadioRootDataAttributes.mjs +44 -47
- package/radio/utils/stateAttributesMapping.js +4 -2
- package/radio/utils/stateAttributesMapping.mjs +3 -2
- package/radio-group/RadioGroupDataAttributes.d.mts +4 -6
- package/radio-group/RadioGroupDataAttributes.d.ts +4 -6
- package/radio-group/RadioGroupDataAttributes.js +5 -8
- package/radio-group/RadioGroupDataAttributes.mjs +4 -7
- package/scroll-area/content/ScrollAreaContentDataAttributes.d.mts +28 -30
- package/scroll-area/content/ScrollAreaContentDataAttributes.d.ts +28 -30
- package/scroll-area/content/ScrollAreaContentDataAttributes.js +29 -32
- package/scroll-area/content/ScrollAreaContentDataAttributes.mjs +28 -31
- package/scroll-area/corner/ScrollAreaCorner.js +1 -0
- package/scroll-area/corner/ScrollAreaCorner.mjs +1 -0
- package/scroll-area/root/ScrollAreaRoot.js +5 -6
- package/scroll-area/root/ScrollAreaRoot.mjs +5 -6
- package/scroll-area/root/ScrollAreaRootCssVars.d.mts +10 -12
- package/scroll-area/root/ScrollAreaRootCssVars.d.ts +10 -12
- package/scroll-area/root/ScrollAreaRootCssVars.js +11 -14
- package/scroll-area/root/ScrollAreaRootCssVars.mjs +10 -13
- package/scroll-area/root/ScrollAreaRootDataAttributes.d.mts +28 -30
- package/scroll-area/root/ScrollAreaRootDataAttributes.d.ts +28 -30
- package/scroll-area/root/ScrollAreaRootDataAttributes.js +29 -32
- package/scroll-area/root/ScrollAreaRootDataAttributes.mjs +28 -31
- package/scroll-area/root/stateAttributes.js +8 -7
- package/scroll-area/root/stateAttributes.mjs +7 -7
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +12 -4
- package/scroll-area/scrollbar/ScrollAreaScrollbar.mjs +14 -5
- package/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.d.mts +10 -12
- package/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.d.ts +10 -12
- package/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.js +11 -14
- package/scroll-area/scrollbar/ScrollAreaScrollbarCssVars.mjs +10 -13
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.mts +37 -39
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.d.ts +37 -39
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.js +38 -41
- package/scroll-area/scrollbar/ScrollAreaScrollbarDataAttributes.mjs +37 -40
- package/scroll-area/thumb/ScrollAreaThumbDataAttributes.d.mts +9 -11
- package/scroll-area/thumb/ScrollAreaThumbDataAttributes.d.ts +9 -11
- package/scroll-area/thumb/ScrollAreaThumbDataAttributes.js +10 -13
- package/scroll-area/thumb/ScrollAreaThumbDataAttributes.mjs +9 -12
- package/scroll-area/viewport/ScrollAreaViewport.js +6 -5
- package/scroll-area/viewport/ScrollAreaViewport.mjs +6 -6
- package/scroll-area/viewport/ScrollAreaViewportCssVars.d.mts +20 -22
- package/scroll-area/viewport/ScrollAreaViewportCssVars.d.ts +20 -22
- package/scroll-area/viewport/ScrollAreaViewportCssVars.js +21 -24
- package/scroll-area/viewport/ScrollAreaViewportCssVars.mjs +20 -23
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.mts +28 -30
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.d.ts +28 -30
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.js +29 -32
- package/scroll-area/viewport/ScrollAreaViewportDataAttributes.mjs +28 -31
- package/select/arrow/SelectArrow.js +2 -6
- package/select/arrow/SelectArrow.mjs +2 -6
- package/select/arrow/SelectArrowDataAttributes.d.mts +22 -24
- package/select/arrow/SelectArrowDataAttributes.d.ts +22 -24
- package/select/arrow/SelectArrowDataAttributes.js +23 -26
- package/select/arrow/SelectArrowDataAttributes.mjs +23 -25
- package/select/backdrop/SelectBackdrop.js +4 -8
- package/select/backdrop/SelectBackdrop.mjs +4 -8
- package/select/backdrop/SelectBackdropDataAttributes.d.mts +16 -18
- package/select/backdrop/SelectBackdropDataAttributes.d.ts +16 -18
- package/select/backdrop/SelectBackdropDataAttributes.js +17 -20
- package/select/backdrop/SelectBackdropDataAttributes.mjs +17 -19
- package/select/group-label/SelectGroupLabel.js +2 -1
- package/select/group-label/SelectGroupLabel.mjs +2 -1
- package/select/icon/SelectIcon.js +2 -6
- package/select/icon/SelectIcon.mjs +2 -6
- package/select/icon/SelectIconDataAttributes.d.mts +4 -6
- package/select/icon/SelectIconDataAttributes.d.ts +4 -6
- package/select/icon/SelectIconDataAttributes.js +5 -8
- package/select/icon/SelectIconDataAttributes.mjs +5 -7
- package/select/item/SelectItem.js +38 -37
- package/select/item/SelectItem.mjs +40 -39
- package/select/item/SelectItemDataAttributes.d.mts +12 -14
- package/select/item/SelectItemDataAttributes.d.ts +12 -14
- package/select/item/SelectItemDataAttributes.js +13 -16
- package/select/item/SelectItemDataAttributes.mjs +12 -15
- package/select/item-indicator/SelectItemIndicator.js +2 -0
- package/select/item-indicator/SelectItemIndicator.mjs +2 -0
- package/select/item-indicator/SelectItemIndicatorDataAttributes.d.mts +8 -10
- package/select/item-indicator/SelectItemIndicatorDataAttributes.d.ts +8 -10
- package/select/item-indicator/SelectItemIndicatorDataAttributes.js +9 -12
- package/select/item-indicator/SelectItemIndicatorDataAttributes.mjs +9 -11
- package/select/item-text/SelectItemText.js +4 -7
- package/select/item-text/SelectItemText.mjs +4 -7
- package/select/label/SelectLabel.js +3 -7
- package/select/label/SelectLabel.mjs +3 -7
- package/select/list/SelectList.js +9 -10
- package/select/list/SelectList.mjs +10 -11
- package/select/popup/SelectPopup.js +43 -52
- package/select/popup/SelectPopup.mjs +44 -53
- package/select/popup/SelectPopupDataAttributes.d.mts +26 -28
- package/select/popup/SelectPopupDataAttributes.d.ts +26 -28
- package/select/popup/SelectPopupDataAttributes.js +27 -30
- package/select/popup/SelectPopupDataAttributes.mjs +27 -29
- package/select/portal/SelectPortal.js +3 -7
- package/select/portal/SelectPortal.mjs +3 -7
- package/select/positioner/SelectPositioner.js +24 -39
- package/select/positioner/SelectPositioner.mjs +25 -40
- package/select/positioner/SelectPositionerCssVars.d.mts +25 -27
- package/select/positioner/SelectPositionerCssVars.d.ts +25 -27
- package/select/positioner/SelectPositionerCssVars.js +26 -29
- package/select/positioner/SelectPositionerCssVars.mjs +25 -28
- package/select/positioner/SelectPositionerDataAttributes.d.mts +22 -24
- package/select/positioner/SelectPositionerDataAttributes.d.ts +22 -24
- package/select/positioner/SelectPositionerDataAttributes.js +23 -26
- package/select/positioner/SelectPositionerDataAttributes.mjs +23 -25
- package/select/root/SelectRoot.js +60 -56
- package/select/root/SelectRoot.mjs +63 -59
- package/select/root/SelectRootContext.d.mts +11 -30
- package/select/root/SelectRootContext.d.ts +11 -30
- package/select/root/SelectRootContext.js +29 -4
- package/select/root/SelectRootContext.mjs +27 -3
- package/select/scroll-arrow/SelectScrollArrow.js +11 -19
- package/select/scroll-arrow/SelectScrollArrow.mjs +11 -19
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.d.mts +22 -24
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.d.ts +22 -24
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.js +23 -26
- package/select/scroll-down-arrow/SelectScrollDownArrowDataAttributes.mjs +23 -25
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.d.mts +22 -24
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.d.ts +22 -24
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.js +23 -26
- package/select/scroll-up-arrow/SelectScrollUpArrowDataAttributes.mjs +23 -25
- package/select/store.d.mts +30 -2
- package/select/store.d.ts +30 -2
- package/select/store.js +5 -0
- package/select/store.mjs +6 -0
- package/select/trigger/SelectTrigger.js +23 -27
- package/select/trigger/SelectTrigger.mjs +24 -28
- package/select/trigger/SelectTriggerDataAttributes.d.mts +53 -55
- package/select/trigger/SelectTriggerDataAttributes.d.ts +53 -55
- package/select/trigger/SelectTriggerDataAttributes.js +54 -57
- package/select/trigger/SelectTriggerDataAttributes.mjs +54 -56
- package/select/value/SelectValue.d.mts +2 -0
- package/select/value/SelectValue.d.ts +2 -0
- package/select/value/SelectValue.js +7 -12
- package/select/value/SelectValue.mjs +7 -12
- package/select/value/SelectValueDataAttributes.d.mts +4 -6
- package/select/value/SelectValueDataAttributes.d.ts +4 -6
- package/select/value/SelectValueDataAttributes.js +5 -8
- package/select/value/SelectValueDataAttributes.mjs +4 -7
- package/separator/SeparatorDataAttributes.d.mts +5 -7
- package/separator/SeparatorDataAttributes.d.ts +5 -7
- package/separator/SeparatorDataAttributes.js +6 -9
- package/separator/SeparatorDataAttributes.mjs +5 -8
- package/slider/control/SliderControl.js +1 -1
- package/slider/control/SliderControl.mjs +1 -1
- package/slider/control/SliderControlDataAttributes.d.mts +33 -35
- package/slider/control/SliderControlDataAttributes.d.ts +33 -35
- package/slider/control/SliderControlDataAttributes.js +34 -37
- package/slider/control/SliderControlDataAttributes.mjs +33 -36
- package/slider/indicator/SliderIndicatorDataAttributes.d.mts +33 -35
- package/slider/indicator/SliderIndicatorDataAttributes.d.ts +33 -35
- package/slider/indicator/SliderIndicatorDataAttributes.js +34 -37
- package/slider/indicator/SliderIndicatorDataAttributes.mjs +33 -36
- package/slider/root/SliderRoot.js +2 -2
- package/slider/root/SliderRoot.mjs +2 -2
- package/slider/root/SliderRootDataAttributes.d.mts +33 -35
- package/slider/root/SliderRootDataAttributes.d.ts +33 -35
- package/slider/root/SliderRootDataAttributes.js +34 -37
- package/slider/root/SliderRootDataAttributes.mjs +33 -36
- package/slider/thumb/SliderThumb.d.mts +1 -2
- package/slider/thumb/SliderThumb.d.ts +1 -2
- package/slider/thumb/SliderThumb.js +4 -3
- package/slider/thumb/SliderThumb.mjs +4 -3
- package/slider/thumb/SliderThumbDataAttributes.d.mts +37 -39
- package/slider/thumb/SliderThumbDataAttributes.d.ts +37 -39
- package/slider/thumb/SliderThumbDataAttributes.js +38 -41
- package/slider/thumb/SliderThumbDataAttributes.mjs +37 -40
- package/slider/track/SliderTrackDataAttributes.d.mts +33 -35
- package/slider/track/SliderTrackDataAttributes.d.ts +33 -35
- package/slider/track/SliderTrackDataAttributes.js +34 -37
- package/slider/track/SliderTrackDataAttributes.mjs +33 -36
- package/slider/utils/getPushedThumbValues.js +1 -1
- package/slider/utils/getPushedThumbValues.mjs +1 -1
- package/slider/utils/getSliderValue.js +1 -1
- package/slider/utils/getSliderValue.mjs +1 -1
- package/slider/utils/resolveThumbCollision.js +1 -1
- package/slider/utils/resolveThumbCollision.mjs +1 -1
- package/slider/value/SliderValue.js +1 -1
- package/slider/value/SliderValue.mjs +1 -1
- package/slider/value/SliderValueDataAttributes.d.mts +33 -35
- package/slider/value/SliderValueDataAttributes.d.ts +33 -35
- package/slider/value/SliderValueDataAttributes.js +34 -37
- package/slider/value/SliderValueDataAttributes.mjs +33 -36
- package/switch/root/SwitchRoot.js +3 -8
- package/switch/root/SwitchRoot.mjs +3 -8
- package/switch/root/SwitchRootDataAttributes.d.mts +44 -46
- package/switch/root/SwitchRootDataAttributes.d.ts +44 -46
- package/switch/root/SwitchRootDataAttributes.js +45 -48
- package/switch/root/SwitchRootDataAttributes.mjs +44 -47
- package/switch/stateAttributesMapping.js +4 -2
- package/switch/stateAttributesMapping.mjs +3 -2
- package/switch/thumb/SwitchThumbDataAttributes.d.mts +44 -46
- package/switch/thumb/SwitchThumbDataAttributes.d.ts +44 -46
- package/switch/thumb/SwitchThumbDataAttributes.js +45 -48
- package/switch/thumb/SwitchThumbDataAttributes.mjs +44 -47
- package/tabs/indicator/TabsIndicator.js +133 -17
- package/tabs/indicator/TabsIndicator.mjs +133 -17
- package/tabs/indicator/TabsIndicatorCssVars.d.mts +30 -32
- package/tabs/indicator/TabsIndicatorCssVars.d.ts +30 -32
- package/tabs/indicator/TabsIndicatorCssVars.js +31 -34
- package/tabs/indicator/TabsIndicatorCssVars.mjs +30 -33
- package/tabs/indicator/TabsIndicatorDataAttributes.d.mts +10 -12
- package/tabs/indicator/TabsIndicatorDataAttributes.d.ts +10 -12
- package/tabs/indicator/TabsIndicatorDataAttributes.js +11 -14
- package/tabs/indicator/TabsIndicatorDataAttributes.mjs +10 -13
- package/tabs/indicator/prehydrationScript.min.d.mts +1 -1
- package/tabs/indicator/prehydrationScript.min.d.ts +1 -1
- package/tabs/indicator/prehydrationScript.min.js +1 -1
- package/tabs/indicator/prehydrationScript.min.mjs +1 -1
- package/tabs/list/TabsListDataAttributes.d.mts +10 -12
- package/tabs/list/TabsListDataAttributes.d.ts +10 -12
- package/tabs/list/TabsListDataAttributes.js +11 -14
- package/tabs/list/TabsListDataAttributes.mjs +10 -13
- package/tabs/panel/TabsPanel.js +2 -1
- package/tabs/panel/TabsPanel.mjs +2 -1
- package/tabs/panel/TabsPanelDataAttributes.d.mts +26 -28
- package/tabs/panel/TabsPanelDataAttributes.d.ts +26 -28
- package/tabs/panel/TabsPanelDataAttributes.js +27 -30
- package/tabs/panel/TabsPanelDataAttributes.mjs +27 -29
- package/tabs/root/TabsRootDataAttributes.d.mts +10 -12
- package/tabs/root/TabsRootDataAttributes.d.ts +10 -12
- package/tabs/root/TabsRootDataAttributes.js +11 -14
- package/tabs/root/TabsRootDataAttributes.mjs +10 -13
- package/tabs/root/stateAttributesMapping.js +3 -1
- package/tabs/root/stateAttributesMapping.mjs +2 -1
- package/tabs/tab/TabsTabDataAttributes.d.mts +18 -20
- package/tabs/tab/TabsTabDataAttributes.d.ts +18 -20
- package/tabs/tab/TabsTabDataAttributes.js +19 -22
- package/tabs/tab/TabsTabDataAttributes.mjs +18 -21
- package/toast/action/ToastActionDataAttributes.d.mts +5 -7
- package/toast/action/ToastActionDataAttributes.d.ts +5 -7
- package/toast/action/ToastActionDataAttributes.js +6 -9
- package/toast/action/ToastActionDataAttributes.mjs +5 -8
- package/toast/arrow/ToastArrowDataAttributes.d.mts +14 -16
- package/toast/arrow/ToastArrowDataAttributes.d.ts +14 -16
- package/toast/arrow/ToastArrowDataAttributes.js +15 -18
- package/toast/arrow/ToastArrowDataAttributes.mjs +15 -17
- package/toast/close/ToastCloseDataAttributes.d.mts +5 -7
- package/toast/close/ToastCloseDataAttributes.d.ts +5 -7
- package/toast/close/ToastCloseDataAttributes.js +6 -9
- package/toast/close/ToastCloseDataAttributes.mjs +5 -8
- package/toast/content/ToastContentDataAttributes.d.mts +10 -12
- package/toast/content/ToastContentDataAttributes.d.ts +10 -12
- package/toast/content/ToastContentDataAttributes.js +11 -14
- package/toast/content/ToastContentDataAttributes.mjs +10 -13
- package/toast/createToastManager.d.mts +2 -2
- package/toast/createToastManager.d.ts +2 -2
- package/toast/createToastManager.js +2 -2
- package/toast/createToastManager.mjs +2 -2
- package/toast/description/ToastDescriptionDataAttributes.d.mts +5 -7
- package/toast/description/ToastDescriptionDataAttributes.d.ts +5 -7
- package/toast/description/ToastDescriptionDataAttributes.js +6 -9
- package/toast/description/ToastDescriptionDataAttributes.mjs +5 -8
- package/toast/positioner/ToastPositioner.js +2 -1
- package/toast/positioner/ToastPositioner.mjs +2 -1
- package/toast/positioner/ToastPositionerCssVars.d.mts +25 -27
- package/toast/positioner/ToastPositionerCssVars.d.ts +25 -27
- package/toast/positioner/ToastPositionerCssVars.js +26 -29
- package/toast/positioner/ToastPositionerCssVars.mjs +25 -28
- package/toast/positioner/ToastPositionerDataAttributes.d.mts +14 -16
- package/toast/positioner/ToastPositionerDataAttributes.d.ts +14 -16
- package/toast/positioner/ToastPositionerDataAttributes.js +15 -18
- package/toast/positioner/ToastPositionerDataAttributes.mjs +15 -17
- package/toast/provider/ToastProvider.js +1 -1
- package/toast/provider/ToastProvider.mjs +1 -1
- package/toast/root/ToastRoot.js +10 -7
- package/toast/root/ToastRoot.mjs +10 -7
- package/toast/root/ToastRootCssVars.d.mts +25 -27
- package/toast/root/ToastRootCssVars.d.ts +25 -27
- package/toast/root/ToastRootCssVars.js +26 -29
- package/toast/root/ToastRootCssVars.mjs +25 -28
- package/toast/root/ToastRootDataAttributes.d.mts +33 -35
- package/toast/root/ToastRootDataAttributes.d.ts +33 -35
- package/toast/root/ToastRootDataAttributes.js +34 -37
- package/toast/root/ToastRootDataAttributes.mjs +34 -36
- package/toast/store.d.mts +1 -1
- package/toast/store.d.ts +1 -1
- package/toast/store.js +9 -1
- package/toast/store.mjs +9 -1
- package/toast/title/ToastTitleDataAttributes.d.mts +5 -7
- package/toast/title/ToastTitleDataAttributes.d.ts +5 -7
- package/toast/title/ToastTitleDataAttributes.js +6 -9
- package/toast/title/ToastTitleDataAttributes.mjs +5 -8
- package/toast/useToastManager.d.mts +1 -1
- package/toast/useToastManager.d.ts +1 -1
- package/toast/viewport/ToastViewport.js +2 -1
- package/toast/viewport/ToastViewport.mjs +2 -1
- package/toast/viewport/ToastViewportCssVars.d.mts +5 -7
- package/toast/viewport/ToastViewportCssVars.d.ts +5 -7
- package/toast/viewport/ToastViewportCssVars.js +6 -9
- package/toast/viewport/ToastViewportCssVars.mjs +5 -8
- package/toast/viewport/ToastViewportDataAttributes.d.mts +5 -7
- package/toast/viewport/ToastViewportDataAttributes.d.ts +5 -7
- package/toast/viewport/ToastViewportDataAttributes.js +6 -9
- package/toast/viewport/ToastViewportDataAttributes.mjs +5 -8
- package/toggle/Toggle.js +1 -2
- package/toggle/Toggle.mjs +1 -2
- package/toggle/ToggleDataAttributes.d.mts +8 -10
- package/toggle/ToggleDataAttributes.d.ts +8 -10
- package/toggle/ToggleDataAttributes.js +9 -12
- package/toggle/ToggleDataAttributes.mjs +8 -11
- package/toggle-group/ToggleGroup.js +3 -1
- package/toggle-group/ToggleGroup.mjs +3 -1
- package/toggle-group/ToggleGroupDataAttributes.d.mts +13 -15
- package/toggle-group/ToggleGroupDataAttributes.d.ts +13 -15
- package/toggle-group/ToggleGroupDataAttributes.js +14 -17
- package/toggle-group/ToggleGroupDataAttributes.mjs +13 -16
- package/toolbar/button/ToolbarButtonDataAttributes.d.mts +13 -15
- package/toolbar/button/ToolbarButtonDataAttributes.d.ts +13 -15
- package/toolbar/button/ToolbarButtonDataAttributes.js +14 -17
- package/toolbar/button/ToolbarButtonDataAttributes.mjs +13 -16
- package/toolbar/group/ToolbarGroupDataAttributes.d.mts +9 -11
- package/toolbar/group/ToolbarGroupDataAttributes.d.ts +9 -11
- package/toolbar/group/ToolbarGroupDataAttributes.js +10 -13
- package/toolbar/group/ToolbarGroupDataAttributes.mjs +9 -12
- package/toolbar/input/ToolbarInputDataAttributes.d.mts +13 -15
- package/toolbar/input/ToolbarInputDataAttributes.d.ts +13 -15
- package/toolbar/input/ToolbarInputDataAttributes.js +14 -17
- package/toolbar/input/ToolbarInputDataAttributes.mjs +13 -16
- package/toolbar/link/ToolbarLinkDataAttributes.d.mts +5 -7
- package/toolbar/link/ToolbarLinkDataAttributes.d.ts +5 -7
- package/toolbar/link/ToolbarLinkDataAttributes.js +6 -9
- package/toolbar/link/ToolbarLinkDataAttributes.mjs +5 -8
- package/toolbar/root/ToolbarRootDataAttributes.d.mts +9 -11
- package/toolbar/root/ToolbarRootDataAttributes.d.ts +9 -11
- package/toolbar/root/ToolbarRootDataAttributes.js +10 -13
- package/toolbar/root/ToolbarRootDataAttributes.mjs +9 -12
- package/toolbar/separator/ToolbarSeparatorDataAttributes.d.mts +5 -7
- package/toolbar/separator/ToolbarSeparatorDataAttributes.d.ts +5 -7
- package/toolbar/separator/ToolbarSeparatorDataAttributes.js +6 -9
- package/toolbar/separator/ToolbarSeparatorDataAttributes.mjs +5 -8
- package/tooltip/arrow/TooltipArrowDataAttributes.d.mts +27 -29
- package/tooltip/arrow/TooltipArrowDataAttributes.d.ts +27 -29
- package/tooltip/arrow/TooltipArrowDataAttributes.js +28 -31
- package/tooltip/arrow/TooltipArrowDataAttributes.mjs +28 -30
- package/tooltip/popup/TooltipPopupDataAttributes.d.mts +31 -33
- package/tooltip/popup/TooltipPopupDataAttributes.d.ts +31 -33
- package/tooltip/popup/TooltipPopupDataAttributes.js +32 -35
- package/tooltip/popup/TooltipPopupDataAttributes.mjs +32 -34
- package/tooltip/positioner/TooltipPositionerCssVars.d.mts +37 -39
- package/tooltip/positioner/TooltipPositionerCssVars.d.ts +37 -39
- package/tooltip/positioner/TooltipPositionerCssVars.js +38 -41
- package/tooltip/positioner/TooltipPositionerCssVars.mjs +37 -40
- package/tooltip/positioner/TooltipPositionerDataAttributes.d.mts +22 -24
- package/tooltip/positioner/TooltipPositionerDataAttributes.d.ts +22 -24
- package/tooltip/positioner/TooltipPositionerDataAttributes.js +23 -26
- package/tooltip/positioner/TooltipPositionerDataAttributes.mjs +23 -25
- package/tooltip/root/TooltipRoot.d.mts +1 -1
- package/tooltip/root/TooltipRoot.d.ts +1 -1
- package/tooltip/store/TooltipStore.js +1 -2
- package/tooltip/store/TooltipStore.mjs +2 -3
- package/tooltip/trigger/TooltipTrigger.js +7 -5
- package/tooltip/trigger/TooltipTrigger.mjs +7 -5
- package/tooltip/trigger/TooltipTriggerDataAttributes.d.mts +8 -10
- package/tooltip/trigger/TooltipTriggerDataAttributes.d.ts +8 -10
- package/tooltip/trigger/TooltipTriggerDataAttributes.js +9 -12
- package/tooltip/trigger/TooltipTriggerDataAttributes.mjs +9 -11
- package/tooltip/viewport/TooltipViewportCssVars.d.mts +12 -14
- package/tooltip/viewport/TooltipViewportCssVars.d.ts +12 -14
- package/tooltip/viewport/TooltipViewportCssVars.js +13 -16
- package/tooltip/viewport/TooltipViewportCssVars.mjs +12 -15
- package/tooltip/viewport/TooltipViewportDataAttributes.d.mts +24 -26
- package/tooltip/viewport/TooltipViewportDataAttributes.d.ts +24 -26
- package/tooltip/viewport/TooltipViewportDataAttributes.js +25 -28
- package/tooltip/viewport/TooltipViewportDataAttributes.mjs +24 -27
- package/utils/CommonPopupCssVars.d.mts +12 -0
- package/utils/CommonPopupCssVars.d.ts +12 -0
- package/utils/CommonPopupCssVars.js +18 -0
- package/utils/CommonPopupCssVars.mjs +12 -0
- package/utils/CommonPopupDataAttributes.d.mts +30 -0
- package/utils/CommonPopupDataAttributes.d.ts +30 -0
- package/utils/CommonPopupDataAttributes.js +44 -0
- package/utils/CommonPopupDataAttributes.mjs +38 -0
- package/utils/CommonPositionerCssVars.d.mts +37 -0
- package/utils/CommonPositionerCssVars.d.ts +37 -0
- package/utils/CommonPositionerCssVars.js +43 -0
- package/utils/CommonPositionerCssVars.mjs +37 -0
- package/utils/CommonTriggerDataAttributes.d.mts +8 -0
- package/utils/CommonTriggerDataAttributes.d.ts +8 -0
- package/utils/CommonTriggerDataAttributes.js +15 -0
- package/utils/CommonTriggerDataAttributes.mjs +9 -0
- package/utils/CommonViewportDataAttributes.d.mts +7 -0
- package/utils/CommonViewportDataAttributes.d.ts +7 -0
- package/utils/CommonViewportDataAttributes.js +13 -0
- package/utils/CommonViewportDataAttributes.mjs +7 -0
- package/utils/NullStore.d.mts +2 -2
- package/utils/NullStore.d.ts +2 -2
- package/utils/collapsibleOpenStateMapping.js +6 -5
- package/utils/collapsibleOpenStateMapping.mjs +2 -2
- package/utils/getElementTransform.d.mts +12 -0
- package/utils/getElementTransform.d.ts +12 -0
- package/utils/getElementTransform.js +40 -0
- package/utils/getElementTransform.mjs +35 -0
- package/utils/popupStateMapping.d.mts +12 -51
- package/utils/popupStateMapping.d.ts +12 -51
- package/utils/popupStateMapping.js +11 -51
- package/utils/popupStateMapping.mjs +10 -54
- package/utils/popups/popupHandle.js +2 -2
- package/utils/popups/popupHandle.mjs +2 -2
- package/utils/popups/popupStoreUtils.d.mts +28 -11
- package/utils/popups/popupStoreUtils.d.ts +28 -11
- package/utils/popups/popupStoreUtils.js +82 -55
- package/utils/popups/popupStoreUtils.mjs +81 -54
- package/utils/popups/store.d.mts +7 -5
- package/utils/popups/store.d.ts +7 -5
- package/utils/popups/store.js +13 -18
- package/utils/popups/store.mjs +13 -17
- package/utils/scrollEdges.js +1 -1
- package/utils/scrollEdges.mjs +1 -1
- package/utils/styles.d.mts +1 -1
- package/utils/styles.d.ts +1 -1
- package/utils/usePopupAutoResize.js +10 -8
- package/utils/usePopupAutoResize.mjs +11 -8
- package/utils/usePopupViewport.js +5 -3
- package/utils/usePopupViewport.mjs +5 -3
- package/utils/useSwipeDismiss.d.mts +0 -5
- package/utils/useSwipeDismiss.d.ts +0 -5
- package/utils/useSwipeDismiss.js +14 -33
- package/utils/useSwipeDismiss.mjs +14 -32
- package/internals/areArraysEqual.d.mts +0 -3
- package/internals/areArraysEqual.d.ts +0 -3
- package/internals/areArraysEqual.js +0 -9
- package/internals/areArraysEqual.mjs +0 -3
- package/internals/clamp.d.mts +0 -1
- package/internals/clamp.d.ts +0 -1
- package/internals/clamp.js +0 -9
- package/internals/clamp.mjs +0 -3
- package/internals/shadowDom.d.mts +0 -3
- package/internals/shadowDom.d.ts +0 -3
- package/internals/shadowDom.js +0 -48
- package/internals/shadowDom.mjs +0 -40
- package/utils/formatNumber.d.mts +0 -3
- package/utils/formatNumber.d.ts +0 -3
- package/utils/formatNumber.js +0 -29
- package/utils/formatNumber.mjs +0 -21
- package/utils/stringifyLocale.d.mts +0 -1
- package/utils/stringifyLocale.d.ts +0 -1
- package/utils/stringifyLocale.js +0 -15
- package/utils/stringifyLocale.mjs +0 -9
- /package/drawer/content/{DrawerContentDataAttributes.d.mts → drawerContentAttribute.d.mts} +0 -0
- /package/drawer/content/{DrawerContentDataAttributes.d.ts → drawerContentAttribute.d.ts} +0 -0
- /package/drawer/content/{DrawerContentDataAttributes.js → drawerContentAttribute.js} +0 -0
- /package/drawer/content/{DrawerContentDataAttributes.mjs → drawerContentAttribute.mjs} +0 -0
|
@@ -587,28 +587,613 @@ import { Combobox } from '@base-ui/react/combobox';
|
|
|
587
587
|
</Combobox.Root>;
|
|
588
588
|
```
|
|
589
589
|
|
|
590
|
-
##
|
|
590
|
+
## Item values
|
|
591
591
|
|
|
592
|
-
Combobox
|
|
593
|
-
|
|
592
|
+
Each `<Combobox.Item>` takes a `value` prop identifying it. Pass the item being rendered:
|
|
593
|
+
|
|
594
|
+
```jsx title="Using item objects as values"
|
|
595
|
+
<Combobox.List>
|
|
596
|
+
{(item) => (
|
|
597
|
+
<Combobox.Item key={item.id} value={item}>
|
|
598
|
+
{item.label}
|
|
599
|
+
</Combobox.Item>
|
|
600
|
+
)}
|
|
601
|
+
</Combobox.List>
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
That item is what `value`, `defaultValue`, and `onValueChange` receive. To store IDs instead, see [Value selection with IDs](/react/components/combobox.md).
|
|
594
605
|
|
|
595
606
|
## Examples
|
|
596
607
|
|
|
597
|
-
### Typed wrapper component
|
|
608
|
+
### Typed wrapper component
|
|
609
|
+
|
|
610
|
+
The following example shows a typed wrapper around the Combobox component with correct type inference and type safety:
|
|
611
|
+
|
|
612
|
+
```tsx title="Specifying generic type parameters"
|
|
613
|
+
import * as React from 'react';
|
|
614
|
+
import { Combobox } from '@base-ui/react/combobox';
|
|
615
|
+
|
|
616
|
+
export function MyCombobox<Value, Multiple extends boolean | undefined = false, Item = Value>(
|
|
617
|
+
props: Combobox.Root.Props<Value, Multiple, Item>,
|
|
618
|
+
): React.JSX.Element {
|
|
619
|
+
return <Combobox.Root {...props}>{/* ... */}</Combobox.Root>;
|
|
620
|
+
}
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
The third `Item` type parameter is what lets the wrapper accept a `Combobox.createItems()` collection, whose rendered item type differs from its selection value. Omit it and a collection infers `Value` as the source item type, surfacing an error on `defaultValue` rather than on `items`.
|
|
624
|
+
|
|
625
|
+
### Value selection with IDs
|
|
626
|
+
|
|
627
|
+
When your app stores IDs rather than item objects, use `Combobox.createItems` with `getValue` and `getLabel` to derive each item's selection value and display label.
|
|
628
|
+
|
|
629
|
+
With static data, create the collection at module scope. The accessor parameters are inferred from `users`. Pass the derived ID to the `value` prop of `<Combobox.Item>`, not the item being rendered:
|
|
630
|
+
|
|
631
|
+
```jsx title="Using item IDs as values"
|
|
632
|
+
const items = Combobox.createItems(users, {
|
|
633
|
+
getValue: (user) => user.id,
|
|
634
|
+
getLabel: (user) => user.name,
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
<Combobox.Root items={items}>
|
|
638
|
+
<Combobox.List>
|
|
639
|
+
{(user) => (
|
|
640
|
+
<Combobox.Item key={user.id} value={user.id}>
|
|
641
|
+
{user.name}
|
|
642
|
+
</Combobox.Item>
|
|
643
|
+
)}
|
|
644
|
+
</Combobox.List>
|
|
645
|
+
</Combobox.Root>;
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
Selection props and events use the derived IDs, while list rendering continues to receive the original items. The derived label is also used for filtering and typeahead.
|
|
649
|
+
|
|
650
|
+
When the data is loaded or replaced at runtime, memoize the collection on it so that it is rebuilt only when the data changes:
|
|
651
|
+
|
|
652
|
+
```jsx title="Creating a collection from dynamic data"
|
|
653
|
+
const items = React.useMemo(
|
|
654
|
+
() =>
|
|
655
|
+
Combobox.createItems(users, {
|
|
656
|
+
getValue: (user) => user.id,
|
|
657
|
+
getLabel: (user) => user.name,
|
|
658
|
+
}),
|
|
659
|
+
[users],
|
|
660
|
+
);
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
## Demo
|
|
664
|
+
|
|
665
|
+
### Tailwind
|
|
666
|
+
|
|
667
|
+
This example shows how to implement the component using Tailwind CSS.
|
|
668
|
+
|
|
669
|
+
```tsx
|
|
670
|
+
/* index.tsx */
|
|
671
|
+
'use client';
|
|
672
|
+
import * as React from 'react';
|
|
673
|
+
import { Combobox } from '@base-ui/react/combobox';
|
|
674
|
+
|
|
675
|
+
export default function ExampleCreateItemsCombobox() {
|
|
676
|
+
const id = React.useId();
|
|
677
|
+
|
|
678
|
+
return (
|
|
679
|
+
<Combobox.Root items={items} defaultValue="banana">
|
|
680
|
+
<div className="relative flex flex-col gap-1 text-sm leading-5 font-bold text-neutral-950 dark:text-white">
|
|
681
|
+
<label htmlFor={id}>Choose a fruit</label>
|
|
682
|
+
<Combobox.InputGroup className="relative h-8 w-56 border border-neutral-950 bg-white dark:bg-neutral-950 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-neutral-950 dark:focus-within:outline-white dark:border-white [&>input]:pr-[calc(0.5rem+2rem)] has-[.combobox-clear]:[&>input]:pr-[calc(0.5rem+2rem*2)]">
|
|
683
|
+
<Combobox.Input
|
|
684
|
+
placeholder="e.g. Apple"
|
|
685
|
+
id={id}
|
|
686
|
+
className="h-full w-full border-0 bg-white pl-2 dark:bg-neutral-950 text-sm any-pointer-coarse:text-base font-normal text-neutral-950 outline-none placeholder:text-neutral-500 dark:placeholder:text-neutral-400 dark:text-white"
|
|
687
|
+
/>
|
|
688
|
+
<div className="absolute right-0 bottom-0 flex h-full items-center justify-center text-neutral-500 dark:text-neutral-400">
|
|
689
|
+
<Combobox.Clear
|
|
690
|
+
className="combobox-clear flex h-full w-6 items-center justify-center border-0 bg-transparent p-0 text-neutral-950 dark:text-white"
|
|
691
|
+
aria-label="Clear selection"
|
|
692
|
+
>
|
|
693
|
+
<XIcon />
|
|
694
|
+
</Combobox.Clear>
|
|
695
|
+
<Combobox.Trigger
|
|
696
|
+
className="flex h-full w-6 items-center justify-center border-0 bg-transparent p-0 text-neutral-950 dark:text-white"
|
|
697
|
+
aria-label="Open popup"
|
|
698
|
+
>
|
|
699
|
+
<CaretDownIcon />
|
|
700
|
+
</Combobox.Trigger>
|
|
701
|
+
</div>
|
|
702
|
+
</Combobox.InputGroup>
|
|
703
|
+
</div>
|
|
704
|
+
|
|
705
|
+
<Combobox.Portal>
|
|
706
|
+
<Combobox.Positioner className="outline-none" sideOffset={4}>
|
|
707
|
+
<Combobox.Popup className="w-[var(--anchor-width)] max-w-[var(--available-width)] origin-[var(--transform-origin)] border border-neutral-950 bg-white text-neutral-950 shadow-[0.25rem_0.25rem_0_rgb(0_0_0_/_12%)] transition-[scale,opacity] duration-100 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0 dark:border-white dark:bg-neutral-950 dark:text-white dark:shadow-none">
|
|
708
|
+
<Combobox.Empty>
|
|
709
|
+
<div className="py-4 pr-4 pl-2 text-sm leading-4 text-neutral-500 dark:text-neutral-400">
|
|
710
|
+
No fruits found.
|
|
711
|
+
</div>
|
|
712
|
+
</Combobox.Empty>
|
|
713
|
+
<Combobox.List className="max-h-[min(22.5rem,var(--available-height))] overflow-y-auto overscroll-contain py-1 scroll-py-1 outline-0 data-empty:p-0">
|
|
714
|
+
{(item) => (
|
|
715
|
+
<Combobox.Item
|
|
716
|
+
key={item.id}
|
|
717
|
+
value={item.id}
|
|
718
|
+
className="grid cursor-default grid-cols-[1rem_1fr] items-center gap-2 p-2 text-sm leading-4 outline-none select-none data-highlighted:relative data-highlighted:z-0 data-highlighted:text-white data-highlighted:before:absolute data-highlighted:before:inset-0 data-highlighted:before:z-[-1] data-highlighted:before:bg-neutral-950 dark:data-highlighted:text-neutral-950 dark:data-highlighted:before:bg-white"
|
|
719
|
+
>
|
|
720
|
+
<Combobox.ItemIndicator className="col-start-1">
|
|
721
|
+
<CheckIcon />
|
|
722
|
+
</Combobox.ItemIndicator>
|
|
723
|
+
<span className="col-start-2">{item.name}</span>
|
|
724
|
+
</Combobox.Item>
|
|
725
|
+
)}
|
|
726
|
+
</Combobox.List>
|
|
727
|
+
</Combobox.Popup>
|
|
728
|
+
</Combobox.Positioner>
|
|
729
|
+
</Combobox.Portal>
|
|
730
|
+
</Combobox.Root>
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
function CheckIcon(props: React.ComponentProps<'svg'>) {
|
|
735
|
+
return (
|
|
736
|
+
<svg
|
|
737
|
+
width="16"
|
|
738
|
+
height="16"
|
|
739
|
+
viewBox="0 0 16 16"
|
|
740
|
+
fill="none"
|
|
741
|
+
stroke="currentColor"
|
|
742
|
+
{...props}
|
|
743
|
+
style={{ display: 'block', ...props.style }}
|
|
744
|
+
>
|
|
745
|
+
<path d="m2.5 8.5 4 4 7-9" />
|
|
746
|
+
</svg>
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
function XIcon(props: React.ComponentProps<'svg'>) {
|
|
751
|
+
return (
|
|
752
|
+
<svg
|
|
753
|
+
width="16"
|
|
754
|
+
height="16"
|
|
755
|
+
viewBox="0 0 16 16"
|
|
756
|
+
fill="none"
|
|
757
|
+
stroke="currentColor"
|
|
758
|
+
strokeLinecap="square"
|
|
759
|
+
strokeLinejoin="round"
|
|
760
|
+
{...props}
|
|
761
|
+
style={{ display: 'block', ...props.style }}
|
|
762
|
+
>
|
|
763
|
+
<path d="m4.5 4.5 7 7m-7 0 7-7" />
|
|
764
|
+
</svg>
|
|
765
|
+
);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
function CaretDownIcon(props: React.ComponentProps<'svg'>) {
|
|
769
|
+
return (
|
|
770
|
+
<svg
|
|
771
|
+
width="16"
|
|
772
|
+
height="16"
|
|
773
|
+
viewBox="0 0 16 16"
|
|
774
|
+
fill="currentColor"
|
|
775
|
+
{...props}
|
|
776
|
+
style={{ display: 'block', ...props.style }}
|
|
777
|
+
>
|
|
778
|
+
<path d="M12 6H4l4 4.5z" />
|
|
779
|
+
</svg>
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
interface Fruit {
|
|
784
|
+
id: string;
|
|
785
|
+
name: string;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
const fruits: Fruit[] = [
|
|
789
|
+
{ id: 'apple', name: 'Apple' },
|
|
790
|
+
{ id: 'banana', name: 'Banana' },
|
|
791
|
+
{ id: 'orange', name: 'Orange' },
|
|
792
|
+
{ id: 'pineapple', name: 'Pineapple' },
|
|
793
|
+
{ id: 'grape', name: 'Grape' },
|
|
794
|
+
{ id: 'mango', name: 'Mango' },
|
|
795
|
+
{ id: 'strawberry', name: 'Strawberry' },
|
|
796
|
+
{ id: 'blueberry', name: 'Blueberry' },
|
|
797
|
+
{ id: 'raspberry', name: 'Raspberry' },
|
|
798
|
+
{ id: 'blackberry', name: 'Blackberry' },
|
|
799
|
+
{ id: 'cherry', name: 'Cherry' },
|
|
800
|
+
{ id: 'peach', name: 'Peach' },
|
|
801
|
+
{ id: 'pear', name: 'Pear' },
|
|
802
|
+
{ id: 'plum', name: 'Plum' },
|
|
803
|
+
{ id: 'kiwi', name: 'Kiwi' },
|
|
804
|
+
{ id: 'watermelon', name: 'Watermelon' },
|
|
805
|
+
];
|
|
806
|
+
|
|
807
|
+
const items = Combobox.createItems(fruits, {
|
|
808
|
+
getValue: (fruit) => fruit.id,
|
|
809
|
+
getLabel: (fruit) => fruit.name,
|
|
810
|
+
});
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
### CSS Modules
|
|
814
|
+
|
|
815
|
+
This example shows how to implement the component using CSS Modules.
|
|
816
|
+
|
|
817
|
+
```css
|
|
818
|
+
/* index.module.css */
|
|
819
|
+
.InputGroup {
|
|
820
|
+
box-sizing: border-box;
|
|
821
|
+
position: relative;
|
|
822
|
+
width: 14rem;
|
|
823
|
+
height: 2rem;
|
|
824
|
+
border: 1px solid oklch(14.5% 0 0deg);
|
|
825
|
+
background-color: white;
|
|
826
|
+
|
|
827
|
+
@media (prefers-color-scheme: dark) {
|
|
828
|
+
border: 1px solid white;
|
|
829
|
+
background-color: oklch(14.5% 0 0deg);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
&:focus-within {
|
|
833
|
+
outline: 2px solid oklch(14.5% 0 0deg);
|
|
834
|
+
outline-offset: -1px;
|
|
835
|
+
|
|
836
|
+
@media (prefers-color-scheme: dark) {
|
|
837
|
+
outline-color: white;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
&:has(.Clear) .Input {
|
|
842
|
+
padding: 0 calc(0.5rem + 2rem * 2) 0 0.5rem;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
.Input {
|
|
847
|
+
box-sizing: border-box;
|
|
848
|
+
padding: 0 calc(0.5rem + 2rem) 0 0.5rem;
|
|
849
|
+
margin: 0;
|
|
850
|
+
border: none;
|
|
851
|
+
border-radius: 0;
|
|
852
|
+
width: 100%;
|
|
853
|
+
height: 100%;
|
|
854
|
+
font-family: inherit;
|
|
855
|
+
font-size: 0.875rem;
|
|
856
|
+
line-height: 1.25rem;
|
|
857
|
+
font-weight: 400;
|
|
858
|
+
background-color: white;
|
|
859
|
+
color: oklch(14.5% 0 0deg);
|
|
860
|
+
|
|
861
|
+
@media (any-pointer: coarse) {
|
|
862
|
+
font-size: 1rem;
|
|
863
|
+
line-height: 1.5rem;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
@media (prefers-color-scheme: dark) {
|
|
867
|
+
background-color: oklch(14.5% 0 0deg);
|
|
868
|
+
color: white;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
&::placeholder {
|
|
872
|
+
color: oklch(55.6% 0 0deg);
|
|
873
|
+
|
|
874
|
+
@media (prefers-color-scheme: dark) {
|
|
875
|
+
color: oklch(70.8% 0 0deg);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
&:focus {
|
|
880
|
+
outline: none;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.Label {
|
|
885
|
+
display: flex;
|
|
886
|
+
flex-direction: column;
|
|
887
|
+
gap: 0.25rem;
|
|
888
|
+
font-size: 0.875rem;
|
|
889
|
+
line-height: 1.25rem;
|
|
890
|
+
font-weight: 700;
|
|
891
|
+
color: oklch(14.5% 0 0deg);
|
|
892
|
+
position: relative;
|
|
893
|
+
|
|
894
|
+
@media (prefers-color-scheme: dark) {
|
|
895
|
+
color: white;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.ActionButtons {
|
|
900
|
+
box-sizing: border-box;
|
|
901
|
+
position: absolute;
|
|
902
|
+
display: flex;
|
|
903
|
+
align-items: center;
|
|
904
|
+
justify-content: center;
|
|
905
|
+
bottom: 0;
|
|
906
|
+
height: 100%;
|
|
907
|
+
right: 0;
|
|
908
|
+
border: none;
|
|
909
|
+
color: oklch(55.6% 0 0deg);
|
|
910
|
+
padding: 0;
|
|
911
|
+
|
|
912
|
+
@media (prefers-color-scheme: dark) {
|
|
913
|
+
color: oklch(70.8% 0 0deg);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.Trigger,
|
|
918
|
+
.Clear {
|
|
919
|
+
box-sizing: border-box;
|
|
920
|
+
display: flex;
|
|
921
|
+
align-items: center;
|
|
922
|
+
justify-content: center;
|
|
923
|
+
width: 1.5rem;
|
|
924
|
+
height: 100%;
|
|
925
|
+
color: oklch(14.5% 0 0deg);
|
|
926
|
+
border: none;
|
|
927
|
+
padding: 0;
|
|
928
|
+
background: none;
|
|
929
|
+
|
|
930
|
+
@media (prefers-color-scheme: dark) {
|
|
931
|
+
color: white;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.Positioner {
|
|
936
|
+
outline: 0;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.Popup {
|
|
940
|
+
box-sizing: border-box;
|
|
941
|
+
background-color: white;
|
|
942
|
+
color: oklch(14.5% 0 0deg);
|
|
943
|
+
width: var(--anchor-width);
|
|
944
|
+
max-width: var(--available-width);
|
|
945
|
+
transition:
|
|
946
|
+
opacity 0.1s,
|
|
947
|
+
transform 0.1s;
|
|
948
|
+
transform-origin: var(--transform-origin);
|
|
949
|
+
|
|
950
|
+
border: 1px solid oklch(14.5% 0 0deg);
|
|
951
|
+
box-shadow: 0.25rem 0.25rem 0 rgb(0 0 0 / 12%);
|
|
952
|
+
|
|
953
|
+
@media (prefers-color-scheme: dark) {
|
|
954
|
+
background-color: oklch(14.5% 0 0deg);
|
|
955
|
+
color: white;
|
|
956
|
+
border: 1px solid white;
|
|
957
|
+
box-shadow: none;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
&[data-starting-style],
|
|
961
|
+
&[data-ending-style] {
|
|
962
|
+
opacity: 0;
|
|
963
|
+
transform: scale(0.95);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
.List {
|
|
968
|
+
box-sizing: border-box;
|
|
969
|
+
overflow-y: auto;
|
|
970
|
+
overscroll-behavior: contain;
|
|
971
|
+
padding-block: 0.25rem;
|
|
972
|
+
scroll-padding-block: 0.25rem;
|
|
973
|
+
outline: 0;
|
|
974
|
+
max-height: min(22.5rem, var(--available-height));
|
|
975
|
+
|
|
976
|
+
&[data-empty] {
|
|
977
|
+
padding: 0;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.Item {
|
|
982
|
+
box-sizing: border-box;
|
|
983
|
+
outline: 0;
|
|
984
|
+
cursor: default;
|
|
985
|
+
-webkit-user-select: none;
|
|
986
|
+
user-select: none;
|
|
987
|
+
padding-block: 0.5rem;
|
|
988
|
+
padding-left: 0.5rem;
|
|
989
|
+
padding-right: 0.5rem;
|
|
990
|
+
display: grid;
|
|
991
|
+
gap: 0.5rem;
|
|
992
|
+
align-items: center;
|
|
993
|
+
grid-template-columns: 1rem 1fr;
|
|
994
|
+
font-size: 0.875rem;
|
|
995
|
+
line-height: 1rem;
|
|
996
|
+
|
|
997
|
+
&[data-highlighted] {
|
|
998
|
+
z-index: 0;
|
|
999
|
+
position: relative;
|
|
1000
|
+
color: white;
|
|
1001
|
+
|
|
1002
|
+
@media (prefers-color-scheme: dark) {
|
|
1003
|
+
color: oklch(14.5% 0 0deg);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
&[data-highlighted]::before {
|
|
1008
|
+
content: '';
|
|
1009
|
+
z-index: -1;
|
|
1010
|
+
position: absolute;
|
|
1011
|
+
inset-block: 0;
|
|
1012
|
+
inset-inline: 0;
|
|
1013
|
+
background-color: oklch(14.5% 0 0deg);
|
|
1014
|
+
|
|
1015
|
+
@media (prefers-color-scheme: dark) {
|
|
1016
|
+
background-color: white;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.ItemText {
|
|
1022
|
+
grid-column-start: 2;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
.ItemIndicator {
|
|
1026
|
+
grid-column-start: 1;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
.Empty {
|
|
1030
|
+
box-sizing: border-box;
|
|
1031
|
+
padding: 1rem 1rem 1rem 0.5rem;
|
|
1032
|
+
font-size: 0.875rem;
|
|
1033
|
+
line-height: 1rem;
|
|
1034
|
+
color: oklch(55.6% 0 0deg);
|
|
1035
|
+
|
|
1036
|
+
@media (prefers-color-scheme: dark) {
|
|
1037
|
+
color: oklch(70.8% 0 0deg);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
```tsx
|
|
1043
|
+
/* index.tsx */
|
|
1044
|
+
'use client';
|
|
1045
|
+
import * as React from 'react';
|
|
1046
|
+
import { Combobox } from '@base-ui/react/combobox';
|
|
1047
|
+
import styles from './index.module.css';
|
|
1048
|
+
|
|
1049
|
+
export default function ExampleCreateItemsCombobox() {
|
|
1050
|
+
const id = React.useId();
|
|
1051
|
+
|
|
1052
|
+
return (
|
|
1053
|
+
<Combobox.Root items={items} defaultValue="banana">
|
|
1054
|
+
<div className={styles.Label}>
|
|
1055
|
+
<label htmlFor={id}>Choose a fruit</label>
|
|
1056
|
+
<Combobox.InputGroup className={styles.InputGroup}>
|
|
1057
|
+
<Combobox.Input placeholder="e.g. Apple" id={id} className={styles.Input} />
|
|
1058
|
+
<div className={styles.ActionButtons}>
|
|
1059
|
+
<Combobox.Clear className={styles.Clear} aria-label="Clear selection">
|
|
1060
|
+
<XIcon />
|
|
1061
|
+
</Combobox.Clear>
|
|
1062
|
+
<Combobox.Trigger className={styles.Trigger} aria-label="Open popup">
|
|
1063
|
+
<CaretDownIcon />
|
|
1064
|
+
</Combobox.Trigger>
|
|
1065
|
+
</div>
|
|
1066
|
+
</Combobox.InputGroup>
|
|
1067
|
+
</div>
|
|
1068
|
+
|
|
1069
|
+
<Combobox.Portal>
|
|
1070
|
+
<Combobox.Positioner className={styles.Positioner} sideOffset={4}>
|
|
1071
|
+
<Combobox.Popup className={styles.Popup}>
|
|
1072
|
+
<Combobox.Empty>
|
|
1073
|
+
<div className={styles.Empty}>No fruits found.</div>
|
|
1074
|
+
</Combobox.Empty>
|
|
1075
|
+
<Combobox.List className={styles.List}>
|
|
1076
|
+
{(item) => (
|
|
1077
|
+
<Combobox.Item key={item.id} value={item.id} className={styles.Item}>
|
|
1078
|
+
<Combobox.ItemIndicator className={styles.ItemIndicator}>
|
|
1079
|
+
<CheckIcon />
|
|
1080
|
+
</Combobox.ItemIndicator>
|
|
1081
|
+
<span className={styles.ItemText}>{item.name}</span>
|
|
1082
|
+
</Combobox.Item>
|
|
1083
|
+
)}
|
|
1084
|
+
</Combobox.List>
|
|
1085
|
+
</Combobox.Popup>
|
|
1086
|
+
</Combobox.Positioner>
|
|
1087
|
+
</Combobox.Portal>
|
|
1088
|
+
</Combobox.Root>
|
|
1089
|
+
);
|
|
1090
|
+
}
|
|
598
1091
|
|
|
599
|
-
|
|
1092
|
+
function CheckIcon(props: React.ComponentProps<'svg'>) {
|
|
1093
|
+
return (
|
|
1094
|
+
<svg
|
|
1095
|
+
width="16"
|
|
1096
|
+
height="16"
|
|
1097
|
+
viewBox="0 0 16 16"
|
|
1098
|
+
fill="none"
|
|
1099
|
+
stroke="currentColor"
|
|
1100
|
+
{...props}
|
|
1101
|
+
style={{ display: 'block', ...props.style }}
|
|
1102
|
+
>
|
|
1103
|
+
<path d="m2.5 8.5 4 4 7-9" />
|
|
1104
|
+
</svg>
|
|
1105
|
+
);
|
|
1106
|
+
}
|
|
600
1107
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
1108
|
+
function XIcon(props: React.ComponentProps<'svg'>) {
|
|
1109
|
+
return (
|
|
1110
|
+
<svg
|
|
1111
|
+
width="16"
|
|
1112
|
+
height="16"
|
|
1113
|
+
viewBox="0 0 16 16"
|
|
1114
|
+
fill="none"
|
|
1115
|
+
stroke="currentColor"
|
|
1116
|
+
strokeLinecap="square"
|
|
1117
|
+
strokeLinejoin="round"
|
|
1118
|
+
{...props}
|
|
1119
|
+
style={{ display: 'block', ...props.style }}
|
|
1120
|
+
>
|
|
1121
|
+
<path d="m4.5 4.5 7 7m-7 0 7-7" />
|
|
1122
|
+
</svg>
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
604
1125
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
1126
|
+
function CaretDownIcon(props: React.ComponentProps<'svg'>) {
|
|
1127
|
+
return (
|
|
1128
|
+
<svg
|
|
1129
|
+
width="16"
|
|
1130
|
+
height="16"
|
|
1131
|
+
viewBox="0 0 16 16"
|
|
1132
|
+
fill="currentColor"
|
|
1133
|
+
{...props}
|
|
1134
|
+
style={{ display: 'block', ...props.style }}
|
|
1135
|
+
>
|
|
1136
|
+
<path d="M12 6H4l4 4.5z" />
|
|
1137
|
+
</svg>
|
|
1138
|
+
);
|
|
609
1139
|
}
|
|
1140
|
+
|
|
1141
|
+
interface Fruit {
|
|
1142
|
+
id: string;
|
|
1143
|
+
name: string;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
const fruits: Fruit[] = [
|
|
1147
|
+
{ id: 'apple', name: 'Apple' },
|
|
1148
|
+
{ id: 'banana', name: 'Banana' },
|
|
1149
|
+
{ id: 'orange', name: 'Orange' },
|
|
1150
|
+
{ id: 'pineapple', name: 'Pineapple' },
|
|
1151
|
+
{ id: 'grape', name: 'Grape' },
|
|
1152
|
+
{ id: 'mango', name: 'Mango' },
|
|
1153
|
+
{ id: 'strawberry', name: 'Strawberry' },
|
|
1154
|
+
{ id: 'blueberry', name: 'Blueberry' },
|
|
1155
|
+
{ id: 'raspberry', name: 'Raspberry' },
|
|
1156
|
+
{ id: 'blackberry', name: 'Blackberry' },
|
|
1157
|
+
{ id: 'cherry', name: 'Cherry' },
|
|
1158
|
+
{ id: 'peach', name: 'Peach' },
|
|
1159
|
+
{ id: 'pear', name: 'Pear' },
|
|
1160
|
+
{ id: 'plum', name: 'Plum' },
|
|
1161
|
+
{ id: 'kiwi', name: 'Kiwi' },
|
|
1162
|
+
{ id: 'watermelon', name: 'Watermelon' },
|
|
1163
|
+
];
|
|
1164
|
+
|
|
1165
|
+
const items = Combobox.createItems(fruits, {
|
|
1166
|
+
getValue: (fruit) => fruit.id,
|
|
1167
|
+
getLabel: (fruit) => fruit.name,
|
|
1168
|
+
});
|
|
1169
|
+
```
|
|
1170
|
+
|
|
1171
|
+
As a rule of thumb, use primitive items for simple lists, object values when the selected record is useful application state, and `createItems()` when selection should use a stable primitive ID while rendering and filtering still use object records.
|
|
1172
|
+
|
|
1173
|
+
Stable IDs preserve item matching when an async data library replaces row objects during a refetch. With object values, use `isItemEqualToValue` to compare their IDs instead.
|
|
1174
|
+
|
|
1175
|
+
When results are filtered externally (for example, by a server-side search), `items` represents records known to the app, while `filteredItems` represents the current result window displayed in the popup. Pass source items rather than derived values to `filteredItems`, preserving the flat or grouped structure of `items`:
|
|
1176
|
+
|
|
1177
|
+
```tsx title="Displaying a window of async results"
|
|
1178
|
+
const items = React.useMemo(
|
|
1179
|
+
() =>
|
|
1180
|
+
Combobox.createItems(knownUsers, {
|
|
1181
|
+
getValue: (user) => user.id,
|
|
1182
|
+
getLabel: (user) => user.name,
|
|
1183
|
+
}),
|
|
1184
|
+
[knownUsers],
|
|
1185
|
+
);
|
|
1186
|
+
|
|
1187
|
+
<Combobox.Root
|
|
1188
|
+
items={items}
|
|
1189
|
+
filteredItems={searchResults}
|
|
1190
|
+
value={selectedUserId}
|
|
1191
|
+
onValueChange={setSelectedUserId}
|
|
1192
|
+
/>;
|
|
610
1193
|
```
|
|
611
1194
|
|
|
1195
|
+
Include the selected user's record in `knownUsers` so its label remains available when it is outside `searchResults`. Alternatively, provide `itemToStringLabel` when the label can be derived from the selected value alone.
|
|
1196
|
+
|
|
612
1197
|
### Multiple select
|
|
613
1198
|
|
|
614
1199
|
The combobox can allow multiple selections by adding the `multiple` prop to `<Combobox.Root>`.
|
|
@@ -639,34 +1224,41 @@ export default function ExampleMultipleCombobox() {
|
|
|
639
1224
|
Programming languages
|
|
640
1225
|
</label>
|
|
641
1226
|
<Combobox.InputGroup className="flex min-h-8 w-64 cursor-text flex-wrap items-center gap-0.5 border border-neutral-950 bg-white dark:bg-neutral-950 px-2 py-1 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-neutral-950 dark:focus-within:outline-white has-[button]:px-1 dark:border-white min-[32rem]:w-[22rem]">
|
|
642
|
-
<Combobox.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
1227
|
+
<Combobox.Value>
|
|
1228
|
+
{(value: ProgrammingLanguage[]) => (
|
|
1229
|
+
<Combobox.Chips
|
|
1230
|
+
className="flex w-full flex-wrap items-center gap-1"
|
|
1231
|
+
aria-label={value.length > 0 ? 'Selected languages' : undefined}
|
|
1232
|
+
>
|
|
1233
|
+
{value.map((language) => (
|
|
1234
|
+
<Combobox.Chip
|
|
1235
|
+
key={language.id}
|
|
1236
|
+
className="group flex min-h-[calc(1.5rem-2px)] cursor-default items-center gap-1 overflow-hidden bg-neutral-100 py-0 pr-[0.2rem] pl-[0.4rem] text-sm leading-none text-neutral-950 outline-none focus-within:bg-neutral-950 focus-within:text-white [@media(hover:hover)]:data-highlighted:bg-neutral-950 [@media(hover:hover)]:data-highlighted:text-white dark:bg-neutral-800 dark:text-white dark:focus-within:bg-white dark:focus-within:text-neutral-950 dark:[@media(hover:hover)]:data-highlighted:bg-white dark:[@media(hover:hover)]:data-highlighted:text-neutral-950"
|
|
1237
|
+
aria-label={language.value}
|
|
1238
|
+
aria-description="Press Backspace or Delete to remove"
|
|
1239
|
+
>
|
|
1240
|
+
{language.value}
|
|
1241
|
+
<Combobox.ChipRemove
|
|
1242
|
+
className="flex size-4 items-center justify-center border-0 bg-transparent p-0 text-inherit hover:bg-neutral-200 group-focus-within:hover:bg-neutral-700 dark:hover:bg-neutral-700 dark:group-focus-within:hover:bg-neutral-200"
|
|
1243
|
+
aria-label={`Remove ${language.value}`}
|
|
651
1244
|
>
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
</Combobox.Chips>
|
|
1245
|
+
<XIcon />
|
|
1246
|
+
</Combobox.ChipRemove>
|
|
1247
|
+
</Combobox.Chip>
|
|
1248
|
+
))}
|
|
1249
|
+
<Combobox.Input
|
|
1250
|
+
id={id}
|
|
1251
|
+
placeholder={value.length > 0 ? '' : 'e.g. TypeScript'}
|
|
1252
|
+
aria-description={
|
|
1253
|
+
value.length > 0
|
|
1254
|
+
? `${value.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
1255
|
+
: undefined
|
|
1256
|
+
}
|
|
1257
|
+
className="h-[calc(1.5rem-2px)] min-w-12 flex-1 border-0 bg-white p-0 text-sm any-pointer-coarse:text-base dark:bg-neutral-950 font-normal text-neutral-950 outline-none placeholder:text-neutral-500 dark:placeholder:text-neutral-400 dark:text-white"
|
|
1258
|
+
/>
|
|
1259
|
+
</Combobox.Chips>
|
|
1260
|
+
)}
|
|
1261
|
+
</Combobox.Value>
|
|
670
1262
|
</Combobox.InputGroup>
|
|
671
1263
|
</div>
|
|
672
1264
|
|
|
@@ -1090,34 +1682,41 @@ export default function ExampleMultipleCombobox() {
|
|
|
1090
1682
|
Programming languages
|
|
1091
1683
|
</label>
|
|
1092
1684
|
<Combobox.InputGroup className={styles.InputGroup}>
|
|
1093
|
-
<Combobox.
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1685
|
+
<Combobox.Value>
|
|
1686
|
+
{(value: ProgrammingLanguage[]) => (
|
|
1687
|
+
<Combobox.Chips
|
|
1688
|
+
className={styles.Chips}
|
|
1689
|
+
aria-label={value.length > 0 ? 'Selected languages' : undefined}
|
|
1690
|
+
>
|
|
1691
|
+
{value.map((language) => (
|
|
1692
|
+
<Combobox.Chip
|
|
1693
|
+
key={language.id}
|
|
1694
|
+
className={styles.Chip}
|
|
1695
|
+
aria-label={language.value}
|
|
1696
|
+
aria-description="Press Backspace or Delete to remove"
|
|
1697
|
+
>
|
|
1698
|
+
{language.value}
|
|
1699
|
+
<Combobox.ChipRemove
|
|
1700
|
+
className={styles.ChipRemove}
|
|
1701
|
+
aria-label={`Remove ${language.value}`}
|
|
1102
1702
|
>
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
</Combobox.Chips>
|
|
1703
|
+
<XIcon />
|
|
1704
|
+
</Combobox.ChipRemove>
|
|
1705
|
+
</Combobox.Chip>
|
|
1706
|
+
))}
|
|
1707
|
+
<Combobox.Input
|
|
1708
|
+
id={id}
|
|
1709
|
+
placeholder={value.length > 0 ? '' : 'e.g. TypeScript'}
|
|
1710
|
+
aria-description={
|
|
1711
|
+
value.length > 0
|
|
1712
|
+
? `${value.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
1713
|
+
: undefined
|
|
1714
|
+
}
|
|
1715
|
+
className={styles.Input}
|
|
1716
|
+
/>
|
|
1717
|
+
</Combobox.Chips>
|
|
1718
|
+
)}
|
|
1719
|
+
</Combobox.Value>
|
|
1121
1720
|
</Combobox.InputGroup>
|
|
1122
1721
|
</div>
|
|
1123
1722
|
|
|
@@ -1198,6 +1797,9 @@ const langs: ProgrammingLanguage[] = [
|
|
|
1198
1797
|
];
|
|
1199
1798
|
```
|
|
1200
1799
|
|
|
1800
|
+
In order for screen readers to announce how to reach and remove the chips, add `aria-description` to `<Combobox.Chip>` and `<Combobox.Input>`, alongside the `aria-label` on `<Combobox.Chips>` and `<Combobox.ChipRemove>`.
|
|
1801
|
+
Base UI does not ship these strings. Translate them together with the rest of your interface.
|
|
1802
|
+
|
|
1201
1803
|
Visible chips can be limited by slicing the selected values rendered in `<Combobox.Value>`:
|
|
1202
1804
|
|
|
1203
1805
|
```tsx title="Limiting visible chips"
|
|
@@ -1212,7 +1814,7 @@ const CHIP_LIMIT = 3;
|
|
|
1212
1814
|
return (
|
|
1213
1815
|
<>
|
|
1214
1816
|
{visibleValue.map((item) => (
|
|
1215
|
-
<Combobox.Chip key={item}>
|
|
1817
|
+
<Combobox.Chip key={item} aria-description="Press Backspace or Delete to remove">
|
|
1216
1818
|
{item}
|
|
1217
1819
|
<Combobox.ChipRemove aria-label={`Remove ${item}`} />
|
|
1218
1820
|
</Combobox.Chip>
|
|
@@ -1220,13 +1822,53 @@ const CHIP_LIMIT = 3;
|
|
|
1220
1822
|
{/* @highlight-start */}
|
|
1221
1823
|
{hiddenCount > 0 && <span>{`+${hiddenCount} more`}</span>}
|
|
1222
1824
|
{/* @highlight-end */}
|
|
1223
|
-
<Combobox.Input
|
|
1825
|
+
<Combobox.Input
|
|
1826
|
+
aria-description={
|
|
1827
|
+
selectedValue.length > 0
|
|
1828
|
+
? `${selectedValue.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
1829
|
+
: undefined
|
|
1830
|
+
}
|
|
1831
|
+
/>
|
|
1224
1832
|
</>
|
|
1225
1833
|
);
|
|
1226
1834
|
}}
|
|
1227
1835
|
</Combobox.Value>;
|
|
1228
1836
|
```
|
|
1229
1837
|
|
|
1838
|
+
#### Keeping the filter after selection
|
|
1839
|
+
|
|
1840
|
+
In `multiple` mode, selecting an item clears the typed filter and closes the popup when the input is rendered outside it. To let users pick several results from one query, cancel the relevant change request.
|
|
1841
|
+
|
|
1842
|
+
Which request to cancel depends on the input's placement. When the input is outside the popup, cancel the `item-press` close request in `onOpenChange`. When it is inside, cancel the clear request in `onInputValueChange`, marked with `eventDetails.isItemPress`.
|
|
1843
|
+
|
|
1844
|
+
```jsx title="Input outside the popup"
|
|
1845
|
+
<Combobox.Root
|
|
1846
|
+
multiple
|
|
1847
|
+
onOpenChange={(open, eventDetails) => {
|
|
1848
|
+
if (!open && eventDetails.reason === 'item-press') {
|
|
1849
|
+
eventDetails.cancel();
|
|
1850
|
+
}
|
|
1851
|
+
}}
|
|
1852
|
+
>
|
|
1853
|
+
{/* ... */}
|
|
1854
|
+
</Combobox.Root>
|
|
1855
|
+
```
|
|
1856
|
+
|
|
1857
|
+
```jsx title="Input inside the popup"
|
|
1858
|
+
<Combobox.Root
|
|
1859
|
+
multiple
|
|
1860
|
+
onInputValueChange={(value, eventDetails) => {
|
|
1861
|
+
if (eventDetails.isItemPress) {
|
|
1862
|
+
eventDetails.cancel();
|
|
1863
|
+
}
|
|
1864
|
+
}}
|
|
1865
|
+
>
|
|
1866
|
+
{/* ... */}
|
|
1867
|
+
</Combobox.Root>
|
|
1868
|
+
```
|
|
1869
|
+
|
|
1870
|
+
The typed filter still resets once the popup closes.
|
|
1871
|
+
|
|
1230
1872
|
### Input inside popup
|
|
1231
1873
|
|
|
1232
1874
|
`<Combobox.Input>` can be rendered inside `<Combobox.Popup>` to create a searchable select popup.
|
|
@@ -2810,6 +3452,7 @@ export default function ExampleAsyncSingleCombobox() {
|
|
|
2810
3452
|
<Combobox.Root
|
|
2811
3453
|
items={items}
|
|
2812
3454
|
itemToStringLabel={(user: DirectoryUser) => user.name}
|
|
3455
|
+
isItemEqualToValue={(item, value) => item.id === value.id}
|
|
2813
3456
|
filter={null}
|
|
2814
3457
|
onOpenChangeComplete={(open) => {
|
|
2815
3458
|
if (!open && selectedValue) {
|
|
@@ -3466,6 +4109,7 @@ export default function ExampleAsyncSingleCombobox() {
|
|
|
3466
4109
|
<Combobox.Root
|
|
3467
4110
|
items={items}
|
|
3468
4111
|
itemToStringLabel={(user: DirectoryUser) => user.name}
|
|
4112
|
+
isItemEqualToValue={(item, value) => item.id === value.id}
|
|
3469
4113
|
filter={null}
|
|
3470
4114
|
onOpenChangeComplete={(open) => {
|
|
3471
4115
|
if (!open && selectedValue) {
|
|
@@ -3830,6 +4474,7 @@ export default function ExampleAsyncMultipleCombobox() {
|
|
|
3830
4474
|
<Combobox.Root
|
|
3831
4475
|
items={items}
|
|
3832
4476
|
itemToStringLabel={(user: DirectoryUser) => user.name}
|
|
4477
|
+
isItemEqualToValue={(item, value) => item.id === value.id}
|
|
3833
4478
|
multiple
|
|
3834
4479
|
filter={null}
|
|
3835
4480
|
onOpenChangeComplete={(open) => {
|
|
@@ -3893,34 +4538,41 @@ export default function ExampleAsyncMultipleCombobox() {
|
|
|
3893
4538
|
Assign reviewers
|
|
3894
4539
|
</label>
|
|
3895
4540
|
<Combobox.InputGroup className="flex min-h-8 w-64 cursor-text flex-wrap items-center gap-0.5 border border-neutral-950 bg-white dark:bg-neutral-950 px-2 py-1 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-neutral-950 dark:focus-within:outline-white has-[button]:px-1 dark:border-white min-[32rem]:w-[22rem]">
|
|
3896
|
-
<Combobox.
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
4541
|
+
<Combobox.Value>
|
|
4542
|
+
{(value: DirectoryUser[]) => (
|
|
4543
|
+
<Combobox.Chips
|
|
4544
|
+
className="flex w-full flex-wrap items-center gap-1"
|
|
4545
|
+
aria-label={value.length > 0 ? 'Selected reviewers' : undefined}
|
|
4546
|
+
>
|
|
4547
|
+
{value.map((user) => (
|
|
4548
|
+
<Combobox.Chip
|
|
4549
|
+
key={user.id}
|
|
4550
|
+
className="group flex min-h-[calc(1.5rem-2px)] cursor-default items-center gap-1 overflow-hidden bg-neutral-100 py-0 pr-[0.2rem] pl-[0.4rem] text-sm leading-none text-neutral-950 outline-none focus-within:bg-neutral-950 focus-within:text-white [@media(hover:hover)]:data-highlighted:bg-neutral-950 [@media(hover:hover)]:data-highlighted:text-white dark:bg-neutral-800 dark:text-white dark:focus-within:bg-white dark:focus-within:text-neutral-950 dark:[@media(hover:hover)]:data-highlighted:bg-white dark:[@media(hover:hover)]:data-highlighted:text-neutral-950"
|
|
4551
|
+
aria-label={user.name}
|
|
4552
|
+
aria-description="Press Backspace or Delete to remove"
|
|
4553
|
+
>
|
|
4554
|
+
{user.name}
|
|
4555
|
+
<Combobox.ChipRemove
|
|
4556
|
+
className="flex size-4 items-center justify-center border-0 bg-transparent p-0 text-inherit hover:bg-neutral-200 group-focus-within:hover:bg-neutral-700 dark:hover:bg-neutral-700 dark:group-focus-within:hover:bg-neutral-200"
|
|
4557
|
+
aria-label={`Remove ${user.name}`}
|
|
3905
4558
|
>
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
</Combobox.Chips>
|
|
4559
|
+
<XIcon />
|
|
4560
|
+
</Combobox.ChipRemove>
|
|
4561
|
+
</Combobox.Chip>
|
|
4562
|
+
))}
|
|
4563
|
+
<Combobox.Input
|
|
4564
|
+
id={id}
|
|
4565
|
+
placeholder={value.length > 0 ? '' : 'e.g. Michael'}
|
|
4566
|
+
aria-description={
|
|
4567
|
+
value.length > 0
|
|
4568
|
+
? `${value.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
4569
|
+
: undefined
|
|
4570
|
+
}
|
|
4571
|
+
className="h-[calc(1.5rem-2px)] min-w-12 flex-1 border-0 bg-white p-0 text-sm any-pointer-coarse:text-base dark:bg-neutral-950 font-normal text-neutral-950 outline-none placeholder:text-neutral-500 dark:placeholder:text-neutral-400 dark:text-white"
|
|
4572
|
+
/>
|
|
4573
|
+
</Combobox.Chips>
|
|
4574
|
+
)}
|
|
4575
|
+
</Combobox.Value>
|
|
3924
4576
|
</Combobox.InputGroup>
|
|
3925
4577
|
</div>
|
|
3926
4578
|
|
|
@@ -4565,6 +5217,7 @@ export default function ExampleAsyncMultipleCombobox() {
|
|
|
4565
5217
|
<Combobox.Root
|
|
4566
5218
|
items={items}
|
|
4567
5219
|
itemToStringLabel={(user: DirectoryUser) => user.name}
|
|
5220
|
+
isItemEqualToValue={(item, value) => item.id === value.id}
|
|
4568
5221
|
multiple
|
|
4569
5222
|
filter={null}
|
|
4570
5223
|
onOpenChangeComplete={(open) => {
|
|
@@ -4625,30 +5278,41 @@ export default function ExampleAsyncMultipleCombobox() {
|
|
|
4625
5278
|
Assign reviewers
|
|
4626
5279
|
</label>
|
|
4627
5280
|
<Combobox.InputGroup className={styles.InputGroup}>
|
|
4628
|
-
<Combobox.
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
5281
|
+
<Combobox.Value>
|
|
5282
|
+
{(value: DirectoryUser[]) => (
|
|
5283
|
+
<Combobox.Chips
|
|
5284
|
+
className={styles.Chips}
|
|
5285
|
+
aria-label={value.length > 0 ? 'Selected reviewers' : undefined}
|
|
5286
|
+
>
|
|
5287
|
+
{value.map((user) => (
|
|
5288
|
+
<Combobox.Chip
|
|
5289
|
+
key={user.id}
|
|
5290
|
+
className={styles.Chip}
|
|
5291
|
+
aria-label={user.name}
|
|
5292
|
+
aria-description="Press Backspace or Delete to remove"
|
|
5293
|
+
>
|
|
5294
|
+
{user.name}
|
|
5295
|
+
<Combobox.ChipRemove
|
|
5296
|
+
className={styles.ChipRemove}
|
|
5297
|
+
aria-label={`Remove ${user.name}`}
|
|
5298
|
+
>
|
|
5299
|
+
<XIcon />
|
|
5300
|
+
</Combobox.ChipRemove>
|
|
5301
|
+
</Combobox.Chip>
|
|
5302
|
+
))}
|
|
5303
|
+
<Combobox.Input
|
|
5304
|
+
id={id}
|
|
5305
|
+
placeholder={value.length > 0 ? '' : 'e.g. Michael'}
|
|
5306
|
+
aria-description={
|
|
5307
|
+
value.length > 0
|
|
5308
|
+
? `${value.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
5309
|
+
: undefined
|
|
5310
|
+
}
|
|
5311
|
+
className={styles.Input}
|
|
5312
|
+
/>
|
|
5313
|
+
</Combobox.Chips>
|
|
5314
|
+
)}
|
|
5315
|
+
</Combobox.Value>
|
|
4652
5316
|
</Combobox.InputGroup>
|
|
4653
5317
|
</div>
|
|
4654
5318
|
|
|
@@ -4992,36 +5656,43 @@ export default function ExampleCreatableCombobox() {
|
|
|
4992
5656
|
Labels
|
|
4993
5657
|
</label>
|
|
4994
5658
|
<Combobox.InputGroup className="flex min-h-8 w-64 cursor-text flex-wrap items-center gap-0.5 border border-neutral-950 bg-white dark:bg-neutral-950 px-2 py-1 focus-within:outline-2 focus-within:-outline-offset-1 focus-within:outline-neutral-950 dark:focus-within:outline-white has-[button]:px-1 dark:border-white min-[32rem]:w-[22rem]">
|
|
4995
|
-
<Combobox.
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5659
|
+
<Combobox.Value>
|
|
5660
|
+
{(value: LabelItem[]) => (
|
|
5661
|
+
<Combobox.Chips
|
|
5662
|
+
className="flex w-full flex-wrap items-center gap-1"
|
|
5663
|
+
aria-label={value.length > 0 ? 'Selected labels' : undefined}
|
|
5664
|
+
>
|
|
5665
|
+
{value.map((label) => (
|
|
5666
|
+
<Combobox.Chip
|
|
5667
|
+
key={label.id}
|
|
5668
|
+
className="group flex min-h-[calc(1.5rem-2px)] cursor-default items-center gap-1 overflow-hidden bg-neutral-100 py-0 pr-[0.2rem] pl-[0.4rem] text-sm leading-none text-neutral-950 outline-none focus-within:bg-neutral-950 focus-within:text-white [@media(hover:hover)]:data-highlighted:bg-neutral-950 [@media(hover:hover)]:data-highlighted:text-white dark:bg-neutral-800 dark:text-white dark:focus-within:bg-white dark:focus-within:text-neutral-950 dark:[@media(hover:hover)]:data-highlighted:bg-white dark:[@media(hover:hover)]:data-highlighted:text-neutral-950"
|
|
5669
|
+
aria-label={label.value}
|
|
5670
|
+
aria-description="Press Backspace or Delete to remove"
|
|
5671
|
+
>
|
|
5672
|
+
{label.value}
|
|
5673
|
+
<Combobox.ChipRemove
|
|
5674
|
+
className="flex size-4 items-center justify-center border-0 bg-transparent p-0 text-inherit hover:bg-neutral-200 group-focus-within:hover:bg-neutral-700 dark:hover:bg-neutral-700 dark:group-focus-within:hover:bg-neutral-200"
|
|
5675
|
+
aria-label={`Remove ${label.value}`}
|
|
5004
5676
|
>
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
</Combobox.Chips>
|
|
5677
|
+
<XIcon />
|
|
5678
|
+
</Combobox.ChipRemove>
|
|
5679
|
+
</Combobox.Chip>
|
|
5680
|
+
))}
|
|
5681
|
+
<Combobox.Input
|
|
5682
|
+
ref={comboboxInputRef}
|
|
5683
|
+
id={id}
|
|
5684
|
+
placeholder={value.length > 0 ? '' : 'e.g. bug'}
|
|
5685
|
+
aria-description={
|
|
5686
|
+
value.length > 0
|
|
5687
|
+
? `${value.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
5688
|
+
: undefined
|
|
5689
|
+
}
|
|
5690
|
+
className="h-[calc(1.5rem-2px)] min-w-12 flex-1 border-0 bg-white p-0 text-sm any-pointer-coarse:text-base dark:bg-neutral-950 font-normal text-neutral-950 outline-none placeholder:text-neutral-500 dark:placeholder:text-neutral-400 dark:text-white"
|
|
5691
|
+
onKeyDown={handleInputKeyDown}
|
|
5692
|
+
/>
|
|
5693
|
+
</Combobox.Chips>
|
|
5694
|
+
)}
|
|
5695
|
+
</Combobox.Value>
|
|
5025
5696
|
</Combobox.InputGroup>
|
|
5026
5697
|
</div>
|
|
5027
5698
|
|
|
@@ -5804,36 +6475,43 @@ export default function ExampleCreatableCombobox() {
|
|
|
5804
6475
|
Labels
|
|
5805
6476
|
</label>
|
|
5806
6477
|
<Combobox.InputGroup className={styles.InputGroup}>
|
|
5807
|
-
<Combobox.
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
6478
|
+
<Combobox.Value>
|
|
6479
|
+
{(value: LabelItem[]) => (
|
|
6480
|
+
<Combobox.Chips
|
|
6481
|
+
className={styles.Chips}
|
|
6482
|
+
aria-label={value.length > 0 ? 'Selected labels' : undefined}
|
|
6483
|
+
>
|
|
6484
|
+
{value.map((label) => (
|
|
6485
|
+
<Combobox.Chip
|
|
6486
|
+
key={label.id}
|
|
6487
|
+
className={styles.Chip}
|
|
6488
|
+
aria-label={label.value}
|
|
6489
|
+
aria-description="Press Backspace or Delete to remove"
|
|
6490
|
+
>
|
|
6491
|
+
{label.value}
|
|
6492
|
+
<Combobox.ChipRemove
|
|
6493
|
+
className={styles.ChipRemove}
|
|
6494
|
+
aria-label={`Remove ${label.value}`}
|
|
5816
6495
|
>
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
</Combobox.Chips>
|
|
6496
|
+
<XIcon />
|
|
6497
|
+
</Combobox.ChipRemove>
|
|
6498
|
+
</Combobox.Chip>
|
|
6499
|
+
))}
|
|
6500
|
+
<Combobox.Input
|
|
6501
|
+
ref={comboboxInputRef}
|
|
6502
|
+
id={id}
|
|
6503
|
+
placeholder={value.length > 0 ? '' : 'e.g. bug'}
|
|
6504
|
+
aria-description={
|
|
6505
|
+
value.length > 0
|
|
6506
|
+
? `${value.length} selected. From the start of the input, press Left Arrow to focus the selected items`
|
|
6507
|
+
: undefined
|
|
6508
|
+
}
|
|
6509
|
+
className={styles.Input}
|
|
6510
|
+
onKeyDown={handleInputKeyDown}
|
|
6511
|
+
/>
|
|
6512
|
+
</Combobox.Chips>
|
|
6513
|
+
)}
|
|
6514
|
+
</Combobox.Value>
|
|
5837
6515
|
</Combobox.InputGroup>
|
|
5838
6516
|
</div>
|
|
5839
6517
|
|
|
@@ -6517,46 +7195,46 @@ Doesn't render its own HTML element.
|
|
|
6517
7195
|
|
|
6518
7196
|
**Root Props:**
|
|
6519
7197
|
|
|
6520
|
-
| Prop | Type
|
|
6521
|
-
| :------------------- |
|
|
6522
|
-
| name | `string`
|
|
6523
|
-
| defaultValue | `Value[] \| Value \| null`
|
|
6524
|
-
| value | `Value[] \| Value \| null`
|
|
6525
|
-
| onValueChange | `((value: Value[] \| Value \| null, eventDetails: Combobox.Root.ChangeEventDetails) => void)`
|
|
6526
|
-
| defaultInputValue | `string \| number \| string[]`
|
|
6527
|
-
| inputValue | `string \| string[] \| number`
|
|
6528
|
-
| onInputValueChange | `((inputValue: string, eventDetails: Combobox.Root.ChangeEventDetails) => void)`
|
|
6529
|
-
| defaultOpen | `boolean`
|
|
6530
|
-
| open | `boolean`
|
|
6531
|
-
| onOpenChange | `((open: boolean, eventDetails: Combobox.Root.ChangeEventDetails) => void)`
|
|
6532
|
-
| autoHighlight | `boolean`
|
|
6533
|
-
| highlightItemOnHover | `boolean`
|
|
6534
|
-
| actionsRef | `React.RefObject<Combobox.Root.Actions \| null>`
|
|
6535
|
-
| autoComplete | `string`
|
|
6536
|
-
| filter | `((
|
|
6537
|
-
| filteredItems | `
|
|
6538
|
-
| form | `string`
|
|
6539
|
-
| grid | `boolean`
|
|
6540
|
-
| inline | `boolean`
|
|
6541
|
-
| isItemEqualToValue | `((itemValue: Value, value: Value) => boolean)`
|
|
6542
|
-
| itemToStringLabel | `((itemValue: Value) => string)`
|
|
6543
|
-
| itemToStringValue | `((itemValue: Value) => string)`
|
|
6544
|
-
| items | `any[] \| Group[]
|
|
6545
|
-
| limit | `number`
|
|
6546
|
-
| locale | `Intl.LocalesArgument`
|
|
6547
|
-
| loopFocus | `boolean`
|
|
6548
|
-
| modal | `boolean`
|
|
6549
|
-
| multiple | `boolean`
|
|
6550
|
-
| onItemHighlighted | `((highlightedValue: Value \| undefined, eventDetails: Combobox.Root.HighlightEventDetails) => void)`
|
|
6551
|
-
| onOpenChangeComplete | `((open: boolean) => void)`
|
|
6552
|
-
| openOnInputClick | `boolean`
|
|
6553
|
-
| virtualized | `boolean`
|
|
6554
|
-
| disabled | `boolean`
|
|
6555
|
-
| readOnly | `boolean`
|
|
6556
|
-
| required | `boolean`
|
|
6557
|
-
| inputRef | `React.Ref<HTMLInputElement>`
|
|
6558
|
-
| id | `string`
|
|
6559
|
-
| children | `React.ReactNode`
|
|
7198
|
+
| Prop | Type | Default | Description |
|
|
7199
|
+
| :------------------- | :---------------------------------------------------------------------------------------------------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7200
|
+
| name | `string` | - | Identifies the field when a form is submitted. |
|
|
7201
|
+
| defaultValue | `Value[] \| Value \| null` | - | The uncontrolled selected value of the combobox when it's initially rendered. To render a controlled combobox, use the `value` prop instead. |
|
|
7202
|
+
| value | `Value[] \| Value \| null` | - | The selected value of the combobox. Use when controlled. |
|
|
7203
|
+
| onValueChange | `((value: Value[] \| Value \| null, eventDetails: Combobox.Root.ChangeEventDetails) => void)` | - | Event handler called when the selected value of the combobox changes. |
|
|
7204
|
+
| defaultInputValue | `string \| number \| string[]` | - | The uncontrolled input value when initially rendered. To render a controlled input, use the `inputValue` prop instead. |
|
|
7205
|
+
| inputValue | `string \| string[] \| number` | - | The input value of the combobox. Use when controlled. |
|
|
7206
|
+
| onInputValueChange | `((inputValue: string, eventDetails: Combobox.Root.ChangeEventDetails) => void)` | - | Event handler called when the input value changes. |
|
|
7207
|
+
| defaultOpen | `boolean` | `false` | Whether the popup is initially open. To render a controlled popup, use the `open` prop instead. |
|
|
7208
|
+
| open | `boolean` | - | Whether the popup is currently open. Use when controlled. |
|
|
7209
|
+
| onOpenChange | `((open: boolean, eventDetails: Combobox.Root.ChangeEventDetails) => void)` | - | Event handler called when the popup is opened or closed. |
|
|
7210
|
+
| autoHighlight | `boolean` | `false` | Whether the first matching item is highlighted automatically while filtering. |
|
|
7211
|
+
| highlightItemOnHover | `boolean` | `true` | Whether moving the pointer over items should highlight them.
Disabling this prop allows CSS `:hover` to be differentiated from the `:focus` (`data-highlighted`) state. |
|
|
7212
|
+
| actionsRef | `React.RefObject<Combobox.Root.Actions \| null>` | - | A ref to imperative actions. `unmount`: Manually unmounts the combobox.
Call this after any externally controlled closing animation finishes. |
|
|
7213
|
+
| autoComplete | `string` | - | Provides a hint to the browser for autofill. |
|
|
7214
|
+
| filter | `((item: Item, query: string, itemToString?: ((item: Item) => string)) => boolean) \| null` | - | ComboboxFilter function used to match items vs input query.
Receives the source item, which is the derived value's item when `items` is a `createItems()`
collection, and the item itself otherwise. |
|
|
7215
|
+
| filteredItems | `Item[] \| Group<Item>[]` | - | Filtered items to display in the list.
When provided, the list uses these items instead of filtering the `items` prop internally.
When `items` is also provided, this array must preserve its flat or grouped structure.
With a `createItems()` collection, pass source items rather than derived values.
Nullish entries are not supported, as in `items`.
Use when you want to control filtering logic externally with the `useFilter()` hook. |
|
|
7216
|
+
| form | `string` | - | Identifies the form that owns the internal input.
Useful when the combobox is rendered outside the form. |
|
|
7217
|
+
| grid | `boolean` | `false` | Whether list items are presented in a grid layout.
When enabled, arrow keys navigate across rows and columns inferred from DOM rows. |
|
|
7218
|
+
| inline | `boolean` | `false` | Whether the list is rendered inline without using the component's own popup. Specify `open` unconditionally in conjunction with this prop so the list is considered
visible: `<Combobox.Root inline open>` In a `Combobox.Root` > `Dialog.Root` composition, bind the Combobox's `open` and
`onOpenChange` props to the `Dialog`'s `open` and `onOpenChange` state instead so the
component resets its transient state (filter query, highlighted item, and input value) when
the dialog closes. |
|
|
7219
|
+
| isItemEqualToValue | `((itemValue: Value, value: Value) => boolean)` | - | Custom comparison logic used to determine if a combobox item value matches the current selected value. Useful when item values are objects without matching referentially.
With a `createItems()` collection, both arguments are derived values.
Defaults to `Object.is` comparison. |
|
|
7220
|
+
| itemToStringLabel | `((itemValue: Value) => string)` | - | When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for display in the input.
If the shape of the object is `{ value, label }`, the label will be used automatically without needing to specify this prop.
With a `createItems()` collection, this receives the derived value, and the collection's
`getLabel` takes precedence for values it can resolve. |
|
|
7221
|
+
| itemToStringValue | `((itemValue: Value) => string)` | - | When the item values are objects (`<Combobox.Item value={object}>`), this function converts the object value to a string representation for form submission.
If the shape of the object is `{ value, label }`, the value will be used automatically without needing to specify this prop.
With a `createItems()` collection, this receives the derived value. |
|
|
7222
|
+
| items | `any[] \| Group[] \| ComboboxItemCollection<Item, Value>` | - | The items to be displayed in the list.
Can be a flat array of items, an array of groups with items, or a collection created by
the `createItems()` function, which derives each item's selection value and label.
Nullish entries are not supported: remove them from the data before passing it. |
|
|
7223
|
+
| limit | `number` | `-1` | The maximum number of items to display in the list. |
|
|
7224
|
+
| locale | `Intl.LocalesArgument` | - | The locale to use for string comparison.
Defaults to the user's runtime locale. |
|
|
7225
|
+
| loopFocus | `boolean` | `true` | 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 ArrowDown again from the input, or the last item can be reached by pressing ArrowUp from the input.
The input is always included in the focus loop per [ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/).
When disabled, focus does not move when on the last element and the user presses ArrowDown, or when on the first element and the user presses ArrowUp. |
|
|
7226
|
+
| modal | `boolean` | `false` | Determines if the popup enters a modal state when open. `true`: user interaction is limited to the popup: document page scroll is locked and pointer interactions on outside elements are disabled.`false`: user interaction with the rest of the document is allowed. On touch devices, a `true` modal blocks outside taps but leaves the page scrollable unless the popup spans nearly the full viewport width, matching native iOS behavior. |
|
|
7227
|
+
| multiple | `boolean` | `false` | Whether multiple items can be selected. |
|
|
7228
|
+
| onItemHighlighted | `((highlightedValue: Value \| undefined, eventDetails: Combobox.Root.HighlightEventDetails) => void)` | - | Callback fired when an item is highlighted or unhighlighted.
Receives the highlighted item value (or `undefined` if no item is highlighted) and event details with a `reason` property describing why the highlight changed.
The `reason` can be: `'keyboard'`: the highlight changed due to keyboard navigation.`'pointer'`: the highlight changed due to pointer hovering.`'none'`: the highlight changed programmatically. |
|
|
7229
|
+
| onOpenChangeComplete | `((open: boolean) => void)` | - | Event handler called after any animations complete when the popup is opened or closed. |
|
|
7230
|
+
| openOnInputClick | `boolean` | `true` | Whether the popup opens when clicking the input. |
|
|
7231
|
+
| virtualized | `boolean` | `false` | Whether the items are being externally virtualized. |
|
|
7232
|
+
| disabled | `boolean` | `false` | Whether the component should ignore user interaction. |
|
|
7233
|
+
| readOnly | `boolean` | `false` | Whether the user should be unable to choose a different option from the popup. |
|
|
7234
|
+
| required | `boolean` | `false` | Whether the user must choose a value before submitting a form. |
|
|
7235
|
+
| inputRef | `React.Ref<HTMLInputElement>` | - | A ref to the hidden input element. |
|
|
7236
|
+
| id | `string` | - | The id of the component. |
|
|
7237
|
+
| children | `React.ReactNode` | - | - |
|
|
6560
7238
|
|
|
6561
7239
|
**`autoComplete` Prop References:**
|
|
6562
7240
|
|
|
@@ -6602,7 +7280,6 @@ type ComboboxRootChangeEventReason =
|
|
|
6602
7280
|
|
|
6603
7281
|
```typescript
|
|
6604
7282
|
type ComboboxRootChangeEventDetails = (
|
|
6605
|
-
| { reason: 'none'; event: Event }
|
|
6606
7283
|
| { reason: 'trigger-press'; event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent }
|
|
6607
7284
|
| { reason: 'input-press'; event: MouseEvent | PointerEvent | TouchEvent | KeyboardEvent }
|
|
6608
7285
|
| { reason: 'outside-press'; event: MouseEvent | PointerEvent | TouchEvent }
|
|
@@ -6616,6 +7293,7 @@ type ComboboxRootChangeEventDetails = (
|
|
|
6616
7293
|
| { reason: 'clear-press'; event: MouseEvent | PointerEvent | KeyboardEvent }
|
|
6617
7294
|
| { reason: 'chip-remove-press'; event: MouseEvent | PointerEvent | KeyboardEvent }
|
|
6618
7295
|
| { reason: 'cancel-open'; event: MouseEvent }
|
|
7296
|
+
| { reason: 'none'; event: Event }
|
|
6619
7297
|
) & {
|
|
6620
7298
|
/** Cancels Base UI from handling the event. */
|
|
6621
7299
|
cancel: () => void;
|
|
@@ -6627,6 +7305,11 @@ type ComboboxRootChangeEventDetails = (
|
|
|
6627
7305
|
isPropagationAllowed: boolean;
|
|
6628
7306
|
/** The element that triggered the event, if applicable. */
|
|
6629
7307
|
trigger: Element | undefined;
|
|
7308
|
+
/**
|
|
7309
|
+
* When `reason` is `input-clear` in multiple mode, indicates whether an item press caused the
|
|
7310
|
+
* clear. Automatic cleanup clears omit this property.
|
|
7311
|
+
*/
|
|
7312
|
+
isItemPress?: boolean;
|
|
6630
7313
|
};
|
|
6631
7314
|
```
|
|
6632
7315
|
|
|
@@ -6691,6 +7374,8 @@ type ComboboxTriggerState = {
|
|
|
6691
7374
|
open: boolean;
|
|
6692
7375
|
/** Whether the component should ignore user interaction. */
|
|
6693
7376
|
disabled: boolean;
|
|
7377
|
+
/** Whether the component should ignore user edits. */
|
|
7378
|
+
readOnly: boolean;
|
|
6694
7379
|
/** Indicates which side the corresponding popup is positioned relative to its anchor. */
|
|
6695
7380
|
popupSide: Side | null;
|
|
6696
7381
|
/** Present when the corresponding items list is empty. */
|
|
@@ -6717,10 +7402,10 @@ Doesn't render its own HTML element.
|
|
|
6717
7402
|
|
|
6718
7403
|
**Value Props:**
|
|
6719
7404
|
|
|
6720
|
-
| Prop | Type | Default | Description
|
|
6721
|
-
| :---------- | :------------------------------------------------------------- | :------ |
|
|
6722
|
-
| placeholder | `React.ReactNode` | - | The placeholder value to display when no value is selected.
This is overridden by `children` if specified, or by a null item's label in `items`.
|
|
6723
|
-
| children | `React.ReactNode \| ((selectedValue: any) => React.ReactNode)` | - | -
|
|
7405
|
+
| Prop | Type | Default | Description |
|
|
7406
|
+
| :---------- | :------------------------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
7407
|
+
| placeholder | `React.ReactNode` | - | The placeholder value to display when no value is selected.
This is overridden by `children` if specified, or by a null item's label in `items`. |
|
|
7408
|
+
| children | `React.ReactNode \| ((selectedValue: any) => React.ReactNode)` | - | Accepts a function that returns a `ReactNode` to format the selected value.
Treat the value as read-only: in `multiple` mode it may be a shared frozen array
when nothing is selected. |
|
|
6724
7409
|
|
|
6725
7410
|
### Value.Props
|
|
6726
7411
|
|
|
@@ -7073,9 +7758,9 @@ Renders a `<div>` element.
|
|
|
7073
7758
|
| :------------------ | :------------------------------------------------------------------------- | :-------------------------------------------------------------------- |
|
|
7074
7759
|
| data-open | - | Present when the popup is open. |
|
|
7075
7760
|
| data-closed | - | Present when the popup is closed. |
|
|
7761
|
+
| data-anchor-hidden | - | Present when the anchor is hidden. |
|
|
7076
7762
|
| data-align | `'start' \| 'center' \| 'end'` | Indicates how the popup is aligned relative to specified side. |
|
|
7077
7763
|
| data-empty | - | Present when the items list is empty. |
|
|
7078
|
-
| data-instant | `'click' \| 'dismiss'` | Present if animations should be instant. |
|
|
7079
7764
|
| data-side | `'top' \| 'bottom' \| 'left' \| 'right' \| 'inline-end' \| 'inline-start'` | Indicates which side the popup is positioned relative to the trigger. |
|
|
7080
7765
|
| data-starting-style | - | Present when the popup begins animating in. |
|
|
7081
7766
|
| data-ending-style | - | Present when the popup is animating out. |
|
|
@@ -7534,6 +8219,46 @@ type ComboboxItemIndicatorState = {
|
|
|
7534
8219
|
};
|
|
7535
8220
|
```
|
|
7536
8221
|
|
|
8222
|
+
### ComboboxItemCollection
|
|
8223
|
+
|
|
8224
|
+
An opaque collection created by `createItems()`.
|
|
8225
|
+
|
|
8226
|
+
It carries the source item and derived value types so the root can infer the list item and
|
|
8227
|
+
selection value types.
|
|
8228
|
+
|
|
8229
|
+
Pass it directly to the root's `items` prop; it has no public members.
|
|
8230
|
+
|
|
8231
|
+
### createItems
|
|
8232
|
+
|
|
8233
|
+
Creates a collection for the root's `items` prop. Values and labels are derived on first use.
|
|
8234
|
+
|
|
8235
|
+
Accepts either a flat item array or an array of groups. The `getValue` and `getLabel` accessors
|
|
8236
|
+
receive items, not groups.
|
|
8237
|
+
|
|
8238
|
+
Items cannot have an `items` array property because they would be interpreted as groups.
|
|
8239
|
+
Rename that field or cast the data when the runtime values are known not to contain arrays.
|
|
8240
|
+
|
|
8241
|
+
The data must not contain nullish entries: remove them before creating the collection, as for
|
|
8242
|
+
the root's `items` prop.
|
|
8243
|
+
|
|
8244
|
+
Create static collections at module scope. Wrap dynamic collections in `React.useMemo()` keyed
|
|
8245
|
+
by their data.
|
|
8246
|
+
|
|
8247
|
+
**Parameters:**
|
|
8248
|
+
|
|
8249
|
+
| Parameter | Type | Default | Description |
|
|
8250
|
+
| :-------- | :--------------------------------------------------------- | :------ | :-------------------------------------------------------------------------- |
|
|
8251
|
+
| data | `ComboboxItemsData<Item> \| undefined` | - | The flat or grouped source items, or `undefined` while they are loading. |
|
|
8252
|
+
| options | `CreateComboboxItemsOptions<Item, ComboboxPrimitiveValue>` | - | Functions that derive each source item's selection value and display label. |
|
|
8253
|
+
|
|
8254
|
+
**Return Value:**
|
|
8255
|
+
|
|
8256
|
+
A collection whose selection value is the `getValue` accessor's return value.
|
|
8257
|
+
|
|
8258
|
+
```tsx
|
|
8259
|
+
type ReturnValue = ComboboxItemCollection<Item, ComboboxPrimitiveValue>;
|
|
8260
|
+
```
|
|
8261
|
+
|
|
7537
8262
|
### InputGroup
|
|
7538
8263
|
|
|
7539
8264
|
A wrapper for the input and its associated controls.
|
|
@@ -7606,7 +8331,7 @@ Matches items against a query using `Intl.Collator` for robust string matching.
|
|
|
7606
8331
|
|
|
7607
8332
|
| Parameter | Type | Default | Description |
|
|
7608
8333
|
| :-------- | :---------------------- | :------ | :---------- |
|
|
7609
|
-
| options? | `ComboboxFilterOptions` |
|
|
8334
|
+
| options? | `ComboboxFilterOptions` | `{}` | - |
|
|
7610
8335
|
|
|
7611
8336
|
**Return Value:**
|
|
7612
8337
|
|
|
@@ -7617,6 +8342,7 @@ type ReturnValue = ComboboxFilter;
|
|
|
7617
8342
|
### useFilteredItems
|
|
7618
8343
|
|
|
7619
8344
|
Returns the internally filtered items.
|
|
8345
|
+
Treat the result as read-only: it is internal state and may be a shared frozen array.
|
|
7620
8346
|
|
|
7621
8347
|
**Return Value:**
|
|
7622
8348
|
|
|
@@ -7648,7 +8374,10 @@ type ComboboxFilterOptions = {
|
|
|
7648
8374
|
* @default false
|
|
7649
8375
|
*/
|
|
7650
8376
|
multiple?: boolean;
|
|
7651
|
-
/**
|
|
8377
|
+
/**
|
|
8378
|
+
* The current value of the combobox, used to keep every item visible while the query still
|
|
8379
|
+
* matches the selection.
|
|
8380
|
+
*/
|
|
7652
8381
|
value?: any;
|
|
7653
8382
|
/**
|
|
7654
8383
|
* The locale to use for string comparison.
|
|
@@ -7658,6 +8387,36 @@ type ComboboxFilterOptions = {
|
|
|
7658
8387
|
};
|
|
7659
8388
|
```
|
|
7660
8389
|
|
|
8390
|
+
### ComboboxPrimitiveValue
|
|
8391
|
+
|
|
8392
|
+
```typescript
|
|
8393
|
+
type ComboboxPrimitiveValue = string | number | bigint | boolean;
|
|
8394
|
+
```
|
|
8395
|
+
|
|
8396
|
+
### CreateComboboxItemsOptions
|
|
8397
|
+
|
|
8398
|
+
```typescript
|
|
8399
|
+
type CreateComboboxItemsOptions<
|
|
8400
|
+
Item,
|
|
8401
|
+
Value extends ComboboxPrimitiveValue = ComboboxPrimitiveValue,
|
|
8402
|
+
> = {
|
|
8403
|
+
/**
|
|
8404
|
+
* Projects an item to the primitive value that identifies it, used as the item's
|
|
8405
|
+
* selection value.
|
|
8406
|
+
*
|
|
8407
|
+
* `null` and `undefined` are reserved for no selection, and each item must derive a unique
|
|
8408
|
+
* value. Prefer stable IDs from your application data.
|
|
8409
|
+
*/
|
|
8410
|
+
getValue: (item: Item) => Value;
|
|
8411
|
+
/**
|
|
8412
|
+
* Projects an item to the label string that represents it in the input and when matching the
|
|
8413
|
+
* typed query. The root's `itemToStringLabel` prop is the fallback for values whose item is in
|
|
8414
|
+
* neither the data nor the current `filteredItems`.
|
|
8415
|
+
*/
|
|
8416
|
+
getLabel: (item: Item) => string;
|
|
8417
|
+
};
|
|
8418
|
+
```
|
|
8419
|
+
|
|
7661
8420
|
## External Types
|
|
7662
8421
|
|
|
7663
8422
|
### Side
|
|
@@ -7725,7 +8484,8 @@ type Orientation = 'horizontal' | 'vertical';
|
|
|
7725
8484
|
- `Combobox.Separator`: `Combobox.Separator`, `Combobox.Separator.Props`, `Combobox.Separator.State`
|
|
7726
8485
|
- `Combobox.useFilter`
|
|
7727
8486
|
- `Combobox.useFilteredItems`
|
|
7728
|
-
- `
|
|
8487
|
+
- `Combobox.createItems`
|
|
8488
|
+
- `Default`: `ComboboxFilter`, `ComboboxFilterOptions`, `ComboboxPrimitiveValue`, `CreateComboboxItemsOptions`, `ComboboxItemCollection`, `ComboboxRootProps`, `ComboboxRootState`, `ComboboxRootActions`, `ComboboxRootChangeEventReason`, `ComboboxRootChangeEventDetails`, `ComboboxRootHighlightEventReason`, `ComboboxRootHighlightEventDetails`, `ComboboxLabelState`, `ComboboxLabelProps`, `ComboboxTriggerState`, `ComboboxTriggerProps`, `ComboboxInputState`, `ComboboxInputProps`, `ComboboxInputGroupState`, `ComboboxInputGroupProps`, `ComboboxPopupState`, `ComboboxPopupProps`, `ComboboxPositionerState`, `ComboboxPositionerProps`, `ComboboxListState`, `ComboboxListProps`, `ComboboxItemState`, `ComboboxItemProps`, `ComboboxItemIndicatorProps`, `ComboboxItemIndicatorState`, `ComboboxValueState`, `ComboboxValueProps`, `ComboboxIconState`, `ComboboxIconProps`, `ComboboxArrowState`, `ComboboxArrowProps`, `ComboboxBackdropProps`, `ComboboxBackdropState`, `ComboboxPortalState`, `ComboboxPortalProps`, `ComboboxEmptyState`, `ComboboxEmptyProps`, `ComboboxGroupState`, `ComboboxGroupProps`, `ComboboxGroupLabelState`, `ComboboxGroupLabelProps`, `ComboboxRowState`, `ComboboxRowProps`, `ComboboxChipsState`, `ComboboxChipsProps`, `ComboboxChipState`, `ComboboxChipProps`, `ComboboxChipRemoveState`, `ComboboxChipRemoveProps`, `ComboboxClearState`, `ComboboxClearProps`, `ComboboxStatusState`, `ComboboxStatusProps`, `ComboboxCollectionState`, `ComboboxCollectionProps`, `ComboboxSeparatorProps`, `ComboboxSeparatorState`
|
|
7729
8489
|
|
|
7730
8490
|
## Canonical Types
|
|
7731
8491
|
|
|
@@ -7798,3 +8558,7 @@ Pass the result to the `filter` prop of `<Combobox.Root>`.
|
|
|
7798
8558
|
## useFilteredItems
|
|
7799
8559
|
|
|
7800
8560
|
Returns the internally filtered items when called inside `<Combobox.Root>`.
|
|
8561
|
+
|
|
8562
|
+
## createItems
|
|
8563
|
+
|
|
8564
|
+
Normalizes items into a collection for the `items` prop of `<Combobox.Root>`, deriving each item's selection value and label before rendering.
|