@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,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useFieldControlRegistration = useFieldControlRegistration;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var ReactDOM = _interopRequireWildcard(require("react-dom"));
|
|
11
|
+
var _useIsoLayoutEffect = require("@base-ui/utils/useIsoLayoutEffect");
|
|
12
|
+
var _useStableCallback = require("@base-ui/utils/useStableCallback");
|
|
13
|
+
var _getCombinedFieldValidityData = require("../utils/getCombinedFieldValidityData");
|
|
14
|
+
var _FormContext = require("../../form/FormContext");
|
|
15
|
+
function useFieldControlRegistration(params) {
|
|
16
|
+
const {
|
|
17
|
+
commit,
|
|
18
|
+
invalid,
|
|
19
|
+
markedDirtyRef,
|
|
20
|
+
name,
|
|
21
|
+
setValidityData,
|
|
22
|
+
validityData
|
|
23
|
+
} = params;
|
|
24
|
+
const {
|
|
25
|
+
formRef
|
|
26
|
+
} = (0, _FormContext.useFormContext)();
|
|
27
|
+
const activeFieldControlSourceRef = React.useRef(null);
|
|
28
|
+
const registrationRef = React.useRef(null);
|
|
29
|
+
const fallbackControlRef = React.useRef(null);
|
|
30
|
+
const getValue = (0, _useStableCallback.useStableCallback)(() => {
|
|
31
|
+
const registration = registrationRef.current;
|
|
32
|
+
if (!registration) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
if (registration.getValue) {
|
|
36
|
+
return registration.getValue();
|
|
37
|
+
}
|
|
38
|
+
return registration.value;
|
|
39
|
+
});
|
|
40
|
+
const validate = (0, _useStableCallback.useStableCallback)((flushSync = true) => {
|
|
41
|
+
const registration = registrationRef.current;
|
|
42
|
+
if (!registration) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let nextValue = registration.value;
|
|
46
|
+
if (nextValue === undefined) {
|
|
47
|
+
nextValue = getValue();
|
|
48
|
+
}
|
|
49
|
+
markedDirtyRef.current = true;
|
|
50
|
+
if (!flushSync) {
|
|
51
|
+
commit(nextValue);
|
|
52
|
+
} else {
|
|
53
|
+
// Synchronously update the validity state so the submit event can be prevented.
|
|
54
|
+
ReactDOM.flushSync(() => commit(nextValue));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
function refreshRegistration() {
|
|
58
|
+
const registration = registrationRef.current;
|
|
59
|
+
if (!registration || !registration.id) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
formRef.current.fields.set(registration.id, {
|
|
63
|
+
getValue,
|
|
64
|
+
name,
|
|
65
|
+
controlRef: registration.controlRef ?? fallbackControlRef,
|
|
66
|
+
validityData: (0, _getCombinedFieldValidityData.getCombinedFieldValidityData)(validityData, invalid),
|
|
67
|
+
validate
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function deleteRegistration(id = registrationRef.current?.id) {
|
|
71
|
+
if (id) {
|
|
72
|
+
formRef.current.fields.delete(id);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function syncInitialValue() {
|
|
76
|
+
const registration = registrationRef.current;
|
|
77
|
+
if (!registration) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let initialValue = registration.value;
|
|
81
|
+
if (initialValue === undefined) {
|
|
82
|
+
initialValue = getValue();
|
|
83
|
+
}
|
|
84
|
+
if (validityData.initialValue === null && initialValue !== null) {
|
|
85
|
+
setValidityData(prev => ({
|
|
86
|
+
...prev,
|
|
87
|
+
initialValue
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
(0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
|
|
92
|
+
const registration = registrationRef.current;
|
|
93
|
+
if (!registration || !registration.id) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
formRef.current.fields.set(registration.id, {
|
|
97
|
+
getValue,
|
|
98
|
+
name,
|
|
99
|
+
controlRef: registration.controlRef ?? fallbackControlRef,
|
|
100
|
+
validityData: (0, _getCombinedFieldValidityData.getCombinedFieldValidityData)(validityData, invalid),
|
|
101
|
+
validate
|
|
102
|
+
});
|
|
103
|
+
}, [formRef, getValue, invalid, name, validate, validityData]);
|
|
104
|
+
(0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
|
|
105
|
+
const fields = formRef.current.fields;
|
|
106
|
+
return () => {
|
|
107
|
+
const id = registrationRef.current?.id;
|
|
108
|
+
if (id) {
|
|
109
|
+
fields.delete(id);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}, [formRef]);
|
|
113
|
+
return (0, _useStableCallback.useStableCallback)((source, registration) => {
|
|
114
|
+
if (!registration) {
|
|
115
|
+
if (activeFieldControlSourceRef.current === source) {
|
|
116
|
+
activeFieldControlSourceRef.current = null;
|
|
117
|
+
deleteRegistration();
|
|
118
|
+
registrationRef.current = null;
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const previousId = registrationRef.current?.id;
|
|
123
|
+
activeFieldControlSourceRef.current = source;
|
|
124
|
+
registrationRef.current = registration;
|
|
125
|
+
if (previousId && previousId !== registration.id) {
|
|
126
|
+
deleteRegistration(previousId);
|
|
127
|
+
}
|
|
128
|
+
syncInitialValue();
|
|
129
|
+
refreshRegistration();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { FieldControlRegistration } from "./useFieldControlRegistration.js";
|
|
2
|
+
export interface UseRegisterFieldControlParameters extends FieldControlRegistration {
|
|
3
|
+
enabled?: boolean | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function useRegisterFieldControl(controlRef: FieldControlRegistration['controlRef'], params: Omit<UseRegisterFieldControlParameters, 'controlRef'>): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useRegisterFieldControl = useRegisterFieldControl;
|
|
9
|
+
var React = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _useIsoLayoutEffect = require("@base-ui/utils/useIsoLayoutEffect");
|
|
11
|
+
var _FieldRootContext = require("./FieldRootContext");
|
|
12
|
+
function useRegisterFieldControl(controlRef, params) {
|
|
13
|
+
const {
|
|
14
|
+
enabled = true,
|
|
15
|
+
getValue,
|
|
16
|
+
id,
|
|
17
|
+
value
|
|
18
|
+
} = params;
|
|
19
|
+
const {
|
|
20
|
+
registerFieldControl
|
|
21
|
+
} = (0, _FieldRootContext.useFieldRootContext)();
|
|
22
|
+
const sourceRef = React.useRef(null);
|
|
23
|
+
if (!sourceRef.current) {
|
|
24
|
+
sourceRef.current = Symbol();
|
|
25
|
+
}
|
|
26
|
+
(0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
|
|
27
|
+
const source = sourceRef.current;
|
|
28
|
+
if (!source || !enabled) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
registerFieldControl(source, {
|
|
32
|
+
controlRef,
|
|
33
|
+
getValue,
|
|
34
|
+
id,
|
|
35
|
+
value
|
|
36
|
+
});
|
|
37
|
+
return () => {
|
|
38
|
+
registerFieldControl(source, undefined);
|
|
39
|
+
};
|
|
40
|
+
}, [controlRef, enabled, getValue, id, registerFieldControl, value]);
|
|
41
|
+
}
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { FieldValidityData } from "../root/FieldRoot.js";
|
|
3
3
|
import { type TransitionStatus } from "../../utils/useTransitionStatus.js";
|
|
4
4
|
/**
|
|
5
|
-
* Used to display a custom message based on the field
|
|
5
|
+
* Used to display a custom message based on the field's validity.
|
|
6
6
|
* Requires `children` to be a function that accepts field validity state as an argument.
|
|
7
7
|
*
|
|
8
8
|
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
@@ -12,7 +12,7 @@ var _getCombinedFieldValidityData = require("../utils/getCombinedFieldValidityDa
|
|
|
12
12
|
var _useTransitionStatus = require("../../utils/useTransitionStatus");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
/**
|
|
15
|
-
* Used to display a custom message based on the field
|
|
15
|
+
* Used to display a custom message based on the field's validity.
|
|
16
16
|
* Requires `children` to be a function that accepts field validity state as an argument.
|
|
17
17
|
*
|
|
18
18
|
* Documentation: [Base UI Field](https://base-ui.com/react/components/field)
|
|
@@ -7,8 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.FloatingFocusManager = FloatingFocusManager;
|
|
9
9
|
var React = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _tabbable = require("tabbable");
|
|
11
10
|
var _dom = require("@floating-ui/utils/dom");
|
|
11
|
+
var _addEventListener = require("@base-ui/utils/addEventListener");
|
|
12
|
+
var _mergeCleanups = require("@base-ui/utils/mergeCleanups");
|
|
12
13
|
var _useMergedRefs = require("@base-ui/utils/useMergedRefs");
|
|
13
14
|
var _useValueAsRef = require("@base-ui/utils/useValueAsRef");
|
|
14
15
|
var _useStableCallback = require("@base-ui/utils/useStableCallback");
|
|
@@ -18,7 +19,11 @@ var _detectBrowser = require("@base-ui/utils/detectBrowser");
|
|
|
18
19
|
var _useAnimationFrame = require("@base-ui/utils/useAnimationFrame");
|
|
19
20
|
var _owner = require("@base-ui/utils/owner");
|
|
20
21
|
var _FocusGuard = require("../../utils/FocusGuard");
|
|
21
|
-
var
|
|
22
|
+
var _element = require("../utils/element");
|
|
23
|
+
var _event = require("../utils/event");
|
|
24
|
+
var _tabbable = require("../utils/tabbable");
|
|
25
|
+
var _nodes = require("../utils/nodes");
|
|
26
|
+
var _composite = require("../utils/composite");
|
|
22
27
|
var _createBaseUIEventDetails = require("../../utils/createBaseUIEventDetails");
|
|
23
28
|
var _reasons = require("../../utils/reasons");
|
|
24
29
|
var _createAttribute = require("../utils/createAttribute");
|
|
@@ -30,7 +35,7 @@ var _constants = require("../../utils/constants");
|
|
|
30
35
|
var _resolveRef = require("../../utils/resolveRef");
|
|
31
36
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
37
|
function getEventType(event, lastInteractionType) {
|
|
33
|
-
const win = (0, _owner.ownerWindow)(
|
|
38
|
+
const win = (0, _owner.ownerWindow)((0, _element.getTarget)(event));
|
|
34
39
|
if (event instanceof win.KeyboardEvent) {
|
|
35
40
|
return 'keyboard';
|
|
36
41
|
}
|
|
@@ -75,11 +80,10 @@ function getFirstTabbableElement(container) {
|
|
|
75
80
|
if (!container) {
|
|
76
81
|
return null;
|
|
77
82
|
}
|
|
78
|
-
|
|
79
|
-
if ((0, _tabbable.isTabbable)(container, tabbableOptions)) {
|
|
83
|
+
if ((0, _tabbable.isTabbable)(container)) {
|
|
80
84
|
return container;
|
|
81
85
|
}
|
|
82
|
-
return (0, _tabbable.tabbable)(container
|
|
86
|
+
return (0, _tabbable.tabbable)(container)[0] || container;
|
|
83
87
|
}
|
|
84
88
|
function isFocusable(element) {
|
|
85
89
|
if (!element || !element.isConnected) {
|
|
@@ -88,17 +92,19 @@ function isFocusable(element) {
|
|
|
88
92
|
if (typeof element.checkVisibility === 'function') {
|
|
89
93
|
return element.checkVisibility();
|
|
90
94
|
}
|
|
91
|
-
return (0,
|
|
95
|
+
return (0, _composite.isElementVisible)(element);
|
|
92
96
|
}
|
|
93
97
|
function handleTabIndex(floatingFocusElement, orderRef) {
|
|
98
|
+
if (floatingFocusElement.hasAttribute('tabindex') && !floatingFocusElement.hasAttribute('data-tabindex')) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
94
101
|
if (!orderRef.current.includes('floating') && !floatingFocusElement.getAttribute('role')?.includes('dialog')) {
|
|
95
102
|
return;
|
|
96
103
|
}
|
|
97
|
-
const
|
|
98
|
-
const focusableElements = (0, _tabbable.focusable)(floatingFocusElement, options);
|
|
104
|
+
const focusableElements = (0, _tabbable.focusable)(floatingFocusElement);
|
|
99
105
|
const tabbableContent = focusableElements.filter(element => {
|
|
100
106
|
const dataTabIndex = element.getAttribute('data-tabindex') || '';
|
|
101
|
-
return (0, _tabbable.isTabbable)(element
|
|
107
|
+
return (0, _tabbable.isTabbable)(element) || element.hasAttribute('data-tabindex') && !dataTabIndex.startsWith('-');
|
|
102
108
|
});
|
|
103
109
|
const tabIndex = floatingFocusElement.getAttribute('tabindex');
|
|
104
110
|
if (orderRef.current.includes('floating') || tabbableContent.length === 0) {
|
|
@@ -147,7 +153,7 @@ function FloatingFocusManager(props) {
|
|
|
147
153
|
// aria-hidden should be applied to all nodes still. Further, the visually
|
|
148
154
|
// hidden dismiss button should only appear at the end of the list, not the
|
|
149
155
|
// start.
|
|
150
|
-
const isUntrappedTypeableCombobox = (0,
|
|
156
|
+
const isUntrappedTypeableCombobox = (0, _element.isTypeableCombobox)(domReference) && ignoreInitialFocus;
|
|
151
157
|
const orderRef = React.useRef(['content']);
|
|
152
158
|
const initialFocusRef = (0, _useValueAsRef.useValueAsRef)(initialFocus);
|
|
153
159
|
const returnFocusRef = (0, _useValueAsRef.useValueAsRef)(returnFocus);
|
|
@@ -157,7 +163,7 @@ function FloatingFocusManager(props) {
|
|
|
157
163
|
const preventReturnFocusRef = React.useRef(false);
|
|
158
164
|
const isPointerDownRef = React.useRef(false);
|
|
159
165
|
const pointerDownOutsideRef = React.useRef(false);
|
|
160
|
-
const
|
|
166
|
+
const lastFocusedTabbableRef = React.useRef(null);
|
|
161
167
|
const closeTypeRef = React.useRef('');
|
|
162
168
|
const lastInteractionTypeRef = React.useRef('');
|
|
163
169
|
const beforeGuardRef = React.useRef(null);
|
|
@@ -168,15 +174,11 @@ function FloatingFocusManager(props) {
|
|
|
168
174
|
const pointerDownTimeout = (0, _useTimeout.useTimeout)();
|
|
169
175
|
const restoreFocusFrame = (0, _useAnimationFrame.useAnimationFrame)();
|
|
170
176
|
const isInsidePortal = portalContext != null;
|
|
171
|
-
const floatingFocusElement = (0,
|
|
177
|
+
const floatingFocusElement = (0, _element.getFloatingFocusElement)(floating);
|
|
172
178
|
const getTabbableContent = (0, _useStableCallback.useStableCallback)((container = floatingFocusElement) => {
|
|
173
|
-
return container ? (0, _tabbable.tabbable)(container
|
|
179
|
+
return container ? (0, _tabbable.tabbable)(container) : [];
|
|
174
180
|
});
|
|
175
181
|
const getResolvedInsideElements = (0, _useStableCallback.useStableCallback)(() => getInsideElements?.().filter(element => element != null) ?? []);
|
|
176
|
-
const getTabbableElements = (0, _useStableCallback.useStableCallback)(container => {
|
|
177
|
-
const content = getTabbableContent(container);
|
|
178
|
-
return orderRef.current.map(() => content).filter(Boolean).flat();
|
|
179
|
-
});
|
|
180
182
|
|
|
181
183
|
// Prevent Tab from escaping the modal when there are no tabbable elements.
|
|
182
184
|
React.useEffect(() => {
|
|
@@ -186,17 +188,14 @@ function FloatingFocusManager(props) {
|
|
|
186
188
|
function onKeyDown(event) {
|
|
187
189
|
if (event.key === 'Tab') {
|
|
188
190
|
// The focus guards have nothing to focus, so we need to stop the event.
|
|
189
|
-
if ((0,
|
|
190
|
-
(0,
|
|
191
|
+
if ((0, _element.contains)(floatingFocusElement, (0, _element.activeElement)((0, _owner.ownerDocument)(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {
|
|
192
|
+
(0, _event.stopEvent)(event);
|
|
191
193
|
}
|
|
192
194
|
}
|
|
193
195
|
}
|
|
194
196
|
const doc = (0, _owner.ownerDocument)(floatingFocusElement);
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
doc.removeEventListener('keydown', onKeyDown);
|
|
198
|
-
};
|
|
199
|
-
}, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]);
|
|
197
|
+
return (0, _addEventListener.addEventListener)(doc, 'keydown', onKeyDown);
|
|
198
|
+
}, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent]);
|
|
200
199
|
|
|
201
200
|
// Track pointer/keyboard interactions to disambiguate focus and outside presses.
|
|
202
201
|
React.useEffect(() => {
|
|
@@ -208,9 +207,9 @@ function FloatingFocusManager(props) {
|
|
|
208
207
|
pointerDownOutsideRef.current = false;
|
|
209
208
|
}
|
|
210
209
|
function onPointerDown(event) {
|
|
211
|
-
const target = (0,
|
|
210
|
+
const target = (0, _element.getTarget)(event);
|
|
212
211
|
const insideElements = getResolvedInsideElements();
|
|
213
|
-
const pointerTargetInside = (0,
|
|
212
|
+
const pointerTargetInside = (0, _element.contains)(floating, target) || (0, _element.contains)(domReference, target) || (0, _element.contains)(portalContext?.portalNode, target) || insideElements.some(element => element === target || (0, _element.contains)(element, target));
|
|
214
213
|
pointerDownOutsideRef.current = !pointerTargetInside;
|
|
215
214
|
lastInteractionTypeRef.current = event.pointerType || 'keyboard';
|
|
216
215
|
if (target?.closest(`[${_constants.CLICK_TRIGGER_IDENTIFIER}]`)) {
|
|
@@ -220,16 +219,7 @@ function FloatingFocusManager(props) {
|
|
|
220
219
|
function onKeyDown() {
|
|
221
220
|
lastInteractionTypeRef.current = 'keyboard';
|
|
222
221
|
}
|
|
223
|
-
|
|
224
|
-
doc.addEventListener('pointerup', clearPointerDownOutside, true);
|
|
225
|
-
doc.addEventListener('pointercancel', clearPointerDownOutside, true);
|
|
226
|
-
doc.addEventListener('keydown', onKeyDown, true);
|
|
227
|
-
return () => {
|
|
228
|
-
doc.removeEventListener('pointerdown', onPointerDown, true);
|
|
229
|
-
doc.removeEventListener('pointerup', clearPointerDownOutside, true);
|
|
230
|
-
doc.removeEventListener('pointercancel', clearPointerDownOutside, true);
|
|
231
|
-
doc.removeEventListener('keydown', onKeyDown, true);
|
|
232
|
-
};
|
|
222
|
+
return (0, _mergeCleanups.mergeCleanups)((0, _addEventListener.addEventListener)(doc, 'pointerdown', onPointerDown, true), (0, _addEventListener.addEventListener)(doc, 'pointerup', clearPointerDownOutside, true), (0, _addEventListener.addEventListener)(doc, 'pointercancel', clearPointerDownOutside, true), (0, _addEventListener.addEventListener)(doc, 'keydown', onKeyDown, true));
|
|
233
223
|
}, [disabled, floating, domReference, floatingFocusElement, open, portalContext, getResolvedInsideElements]);
|
|
234
224
|
|
|
235
225
|
// Close on focus out and restore focus within the floating tree when needed.
|
|
@@ -247,30 +237,28 @@ function FloatingFocusManager(props) {
|
|
|
247
237
|
});
|
|
248
238
|
}
|
|
249
239
|
function handleFocusIn(event) {
|
|
250
|
-
const target = (0,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (tabbableIndex !== -1) {
|
|
254
|
-
tabbableIndexRef.current = tabbableIndex;
|
|
240
|
+
const target = (0, _element.getTarget)(event);
|
|
241
|
+
if ((0, _tabbable.isTabbable)(target)) {
|
|
242
|
+
lastFocusedTabbableRef.current = target;
|
|
255
243
|
}
|
|
256
244
|
}
|
|
257
245
|
function handleFocusOutside(event) {
|
|
258
246
|
const relatedTarget = event.relatedTarget;
|
|
259
247
|
const currentTarget = event.currentTarget;
|
|
260
|
-
const target = (0,
|
|
248
|
+
const target = (0, _element.getTarget)(event);
|
|
261
249
|
queueMicrotask(() => {
|
|
262
250
|
const nodeId = getNodeId();
|
|
263
251
|
const triggers = store.context.triggerElements;
|
|
264
252
|
const insideElements = getResolvedInsideElements();
|
|
265
253
|
const isRelatedFocusGuard = relatedTarget?.hasAttribute((0, _createAttribute.createAttribute)('focus-guard')) && [beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeInsideRef.current, portalContext?.afterInsideRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, (0, _resolveRef.resolveRef)(previousFocusableElement), (0, _resolveRef.resolveRef)(nextFocusableElement)].includes(relatedTarget);
|
|
266
|
-
const movedToUnrelatedNode = !((0,
|
|
254
|
+
const movedToUnrelatedNode = !((0, _element.contains)(domReference, relatedTarget) || (0, _element.contains)(floating, relatedTarget) || (0, _element.contains)(relatedTarget, floating) || (0, _element.contains)(portalContext?.portalNode, relatedTarget) || insideElements.some(element => element === relatedTarget || (0, _element.contains)(element, relatedTarget)) || relatedTarget != null && triggers.hasElement(relatedTarget) || triggers.hasMatchingElement(trigger => (0, _element.contains)(trigger, relatedTarget)) || isRelatedFocusGuard || tree && ((0, _nodes.getNodeChildren)(tree.nodesRef.current, nodeId).find(node => (0, _element.contains)(node.context?.elements.floating, relatedTarget) || (0, _element.contains)(node.context?.elements.domReference, relatedTarget)) || (0, _nodes.getNodeAncestors)(tree.nodesRef.current, nodeId).find(node => [node.context?.elements.floating, (0, _element.getFloatingFocusElement)(node.context?.elements.floating)].includes(relatedTarget) || node.context?.elements.domReference === relatedTarget)));
|
|
267
255
|
if (currentTarget === domReference && floatingFocusElement) {
|
|
268
256
|
handleTabIndex(floatingFocusElement, orderRef);
|
|
269
257
|
}
|
|
270
258
|
|
|
271
259
|
// Restore focus to the previous tabbable element index to prevent
|
|
272
260
|
// focus from being lost outside the floating tree.
|
|
273
|
-
if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && (0,
|
|
261
|
+
if (restoreFocus && currentTarget !== domReference && !isFocusable(target) && (0, _element.activeElement)(doc) === doc.body) {
|
|
274
262
|
// Let `FloatingPortal` effect knows that focus is still inside the
|
|
275
263
|
// floating tree.
|
|
276
264
|
if ((0, _dom.isHTMLElement)(floatingFocusElement)) {
|
|
@@ -288,9 +276,9 @@ function FloatingFocusManager(props) {
|
|
|
288
276
|
return;
|
|
289
277
|
}
|
|
290
278
|
}
|
|
291
|
-
const prevTabbableIndex = tabbableIndexRef.current;
|
|
292
279
|
const tabbableContent = getTabbableContent();
|
|
293
|
-
const
|
|
280
|
+
const prevTabbable = lastFocusedTabbableRef.current;
|
|
281
|
+
const nodeToFocus = (prevTabbable && tabbableContent.includes(prevTabbable) ? prevTabbable : null) || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;
|
|
294
282
|
if ((0, _dom.isHTMLElement)(nodeToFocus)) {
|
|
295
283
|
nodeToFocus.focus();
|
|
296
284
|
}
|
|
@@ -328,37 +316,10 @@ function FloatingFocusManager(props) {
|
|
|
328
316
|
});
|
|
329
317
|
}
|
|
330
318
|
const domReferenceElement = (0, _dom.isHTMLElement)(domReference) ? domReference : null;
|
|
331
|
-
const cleanups = [];
|
|
332
319
|
if (!floating && !domReferenceElement) {
|
|
333
320
|
return undefined;
|
|
334
321
|
}
|
|
335
|
-
|
|
336
|
-
domReferenceElement.addEventListener('focusout', handleFocusOutside);
|
|
337
|
-
domReferenceElement.addEventListener('pointerdown', handlePointerDown);
|
|
338
|
-
cleanups.push(() => {
|
|
339
|
-
domReferenceElement.removeEventListener('focusout', handleFocusOutside);
|
|
340
|
-
domReferenceElement.removeEventListener('pointerdown', handlePointerDown);
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
if (floating) {
|
|
344
|
-
floating.addEventListener('focusin', handleFocusIn);
|
|
345
|
-
floating.addEventListener('focusout', handleFocusOutside);
|
|
346
|
-
if (portalContext) {
|
|
347
|
-
floating.addEventListener('focusout', markInsideReactTree, true);
|
|
348
|
-
cleanups.push(() => {
|
|
349
|
-
floating.removeEventListener('focusout', markInsideReactTree, true);
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
cleanups.push(() => {
|
|
353
|
-
floating.removeEventListener('focusin', handleFocusIn);
|
|
354
|
-
floating.removeEventListener('focusout', handleFocusOutside);
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
return () => {
|
|
358
|
-
cleanups.forEach(cleanup => {
|
|
359
|
-
cleanup();
|
|
360
|
-
});
|
|
361
|
-
};
|
|
322
|
+
return (0, _mergeCleanups.mergeCleanups)(domReferenceElement && (0, _addEventListener.addEventListener)(domReferenceElement, 'focusout', handleFocusOutside), domReferenceElement && (0, _addEventListener.addEventListener)(domReferenceElement, 'pointerdown', handlePointerDown), floating && (0, _addEventListener.addEventListener)(floating, 'focusin', handleFocusIn), floating && (0, _addEventListener.addEventListener)(floating, 'focusout', handleFocusOutside), floating && portalContext && (0, _addEventListener.addEventListener)(floating, 'focusout', markInsideReactTree, true));
|
|
362
323
|
}, [disabled, domReference, floating, floatingFocusElement, modal, tree, portalContext, store, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox, getNodeId, orderRef, dataRef, blurTimeout, pointerDownTimeout, restoreFocusFrame, nextFocusableElement, previousFocusableElement, getResolvedInsideElements]);
|
|
363
324
|
|
|
364
325
|
// Hide everything outside the floating tree from assistive tech while open.
|
|
@@ -369,8 +330,8 @@ function FloatingFocusManager(props) {
|
|
|
369
330
|
|
|
370
331
|
// Don't hide portals nested within the parent portal.
|
|
371
332
|
const portalNodes = Array.from(portalContext?.portalNode?.querySelectorAll(`[${(0, _createAttribute.createAttribute)('portal')}]`) || []);
|
|
372
|
-
const ancestors = tree ? (0,
|
|
373
|
-
const rootAncestorComboboxDomReference = ancestors.find(node => (0,
|
|
333
|
+
const ancestors = tree ? (0, _nodes.getNodeAncestors)(tree.nodesRef.current, getNodeId()) : [];
|
|
334
|
+
const rootAncestorComboboxDomReference = ancestors.find(node => (0, _element.isTypeableCombobox)(node.context?.elements.domReference || null))?.context?.elements.domReference;
|
|
374
335
|
const controlInsideElements = [floating, ...portalNodes, beforeGuardRef.current, afterGuardRef.current, portalContext?.beforeOutsideRef.current, portalContext?.afterOutsideRef.current, ...getResolvedInsideElements()];
|
|
375
336
|
const insideElements = [...controlInsideElements, rootAncestorComboboxDomReference, (0, _resolveRef.resolveRef)(previousFocusableElement), (0, _resolveRef.resolveRef)(nextFocusableElement), isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);
|
|
376
337
|
const ariaHiddenCleanup = (0, _markOthers.markOthers)(insideElements, {
|
|
@@ -391,11 +352,10 @@ function FloatingFocusManager(props) {
|
|
|
391
352
|
return;
|
|
392
353
|
}
|
|
393
354
|
const doc = (0, _owner.ownerDocument)(floatingFocusElement);
|
|
394
|
-
const previouslyFocusedElement = (0,
|
|
355
|
+
const previouslyFocusedElement = (0, _element.activeElement)(doc);
|
|
395
356
|
|
|
396
357
|
// Wait for any layout effect state setters to execute to set `tabIndex`.
|
|
397
358
|
queueMicrotask(() => {
|
|
398
|
-
const focusableElements = getTabbableElements(floatingFocusElement);
|
|
399
359
|
const initialFocusValueOrFn = initialFocusRef.current;
|
|
400
360
|
const resolvedInitialFocus = typeof initialFocusValueOrFn === 'function' ? initialFocusValueOrFn(openInteractionTypeRef.current || '') : initialFocusValueOrFn;
|
|
401
361
|
|
|
@@ -403,22 +363,29 @@ function FloatingFocusManager(props) {
|
|
|
403
363
|
if (resolvedInitialFocus === undefined || resolvedInitialFocus === false) {
|
|
404
364
|
return;
|
|
405
365
|
}
|
|
366
|
+
const focusAlreadyInsideFloatingEl = (0, _element.contains)(floatingFocusElement, previouslyFocusedElement);
|
|
367
|
+
if (focusAlreadyInsideFloatingEl) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
let focusableElements = null;
|
|
371
|
+
const getDefaultFocusElement = () => {
|
|
372
|
+
if (focusableElements == null) {
|
|
373
|
+
focusableElements = getTabbableContent(floatingFocusElement);
|
|
374
|
+
}
|
|
375
|
+
return focusableElements[0] || floatingFocusElement;
|
|
376
|
+
};
|
|
406
377
|
let elToFocus;
|
|
407
378
|
if (resolvedInitialFocus === true || resolvedInitialFocus === null) {
|
|
408
|
-
elToFocus =
|
|
379
|
+
elToFocus = getDefaultFocusElement();
|
|
409
380
|
} else {
|
|
410
381
|
elToFocus = (0, _resolveRef.resolveRef)(resolvedInitialFocus);
|
|
411
382
|
}
|
|
412
|
-
elToFocus = elToFocus ||
|
|
413
|
-
const focusAlreadyInsideFloatingEl = (0, _utils.contains)(floatingFocusElement, previouslyFocusedElement);
|
|
414
|
-
if (focusAlreadyInsideFloatingEl) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
383
|
+
elToFocus = elToFocus || getDefaultFocusElement();
|
|
417
384
|
(0, _enqueueFocus.enqueueFocus)(elToFocus, {
|
|
418
385
|
preventScroll: elToFocus === floatingFocusElement
|
|
419
386
|
});
|
|
420
387
|
});
|
|
421
|
-
}, [disabled, open, floatingFocusElement, ignoreInitialFocus,
|
|
388
|
+
}, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableContent, initialFocusRef, openInteractionTypeRef]);
|
|
422
389
|
|
|
423
390
|
// Track return focus targets and restore focus on unmount/close.
|
|
424
391
|
(0, _useIsoLayoutEffect.useIsoLayoutEffect)(() => {
|
|
@@ -426,7 +393,7 @@ function FloatingFocusManager(props) {
|
|
|
426
393
|
return undefined;
|
|
427
394
|
}
|
|
428
395
|
const doc = (0, _owner.ownerDocument)(floatingFocusElement);
|
|
429
|
-
const previouslyFocusedElement = (0,
|
|
396
|
+
const previouslyFocusedElement = (0, _element.activeElement)(doc);
|
|
430
397
|
addPreviouslyFocusedElement(previouslyFocusedElement);
|
|
431
398
|
|
|
432
399
|
// Dismissing via outside press should always ignore `returnFocus` to
|
|
@@ -443,11 +410,11 @@ function FloatingFocusManager(props) {
|
|
|
443
410
|
}
|
|
444
411
|
if (details.nested) {
|
|
445
412
|
preventReturnFocusRef.current = false;
|
|
446
|
-
} else if ((0,
|
|
413
|
+
} else if ((0, _event.isVirtualClick)(details.nativeEvent) || (0, _event.isVirtualPointerEvent)(details.nativeEvent)) {
|
|
447
414
|
preventReturnFocusRef.current = false;
|
|
448
415
|
} else {
|
|
449
416
|
let isPreventScrollSupported = false;
|
|
450
|
-
|
|
417
|
+
(0, _owner.ownerDocument)(floatingFocusElement).createElement('div').focus({
|
|
451
418
|
get preventScroll() {
|
|
452
419
|
isPreventScrollSupported = true;
|
|
453
420
|
return false;
|
|
@@ -481,17 +448,18 @@ function FloatingFocusManager(props) {
|
|
|
481
448
|
}
|
|
482
449
|
return () => {
|
|
483
450
|
events.off('openchange', onOpenChangeLocal);
|
|
484
|
-
const activeEl = (0,
|
|
451
|
+
const activeEl = (0, _element.activeElement)(doc);
|
|
485
452
|
const insideElements = getResolvedInsideElements();
|
|
486
|
-
const isFocusInsideFloatingTree = (0,
|
|
453
|
+
const isFocusInsideFloatingTree = (0, _element.contains)(floating, activeEl) || insideElements.some(element => element === activeEl || (0, _element.contains)(element, activeEl)) || tree && (0, _nodes.getNodeChildren)(tree.nodesRef.current, getNodeId(), false).some(node => (0, _element.contains)(node.context?.elements.floating, activeEl));
|
|
454
|
+
|
|
455
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
456
|
+
const returnFocusValueOrFn = returnFocusRef.current;
|
|
487
457
|
const returnElement = getReturnElement();
|
|
488
458
|
queueMicrotask(() => {
|
|
489
459
|
// This is `returnElement`, if it's tabbable, or its first tabbable child.
|
|
490
460
|
const tabbableReturnElement = getFirstTabbableElement(returnElement);
|
|
491
|
-
const hasExplicitReturnFocus = typeof
|
|
492
|
-
if (
|
|
493
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
494
|
-
returnFocusRef.current && !preventReturnFocusRef.current && (0, _dom.isHTMLElement)(tabbableReturnElement) && (
|
|
461
|
+
const hasExplicitReturnFocus = typeof returnFocusValueOrFn !== 'boolean';
|
|
462
|
+
if (returnFocusValueOrFn && !preventReturnFocusRef.current && (0, _dom.isHTMLElement)(tabbableReturnElement) && (
|
|
495
463
|
// If the focus moved somewhere else after mount, avoid returning focus
|
|
496
464
|
// since it likely entered a different element which should be
|
|
497
465
|
// respected: https://github.com/floating-ui/floating-ui/issues/2607
|
|
@@ -512,11 +480,11 @@ function FloatingFocusManager(props) {
|
|
|
512
480
|
if (!_detectBrowser.isWebKit || open || !floating) {
|
|
513
481
|
return;
|
|
514
482
|
}
|
|
515
|
-
const activeEl = (0,
|
|
516
|
-
if (!(0, _dom.isHTMLElement)(activeEl) || !(0,
|
|
483
|
+
const activeEl = (0, _element.activeElement)((0, _owner.ownerDocument)(floating));
|
|
484
|
+
if (!(0, _dom.isHTMLElement)(activeEl) || !(0, _element.isTypeableElement)(activeEl)) {
|
|
517
485
|
return;
|
|
518
486
|
}
|
|
519
|
-
if ((0,
|
|
487
|
+
if ((0, _element.contains)(floating, activeEl)) {
|
|
520
488
|
activeEl.blur();
|
|
521
489
|
}
|
|
522
490
|
}, [open, floating]);
|
|
@@ -555,12 +523,12 @@ function FloatingFocusManager(props) {
|
|
|
555
523
|
ref: mergedBeforeGuardRef,
|
|
556
524
|
onFocus: event => {
|
|
557
525
|
if (modal) {
|
|
558
|
-
const els =
|
|
526
|
+
const els = getTabbableContent();
|
|
559
527
|
(0, _enqueueFocus.enqueueFocus)(els[els.length - 1]);
|
|
560
528
|
} else if (portalContext?.portalNode) {
|
|
561
529
|
preventReturnFocusRef.current = false;
|
|
562
|
-
if ((0,
|
|
563
|
-
const nextTabbable = (0,
|
|
530
|
+
if ((0, _tabbable.isOutsideEvent)(event, portalContext.portalNode)) {
|
|
531
|
+
const nextTabbable = (0, _tabbable.getNextTabbable)(domReference);
|
|
564
532
|
nextTabbable?.focus();
|
|
565
533
|
} else {
|
|
566
534
|
(0, _resolveRef.resolveRef)(previousFocusableElement ?? portalContext.beforeOutsideRef)?.focus();
|
|
@@ -572,13 +540,13 @@ function FloatingFocusManager(props) {
|
|
|
572
540
|
ref: mergedAfterGuardRef,
|
|
573
541
|
onFocus: event => {
|
|
574
542
|
if (modal) {
|
|
575
|
-
(0, _enqueueFocus.enqueueFocus)(
|
|
543
|
+
(0, _enqueueFocus.enqueueFocus)(getTabbableContent()[0]);
|
|
576
544
|
} else if (portalContext?.portalNode) {
|
|
577
545
|
if (closeOnFocusOut) {
|
|
578
546
|
preventReturnFocusRef.current = true;
|
|
579
547
|
}
|
|
580
|
-
if ((0,
|
|
581
|
-
const prevTabbable = (0,
|
|
548
|
+
if ((0, _tabbable.isOutsideEvent)(event, portalContext.portalNode)) {
|
|
549
|
+
const prevTabbable = (0, _tabbable.getPreviousTabbable)(domReference);
|
|
582
550
|
prevTabbable?.focus();
|
|
583
551
|
} else {
|
|
584
552
|
(0, _resolveRef.resolveRef)(nextFocusableElement ?? portalContext.afterOutsideRef)?.focus();
|