@base-ui/react 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +144 -1
- package/README.md +2 -3
- package/accordion/header/AccordionHeader.d.ts +1 -1
- package/accordion/item/AccordionItem.d.ts +1 -1
- package/accordion/panel/AccordionPanel.d.ts +1 -1
- package/accordion/root/AccordionRoot.d.ts +1 -1
- package/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/accordion/trigger/AccordionTrigger.js +3 -4
- package/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/autocomplete/root/AutocompleteRoot.d.ts +1 -1
- package/avatar/fallback/AvatarFallback.d.ts +1 -1
- package/avatar/image/AvatarImage.d.ts +1 -1
- package/avatar/root/AvatarRoot.d.ts +1 -1
- package/button/Button.d.ts +4 -17
- package/button/Button.js +1 -2
- package/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.d.ts +4 -0
- package/checkbox/indicator/CheckboxIndicatorDataAttributes.js +4 -0
- package/checkbox/root/CheckboxRoot.d.ts +1 -1
- package/checkbox/root/CheckboxRoot.js +5 -4
- package/checkbox/root/CheckboxRootDataAttributes.d.ts +4 -0
- package/checkbox/root/CheckboxRootDataAttributes.js +4 -0
- package/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/collapsible/trigger/CollapsibleTrigger.js +1 -2
- package/combobox/arrow/ComboboxArrow.d.ts +1 -1
- package/combobox/backdrop/ComboboxBackdrop.d.ts +1 -1
- package/combobox/chip/ComboboxChip.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/combobox/chip-remove/ComboboxChipRemove.js +3 -2
- package/combobox/chips/ComboboxChips.d.ts +1 -1
- package/combobox/chips/ComboboxChips.js +7 -1
- package/combobox/clear/ComboboxClear.d.ts +1 -1
- package/combobox/clear/ComboboxClear.js +2 -2
- package/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/combobox/group/ComboboxGroup.d.ts +1 -1
- package/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/combobox/input/ComboboxInput.d.ts +1 -1
- package/combobox/input/ComboboxInput.js +12 -18
- package/combobox/item/ComboboxItem.d.ts +1 -1
- package/combobox/item/ComboboxItem.js +0 -1
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/combobox/list/ComboboxList.d.ts +1 -1
- package/combobox/popup/ComboboxPopup.d.ts +1 -1
- package/combobox/popup/ComboboxPopup.js +2 -1
- package/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/combobox/positioner/ComboboxPositioner.d.ts +1 -1
- package/combobox/root/AriaCombobox.d.ts +8 -1
- package/combobox/root/AriaCombobox.js +19 -16
- package/combobox/root/ComboboxRoot.d.ts +1 -1
- package/combobox/row/ComboboxRow.d.ts +1 -1
- package/combobox/status/ComboboxStatus.d.ts +1 -1
- package/combobox/store.d.ts +3 -0
- package/combobox/store.js +21 -0
- package/combobox/trigger/ComboboxTrigger.d.ts +14 -1
- package/combobox/trigger/ComboboxTrigger.js +31 -11
- package/combobox/trigger/ComboboxTriggerDataAttributes.d.ts +13 -0
- package/combobox/trigger/ComboboxTriggerDataAttributes.js +13 -0
- package/combobox/utils/stateAttributesMapping.d.ts +14 -0
- package/combobox/utils/stateAttributesMapping.js +18 -0
- package/combobox/value/ComboboxValue.d.ts +5 -0
- package/combobox/value/ComboboxValue.js +15 -6
- package/composite/root/useCompositeRoot.d.ts +1 -1
- package/context-menu/trigger/ContextMenuTrigger.d.ts +1 -1
- package/csp-provider/CSPContext.d.ts +13 -0
- package/csp-provider/CSPContext.js +25 -0
- package/csp-provider/CSPProvider.d.ts +25 -0
- package/csp-provider/CSPProvider.js +32 -0
- package/csp-provider/index.d.ts +2 -0
- package/csp-provider/index.js +12 -0
- package/csp-provider/index.parts.d.ts +1 -0
- package/csp-provider/index.parts.js +12 -0
- package/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dialog/close/DialogClose.d.ts +1 -1
- package/dialog/description/DialogDescription.d.ts +1 -1
- package/dialog/popup/DialogPopup.d.ts +1 -1
- package/dialog/portal/DialogPortal.d.ts +1 -1
- package/dialog/portal/DialogPortal.js +1 -0
- package/dialog/root/DialogRoot.d.ts +4 -4
- package/dialog/store/DialogStore.d.ts +2 -2
- package/dialog/title/DialogTitle.d.ts +1 -1
- package/dialog/viewport/DialogViewport.d.ts +1 -1
- package/esm/accordion/header/AccordionHeader.d.ts +1 -1
- package/esm/accordion/item/AccordionItem.d.ts +1 -1
- package/esm/accordion/panel/AccordionPanel.d.ts +1 -1
- package/esm/accordion/root/AccordionRoot.d.ts +1 -1
- package/esm/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/esm/accordion/trigger/AccordionTrigger.js +3 -4
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +3 -3
- package/esm/autocomplete/root/AutocompleteRoot.d.ts +1 -1
- package/esm/avatar/fallback/AvatarFallback.d.ts +1 -1
- package/esm/avatar/image/AvatarImage.d.ts +1 -1
- package/esm/avatar/root/AvatarRoot.d.ts +1 -1
- package/esm/button/Button.d.ts +4 -17
- package/esm/button/Button.js +1 -2
- package/esm/checkbox/indicator/CheckboxIndicator.d.ts +1 -1
- package/esm/checkbox/indicator/CheckboxIndicatorDataAttributes.d.ts +4 -0
- package/esm/checkbox/indicator/CheckboxIndicatorDataAttributes.js +4 -0
- package/esm/checkbox/root/CheckboxRoot.d.ts +1 -1
- package/esm/checkbox/root/CheckboxRoot.js +6 -5
- package/esm/checkbox/root/CheckboxRootDataAttributes.d.ts +4 -0
- package/esm/checkbox/root/CheckboxRootDataAttributes.js +4 -0
- package/esm/checkbox-group/CheckboxGroup.d.ts +1 -1
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/esm/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/esm/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/esm/collapsible/trigger/CollapsibleTrigger.js +1 -2
- package/esm/combobox/arrow/ComboboxArrow.d.ts +1 -1
- package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +1 -1
- package/esm/combobox/chip/ComboboxChip.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +1 -1
- package/esm/combobox/chip-remove/ComboboxChipRemove.js +3 -2
- package/esm/combobox/chips/ComboboxChips.d.ts +1 -1
- package/esm/combobox/chips/ComboboxChips.js +7 -1
- package/esm/combobox/clear/ComboboxClear.d.ts +1 -1
- package/esm/combobox/clear/ComboboxClear.js +2 -2
- package/esm/combobox/empty/ComboboxEmpty.d.ts +1 -1
- package/esm/combobox/group/ComboboxGroup.d.ts +1 -1
- package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +1 -1
- package/esm/combobox/icon/ComboboxIcon.d.ts +1 -1
- package/esm/combobox/input/ComboboxInput.d.ts +1 -1
- package/esm/combobox/input/ComboboxInput.js +12 -17
- package/esm/combobox/item/ComboboxItem.d.ts +1 -1
- package/esm/combobox/item/ComboboxItem.js +0 -1
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +1 -1
- package/esm/combobox/list/ComboboxList.d.ts +1 -1
- package/esm/combobox/popup/ComboboxPopup.d.ts +1 -1
- package/esm/combobox/popup/ComboboxPopup.js +2 -1
- package/esm/combobox/portal/ComboboxPortal.d.ts +1 -1
- package/esm/combobox/positioner/ComboboxPositioner.d.ts +1 -1
- package/esm/combobox/root/AriaCombobox.d.ts +8 -1
- package/esm/combobox/root/AriaCombobox.js +20 -17
- package/esm/combobox/root/ComboboxRoot.d.ts +1 -1
- package/esm/combobox/row/ComboboxRow.d.ts +1 -1
- package/esm/combobox/status/ComboboxStatus.d.ts +1 -1
- package/esm/combobox/store.d.ts +3 -0
- package/esm/combobox/store.js +21 -0
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +14 -1
- package/esm/combobox/trigger/ComboboxTrigger.js +32 -12
- package/esm/combobox/trigger/ComboboxTriggerDataAttributes.d.ts +13 -0
- package/esm/combobox/trigger/ComboboxTriggerDataAttributes.js +13 -0
- package/esm/combobox/utils/stateAttributesMapping.d.ts +14 -0
- package/esm/combobox/utils/stateAttributesMapping.js +12 -0
- package/esm/combobox/value/ComboboxValue.d.ts +5 -0
- package/esm/combobox/value/ComboboxValue.js +16 -7
- package/esm/composite/root/useCompositeRoot.d.ts +1 -1
- package/esm/context-menu/trigger/ContextMenuTrigger.d.ts +1 -1
- package/esm/csp-provider/CSPContext.d.ts +13 -0
- package/esm/csp-provider/CSPContext.js +18 -0
- package/esm/csp-provider/CSPProvider.d.ts +25 -0
- package/esm/csp-provider/CSPProvider.js +27 -0
- package/esm/csp-provider/index.d.ts +2 -0
- package/esm/csp-provider/index.js +1 -0
- package/esm/csp-provider/index.parts.d.ts +1 -0
- package/esm/csp-provider/index.parts.js +1 -0
- package/esm/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/esm/dialog/close/DialogClose.d.ts +1 -1
- package/esm/dialog/description/DialogDescription.d.ts +1 -1
- package/esm/dialog/popup/DialogPopup.d.ts +1 -1
- package/esm/dialog/portal/DialogPortal.d.ts +1 -1
- package/esm/dialog/portal/DialogPortal.js +1 -0
- package/esm/dialog/root/DialogRoot.d.ts +4 -4
- package/esm/dialog/store/DialogStore.d.ts +2 -2
- package/esm/dialog/title/DialogTitle.d.ts +1 -1
- package/esm/dialog/viewport/DialogViewport.d.ts +1 -1
- package/esm/field/control/FieldControl.d.ts +1 -1
- package/esm/field/description/FieldDescription.d.ts +1 -1
- package/esm/field/error/FieldError.d.ts +1 -1
- package/esm/field/index.d.ts +2 -1
- package/esm/field/item/FieldItem.d.ts +1 -1
- package/esm/field/label/FieldLabel.d.ts +11 -2
- package/esm/field/label/FieldLabel.js +51 -11
- package/esm/field/root/FieldRoot.d.ts +10 -1
- package/esm/field/root/FieldRoot.js +8 -0
- package/esm/field/useField.js +7 -3
- package/esm/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/esm/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/esm/floating-ui-react/components/FloatingFocusManager.js +7 -6
- package/esm/floating-ui-react/components/FloatingPortal.d.ts +2 -2
- package/esm/floating-ui-react/components/FloatingPortal.js +11 -2
- package/esm/floating-ui-react/hooks/useClientPoint.js +5 -4
- package/esm/floating-ui-react/hooks/useDismiss.js +16 -3
- package/esm/floating-ui-react/hooks/useFocus.d.ts +5 -0
- package/esm/floating-ui-react/hooks/useFocus.js +43 -9
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +17 -4
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -0
- package/esm/form/Form.d.ts +18 -1
- package/esm/form/Form.js +17 -0
- package/esm/form/FormContext.d.ts +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -1
- package/esm/input/Input.d.ts +1 -1
- package/esm/menu/arrow/MenuArrow.d.ts +1 -1
- package/esm/menu/backdrop/MenuBackdrop.d.ts +1 -1
- package/esm/menu/checkbox-item/MenuCheckboxItem.d.ts +1 -1
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +1 -1
- package/esm/menu/group/MenuGroup.d.ts +1 -1
- package/esm/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/esm/menu/item/MenuItem.d.ts +1 -1
- package/esm/menu/popup/MenuPopup.d.ts +1 -1
- package/esm/menu/popup/MenuPopup.js +4 -3
- package/esm/menu/portal/MenuPortal.d.ts +1 -1
- package/esm/menu/positioner/MenuPositioner.d.ts +1 -1
- package/esm/menu/radio-group/MenuRadioGroup.d.ts +1 -1
- package/esm/menu/radio-item/MenuRadioItem.d.ts +1 -1
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +1 -1
- package/esm/menu/root/MenuRoot.d.ts +7 -6
- package/esm/menu/root/MenuRoot.js +4 -2
- package/esm/menu/store/MenuStore.js +3 -3
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +1 -1
- package/esm/menu/trigger/MenuTrigger.js +13 -13
- package/esm/menubar/Menubar.d.ts +1 -1
- package/esm/merge-props/mergeProps.d.ts +31 -11
- package/esm/merge-props/mergeProps.js +29 -8
- package/esm/meter/indicator/MeterIndicator.d.ts +1 -1
- package/esm/meter/label/MeterLabel.d.ts +1 -1
- package/esm/meter/root/MeterRoot.d.ts +1 -1
- package/esm/meter/track/MeterTrack.d.ts +1 -1
- package/esm/meter/value/MeterValue.d.ts +1 -1
- package/esm/navigation-menu/arrow/NavigationMenuArrow.d.ts +1 -1
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/esm/navigation-menu/content/NavigationMenuContent.js +6 -0
- package/esm/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/esm/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/esm/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/esm/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/esm/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/esm/navigation-menu/portal/NavigationMenuPortal.d.ts +1 -1
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.d.ts +1 -1
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +2 -2
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/esm/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/esm/number-field/decrement/NumberFieldDecrement.d.ts +1 -1
- package/esm/number-field/decrement/NumberFieldDecrement.js +4 -6
- package/esm/number-field/group/NumberFieldGroup.d.ts +1 -1
- package/esm/number-field/increment/NumberFieldIncrement.d.ts +1 -1
- package/esm/number-field/increment/NumberFieldIncrement.js +4 -6
- package/esm/number-field/input/NumberFieldInput.d.ts +1 -1
- package/esm/number-field/input/NumberFieldInput.js +5 -2
- package/esm/number-field/root/NumberFieldRoot.d.ts +5 -4
- package/esm/number-field/root/NumberFieldRoot.js +12 -5
- package/esm/number-field/root/useNumberFieldButton.d.ts +0 -3
- package/esm/number-field/root/useNumberFieldButton.js +5 -11
- package/esm/number-field/scrub-area/NumberFieldScrubArea.d.ts +1 -1
- package/esm/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +1 -1
- package/esm/popover/arrow/PopoverArrow.d.ts +1 -1
- package/esm/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/esm/popover/close/PopoverClose.d.ts +1 -1
- package/esm/popover/description/PopoverDescription.d.ts +1 -1
- package/esm/popover/popup/PopoverPopup.d.ts +1 -1
- package/esm/popover/popup/PopoverPopup.js +0 -30
- package/esm/popover/portal/PopoverPortal.d.ts +1 -1
- package/esm/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/esm/popover/positioner/PopoverPositioner.js +2 -1
- package/esm/popover/root/PopoverRoot.d.ts +2 -2
- package/esm/popover/store/PopoverStore.d.ts +4 -2
- package/esm/popover/store/PopoverStore.js +8 -5
- package/esm/popover/title/PopoverTitle.d.ts +1 -1
- package/esm/popover/trigger/PopoverTrigger.js +2 -2
- package/esm/popover/viewport/PopoverViewport.d.ts +1 -1
- package/esm/popover/viewport/PopoverViewport.js +28 -12
- package/esm/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/esm/preview-card/arrow/PreviewCardArrow.js +2 -3
- package/esm/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/esm/preview-card/backdrop/PreviewCardBackdrop.js +4 -5
- package/esm/preview-card/index.parts.d.ts +3 -1
- package/esm/preview-card/index.parts.js +3 -1
- package/esm/preview-card/popup/PreviewCardPopup.d.ts +2 -1
- package/esm/preview-card/popup/PreviewCardPopup.js +17 -11
- package/esm/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/esm/preview-card/portal/PreviewCardPortal.js +2 -3
- package/esm/preview-card/positioner/PreviewCardPositioner.d.ts +2 -1
- package/esm/preview-card/positioner/PreviewCardPositioner.js +16 -11
- package/esm/preview-card/root/PreviewCardContext.d.ts +5 -26
- package/esm/preview-card/root/PreviewCardContext.js +2 -2
- package/esm/preview-card/root/PreviewCardRoot.d.ts +35 -10
- package/esm/preview-card/root/PreviewCardRoot.js +61 -116
- package/esm/preview-card/store/PreviewCardHandle.d.ts +33 -0
- package/esm/preview-card/store/PreviewCardHandle.js +55 -0
- package/esm/preview-card/store/PreviewCardStore.d.ts +36 -0
- package/esm/preview-card/store/PreviewCardStore.js +97 -0
- package/esm/preview-card/trigger/PreviewCardTrigger.d.ts +15 -3
- package/esm/preview-card/trigger/PreviewCardTrigger.js +49 -13
- package/esm/preview-card/viewport/PreviewCardViewport.d.ts +22 -0
- package/esm/preview-card/viewport/PreviewCardViewport.js +272 -0
- package/esm/preview-card/viewport/PreviewCardViewportCssVars.d.ts +14 -0
- package/esm/preview-card/viewport/PreviewCardViewportCssVars.js +15 -0
- package/esm/preview-card/viewport/PreviewCardViewportDataAttributes.d.ts +26 -0
- package/esm/preview-card/viewport/PreviewCardViewportDataAttributes.js +27 -0
- package/esm/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/esm/progress/label/ProgressLabel.d.ts +1 -1
- package/esm/progress/root/ProgressRoot.d.ts +1 -1
- package/esm/progress/track/ProgressTrack.d.ts +1 -1
- package/esm/progress/value/ProgressValue.d.ts +1 -1
- package/esm/radio/indicator/RadioIndicator.d.ts +1 -1
- package/esm/radio/root/RadioRoot.d.ts +1 -1
- package/esm/radio/root/RadioRoot.js +9 -9
- package/esm/radio-group/RadioGroup.d.ts +4 -4
- package/esm/radio-group/RadioGroup.js +2 -2
- package/esm/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/esm/scroll-area/content/ScrollAreaContent.js +10 -1
- package/esm/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/esm/scroll-area/corner/ScrollAreaCorner.js +1 -1
- package/esm/scroll-area/root/ScrollAreaRoot.d.ts +26 -2
- package/esm/scroll-area/root/ScrollAreaRoot.js +33 -29
- package/esm/scroll-area/root/ScrollAreaRootContext.d.ts +10 -43
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -4
- package/esm/scroll-area/thumb/ScrollAreaThumb.d.ts +2 -2
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +1 -1
- package/esm/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +51 -25
- package/esm/select/arrow/SelectArrow.d.ts +1 -1
- package/esm/select/backdrop/SelectBackdrop.d.ts +1 -1
- package/esm/select/group/SelectGroup.d.ts +1 -1
- package/esm/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/esm/select/icon/SelectIcon.d.ts +1 -1
- package/esm/select/item/SelectItem.d.ts +1 -1
- package/esm/select/item/SelectItem.js +0 -1
- package/esm/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/esm/select/item-text/SelectItemText.d.ts +1 -1
- package/esm/select/list/SelectList.d.ts +1 -1
- package/esm/select/popup/SelectPopup.d.ts +1 -1
- package/esm/select/popup/SelectPopup.js +154 -95
- package/esm/select/portal/SelectPortal.d.ts +1 -1
- package/esm/select/positioner/SelectPositioner.d.ts +1 -1
- package/esm/select/root/SelectRoot.d.ts +2 -2
- package/esm/select/root/SelectRoot.js +26 -13
- package/esm/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/esm/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/esm/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/esm/select/store.d.ts +2 -1
- package/esm/select/store.js +19 -13
- package/esm/select/trigger/SelectTrigger.d.ts +14 -4
- package/esm/select/trigger/SelectTrigger.js +50 -18
- package/esm/select/value/SelectValue.d.ts +6 -1
- package/esm/select/value/SelectValue.js +19 -5
- package/esm/separator/Separator.d.ts +1 -1
- package/esm/slider/control/SliderControl.d.ts +1 -1
- package/esm/slider/control/SliderControl.js +1 -1
- package/esm/slider/control/SliderControlDataAttributes.d.ts +0 -8
- package/esm/slider/control/SliderControlDataAttributes.js +0 -8
- package/esm/slider/indicator/SliderIndicator.d.ts +1 -1
- package/esm/slider/indicator/SliderIndicatorDataAttributes.d.ts +0 -8
- package/esm/slider/indicator/SliderIndicatorDataAttributes.js +0 -8
- package/esm/slider/root/SliderRootDataAttributes.d.ts +0 -8
- package/esm/slider/root/SliderRootDataAttributes.js +0 -8
- package/esm/slider/thumb/SliderThumb.d.ts +2 -2
- package/esm/slider/thumb/SliderThumb.js +7 -1
- package/esm/slider/thumb/SliderThumbDataAttributes.d.ts +0 -8
- package/esm/slider/thumb/SliderThumbDataAttributes.js +0 -8
- package/esm/slider/track/SliderTrack.d.ts +1 -1
- package/esm/slider/track/SliderTrackDataAttributes.d.ts +0 -8
- package/esm/slider/track/SliderTrackDataAttributes.js +0 -8
- package/esm/slider/value/SliderValue.d.ts +1 -1
- package/esm/slider/value/SliderValueDataAttributes.d.ts +0 -8
- package/esm/slider/value/SliderValueDataAttributes.js +0 -8
- package/esm/switch/root/SwitchRoot.d.ts +6 -1
- package/esm/switch/root/SwitchRoot.js +15 -6
- package/esm/switch/thumb/SwitchThumb.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.js +6 -0
- package/esm/tabs/list/TabsList.d.ts +1 -1
- package/esm/tabs/panel/TabsPanel.d.ts +1 -1
- package/esm/tabs/root/TabsRoot.d.ts +1 -1
- package/esm/tabs/tab/TabsTab.d.ts +1 -1
- package/esm/toast/action/ToastAction.d.ts +1 -1
- package/esm/toast/arrow/ToastArrow.d.ts +1 -1
- package/esm/toast/close/ToastClose.d.ts +1 -1
- package/esm/toast/content/ToastContent.d.ts +1 -1
- package/esm/toast/description/ToastDescription.d.ts +1 -1
- package/esm/toast/portal/ToastPortal.d.ts +1 -1
- package/esm/toast/positioner/ToastPositioner.d.ts +1 -1
- package/esm/toast/provider/ToastProvider.js +46 -19
- package/esm/toast/root/ToastRoot.d.ts +1 -1
- package/esm/toast/title/ToastTitle.d.ts +1 -1
- package/esm/toast/viewport/ToastViewport.d.ts +1 -1
- package/esm/toggle/Toggle.d.ts +1 -1
- package/esm/toggle-group/ToggleGroup.d.ts +1 -1
- package/esm/toolbar/button/ToolbarButton.d.ts +1 -1
- package/esm/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/esm/toolbar/input/ToolbarInput.d.ts +1 -1
- package/esm/toolbar/link/ToolbarLink.d.ts +1 -1
- package/esm/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/esm/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/esm/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/esm/tooltip/popup/TooltipPopup.d.ts +1 -1
- package/esm/tooltip/popup/TooltipPopup.js +0 -31
- package/esm/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/esm/tooltip/positioner/TooltipPositioner.js +2 -1
- package/esm/tooltip/root/TooltipRoot.d.ts +4 -6
- package/esm/tooltip/root/TooltipRoot.js +1 -2
- package/esm/tooltip/store/TooltipStore.d.ts +4 -2
- package/esm/tooltip/store/TooltipStore.js +7 -4
- package/esm/tooltip/trigger/TooltipTrigger.js +1 -1
- package/esm/tooltip/viewport/TooltipViewport.d.ts +1 -1
- package/esm/tooltip/viewport/TooltipViewport.js +28 -12
- package/esm/use-render/index.d.ts +2 -1
- package/esm/use-render/index.js +2 -1
- package/esm/utils/FloatingPortalLite.d.ts +1 -1
- package/esm/utils/popups/popupStoreUtils.js +21 -2
- package/esm/utils/resolveValueLabel.d.ts +5 -1
- package/esm/utils/resolveValueLabel.js +46 -22
- package/esm/utils/styles.d.ts +1 -1
- package/esm/utils/styles.js +10 -6
- package/esm/utils/types.d.ts +1 -1
- package/esm/utils/useAnimationsFinished.d.ts +2 -2
- package/esm/utils/useAnimationsFinished.js +56 -33
- package/esm/utils/useOpenChangeComplete.js +8 -10
- package/esm/utils/useOpenInteractionType.js +6 -1
- package/esm/utils/usePopupAutoResize.js +82 -46
- package/field/control/FieldControl.d.ts +1 -1
- package/field/description/FieldDescription.d.ts +1 -1
- package/field/error/FieldError.d.ts +1 -1
- package/field/index.d.ts +2 -1
- package/field/item/FieldItem.d.ts +1 -1
- package/field/label/FieldLabel.d.ts +11 -2
- package/field/label/FieldLabel.js +51 -11
- package/field/root/FieldRoot.d.ts +10 -1
- package/field/root/FieldRoot.js +8 -0
- package/field/useField.js +7 -3
- package/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/floating-ui-react/components/FloatingFocusManager.js +7 -6
- package/floating-ui-react/components/FloatingPortal.d.ts +2 -2
- package/floating-ui-react/components/FloatingPortal.js +11 -2
- package/floating-ui-react/hooks/useClientPoint.js +5 -4
- package/floating-ui-react/hooks/useDismiss.js +16 -3
- package/floating-ui-react/hooks/useFocus.d.ts +5 -0
- package/floating-ui-react/hooks/useFocus.js +43 -9
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +17 -4
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -0
- package/form/Form.d.ts +18 -1
- package/form/Form.js +17 -0
- package/form/FormContext.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/input/Input.d.ts +1 -1
- package/menu/arrow/MenuArrow.d.ts +1 -1
- package/menu/backdrop/MenuBackdrop.d.ts +1 -1
- package/menu/checkbox-item/MenuCheckboxItem.d.ts +1 -1
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.d.ts +1 -1
- package/menu/group/MenuGroup.d.ts +1 -1
- package/menu/group-label/MenuGroupLabel.d.ts +1 -1
- package/menu/item/MenuItem.d.ts +1 -1
- package/menu/popup/MenuPopup.d.ts +1 -1
- package/menu/popup/MenuPopup.js +4 -3
- package/menu/portal/MenuPortal.d.ts +1 -1
- package/menu/positioner/MenuPositioner.d.ts +1 -1
- package/menu/radio-group/MenuRadioGroup.d.ts +1 -1
- package/menu/radio-item/MenuRadioItem.d.ts +1 -1
- package/menu/radio-item-indicator/MenuRadioItemIndicator.d.ts +1 -1
- package/menu/root/MenuRoot.d.ts +7 -6
- package/menu/root/MenuRoot.js +4 -2
- package/menu/store/MenuStore.js +3 -3
- package/menu/submenu-trigger/MenuSubmenuTrigger.d.ts +1 -1
- package/menu/trigger/MenuTrigger.js +14 -14
- package/menubar/Menubar.d.ts +1 -1
- package/merge-props/mergeProps.d.ts +31 -11
- package/merge-props/mergeProps.js +29 -8
- package/meter/indicator/MeterIndicator.d.ts +1 -1
- package/meter/label/MeterLabel.d.ts +1 -1
- package/meter/root/MeterRoot.d.ts +1 -1
- package/meter/track/MeterTrack.d.ts +1 -1
- package/meter/value/MeterValue.d.ts +1 -1
- package/navigation-menu/arrow/NavigationMenuArrow.d.ts +1 -1
- package/navigation-menu/backdrop/NavigationMenuBackdrop.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.d.ts +1 -1
- package/navigation-menu/content/NavigationMenuContent.js +6 -0
- package/navigation-menu/icon/NavigationMenuIcon.d.ts +1 -1
- package/navigation-menu/item/NavigationMenuItem.d.ts +1 -1
- package/navigation-menu/link/NavigationMenuLink.d.ts +1 -1
- package/navigation-menu/list/NavigationMenuList.d.ts +1 -1
- package/navigation-menu/popup/NavigationMenuPopup.d.ts +1 -1
- package/navigation-menu/portal/NavigationMenuPortal.d.ts +1 -1
- package/navigation-menu/positioner/NavigationMenuPositioner.d.ts +1 -1
- package/navigation-menu/root/NavigationMenuRoot.d.ts +2 -2
- package/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -1
- package/navigation-menu/viewport/NavigationMenuViewport.d.ts +1 -1
- package/number-field/decrement/NumberFieldDecrement.d.ts +1 -1
- package/number-field/decrement/NumberFieldDecrement.js +4 -6
- package/number-field/group/NumberFieldGroup.d.ts +1 -1
- package/number-field/increment/NumberFieldIncrement.d.ts +1 -1
- package/number-field/increment/NumberFieldIncrement.js +4 -6
- package/number-field/input/NumberFieldInput.d.ts +1 -1
- package/number-field/input/NumberFieldInput.js +5 -2
- package/number-field/root/NumberFieldRoot.d.ts +5 -4
- package/number-field/root/NumberFieldRoot.js +11 -4
- package/number-field/root/useNumberFieldButton.d.ts +0 -3
- package/number-field/root/useNumberFieldButton.js +5 -11
- package/number-field/scrub-area/NumberFieldScrubArea.d.ts +1 -1
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.d.ts +1 -1
- package/package.json +13 -3
- package/popover/arrow/PopoverArrow.d.ts +1 -1
- package/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/popover/close/PopoverClose.d.ts +1 -1
- package/popover/description/PopoverDescription.d.ts +1 -1
- package/popover/popup/PopoverPopup.d.ts +1 -1
- package/popover/popup/PopoverPopup.js +0 -30
- package/popover/portal/PopoverPortal.d.ts +1 -1
- package/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/popover/positioner/PopoverPositioner.js +2 -1
- package/popover/root/PopoverRoot.d.ts +2 -2
- package/popover/store/PopoverStore.d.ts +4 -2
- package/popover/store/PopoverStore.js +8 -5
- package/popover/title/PopoverTitle.d.ts +1 -1
- package/popover/trigger/PopoverTrigger.js +2 -2
- package/popover/viewport/PopoverViewport.d.ts +1 -1
- package/popover/viewport/PopoverViewport.js +28 -12
- package/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/preview-card/arrow/PreviewCardArrow.js +2 -3
- package/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/preview-card/backdrop/PreviewCardBackdrop.js +4 -5
- package/preview-card/index.parts.d.ts +3 -1
- package/preview-card/index.parts.js +21 -1
- package/preview-card/popup/PreviewCardPopup.d.ts +2 -1
- package/preview-card/popup/PreviewCardPopup.js +17 -11
- package/preview-card/portal/PreviewCardPortal.d.ts +1 -1
- package/preview-card/portal/PreviewCardPortal.js +2 -3
- package/preview-card/positioner/PreviewCardPositioner.d.ts +2 -1
- package/preview-card/positioner/PreviewCardPositioner.js +16 -11
- package/preview-card/root/PreviewCardContext.d.ts +5 -26
- package/preview-card/root/PreviewCardContext.js +2 -2
- package/preview-card/root/PreviewCardRoot.d.ts +35 -10
- package/preview-card/root/PreviewCardRoot.js +59 -113
- package/preview-card/store/PreviewCardHandle.d.ts +33 -0
- package/preview-card/store/PreviewCardHandle.js +63 -0
- package/preview-card/store/PreviewCardStore.d.ts +36 -0
- package/preview-card/store/PreviewCardStore.js +105 -0
- package/preview-card/trigger/PreviewCardTrigger.d.ts +15 -3
- package/preview-card/trigger/PreviewCardTrigger.js +50 -13
- package/preview-card/viewport/PreviewCardViewport.d.ts +22 -0
- package/preview-card/viewport/PreviewCardViewport.js +278 -0
- package/preview-card/viewport/PreviewCardViewportCssVars.d.ts +14 -0
- package/preview-card/viewport/PreviewCardViewportCssVars.js +21 -0
- package/preview-card/viewport/PreviewCardViewportDataAttributes.d.ts +26 -0
- package/preview-card/viewport/PreviewCardViewportDataAttributes.js +33 -0
- package/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/progress/label/ProgressLabel.d.ts +1 -1
- package/progress/root/ProgressRoot.d.ts +1 -1
- package/progress/track/ProgressTrack.d.ts +1 -1
- package/progress/value/ProgressValue.d.ts +1 -1
- package/radio/indicator/RadioIndicator.d.ts +1 -1
- package/radio/root/RadioRoot.d.ts +1 -1
- package/radio/root/RadioRoot.js +8 -8
- package/radio-group/RadioGroup.d.ts +4 -4
- package/radio-group/RadioGroup.js +1 -1
- package/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/scroll-area/content/ScrollAreaContent.js +10 -1
- package/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/scroll-area/corner/ScrollAreaCorner.js +1 -1
- package/scroll-area/root/ScrollAreaRoot.d.ts +26 -2
- package/scroll-area/root/ScrollAreaRoot.js +33 -29
- package/scroll-area/root/ScrollAreaRootContext.d.ts +10 -43
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +4 -4
- package/scroll-area/thumb/ScrollAreaThumb.d.ts +2 -2
- package/scroll-area/thumb/ScrollAreaThumb.js +1 -1
- package/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/scroll-area/viewport/ScrollAreaViewport.js +51 -25
- package/select/arrow/SelectArrow.d.ts +1 -1
- package/select/backdrop/SelectBackdrop.d.ts +1 -1
- package/select/group/SelectGroup.d.ts +1 -1
- package/select/group-label/SelectGroupLabel.d.ts +1 -1
- package/select/icon/SelectIcon.d.ts +1 -1
- package/select/item/SelectItem.d.ts +1 -1
- package/select/item/SelectItem.js +0 -1
- package/select/item-indicator/SelectItemIndicator.d.ts +1 -1
- package/select/item-text/SelectItemText.d.ts +1 -1
- package/select/list/SelectList.d.ts +1 -1
- package/select/popup/SelectPopup.d.ts +1 -1
- package/select/popup/SelectPopup.js +154 -95
- package/select/portal/SelectPortal.d.ts +1 -1
- package/select/positioner/SelectPositioner.d.ts +1 -1
- package/select/root/SelectRoot.d.ts +2 -2
- package/select/root/SelectRoot.js +24 -11
- package/select/scroll-arrow/SelectScrollArrow.d.ts +1 -1
- package/select/scroll-down-arrow/SelectScrollDownArrow.d.ts +1 -1
- package/select/scroll-up-arrow/SelectScrollUpArrow.d.ts +1 -1
- package/select/store.d.ts +2 -1
- package/select/store.js +18 -12
- package/select/trigger/SelectTrigger.d.ts +14 -4
- package/select/trigger/SelectTrigger.js +50 -18
- package/select/value/SelectValue.d.ts +6 -1
- package/select/value/SelectValue.js +18 -4
- package/separator/Separator.d.ts +1 -1
- package/slider/control/SliderControl.d.ts +1 -1
- package/slider/control/SliderControl.js +1 -1
- package/slider/control/SliderControlDataAttributes.d.ts +0 -8
- package/slider/control/SliderControlDataAttributes.js +0 -8
- package/slider/indicator/SliderIndicator.d.ts +1 -1
- package/slider/indicator/SliderIndicatorDataAttributes.d.ts +0 -8
- package/slider/indicator/SliderIndicatorDataAttributes.js +0 -8
- package/slider/root/SliderRootDataAttributes.d.ts +0 -8
- package/slider/root/SliderRootDataAttributes.js +0 -8
- package/slider/thumb/SliderThumb.d.ts +2 -2
- package/slider/thumb/SliderThumb.js +7 -1
- package/slider/thumb/SliderThumbDataAttributes.d.ts +0 -8
- package/slider/thumb/SliderThumbDataAttributes.js +0 -8
- package/slider/track/SliderTrack.d.ts +1 -1
- package/slider/track/SliderTrackDataAttributes.d.ts +0 -8
- package/slider/track/SliderTrackDataAttributes.js +0 -8
- package/slider/value/SliderValue.d.ts +1 -1
- package/slider/value/SliderValueDataAttributes.d.ts +0 -8
- package/slider/value/SliderValueDataAttributes.js +0 -8
- package/switch/root/SwitchRoot.d.ts +6 -1
- package/switch/root/SwitchRoot.js +14 -5
- package/switch/thumb/SwitchThumb.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.js +6 -0
- package/tabs/list/TabsList.d.ts +1 -1
- package/tabs/panel/TabsPanel.d.ts +1 -1
- package/tabs/root/TabsRoot.d.ts +1 -1
- package/tabs/tab/TabsTab.d.ts +1 -1
- package/toast/action/ToastAction.d.ts +1 -1
- package/toast/arrow/ToastArrow.d.ts +1 -1
- package/toast/close/ToastClose.d.ts +1 -1
- package/toast/content/ToastContent.d.ts +1 -1
- package/toast/description/ToastDescription.d.ts +1 -1
- package/toast/portal/ToastPortal.d.ts +1 -1
- package/toast/positioner/ToastPositioner.d.ts +1 -1
- package/toast/provider/ToastProvider.js +46 -19
- package/toast/root/ToastRoot.d.ts +1 -1
- package/toast/title/ToastTitle.d.ts +1 -1
- package/toast/viewport/ToastViewport.d.ts +1 -1
- package/toggle/Toggle.d.ts +1 -1
- package/toggle-group/ToggleGroup.d.ts +1 -1
- package/toolbar/button/ToolbarButton.d.ts +1 -1
- package/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/toolbar/input/ToolbarInput.d.ts +1 -1
- package/toolbar/link/ToolbarLink.d.ts +1 -1
- package/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/tooltip/popup/TooltipPopup.d.ts +1 -1
- package/tooltip/popup/TooltipPopup.js +0 -31
- package/tooltip/portal/TooltipPortal.d.ts +1 -1
- package/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/tooltip/positioner/TooltipPositioner.js +2 -1
- package/tooltip/root/TooltipRoot.d.ts +4 -6
- package/tooltip/root/TooltipRoot.js +1 -2
- package/tooltip/store/TooltipStore.d.ts +4 -2
- package/tooltip/store/TooltipStore.js +7 -4
- package/tooltip/trigger/TooltipTrigger.js +1 -1
- package/tooltip/viewport/TooltipViewport.d.ts +1 -1
- package/tooltip/viewport/TooltipViewport.js +28 -12
- package/use-render/index.d.ts +2 -1
- package/utils/FloatingPortalLite.d.ts +1 -1
- package/utils/popups/popupStoreUtils.js +21 -2
- package/utils/resolveValueLabel.d.ts +5 -1
- package/utils/resolveValueLabel.js +48 -22
- package/utils/styles.d.ts +1 -1
- package/utils/styles.js +10 -6
- package/utils/types.d.ts +1 -1
- package/utils/useAnimationsFinished.d.ts +2 -2
- package/utils/useAnimationsFinished.js +56 -33
- package/utils/useOpenChangeComplete.js +8 -10
- package/utils/useOpenInteractionType.js +6 -1
- package/utils/usePopupAutoResize.js +82 -46
- package/esm/utils/interactions/useFocusWithDelay.d.ts +0 -9
- package/esm/utils/interactions/useFocusWithDelay.js +0 -81
- package/utils/interactions/useFocusWithDelay.d.ts +0 -9
- package/utils/interactions/useFocusWithDelay.js +0 -87
- /package/esm/utils/{useMixedToggleClickHander.d.ts → useMixedToggleClickHandler.d.ts} +0 -0
- /package/esm/utils/{useMixedToggleClickHander.js → useMixedToggleClickHandler.js} +0 -0
- /package/utils/{useMixedToggleClickHander.d.ts → useMixedToggleClickHandler.d.ts} +0 -0
- /package/utils/{useMixedToggleClickHander.js → useMixedToggleClickHandler.js} +0 -0
|
@@ -5,7 +5,7 @@ import { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
5
5
|
* Useful for conveying the status of an asynchronously loaded list.
|
|
6
6
|
* Renders a `<div>` element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const ComboboxStatus: React.ForwardRefExoticComponent<ComboboxStatusProps & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const ComboboxStatus: React.ForwardRefExoticComponent<Omit<ComboboxStatusProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export interface ComboboxStatusState {}
|
|
10
10
|
export interface ComboboxStatusProps extends BaseUIComponentProps<'div', ComboboxStatus.State> {}
|
|
11
11
|
export declare namespace ComboboxStatus {
|
package/esm/combobox/store.d.ts
CHANGED
|
@@ -77,6 +77,9 @@ export declare const selectors: {
|
|
|
77
77
|
query: (state: State) => string;
|
|
78
78
|
items: (state: State) => readonly any[] | undefined;
|
|
79
79
|
selectedValue: (state: State) => any;
|
|
80
|
+
hasSelectionChips: (state: State) => boolean;
|
|
81
|
+
hasSelectedValue: (state: State) => boolean;
|
|
82
|
+
hasNullItemLabel: (state: State, enabled: boolean) => boolean;
|
|
80
83
|
open: (state: State) => boolean;
|
|
81
84
|
mounted: (state: State) => boolean;
|
|
82
85
|
forceMounted: (state: State) => boolean;
|
package/esm/combobox/store.js
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
import { createSelector } from '@base-ui/utils/store';
|
|
2
2
|
import { compareItemEquality } from "../utils/itemEquality.js";
|
|
3
|
+
import { hasNullItemLabel } from "../utils/resolveValueLabel.js";
|
|
3
4
|
export const selectors = {
|
|
4
5
|
id: createSelector(state => state.id),
|
|
5
6
|
query: createSelector(state => state.query),
|
|
6
7
|
items: createSelector(state => state.items),
|
|
7
8
|
selectedValue: createSelector(state => state.selectedValue),
|
|
9
|
+
hasSelectionChips: createSelector(state => {
|
|
10
|
+
const selectedValue = state.selectedValue;
|
|
11
|
+
return Array.isArray(selectedValue) && selectedValue.length > 0;
|
|
12
|
+
}),
|
|
13
|
+
hasSelectedValue: createSelector(state => {
|
|
14
|
+
const {
|
|
15
|
+
selectedValue,
|
|
16
|
+
selectionMode
|
|
17
|
+
} = state;
|
|
18
|
+
if (selectedValue == null) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
if (selectionMode === 'multiple' && Array.isArray(selectedValue)) {
|
|
22
|
+
return selectedValue.length > 0;
|
|
23
|
+
}
|
|
24
|
+
return true;
|
|
25
|
+
}),
|
|
26
|
+
hasNullItemLabel: createSelector((state, enabled) => {
|
|
27
|
+
return enabled ? hasNullItemLabel(state.items) : false;
|
|
28
|
+
}),
|
|
8
29
|
open: createSelector(state => state.open),
|
|
9
30
|
mounted: createSelector(state => state.mounted),
|
|
10
31
|
forceMounted: createSelector(state => state.forceMounted),
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { BaseUIComponentProps, NativeButtonProps } from "../../utils/types.js";
|
|
3
3
|
import type { FieldRoot } from "../../field/root/FieldRoot.js";
|
|
4
|
+
import type { Side } from "../../utils/useAnchorPositioning.js";
|
|
4
5
|
/**
|
|
5
6
|
* A button that opens the popup.
|
|
6
7
|
* Renders a `<button>` element.
|
|
7
8
|
*/
|
|
8
|
-
export declare const ComboboxTrigger: React.ForwardRefExoticComponent<ComboboxTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export declare const ComboboxTrigger: React.ForwardRefExoticComponent<Omit<ComboboxTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
10
|
export interface ComboboxTriggerState extends FieldRoot.State {
|
|
10
11
|
/**
|
|
11
12
|
* Whether the popup is open.
|
|
@@ -15,6 +16,18 @@ export interface ComboboxTriggerState extends FieldRoot.State {
|
|
|
15
16
|
* Whether the component should ignore user interaction.
|
|
16
17
|
*/
|
|
17
18
|
disabled: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
21
|
+
*/
|
|
22
|
+
popupSide: Side | null;
|
|
23
|
+
/**
|
|
24
|
+
* Present when the corresponding items list is empty.
|
|
25
|
+
*/
|
|
26
|
+
listEmpty: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the combobox doesn't have a value.
|
|
29
|
+
*/
|
|
30
|
+
placeholder: boolean;
|
|
18
31
|
}
|
|
19
32
|
export interface ComboboxTriggerProps extends NativeButtonProps, BaseUIComponentProps<'button', ComboboxTrigger.State> {
|
|
20
33
|
/**
|
|
@@ -7,22 +7,18 @@ import { useTimeout } from '@base-ui/utils/useTimeout';
|
|
|
7
7
|
import { ownerDocument } from '@base-ui/utils/owner';
|
|
8
8
|
import { useRenderElement } from "../../utils/useRenderElement.js";
|
|
9
9
|
import { useButton } from "../../use-button/index.js";
|
|
10
|
-
import { useComboboxFloatingContext, useComboboxInputValueContext, useComboboxRootContext } from "../root/ComboboxRootContext.js";
|
|
10
|
+
import { useComboboxFloatingContext, useComboboxDerivedItemsContext, useComboboxInputValueContext, useComboboxRootContext } from "../root/ComboboxRootContext.js";
|
|
11
|
+
import { triggerStateAttributesMapping } from "../utils/stateAttributesMapping.js";
|
|
11
12
|
import { selectors } from "../store.js";
|
|
12
13
|
import { useFieldRootContext } from "../../field/root/FieldRootContext.js";
|
|
13
14
|
import { useLabelableContext } from "../../labelable-provider/LabelableContext.js";
|
|
14
|
-
import { pressableTriggerOpenStateMapping } from "../../utils/popupStateMapping.js";
|
|
15
15
|
import { stopEvent, contains, getTarget } from "../../floating-ui-react/utils.js";
|
|
16
16
|
import { getPseudoElementBounds } from "../../utils/getPseudoElementBounds.js";
|
|
17
17
|
import { createChangeEventDetails } from "../../utils/createBaseUIEventDetails.js";
|
|
18
18
|
import { REASONS } from "../../utils/reasons.js";
|
|
19
|
-
import { fieldValidityMapping } from "../../field/utils/constants.js";
|
|
20
19
|
import { useClick, useTypeahead } from "../../floating-ui-react/index.js";
|
|
20
|
+
import { useLabelableId } from "../../labelable-provider/useLabelableId.js";
|
|
21
21
|
const BOUNDARY_OFFSET = 2;
|
|
22
|
-
const stateAttributesMapping = {
|
|
23
|
-
...pressableTriggerOpenStateMapping,
|
|
24
|
-
...fieldValidityMapping
|
|
25
|
-
};
|
|
26
22
|
|
|
27
23
|
/**
|
|
28
24
|
* A button that opens the popup.
|
|
@@ -34,6 +30,7 @@ export const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTr
|
|
|
34
30
|
className,
|
|
35
31
|
nativeButton = true,
|
|
36
32
|
disabled: disabledProp = false,
|
|
33
|
+
id: idProp,
|
|
37
34
|
...elementProps
|
|
38
35
|
} = componentProps;
|
|
39
36
|
const {
|
|
@@ -48,21 +45,36 @@ export const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTr
|
|
|
48
45
|
labelId
|
|
49
46
|
} = useLabelableContext();
|
|
50
47
|
const store = useComboboxRootContext();
|
|
48
|
+
const {
|
|
49
|
+
filteredItems
|
|
50
|
+
} = useComboboxDerivedItemsContext();
|
|
51
51
|
const selectionMode = useStore(store, selectors.selectionMode);
|
|
52
52
|
const comboboxDisabled = useStore(store, selectors.disabled);
|
|
53
53
|
const readOnly = useStore(store, selectors.readOnly);
|
|
54
|
+
const required = useStore(store, selectors.required);
|
|
55
|
+
const mounted = useStore(store, selectors.mounted);
|
|
56
|
+
const popupSideValue = useStore(store, selectors.popupSide);
|
|
57
|
+
const positionerElement = useStore(store, selectors.positionerElement);
|
|
54
58
|
const listElement = useStore(store, selectors.listElement);
|
|
55
59
|
const triggerProps = useStore(store, selectors.triggerProps);
|
|
56
60
|
const triggerElement = useStore(store, selectors.triggerElement);
|
|
57
61
|
const inputInsidePopup = useStore(store, selectors.inputInsidePopup);
|
|
62
|
+
const rootId = useStore(store, selectors.id);
|
|
58
63
|
const open = useStore(store, selectors.open);
|
|
59
64
|
const selectedValue = useStore(store, selectors.selectedValue);
|
|
60
65
|
const activeIndex = useStore(store, selectors.activeIndex);
|
|
61
66
|
const selectedIndex = useStore(store, selectors.selectedIndex);
|
|
67
|
+
const hasSelectedValue = useStore(store, selectors.hasSelectedValue);
|
|
62
68
|
const floatingRootContext = useComboboxFloatingContext();
|
|
63
69
|
const inputValue = useComboboxInputValueContext();
|
|
64
70
|
const focusTimeout = useTimeout();
|
|
65
71
|
const disabled = fieldDisabled || comboboxDisabled || disabledProp;
|
|
72
|
+
const listEmpty = filteredItems.length === 0;
|
|
73
|
+
const popupSide = mounted && positionerElement ? popupSideValue : null;
|
|
74
|
+
useLabelableId({
|
|
75
|
+
id: inputInsidePopup ? idProp : undefined
|
|
76
|
+
});
|
|
77
|
+
const id = inputInsidePopup ? idProp ?? rootId : idProp;
|
|
66
78
|
const currentPointerTypeRef = React.useRef('');
|
|
67
79
|
function trackPointerType(event) {
|
|
68
80
|
currentPointerTypeRef.current = event.pointerType;
|
|
@@ -109,8 +121,11 @@ export const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTr
|
|
|
109
121
|
const state = React.useMemo(() => ({
|
|
110
122
|
...fieldState,
|
|
111
123
|
open,
|
|
112
|
-
disabled
|
|
113
|
-
|
|
124
|
+
disabled,
|
|
125
|
+
popupSide,
|
|
126
|
+
listEmpty,
|
|
127
|
+
placeholder: !hasSelectedValue
|
|
128
|
+
}), [fieldState, open, disabled, popupSide, listEmpty, hasSelectedValue]);
|
|
114
129
|
const setTriggerElement = useStableCallback(element => {
|
|
115
130
|
store.set('triggerElement', element);
|
|
116
131
|
});
|
|
@@ -118,13 +133,14 @@ export const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTr
|
|
|
118
133
|
ref: [forwardedRef, buttonRef, setTriggerElement],
|
|
119
134
|
state,
|
|
120
135
|
props: [triggerProps, triggerClickProps, triggerTypeaheadProps, {
|
|
136
|
+
id,
|
|
121
137
|
tabIndex: inputInsidePopup ? 0 : -1,
|
|
122
|
-
disabled,
|
|
123
138
|
role: inputInsidePopup ? 'combobox' : undefined,
|
|
124
139
|
'aria-expanded': open ? 'true' : 'false',
|
|
125
140
|
'aria-haspopup': inputInsidePopup ? 'dialog' : 'listbox',
|
|
126
141
|
'aria-controls': open ? listElement?.id : undefined,
|
|
127
142
|
'aria-readonly': readOnly || undefined,
|
|
143
|
+
'aria-required': inputInsidePopup ? required || undefined : undefined,
|
|
128
144
|
'aria-labelledby': labelId,
|
|
129
145
|
onPointerDown: trackPointerType,
|
|
130
146
|
onPointerEnter: trackPointerType,
|
|
@@ -135,7 +151,11 @@ export const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTr
|
|
|
135
151
|
}
|
|
136
152
|
focusTimeout.start(0, store.state.forceMount);
|
|
137
153
|
},
|
|
138
|
-
onBlur() {
|
|
154
|
+
onBlur(event) {
|
|
155
|
+
// If focus is moving into the popup, don't count it as a blur.
|
|
156
|
+
if (contains(positionerElement, event.relatedTarget)) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
139
159
|
setTouched(true);
|
|
140
160
|
setFocused(false);
|
|
141
161
|
if (validationMode === 'onBlur') {
|
|
@@ -198,7 +218,7 @@ export const ComboboxTrigger = /*#__PURE__*/React.forwardRef(function ComboboxTr
|
|
|
198
218
|
}
|
|
199
219
|
}
|
|
200
220
|
}, validation ? validation.getValidationProps(elementProps) : elementProps, getButtonProps],
|
|
201
|
-
stateAttributesMapping
|
|
221
|
+
stateAttributesMapping: triggerStateAttributesMapping
|
|
202
222
|
});
|
|
203
223
|
return element;
|
|
204
224
|
});
|
|
@@ -15,6 +15,11 @@ export declare enum ComboboxTriggerDataAttributes {
|
|
|
15
15
|
* Present when the component is readonly.
|
|
16
16
|
*/
|
|
17
17
|
readonly = "data-readonly",
|
|
18
|
+
/**
|
|
19
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
20
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
21
|
+
*/
|
|
22
|
+
popupSide = "data-popup-side",
|
|
18
23
|
/**
|
|
19
24
|
* Present when the component is required.
|
|
20
25
|
*/
|
|
@@ -43,4 +48,12 @@ export declare enum ComboboxTriggerDataAttributes {
|
|
|
43
48
|
* Present when the trigger is focused (when wrapped in Field.Root).
|
|
44
49
|
*/
|
|
45
50
|
focused = "data-focused",
|
|
51
|
+
/**
|
|
52
|
+
* Present when the corresponding items list is empty.
|
|
53
|
+
*/
|
|
54
|
+
listEmpty = "data-list-empty",
|
|
55
|
+
/**
|
|
56
|
+
* Present when the combobox doesn't have a value.
|
|
57
|
+
*/
|
|
58
|
+
placeholder = "data-placeholder",
|
|
46
59
|
}
|
|
@@ -16,6 +16,11 @@ export let ComboboxTriggerDataAttributes = function (ComboboxTriggerDataAttribut
|
|
|
16
16
|
* Present when the component is readonly.
|
|
17
17
|
*/
|
|
18
18
|
ComboboxTriggerDataAttributes["readonly"] = "data-readonly";
|
|
19
|
+
/**
|
|
20
|
+
* Indicates which side the corresponding popup is positioned relative to its anchor.
|
|
21
|
+
* @type {'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start' | null}
|
|
22
|
+
*/
|
|
23
|
+
ComboboxTriggerDataAttributes["popupSide"] = "data-popup-side";
|
|
19
24
|
/**
|
|
20
25
|
* Present when the component is required.
|
|
21
26
|
*/
|
|
@@ -44,5 +49,13 @@ export let ComboboxTriggerDataAttributes = function (ComboboxTriggerDataAttribut
|
|
|
44
49
|
* Present when the trigger is focused (when wrapped in Field.Root).
|
|
45
50
|
*/
|
|
46
51
|
ComboboxTriggerDataAttributes["focused"] = "data-focused";
|
|
52
|
+
/**
|
|
53
|
+
* Present when the corresponding items list is empty.
|
|
54
|
+
*/
|
|
55
|
+
ComboboxTriggerDataAttributes["listEmpty"] = "data-list-empty";
|
|
56
|
+
/**
|
|
57
|
+
* Present when the combobox doesn't have a value.
|
|
58
|
+
*/
|
|
59
|
+
ComboboxTriggerDataAttributes["placeholder"] = "data-placeholder";
|
|
47
60
|
return ComboboxTriggerDataAttributes;
|
|
48
61
|
}({});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Side } from "../../utils/useAnchorPositioning.js";
|
|
2
|
+
export declare const triggerStateAttributesMapping: {
|
|
3
|
+
popupSide: (side: Side | null) => {
|
|
4
|
+
'data-popup-side': Side;
|
|
5
|
+
} | null;
|
|
6
|
+
listEmpty: (empty: boolean) => {
|
|
7
|
+
'data-list-empty': string;
|
|
8
|
+
} | null;
|
|
9
|
+
valid(value: boolean | null): Record<string, string> | null;
|
|
10
|
+
open(value: boolean): {
|
|
11
|
+
"data-popup-open": string;
|
|
12
|
+
"data-pressed": string;
|
|
13
|
+
} | null;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { pressableTriggerOpenStateMapping } from "../../utils/popupStateMapping.js";
|
|
2
|
+
import { fieldValidityMapping } from "../../field/utils/constants.js";
|
|
3
|
+
export const triggerStateAttributesMapping = {
|
|
4
|
+
...pressableTriggerOpenStateMapping,
|
|
5
|
+
...fieldValidityMapping,
|
|
6
|
+
popupSide: side => side ? {
|
|
7
|
+
'data-popup-side': side
|
|
8
|
+
} : null,
|
|
9
|
+
listEmpty: empty => empty ? {
|
|
10
|
+
'data-list-empty': ''
|
|
11
|
+
} : null
|
|
12
|
+
};
|
|
@@ -9,6 +9,11 @@ export declare function ComboboxValue(props: ComboboxValue.Props): React.ReactEl
|
|
|
9
9
|
export interface ComboboxValueState {}
|
|
10
10
|
export interface ComboboxValueProps {
|
|
11
11
|
children?: React.ReactNode | ((selectedValue: any) => React.ReactNode);
|
|
12
|
+
/**
|
|
13
|
+
* The placeholder value to display when no value is selected.
|
|
14
|
+
* This is overridden by `children` if specified, or by a null item's label in `items`.
|
|
15
|
+
*/
|
|
16
|
+
placeholder?: React.ReactNode;
|
|
12
17
|
}
|
|
13
18
|
export declare namespace ComboboxValue {
|
|
14
19
|
type State = ComboboxValueState;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { useStore } from '@base-ui/utils/store';
|
|
5
5
|
import { useComboboxRootContext } from "../root/ComboboxRootContext.js";
|
|
6
|
-
import { resolveSelectedLabel } from "../../utils/resolveValueLabel.js";
|
|
6
|
+
import { resolveMultipleLabels, resolveSelectedLabel } from "../../utils/resolveValueLabel.js";
|
|
7
7
|
import { selectors } from "../store.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -15,21 +15,30 @@ import { selectors } from "../store.js";
|
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
export function ComboboxValue(props) {
|
|
17
17
|
const {
|
|
18
|
-
children: childrenProp
|
|
18
|
+
children: childrenProp,
|
|
19
|
+
placeholder
|
|
19
20
|
} = props;
|
|
20
21
|
const store = useComboboxRootContext();
|
|
21
22
|
const itemToStringLabel = useStore(store, selectors.itemToStringLabel);
|
|
22
23
|
const selectedValue = useStore(store, selectors.selectedValue);
|
|
23
24
|
const items = useStore(store, selectors.items);
|
|
24
|
-
|
|
25
|
+
const multiple = useStore(store, selectors.selectionMode) === 'multiple';
|
|
26
|
+
const hasSelectedValue = useStore(store, selectors.hasSelectedValue);
|
|
27
|
+
const shouldCheckNullItemLabel = !hasSelectedValue && placeholder != null && childrenProp == null;
|
|
28
|
+
const hasNullLabel = useStore(store, selectors.hasNullItemLabel, shouldCheckNullItemLabel);
|
|
29
|
+
let children = null;
|
|
25
30
|
if (typeof childrenProp === 'function') {
|
|
26
|
-
|
|
31
|
+
children = childrenProp(selectedValue);
|
|
27
32
|
} else if (childrenProp != null) {
|
|
28
|
-
|
|
33
|
+
children = childrenProp;
|
|
34
|
+
} else if (!hasSelectedValue && placeholder != null && !hasNullLabel) {
|
|
35
|
+
children = placeholder;
|
|
36
|
+
} else if (multiple && Array.isArray(selectedValue)) {
|
|
37
|
+
children = resolveMultipleLabels(selectedValue, items, itemToStringLabel);
|
|
29
38
|
} else {
|
|
30
|
-
|
|
39
|
+
children = resolveSelectedLabel(selectedValue, items, itemToStringLabel);
|
|
31
40
|
}
|
|
32
41
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
33
|
-
children:
|
|
42
|
+
children: children
|
|
34
43
|
});
|
|
35
44
|
}
|
|
@@ -21,7 +21,7 @@ export interface UseCompositeRootParameters {
|
|
|
21
21
|
enableHomeAndEndKeys?: boolean;
|
|
22
22
|
/**
|
|
23
23
|
* When `true`, keypress events on Composite's navigation keys
|
|
24
|
-
* be stopped with event.stopPropagation()
|
|
24
|
+
* be stopped with event.stopPropagation().
|
|
25
25
|
* @default false
|
|
26
26
|
*/
|
|
27
27
|
stopEventPropagation?: boolean;
|
|
@@ -6,7 +6,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
6
6
|
*
|
|
7
7
|
* Documentation: [Base UI Context Menu](https://base-ui.com/react/components/context-menu)
|
|
8
8
|
*/
|
|
9
|
-
export declare const ContextMenuTrigger: React.ForwardRefExoticComponent<ContextMenuTriggerProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const ContextMenuTrigger: React.ForwardRefExoticComponent<Omit<ContextMenuTriggerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export type ContextMenuTriggerState = {
|
|
11
11
|
/**
|
|
12
12
|
* Whether the context menu is currently open.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface CSPContextValue {
|
|
3
|
+
nonce?: string;
|
|
4
|
+
disableStyleElements?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const CSPContext: React.Context<CSPContextValue | undefined>;
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function useCSPContext(): CSPContextValue;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export const CSPContext = /*#__PURE__*/React.createContext(undefined);
|
|
8
|
+
if (process.env.NODE_ENV !== "production") CSPContext.displayName = "CSPContext";
|
|
9
|
+
const DEFAULT_CSP_CONTEXT_VALUE = {
|
|
10
|
+
disableStyleElements: false
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export function useCSPContext() {
|
|
17
|
+
return React.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Provides a default Content Security Policy (CSP) configuration for Base UI components that
|
|
4
|
+
* require inline `<style>` or `<script>` tags.
|
|
5
|
+
*
|
|
6
|
+
* Documentation: [Base UI CSP Provider](https://base-ui.com/react/utils/csp-provider)
|
|
7
|
+
*/
|
|
8
|
+
export declare function CSPProvider(props: CSPProvider.Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface CSPProviderState {}
|
|
10
|
+
export interface CSPProviderProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* The nonce value to apply to inline `<style>` and `<script>` tags.
|
|
14
|
+
*/
|
|
15
|
+
nonce?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether inline `<style>` elements created by Base UI components should not be rendered. Instead, components must specify the CSS styles via custom class names or other methods.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
disableStyleElements?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace CSPProvider {
|
|
23
|
+
type State = CSPProviderState;
|
|
24
|
+
type Props = CSPProviderProps;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { CSPContext } from "./CSPContext.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Provides a default Content Security Policy (CSP) configuration for Base UI components that
|
|
8
|
+
* require inline `<style>` or `<script>` tags.
|
|
9
|
+
*
|
|
10
|
+
* Documentation: [Base UI CSP Provider](https://base-ui.com/react/utils/csp-provider)
|
|
11
|
+
*/
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export function CSPProvider(props) {
|
|
14
|
+
const {
|
|
15
|
+
children,
|
|
16
|
+
nonce,
|
|
17
|
+
disableStyleElements
|
|
18
|
+
} = props;
|
|
19
|
+
const contextValue = React.useMemo(() => ({
|
|
20
|
+
nonce,
|
|
21
|
+
disableStyleElements
|
|
22
|
+
}), [nonce, disableStyleElements]);
|
|
23
|
+
return /*#__PURE__*/_jsx(CSPContext.Provider, {
|
|
24
|
+
value: contextValue,
|
|
25
|
+
children: children
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CSPProvider } from "./index.parts.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CSPProvider } from "./CSPProvider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CSPProvider } from "./CSPProvider.js";
|
|
@@ -7,7 +7,7 @@ import { type BaseUIComponentProps } from "../../utils/types.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
9
9
|
*/
|
|
10
|
-
export declare const DialogBackdrop: React.ForwardRefExoticComponent<DialogBackdropProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const DialogBackdrop: React.ForwardRefExoticComponent<Omit<DialogBackdropProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export interface DialogBackdropProps extends BaseUIComponentProps<'div', DialogBackdrop.State> {
|
|
12
12
|
/**
|
|
13
13
|
* Whether the backdrop is forced to render even when nested.
|
|
@@ -6,7 +6,7 @@ import type { BaseUIComponentProps, NativeButtonProps } from "../../utils/types.
|
|
|
6
6
|
*
|
|
7
7
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
8
8
|
*/
|
|
9
|
-
export declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export declare const DialogClose: React.ForwardRefExoticComponent<Omit<DialogCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
export interface DialogCloseProps extends NativeButtonProps, BaseUIComponentProps<'button', DialogClose.State> {}
|
|
11
11
|
export interface DialogCloseState {
|
|
12
12
|
/**
|
|
@@ -6,7 +6,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
6
6
|
*
|
|
7
7
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
8
8
|
*/
|
|
9
|
-
export declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
9
|
+
export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
10
10
|
export interface DialogDescriptionProps extends BaseUIComponentProps<'p', DialogDescription.State> {}
|
|
11
11
|
export interface DialogDescriptionState {}
|
|
12
12
|
export declare namespace DialogDescription {
|
|
@@ -8,7 +8,7 @@ import { type TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
8
8
|
*
|
|
9
9
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
10
10
|
*/
|
|
11
|
-
export declare const DialogPopup: React.ForwardRefExoticComponent<DialogPopupProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const DialogPopup: React.ForwardRefExoticComponent<Omit<DialogPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export interface DialogPopupProps extends BaseUIComponentProps<'div', DialogPopup.State> {
|
|
13
13
|
/**
|
|
14
14
|
* Determines the element to focus when the dialog is opened.
|
|
@@ -7,7 +7,7 @@ import { FloatingPortal } from "../../floating-ui-react/index.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
9
9
|
*/
|
|
10
|
-
export declare const DialogPortal: React.ForwardRefExoticComponent<DialogPortalProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const DialogPortal: React.ForwardRefExoticComponent<Omit<DialogPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export declare namespace DialogPortal {
|
|
12
12
|
interface State {}
|
|
13
13
|
}
|
|
@@ -25,6 +25,7 @@ export const DialogPortal = /*#__PURE__*/React.forwardRef(function DialogPortal(
|
|
|
25
25
|
} = useDialogRootContext();
|
|
26
26
|
const mounted = store.useState('mounted');
|
|
27
27
|
const modal = store.useState('modal');
|
|
28
|
+
const open = store.useState('open');
|
|
28
29
|
const shouldRender = mounted || keepMounted;
|
|
29
30
|
if (!shouldRender) {
|
|
30
31
|
return null;
|
|
@@ -50,10 +50,10 @@ export interface DialogRootProps<Payload = unknown> {
|
|
|
50
50
|
* Useful when the dialog's animation is controlled by an external library.
|
|
51
51
|
* - `close`: Closes the dialog imperatively when called.
|
|
52
52
|
*/
|
|
53
|
-
actionsRef?: React.RefObject<DialogRoot.Actions>;
|
|
53
|
+
actionsRef?: React.RefObject<DialogRoot.Actions | null>;
|
|
54
54
|
/**
|
|
55
|
-
* A handle to associate the
|
|
56
|
-
* If specified, allows external triggers to control the
|
|
55
|
+
* A handle to associate the dialog with a trigger.
|
|
56
|
+
* If specified, allows external triggers to control the dialog's open state.
|
|
57
57
|
* Can be created with the Dialog.createHandle() method.
|
|
58
58
|
*/
|
|
59
59
|
handle?: DialogHandle<Payload>;
|
|
@@ -64,7 +64,7 @@ export interface DialogRootProps<Payload = unknown> {
|
|
|
64
64
|
children?: React.ReactNode | PayloadChildRenderFunction<Payload>;
|
|
65
65
|
/**
|
|
66
66
|
* ID of the trigger that the dialog is associated with.
|
|
67
|
-
* This is useful in
|
|
67
|
+
* This is useful in conjunction with the `open` prop to create a controlled dialog.
|
|
68
68
|
* There's no need to specify this prop when the popover is uncontrolled (i.e. when the `open` prop is not set).
|
|
69
69
|
*/
|
|
70
70
|
triggerId?: string | null;
|
|
@@ -42,8 +42,8 @@ declare const selectors: {
|
|
|
42
42
|
isTriggerActive: (state: PopupStoreState<unknown>, triggerId: string | undefined) => boolean;
|
|
43
43
|
isOpenedByTrigger: (state: PopupStoreState<unknown>, triggerId: string | undefined) => boolean;
|
|
44
44
|
isMountedByTrigger: (state: PopupStoreState<unknown>, triggerId: string | undefined) => boolean;
|
|
45
|
-
triggerProps: (state: PopupStoreState<unknown>, isActive: boolean) => import("../../
|
|
46
|
-
popupProps: (state: PopupStoreState<unknown>) => import("../../
|
|
45
|
+
triggerProps: (state: PopupStoreState<unknown>, isActive: boolean) => import("../../index.js").HTMLProps;
|
|
46
|
+
popupProps: (state: PopupStoreState<unknown>) => import("../../index.js").HTMLProps;
|
|
47
47
|
popupElement: (state: PopupStoreState<unknown>) => HTMLElement | null;
|
|
48
48
|
positionerElement: (state: PopupStoreState<unknown>) => HTMLElement | null;
|
|
49
49
|
};
|
|
@@ -6,7 +6,7 @@ import { type BaseUIComponentProps } from "../../utils/types.js";
|
|
|
6
6
|
*
|
|
7
7
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
8
8
|
*/
|
|
9
|
-
export declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<
|
|
9
|
+
export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogTitleProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
10
10
|
export interface DialogTitleProps extends BaseUIComponentProps<'h2', DialogTitle.State> {}
|
|
11
11
|
export interface DialogTitleState {}
|
|
12
12
|
export declare namespace DialogTitle {
|
|
@@ -7,7 +7,7 @@ import { type TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
9
9
|
*/
|
|
10
|
-
export declare const DialogViewport: React.ForwardRefExoticComponent<DialogViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const DialogViewport: React.ForwardRefExoticComponent<Omit<DialogViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export interface DialogViewportState {
|
|
12
12
|
/**
|
|
13
13
|
* Whether the dialog is currently open.
|
|
@@ -13,7 +13,7 @@ import type { BaseUIChangeEventDetails } from "../../utils/createBaseUIEventDeta
|
|
|
13
13
|
*
|
|
14
14
|
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
15
15
|
*/
|
|
16
|
-
export declare const FieldControl: React.ForwardRefExoticComponent<FieldControlProps & React.RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export declare const FieldControl: React.ForwardRefExoticComponent<Omit<FieldControlProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
17
|
export type FieldControlState = FieldRoot.State;
|
|
18
18
|
export interface FieldControlProps extends BaseUIComponentProps<'input', FieldControl.State> {
|
|
19
19
|
/**
|
|
@@ -7,7 +7,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
9
9
|
*/
|
|
10
|
-
export declare const FieldDescription: React.ForwardRefExoticComponent<FieldDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
10
|
+
export declare const FieldDescription: React.ForwardRefExoticComponent<Omit<FieldDescriptionProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
11
11
|
export type FieldDescriptionState = FieldRoot.State;
|
|
12
12
|
export interface FieldDescriptionProps extends BaseUIComponentProps<'p', FieldDescription.State> {}
|
|
13
13
|
export declare namespace FieldDescription {
|
|
@@ -7,7 +7,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
9
9
|
*/
|
|
10
|
-
export declare const FieldError: React.ForwardRefExoticComponent<FieldErrorProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const FieldError: React.ForwardRefExoticComponent<Omit<FieldErrorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export type FieldErrorState = FieldRoot.State;
|
|
12
12
|
export interface FieldErrorProps extends BaseUIComponentProps<'div', FieldError.State> {
|
|
13
13
|
/**
|
package/esm/field/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export type * from "./label/FieldLabel.js";
|
|
|
4
4
|
export type * from "./description/FieldDescription.js";
|
|
5
5
|
export type * from "./error/FieldError.js";
|
|
6
6
|
export type * from "./control/FieldControl.js";
|
|
7
|
-
export type * from "./validity/FieldValidity.js";
|
|
7
|
+
export type * from "./validity/FieldValidity.js";
|
|
8
|
+
export type * from "./item/FieldItem.js";
|
|
@@ -7,7 +7,7 @@ import type { BaseUIComponentProps } from "../../utils/types.js";
|
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
9
9
|
*/
|
|
10
|
-
export declare const FieldItem: React.ForwardRefExoticComponent<FieldItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const FieldItem: React.ForwardRefExoticComponent<Omit<FieldItemProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
export interface FieldItemProps extends BaseUIComponentProps<'div', FieldItem.State> {
|
|
12
12
|
/**
|
|
13
13
|
* Whether the wrapped control should ignore user interaction.
|