@base-ui/react 1.3.0 → 1.4.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 +131 -0
- package/accordion/header/AccordionHeader.js +1 -0
- package/accordion/item/AccordionItem.js +1 -0
- package/accordion/panel/AccordionPanel.js +2 -1
- package/accordion/root/AccordionRoot.d.ts +1 -1
- package/accordion/root/AccordionRoot.js +1 -0
- package/accordion/trigger/AccordionTrigger.js +2 -1
- package/alert-dialog/index.d.ts +9 -1
- package/alert-dialog/root/AlertDialogRoot.d.ts +1 -1
- package/alert-dialog/root/AlertDialogRoot.js +22 -20
- package/autocomplete/clear/AutocompleteClearDataAttributes.d.ts +1 -0
- package/autocomplete/clear/AutocompleteClearDataAttributes.js +12 -0
- package/autocomplete/index.d.ts +8 -5
- package/autocomplete/index.parts.d.ts +3 -3
- package/autocomplete/index.parts.js +6 -6
- package/autocomplete/input-group/AutocompleteInputGroup.d.ts +41 -0
- package/autocomplete/input-group/AutocompleteInputGroup.js +15 -0
- package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.d.ts +51 -0
- package/autocomplete/input-group/AutocompleteInputGroupDataAttributes.js +58 -0
- package/autocomplete/item/AutocompleteItem.d.ts +48 -0
- package/autocomplete/item/AutocompleteItem.js +15 -0
- package/autocomplete/item/AutocompleteItemDataAttributes.d.ts +10 -0
- package/autocomplete/item/AutocompleteItemDataAttributes.js +18 -0
- package/autocomplete/trigger/AutocompleteTrigger.d.ts +43 -0
- package/autocomplete/trigger/AutocompleteTrigger.js +15 -0
- package/autocomplete/trigger/AutocompleteTriggerDataAttributes.d.ts +55 -0
- package/autocomplete/trigger/AutocompleteTriggerDataAttributes.js +63 -0
- package/avatar/fallback/AvatarFallback.js +1 -0
- package/avatar/image/AvatarImage.js +1 -0
- package/avatar/image/useImageLoadingStatus.js +5 -0
- package/avatar/root/AvatarRoot.js +1 -0
- package/button/Button.js +1 -0
- package/calendar/day-button/CalendarDayButton.d.ts +47 -0
- package/calendar/day-button/CalendarDayButton.js +130 -0
- package/calendar/day-button/CalendarDayButtonDataAttributes.d.ts +22 -0
- package/calendar/day-button/CalendarDayButtonDataAttributes.js +29 -0
- package/calendar/day-grid/CalendarDayGrid.d.ts +15 -0
- package/calendar/day-grid/CalendarDayGrid.js +32 -0
- package/calendar/day-grid-body/CalendarDayGridBody.d.ts +16 -0
- package/calendar/day-grid-body/CalendarDayGridBody.js +53 -0
- package/calendar/day-grid-body/SharedCalendarDayGridBodyContext.d.ts +14 -0
- package/calendar/day-grid-body/SharedCalendarDayGridBodyContext.js +21 -0
- package/calendar/day-grid-body/useSharedCalendarDayGridBody.d.ts +45 -0
- package/calendar/day-grid-body/useSharedCalendarDayGridBody.js +285 -0
- package/calendar/day-grid-cell/CalendarDayGridCell.d.ts +16 -0
- package/calendar/day-grid-cell/CalendarDayGridCell.js +46 -0
- package/calendar/day-grid-cell/SharedCalendarDayGridCellContext.d.ts +22 -0
- package/calendar/day-grid-cell/SharedCalendarDayGridCellContext.js +21 -0
- package/calendar/day-grid-cell/useSharedCalendarDayGridCell.d.ts +17 -0
- package/calendar/day-grid-cell/useSharedCalendarDayGridCell.js +40 -0
- package/calendar/day-grid-header/CalendarDayGridHeader.d.ts +15 -0
- package/calendar/day-grid-header/CalendarDayGridHeader.js +32 -0
- package/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.d.ts +25 -0
- package/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.js +41 -0
- package/calendar/day-grid-header-row/CalendarDayGridHeaderRow.d.ts +22 -0
- package/calendar/day-grid-header-row/CalendarDayGridHeaderRow.js +47 -0
- package/calendar/day-grid-row/CalendarDayGridRow.d.ts +26 -0
- package/calendar/day-grid-row/CalendarDayGridRow.js +46 -0
- package/calendar/decrement-month/CalendarDecrementMonth.d.ts +20 -0
- package/calendar/decrement-month/CalendarDecrementMonth.js +80 -0
- package/calendar/decrement-month/CalendarDecrementMonthDataAttributes.d.ts +6 -0
- package/calendar/decrement-month/CalendarDecrementMonthDataAttributes.js +13 -0
- package/calendar/increment-month/CalendarIncrementMonth.d.ts +20 -0
- package/calendar/increment-month/CalendarIncrementMonth.js +79 -0
- package/calendar/increment-month/CalendarIncrementMonthDataAttributes.d.ts +6 -0
- package/calendar/increment-month/CalendarIncrementMonthDataAttributes.js +13 -0
- package/calendar/index.d.ts +14 -0
- package/calendar/index.js +9 -0
- package/calendar/index.parts.d.ts +15 -0
- package/calendar/index.parts.js +110 -0
- package/calendar/root/CalendarRoot.d.ts +36 -0
- package/calendar/root/CalendarRoot.js +147 -0
- package/calendar/root/CalendarRootDataAttributes.d.ts +23 -0
- package/calendar/root/CalendarRootDataAttributes.js +30 -0
- package/calendar/root/SharedCalendarRootContext.d.ts +5 -0
- package/calendar/root/SharedCalendarRootContext.js +21 -0
- package/calendar/store/SharedCalendarState.d.ts +78 -0
- package/calendar/store/SharedCalendarState.js +5 -0
- package/calendar/store/SharedCalendarStore.d.ts +144 -0
- package/calendar/store/SharedCalendarStore.js +144 -0
- package/calendar/store/index.d.ts +3 -0
- package/calendar/store/index.js +38 -0
- package/calendar/store/selectors.d.ts +104 -0
- package/calendar/store/selectors.js +198 -0
- package/calendar/use-context/CalendarContext.d.ts +6 -0
- package/calendar/use-context/CalendarContext.js +20 -0
- package/calendar/use-day-list/getDayList.d.ts +9 -0
- package/calendar/use-day-list/getDayList.js +40 -0
- package/calendar/use-day-list/useCalendarDayList.d.ts +12 -0
- package/calendar/use-day-list/useCalendarDayList.js +14 -0
- package/calendar/use-week-list/getWeekList.d.ts +9 -0
- package/calendar/use-week-list/getWeekList.js +40 -0
- package/calendar/use-week-list/useCalendarWeekList.d.ts +17 -0
- package/calendar/use-week-list/useCalendarWeekList.js +14 -0
- package/calendar/utils/computeMonthDayGrid.d.ts +6 -0
- package/calendar/utils/computeMonthDayGrid.js +22 -0
- package/calendar/utils/useCalendarMonthButton.d.ts +31 -0
- package/calendar/utils/useCalendarMonthButton.js +53 -0
- package/calendar/viewport/CalendarViewport.d.ts +30 -0
- package/calendar/viewport/CalendarViewport.js +171 -0
- package/calendar/viewport/CalendarViewportDataAttributes.d.ts +23 -0
- package/calendar/viewport/CalendarViewportDataAttributes.js +31 -0
- package/checkbox/indicator/CheckboxIndicator.js +1 -0
- package/checkbox/root/CheckboxRoot.d.ts +5 -0
- package/checkbox/root/CheckboxRoot.js +15 -10
- package/checkbox-group/CheckboxGroup.js +13 -10
- package/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/collapsible/panel/CollapsiblePanel.js +2 -1
- package/collapsible/panel/useCollapsiblePanel.d.ts +4 -2
- package/collapsible/panel/useCollapsiblePanel.js +2 -4
- package/collapsible/root/CollapsibleRoot.js +1 -0
- package/collapsible/root/useCollapsibleRoot.d.ts +4 -2
- package/collapsible/root/useCollapsibleRoot.js +5 -4
- package/collapsible/trigger/CollapsibleTrigger.js +1 -0
- package/combobox/arrow/ComboboxArrow.d.ts +2 -0
- package/combobox/arrow/ComboboxArrow.js +3 -0
- package/combobox/backdrop/ComboboxBackdrop.d.ts +2 -0
- package/combobox/backdrop/ComboboxBackdrop.js +3 -0
- package/combobox/chip/ComboboxChip.d.ts +2 -0
- package/combobox/chip/ComboboxChip.js +4 -11
- package/combobox/chip-remove/ComboboxChipRemove.d.ts +2 -0
- package/combobox/chip-remove/ComboboxChipRemove.js +6 -0
- package/combobox/chips/ComboboxChips.d.ts +3 -1
- package/combobox/chips/ComboboxChips.js +9 -1
- package/combobox/clear/ComboboxClear.d.ts +2 -0
- package/combobox/clear/ComboboxClear.js +3 -0
- package/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/combobox/collection/ComboboxCollection.js +2 -0
- package/combobox/empty/ComboboxEmpty.d.ts +6 -0
- package/combobox/empty/ComboboxEmpty.js +10 -1
- package/combobox/group/ComboboxGroup.d.ts +2 -0
- package/combobox/group/ComboboxGroup.js +3 -0
- package/combobox/group-label/ComboboxGroupLabel.d.ts +2 -0
- package/combobox/group-label/ComboboxGroupLabel.js +3 -0
- package/combobox/icon/ComboboxIcon.d.ts +2 -0
- package/combobox/icon/ComboboxIcon.js +3 -0
- package/combobox/input/ComboboxInput.d.ts +2 -0
- package/combobox/input/ComboboxInput.js +11 -4
- package/combobox/input-group/ComboboxInputGroup.d.ts +3 -1
- package/combobox/input-group/ComboboxInputGroup.js +13 -4
- package/combobox/item/ComboboxItem.d.ts +2 -0
- package/combobox/item/ComboboxItem.js +8 -0
- package/combobox/item-indicator/ComboboxItemIndicator.d.ts +2 -0
- package/combobox/item-indicator/ComboboxItemIndicator.js +3 -0
- package/combobox/label/ComboboxLabel.js +1 -0
- package/combobox/list/ComboboxList.d.ts +2 -0
- package/combobox/list/ComboboxList.js +8 -9
- package/combobox/popup/ComboboxPopup.d.ts +2 -0
- package/combobox/popup/ComboboxPopup.js +3 -0
- package/combobox/portal/ComboboxPortal.d.ts +2 -0
- package/combobox/portal/ComboboxPortal.js +2 -0
- package/combobox/positioner/ComboboxPositioner.d.ts +2 -0
- package/combobox/positioner/ComboboxPositioner.js +15 -33
- package/combobox/positioner/ComboboxPositionerContext.d.ts +2 -10
- package/combobox/root/AriaCombobox.d.ts +5 -0
- package/combobox/root/AriaCombobox.js +33 -20
- package/combobox/root/utils/useFilter.d.ts +9 -0
- package/combobox/row/ComboboxRow.d.ts +2 -0
- package/combobox/row/ComboboxRow.js +3 -0
- package/combobox/status/ComboboxStatus.d.ts +6 -0
- package/combobox/status/ComboboxStatus.js +12 -1
- package/combobox/store.d.ts +2 -14
- package/combobox/store.js +1 -14
- package/combobox/trigger/ComboboxTrigger.d.ts +2 -0
- package/combobox/trigger/ComboboxTrigger.js +4 -1
- package/combobox/utils/handleInputPress.d.ts +5 -0
- package/combobox/utils/handleInputPress.js +28 -0
- package/combobox/utils/useInitialLiveRegionTextMutation.d.ts +3 -0
- package/combobox/utils/useInitialLiveRegionTextMutation.js +61 -0
- package/composite/composite.d.ts +2 -0
- package/composite/composite.js +3 -1
- package/composite/item/CompositeItem.d.ts +1 -1
- package/composite/item/CompositeItem.js +1 -0
- package/composite/root/CompositeRoot.d.ts +4 -2
- package/composite/root/CompositeRoot.js +3 -0
- package/composite/root/useCompositeRoot.d.ts +1 -0
- package/composite/root/useCompositeRoot.js +30 -15
- package/context-menu/index.d.ts +1 -1
- package/context-menu/root/ContextMenuRoot.d.ts +3 -1
- package/context-menu/root/ContextMenuRoot.js +1 -1
- package/context-menu/trigger/ContextMenuTrigger.js +4 -5
- package/dialog/backdrop/DialogBackdrop.js +1 -0
- package/dialog/close/DialogClose.js +1 -0
- package/dialog/description/DialogDescription.js +1 -0
- package/dialog/popup/DialogPopup.js +1 -0
- package/dialog/root/DialogRoot.d.ts +3 -2
- package/dialog/root/DialogRoot.js +24 -18
- package/dialog/root/useDialogRoot.d.ts +1 -0
- package/dialog/root/useDialogRoot.js +13 -9
- package/dialog/store/DialogStore.d.ts +4 -1
- package/dialog/store/DialogStore.js +11 -7
- package/dialog/title/DialogTitle.js +1 -0
- package/dialog/trigger/DialogTrigger.js +1 -0
- package/dialog/viewport/DialogViewport.js +1 -0
- package/drawer/backdrop/DrawerBackdrop.js +1 -0
- package/drawer/content/DrawerContent.js +1 -0
- package/drawer/indent/DrawerIndent.js +1 -0
- package/drawer/indent-background/DrawerIndentBackground.js +1 -0
- package/drawer/popup/DrawerPopup.js +17 -3
- package/drawer/root/DrawerRoot.d.ts +1 -1
- package/drawer/root/DrawerRoot.js +19 -14
- package/drawer/root/DrawerRootContext.d.ts +4 -4
- package/drawer/swipe-area/DrawerSwipeArea.js +17 -12
- package/drawer/viewport/DrawerViewport.js +34 -22
- package/esm/accordion/header/AccordionHeader.js +1 -0
- package/esm/accordion/item/AccordionItem.js +1 -0
- package/esm/accordion/panel/AccordionPanel.js +2 -1
- package/esm/accordion/root/AccordionRoot.d.ts +1 -1
- package/esm/accordion/root/AccordionRoot.js +1 -0
- package/esm/accordion/trigger/AccordionTrigger.js +2 -1
- package/esm/alert-dialog/index.d.ts +9 -1
- package/esm/alert-dialog/root/AlertDialogRoot.d.ts +1 -1
- package/esm/alert-dialog/root/AlertDialogRoot.js +22 -20
- package/esm/autocomplete/clear/AutocompleteClearDataAttributes.d.ts +1 -0
- package/esm/autocomplete/clear/AutocompleteClearDataAttributes.js +1 -0
- package/esm/autocomplete/index.d.ts +8 -5
- package/esm/autocomplete/index.parts.d.ts +3 -3
- package/esm/autocomplete/index.parts.js +3 -3
- package/esm/autocomplete/input-group/AutocompleteInputGroup.d.ts +41 -0
- package/esm/autocomplete/input-group/AutocompleteInputGroup.js +10 -0
- package/esm/autocomplete/input-group/AutocompleteInputGroupDataAttributes.d.ts +51 -0
- package/esm/autocomplete/input-group/AutocompleteInputGroupDataAttributes.js +52 -0
- package/esm/autocomplete/item/AutocompleteItem.d.ts +48 -0
- package/esm/autocomplete/item/AutocompleteItem.js +10 -0
- package/esm/autocomplete/item/AutocompleteItemDataAttributes.d.ts +10 -0
- package/esm/autocomplete/item/AutocompleteItemDataAttributes.js +12 -0
- package/esm/autocomplete/trigger/AutocompleteTrigger.d.ts +43 -0
- package/esm/autocomplete/trigger/AutocompleteTrigger.js +10 -0
- package/esm/autocomplete/trigger/AutocompleteTriggerDataAttributes.d.ts +55 -0
- package/esm/autocomplete/trigger/AutocompleteTriggerDataAttributes.js +57 -0
- package/esm/avatar/fallback/AvatarFallback.js +1 -0
- package/esm/avatar/image/AvatarImage.js +1 -0
- package/esm/avatar/image/useImageLoadingStatus.js +5 -0
- package/esm/avatar/root/AvatarRoot.js +1 -0
- package/esm/button/Button.js +1 -0
- package/esm/calendar/day-button/CalendarDayButton.d.ts +47 -0
- package/esm/calendar/day-button/CalendarDayButton.js +124 -0
- package/esm/calendar/day-button/CalendarDayButtonDataAttributes.d.ts +22 -0
- package/esm/calendar/day-button/CalendarDayButtonDataAttributes.js +23 -0
- package/esm/calendar/day-grid/CalendarDayGrid.d.ts +15 -0
- package/esm/calendar/day-grid/CalendarDayGrid.js +27 -0
- package/esm/calendar/day-grid-body/CalendarDayGridBody.d.ts +16 -0
- package/esm/calendar/day-grid-body/CalendarDayGridBody.js +48 -0
- package/esm/calendar/day-grid-body/SharedCalendarDayGridBodyContext.d.ts +14 -0
- package/esm/calendar/day-grid-body/SharedCalendarDayGridBodyContext.js +13 -0
- package/esm/calendar/day-grid-body/useSharedCalendarDayGridBody.d.ts +45 -0
- package/esm/calendar/day-grid-body/useSharedCalendarDayGridBody.js +279 -0
- package/esm/calendar/day-grid-cell/CalendarDayGridCell.d.ts +16 -0
- package/esm/calendar/day-grid-cell/CalendarDayGridCell.js +40 -0
- package/esm/calendar/day-grid-cell/SharedCalendarDayGridCellContext.d.ts +22 -0
- package/esm/calendar/day-grid-cell/SharedCalendarDayGridCellContext.js +13 -0
- package/esm/calendar/day-grid-cell/useSharedCalendarDayGridCell.d.ts +17 -0
- package/esm/calendar/day-grid-cell/useSharedCalendarDayGridCell.js +33 -0
- package/esm/calendar/day-grid-header/CalendarDayGridHeader.d.ts +15 -0
- package/esm/calendar/day-grid-header/CalendarDayGridHeader.js +27 -0
- package/esm/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.d.ts +25 -0
- package/esm/calendar/day-grid-header-cell/CalendarDayGridHeaderCell.js +35 -0
- package/esm/calendar/day-grid-header-row/CalendarDayGridHeaderRow.d.ts +22 -0
- package/esm/calendar/day-grid-header-row/CalendarDayGridHeaderRow.js +42 -0
- package/esm/calendar/day-grid-row/CalendarDayGridRow.d.ts +26 -0
- package/esm/calendar/day-grid-row/CalendarDayGridRow.js +41 -0
- package/esm/calendar/decrement-month/CalendarDecrementMonth.d.ts +20 -0
- package/esm/calendar/decrement-month/CalendarDecrementMonth.js +75 -0
- package/esm/calendar/decrement-month/CalendarDecrementMonthDataAttributes.d.ts +6 -0
- package/esm/calendar/decrement-month/CalendarDecrementMonthDataAttributes.js +7 -0
- package/esm/calendar/increment-month/CalendarIncrementMonth.d.ts +20 -0
- package/esm/calendar/increment-month/CalendarIncrementMonth.js +74 -0
- package/esm/calendar/increment-month/CalendarIncrementMonthDataAttributes.d.ts +6 -0
- package/esm/calendar/increment-month/CalendarIncrementMonthDataAttributes.js +7 -0
- package/esm/calendar/index.d.ts +14 -0
- package/esm/calendar/index.js +1 -0
- package/esm/calendar/index.parts.d.ts +15 -0
- package/esm/calendar/index.parts.js +21 -0
- package/esm/calendar/root/CalendarRoot.d.ts +36 -0
- package/esm/calendar/root/CalendarRoot.js +141 -0
- package/esm/calendar/root/CalendarRootDataAttributes.d.ts +23 -0
- package/esm/calendar/root/CalendarRootDataAttributes.js +24 -0
- package/esm/calendar/root/SharedCalendarRootContext.d.ts +5 -0
- package/esm/calendar/root/SharedCalendarRootContext.js +13 -0
- package/esm/calendar/store/SharedCalendarState.d.ts +78 -0
- package/esm/calendar/store/SharedCalendarState.js +1 -0
- package/esm/calendar/store/SharedCalendarStore.d.ts +144 -0
- package/esm/calendar/store/SharedCalendarStore.js +137 -0
- package/esm/calendar/store/index.d.ts +3 -0
- package/esm/calendar/store/index.js +3 -0
- package/esm/calendar/store/selectors.d.ts +104 -0
- package/esm/calendar/store/selectors.js +192 -0
- package/esm/calendar/use-context/CalendarContext.d.ts +6 -0
- package/esm/calendar/use-context/CalendarContext.js +14 -0
- package/esm/calendar/use-day-list/getDayList.d.ts +9 -0
- package/esm/calendar/use-day-list/getDayList.js +34 -0
- package/esm/calendar/use-day-list/useCalendarDayList.d.ts +12 -0
- package/esm/calendar/use-day-list/useCalendarDayList.js +7 -0
- package/esm/calendar/use-week-list/getWeekList.d.ts +9 -0
- package/esm/calendar/use-week-list/getWeekList.js +34 -0
- package/esm/calendar/use-week-list/useCalendarWeekList.d.ts +17 -0
- package/esm/calendar/use-week-list/useCalendarWeekList.js +7 -0
- package/esm/calendar/utils/computeMonthDayGrid.d.ts +6 -0
- package/esm/calendar/utils/computeMonthDayGrid.js +17 -0
- package/esm/calendar/utils/useCalendarMonthButton.d.ts +31 -0
- package/esm/calendar/utils/useCalendarMonthButton.js +47 -0
- package/esm/calendar/viewport/CalendarViewport.d.ts +30 -0
- package/esm/calendar/viewport/CalendarViewport.js +165 -0
- package/esm/calendar/viewport/CalendarViewportDataAttributes.d.ts +23 -0
- package/esm/calendar/viewport/CalendarViewportDataAttributes.js +25 -0
- package/esm/checkbox/indicator/CheckboxIndicator.js +1 -0
- package/esm/checkbox/root/CheckboxRoot.d.ts +5 -0
- package/esm/checkbox/root/CheckboxRoot.js +15 -10
- package/esm/checkbox-group/CheckboxGroup.js +13 -10
- package/esm/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/esm/collapsible/panel/CollapsiblePanel.js +2 -1
- package/esm/collapsible/panel/useCollapsiblePanel.d.ts +4 -2
- package/esm/collapsible/panel/useCollapsiblePanel.js +2 -4
- package/esm/collapsible/root/CollapsibleRoot.js +1 -0
- package/esm/collapsible/root/useCollapsibleRoot.d.ts +4 -2
- package/esm/collapsible/root/useCollapsibleRoot.js +5 -4
- package/esm/collapsible/trigger/CollapsibleTrigger.js +1 -0
- package/esm/combobox/arrow/ComboboxArrow.d.ts +2 -0
- package/esm/combobox/arrow/ComboboxArrow.js +3 -0
- package/esm/combobox/backdrop/ComboboxBackdrop.d.ts +2 -0
- package/esm/combobox/backdrop/ComboboxBackdrop.js +3 -0
- package/esm/combobox/chip/ComboboxChip.d.ts +2 -0
- package/esm/combobox/chip/ComboboxChip.js +4 -11
- package/esm/combobox/chip-remove/ComboboxChipRemove.d.ts +2 -0
- package/esm/combobox/chip-remove/ComboboxChipRemove.js +6 -0
- package/esm/combobox/chips/ComboboxChips.d.ts +3 -1
- package/esm/combobox/chips/ComboboxChips.js +9 -1
- package/esm/combobox/clear/ComboboxClear.d.ts +2 -0
- package/esm/combobox/clear/ComboboxClear.js +3 -0
- package/esm/combobox/collection/ComboboxCollection.d.ts +2 -0
- package/esm/combobox/collection/ComboboxCollection.js +2 -0
- package/esm/combobox/empty/ComboboxEmpty.d.ts +6 -0
- package/esm/combobox/empty/ComboboxEmpty.js +10 -1
- package/esm/combobox/group/ComboboxGroup.d.ts +2 -0
- package/esm/combobox/group/ComboboxGroup.js +3 -0
- package/esm/combobox/group-label/ComboboxGroupLabel.d.ts +2 -0
- package/esm/combobox/group-label/ComboboxGroupLabel.js +3 -0
- package/esm/combobox/icon/ComboboxIcon.d.ts +2 -0
- package/esm/combobox/icon/ComboboxIcon.js +3 -0
- package/esm/combobox/input/ComboboxInput.d.ts +2 -0
- package/esm/combobox/input/ComboboxInput.js +11 -4
- package/esm/combobox/input-group/ComboboxInputGroup.d.ts +3 -1
- package/esm/combobox/input-group/ComboboxInputGroup.js +13 -4
- package/esm/combobox/item/ComboboxItem.d.ts +2 -0
- package/esm/combobox/item/ComboboxItem.js +8 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicator.d.ts +2 -0
- package/esm/combobox/item-indicator/ComboboxItemIndicator.js +3 -0
- package/esm/combobox/label/ComboboxLabel.js +1 -0
- package/esm/combobox/list/ComboboxList.d.ts +2 -0
- package/esm/combobox/list/ComboboxList.js +8 -9
- package/esm/combobox/popup/ComboboxPopup.d.ts +2 -0
- package/esm/combobox/popup/ComboboxPopup.js +3 -0
- package/esm/combobox/portal/ComboboxPortal.d.ts +2 -0
- package/esm/combobox/portal/ComboboxPortal.js +2 -0
- package/esm/combobox/positioner/ComboboxPositioner.d.ts +2 -0
- package/esm/combobox/positioner/ComboboxPositioner.js +15 -33
- package/esm/combobox/positioner/ComboboxPositionerContext.d.ts +2 -10
- package/esm/combobox/root/AriaCombobox.d.ts +5 -0
- package/esm/combobox/root/AriaCombobox.js +33 -20
- package/esm/combobox/root/utils/useFilter.d.ts +9 -0
- package/esm/combobox/row/ComboboxRow.d.ts +2 -0
- package/esm/combobox/row/ComboboxRow.js +3 -0
- package/esm/combobox/status/ComboboxStatus.d.ts +6 -0
- package/esm/combobox/status/ComboboxStatus.js +12 -1
- package/esm/combobox/store.d.ts +2 -14
- package/esm/combobox/store.js +1 -14
- package/esm/combobox/trigger/ComboboxTrigger.d.ts +2 -0
- package/esm/combobox/trigger/ComboboxTrigger.js +4 -1
- package/esm/combobox/utils/handleInputPress.d.ts +5 -0
- package/esm/combobox/utils/handleInputPress.js +22 -0
- package/esm/combobox/utils/useInitialLiveRegionTextMutation.d.ts +3 -0
- package/esm/combobox/utils/useInitialLiveRegionTextMutation.js +55 -0
- package/esm/composite/composite.d.ts +2 -0
- package/esm/composite/composite.js +2 -0
- package/esm/composite/item/CompositeItem.d.ts +1 -1
- package/esm/composite/item/CompositeItem.js +1 -0
- package/esm/composite/root/CompositeRoot.d.ts +4 -2
- package/esm/composite/root/CompositeRoot.js +3 -0
- package/esm/composite/root/useCompositeRoot.d.ts +1 -0
- package/esm/composite/root/useCompositeRoot.js +30 -15
- package/esm/context-menu/index.d.ts +1 -1
- package/esm/context-menu/root/ContextMenuRoot.d.ts +3 -1
- package/esm/context-menu/root/ContextMenuRoot.js +1 -1
- package/esm/context-menu/trigger/ContextMenuTrigger.js +4 -5
- package/esm/dialog/backdrop/DialogBackdrop.js +1 -0
- package/esm/dialog/close/DialogClose.js +1 -0
- package/esm/dialog/description/DialogDescription.js +1 -0
- package/esm/dialog/popup/DialogPopup.js +1 -0
- package/esm/dialog/root/DialogRoot.d.ts +3 -2
- package/esm/dialog/root/DialogRoot.js +23 -18
- package/esm/dialog/root/useDialogRoot.d.ts +1 -0
- package/esm/dialog/root/useDialogRoot.js +13 -9
- package/esm/dialog/store/DialogStore.d.ts +4 -1
- package/esm/dialog/store/DialogStore.js +11 -7
- package/esm/dialog/title/DialogTitle.js +1 -0
- package/esm/dialog/trigger/DialogTrigger.js +1 -0
- package/esm/dialog/viewport/DialogViewport.js +1 -0
- package/esm/drawer/backdrop/DrawerBackdrop.js +1 -0
- package/esm/drawer/content/DrawerContent.js +1 -0
- package/esm/drawer/indent/DrawerIndent.js +1 -0
- package/esm/drawer/indent-background/DrawerIndentBackground.js +1 -0
- package/esm/drawer/popup/DrawerPopup.js +17 -3
- package/esm/drawer/root/DrawerRoot.d.ts +1 -1
- package/esm/drawer/root/DrawerRoot.js +19 -14
- package/esm/drawer/root/DrawerRootContext.d.ts +4 -4
- package/esm/drawer/swipe-area/DrawerSwipeArea.js +17 -12
- package/esm/drawer/viewport/DrawerViewport.js +35 -23
- package/esm/field/control/FieldControl.js +6 -6
- package/esm/field/description/FieldDescription.js +1 -0
- package/esm/field/error/FieldError.d.ts +1 -1
- package/esm/field/error/FieldError.js +8 -5
- package/esm/field/item/FieldItem.js +1 -0
- package/esm/field/label/FieldLabel.d.ts +1 -1
- package/esm/field/label/FieldLabel.js +1 -0
- package/esm/field/root/FieldRoot.js +12 -1
- package/esm/field/root/FieldRootContext.d.ts +2 -0
- package/esm/field/root/FieldRootContext.js +1 -0
- package/esm/field/root/useFieldControlRegistration.d.ts +17 -0
- package/esm/field/root/useFieldControlRegistration.js +125 -0
- package/esm/field/root/useRegisterFieldControl.d.ts +5 -0
- package/esm/field/root/useRegisterFieldControl.js +35 -0
- package/esm/field/validity/FieldValidity.d.ts +1 -1
- package/esm/field/validity/FieldValidity.js +1 -1
- package/esm/fieldset/legend/FieldsetLegend.js +1 -0
- package/esm/fieldset/root/FieldsetRoot.js +1 -0
- package/esm/floating-ui-react/components/FloatingFocusManager.js +47 -79
- package/esm/floating-ui-react/components/FloatingPortal.js +17 -11
- package/esm/floating-ui-react/components/FloatingRootStore.d.ts +18 -2
- package/esm/floating-ui-react/components/FloatingRootStore.js +34 -17
- package/esm/floating-ui-react/hooks/useClick.js +5 -3
- package/esm/floating-ui-react/hooks/useClientPoint.js +6 -5
- package/esm/floating-ui-react/hooks/useDismiss.js +26 -63
- package/esm/floating-ui-react/hooks/useFloating.js +4 -3
- package/esm/floating-ui-react/hooks/useFloatingRootContext.js +3 -3
- package/esm/floating-ui-react/hooks/useFocus.js +5 -14
- package/esm/floating-ui-react/hooks/useHover.d.ts +1 -1
- package/esm/floating-ui-react/hooks/useHover.js +8 -46
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +5 -0
- package/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js +15 -15
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +3 -3
- package/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js +15 -8
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +1 -0
- package/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js +64 -26
- package/esm/floating-ui-react/hooks/useHoverShared.js +1 -1
- package/esm/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
- package/esm/floating-ui-react/hooks/useListNavigation.js +32 -28
- package/esm/floating-ui-react/hooks/useRole.js +1 -1
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +0 -4
- package/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -4
- package/esm/floating-ui-react/hooks/useTypeahead.js +3 -1
- package/esm/floating-ui-react/safePolygon.js +1 -0
- package/esm/floating-ui-react/utils/composite.d.ts +6 -4
- package/esm/floating-ui-react/utils/composite.js +55 -24
- package/esm/floating-ui-react/utils/element.d.ts +3 -3
- package/esm/floating-ui-react/utils/element.js +6 -42
- package/esm/floating-ui-react/utils/enqueueFocus.d.ts +3 -2
- package/esm/floating-ui-react/utils/enqueueFocus.js +10 -2
- package/esm/floating-ui-react/utils/getEmptyRootContext.js +2 -1
- package/esm/floating-ui-react/utils/nodes.js +2 -2
- package/esm/floating-ui-react/utils/shadowDom.d.ts +3 -0
- package/esm/floating-ui-react/utils/shadowDom.js +40 -0
- package/esm/floating-ui-react/utils/tabbable.d.ts +4 -5
- package/esm/floating-ui-react/utils/tabbable.js +126 -13
- package/esm/form/Form.js +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +6 -1
- package/esm/input/Input.d.ts +1 -1
- package/esm/labelable-provider/useLabel.js +0 -1
- package/esm/localization-provider/LocalizationContext.d.ts +10 -0
- package/esm/localization-provider/LocalizationContext.js +16 -0
- package/esm/localization-provider/LocalizationProvider.d.ts +20 -0
- package/esm/localization-provider/LocalizationProvider.js +37 -0
- package/esm/localization-provider/index.d.ts +2 -0
- package/esm/localization-provider/index.js +2 -0
- package/esm/menu/arrow/MenuArrow.js +1 -0
- package/esm/menu/backdrop/MenuBackdrop.js +1 -0
- package/esm/menu/checkbox-item/MenuCheckboxItem.js +2 -1
- package/esm/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +1 -0
- package/esm/menu/group/MenuGroup.js +1 -0
- package/esm/menu/group-label/MenuGroupLabel.js +1 -0
- package/esm/menu/item/MenuItem.js +2 -1
- package/esm/menu/item/useMenuItem.d.ts +1 -1
- package/esm/menu/link-item/MenuLinkItem.js +2 -1
- package/esm/menu/popup/MenuPopup.js +1 -0
- package/esm/menu/positioner/MenuPositioner.js +15 -31
- package/esm/menu/positioner/MenuPositionerContext.d.ts +2 -15
- package/esm/menu/radio-group/MenuRadioGroup.js +1 -0
- package/esm/menu/radio-item/MenuRadioItem.js +2 -1
- package/esm/menu/radio-item-indicator/MenuRadioItemIndicator.js +1 -0
- package/esm/menu/root/MenuRoot.d.ts +2 -2
- package/esm/menu/root/MenuRoot.js +8 -17
- package/esm/menu/store/MenuStore.d.ts +3 -0
- package/esm/menu/store/MenuStore.js +2 -0
- package/esm/menu/submenu-root/MenuSubmenuRoot.d.ts +1 -1
- package/esm/menu/submenu-root/MenuSubmenuRoot.js +1 -1
- package/esm/menu/submenu-trigger/MenuSubmenuTrigger.js +18 -2
- package/esm/menu/trigger/MenuTrigger.js +11 -31
- package/esm/menu/viewport/MenuViewport.js +1 -0
- package/esm/menubar/Menubar.js +7 -11
- package/esm/menubar/MenubarDataAttributes.d.ts +6 -3
- package/esm/menubar/MenubarDataAttributes.js +9 -6
- package/esm/merge-props/mergeProps.d.ts +1 -1
- package/esm/merge-props/mergeProps.js +53 -18
- package/esm/meter/indicator/MeterIndicator.js +1 -0
- package/esm/meter/label/MeterLabel.js +1 -0
- package/esm/meter/root/MeterRoot.js +1 -0
- package/esm/meter/track/MeterTrack.js +1 -0
- package/esm/meter/value/MeterValue.js +1 -0
- package/esm/navigation-menu/arrow/NavigationMenuArrow.js +1 -0
- package/esm/navigation-menu/backdrop/NavigationMenuBackdrop.js +1 -0
- package/esm/navigation-menu/content/NavigationMenuContent.js +3 -0
- package/esm/navigation-menu/icon/NavigationMenuIcon.js +1 -0
- package/esm/navigation-menu/item/NavigationMenuItem.js +1 -0
- package/esm/navigation-menu/link/NavigationMenuLink.js +2 -0
- package/esm/navigation-menu/list/NavigationMenuList.js +10 -6
- package/esm/navigation-menu/popup/NavigationMenuPopup.js +1 -0
- package/esm/navigation-menu/positioner/NavigationMenuPositioner.js +13 -32
- package/esm/navigation-menu/root/NavigationMenuRoot.d.ts +9 -6
- package/esm/navigation-menu/root/NavigationMenuRoot.js +8 -0
- package/esm/navigation-menu/root/NavigationMenuRootContext.d.ts +11 -6
- package/esm/navigation-menu/trigger/NavigationMenuTrigger.js +66 -31
- package/esm/navigation-menu/viewport/NavigationMenuViewport.js +1 -0
- package/esm/number-field/decrement/NumberFieldDecrement.js +1 -10
- package/esm/number-field/group/NumberFieldGroup.js +1 -0
- package/esm/number-field/increment/NumberFieldIncrement.js +1 -10
- package/esm/number-field/input/NumberFieldInput.js +6 -10
- package/esm/number-field/root/NumberFieldRoot.d.ts +6 -1
- package/esm/number-field/root/NumberFieldRoot.js +13 -78
- package/esm/number-field/root/NumberFieldRootContext.d.ts +0 -6
- package/esm/number-field/root/useNumberFieldButton.d.ts +0 -6
- package/esm/number-field/root/useNumberFieldButton.js +34 -101
- package/esm/number-field/scrub-area/NumberFieldScrubArea.js +8 -9
- package/esm/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.js +1 -0
- package/esm/number-field/utils/constants.d.ts +0 -2
- package/esm/number-field/utils/constants.js +0 -2
- package/esm/number-field/utils/subscribeToVisualViewportResize.js +2 -4
- package/esm/otp-field/index.d.ts +3 -0
- package/esm/otp-field/index.js +1 -0
- package/esm/otp-field/index.parts.d.ts +3 -0
- package/esm/otp-field/index.parts.js +3 -0
- package/esm/otp-field/input/OTPFieldInput.d.ts +29 -0
- package/esm/otp-field/input/OTPFieldInput.js +237 -0
- package/esm/otp-field/input/OTPFieldInputDataAttributes.d.ts +42 -0
- package/esm/otp-field/input/OTPFieldInputDataAttributes.js +43 -0
- package/esm/otp-field/root/OTPFieldRoot.d.ts +159 -0
- package/esm/otp-field/root/OTPFieldRoot.js +408 -0
- package/esm/otp-field/root/OTPFieldRootContext.d.ts +31 -0
- package/esm/otp-field/root/OTPFieldRootContext.js +21 -0
- package/esm/otp-field/root/OTPFieldRootDataAttributes.d.ts +42 -0
- package/esm/otp-field/root/OTPFieldRootDataAttributes.js +43 -0
- package/esm/otp-field/utils/otp.d.ts +21 -0
- package/esm/otp-field/utils/otp.js +66 -0
- package/esm/otp-field/utils/stateAttributesMapping.d.ts +5 -0
- package/esm/otp-field/utils/stateAttributesMapping.js +11 -0
- package/esm/popover/arrow/PopoverArrow.js +1 -0
- package/esm/popover/backdrop/PopoverBackdrop.js +1 -0
- package/esm/popover/close/PopoverClose.js +1 -0
- package/esm/popover/description/PopoverDescription.js +1 -0
- package/esm/popover/popup/PopoverPopup.js +2 -0
- package/esm/popover/positioner/PopoverPositioner.js +16 -30
- package/esm/popover/root/PopoverRoot.d.ts +2 -2
- package/esm/popover/root/PopoverRoot.js +1 -5
- package/esm/popover/store/PopoverStore.d.ts +2 -0
- package/esm/popover/store/PopoverStore.js +3 -9
- package/esm/popover/title/PopoverTitle.js +1 -0
- package/esm/popover/trigger/PopoverTrigger.js +11 -33
- package/esm/popover/viewport/PopoverViewport.js +1 -0
- package/esm/preview-card/arrow/PreviewCardArrow.js +1 -0
- package/esm/preview-card/backdrop/PreviewCardBackdrop.js +1 -0
- package/esm/preview-card/index.d.ts +1 -0
- package/esm/preview-card/popup/PreviewCardPopup.js +1 -0
- package/esm/preview-card/positioner/PreviewCardPositioner.js +10 -30
- package/esm/preview-card/positioner/PreviewCardPositionerContext.d.ts +2 -8
- package/esm/preview-card/root/PreviewCardRoot.d.ts +2 -2
- package/esm/preview-card/root/PreviewCardRoot.js +2 -2
- package/esm/preview-card/store/PreviewCardStore.js +1 -0
- package/esm/preview-card/trigger/PreviewCardTrigger.js +3 -1
- package/esm/preview-card/viewport/PreviewCardViewport.js +1 -0
- package/esm/progress/indicator/ProgressIndicator.js +1 -0
- package/esm/progress/indicator/ProgressIndicatorDataAttributes.d.ts +1 -1
- package/esm/progress/indicator/ProgressIndicatorDataAttributes.js +1 -1
- package/esm/progress/label/ProgressLabel.js +1 -0
- package/esm/progress/label/ProgressLabelDataAttributes.d.ts +1 -1
- package/esm/progress/label/ProgressLabelDataAttributes.js +1 -1
- package/esm/progress/root/ProgressRoot.js +1 -0
- package/esm/progress/root/ProgressRootDataAttributes.d.ts +1 -1
- package/esm/progress/root/ProgressRootDataAttributes.js +1 -1
- package/esm/progress/track/ProgressTrack.js +1 -0
- package/esm/progress/track/ProgressTrackDataAttributes.d.ts +1 -1
- package/esm/progress/track/ProgressTrackDataAttributes.js +1 -1
- package/esm/progress/value/ProgressValue.js +1 -0
- package/esm/progress/value/ProgressValueDataAttributes.d.ts +1 -1
- package/esm/progress/value/ProgressValueDataAttributes.js +1 -1
- package/esm/radio/indicator/RadioIndicator.js +1 -0
- package/esm/radio/root/RadioRoot.js +7 -1
- package/esm/radio-group/RadioGroup.d.ts +5 -0
- package/esm/radio-group/RadioGroup.js +9 -7
- package/esm/radio-group/RadioGroupContext.d.ts +1 -0
- package/esm/scroll-area/content/ScrollAreaContent.js +1 -0
- package/esm/scroll-area/corner/ScrollAreaCorner.js +1 -0
- package/esm/scroll-area/root/ScrollAreaRoot.js +1 -0
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/esm/scroll-area/scrollbar/ScrollAreaScrollbar.js +9 -6
- package/esm/scroll-area/thumb/ScrollAreaThumb.js +1 -0
- package/esm/scroll-area/viewport/ScrollAreaViewport.js +5 -13
- package/esm/select/arrow/SelectArrow.js +1 -0
- package/esm/select/backdrop/SelectBackdrop.js +1 -0
- package/esm/select/group/SelectGroup.js +1 -0
- package/esm/select/group-label/SelectGroupLabel.js +1 -0
- package/esm/select/icon/SelectIcon.js +1 -0
- package/esm/select/item/SelectItem.js +9 -34
- package/esm/select/item-indicator/SelectItemIndicator.js +1 -0
- package/esm/select/item-text/SelectItemText.js +1 -0
- package/esm/select/label/SelectLabel.js +1 -0
- package/esm/select/list/SelectList.js +1 -0
- package/esm/select/popup/SelectPopup.js +140 -168
- package/esm/select/positioner/SelectPositioner.js +11 -24
- package/esm/select/root/SelectRoot.d.ts +7 -2
- package/esm/select/root/SelectRoot.js +37 -24
- package/esm/select/scroll-arrow/SelectScrollArrow.js +47 -63
- package/esm/select/trigger/SelectTrigger.js +1 -0
- package/esm/select/value/SelectValue.js +1 -0
- package/esm/separator/Separator.js +1 -0
- package/esm/separator/SeparatorDataAttributes.d.ts +7 -0
- package/esm/separator/SeparatorDataAttributes.js +8 -0
- package/esm/slider/control/SliderControl.js +17 -8
- package/esm/slider/indicator/SliderIndicator.js +6 -6
- package/esm/slider/label/SliderLabel.js +1 -0
- package/esm/slider/root/SliderRoot.d.ts +6 -1
- package/esm/slider/root/SliderRoot.js +9 -10
- package/esm/slider/root/SliderRootContext.d.ts +1 -0
- package/esm/slider/thumb/SliderThumb.js +64 -22
- package/esm/slider/track/SliderTrack.js +1 -0
- package/esm/slider/utils/roundValueToStep.d.ts +1 -0
- package/esm/slider/utils/roundValueToStep.js +6 -2
- package/esm/slider/value/SliderValue.js +1 -0
- package/esm/switch/root/SwitchRoot.d.ts +5 -0
- package/esm/switch/root/SwitchRoot.js +15 -10
- package/esm/switch/thumb/SwitchThumb.js +1 -0
- package/esm/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/esm/tabs/indicator/TabsIndicator.js +4 -4
- package/esm/tabs/list/TabsList.js +3 -85
- package/esm/tabs/panel/TabsPanel.js +1 -0
- package/esm/tabs/root/TabsRoot.js +115 -22
- package/esm/tabs/tab/TabsTab.js +1 -0
- package/esm/temporal-adapter-date-fns/TemporalAdapterDateFns.d.ts +93 -0
- package/esm/temporal-adapter-date-fns/TemporalAdapterDateFns.js +352 -0
- package/esm/temporal-adapter-date-fns/index.d.ts +1 -0
- package/esm/temporal-adapter-date-fns/index.js +1 -0
- package/esm/temporal-adapter-luxon/TemporalAdapterLuxon.d.ts +89 -0
- package/esm/temporal-adapter-luxon/TemporalAdapterLuxon.js +327 -0
- package/esm/temporal-adapter-luxon/index.d.ts +1 -0
- package/esm/temporal-adapter-luxon/index.js +1 -0
- package/esm/temporal-adapter-provider/TemporalAdapterContext.d.ts +10 -0
- package/esm/temporal-adapter-provider/TemporalAdapterContext.js +19 -0
- package/esm/temporal-adapter-provider/TemporalAdapterProvider.d.ts +15 -0
- package/esm/temporal-adapter-provider/TemporalAdapterProvider.js +23 -0
- package/esm/temporal-adapter-provider/index.d.ts +1 -0
- package/esm/temporal-adapter-provider/index.js +1 -0
- package/esm/toast/action/ToastAction.js +1 -0
- package/esm/toast/arrow/ToastArrow.js +1 -0
- package/esm/toast/close/ToastClose.js +1 -0
- package/esm/toast/content/ToastContent.js +1 -0
- package/esm/toast/description/ToastDescription.js +1 -0
- package/esm/toast/positioner/ToastPositioner.js +11 -26
- package/esm/toast/positioner/ToastPositionerContext.d.ts +2 -8
- package/esm/toast/root/ToastRoot.js +20 -7
- package/esm/toast/root/ToastRootDataAttributes.js +4 -3
- package/esm/toast/store.d.ts +9 -2
- package/esm/toast/store.js +37 -12
- package/esm/toast/title/ToastTitle.js +1 -0
- package/esm/toast/useToastManager.d.ts +10 -2
- package/esm/toast/viewport/ToastViewport.js +36 -26
- package/esm/toggle/Toggle.js +2 -0
- package/esm/toggle-group/ToggleGroup.js +4 -1
- package/esm/toolbar/button/ToolbarButton.d.ts +1 -1
- package/esm/toolbar/button/ToolbarButton.js +2 -0
- package/esm/toolbar/group/ToolbarGroup.js +1 -0
- package/esm/toolbar/input/ToolbarInput.d.ts +1 -1
- package/esm/toolbar/input/ToolbarInput.js +2 -0
- package/esm/toolbar/link/ToolbarLink.js +2 -0
- package/esm/toolbar/root/ToolbarRoot.js +2 -0
- package/esm/tooltip/arrow/TooltipArrow.js +2 -1
- package/esm/tooltip/index.d.ts +1 -0
- package/esm/tooltip/popup/TooltipPopup.js +1 -0
- package/esm/tooltip/positioner/TooltipPositioner.js +10 -29
- package/esm/tooltip/positioner/TooltipPositionerContext.d.ts +2 -9
- package/esm/tooltip/root/TooltipRoot.d.ts +2 -2
- package/esm/tooltip/root/TooltipRoot.js +2 -2
- package/esm/tooltip/store/TooltipStore.js +1 -0
- package/esm/tooltip/trigger/TooltipTrigger.js +3 -1
- package/esm/tooltip/viewport/TooltipViewport.js +1 -0
- package/esm/types/temporal/index.d.ts +2 -0
- package/esm/types/temporal/index.js +2 -0
- package/esm/types/temporal/temporal-adapter.d.ts +371 -0
- package/esm/types/temporal/temporal-adapter.js +1 -0
- package/esm/types/temporal/temporal.d.ts +35 -0
- package/esm/types/temporal/temporal.js +1 -0
- package/esm/unstable-use-media-query/index.js +2 -6
- package/esm/use-render/useRender.d.ts +1 -1
- package/esm/utils/FloatingPortalLite.js +1 -0
- package/esm/utils/InternalBackdrop.js +2 -13
- package/esm/utils/createBaseUIEventDetails.d.ts +2 -2
- package/esm/utils/getPseudoElementBounds.js +4 -2
- package/esm/utils/popups/store.js +1 -1
- package/esm/utils/popups/useTriggerFocusGuards.d.ts +28 -0
- package/esm/utils/popups/useTriggerFocusGuards.js +55 -0
- package/esm/utils/reason-parts.d.ts +4 -1
- package/esm/utils/reason-parts.js +4 -1
- package/esm/{scroll-area/utils → utils}/scrollEdges.d.ts +1 -0
- package/esm/{scroll-area/utils → utils}/scrollEdges.js +4 -1
- package/esm/utils/temporal/date-helpers.d.ts +15 -0
- package/esm/utils/temporal/date-helpers.js +43 -0
- package/esm/utils/temporal/getDateManager.d.ts +5 -0
- package/esm/utils/temporal/getDateManager.js +19 -0
- package/esm/utils/temporal/getInitialReferenceDate.d.ts +27 -0
- package/esm/utils/temporal/getInitialReferenceDate.js +28 -0
- package/esm/utils/temporal/types.d.ts +65 -0
- package/esm/utils/temporal/types.js +1 -0
- package/esm/utils/temporal/validateDate.d.ts +27 -0
- package/esm/utils/temporal/validateDate.js +25 -0
- package/esm/utils/types.d.ts +11 -5
- package/esm/utils/useAnchorPositioning.js +10 -4
- package/esm/utils/useAnchoredPopupScrollLock.d.ts +6 -0
- package/esm/utils/useAnchoredPopupScrollLock.js +31 -0
- package/esm/utils/useAnimationsFinished.js +48 -51
- package/esm/utils/useIsHydrating.d.ts +5 -0
- package/esm/utils/useIsHydrating.js +19 -0
- package/esm/utils/usePopupViewport.js +2 -1
- package/esm/utils/usePositioner.d.ts +23 -0
- package/esm/utils/usePositioner.js +34 -0
- package/esm/utils/usePressAndHold.d.ts +58 -0
- package/esm/utils/usePressAndHold.js +192 -0
- package/esm/utils/useRenderElement.js +18 -3
- package/esm/utils/useSwipeDismiss.d.ts +1 -0
- package/esm/utils/useSwipeDismiss.js +4 -2
- package/esm/utils/useTransitionStatus.js +3 -3
- package/field/control/FieldControl.js +6 -6
- package/field/description/FieldDescription.js +1 -0
- package/field/error/FieldError.d.ts +1 -1
- package/field/error/FieldError.js +8 -5
- package/field/item/FieldItem.js +1 -0
- package/field/label/FieldLabel.d.ts +1 -1
- package/field/label/FieldLabel.js +1 -0
- package/field/root/FieldRoot.js +12 -1
- package/field/root/FieldRootContext.d.ts +2 -0
- package/field/root/FieldRootContext.js +1 -0
- package/field/root/useFieldControlRegistration.d.ts +17 -0
- package/field/root/useFieldControlRegistration.js +131 -0
- package/field/root/useRegisterFieldControl.d.ts +5 -0
- package/field/root/useRegisterFieldControl.js +41 -0
- package/field/validity/FieldValidity.d.ts +1 -1
- package/field/validity/FieldValidity.js +1 -1
- package/fieldset/legend/FieldsetLegend.js +1 -0
- package/fieldset/root/FieldsetRoot.js +1 -0
- package/floating-ui-react/components/FloatingFocusManager.js +72 -104
- package/floating-ui-react/components/FloatingPortal.js +23 -17
- package/floating-ui-react/components/FloatingRootStore.d.ts +18 -2
- package/floating-ui-react/components/FloatingRootStore.js +34 -17
- package/floating-ui-react/hooks/useClick.js +8 -6
- package/floating-ui-react/hooks/useClientPoint.js +9 -8
- package/floating-ui-react/hooks/useDismiss.js +42 -79
- package/floating-ui-react/hooks/useFloating.js +4 -3
- package/floating-ui-react/hooks/useFloatingRootContext.js +3 -3
- package/floating-ui-react/hooks/useFocus.js +12 -21
- package/floating-ui-react/hooks/useHover.d.ts +1 -1
- package/floating-ui-react/hooks/useHover.js +8 -46
- package/floating-ui-react/hooks/useHoverFloatingInteraction.d.ts +5 -0
- package/floating-ui-react/hooks/useHoverFloatingInteraction.js +19 -19
- package/floating-ui-react/hooks/useHoverInteractionSharedState.d.ts +3 -3
- package/floating-ui-react/hooks/useHoverInteractionSharedState.js +20 -9
- package/floating-ui-react/hooks/useHoverReferenceInteraction.d.ts +1 -0
- package/floating-ui-react/hooks/useHoverReferenceInteraction.js +69 -31
- package/floating-ui-react/hooks/useHoverShared.js +2 -2
- package/floating-ui-react/hooks/useListNavigation.d.ts +4 -4
- package/floating-ui-react/hooks/useListNavigation.js +56 -52
- package/floating-ui-react/hooks/useRole.js +2 -2
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.d.ts +0 -4
- package/floating-ui-react/hooks/useSyncedFloatingRootContext.js +3 -4
- package/floating-ui-react/hooks/useTypeahead.js +8 -6
- package/floating-ui-react/safePolygon.js +1 -0
- package/floating-ui-react/utils/composite.d.ts +6 -4
- package/floating-ui-react/utils/composite.js +55 -24
- package/floating-ui-react/utils/element.d.ts +3 -3
- package/floating-ui-react/utils/element.js +24 -45
- package/floating-ui-react/utils/enqueueFocus.d.ts +3 -2
- package/floating-ui-react/utils/enqueueFocus.js +10 -2
- package/floating-ui-react/utils/getEmptyRootContext.js +2 -1
- package/floating-ui-react/utils/nodes.js +2 -2
- package/floating-ui-react/utils/shadowDom.d.ts +3 -0
- package/floating-ui-react/utils/shadowDom.js +48 -0
- package/floating-ui-react/utils/tabbable.d.ts +4 -5
- package/floating-ui-react/utils/tabbable.js +129 -15
- package/form/Form.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +12 -1
- package/input/Input.d.ts +1 -1
- package/labelable-provider/useLabel.js +0 -1
- package/localization-provider/LocalizationContext.d.ts +10 -0
- package/localization-provider/LocalizationContext.js +24 -0
- package/localization-provider/LocalizationProvider.d.ts +20 -0
- package/localization-provider/LocalizationProvider.js +42 -0
- package/localization-provider/index.d.ts +2 -0
- package/localization-provider/index.js +19 -0
- package/menu/arrow/MenuArrow.js +1 -0
- package/menu/backdrop/MenuBackdrop.js +1 -0
- package/menu/checkbox-item/MenuCheckboxItem.js +2 -1
- package/menu/checkbox-item-indicator/MenuCheckboxItemIndicator.js +1 -0
- package/menu/group/MenuGroup.js +1 -0
- package/menu/group-label/MenuGroupLabel.js +1 -0
- package/menu/item/MenuItem.js +2 -1
- package/menu/item/useMenuItem.d.ts +1 -1
- package/menu/link-item/MenuLinkItem.js +2 -1
- package/menu/popup/MenuPopup.js +1 -0
- package/menu/positioner/MenuPositioner.js +15 -31
- package/menu/positioner/MenuPositionerContext.d.ts +2 -15
- package/menu/radio-group/MenuRadioGroup.js +1 -0
- package/menu/radio-item/MenuRadioItem.js +2 -1
- package/menu/radio-item-indicator/MenuRadioItemIndicator.js +1 -0
- package/menu/root/MenuRoot.d.ts +2 -2
- package/menu/root/MenuRoot.js +8 -17
- package/menu/store/MenuStore.d.ts +3 -0
- package/menu/store/MenuStore.js +2 -0
- package/menu/submenu-root/MenuSubmenuRoot.d.ts +1 -1
- package/menu/submenu-root/MenuSubmenuRoot.js +1 -1
- package/menu/submenu-trigger/MenuSubmenuTrigger.js +18 -2
- package/menu/trigger/MenuTrigger.js +10 -30
- package/menu/viewport/MenuViewport.js +1 -0
- package/menubar/Menubar.js +7 -11
- package/menubar/MenubarDataAttributes.d.ts +6 -3
- package/menubar/MenubarDataAttributes.js +10 -7
- package/merge-props/mergeProps.d.ts +1 -1
- package/merge-props/mergeProps.js +53 -18
- package/meter/indicator/MeterIndicator.js +1 -0
- package/meter/label/MeterLabel.js +1 -0
- package/meter/root/MeterRoot.js +1 -0
- package/meter/track/MeterTrack.js +1 -0
- package/meter/value/MeterValue.js +1 -0
- package/navigation-menu/arrow/NavigationMenuArrow.js +1 -0
- package/navigation-menu/backdrop/NavigationMenuBackdrop.js +1 -0
- package/navigation-menu/content/NavigationMenuContent.js +3 -0
- package/navigation-menu/icon/NavigationMenuIcon.js +1 -0
- package/navigation-menu/item/NavigationMenuItem.js +1 -0
- package/navigation-menu/link/NavigationMenuLink.js +2 -0
- package/navigation-menu/list/NavigationMenuList.js +9 -5
- package/navigation-menu/popup/NavigationMenuPopup.js +1 -0
- package/navigation-menu/positioner/NavigationMenuPositioner.js +13 -32
- package/navigation-menu/root/NavigationMenuRoot.d.ts +9 -6
- package/navigation-menu/root/NavigationMenuRoot.js +8 -0
- package/navigation-menu/root/NavigationMenuRootContext.d.ts +11 -6
- package/navigation-menu/trigger/NavigationMenuTrigger.js +66 -31
- package/navigation-menu/viewport/NavigationMenuViewport.js +1 -0
- package/number-field/decrement/NumberFieldDecrement.js +1 -10
- package/number-field/group/NumberFieldGroup.js +1 -0
- package/number-field/increment/NumberFieldIncrement.js +1 -10
- package/number-field/input/NumberFieldInput.js +6 -10
- package/number-field/root/NumberFieldRoot.d.ts +6 -1
- package/number-field/root/NumberFieldRoot.js +10 -75
- package/number-field/root/NumberFieldRootContext.d.ts +0 -6
- package/number-field/root/useNumberFieldButton.d.ts +0 -6
- package/number-field/root/useNumberFieldButton.js +32 -101
- package/number-field/scrub-area/NumberFieldScrubArea.js +8 -9
- package/number-field/scrub-area-cursor/NumberFieldScrubAreaCursor.js +1 -0
- package/number-field/utils/constants.d.ts +0 -2
- package/number-field/utils/constants.js +1 -3
- package/number-field/utils/subscribeToVisualViewportResize.js +2 -4
- package/otp-field/index.d.ts +3 -0
- package/otp-field/index.js +9 -0
- package/otp-field/index.parts.d.ts +3 -0
- package/otp-field/index.parts.js +26 -0
- package/otp-field/input/OTPFieldInput.d.ts +29 -0
- package/otp-field/input/OTPFieldInput.js +242 -0
- package/otp-field/input/OTPFieldInputDataAttributes.d.ts +42 -0
- package/otp-field/input/OTPFieldInputDataAttributes.js +49 -0
- package/otp-field/root/OTPFieldRoot.d.ts +159 -0
- package/otp-field/root/OTPFieldRoot.js +413 -0
- package/otp-field/root/OTPFieldRootContext.d.ts +31 -0
- package/otp-field/root/OTPFieldRootContext.js +30 -0
- package/otp-field/root/OTPFieldRootDataAttributes.d.ts +42 -0
- package/otp-field/root/OTPFieldRootDataAttributes.js +49 -0
- package/otp-field/utils/otp.d.ts +21 -0
- package/otp-field/utils/otp.js +76 -0
- package/otp-field/utils/stateAttributesMapping.d.ts +5 -0
- package/otp-field/utils/stateAttributesMapping.js +17 -0
- package/package.json +21 -5
- package/popover/arrow/PopoverArrow.js +1 -0
- package/popover/backdrop/PopoverBackdrop.js +1 -0
- package/popover/close/PopoverClose.js +1 -0
- package/popover/description/PopoverDescription.js +1 -0
- package/popover/popup/PopoverPopup.js +2 -0
- package/popover/positioner/PopoverPositioner.js +16 -30
- package/popover/root/PopoverRoot.d.ts +2 -2
- package/popover/root/PopoverRoot.js +1 -5
- package/popover/store/PopoverStore.d.ts +2 -0
- package/popover/store/PopoverStore.js +3 -9
- package/popover/title/PopoverTitle.js +1 -0
- package/popover/trigger/PopoverTrigger.js +11 -33
- package/popover/viewport/PopoverViewport.js +1 -0
- package/preview-card/arrow/PreviewCardArrow.js +1 -0
- package/preview-card/backdrop/PreviewCardBackdrop.js +1 -0
- package/preview-card/index.d.ts +1 -0
- package/preview-card/popup/PreviewCardPopup.js +1 -0
- package/preview-card/positioner/PreviewCardPositioner.js +10 -30
- package/preview-card/positioner/PreviewCardPositionerContext.d.ts +2 -8
- package/preview-card/root/PreviewCardRoot.d.ts +2 -2
- package/preview-card/root/PreviewCardRoot.js +2 -2
- package/preview-card/store/PreviewCardStore.js +1 -0
- package/preview-card/trigger/PreviewCardTrigger.js +3 -1
- package/preview-card/viewport/PreviewCardViewport.js +1 -0
- package/progress/indicator/ProgressIndicator.js +1 -0
- package/progress/indicator/ProgressIndicatorDataAttributes.d.ts +1 -1
- package/progress/indicator/ProgressIndicatorDataAttributes.js +1 -1
- package/progress/label/ProgressLabel.js +1 -0
- package/progress/label/ProgressLabelDataAttributes.d.ts +1 -1
- package/progress/label/ProgressLabelDataAttributes.js +1 -1
- package/progress/root/ProgressRoot.js +1 -0
- package/progress/root/ProgressRootDataAttributes.d.ts +1 -1
- package/progress/root/ProgressRootDataAttributes.js +1 -1
- package/progress/track/ProgressTrack.js +1 -0
- package/progress/track/ProgressTrackDataAttributes.d.ts +1 -1
- package/progress/track/ProgressTrackDataAttributes.js +1 -1
- package/progress/value/ProgressValue.js +1 -0
- package/progress/value/ProgressValueDataAttributes.d.ts +1 -1
- package/progress/value/ProgressValueDataAttributes.js +1 -1
- package/radio/indicator/RadioIndicator.js +1 -0
- package/radio/root/RadioRoot.js +7 -1
- package/radio-group/RadioGroup.d.ts +5 -0
- package/radio-group/RadioGroup.js +9 -7
- package/radio-group/RadioGroupContext.d.ts +1 -0
- package/scroll-area/content/ScrollAreaContent.js +1 -0
- package/scroll-area/corner/ScrollAreaCorner.js +1 -0
- package/scroll-area/root/ScrollAreaRoot.js +1 -0
- package/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +1 -1
- package/scroll-area/scrollbar/ScrollAreaScrollbar.js +9 -6
- package/scroll-area/thumb/ScrollAreaThumb.js +1 -0
- package/scroll-area/viewport/ScrollAreaViewport.js +5 -13
- package/select/arrow/SelectArrow.js +1 -0
- package/select/backdrop/SelectBackdrop.js +1 -0
- package/select/group/SelectGroup.js +1 -0
- package/select/group-label/SelectGroupLabel.js +1 -0
- package/select/icon/SelectIcon.js +1 -0
- package/select/item/SelectItem.js +9 -34
- package/select/item-indicator/SelectItemIndicator.js +1 -0
- package/select/item-text/SelectItemText.js +1 -0
- package/select/label/SelectLabel.js +1 -0
- package/select/list/SelectList.js +1 -0
- package/select/popup/SelectPopup.js +140 -168
- package/select/positioner/SelectPositioner.js +11 -24
- package/select/root/SelectRoot.d.ts +7 -2
- package/select/root/SelectRoot.js +36 -23
- package/select/scroll-arrow/SelectScrollArrow.js +47 -63
- package/select/trigger/SelectTrigger.js +1 -0
- package/select/value/SelectValue.js +1 -0
- package/separator/Separator.js +1 -0
- package/separator/SeparatorDataAttributes.d.ts +7 -0
- package/separator/SeparatorDataAttributes.js +14 -0
- package/slider/control/SliderControl.js +16 -7
- package/slider/indicator/SliderIndicator.js +6 -6
- package/slider/label/SliderLabel.js +1 -0
- package/slider/root/SliderRoot.d.ts +6 -1
- package/slider/root/SliderRoot.js +8 -9
- package/slider/root/SliderRootContext.d.ts +1 -0
- package/slider/thumb/SliderThumb.js +65 -23
- package/slider/track/SliderTrack.js +1 -0
- package/slider/utils/roundValueToStep.d.ts +1 -0
- package/slider/utils/roundValueToStep.js +6 -1
- package/slider/value/SliderValue.js +1 -0
- package/switch/root/SwitchRoot.d.ts +5 -0
- package/switch/root/SwitchRoot.js +15 -10
- package/switch/thumb/SwitchThumb.js +1 -0
- package/tabs/indicator/TabsIndicator.d.ts +1 -1
- package/tabs/indicator/TabsIndicator.js +4 -4
- package/tabs/list/TabsList.js +3 -85
- package/tabs/panel/TabsPanel.js +1 -0
- package/tabs/root/TabsRoot.js +115 -22
- package/tabs/tab/TabsTab.js +1 -0
- package/temporal-adapter-date-fns/TemporalAdapterDateFns.d.ts +93 -0
- package/temporal-adapter-date-fns/TemporalAdapterDateFns.js +358 -0
- package/temporal-adapter-date-fns/index.d.ts +1 -0
- package/temporal-adapter-date-fns/index.js +12 -0
- package/temporal-adapter-luxon/TemporalAdapterLuxon.d.ts +89 -0
- package/temporal-adapter-luxon/TemporalAdapterLuxon.js +333 -0
- package/temporal-adapter-luxon/index.d.ts +1 -0
- package/temporal-adapter-luxon/index.js +12 -0
- package/temporal-adapter-provider/TemporalAdapterContext.d.ts +10 -0
- package/temporal-adapter-provider/TemporalAdapterContext.js +27 -0
- package/temporal-adapter-provider/TemporalAdapterProvider.d.ts +15 -0
- package/temporal-adapter-provider/TemporalAdapterProvider.js +28 -0
- package/temporal-adapter-provider/index.d.ts +1 -0
- package/temporal-adapter-provider/index.js +12 -0
- package/toast/action/ToastAction.js +1 -0
- package/toast/arrow/ToastArrow.js +1 -0
- package/toast/close/ToastClose.js +1 -0
- package/toast/content/ToastContent.js +1 -0
- package/toast/description/ToastDescription.js +1 -0
- package/toast/positioner/ToastPositioner.js +11 -26
- package/toast/positioner/ToastPositionerContext.d.ts +2 -8
- package/toast/root/ToastRoot.js +19 -6
- package/toast/root/ToastRootDataAttributes.js +4 -3
- package/toast/store.d.ts +9 -2
- package/toast/store.js +37 -12
- package/toast/title/ToastTitle.js +1 -0
- package/toast/useToastManager.d.ts +10 -2
- package/toast/viewport/ToastViewport.js +36 -26
- package/toggle/Toggle.js +2 -0
- package/toggle-group/ToggleGroup.js +4 -1
- package/toolbar/button/ToolbarButton.d.ts +1 -1
- package/toolbar/button/ToolbarButton.js +2 -0
- package/toolbar/group/ToolbarGroup.js +1 -0
- package/toolbar/input/ToolbarInput.d.ts +1 -1
- package/toolbar/input/ToolbarInput.js +2 -0
- package/toolbar/link/ToolbarLink.js +2 -0
- package/toolbar/root/ToolbarRoot.js +2 -0
- package/tooltip/arrow/TooltipArrow.js +2 -1
- package/tooltip/index.d.ts +1 -0
- package/tooltip/popup/TooltipPopup.js +1 -0
- package/tooltip/positioner/TooltipPositioner.js +10 -29
- package/tooltip/positioner/TooltipPositionerContext.d.ts +2 -9
- package/tooltip/root/TooltipRoot.d.ts +2 -2
- package/tooltip/root/TooltipRoot.js +2 -2
- package/tooltip/store/TooltipStore.js +1 -0
- package/tooltip/trigger/TooltipTrigger.js +3 -1
- package/tooltip/viewport/TooltipViewport.js +1 -0
- package/types/temporal/index.d.ts +2 -0
- package/types/temporal/index.js +27 -0
- package/types/temporal/temporal-adapter.d.ts +371 -0
- package/types/temporal/temporal-adapter.js +5 -0
- package/types/temporal/temporal.d.ts +35 -0
- package/types/temporal/temporal.js +5 -0
- package/unstable-use-media-query/index.js +2 -6
- package/use-render/useRender.d.ts +1 -1
- package/utils/FloatingPortalLite.js +1 -0
- package/utils/InternalBackdrop.js +2 -13
- package/utils/createBaseUIEventDetails.d.ts +2 -2
- package/utils/getPseudoElementBounds.js +4 -2
- package/utils/popups/store.js +1 -1
- package/utils/popups/useTriggerFocusGuards.d.ts +28 -0
- package/utils/popups/useTriggerFocusGuards.js +60 -0
- package/utils/reason-parts.d.ts +4 -1
- package/utils/reason-parts.js +5 -2
- package/{scroll-area/utils → utils}/scrollEdges.d.ts +1 -0
- package/{scroll-area/utils → utils}/scrollEdges.js +5 -1
- package/utils/temporal/date-helpers.d.ts +15 -0
- package/utils/temporal/date-helpers.js +54 -0
- package/utils/temporal/getDateManager.d.ts +5 -0
- package/utils/temporal/getDateManager.js +25 -0
- package/utils/temporal/getInitialReferenceDate.d.ts +27 -0
- package/utils/temporal/getInitialReferenceDate.js +34 -0
- package/utils/temporal/types.d.ts +65 -0
- package/utils/temporal/types.js +5 -0
- package/utils/temporal/validateDate.d.ts +27 -0
- package/utils/temporal/validateDate.js +31 -0
- package/utils/types.d.ts +11 -5
- package/utils/useAnchorPositioning.js +9 -3
- package/utils/useAnchoredPopupScrollLock.d.ts +6 -0
- package/utils/useAnchoredPopupScrollLock.js +36 -0
- package/utils/useAnimationsFinished.js +48 -51
- package/utils/useIsHydrating.d.ts +5 -0
- package/utils/useIsHydrating.js +25 -0
- package/utils/usePopupViewport.js +2 -1
- package/utils/usePositioner.d.ts +23 -0
- package/utils/usePositioner.js +39 -0
- package/utils/usePressAndHold.d.ts +58 -0
- package/utils/usePressAndHold.js +198 -0
- package/utils/useRenderElement.js +18 -3
- package/utils/useSwipeDismiss.d.ts +1 -0
- package/utils/useSwipeDismiss.js +3 -1
- package/utils/useTransitionStatus.js +3 -3
- package/esm/field/useField.d.ts +0 -14
- package/esm/field/useField.js +0 -75
- package/esm/scroll-area/utils/onVisible.d.ts +0 -4
- package/esm/scroll-area/utils/onVisible.js +0 -20
- package/field/useField.d.ts +0 -14
- package/field/useField.js +0 -81
- package/scroll-area/utils/onVisible.d.ts +0 -4
- package/scroll-area/utils/onVisible.js +0 -26
- /package/combobox/clear/{ComboboxClearDataAtributes.d.ts → ComboboxClearDataAttributes.d.ts} +0 -0
- /package/combobox/clear/{ComboboxClearDataAtributes.js → ComboboxClearDataAttributes.js} +0 -0
- /package/combobox/item/{ComboboxtemDataAttributes.d.ts → ComboboxItemDataAttributes.d.ts} +0 -0
- /package/combobox/item/{ComboboxtemDataAttributes.js → ComboboxItemDataAttributes.js} +0 -0
- /package/esm/combobox/clear/{ComboboxClearDataAtributes.d.ts → ComboboxClearDataAttributes.d.ts} +0 -0
- /package/esm/combobox/clear/{ComboboxClearDataAtributes.js → ComboboxClearDataAttributes.js} +0 -0
- /package/esm/combobox/item/{ComboboxtemDataAttributes.d.ts → ComboboxItemDataAttributes.d.ts} +0 -0
- /package/esm/combobox/item/{ComboboxtemDataAttributes.js → ComboboxItemDataAttributes.js} +0 -0
- /package/esm/navigation-menu/link/{NavigationMenuLinikDataAttributes.d.ts → NavigationMenuLinkDataAttributes.d.ts} +0 -0
- /package/esm/navigation-menu/link/{NavigationMenuLinikDataAttributes.js → NavigationMenuLinkDataAttributes.js} +0 -0
- /package/esm/navigation-menu/positioner/{NavigationPositionerDataAttributes.d.ts → NavigationMenuPositionerDataAttributes.d.ts} +0 -0
- /package/esm/navigation-menu/positioner/{NavigationPositionerDataAttributes.js → NavigationMenuPositionerDataAttributes.js} +0 -0
- /package/navigation-menu/link/{NavigationMenuLinikDataAttributes.d.ts → NavigationMenuLinkDataAttributes.d.ts} +0 -0
- /package/navigation-menu/link/{NavigationMenuLinikDataAttributes.js → NavigationMenuLinkDataAttributes.js} +0 -0
- /package/navigation-menu/positioner/{NavigationPositionerDataAttributes.d.ts → NavigationMenuPositionerDataAttributes.d.ts} +0 -0
- /package/navigation-menu/positioner/{NavigationPositionerDataAttributes.js → NavigationMenuPositionerDataAttributes.js} +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ReactDOM from 'react-dom';
|
|
5
|
+
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
6
|
+
import { contains, getNextTabbable, getTabbableAfterElement, getTabbableBeforeElement, isOutsideEvent } from "../../floating-ui-react/utils.js";
|
|
7
|
+
import { createChangeEventDetails } from "../createBaseUIEventDetails.js";
|
|
8
|
+
import { REASONS } from "../reasons.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Minimal store interface required by the focus guard hook.
|
|
12
|
+
* Both PopoverStore and MenuStore satisfy this interface.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Provides focus guard handlers for popup triggers (Popover, Menu).
|
|
17
|
+
*
|
|
18
|
+
* When the popup is open, invisible focus guard elements are placed before and after
|
|
19
|
+
* the trigger. These handlers close the popup and move focus to the appropriate
|
|
20
|
+
* tabbable element when the guards receive focus (i.e. when the user tabs out).
|
|
21
|
+
*/
|
|
22
|
+
export function useTriggerFocusGuards(store, triggerElementRef) {
|
|
23
|
+
const preFocusGuardRef = React.useRef(null);
|
|
24
|
+
const handlePreFocusGuardFocus = useStableCallback(event => {
|
|
25
|
+
ReactDOM.flushSync(() => {
|
|
26
|
+
store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent, event.currentTarget));
|
|
27
|
+
});
|
|
28
|
+
const previousTabbable = getTabbableBeforeElement(preFocusGuardRef.current);
|
|
29
|
+
previousTabbable?.focus();
|
|
30
|
+
});
|
|
31
|
+
const handleFocusTargetFocus = useStableCallback(event => {
|
|
32
|
+
const positionerElement = store.select('positionerElement');
|
|
33
|
+
if (positionerElement && isOutsideEvent(event, positionerElement)) {
|
|
34
|
+
store.context.beforeContentFocusGuardRef.current?.focus();
|
|
35
|
+
} else {
|
|
36
|
+
ReactDOM.flushSync(() => {
|
|
37
|
+
store.setOpen(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent, event.currentTarget));
|
|
38
|
+
});
|
|
39
|
+
let nextTabbable = getTabbableAfterElement(store.context.triggerFocusTargetRef.current || triggerElementRef.current);
|
|
40
|
+
while (nextTabbable !== null && contains(positionerElement, nextTabbable)) {
|
|
41
|
+
const prevTabbable = nextTabbable;
|
|
42
|
+
nextTabbable = getNextTabbable(nextTabbable);
|
|
43
|
+
if (nextTabbable === prevTabbable) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
nextTabbable?.focus();
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
preFocusGuardRef,
|
|
52
|
+
handlePreFocusGuardFocus,
|
|
53
|
+
handleFocusTargetFocus
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -30,4 +30,7 @@ export declare const siblingOpen: "sibling-open";
|
|
|
30
30
|
export declare const disabled: "disabled";
|
|
31
31
|
export declare const imperativeAction: "imperative-action";
|
|
32
32
|
export declare const swipe: "swipe";
|
|
33
|
-
export declare const windowResize: "window-resize";
|
|
33
|
+
export declare const windowResize: "window-resize";
|
|
34
|
+
export declare const dayPress: "day-press";
|
|
35
|
+
export declare const monthChange: "month-change";
|
|
36
|
+
export declare const valuePropChange: "value-prop-change";
|
|
@@ -30,4 +30,7 @@ export const siblingOpen = 'sibling-open';
|
|
|
30
30
|
export const disabled = 'disabled';
|
|
31
31
|
export const imperativeAction = 'imperative-action';
|
|
32
32
|
export const swipe = 'swipe';
|
|
33
|
-
export const windowResize = 'window-resize';
|
|
33
|
+
export const windowResize = 'window-resize';
|
|
34
|
+
export const dayPress = 'day-press';
|
|
35
|
+
export const monthChange = 'month-change';
|
|
36
|
+
export const valuePropChange = 'value-prop-change';
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { clamp } from "
|
|
1
|
+
import { clamp } from "./clamp.js";
|
|
2
2
|
export const SCROLL_EDGE_TOLERANCE_PX = 1;
|
|
3
|
+
export function getMaxScrollOffset(scrollSize, clientSize) {
|
|
4
|
+
return Math.max(0, scrollSize - clientSize);
|
|
5
|
+
}
|
|
3
6
|
export function normalizeScrollOffset(value, max) {
|
|
4
7
|
if (max <= 0) {
|
|
5
8
|
return 0;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TemporalAdapter, TemporalSupportedObject } from "../../types/temporal/index.js";
|
|
2
|
+
export declare function mergeDateAndTime(adapter: TemporalAdapter, dateParam: TemporalSupportedObject, timeParam: TemporalSupportedObject): TemporalSupportedObject;
|
|
3
|
+
export declare function areDatesEqual(adapter: TemporalAdapter, a: TemporalSupportedObject | null, b: TemporalSupportedObject | null): boolean;
|
|
4
|
+
export declare function replaceInvalidDateByNull(adapter: TemporalAdapter, value: TemporalSupportedObject | null): TemporalSupportedObject | null;
|
|
5
|
+
/**
|
|
6
|
+
* Check if the day of the date A is after the day of the date B.
|
|
7
|
+
* Uses timezone of the date A.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isAfterDay(adapter: TemporalAdapter, dateA: TemporalSupportedObject, dateB: TemporalSupportedObject): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Check if the day of the date A is before the day of the date B.
|
|
12
|
+
* Uses timezone of the date A.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isBeforeDay(adapter: TemporalAdapter, dateA: TemporalSupportedObject, dateB: TemporalSupportedObject): boolean;
|
|
15
|
+
export declare function formatMonthFullLetterAndYear(adapter: TemporalAdapter, date: TemporalSupportedObject): string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function mergeDateAndTime(adapter, dateParam, timeParam) {
|
|
2
|
+
let mergedDate = dateParam;
|
|
3
|
+
mergedDate = adapter.setHours(mergedDate, adapter.getHours(timeParam));
|
|
4
|
+
mergedDate = adapter.setMinutes(mergedDate, adapter.getMinutes(timeParam));
|
|
5
|
+
mergedDate = adapter.setSeconds(mergedDate, adapter.getSeconds(timeParam));
|
|
6
|
+
mergedDate = adapter.setMilliseconds(mergedDate, adapter.getMilliseconds(timeParam));
|
|
7
|
+
return mergedDate;
|
|
8
|
+
}
|
|
9
|
+
export function areDatesEqual(adapter, a, b) {
|
|
10
|
+
if (!adapter.isValid(a) && a != null && !adapter.isValid(b) && b != null) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return adapter.isEqual(a, b);
|
|
14
|
+
}
|
|
15
|
+
export function replaceInvalidDateByNull(adapter, value) {
|
|
16
|
+
if (adapter.isValid(value)) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Check if the day of the date A is after the day of the date B.
|
|
24
|
+
* Uses timezone of the date A.
|
|
25
|
+
*/
|
|
26
|
+
export function isAfterDay(adapter, dateA, dateB) {
|
|
27
|
+
const dateBWithCorrectTimezone = adapter.setTimezone(dateB, adapter.getTimezone(dateA));
|
|
28
|
+
return adapter.isAfter(dateA, adapter.endOfDay(dateBWithCorrectTimezone));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Check if the day of the date A is before the day of the date B.
|
|
33
|
+
* Uses timezone of the date A.
|
|
34
|
+
*/
|
|
35
|
+
export function isBeforeDay(adapter, dateA, dateB) {
|
|
36
|
+
const dateBWithCorrectTimezone = adapter.setTimezone(dateB, adapter.getTimezone(dateA));
|
|
37
|
+
return adapter.isBefore(dateA, adapter.startOfDay(dateBWithCorrectTimezone));
|
|
38
|
+
}
|
|
39
|
+
export function formatMonthFullLetterAndYear(adapter, date) {
|
|
40
|
+
const f = adapter.formats;
|
|
41
|
+
const dateFormat = `${f.monthFullLetter} ${f.yearPadded}`;
|
|
42
|
+
return adapter.formatByString(date, dateFormat);
|
|
43
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ValidateDateReturnValue, ValidateDateValidationProps } from "./validateDate.js";
|
|
2
|
+
import { TemporalManager } from "./types.js";
|
|
3
|
+
import { TemporalValue, TemporalAdapter } from "../../types/temporal/index.js";
|
|
4
|
+
export declare function getDateManager(adapter: TemporalAdapter): GetDateManagerReturnValue;
|
|
5
|
+
export type GetDateManagerReturnValue = TemporalManager<TemporalValue, ValidateDateReturnValue, ValidateDateValidationProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { areDatesEqual } from "./date-helpers.js";
|
|
2
|
+
import { validateDate } from "./validateDate.js";
|
|
3
|
+
export function getDateManager(adapter) {
|
|
4
|
+
return {
|
|
5
|
+
emptyValue: null,
|
|
6
|
+
emptyValidationError: null,
|
|
7
|
+
areValuesEqual: (valueA, valueB) => areDatesEqual(adapter, valueA, valueB),
|
|
8
|
+
getValidationError: (value, validationProps) => validateDate({
|
|
9
|
+
adapter,
|
|
10
|
+
value,
|
|
11
|
+
validationProps
|
|
12
|
+
}),
|
|
13
|
+
areValidationErrorEquals: (errorA, errorB) => errorA === errorB,
|
|
14
|
+
isValidationErrorEmpty: error => error == null,
|
|
15
|
+
getTimezone: value => adapter.isValid(value) ? adapter.getTimezone(value) : null,
|
|
16
|
+
setTimezone: (value, timezone) => value == null ? null : adapter.setTimezone(value, timezone),
|
|
17
|
+
getDatesFromValue: value => value == null ? [] : [value]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TemporalAdapter, TemporalTimezone, TemporalSupportedObject } from "../../types/temporal/index.js";
|
|
2
|
+
import { ValidateDateValidationProps } from "./validateDate.js";
|
|
3
|
+
export declare function getInitialReferenceDate(parameters: GetInitialReferenceDateParameters): TemporalSupportedObject;
|
|
4
|
+
export interface GetInitialReferenceDateParameters {
|
|
5
|
+
/**
|
|
6
|
+
* The adapter used to manipulate the date.
|
|
7
|
+
*/
|
|
8
|
+
adapter: TemporalAdapter;
|
|
9
|
+
/**
|
|
10
|
+
* The date provided by the user, if any.
|
|
11
|
+
* If the component is a range component, this will be the start date if defined or the end date otherwise.
|
|
12
|
+
*/
|
|
13
|
+
externalDate: TemporalSupportedObject | null;
|
|
14
|
+
/**
|
|
15
|
+
* The reference date provided by the user, if any.
|
|
16
|
+
*/
|
|
17
|
+
externalReferenceDate: TemporalSupportedObject | null;
|
|
18
|
+
/**
|
|
19
|
+
* The timezone the reference date should be in.
|
|
20
|
+
*/
|
|
21
|
+
timezone: TemporalTimezone;
|
|
22
|
+
/**
|
|
23
|
+
* The props used to validate the date, time or date-time object.
|
|
24
|
+
*/
|
|
25
|
+
validationProps: GetInitialReferenceDateValidationProps;
|
|
26
|
+
}
|
|
27
|
+
export interface GetInitialReferenceDateValidationProps extends ValidateDateValidationProps {}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isAfterDay, isBeforeDay } from "./date-helpers.js";
|
|
2
|
+
export function getInitialReferenceDate(parameters) {
|
|
3
|
+
const {
|
|
4
|
+
adapter,
|
|
5
|
+
timezone,
|
|
6
|
+
externalDate,
|
|
7
|
+
externalReferenceDate,
|
|
8
|
+
validationProps: {
|
|
9
|
+
minDate,
|
|
10
|
+
maxDate
|
|
11
|
+
}
|
|
12
|
+
} = parameters;
|
|
13
|
+
let referenceDate = null;
|
|
14
|
+
if (adapter.isValid(externalDate)) {
|
|
15
|
+
referenceDate = externalDate;
|
|
16
|
+
} else if (adapter.isValid(externalReferenceDate)) {
|
|
17
|
+
referenceDate = externalReferenceDate;
|
|
18
|
+
} else {
|
|
19
|
+
referenceDate = adapter.startOfDay(adapter.now(timezone));
|
|
20
|
+
if (minDate != null && isBeforeDay(adapter, referenceDate, minDate)) {
|
|
21
|
+
referenceDate = minDate;
|
|
22
|
+
}
|
|
23
|
+
if (maxDate != null && isAfterDay(adapter, referenceDate, maxDate)) {
|
|
24
|
+
referenceDate = maxDate;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return adapter.setTimezone(referenceDate, timezone);
|
|
28
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { TemporalTimezone, TemporalSupportedValue, TemporalSupportedObject } from "../../types/temporal/index.js";
|
|
2
|
+
export interface TemporalTimezoneProps {
|
|
3
|
+
/**
|
|
4
|
+
* Choose which timezone to use for the value.
|
|
5
|
+
* Example: "default", "system", "UTC", "America/New_York".
|
|
6
|
+
* If you pass values from other timezones to some props, they will be converted to this timezone before being used.
|
|
7
|
+
* @default 'The timezone of the "value" or "defaultValue" prop if defined, "default" otherwise.'
|
|
8
|
+
*/
|
|
9
|
+
timezone?: TemporalTimezone | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface TemporalOnErrorProps<TValue extends TemporalSupportedValue, TError> {
|
|
12
|
+
/**
|
|
13
|
+
* Callback fired when the error associated with the current value changes.
|
|
14
|
+
* When a validation error is detected, the `error` parameter contains a non-null value.
|
|
15
|
+
* This can be used to render an appropriate form error.
|
|
16
|
+
* @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
|
|
17
|
+
* @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
|
|
18
|
+
* @param {TError} error The reason why the current value is not valid.
|
|
19
|
+
* @param {TValue} value The value associated with the error.
|
|
20
|
+
*/
|
|
21
|
+
onError?: ((error: TError, value: TValue) => void) | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Object that contains all the necessary methods and properties to adapt a temporal component or utilities for a given value type.
|
|
25
|
+
*/
|
|
26
|
+
export interface TemporalManager<TValue extends TemporalSupportedValue, TError, TValidationProps extends {}> {
|
|
27
|
+
/**
|
|
28
|
+
* Value to set when emptying the component.
|
|
29
|
+
*/
|
|
30
|
+
emptyValue: TValue;
|
|
31
|
+
/**
|
|
32
|
+
* Error when the value is valid.
|
|
33
|
+
* It is used to initialize the error state.
|
|
34
|
+
*/
|
|
35
|
+
emptyValidationError: TError;
|
|
36
|
+
/**
|
|
37
|
+
* Checks whether two values are equal.
|
|
38
|
+
*/
|
|
39
|
+
areValuesEqual: (valueA: TValue, valueB: TValue) => boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the error associated with a value for the current set of validation props.
|
|
42
|
+
*/
|
|
43
|
+
getValidationError: (value: TValue, validationProps: TValidationProps) => TError;
|
|
44
|
+
/**
|
|
45
|
+
* Checks whether two validation errors are equal.
|
|
46
|
+
*/
|
|
47
|
+
areValidationErrorEquals: (errorA: TError, errorB: TError | null) => boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Checks whether the current validation error is empty.
|
|
50
|
+
*/
|
|
51
|
+
isValidationErrorEmpty: (error: TError) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the timezone of the date inside a value.
|
|
54
|
+
* When used on a range component, throw an error if both values don't have the same timezone.
|
|
55
|
+
*/
|
|
56
|
+
getTimezone: (value: TValue) => string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Changes the timezone of the dates inside a value.
|
|
59
|
+
*/
|
|
60
|
+
setTimezone: (value: TValue, timezone: TemporalTimezone) => TValue;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the list of dates contained in the value.
|
|
63
|
+
*/
|
|
64
|
+
getDatesFromValue: (value: TValue) => TemporalSupportedObject[];
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TemporalAdapter, TemporalValue, TemporalSupportedObject } from "../../types/temporal/index.js";
|
|
2
|
+
export declare function validateDate(parameters: ValidateDateParameters): ValidateDateReturnValue;
|
|
3
|
+
export interface ValidateDateParameters {
|
|
4
|
+
/**
|
|
5
|
+
* The adapter used to manipulate the date.
|
|
6
|
+
*/
|
|
7
|
+
adapter: TemporalAdapter;
|
|
8
|
+
/**
|
|
9
|
+
* The value to validate.
|
|
10
|
+
*/
|
|
11
|
+
value: TemporalValue;
|
|
12
|
+
/**
|
|
13
|
+
* The props used to validate a date.
|
|
14
|
+
*/
|
|
15
|
+
validationProps: ValidateDateValidationProps;
|
|
16
|
+
}
|
|
17
|
+
export interface ValidateDateValidationProps {
|
|
18
|
+
/**
|
|
19
|
+
* Minimal selectable date.
|
|
20
|
+
*/
|
|
21
|
+
minDate?: TemporalSupportedObject | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Maximal selectable date.
|
|
24
|
+
*/
|
|
25
|
+
maxDate?: TemporalSupportedObject | undefined;
|
|
26
|
+
}
|
|
27
|
+
export type ValidateDateReturnValue = 'invalid' | 'before-min-date' | 'after-max-date' | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isAfterDay, isBeforeDay } from "./date-helpers.js";
|
|
2
|
+
export function validateDate(parameters) {
|
|
3
|
+
const {
|
|
4
|
+
adapter,
|
|
5
|
+
value,
|
|
6
|
+
validationProps
|
|
7
|
+
} = parameters;
|
|
8
|
+
if (value === null) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const {
|
|
12
|
+
minDate,
|
|
13
|
+
maxDate
|
|
14
|
+
} = validationProps;
|
|
15
|
+
if (!adapter.isValid(value)) {
|
|
16
|
+
return 'invalid';
|
|
17
|
+
}
|
|
18
|
+
if (minDate != null && isBeforeDay(adapter, value, minDate)) {
|
|
19
|
+
return 'before-min-date';
|
|
20
|
+
}
|
|
21
|
+
if (maxDate != null && isAfterDay(adapter, value, maxDate)) {
|
|
22
|
+
return 'after-max-date';
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
package/esm/utils/types.d.ts
CHANGED
|
@@ -17,14 +17,14 @@ export type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K]
|
|
|
17
17
|
* Props shared by all Base UI components.
|
|
18
18
|
* Contains `className` (string or callback taking the component's state as an argument) and `render` (function to customize rendering).
|
|
19
19
|
*/
|
|
20
|
-
export type BaseUIComponentProps<ElementType extends React.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked'> & {
|
|
20
|
+
export type BaseUIComponentProps<ElementType extends React.ElementType, State, RenderFunctionProps = HTMLProps> = Omit<WithBaseUIEvent<React.ComponentPropsWithRef<ElementType>>, 'className' | 'color' | 'defaultValue' | 'defaultChecked' | 'style'> & {
|
|
21
21
|
/**
|
|
22
22
|
* CSS class applied to the element, or a function that
|
|
23
|
-
* returns a class based on the component
|
|
23
|
+
* returns a class based on the component's state.
|
|
24
24
|
*/
|
|
25
25
|
className?: string | ((state: State) => string | undefined) | undefined;
|
|
26
26
|
/**
|
|
27
|
-
* Allows you to replace the component
|
|
27
|
+
* Allows you to replace the component's HTML element
|
|
28
28
|
* with a different tag, or compose it with another component.
|
|
29
29
|
*
|
|
30
30
|
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
@@ -32,7 +32,7 @@ export type BaseUIComponentProps<ElementType extends React.ElementType, State, R
|
|
|
32
32
|
render?: React.ReactElement | ComponentRenderFn<RenderFunctionProps, State> | undefined;
|
|
33
33
|
/**
|
|
34
34
|
* Style applied to the element, or a function that
|
|
35
|
-
* returns a style object based on the component
|
|
35
|
+
* returns a style object based on the component's state.
|
|
36
36
|
*/
|
|
37
37
|
style?: React.CSSProperties | ((state: State) => React.CSSProperties | undefined) | undefined;
|
|
38
38
|
};
|
|
@@ -40,7 +40,7 @@ export interface NativeButtonProps {
|
|
|
40
40
|
/**
|
|
41
41
|
* Whether the component renders a native `<button>` element when replacing it
|
|
42
42
|
* via the `render` prop.
|
|
43
|
-
* Set to `false` if the rendered element is not a button (
|
|
43
|
+
* Set to `false` if the rendered element is not a button (for example, `<div>`).
|
|
44
44
|
* @default true
|
|
45
45
|
*/
|
|
46
46
|
nativeButton?: boolean | undefined;
|
|
@@ -59,5 +59,11 @@ export interface NonNativeButtonProps {
|
|
|
59
59
|
* Taken from https://effectivetypescript.com/2022/02/25/gentips-4-display/
|
|
60
60
|
*/
|
|
61
61
|
export type Simplify<T> = T extends Function ? T : { [K in keyof T]: T[K] };
|
|
62
|
+
/**
|
|
63
|
+
* Makes specified keys in a type required.
|
|
64
|
+
*
|
|
65
|
+
* @template T - The original type.
|
|
66
|
+
* @template K - The keys to make required.
|
|
67
|
+
*/
|
|
62
68
|
export type RequiredExcept<T, K extends keyof T> = Required<Omit<T, K>> & Pick<T, K>;
|
|
63
69
|
export type Orientation = 'horizontal' | 'vertical';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { getSide, getAlignment, getSideAxis } from '@floating-ui/utils';
|
|
5
|
-
import { ownerDocument } from '@base-ui/utils/owner';
|
|
5
|
+
import { ownerDocument, ownerWindow } from '@base-ui/utils/owner';
|
|
6
6
|
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
7
7
|
import { useValueAsRef } from '@base-ui/utils/useValueAsRef';
|
|
8
8
|
import { useStableCallback } from '@base-ui/utils/useStableCallback';
|
|
@@ -81,6 +81,7 @@ export function useAnchorPositioning(params) {
|
|
|
81
81
|
const anchorFnCallback = useStableCallback(anchorFn);
|
|
82
82
|
const anchorDep = anchorFn ? anchorFnCallback : anchor;
|
|
83
83
|
const anchorValueRef = useValueAsRef(anchor);
|
|
84
|
+
const mountedRef = useValueAsRef(mounted);
|
|
84
85
|
const direction = useDirection();
|
|
85
86
|
const isRtl = direction === 'rtl';
|
|
86
87
|
const side = mountSide || {
|
|
@@ -206,12 +207,15 @@ export function useAnchorPositioning(params) {
|
|
|
206
207
|
availableHeight,
|
|
207
208
|
rects
|
|
208
209
|
}) {
|
|
210
|
+
if (!mountedRef.current) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
209
213
|
const floatingStyle = floating.style;
|
|
210
214
|
floatingStyle.setProperty('--available-width', `${availableWidth}px`);
|
|
211
215
|
floatingStyle.setProperty('--available-height', `${availableHeight}px`);
|
|
212
216
|
|
|
213
217
|
// Snap anchor dimensions to device pixels to ensure the popup's visual width matches the anchor's one.
|
|
214
|
-
const dpr =
|
|
218
|
+
const dpr = ownerWindow(floating).devicePixelRatio || 1;
|
|
215
219
|
const {
|
|
216
220
|
x,
|
|
217
221
|
y,
|
|
@@ -226,7 +230,7 @@ export function useAnchorPositioning(params) {
|
|
|
226
230
|
}), arrow(() => ({
|
|
227
231
|
// `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
|
|
228
232
|
// we'll create a fake element.
|
|
229
|
-
element: arrowRef.current ||
|
|
233
|
+
element: arrowRef.current || ownerDocument(arrowRef.current).createElement('div'),
|
|
230
234
|
padding: arrowPadding,
|
|
231
235
|
offsetParent: 'floating'
|
|
232
236
|
}), [arrowPadding]), {
|
|
@@ -270,7 +274,8 @@ export function useAnchorPositioning(params) {
|
|
|
270
274
|
floatingRootContext.update({
|
|
271
275
|
referenceElement: null,
|
|
272
276
|
floatingElement: null,
|
|
273
|
-
domReferenceElement: null
|
|
277
|
+
domReferenceElement: null,
|
|
278
|
+
positionReference: null
|
|
274
279
|
});
|
|
275
280
|
}
|
|
276
281
|
}, [mounted, floatingRootContext]);
|
|
@@ -291,6 +296,7 @@ export function useAnchorPositioning(params) {
|
|
|
291
296
|
floatingStyles: originalFloatingStyles
|
|
292
297
|
} = useFloating({
|
|
293
298
|
rootContext: floatingRootContext,
|
|
299
|
+
open: keepMounted ? mounted : undefined,
|
|
294
300
|
placement,
|
|
295
301
|
middleware,
|
|
296
302
|
strategy: positionMethod,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when
|
|
3
|
+
* enabled. For touch opens, scroll lock is applied only when the positioner width is effectively
|
|
4
|
+
* viewport-sized.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAnchoredPopupScrollLock(enabled: boolean, touchOpen: boolean, positionerElement: HTMLElement | null, referenceElement: Element | null): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ownerDocument } from '@base-ui/utils/owner';
|
|
5
|
+
import { useScrollLock } from '@base-ui/utils/useScrollLock';
|
|
6
|
+
import { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';
|
|
7
|
+
|
|
8
|
+
// Touch-opened popups normally avoid scroll locking so users can still swipe outside to dismiss.
|
|
9
|
+
// This hook re-enables scroll lock only when the popup is effectively full-width.
|
|
10
|
+
// Treat popups with up to 20px of total horizontal gutter as full-width so common ~10px side
|
|
11
|
+
// padding still locks scroll, since that leaves too little outside space for a reliable swipe.
|
|
12
|
+
const VIEWPORT_WIDTH_TOLERANCE_PX = 20;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when
|
|
16
|
+
* enabled. For touch opens, scroll lock is applied only when the positioner width is effectively
|
|
17
|
+
* viewport-sized.
|
|
18
|
+
*/
|
|
19
|
+
export function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
|
|
20
|
+
const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = React.useState(false);
|
|
21
|
+
useIsoLayoutEffect(() => {
|
|
22
|
+
if (!enabled || !touchOpen || positionerElement == null) {
|
|
23
|
+
setTouchOpenShouldLockScroll(false);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;
|
|
27
|
+
const popupWidth = positionerElement.offsetWidth;
|
|
28
|
+
setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);
|
|
29
|
+
}, [enabled, touchOpen, positionerElement]);
|
|
30
|
+
useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
|
|
31
|
+
}
|
|
@@ -24,69 +24,66 @@ export function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved
|
|
|
24
24
|
*/
|
|
25
25
|
signal = null) => {
|
|
26
26
|
frame.cancel();
|
|
27
|
-
function done() {
|
|
28
|
-
// Synchronously flush the unmounting of the component so that the browser doesn't
|
|
29
|
-
// paint: https://github.com/mui/base-ui/issues/979
|
|
30
|
-
ReactDOM.flushSync(fnToExecute);
|
|
31
|
-
}
|
|
32
27
|
const element = resolveRef(elementOrRef);
|
|
33
28
|
if (element == null) {
|
|
34
29
|
return;
|
|
35
30
|
}
|
|
36
31
|
const resolvedElement = element;
|
|
32
|
+
const done = () => {
|
|
33
|
+
// Synchronously flush the unmounting of the component so that the browser doesn't
|
|
34
|
+
// paint: https://github.com/mui/base-ui/issues/979
|
|
35
|
+
ReactDOM.flushSync(fnToExecute);
|
|
36
|
+
};
|
|
37
37
|
if (typeof resolvedElement.getAnimations !== 'function' || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
|
|
38
38
|
fnToExecute();
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// to give "open" animations a chance to be registered.
|
|
45
|
-
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
|
|
46
|
-
frame.request(exec);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Wait for `[data-starting-style]` to have been removed.
|
|
51
|
-
const attributeObserver = new MutationObserver(() => {
|
|
52
|
-
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
|
|
53
|
-
attributeObserver.disconnect();
|
|
54
|
-
exec();
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
attributeObserver.observe(resolvedElement, {
|
|
58
|
-
attributes: true,
|
|
59
|
-
attributeFilter: [startingStyleAttribute]
|
|
60
|
-
});
|
|
61
|
-
signal?.addEventListener('abort', () => attributeObserver.disconnect(), {
|
|
62
|
-
once: true
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function exec() {
|
|
66
|
-
Promise.all(resolvedElement.getAnimations().map(anim => anim.finished)).then(() => {
|
|
67
|
-
if (signal?.aborted) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
function exec() {
|
|
42
|
+
Promise.all(resolvedElement.getAnimations().map(animation => animation.finished)).then(() => {
|
|
43
|
+
if (!signal?.aborted) {
|
|
70
44
|
done();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
45
|
+
}
|
|
46
|
+
}).catch(() => {
|
|
47
|
+
if (treatAbortedAsFinished) {
|
|
48
|
+
if (!signal?.aborted) {
|
|
77
49
|
done();
|
|
78
|
-
} else if (currentAnimations.length > 0 && currentAnimations.some(anim => anim.pending || anim.playState !== 'finished')) {
|
|
79
|
-
// Sometimes animations can be aborted because a property they depend on changes while the animation plays.
|
|
80
|
-
// In such cases, we need to re-check if any new animations have started.
|
|
81
|
-
exec();
|
|
82
50
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const currentAnimations = resolvedElement.getAnimations();
|
|
54
|
+
if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some(animation => animation.pending || animation.playState !== 'finished')) {
|
|
55
|
+
// Sometimes animations can be aborted because a property they depend on changes while the animation plays.
|
|
56
|
+
// In such cases, we need to re-check if any new animations have started.
|
|
57
|
+
exec();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
if (waitForStartingStyleRemoved) {
|
|
62
|
+
const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;
|
|
63
|
+
|
|
64
|
+
// If `[data-starting-style]` isn't present, fall back to waiting one more frame
|
|
65
|
+
// to give "open" animations a chance to be registered.
|
|
66
|
+
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
|
|
67
|
+
frame.request(exec);
|
|
87
68
|
return;
|
|
88
69
|
}
|
|
89
|
-
|
|
70
|
+
|
|
71
|
+
// Wait for `[data-starting-style]` to have been removed.
|
|
72
|
+
const attributeObserver = new MutationObserver(() => {
|
|
73
|
+
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
|
|
74
|
+
attributeObserver.disconnect();
|
|
75
|
+
exec();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
attributeObserver.observe(resolvedElement, {
|
|
79
|
+
attributes: true,
|
|
80
|
+
attributeFilter: [startingStyleAttribute]
|
|
81
|
+
});
|
|
82
|
+
signal?.addEventListener('abort', () => attributeObserver.disconnect(), {
|
|
83
|
+
once: true
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
90
86
|
}
|
|
87
|
+
frame.request(exec);
|
|
91
88
|
});
|
|
92
89
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
2
|
+
import { NOOP } from "./noop.js";
|
|
3
|
+
function subscribe() {
|
|
4
|
+
return NOOP;
|
|
5
|
+
}
|
|
6
|
+
function getSnapshot() {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
function getServerSnapshot() {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Returns `true` while React is hydrating server-rendered markup and `false`
|
|
15
|
+
* for fresh client-only mounts.
|
|
16
|
+
*/
|
|
17
|
+
export function useIsHydrating() {
|
|
18
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
19
|
+
}
|