@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import _formatErrorMessage from "@base-ui/utils/formatErrorMessage";
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { useControlled } from '@base-ui/utils/useControlled';
|
|
5
6
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
@@ -9,7 +10,7 @@ import { useMergedRefs } from '@base-ui/utils/useMergedRefs';
|
|
|
9
10
|
import { useValueAsRef } from '@base-ui/utils/useValueAsRef';
|
|
10
11
|
import { visuallyHidden, visuallyHiddenInput } from '@base-ui/utils/visuallyHidden';
|
|
11
12
|
import { useRefWithInit } from '@base-ui/utils/useRefWithInit';
|
|
12
|
-
import {
|
|
13
|
+
import { ReactStore } from '@base-ui/utils/store';
|
|
13
14
|
import { EMPTY_ARRAY, EMPTY_OBJECT } from '@base-ui/utils/empty';
|
|
14
15
|
import { isHTMLElement } from '@floating-ui/utils/dom';
|
|
15
16
|
import { getOverflowAncestors, useDismiss, useFloatingRootContext, useListNavigation, useClick } from "../../floating-ui-react/index.mjs";
|
|
@@ -33,11 +34,11 @@ import { useValueChanged } from "../../internals/useValueChanged.mjs";
|
|
|
33
34
|
import { NOOP } from "../../internals/noop.mjs";
|
|
34
35
|
import { FOCUSABLE_POPUP_PROPS } from "../../utils/popups/index.mjs";
|
|
35
36
|
import { mergeProps } from "../../merge-props/index.mjs";
|
|
36
|
-
import { stringifyAsLabel, stringifyAsValue, isGroupedItems } from "../../internals/resolveValueLabel.mjs";
|
|
37
|
-
import { compareItemEquality, defaultItemEquality, findSelectionIndex, removeItem, selectedValueIncludes } from "../../internals/itemEquality.mjs";
|
|
38
|
-
import { areArraysEqual } from "../../internals/areArraysEqual.mjs";
|
|
37
|
+
import { stringifyAsLabel, stringifyAsValue, flattenLeafItems, isGroupedItems } from "../../internals/resolveValueLabel.mjs";
|
|
38
|
+
import { compareItemEquality, defaultItemEquality, findItemIndex, findSelectionIndex, isSelectedValueDirty, removeItem, selectedValueIncludes } from "../../internals/itemEquality.mjs";
|
|
39
39
|
import { INITIAL_LAST_HIGHLIGHT, NO_ACTIVE_VALUE } from "./utils/constants.mjs";
|
|
40
40
|
import { useDirection } from "../../internals/direction-context/DirectionContext.mjs";
|
|
41
|
+
import { findCollectionItem } from "../items/itemCollection.mjs";
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* @internal
|
|
@@ -50,7 +51,7 @@ export function AriaCombobox(props) {
|
|
|
50
51
|
defaultSelectedValue = null,
|
|
51
52
|
selectedValue: selectedValueProp,
|
|
52
53
|
onSelectedValueChange,
|
|
53
|
-
defaultInputValue
|
|
54
|
+
defaultInputValue,
|
|
54
55
|
inputValue: inputValueProp,
|
|
55
56
|
open: openProp,
|
|
56
57
|
defaultOpen = false,
|
|
@@ -63,15 +64,16 @@ export function AriaCombobox(props) {
|
|
|
63
64
|
required = false,
|
|
64
65
|
inputRef: inputRefProp,
|
|
65
66
|
grid = false,
|
|
66
|
-
items,
|
|
67
|
+
items: itemsProp,
|
|
67
68
|
filteredItems: filteredItemsProp,
|
|
68
69
|
filter: filterProp,
|
|
70
|
+
filterQuery: filterQueryProp,
|
|
69
71
|
openOnInputClick = true,
|
|
70
72
|
autoHighlight = false,
|
|
71
73
|
keepHighlight = false,
|
|
72
74
|
highlightItemOnHover = true,
|
|
73
75
|
loopFocus = true,
|
|
74
|
-
itemToStringLabel,
|
|
76
|
+
itemToStringLabel: itemToStringLabelProp,
|
|
75
77
|
itemToStringValue,
|
|
76
78
|
isItemEqualToValue = defaultItemEquality,
|
|
77
79
|
virtualized = false,
|
|
@@ -105,8 +107,76 @@ export function AriaCombobox(props) {
|
|
|
105
107
|
const collatorFilter = useCoreFilter({
|
|
106
108
|
locale
|
|
107
109
|
});
|
|
110
|
+
|
|
111
|
+
// Plain items are arrays; normalized `createItems()` collections are objects.
|
|
112
|
+
const collection = Array.isArray(itemsProp) ? null : itemsProp;
|
|
113
|
+
if (collection && typeof collection.label !== 'function') {
|
|
114
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'Base UI: the `items` prop received an object that is not a collection, ' + 'so its items cannot be read. Pass an array of items, an array of groups with items, ' + 'or the result of `createItems()`. ' + 'See https://base-ui.com/react/components/combobox#createitems' : _formatErrorMessage(100));
|
|
115
|
+
}
|
|
116
|
+
const items = collection ? collection.data : itemsProp;
|
|
117
|
+
const itemToValue = collection?.value;
|
|
118
|
+
|
|
119
|
+
// A projected collection's items live in the source domain, not the selection-value domain the
|
|
120
|
+
// store matches against, so they are withheld from the store.
|
|
121
|
+
const storeItems = itemToValue ? undefined : items;
|
|
122
|
+
|
|
123
|
+
// The externally filtered items projected to their selection values, with a lookup back to the
|
|
124
|
+
// source items. Declared before `itemToStringLabel`, which resolves labels from it on the
|
|
125
|
+
// first render (initial input value).
|
|
126
|
+
const externalWindow = React.useMemo(() => {
|
|
127
|
+
if (!filteredItemsProp || !itemToValue) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
const flat = flattenLeafItems(filteredItemsProp);
|
|
131
|
+
const values = flat.map(itemToValue);
|
|
132
|
+
let valueToItem;
|
|
133
|
+
return {
|
|
134
|
+
values,
|
|
135
|
+
findItem(itemValue, isEqual) {
|
|
136
|
+
if (!valueToItem) {
|
|
137
|
+
valueToItem = new Map();
|
|
138
|
+
for (let i = 0; i < values.length; i += 1) {
|
|
139
|
+
if (!valueToItem.has(values[i])) {
|
|
140
|
+
valueToItem.set(values[i], flat[i]);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return findCollectionItem(valueToItem, itemValue, isEqual);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}, [filteredItemsProp, itemToValue]);
|
|
148
|
+
|
|
149
|
+
// Labels selection values from current props only: collection data first, then the current
|
|
150
|
+
// external window, then the prop. Nothing from a past window is remembered — keeping a value
|
|
151
|
+
// resolvable over time means keeping its item in the collection's data.
|
|
152
|
+
const itemToStringLabel = React.useMemo(() => {
|
|
153
|
+
if (!collection) {
|
|
154
|
+
return itemToStringLabelProp;
|
|
155
|
+
}
|
|
156
|
+
return itemValue => {
|
|
157
|
+
return collection.label(itemValue, isItemEqualToValue, unresolvedValue => {
|
|
158
|
+
const externalItem = externalWindow?.findItem(unresolvedValue, isItemEqualToValue);
|
|
159
|
+
if (externalItem != null) {
|
|
160
|
+
return collection.itemLabel(externalItem);
|
|
161
|
+
}
|
|
162
|
+
return stringifyAsLabel(unresolvedValue, itemToStringLabelProp);
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
}, [collection, itemToStringLabelProp, externalWindow, isItemEqualToValue]);
|
|
166
|
+
const filterItemToString = React.useMemo(() => {
|
|
167
|
+
if (!collection) {
|
|
168
|
+
return itemToStringLabelProp;
|
|
169
|
+
}
|
|
170
|
+
return Object.assign(item => collection.itemLabel(item), {
|
|
171
|
+
selected: value => stringifyAsLabel(value, itemToStringLabel)
|
|
172
|
+
});
|
|
173
|
+
}, [collection, itemToStringLabel, itemToStringLabelProp]);
|
|
174
|
+
function stringifyValueLabel(item) {
|
|
175
|
+
return stringifyAsLabel(item, itemToStringLabel);
|
|
176
|
+
}
|
|
108
177
|
const [queryChangedAfterOpen, setQueryChangedAfterOpen] = React.useState(false);
|
|
109
178
|
const [closeQuery, setCloseQuery] = React.useState(null);
|
|
179
|
+
const previousCloseQueryRef = React.useRef(closeQuery);
|
|
110
180
|
const listRef = React.useRef([]);
|
|
111
181
|
const labelsRef = React.useRef([]);
|
|
112
182
|
const popupRef = React.useRef(null);
|
|
@@ -135,7 +205,7 @@ export function AriaCombobox(props) {
|
|
|
135
205
|
const name = fieldName ?? nameProp;
|
|
136
206
|
const multiple = selectionMode === 'multiple';
|
|
137
207
|
const single = selectionMode === 'single';
|
|
138
|
-
const hasInputValue = inputValueProp !== undefined ||
|
|
208
|
+
const hasInputValue = inputValueProp !== undefined || defaultInputValue !== undefined;
|
|
139
209
|
const hasItems = items !== undefined;
|
|
140
210
|
const hasFilteredItemsProp = filteredItemsProp !== undefined;
|
|
141
211
|
let autoHighlightMode;
|
|
@@ -159,17 +229,17 @@ export function AriaCombobox(props) {
|
|
|
159
229
|
}
|
|
160
230
|
// `shouldBypassFiltering` already empties the query whenever a single selection's label
|
|
161
231
|
// matches it exactly, so the filter never needs a selection-aware variant here.
|
|
162
|
-
return createCollatorItemFilter(collatorFilter,
|
|
163
|
-
}, [filterProp, collatorFilter,
|
|
232
|
+
return createCollatorItemFilter(collatorFilter, filterItemToString);
|
|
233
|
+
}, [filterProp, collatorFilter, filterItemToString]);
|
|
164
234
|
|
|
165
235
|
// If neither inputValue nor defaultInputValue are provided, derive it from the
|
|
166
236
|
// selected value for single mode so the input reflects the selection on mount.
|
|
167
237
|
const initialDefaultInputValue = useRefWithInit(() => {
|
|
168
238
|
if (hasInputValue) {
|
|
169
|
-
return
|
|
239
|
+
return defaultInputValue ?? '';
|
|
170
240
|
}
|
|
171
241
|
if (single) {
|
|
172
|
-
return
|
|
242
|
+
return stringifyValueLabel(selectedValue);
|
|
173
243
|
}
|
|
174
244
|
return '';
|
|
175
245
|
}).current;
|
|
@@ -186,20 +256,12 @@ export function AriaCombobox(props) {
|
|
|
186
256
|
state: 'open'
|
|
187
257
|
});
|
|
188
258
|
const isGrouped = isGroupedItems(items);
|
|
189
|
-
const query = closeQuery
|
|
190
|
-
const selectedLabelString = single ?
|
|
259
|
+
const query = !open && closeQuery !== null ? closeQuery : String(inputValue).trim();
|
|
260
|
+
const selectedLabelString = single ? stringifyValueLabel(selectedValue) : '';
|
|
191
261
|
const shouldBypassFiltering = single && !queryChangedAfterOpen && query !== '' && selectedLabelString.length === query.length && collatorFilter.contains(selectedLabelString, query);
|
|
192
|
-
const filterQuery = shouldBypassFiltering ? '' : query;
|
|
193
|
-
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering;
|
|
194
|
-
const flatItems = React.useMemo(() =>
|
|
195
|
-
if (!items) {
|
|
196
|
-
return EMPTY_ARRAY;
|
|
197
|
-
}
|
|
198
|
-
if (isGrouped) {
|
|
199
|
-
return items.flatMap(group => group.items);
|
|
200
|
-
}
|
|
201
|
-
return items;
|
|
202
|
-
}, [items, isGrouped]);
|
|
262
|
+
const filterQuery = shouldBypassFiltering ? '' : filterQueryProp ?? query;
|
|
263
|
+
const shouldIgnoreExternalFiltering = hasItems && hasFilteredItemsProp && shouldBypassFiltering && (!collection || collection.hasValue(selectedValue, isItemEqualToValue));
|
|
264
|
+
const flatItems = React.useMemo(() => items ? flattenLeafItems(items) : EMPTY_ARRAY, [items]);
|
|
203
265
|
const filteredItems = React.useMemo(() => {
|
|
204
266
|
if (filteredItemsProp && !shouldIgnoreExternalFiltering) {
|
|
205
267
|
return filteredItemsProp;
|
|
@@ -222,7 +284,7 @@ export function AriaCombobox(props) {
|
|
|
222
284
|
if (itemsToTake.length >= remainingLimit) {
|
|
223
285
|
break;
|
|
224
286
|
}
|
|
225
|
-
if (filter(item, filterQuery,
|
|
287
|
+
if (filter(item, filterQuery, filterItemToString)) {
|
|
226
288
|
itemsToTake.push(item);
|
|
227
289
|
}
|
|
228
290
|
}
|
|
@@ -241,7 +303,7 @@ export function AriaCombobox(props) {
|
|
|
241
303
|
if (filterQuery === '') {
|
|
242
304
|
return limit > -1 ? flatItems.slice(0, limit) :
|
|
243
305
|
// The cast here is done as `flatItems` is readonly.
|
|
244
|
-
// valuesRef.current, a mutable ref, can be set to `
|
|
306
|
+
// valuesRef.current, a mutable ref, can be set to `flatFilteredValues`, which may
|
|
245
307
|
// reference this exact readonly value, creating a mutation risk.
|
|
246
308
|
// However, <Combobox.Item> can never mutate this value as the mutating effect
|
|
247
309
|
// bails early when `items` is provided, and this is only ever returned
|
|
@@ -253,19 +315,25 @@ export function AriaCombobox(props) {
|
|
|
253
315
|
if (limit > -1 && limitedItems.length >= limit) {
|
|
254
316
|
break;
|
|
255
317
|
}
|
|
256
|
-
if (filter(item, filterQuery,
|
|
318
|
+
if (filter(item, filterQuery, filterItemToString)) {
|
|
257
319
|
limitedItems.push(item);
|
|
258
320
|
}
|
|
259
321
|
}
|
|
260
322
|
return limitedItems;
|
|
261
|
-
}, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
323
|
+
}, [filteredItemsProp, shouldIgnoreExternalFiltering, items, isGrouped, filterQuery, limit, filter, filterItemToString, flatItems]);
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* The filtered items flattened across groups and projected to their selection values.
|
|
327
|
+
*/
|
|
328
|
+
const flatFilteredValues = React.useMemo(() => {
|
|
329
|
+
if (externalWindow && filteredItems === filteredItemsProp) {
|
|
330
|
+
return externalWindow.values;
|
|
266
331
|
}
|
|
267
|
-
|
|
268
|
-
|
|
332
|
+
// Explicit type argument: inferring it from a union of both shapes resolves `Item` to
|
|
333
|
+
// `Group<Item>`, which tsc rejects and tsgo does not.
|
|
334
|
+
const flat = flattenLeafItems(filteredItems);
|
|
335
|
+
return itemToValue ? flat.map(item => itemToValue(item)) : flat;
|
|
336
|
+
}, [filteredItems, filteredItemsProp, externalWindow, itemToValue]);
|
|
269
337
|
const store = useRefWithInit(() => {
|
|
270
338
|
// An inline list open on the first render never gets a closed pass of the closed-state
|
|
271
339
|
// sync effect below, and `items`-prop lists don't self-register their index the way
|
|
@@ -275,28 +343,15 @@ export function AriaCombobox(props) {
|
|
|
275
343
|
// doesn't move an existing highlight or scroll the list away.
|
|
276
344
|
let initialSelectedIndex = null;
|
|
277
345
|
if (inlineProp && open && hasItems && selectionMode !== 'none') {
|
|
278
|
-
initialSelectedIndex = findSelectionIndex(
|
|
346
|
+
initialSelectedIndex = findSelectionIndex(flatFilteredValues, selectedValue, isItemEqualToValue, multiple);
|
|
279
347
|
}
|
|
280
|
-
return new
|
|
348
|
+
return new ReactStore({
|
|
281
349
|
id,
|
|
282
350
|
labelId: undefined,
|
|
283
351
|
selectedValue,
|
|
284
352
|
open,
|
|
285
|
-
items,
|
|
353
|
+
items: storeItems,
|
|
286
354
|
selectionMode,
|
|
287
|
-
listRef,
|
|
288
|
-
labelsRef,
|
|
289
|
-
popupRef,
|
|
290
|
-
emptyRef,
|
|
291
|
-
inputRef,
|
|
292
|
-
startDismissRef,
|
|
293
|
-
endDismissRef,
|
|
294
|
-
keyboardActiveRef,
|
|
295
|
-
chipsContainerRef,
|
|
296
|
-
clearRef,
|
|
297
|
-
valuesRef,
|
|
298
|
-
pointerDownItemRef,
|
|
299
|
-
selectionEventRef,
|
|
300
355
|
name,
|
|
301
356
|
form,
|
|
302
357
|
disabled,
|
|
@@ -333,7 +388,8 @@ export function AriaCombobox(props) {
|
|
|
333
388
|
inputInsidePopup: true,
|
|
334
389
|
// Avoid duplicate names in the server HTML. Popup inputs aren't rendered
|
|
335
390
|
// until after hydration, so the hidden input takes over then if needed.
|
|
336
|
-
inputOwnsFormValue: selectionMode === 'none'
|
|
391
|
+
inputOwnsFormValue: selectionMode === 'none'
|
|
392
|
+
}, {
|
|
337
393
|
// Placeholder callbacks replaced on first render
|
|
338
394
|
onOpenChangeComplete: NOOP,
|
|
339
395
|
setOpen: NOOP,
|
|
@@ -342,8 +398,21 @@ export function AriaCombobox(props) {
|
|
|
342
398
|
setIndices: NOOP,
|
|
343
399
|
handleSelection: NOOP,
|
|
344
400
|
forceMount: NOOP,
|
|
345
|
-
requestSubmit: NOOP
|
|
346
|
-
|
|
401
|
+
requestSubmit: NOOP,
|
|
402
|
+
listRef,
|
|
403
|
+
labelsRef,
|
|
404
|
+
popupRef,
|
|
405
|
+
emptyRef,
|
|
406
|
+
inputRef,
|
|
407
|
+
startDismissRef,
|
|
408
|
+
endDismissRef,
|
|
409
|
+
keyboardActiveRef,
|
|
410
|
+
chipsContainerRef,
|
|
411
|
+
clearRef,
|
|
412
|
+
valuesRef,
|
|
413
|
+
pointerDownItemRef,
|
|
414
|
+
selectionEventRef
|
|
415
|
+
}, selectors);
|
|
347
416
|
}).current;
|
|
348
417
|
const fieldRawValue = selectionMode === 'none' ? inputValue : selectedValue;
|
|
349
418
|
const fieldStringValue = React.useMemo(() => {
|
|
@@ -357,16 +426,17 @@ export function AriaCombobox(props) {
|
|
|
357
426
|
}, [fieldRawValue, itemToStringValue, selectionMode, selectedValue]);
|
|
358
427
|
const onItemHighlighted = useStableCallback(onItemHighlightedProp);
|
|
359
428
|
const onOpenChangeComplete = useStableCallback(onOpenChangeCompleteProp);
|
|
360
|
-
const activeIndex =
|
|
361
|
-
const selectedIndex =
|
|
362
|
-
const positionerElement =
|
|
363
|
-
const listElement =
|
|
364
|
-
const triggerElement =
|
|
365
|
-
const inputElement =
|
|
366
|
-
const inputGroupElement =
|
|
367
|
-
const inline =
|
|
368
|
-
const inputInsidePopup =
|
|
369
|
-
const inputOwnsFormValue =
|
|
429
|
+
const activeIndex = store.useState('activeIndex');
|
|
430
|
+
const selectedIndex = store.useState('selectedIndex');
|
|
431
|
+
const positionerElement = store.useState('positionerElement');
|
|
432
|
+
const listElement = store.useState('listElement');
|
|
433
|
+
const triggerElement = store.useState('triggerElement');
|
|
434
|
+
const inputElement = store.useState('inputElement');
|
|
435
|
+
const inputGroupElement = store.useState('inputGroupElement');
|
|
436
|
+
const inline = store.useState('inline');
|
|
437
|
+
const inputInsidePopup = store.useState('inputInsidePopup');
|
|
438
|
+
const inputOwnsFormValue = store.useState('inputOwnsFormValue');
|
|
439
|
+
const inputMatchesSelectedValue = single && !inputInsidePopup && inputValue === selectedLabelString;
|
|
370
440
|
const triggerRef = useValueAsRef(triggerElement);
|
|
371
441
|
const {
|
|
372
442
|
mounted,
|
|
@@ -382,7 +452,7 @@ export function AriaCombobox(props) {
|
|
|
382
452
|
const forceMount = useStableCallback(() => {
|
|
383
453
|
if (items) {
|
|
384
454
|
// Ensure typeahead works on a closed list.
|
|
385
|
-
labelsRef.current =
|
|
455
|
+
labelsRef.current = flatFilteredValues.map(stringifyValueLabel);
|
|
386
456
|
} else {
|
|
387
457
|
store.set('forceMounted', true);
|
|
388
458
|
}
|
|
@@ -409,7 +479,14 @@ export function AriaCombobox(props) {
|
|
|
409
479
|
}));
|
|
410
480
|
});
|
|
411
481
|
const setIndices = useStableCallback(options => {
|
|
412
|
-
|
|
482
|
+
const update = {};
|
|
483
|
+
if (options.activeIndex !== undefined) {
|
|
484
|
+
update.activeIndex = options.activeIndex;
|
|
485
|
+
}
|
|
486
|
+
if (options.selectedIndex !== undefined) {
|
|
487
|
+
update.selectedIndex = options.selectedIndex;
|
|
488
|
+
}
|
|
489
|
+
store.update(update);
|
|
413
490
|
const activeIndexOption = options.activeIndex;
|
|
414
491
|
if (activeIndexOption === undefined) {
|
|
415
492
|
return;
|
|
@@ -422,12 +499,14 @@ export function AriaCombobox(props) {
|
|
|
422
499
|
}
|
|
423
500
|
});
|
|
424
501
|
const setInputValue = useStableCallback((next, eventDetails) => {
|
|
425
|
-
hadInputClearRef.current = eventDetails.reason === REASONS.inputClear;
|
|
426
502
|
props.onInputValueChange?.(next, eventDetails);
|
|
427
503
|
if (eventDetails.isCanceled) {
|
|
428
504
|
return;
|
|
429
505
|
}
|
|
430
506
|
|
|
507
|
+
// A canceled selection clear must not suppress close-completion cleanup.
|
|
508
|
+
hadInputClearRef.current = eventDetails.reason === REASONS.inputClear;
|
|
509
|
+
|
|
431
510
|
// If user is typing, ensure we don't auto-highlight on open due to a race
|
|
432
511
|
// with the post-open effect that sets this flag.
|
|
433
512
|
if (eventDetails.reason === REASONS.inputChange) {
|
|
@@ -482,6 +561,20 @@ export function AriaCombobox(props) {
|
|
|
482
561
|
}
|
|
483
562
|
setInputValueUnwrapped(next);
|
|
484
563
|
});
|
|
564
|
+
const handleInterruptedReopen = useStableCallback(isInputChange => {
|
|
565
|
+
// Preserve values supplied with the reopen rather than owned by the interrupted close.
|
|
566
|
+
const clearsPendingInput = !isInputChange && inputInsidePopup && !inline && inputValue !== '' && (String(inputValue).trim() === closeQuery || inputValue === selectedLabelString);
|
|
567
|
+
|
|
568
|
+
// Keep the flag while a visible filter survives so the `items` sync cannot overwrite it.
|
|
569
|
+
if (!isInputChange && (clearsPendingInput || inputValue === '' || inputMatchesSelectedValue)) {
|
|
570
|
+
setQueryChangedAfterOpen(false);
|
|
571
|
+
}
|
|
572
|
+
setCloseQuery(null);
|
|
573
|
+
if (clearsPendingInput) {
|
|
574
|
+
// Cleanup clears omit the selection flag and reopening gesture.
|
|
575
|
+
setInputValue('', createChangeEventDetails(REASONS.inputClear));
|
|
576
|
+
}
|
|
577
|
+
});
|
|
485
578
|
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
486
579
|
if (open === nextOpen) {
|
|
487
580
|
return;
|
|
@@ -490,22 +583,17 @@ export function AriaCombobox(props) {
|
|
|
490
583
|
// If the `Empty` component is not used, the positioner or popup should be hidden
|
|
491
584
|
// with CSS. In this case, allow the Escape key to bubble to close a parent popup
|
|
492
585
|
// if there are no items to show.
|
|
493
|
-
if (eventDetails.reason === REASONS.escapeKey && hasItems &&
|
|
586
|
+
if (eventDetails.reason === REASONS.escapeKey && hasItems && flatFilteredValues.length === 0 && !emptyRef.current) {
|
|
494
587
|
eventDetails.allowPropagation();
|
|
495
588
|
}
|
|
496
589
|
props.onOpenChange?.(nextOpen, eventDetails);
|
|
497
590
|
if (eventDetails.isCanceled) {
|
|
498
591
|
return;
|
|
499
592
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
setQueryChangedAfterOpen(false);
|
|
505
|
-
setCloseQuery(null);
|
|
506
|
-
if (inputValue !== '' && eventDetails.reason !== REASONS.inputChange) {
|
|
507
|
-
setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event));
|
|
508
|
-
}
|
|
593
|
+
if (nextOpen && closeQuery !== null) {
|
|
594
|
+
// `ComboboxInput` calls `setInputValue` before `setOpen`, so on an input-change reopen
|
|
595
|
+
// `inputValue` is still the pre-keystroke value and the typed filter always survives.
|
|
596
|
+
handleInterruptedReopen(eventDetails.reason === REASONS.inputChange);
|
|
509
597
|
}
|
|
510
598
|
if (!nextOpen && queryChangedAfterOpen) {
|
|
511
599
|
if (single) {
|
|
@@ -531,7 +619,9 @@ export function AriaCombobox(props) {
|
|
|
531
619
|
// if the input is outside the popup. When the input is inside the popup, defer the clear until
|
|
532
620
|
// unmount so the filtered list doesn't flash to unfiltered during the exit animation.
|
|
533
621
|
if (!inputInsidePopup || inline) {
|
|
534
|
-
setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event
|
|
622
|
+
setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event, undefined, {
|
|
623
|
+
isItemPress: eventDetails.reason === REASONS.itemPress
|
|
624
|
+
}));
|
|
535
625
|
}
|
|
536
626
|
}
|
|
537
627
|
}
|
|
@@ -555,7 +645,7 @@ export function AriaCombobox(props) {
|
|
|
555
645
|
setSelectedValueUnwrapped(nextValue);
|
|
556
646
|
const shouldFillInput = selectionMode === 'none' && popupRef.current && fillInputOnItemPress || single && !store.state.inputInsidePopup;
|
|
557
647
|
if (shouldFillInput) {
|
|
558
|
-
setInputValue(
|
|
648
|
+
setInputValue(stringifyValueLabel(nextValue), createChangeEventDetails(eventDetails.reason, eventDetails.event));
|
|
559
649
|
}
|
|
560
650
|
});
|
|
561
651
|
const handleSelection = useStableCallback((event, itemValue) => {
|
|
@@ -585,7 +675,15 @@ export function AriaCombobox(props) {
|
|
|
585
675
|
return;
|
|
586
676
|
}
|
|
587
677
|
if (store.state.inputInsidePopup) {
|
|
588
|
-
setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event
|
|
678
|
+
setInputValue('', createChangeEventDetails(REASONS.inputClear, eventDetails.event, undefined, {
|
|
679
|
+
isItemPress: true
|
|
680
|
+
}));
|
|
681
|
+
// A newly selected item stays highlighted through the clear; a deselection
|
|
682
|
+
// falls back to the standard selection anchor.
|
|
683
|
+
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
684
|
+
if (pendingHighlight && !isCurrentlySelected) {
|
|
685
|
+
pendingHighlight.toggledValue = itemValue;
|
|
686
|
+
}
|
|
589
687
|
} else {
|
|
590
688
|
setOpen(false, eventDetails);
|
|
591
689
|
}
|
|
@@ -635,7 +733,7 @@ export function AriaCombobox(props) {
|
|
|
635
733
|
setInputValue('', createChangeEventDetails(REASONS.inputClear));
|
|
636
734
|
}
|
|
637
735
|
} else {
|
|
638
|
-
const stringVal =
|
|
736
|
+
const stringVal = stringifyValueLabel(selectedValue);
|
|
639
737
|
if (inputRef.current && inputRef.current.value !== stringVal) {
|
|
640
738
|
// If no selection was made, treat this as clearing the typed filter.
|
|
641
739
|
const reason = stringVal === '' ? REASONS.inputClear : REASONS.none;
|
|
@@ -670,14 +768,21 @@ export function AriaCombobox(props) {
|
|
|
670
768
|
React.useImperativeHandle(props.actionsRef, () => ({
|
|
671
769
|
unmount: handleUnmount
|
|
672
770
|
}), [handleUnmount]);
|
|
673
|
-
useIsoLayoutEffect(function
|
|
674
|
-
|
|
771
|
+
useIsoLayoutEffect(function syncSelectedIndex() {
|
|
772
|
+
const closeQueryReleased = previousCloseQueryRef.current !== null && closeQuery === null;
|
|
773
|
+
previousCloseQueryRef.current = closeQuery;
|
|
774
|
+
|
|
775
|
+
// Closing indexes against the frozen filtered list. Reopening releases that query, so its
|
|
776
|
+
// rendered coordinates must be synchronized again even though the popup is already open.
|
|
777
|
+
if (open && (!closeQueryReleased || !hasItems)) {
|
|
675
778
|
return;
|
|
676
779
|
}
|
|
677
780
|
|
|
678
781
|
// State-driven (not tied to the internal event path) so controlled closes
|
|
679
782
|
// also clear a pointerdown that never received a matching item mouseup.
|
|
680
|
-
|
|
783
|
+
if (!open) {
|
|
784
|
+
pointerDownItemRef.current = null;
|
|
785
|
+
}
|
|
681
786
|
if (selectionMode === 'none') {
|
|
682
787
|
return;
|
|
683
788
|
}
|
|
@@ -688,17 +793,18 @@ export function AriaCombobox(props) {
|
|
|
688
793
|
// items re-assert the index themselves when their registration moves; when
|
|
689
794
|
// nothing is mounted the lookup resolves to `null` and each item re-registers
|
|
690
795
|
// the index on the next open.
|
|
691
|
-
|
|
796
|
+
// Keep the selected index in the coordinates of the list that is actually rendered.
|
|
797
|
+
const registry = hasItems ? flatFilteredValues : valuesRef.current;
|
|
692
798
|
setIndices({
|
|
693
799
|
selectedIndex: findSelectionIndex(registry, selectedValue, isItemEqualToValue, multiple)
|
|
694
800
|
});
|
|
695
|
-
}, [open, selectedValue, selectionMode, multiple, hasItems,
|
|
801
|
+
}, [open, closeQuery, selectedValue, selectionMode, multiple, hasItems, flatFilteredValues, isItemEqualToValue, setIndices]);
|
|
696
802
|
useIsoLayoutEffect(() => {
|
|
697
803
|
if (items) {
|
|
698
|
-
valuesRef.current =
|
|
699
|
-
listRef.current.length =
|
|
804
|
+
valuesRef.current = flatFilteredValues;
|
|
805
|
+
listRef.current.length = flatFilteredValues.length;
|
|
700
806
|
}
|
|
701
|
-
}, [items,
|
|
807
|
+
}, [items, flatFilteredValues]);
|
|
702
808
|
useIsoLayoutEffect(() => {
|
|
703
809
|
const pendingHighlight = pendingQueryHighlightRef.current;
|
|
704
810
|
if (pendingHighlight) {
|
|
@@ -735,13 +841,18 @@ export function AriaCombobox(props) {
|
|
|
735
841
|
// re-running this effect on every render.
|
|
736
842
|
const currentSelectedValue = store.state.selectedValue;
|
|
737
843
|
const isMultiple = store.state.selectionMode === 'multiple';
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
// A selection that is no longer in
|
|
743
|
-
// leaving it on whichever item
|
|
744
|
-
|
|
844
|
+
const hasSelection = isMultiple && Array.isArray(currentSelectedValue) ? currentSelectedValue.length > 0 : store.state.selectionMode !== 'none' && currentSelectedValue != null;
|
|
845
|
+
if (hasSelection) {
|
|
846
|
+
const registry = hasItems || hasFilteredItemsProp ? flatFilteredValues : valuesRef.current;
|
|
847
|
+
// A selection-driven clear keeps the just-selected item highlighted;
|
|
848
|
+
// otherwise return to the open anchor. A selection that is no longer in
|
|
849
|
+
// the list drops the highlight rather than leaving it on whichever item
|
|
850
|
+
// now occupies that index.
|
|
851
|
+
// `findItemIndex` resolves to -1 when no value was toggled.
|
|
852
|
+
const toggledIndex = findItemIndex(registry, pendingHighlight.toggledValue, store.state.isItemEqualToValue);
|
|
853
|
+
store.set('activeIndex', toggledIndex !== -1 ? toggledIndex : findSelectionIndex(registry, currentSelectedValue, store.state.isItemEqualToValue, isMultiple));
|
|
854
|
+
} else if (clearedBySelection) {
|
|
855
|
+
store.set('activeIndex', null);
|
|
745
856
|
} else if (autoHighlightMode === 'always') {
|
|
746
857
|
store.set('activeIndex', 0);
|
|
747
858
|
}
|
|
@@ -752,8 +863,8 @@ export function AriaCombobox(props) {
|
|
|
752
863
|
if (!open && !inline) {
|
|
753
864
|
return;
|
|
754
865
|
}
|
|
755
|
-
const
|
|
756
|
-
const candidateItems =
|
|
866
|
+
const shouldUseFlatFilteredValues = hasItems || hasFilteredItemsProp;
|
|
867
|
+
const candidateItems = shouldUseFlatFilteredValues ? flatFilteredValues : valuesRef.current;
|
|
757
868
|
const storeActiveIndex = store.state.activeIndex;
|
|
758
869
|
if (storeActiveIndex == null) {
|
|
759
870
|
if (autoHighlightMode === 'always' && candidateItems.length > 0) {
|
|
@@ -774,7 +885,7 @@ export function AriaCombobox(props) {
|
|
|
774
885
|
if (lastHighlightRef.current.index !== storeActiveIndex || !isSameItem) {
|
|
775
886
|
emitHighlight(itemValue, storeActiveIndex, REASONS.none);
|
|
776
887
|
}
|
|
777
|
-
}, [activeIndex, autoHighlightMode, emitHighlight, hasFilteredItemsProp, hasItems,
|
|
888
|
+
}, [activeIndex, autoHighlightMode, emitHighlight, hasFilteredItemsProp, hasItems, flatFilteredValues, inline, open, store,
|
|
778
889
|
// Reruns the effect when the query changes without affecting the deps above, such as
|
|
779
890
|
// clearing the input when no items are filtered out (individually rendered items).
|
|
780
891
|
inputValue]);
|
|
@@ -789,56 +900,67 @@ export function AriaCombobox(props) {
|
|
|
789
900
|
// Ensures that the active index is not set to 0 when the list is empty.
|
|
790
901
|
// This avoids needing to press ArrowDown twice under certain conditions.
|
|
791
902
|
React.useEffect(() => {
|
|
792
|
-
if (hasItems && autoHighlightMode &&
|
|
903
|
+
if (hasItems && autoHighlightMode && flatFilteredValues.length === 0) {
|
|
793
904
|
setIndices({
|
|
794
905
|
activeIndex: null
|
|
795
906
|
});
|
|
796
907
|
}
|
|
797
|
-
}, [hasItems, autoHighlightMode,
|
|
798
|
-
function
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
return !areArraysEqual(value, initialValue, (itemValue, initialItemValue) => compareItemEquality(itemValue, initialItemValue, isItemEqualToValue));
|
|
908
|
+
}, [hasItems, autoHighlightMode, flatFilteredValues.length, setIndices]);
|
|
909
|
+
function handleQueryChanged() {
|
|
910
|
+
if (open && query !== '' && query !== String(initialDefaultInputValue) && !inputMatchesSelectedValue) {
|
|
911
|
+
setQueryChangedAfterOpen(true);
|
|
802
912
|
}
|
|
803
|
-
return value !== initialValue;
|
|
804
913
|
}
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
914
|
+
function handleOpenChanged() {
|
|
915
|
+
// A controlled `open` prop can interrupt the close without calling `setOpen`.
|
|
916
|
+
if (open && closeQuery !== null) {
|
|
917
|
+
handleInterruptedReopen(false);
|
|
808
918
|
}
|
|
809
|
-
|
|
810
|
-
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
// These sync triggers can run in the same commit while still seeing the pre-commit `inputValue`.
|
|
922
|
+
// This render-scoped flag prevents duplicate callbacks and resets so canceled writes can retry.
|
|
923
|
+
let syncedSelectedLabel = false;
|
|
811
924
|
function syncInputToSelectedLabel() {
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
setInputValue(
|
|
925
|
+
if (!syncedSelectedLabel && inputValue !== selectedLabelString) {
|
|
926
|
+
syncedSelectedLabel = true;
|
|
927
|
+
setInputValue(selectedLabelString, createChangeEventDetails(REASONS.none));
|
|
815
928
|
}
|
|
816
929
|
}
|
|
817
|
-
|
|
930
|
+
function handleSelectedValueChanged() {
|
|
818
931
|
if (selectionMode === 'none') {
|
|
819
932
|
return;
|
|
820
933
|
}
|
|
821
934
|
clearErrors(name);
|
|
822
|
-
setDirty(isSelectedValueDirty(selectedValue));
|
|
935
|
+
setDirty(isSelectedValueDirty(selectedValue, validityData.initialValue, isItemEqualToValue));
|
|
823
936
|
validation.change(selectedValue);
|
|
824
937
|
if (single && !hasInputValue && !inputInsidePopup) {
|
|
825
938
|
syncInputToSelectedLabel();
|
|
826
939
|
}
|
|
827
|
-
}
|
|
828
|
-
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// The label catches accessor changes while the items identity restores the selected label after
|
|
943
|
+
// a one-step input clear followed by a data reload. The shared sync prevents duplicate writes
|
|
944
|
+
// when both change in the same commit.
|
|
945
|
+
function syncInputAfterItemsOrLabelChange() {
|
|
946
|
+
if (single && !hasInputValue && !inputInsidePopup && !queryChangedAfterOpen) {
|
|
947
|
+
syncInputToSelectedLabel();
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
function handleInputValueChanged() {
|
|
829
951
|
if (selectionMode !== 'none') {
|
|
830
952
|
return;
|
|
831
953
|
}
|
|
832
954
|
clearErrors(name);
|
|
833
955
|
setDirty(inputValue !== validityData.initialValue);
|
|
834
956
|
validation.change(inputValue);
|
|
835
|
-
}
|
|
836
|
-
useValueChanged(
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
957
|
+
}
|
|
958
|
+
useValueChanged(query, handleQueryChanged);
|
|
959
|
+
useValueChanged(open, handleOpenChanged);
|
|
960
|
+
useValueChanged(selectedValue, handleSelectedValueChanged);
|
|
961
|
+
useValueChanged(selectedLabelString, syncInputAfterItemsOrLabelChange);
|
|
962
|
+
useValueChanged(items, syncInputAfterItemsOrLabelChange);
|
|
963
|
+
useValueChanged(inputValue, handleInputValueChanged);
|
|
842
964
|
const floatingRootContext = useFloatingRootContext({
|
|
843
965
|
open: inline ? true : open,
|
|
844
966
|
onOpenChange: setOpen,
|
|
@@ -871,7 +993,8 @@ export function AriaCombobox(props) {
|
|
|
871
993
|
reference['aria-expanded'] = ariaExpanded;
|
|
872
994
|
reference['aria-haspopup'] = ariaHasPopup;
|
|
873
995
|
reference['aria-controls'] = expanded ? listElement?.id : undefined;
|
|
874
|
-
|
|
996
|
+
// `readOnly` accepts no input, so no completion of any kind is offered.
|
|
997
|
+
reference['aria-autocomplete'] = readOnly ? 'none' : autoComplete;
|
|
875
998
|
}
|
|
876
999
|
return {
|
|
877
1000
|
reference,
|
|
@@ -879,9 +1002,13 @@ export function AriaCombobox(props) {
|
|
|
879
1002
|
role: 'presentation'
|
|
880
1003
|
}
|
|
881
1004
|
};
|
|
882
|
-
}, [inputElement, expanded, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete]);
|
|
1005
|
+
}, [inputElement, expanded, ariaExpanded, ariaHasPopup, listElement?.id, autoComplete, readOnly]);
|
|
1006
|
+
|
|
1007
|
+
// `readOnly` locks the value, not the interaction: the popup opens and can be browsed.
|
|
1008
|
+
// Value changes stay blocked in `ComboboxItem`, `ComboboxInput`'s keydown, `ComboboxTrigger`'s
|
|
1009
|
+
// typeahead, the clear/remove parts, and the hidden input's autofill handler.
|
|
883
1010
|
const click = useClick(floatingRootContext, {
|
|
884
|
-
enabled: !
|
|
1011
|
+
enabled: !disabled && openOnInputClick,
|
|
885
1012
|
event: 'mousedown-only',
|
|
886
1013
|
toggle: false,
|
|
887
1014
|
// Apply a small delay for touch to let mobile viewport/keyboard positioning settle.
|
|
@@ -890,7 +1017,7 @@ export function AriaCombobox(props) {
|
|
|
890
1017
|
reason: REASONS.inputPress
|
|
891
1018
|
});
|
|
892
1019
|
const dismiss = useDismiss(floatingRootContext, {
|
|
893
|
-
enabled: !
|
|
1020
|
+
enabled: !disabled && !inline,
|
|
894
1021
|
outsidePressEvent: {
|
|
895
1022
|
mouse: 'sloppy',
|
|
896
1023
|
// The visual viewport (affected by the mobile software keyboard) can be
|
|
@@ -906,7 +1033,7 @@ export function AriaCombobox(props) {
|
|
|
906
1033
|
}
|
|
907
1034
|
});
|
|
908
1035
|
const listNavigation = useListNavigation(floatingRootContext, {
|
|
909
|
-
enabled: !
|
|
1036
|
+
enabled: !disabled,
|
|
910
1037
|
id,
|
|
911
1038
|
listRef,
|
|
912
1039
|
activeIndex,
|
|
@@ -963,6 +1090,17 @@ export function AriaCombobox(props) {
|
|
|
963
1090
|
onFocus: undefined
|
|
964
1091
|
};
|
|
965
1092
|
}, [listNavigation.item]);
|
|
1093
|
+
store.useContextCallback('setOpen', setOpen);
|
|
1094
|
+
store.useContextCallback('setInputValue', setInputValue);
|
|
1095
|
+
store.useContextCallback('setSelectedValue', setSelectedValue);
|
|
1096
|
+
store.useContextCallback('setIndices', setIndices);
|
|
1097
|
+
store.useContextCallback('handleSelection', handleSelection);
|
|
1098
|
+
store.useContextCallback('forceMount', forceMount);
|
|
1099
|
+
store.useContextCallback('requestSubmit', requestSubmit);
|
|
1100
|
+
store.useContextCallback('onOpenChangeComplete', onOpenChangeCompleteProp);
|
|
1101
|
+
|
|
1102
|
+
// The prop bags must be in the store before the parts render: they read them with `useStore`
|
|
1103
|
+
// during render, and a layout effect commits only after all children have rendered.
|
|
966
1104
|
useOnFirstRender(() => {
|
|
967
1105
|
store.update({
|
|
968
1106
|
inline: inlineProp,
|
|
@@ -970,57 +1108,58 @@ export function AriaCombobox(props) {
|
|
|
970
1108
|
listProps,
|
|
971
1109
|
inputProps,
|
|
972
1110
|
triggerProps,
|
|
973
|
-
itemProps
|
|
974
|
-
setOpen,
|
|
975
|
-
setInputValue,
|
|
976
|
-
setSelectedValue,
|
|
977
|
-
setIndices,
|
|
978
|
-
handleSelection,
|
|
979
|
-
forceMount,
|
|
980
|
-
requestSubmit,
|
|
981
|
-
onOpenChangeComplete
|
|
1111
|
+
itemProps
|
|
982
1112
|
});
|
|
983
1113
|
});
|
|
1114
|
+
const syncedValues = {
|
|
1115
|
+
id,
|
|
1116
|
+
selectedValue,
|
|
1117
|
+
open,
|
|
1118
|
+
mounted,
|
|
1119
|
+
transitionStatus,
|
|
1120
|
+
items: storeItems,
|
|
1121
|
+
inline: inlineProp,
|
|
1122
|
+
popupProps,
|
|
1123
|
+
listProps,
|
|
1124
|
+
inputProps,
|
|
1125
|
+
triggerProps,
|
|
1126
|
+
itemProps,
|
|
1127
|
+
openMethod,
|
|
1128
|
+
selectionMode,
|
|
1129
|
+
name,
|
|
1130
|
+
form,
|
|
1131
|
+
disabled,
|
|
1132
|
+
readOnly,
|
|
1133
|
+
required,
|
|
1134
|
+
grid,
|
|
1135
|
+
virtualized,
|
|
1136
|
+
openOnInputClick,
|
|
1137
|
+
itemToStringLabel,
|
|
1138
|
+
modal,
|
|
1139
|
+
autoHighlight: autoHighlightMode,
|
|
1140
|
+
isItemEqualToValue,
|
|
1141
|
+
submitOnItemClick,
|
|
1142
|
+
hasInputValue
|
|
1143
|
+
};
|
|
984
1144
|
useIsoLayoutEffect(() => {
|
|
1145
|
+
// `inputOwnsFormValue` is derived here rather than during render because `ComboboxInput`
|
|
1146
|
+
// writes it from a ref callback earlier in the same commit, and it has to land in this same
|
|
1147
|
+
// `update` so subscribers never observe an intermediate snapshot. That is also why
|
|
1148
|
+
// `store.useSyncedValues` can't be used yet: it would need a second write. The dependencies
|
|
1149
|
+
// are derived from `syncedValues` so a newly synchronized field can't be forgotten here.
|
|
985
1150
|
store.update({
|
|
986
|
-
|
|
987
|
-
selectedValue,
|
|
988
|
-
open,
|
|
989
|
-
mounted,
|
|
990
|
-
transitionStatus,
|
|
991
|
-
items,
|
|
992
|
-
inline: inlineProp,
|
|
993
|
-
popupProps,
|
|
994
|
-
listProps,
|
|
995
|
-
inputProps,
|
|
996
|
-
triggerProps,
|
|
997
|
-
openMethod,
|
|
998
|
-
itemProps,
|
|
999
|
-
selectionMode,
|
|
1000
|
-
name,
|
|
1001
|
-
form,
|
|
1002
|
-
disabled,
|
|
1003
|
-
readOnly,
|
|
1004
|
-
required,
|
|
1005
|
-
grid,
|
|
1006
|
-
virtualized,
|
|
1007
|
-
openOnInputClick,
|
|
1008
|
-
itemToStringLabel,
|
|
1009
|
-
modal,
|
|
1010
|
-
autoHighlight: autoHighlightMode,
|
|
1011
|
-
isItemEqualToValue,
|
|
1012
|
-
submitOnItemClick,
|
|
1013
|
-
hasInputValue,
|
|
1151
|
+
...syncedValues,
|
|
1014
1152
|
inputOwnsFormValue: selectionMode === 'none' && (inlineProp || !store.state.inputInsidePopup)
|
|
1015
1153
|
});
|
|
1016
|
-
|
|
1154
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1155
|
+
}, [store, ...Object.values(syncedValues)]);
|
|
1017
1156
|
const hiddenInputRef = useMergedRefs(inputRefProp, validation.inputRef);
|
|
1018
1157
|
const itemsContextValue = React.useMemo(() => ({
|
|
1019
1158
|
query,
|
|
1020
1159
|
hasItems,
|
|
1021
1160
|
filteredItems,
|
|
1022
|
-
|
|
1023
|
-
}), [query, hasItems, filteredItems,
|
|
1161
|
+
flatFilteredValues
|
|
1162
|
+
}), [query, hasItems, filteredItems, flatFilteredValues]);
|
|
1024
1163
|
const serializedValue = React.useMemo(() => {
|
|
1025
1164
|
if (Array.isArray(fieldRawValue)) {
|
|
1026
1165
|
return '';
|
|
@@ -1064,7 +1203,7 @@ export function AriaCombobox(props) {
|
|
|
1064
1203
|
const nextValue = event.currentTarget.value;
|
|
1065
1204
|
const nextValueLower = nextValue.toLowerCase();
|
|
1066
1205
|
const details = createChangeEventDetails(REASONS.none, event.nativeEvent);
|
|
1067
|
-
const findSerializedMatchIndex = () => valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower ||
|
|
1206
|
+
const findSerializedMatchIndex = () => valuesRef.current.findIndex(candidate => stringifyAsValue(candidate, itemToStringValue).toLowerCase() === nextValueLower || stringifyValueLabel(candidate).toLowerCase() === nextValueLower);
|
|
1068
1207
|
function handleChange() {
|
|
1069
1208
|
// Browser autofill only writes a single scalar value.
|
|
1070
1209
|
if (multiple) {
|