react-aria 3.48.0 → 3.50.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/dist/exports/CollectionBuilder.cjs.map +1 -1
- package/dist/exports/CollectionBuilder.js.map +1 -1
- package/dist/exports/CollectionBuilder.mjs.map +1 -1
- package/dist/exports/index.cjs +12 -0
- package/dist/exports/index.cjs.map +1 -1
- package/dist/exports/index.js +9 -1
- package/dist/exports/index.js.map +1 -1
- package/dist/exports/index.mjs +9 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroup.cjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroup.js.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroup.mjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroupItem.cjs.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroupItem.js.map +1 -1
- package/dist/exports/private/actiongroup/useActionGroupItem.mjs.map +1 -1
- package/dist/exports/private/autocomplete/useSearchAutocomplete.cjs.map +1 -1
- package/dist/exports/private/autocomplete/useSearchAutocomplete.js.map +1 -1
- package/dist/exports/private/autocomplete/useSearchAutocomplete.mjs.map +1 -1
- package/dist/exports/private/collections/BaseCollection.cjs.map +1 -1
- package/dist/exports/private/collections/BaseCollection.js.map +1 -1
- package/dist/exports/private/collections/BaseCollection.mjs.map +1 -1
- package/dist/exports/private/collections/useCachedChildren.cjs.map +1 -1
- package/dist/exports/private/collections/useCachedChildren.js.map +1 -1
- package/dist/exports/private/collections/useCachedChildren.mjs.map +1 -1
- package/dist/exports/private/focus/FocusScope.cjs.map +1 -1
- package/dist/exports/private/focus/FocusScope.js.map +1 -1
- package/dist/exports/private/focus/FocusScope.mjs.map +1 -1
- package/dist/exports/private/focus/virtualFocus.cjs.map +1 -1
- package/dist/exports/private/focus/virtualFocus.js.map +1 -1
- package/dist/exports/private/focus/virtualFocus.mjs.map +1 -1
- package/dist/exports/private/grid/GridKeyboardDelegate.cjs.map +1 -1
- package/dist/exports/private/grid/GridKeyboardDelegate.js.map +1 -1
- package/dist/exports/private/grid/GridKeyboardDelegate.mjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionAnnouncement.cjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionAnnouncement.js.map +1 -1
- package/dist/exports/private/grid/useGridSelectionAnnouncement.mjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionCheckbox.cjs.map +1 -1
- package/dist/exports/private/grid/useGridSelectionCheckbox.js.map +1 -1
- package/dist/exports/private/grid/useGridSelectionCheckbox.mjs.map +1 -1
- package/dist/exports/private/grid/useHighlightSelectionDescription.cjs.map +1 -1
- package/dist/exports/private/grid/useHighlightSelectionDescription.js.map +1 -1
- package/dist/exports/private/grid/useHighlightSelectionDescription.mjs.map +1 -1
- package/dist/exports/private/interactions/useFocusVisible.cjs.map +1 -1
- package/dist/exports/private/interactions/useFocusVisible.js.map +1 -1
- package/dist/exports/private/interactions/useFocusVisible.mjs.map +1 -1
- package/dist/exports/private/interactions/useFocusable.cjs.map +1 -1
- package/dist/exports/private/interactions/useFocusable.js.map +1 -1
- package/dist/exports/private/interactions/useFocusable.mjs.map +1 -1
- package/dist/exports/private/landmark/useLandmark.cjs.map +1 -1
- package/dist/exports/private/landmark/useLandmark.js.map +1 -1
- package/dist/exports/private/landmark/useLandmark.mjs.map +1 -1
- package/dist/exports/private/live-announcer/LiveAnnouncer.cjs.map +1 -1
- package/dist/exports/private/live-announcer/LiveAnnouncer.js.map +1 -1
- package/dist/exports/private/live-announcer/LiveAnnouncer.mjs.map +1 -1
- package/dist/exports/private/overlays/useModal.cjs.map +1 -1
- package/dist/exports/private/overlays/useModal.js.map +1 -1
- package/dist/exports/private/overlays/useModal.mjs.map +1 -1
- package/dist/exports/private/selection/useSelectableCollection.cjs.map +1 -1
- package/dist/exports/private/selection/useSelectableCollection.js.map +1 -1
- package/dist/exports/private/selection/useSelectableCollection.mjs.map +1 -1
- package/dist/exports/private/selection/useSelectableItem.cjs.map +1 -1
- package/dist/exports/private/selection/useSelectableItem.js.map +1 -1
- package/dist/exports/private/selection/useSelectableItem.mjs.map +1 -1
- package/dist/exports/private/selection/useSelectableList.cjs.map +1 -1
- package/dist/exports/private/selection/useSelectableList.js.map +1 -1
- package/dist/exports/private/selection/useSelectableList.mjs.map +1 -1
- package/dist/exports/private/selection/useTypeSelect.cjs.map +1 -1
- package/dist/exports/private/selection/useTypeSelect.js.map +1 -1
- package/dist/exports/private/selection/useTypeSelect.mjs.map +1 -1
- package/dist/exports/private/spinbutton/useSpinButton.cjs.map +1 -1
- package/dist/exports/private/spinbutton/useSpinButton.js.map +1 -1
- package/dist/exports/private/spinbutton/useSpinButton.mjs.map +1 -1
- package/dist/exports/private/steplist/useStepList.cjs.map +1 -1
- package/dist/exports/private/steplist/useStepList.js.map +1 -1
- package/dist/exports/private/steplist/useStepList.mjs.map +1 -1
- package/dist/exports/private/steplist/useStepListItem.cjs.map +1 -1
- package/dist/exports/private/steplist/useStepListItem.js.map +1 -1
- package/dist/exports/private/steplist/useStepListItem.mjs.map +1 -1
- package/dist/exports/private/utils/openLink.cjs.map +1 -1
- package/dist/exports/private/utils/openLink.js.map +1 -1
- package/dist/exports/private/utils/openLink.mjs.map +1 -1
- package/dist/exports/private/utils/platform.cjs.map +1 -1
- package/dist/exports/private/utils/platform.js.map +1 -1
- package/dist/exports/private/utils/platform.mjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.cjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.js.map +1 -1
- package/dist/exports/private/utils/shadowdom/ShadowTreeWalker.mjs.map +1 -1
- package/dist/exports/private/utils/useLoadMoreSentinel.cjs.map +1 -1
- package/dist/exports/private/utils/useLoadMoreSentinel.js.map +1 -1
- package/dist/exports/private/utils/useLoadMoreSentinel.mjs.map +1 -1
- package/dist/exports/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
- package/dist/exports/private/virtualizer/useVirtualizerItem.js.map +1 -1
- package/dist/exports/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
- package/dist/exports/private/virtualizer/utils.cjs.map +1 -1
- package/dist/exports/private/virtualizer/utils.js.map +1 -1
- package/dist/exports/private/virtualizer/utils.mjs.map +1 -1
- package/dist/exports/useAutocomplete.cjs.map +1 -1
- package/dist/exports/useAutocomplete.js.map +1 -1
- package/dist/exports/useAutocomplete.mjs.map +1 -1
- package/dist/exports/useBreadcrumbs.cjs.map +1 -1
- package/dist/exports/useBreadcrumbs.js.map +1 -1
- package/dist/exports/useBreadcrumbs.mjs.map +1 -1
- package/dist/exports/useButton.cjs.map +1 -1
- package/dist/exports/useButton.js.map +1 -1
- package/dist/exports/useButton.mjs.map +1 -1
- package/dist/exports/useCalendar.cjs +9 -0
- package/dist/exports/useCalendar.cjs.map +1 -1
- package/dist/exports/useCalendar.js +7 -1
- package/dist/exports/useCalendar.js.map +1 -1
- package/dist/exports/useCalendar.mjs +7 -1
- package/dist/exports/useCalendar.mjs.map +1 -1
- package/dist/exports/useClipboard.cjs.map +1 -1
- package/dist/exports/useClipboard.js.map +1 -1
- package/dist/exports/useClipboard.mjs.map +1 -1
- package/dist/exports/useColorArea.cjs.map +1 -1
- package/dist/exports/useColorArea.js.map +1 -1
- package/dist/exports/useColorArea.mjs.map +1 -1
- package/dist/exports/useColorField.cjs.map +1 -1
- package/dist/exports/useColorField.js.map +1 -1
- package/dist/exports/useColorField.mjs.map +1 -1
- package/dist/exports/useColorSlider.cjs.map +1 -1
- package/dist/exports/useColorSlider.js.map +1 -1
- package/dist/exports/useColorSlider.mjs.map +1 -1
- package/dist/exports/useColorWheel.cjs.map +1 -1
- package/dist/exports/useColorWheel.js.map +1 -1
- package/dist/exports/useColorWheel.mjs.map +1 -1
- package/dist/exports/useComboBox.cjs.map +1 -1
- package/dist/exports/useComboBox.js.map +1 -1
- package/dist/exports/useComboBox.mjs.map +1 -1
- package/dist/exports/useDateField.cjs.map +1 -1
- package/dist/exports/useDateField.js.map +1 -1
- package/dist/exports/useDateField.mjs.map +1 -1
- package/dist/exports/useDateRangePicker.cjs.map +1 -1
- package/dist/exports/useDateRangePicker.js.map +1 -1
- package/dist/exports/useDateRangePicker.mjs.map +1 -1
- package/dist/exports/useDisclosure.cjs +1 -1
- package/dist/exports/useDisclosure.cjs.map +1 -1
- package/dist/exports/useDisclosure.js +1 -1
- package/dist/exports/useDisclosure.js.map +1 -1
- package/dist/exports/useDisclosure.mjs +1 -1
- package/dist/exports/useDisclosure.mjs.map +1 -1
- package/dist/exports/useDrag.cjs.map +1 -1
- package/dist/exports/useDrag.js.map +1 -1
- package/dist/exports/useDrag.mjs.map +1 -1
- package/dist/exports/useDraggableCollection.cjs.map +1 -1
- package/dist/exports/useDraggableCollection.js.map +1 -1
- package/dist/exports/useDraggableCollection.mjs.map +1 -1
- package/dist/exports/useDrop.cjs.map +1 -1
- package/dist/exports/useDrop.js.map +1 -1
- package/dist/exports/useDrop.mjs.map +1 -1
- package/dist/exports/useDroppableCollection.cjs.map +1 -1
- package/dist/exports/useDroppableCollection.js.map +1 -1
- package/dist/exports/useDroppableCollection.mjs.map +1 -1
- package/dist/exports/useFocusable.cjs.map +1 -1
- package/dist/exports/useFocusable.js.map +1 -1
- package/dist/exports/useFocusable.mjs.map +1 -1
- package/dist/exports/useGridList.cjs.map +1 -1
- package/dist/exports/useGridList.js.map +1 -1
- package/dist/exports/useGridList.mjs.map +1 -1
- package/dist/exports/useInteractOutside.cjs.map +1 -1
- package/dist/exports/useInteractOutside.js.map +1 -1
- package/dist/exports/useInteractOutside.mjs.map +1 -1
- package/dist/exports/useLandmark.cjs.map +1 -1
- package/dist/exports/useLandmark.js.map +1 -1
- package/dist/exports/useLandmark.mjs.map +1 -1
- package/dist/exports/useListBox.cjs.map +1 -1
- package/dist/exports/useListBox.js.map +1 -1
- package/dist/exports/useListBox.mjs.map +1 -1
- package/dist/exports/useLocalizedStringFormatter.cjs.map +1 -1
- package/dist/exports/useLocalizedStringFormatter.js.map +1 -1
- package/dist/exports/useLocalizedStringFormatter.mjs.map +1 -1
- package/dist/exports/useMove.cjs.map +1 -1
- package/dist/exports/useMove.js.map +1 -1
- package/dist/exports/useMove.mjs.map +1 -1
- package/dist/exports/useOverlayPosition.cjs.map +1 -1
- package/dist/exports/useOverlayPosition.js.map +1 -1
- package/dist/exports/useOverlayPosition.mjs.map +1 -1
- package/dist/exports/useProgressBar.cjs.map +1 -1
- package/dist/exports/useProgressBar.js.map +1 -1
- package/dist/exports/useProgressBar.mjs.map +1 -1
- package/dist/exports/useRangeCalendar.cjs +15 -0
- package/dist/exports/useRangeCalendar.cjs.map +1 -1
- package/dist/exports/useRangeCalendar.js +11 -1
- package/dist/exports/useRangeCalendar.js.map +1 -1
- package/dist/exports/useRangeCalendar.mjs +11 -1
- package/dist/exports/useRangeCalendar.mjs.map +1 -1
- package/dist/exports/useSelect.cjs.map +1 -1
- package/dist/exports/useSelect.js.map +1 -1
- package/dist/exports/useSelect.mjs.map +1 -1
- package/dist/exports/useSlider.cjs.map +1 -1
- package/dist/exports/useSlider.js.map +1 -1
- package/dist/exports/useSlider.mjs.map +1 -1
- package/dist/exports/useTable.cjs.map +1 -1
- package/dist/exports/useTable.js.map +1 -1
- package/dist/exports/useTable.mjs.map +1 -1
- package/dist/exports/useTimeField.cjs.map +1 -1
- package/dist/exports/useTimeField.js.map +1 -1
- package/dist/exports/useTimeField.mjs.map +1 -1
- package/dist/exports/useToggleButton.cjs.map +1 -1
- package/dist/exports/useToggleButton.js.map +1 -1
- package/dist/exports/useToggleButton.mjs.map +1 -1
- package/dist/exports/useToggleButtonGroup.cjs.map +1 -1
- package/dist/exports/useToggleButtonGroup.js.map +1 -1
- package/dist/exports/useToggleButtonGroup.mjs.map +1 -1
- package/dist/exports/useTree.cjs.map +1 -1
- package/dist/exports/useTree.js.map +1 -1
- package/dist/exports/useTree.mjs.map +1 -1
- package/dist/private/actiongroup/useActionGroup.cjs +3 -3
- package/dist/private/actiongroup/useActionGroup.cjs.map +1 -1
- package/dist/private/actiongroup/useActionGroup.js +3 -3
- package/dist/private/actiongroup/useActionGroup.js.map +1 -1
- package/dist/private/actiongroup/useActionGroup.mjs +3 -3
- package/dist/private/actiongroup/useActionGroup.mjs.map +1 -1
- package/dist/private/actiongroup/useActionGroupItem.cjs +5 -4
- package/dist/private/actiongroup/useActionGroupItem.cjs.map +1 -1
- package/dist/private/actiongroup/useActionGroupItem.js +5 -4
- package/dist/private/actiongroup/useActionGroupItem.js.map +1 -1
- package/dist/private/actiongroup/useActionGroupItem.mjs +5 -4
- package/dist/private/actiongroup/useActionGroupItem.mjs.map +1 -1
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.cjs +7 -5
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.cjs.map +1 -1
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.js +7 -5
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.js.map +1 -1
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.mjs +7 -5
- package/dist/private/aria-modal-polyfill/ariaModalPolyfill.mjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.cjs +16 -7
- package/dist/private/autocomplete/useAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.js +16 -7
- package/dist/private/autocomplete/useAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.mjs +16 -7
- package/dist/private/autocomplete/useAutocomplete.mjs.map +1 -1
- package/dist/private/autocomplete/useSearchAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/useSearchAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/useSearchAutocomplete.mjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.cjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.js.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.mjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbs.cjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbs.js.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbs.mjs.map +1 -1
- package/dist/private/button/useButton.cjs.map +1 -1
- package/dist/private/button/useButton.js.map +1 -1
- package/dist/private/button/useButton.mjs.map +1 -1
- package/dist/private/button/useToggleButton.cjs.map +1 -1
- package/dist/private/button/useToggleButton.js.map +1 -1
- package/dist/private/button/useToggleButton.mjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.cjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.js.map +1 -1
- package/dist/private/button/useToggleButtonGroup.mjs.map +1 -1
- package/dist/private/calendar/useCalendar.cjs.map +1 -1
- package/dist/private/calendar/useCalendar.js.map +1 -1
- package/dist/private/calendar/useCalendar.mjs.map +1 -1
- package/dist/private/calendar/useCalendarBase.cjs.map +1 -1
- package/dist/private/calendar/useCalendarBase.js.map +1 -1
- package/dist/private/calendar/useCalendarBase.mjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.cjs +10 -14
- package/dist/private/calendar/useCalendarCell.cjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.js +10 -14
- package/dist/private/calendar/useCalendarCell.js.map +1 -1
- package/dist/private/calendar/useCalendarCell.mjs +10 -14
- package/dist/private/calendar/useCalendarCell.mjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.cjs +9 -5
- package/dist/private/calendar/useCalendarGrid.cjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.js +10 -6
- package/dist/private/calendar/useCalendarGrid.js.map +1 -1
- package/dist/private/calendar/useCalendarGrid.mjs +10 -6
- package/dist/private/calendar/useCalendarGrid.mjs.map +1 -1
- package/dist/private/calendar/useCalendarHeading.cjs +56 -0
- package/dist/private/calendar/useCalendarHeading.cjs.map +1 -0
- package/dist/private/calendar/useCalendarHeading.js +52 -0
- package/dist/private/calendar/useCalendarHeading.js.map +1 -0
- package/dist/private/calendar/useCalendarHeading.mjs +51 -0
- package/dist/private/calendar/useCalendarHeading.mjs.map +1 -0
- package/dist/private/calendar/useCalendarMonthPicker.cjs +66 -0
- package/dist/private/calendar/useCalendarMonthPicker.cjs.map +1 -0
- package/dist/private/calendar/useCalendarMonthPicker.js +61 -0
- package/dist/private/calendar/useCalendarMonthPicker.js.map +1 -0
- package/dist/private/calendar/useCalendarMonthPicker.mjs +61 -0
- package/dist/private/calendar/useCalendarMonthPicker.mjs.map +1 -0
- package/dist/private/calendar/useCalendarYearPicker.cjs +90 -0
- package/dist/private/calendar/useCalendarYearPicker.cjs.map +1 -0
- package/dist/private/calendar/useCalendarYearPicker.js +86 -0
- package/dist/private/calendar/useCalendarYearPicker.js.map +1 -0
- package/dist/private/calendar/useCalendarYearPicker.mjs +85 -0
- package/dist/private/calendar/useCalendarYearPicker.mjs.map +1 -0
- package/dist/private/calendar/useRangeCalendar.cjs +1 -1
- package/dist/private/calendar/useRangeCalendar.cjs.map +1 -1
- package/dist/private/calendar/useRangeCalendar.js +1 -1
- package/dist/private/calendar/useRangeCalendar.js.map +1 -1
- package/dist/private/calendar/useRangeCalendar.mjs +1 -1
- package/dist/private/calendar/useRangeCalendar.mjs.map +1 -1
- package/dist/private/calendar/utils.cjs +20 -4
- package/dist/private/calendar/utils.cjs.map +1 -1
- package/dist/private/calendar/utils.js +22 -5
- package/dist/private/calendar/utils.js.map +1 -1
- package/dist/private/calendar/utils.mjs +20 -4
- package/dist/private/calendar/utils.mjs.map +1 -1
- package/dist/private/checkbox/useCheckbox.cjs +6 -35
- package/dist/private/checkbox/useCheckbox.cjs.map +1 -1
- package/dist/private/checkbox/useCheckbox.js +6 -35
- package/dist/private/checkbox/useCheckbox.js.map +1 -1
- package/dist/private/checkbox/useCheckbox.mjs +6 -35
- package/dist/private/checkbox/useCheckbox.mjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroup.cjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroup.js.map +1 -1
- package/dist/private/checkbox/useCheckboxGroup.mjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.cjs +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.cjs.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.js +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.js.map +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.mjs +1 -1
- package/dist/private/checkbox/useCheckboxGroupItem.mjs.map +1 -1
- package/dist/private/checkbox/utils.cjs.map +1 -1
- package/dist/private/checkbox/utils.js.map +1 -1
- package/dist/private/checkbox/utils.mjs.map +1 -1
- package/dist/private/collections/BaseCollection.cjs +4 -4
- package/dist/private/collections/BaseCollection.cjs.map +1 -1
- package/dist/private/collections/BaseCollection.js +4 -4
- package/dist/private/collections/BaseCollection.js.map +1 -1
- package/dist/private/collections/BaseCollection.mjs +4 -4
- package/dist/private/collections/BaseCollection.mjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.cjs +5 -3
- package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.js +5 -3
- package/dist/private/collections/CollectionBuilder.js.map +1 -1
- package/dist/private/collections/CollectionBuilder.mjs +5 -3
- package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
- package/dist/private/collections/Document.cjs.map +1 -1
- package/dist/private/collections/Document.js.map +1 -1
- package/dist/private/collections/Document.mjs.map +1 -1
- package/dist/private/collections/Hidden.cjs.map +1 -1
- package/dist/private/collections/Hidden.js.map +1 -1
- package/dist/private/collections/Hidden.mjs.map +1 -1
- package/dist/private/collections/useCachedChildren.cjs +29 -8
- package/dist/private/collections/useCachedChildren.cjs.map +1 -1
- package/dist/private/collections/useCachedChildren.js +29 -8
- package/dist/private/collections/useCachedChildren.js.map +1 -1
- package/dist/private/collections/useCachedChildren.mjs +29 -8
- package/dist/private/collections/useCachedChildren.mjs.map +1 -1
- package/dist/private/color/useColorArea.cjs.map +1 -1
- package/dist/private/color/useColorArea.js.map +1 -1
- package/dist/private/color/useColorArea.mjs.map +1 -1
- package/dist/private/color/useColorAreaGradient.cjs +1 -1
- package/dist/private/color/useColorAreaGradient.cjs.map +1 -1
- package/dist/private/color/useColorAreaGradient.js +1 -1
- package/dist/private/color/useColorAreaGradient.js.map +1 -1
- package/dist/private/color/useColorAreaGradient.mjs +1 -1
- package/dist/private/color/useColorAreaGradient.mjs.map +1 -1
- package/dist/private/color/useColorChannelField.cjs.map +1 -1
- package/dist/private/color/useColorChannelField.js.map +1 -1
- package/dist/private/color/useColorChannelField.mjs.map +1 -1
- package/dist/private/color/useColorField.cjs +1 -1
- package/dist/private/color/useColorField.cjs.map +1 -1
- package/dist/private/color/useColorField.js +1 -1
- package/dist/private/color/useColorField.js.map +1 -1
- package/dist/private/color/useColorField.mjs +1 -1
- package/dist/private/color/useColorField.mjs.map +1 -1
- package/dist/private/color/useColorSlider.cjs +2 -2
- package/dist/private/color/useColorSlider.cjs.map +1 -1
- package/dist/private/color/useColorSlider.js +2 -2
- package/dist/private/color/useColorSlider.js.map +1 -1
- package/dist/private/color/useColorSlider.mjs +2 -2
- package/dist/private/color/useColorSlider.mjs.map +1 -1
- package/dist/private/color/useColorSwatch.cjs.map +1 -1
- package/dist/private/color/useColorSwatch.js.map +1 -1
- package/dist/private/color/useColorSwatch.mjs.map +1 -1
- package/dist/private/color/useColorWheel.cjs.map +1 -1
- package/dist/private/color/useColorWheel.js.map +1 -1
- package/dist/private/color/useColorWheel.mjs.map +1 -1
- package/dist/private/combobox/useComboBox.cjs +5 -3
- package/dist/private/combobox/useComboBox.cjs.map +1 -1
- package/dist/private/combobox/useComboBox.js +5 -3
- package/dist/private/combobox/useComboBox.js.map +1 -1
- package/dist/private/combobox/useComboBox.mjs +5 -3
- package/dist/private/combobox/useComboBox.mjs.map +1 -1
- package/dist/private/datepicker/useDateField.cjs.map +1 -1
- package/dist/private/datepicker/useDateField.js.map +1 -1
- package/dist/private/datepicker/useDateField.mjs.map +1 -1
- package/dist/private/datepicker/useDatePicker.cjs.map +1 -1
- package/dist/private/datepicker/useDatePicker.js.map +1 -1
- package/dist/private/datepicker/useDatePicker.mjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.cjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.js.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.mjs.map +1 -1
- package/dist/private/datepicker/useDateRangePicker.cjs.map +1 -1
- package/dist/private/datepicker/useDateRangePicker.js.map +1 -1
- package/dist/private/datepicker/useDateRangePicker.mjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.cjs +2 -2
- package/dist/private/datepicker/useDateSegment.cjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.js +2 -2
- package/dist/private/datepicker/useDateSegment.js.map +1 -1
- package/dist/private/datepicker/useDateSegment.mjs +2 -2
- package/dist/private/datepicker/useDateSegment.mjs.map +1 -1
- package/dist/private/datepicker/useDisplayNames.cjs +1 -2
- package/dist/private/datepicker/useDisplayNames.cjs.map +1 -1
- package/dist/private/datepicker/useDisplayNames.js +1 -2
- package/dist/private/datepicker/useDisplayNames.js.map +1 -1
- package/dist/private/datepicker/useDisplayNames.mjs +1 -2
- package/dist/private/datepicker/useDisplayNames.mjs.map +1 -1
- package/dist/private/dialog/useDialog.cjs.map +1 -1
- package/dist/private/dialog/useDialog.js.map +1 -1
- package/dist/private/dialog/useDialog.mjs.map +1 -1
- package/dist/private/disclosure/useDisclosure.cjs.map +1 -1
- package/dist/private/disclosure/useDisclosure.js.map +1 -1
- package/dist/private/disclosure/useDisclosure.mjs.map +1 -1
- package/dist/private/dnd/DragManager.cjs +4 -1
- package/dist/private/dnd/DragManager.cjs.map +1 -1
- package/dist/private/dnd/DragManager.js +4 -1
- package/dist/private/dnd/DragManager.js.map +1 -1
- package/dist/private/dnd/DragManager.mjs +4 -1
- package/dist/private/dnd/DragManager.mjs.map +1 -1
- package/dist/private/dnd/DragPreview.cjs.map +1 -1
- package/dist/private/dnd/DragPreview.js.map +1 -1
- package/dist/private/dnd/DragPreview.mjs.map +1 -1
- package/dist/private/dnd/DropTargetKeyboardNavigation.cjs +16 -4
- package/dist/private/dnd/DropTargetKeyboardNavigation.cjs.map +1 -1
- package/dist/private/dnd/DropTargetKeyboardNavigation.js +16 -4
- package/dist/private/dnd/DropTargetKeyboardNavigation.js.map +1 -1
- package/dist/private/dnd/DropTargetKeyboardNavigation.mjs +16 -4
- package/dist/private/dnd/DropTargetKeyboardNavigation.mjs.map +1 -1
- package/dist/private/dnd/ListDropTargetDelegate.cjs.map +1 -1
- package/dist/private/dnd/ListDropTargetDelegate.js.map +1 -1
- package/dist/private/dnd/ListDropTargetDelegate.mjs.map +1 -1
- package/dist/private/dnd/constants.cjs.map +1 -1
- package/dist/private/dnd/constants.js.map +1 -1
- package/dist/private/dnd/constants.mjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.cjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.js.map +1 -1
- package/dist/private/dnd/useAutoScroll.mjs.map +1 -1
- package/dist/private/dnd/useClipboard.cjs.map +1 -1
- package/dist/private/dnd/useClipboard.js.map +1 -1
- package/dist/private/dnd/useClipboard.mjs.map +1 -1
- package/dist/private/dnd/useDrag.cjs.map +1 -1
- package/dist/private/dnd/useDrag.js.map +1 -1
- package/dist/private/dnd/useDrag.mjs.map +1 -1
- package/dist/private/dnd/useDraggableCollection.cjs.map +1 -1
- package/dist/private/dnd/useDraggableCollection.js.map +1 -1
- package/dist/private/dnd/useDraggableCollection.mjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.cjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.js.map +1 -1
- package/dist/private/dnd/useDraggableItem.mjs.map +1 -1
- package/dist/private/dnd/useDrop.cjs.map +1 -1
- package/dist/private/dnd/useDrop.js.map +1 -1
- package/dist/private/dnd/useDrop.mjs.map +1 -1
- package/dist/private/dnd/useDropIndicator.cjs.map +1 -1
- package/dist/private/dnd/useDropIndicator.js.map +1 -1
- package/dist/private/dnd/useDropIndicator.mjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.cjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.js.map +1 -1
- package/dist/private/dnd/useDroppableCollection.mjs.map +1 -1
- package/dist/private/dnd/useDroppableItem.cjs.map +1 -1
- package/dist/private/dnd/useDroppableItem.js.map +1 -1
- package/dist/private/dnd/useDroppableItem.mjs.map +1 -1
- package/dist/private/dnd/useVirtualDrop.cjs.map +1 -1
- package/dist/private/dnd/useVirtualDrop.js.map +1 -1
- package/dist/private/dnd/useVirtualDrop.mjs.map +1 -1
- package/dist/private/dnd/utils.cjs +14 -4
- package/dist/private/dnd/utils.cjs.map +1 -1
- package/dist/private/dnd/utils.js +14 -4
- package/dist/private/dnd/utils.js.map +1 -1
- package/dist/private/dnd/utils.mjs +14 -4
- package/dist/private/dnd/utils.mjs.map +1 -1
- package/dist/private/focus/FocusRing.cjs.map +1 -1
- package/dist/private/focus/FocusRing.js.map +1 -1
- package/dist/private/focus/FocusRing.mjs.map +1 -1
- package/dist/private/focus/FocusScope.cjs +4 -1
- package/dist/private/focus/FocusScope.cjs.map +1 -1
- package/dist/private/focus/FocusScope.js +4 -1
- package/dist/private/focus/FocusScope.js.map +1 -1
- package/dist/private/focus/FocusScope.mjs +4 -1
- package/dist/private/focus/FocusScope.mjs.map +1 -1
- package/dist/private/focus/useFocusRing.cjs.map +1 -1
- package/dist/private/focus/useFocusRing.js.map +1 -1
- package/dist/private/focus/useFocusRing.mjs.map +1 -1
- package/dist/private/focus/useHasTabbableChild.cjs.map +1 -1
- package/dist/private/focus/useHasTabbableChild.js.map +1 -1
- package/dist/private/focus/useHasTabbableChild.mjs.map +1 -1
- package/dist/private/form/useFormValidation.cjs +1 -1
- package/dist/private/form/useFormValidation.cjs.map +1 -1
- package/dist/private/form/useFormValidation.js +1 -1
- package/dist/private/form/useFormValidation.js.map +1 -1
- package/dist/private/form/useFormValidation.mjs +1 -1
- package/dist/private/form/useFormValidation.mjs.map +1 -1
- package/dist/private/grid/GridKeyboardDelegate.cjs +9 -9
- package/dist/private/grid/GridKeyboardDelegate.cjs.map +1 -1
- package/dist/private/grid/GridKeyboardDelegate.js +10 -10
- package/dist/private/grid/GridKeyboardDelegate.js.map +1 -1
- package/dist/private/grid/GridKeyboardDelegate.mjs +9 -9
- package/dist/private/grid/GridKeyboardDelegate.mjs.map +1 -1
- package/dist/private/grid/useGrid.cjs.map +1 -1
- package/dist/private/grid/useGrid.js.map +1 -1
- package/dist/private/grid/useGrid.mjs.map +1 -1
- package/dist/private/grid/useGridCell.cjs.map +1 -1
- package/dist/private/grid/useGridCell.js.map +1 -1
- package/dist/private/grid/useGridCell.mjs.map +1 -1
- package/dist/private/grid/useGridRow.cjs.map +1 -1
- package/dist/private/grid/useGridRow.js.map +1 -1
- package/dist/private/grid/useGridRow.mjs.map +1 -1
- package/dist/private/grid/useGridRowGroup.cjs.map +1 -1
- package/dist/private/grid/useGridRowGroup.js.map +1 -1
- package/dist/private/grid/useGridRowGroup.mjs.map +1 -1
- package/dist/private/grid/useGridSelectionAnnouncement.cjs.map +1 -1
- package/dist/private/grid/useGridSelectionAnnouncement.js.map +1 -1
- package/dist/private/grid/useGridSelectionAnnouncement.mjs.map +1 -1
- package/dist/private/grid/useGridSelectionCheckbox.cjs.map +1 -1
- package/dist/private/grid/useGridSelectionCheckbox.js.map +1 -1
- package/dist/private/grid/useGridSelectionCheckbox.mjs.map +1 -1
- package/dist/private/grid/useHighlightSelectionDescription.cjs.map +1 -1
- package/dist/private/grid/useHighlightSelectionDescription.js.map +1 -1
- package/dist/private/grid/useHighlightSelectionDescription.mjs.map +1 -1
- package/dist/private/grid/utils.cjs.map +1 -1
- package/dist/private/grid/utils.js.map +1 -1
- package/dist/private/grid/utils.mjs.map +1 -1
- package/dist/private/gridlist/useGridList.cjs +2 -1
- package/dist/private/gridlist/useGridList.cjs.map +1 -1
- package/dist/private/gridlist/useGridList.js +2 -1
- package/dist/private/gridlist/useGridList.js.map +1 -1
- package/dist/private/gridlist/useGridList.mjs +2 -1
- package/dist/private/gridlist/useGridList.mjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.cjs +66 -23
- package/dist/private/gridlist/useGridListItem.cjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.js +67 -23
- package/dist/private/gridlist/useGridListItem.js.map +1 -1
- package/dist/private/gridlist/useGridListItem.mjs +66 -23
- package/dist/private/gridlist/useGridListItem.mjs.map +1 -1
- package/dist/private/gridlist/useGridListSection.cjs +3 -1
- package/dist/private/gridlist/useGridListSection.cjs.map +1 -1
- package/dist/private/gridlist/useGridListSection.js +3 -1
- package/dist/private/gridlist/useGridListSection.js.map +1 -1
- package/dist/private/gridlist/useGridListSection.mjs +3 -1
- package/dist/private/gridlist/useGridListSection.mjs.map +1 -1
- package/dist/private/gridlist/useGridListSelectionCheckbox.cjs.map +1 -1
- package/dist/private/gridlist/useGridListSelectionCheckbox.js.map +1 -1
- package/dist/private/gridlist/useGridListSelectionCheckbox.mjs.map +1 -1
- package/dist/private/gridlist/utils.cjs.map +1 -1
- package/dist/private/gridlist/utils.js.map +1 -1
- package/dist/private/gridlist/utils.mjs.map +1 -1
- package/dist/private/i18n/I18nProvider.cjs.map +1 -1
- package/dist/private/i18n/I18nProvider.js.map +1 -1
- package/dist/private/i18n/I18nProvider.mjs.map +1 -1
- package/dist/private/i18n/server.cjs.map +1 -1
- package/dist/private/i18n/server.js.map +1 -1
- package/dist/private/i18n/server.mjs.map +1 -1
- package/dist/private/i18n/useCollator.cjs.map +1 -1
- package/dist/private/i18n/useCollator.js.map +1 -1
- package/dist/private/i18n/useCollator.mjs.map +1 -1
- package/dist/private/i18n/useDateFormatter.cjs.map +1 -1
- package/dist/private/i18n/useDateFormatter.js.map +1 -1
- package/dist/private/i18n/useDateFormatter.mjs.map +1 -1
- package/dist/private/i18n/useDefaultLocale.cjs +2 -1
- package/dist/private/i18n/useDefaultLocale.cjs.map +1 -1
- package/dist/private/i18n/useDefaultLocale.js +2 -1
- package/dist/private/i18n/useDefaultLocale.js.map +1 -1
- package/dist/private/i18n/useDefaultLocale.mjs +2 -1
- package/dist/private/i18n/useDefaultLocale.mjs.map +1 -1
- package/dist/private/i18n/useFilter.cjs.map +1 -1
- package/dist/private/i18n/useFilter.js.map +1 -1
- package/dist/private/i18n/useFilter.mjs.map +1 -1
- package/dist/private/i18n/useListFormatter.cjs.map +1 -1
- package/dist/private/i18n/useListFormatter.js.map +1 -1
- package/dist/private/i18n/useListFormatter.mjs.map +1 -1
- package/dist/private/i18n/useLocalizedStringFormatter.cjs.map +1 -1
- package/dist/private/i18n/useLocalizedStringFormatter.js.map +1 -1
- package/dist/private/i18n/useLocalizedStringFormatter.mjs.map +1 -1
- package/dist/private/i18n/useNumberFormatter.cjs.map +1 -1
- package/dist/private/i18n/useNumberFormatter.js.map +1 -1
- package/dist/private/i18n/useNumberFormatter.mjs.map +1 -1
- package/dist/private/i18n/utils.cjs +2 -2
- package/dist/private/i18n/utils.cjs.map +1 -1
- package/dist/private/i18n/utils.js +2 -2
- package/dist/private/i18n/utils.js.map +1 -1
- package/dist/private/i18n/utils.mjs +2 -2
- package/dist/private/i18n/utils.mjs.map +1 -1
- package/dist/private/interactions/PressResponder.cjs.map +1 -1
- package/dist/private/interactions/PressResponder.js.map +1 -1
- package/dist/private/interactions/PressResponder.mjs.map +1 -1
- package/dist/private/interactions/Pressable.cjs.map +1 -1
- package/dist/private/interactions/Pressable.js.map +1 -1
- package/dist/private/interactions/Pressable.mjs.map +1 -1
- package/dist/private/interactions/context.cjs.map +1 -1
- package/dist/private/interactions/context.js.map +1 -1
- package/dist/private/interactions/context.mjs.map +1 -1
- package/dist/private/interactions/createEventHandler.cjs +3 -0
- package/dist/private/interactions/createEventHandler.cjs.map +1 -1
- package/dist/private/interactions/createEventHandler.js +3 -0
- package/dist/private/interactions/createEventHandler.js.map +1 -1
- package/dist/private/interactions/createEventHandler.mjs +3 -0
- package/dist/private/interactions/createEventHandler.mjs.map +1 -1
- package/dist/private/interactions/focusSafely.cjs.map +1 -1
- package/dist/private/interactions/focusSafely.js.map +1 -1
- package/dist/private/interactions/focusSafely.mjs.map +1 -1
- package/dist/private/interactions/textSelection.cjs.map +1 -1
- package/dist/private/interactions/textSelection.js.map +1 -1
- package/dist/private/interactions/textSelection.mjs.map +1 -1
- package/dist/private/interactions/useFocus.cjs.map +1 -1
- package/dist/private/interactions/useFocus.js.map +1 -1
- package/dist/private/interactions/useFocus.mjs.map +1 -1
- package/dist/private/interactions/useFocusVisible.cjs +20 -8
- package/dist/private/interactions/useFocusVisible.cjs.map +1 -1
- package/dist/private/interactions/useFocusVisible.js +20 -8
- package/dist/private/interactions/useFocusVisible.js.map +1 -1
- package/dist/private/interactions/useFocusVisible.mjs +20 -8
- package/dist/private/interactions/useFocusVisible.mjs.map +1 -1
- package/dist/private/interactions/useFocusWithin.cjs.map +1 -1
- package/dist/private/interactions/useFocusWithin.js.map +1 -1
- package/dist/private/interactions/useFocusWithin.mjs.map +1 -1
- package/dist/private/interactions/useFocusable.cjs.map +1 -1
- package/dist/private/interactions/useFocusable.js.map +1 -1
- package/dist/private/interactions/useFocusable.mjs.map +1 -1
- package/dist/private/interactions/useHover.cjs.map +1 -1
- package/dist/private/interactions/useHover.js.map +1 -1
- package/dist/private/interactions/useHover.mjs.map +1 -1
- package/dist/private/interactions/useInteractOutside.cjs.map +1 -1
- package/dist/private/interactions/useInteractOutside.js.map +1 -1
- package/dist/private/interactions/useInteractOutside.mjs.map +1 -1
- package/dist/private/interactions/useKeyboard.cjs.map +1 -1
- package/dist/private/interactions/useKeyboard.js.map +1 -1
- package/dist/private/interactions/useKeyboard.mjs.map +1 -1
- package/dist/private/interactions/useLongPress.cjs.map +1 -1
- package/dist/private/interactions/useLongPress.js.map +1 -1
- package/dist/private/interactions/useLongPress.mjs.map +1 -1
- package/dist/private/interactions/useMove.cjs.map +1 -1
- package/dist/private/interactions/useMove.js.map +1 -1
- package/dist/private/interactions/useMove.mjs.map +1 -1
- package/dist/private/interactions/usePress.cjs +11 -0
- package/dist/private/interactions/usePress.cjs.map +1 -1
- package/dist/private/interactions/usePress.js +12 -1
- package/dist/private/interactions/usePress.js.map +1 -1
- package/dist/private/interactions/usePress.mjs +12 -1
- package/dist/private/interactions/usePress.mjs.map +1 -1
- package/dist/private/interactions/useScrollWheel.cjs.map +1 -1
- package/dist/private/interactions/useScrollWheel.js.map +1 -1
- package/dist/private/interactions/useScrollWheel.mjs.map +1 -1
- package/dist/private/interactions/utils.cjs.map +1 -1
- package/dist/private/interactions/utils.js.map +1 -1
- package/dist/private/interactions/utils.mjs.map +1 -1
- package/dist/private/intl/tag/en-US.cjs.map +1 -1
- package/dist/private/intl/tag/en-US.js.map +1 -1
- package/dist/private/intl/tag/en-US.mjs.map +1 -1
- package/dist/private/label/useField.cjs.map +1 -1
- package/dist/private/label/useField.js.map +1 -1
- package/dist/private/label/useField.mjs.map +1 -1
- package/dist/private/label/useLabel.cjs.map +1 -1
- package/dist/private/label/useLabel.js.map +1 -1
- package/dist/private/label/useLabel.mjs.map +1 -1
- package/dist/private/landmark/useLandmark.cjs +2 -1
- package/dist/private/landmark/useLandmark.cjs.map +1 -1
- package/dist/private/landmark/useLandmark.js +2 -1
- package/dist/private/landmark/useLandmark.js.map +1 -1
- package/dist/private/landmark/useLandmark.mjs +2 -1
- package/dist/private/landmark/useLandmark.mjs.map +1 -1
- package/dist/private/link/useLink.cjs.map +1 -1
- package/dist/private/link/useLink.js.map +1 -1
- package/dist/private/link/useLink.mjs.map +1 -1
- package/dist/private/listbox/useListBox.cjs.map +1 -1
- package/dist/private/listbox/useListBox.js.map +1 -1
- package/dist/private/listbox/useListBox.mjs.map +1 -1
- package/dist/private/listbox/useListBoxSection.cjs.map +1 -1
- package/dist/private/listbox/useListBoxSection.js.map +1 -1
- package/dist/private/listbox/useListBoxSection.mjs.map +1 -1
- package/dist/private/listbox/useOption.cjs.map +1 -1
- package/dist/private/listbox/useOption.js.map +1 -1
- package/dist/private/listbox/useOption.mjs.map +1 -1
- package/dist/private/listbox/utils.cjs.map +1 -1
- package/dist/private/listbox/utils.js.map +1 -1
- package/dist/private/listbox/utils.mjs.map +1 -1
- package/dist/private/live-announcer/LiveAnnouncer.cjs +2 -2
- package/dist/private/live-announcer/LiveAnnouncer.cjs.map +1 -1
- package/dist/private/live-announcer/LiveAnnouncer.js +2 -2
- package/dist/private/live-announcer/LiveAnnouncer.js.map +1 -1
- package/dist/private/live-announcer/LiveAnnouncer.mjs +2 -2
- package/dist/private/live-announcer/LiveAnnouncer.mjs.map +1 -1
- package/dist/private/menu/useMenu.cjs.map +1 -1
- package/dist/private/menu/useMenu.js.map +1 -1
- package/dist/private/menu/useMenu.mjs.map +1 -1
- package/dist/private/menu/useMenuItem.cjs +1 -1
- package/dist/private/menu/useMenuItem.cjs.map +1 -1
- package/dist/private/menu/useMenuItem.js +1 -1
- package/dist/private/menu/useMenuItem.js.map +1 -1
- package/dist/private/menu/useMenuItem.mjs +1 -1
- package/dist/private/menu/useMenuItem.mjs.map +1 -1
- package/dist/private/menu/useMenuSection.cjs.map +1 -1
- package/dist/private/menu/useMenuSection.js.map +1 -1
- package/dist/private/menu/useMenuSection.mjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.js.map +1 -1
- package/dist/private/menu/useMenuTrigger.mjs.map +1 -1
- package/dist/private/menu/useSafelyMouseToSubmenu.cjs.map +1 -1
- package/dist/private/menu/useSafelyMouseToSubmenu.js.map +1 -1
- package/dist/private/menu/useSafelyMouseToSubmenu.mjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.js.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.mjs.map +1 -1
- package/dist/private/menu/utils.cjs.map +1 -1
- package/dist/private/menu/utils.js.map +1 -1
- package/dist/private/menu/utils.mjs.map +1 -1
- package/dist/private/meter/useMeter.cjs.map +1 -1
- package/dist/private/meter/useMeter.js.map +1 -1
- package/dist/private/meter/useMeter.mjs.map +1 -1
- package/dist/private/numberfield/useNumberField.cjs.map +1 -1
- package/dist/private/numberfield/useNumberField.js.map +1 -1
- package/dist/private/numberfield/useNumberField.mjs.map +1 -1
- package/dist/private/overlays/DismissButton.cjs.map +1 -1
- package/dist/private/overlays/DismissButton.js.map +1 -1
- package/dist/private/overlays/DismissButton.mjs.map +1 -1
- package/dist/private/overlays/Overlay.cjs.map +1 -1
- package/dist/private/overlays/Overlay.js.map +1 -1
- package/dist/private/overlays/Overlay.mjs.map +1 -1
- package/dist/private/overlays/PortalProvider.cjs.map +1 -1
- package/dist/private/overlays/PortalProvider.js.map +1 -1
- package/dist/private/overlays/PortalProvider.mjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.cjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.js.map +1 -1
- package/dist/private/overlays/ariaHideOutside.mjs.map +1 -1
- package/dist/private/overlays/calculatePosition.cjs +19 -20
- package/dist/private/overlays/calculatePosition.cjs.map +1 -1
- package/dist/private/overlays/calculatePosition.js +20 -21
- package/dist/private/overlays/calculatePosition.js.map +1 -1
- package/dist/private/overlays/calculatePosition.mjs +19 -20
- package/dist/private/overlays/calculatePosition.mjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.cjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.js.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.mjs.map +1 -1
- package/dist/private/overlays/useModal.cjs.map +1 -1
- package/dist/private/overlays/useModal.js.map +1 -1
- package/dist/private/overlays/useModal.mjs.map +1 -1
- package/dist/private/overlays/useModalOverlay.cjs.map +1 -1
- package/dist/private/overlays/useModalOverlay.js.map +1 -1
- package/dist/private/overlays/useModalOverlay.mjs.map +1 -1
- package/dist/private/overlays/useOverlay.cjs.map +1 -1
- package/dist/private/overlays/useOverlay.js.map +1 -1
- package/dist/private/overlays/useOverlay.mjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.cjs +3 -2
- package/dist/private/overlays/useOverlayPosition.cjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.js +3 -2
- package/dist/private/overlays/useOverlayPosition.js.map +1 -1
- package/dist/private/overlays/useOverlayPosition.mjs +3 -2
- package/dist/private/overlays/useOverlayPosition.mjs.map +1 -1
- package/dist/private/overlays/useOverlayTrigger.cjs.map +1 -1
- package/dist/private/overlays/useOverlayTrigger.js.map +1 -1
- package/dist/private/overlays/useOverlayTrigger.mjs.map +1 -1
- package/dist/private/overlays/usePopover.cjs.map +1 -1
- package/dist/private/overlays/usePopover.js.map +1 -1
- package/dist/private/overlays/usePopover.mjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.cjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.js.map +1 -1
- package/dist/private/overlays/usePreventScroll.mjs.map +1 -1
- package/dist/private/progress/useProgressBar.cjs.map +1 -1
- package/dist/private/progress/useProgressBar.js.map +1 -1
- package/dist/private/progress/useProgressBar.mjs.map +1 -1
- package/dist/private/radio/useRadio.cjs +5 -0
- package/dist/private/radio/useRadio.cjs.map +1 -1
- package/dist/private/radio/useRadio.js +5 -0
- package/dist/private/radio/useRadio.js.map +1 -1
- package/dist/private/radio/useRadio.mjs +5 -0
- package/dist/private/radio/useRadio.mjs.map +1 -1
- package/dist/private/radio/useRadioGroup.cjs.map +1 -1
- package/dist/private/radio/useRadioGroup.js.map +1 -1
- package/dist/private/radio/useRadioGroup.mjs.map +1 -1
- package/dist/private/radio/utils.cjs.map +1 -1
- package/dist/private/radio/utils.js.map +1 -1
- package/dist/private/radio/utils.mjs.map +1 -1
- package/dist/private/searchfield/useSearchField.cjs.map +1 -1
- package/dist/private/searchfield/useSearchField.js.map +1 -1
- package/dist/private/searchfield/useSearchField.mjs.map +1 -1
- package/dist/private/select/HiddenSelect.cjs +2 -1
- package/dist/private/select/HiddenSelect.cjs.map +1 -1
- package/dist/private/select/HiddenSelect.js +2 -1
- package/dist/private/select/HiddenSelect.js.map +1 -1
- package/dist/private/select/HiddenSelect.mjs +2 -1
- package/dist/private/select/HiddenSelect.mjs.map +1 -1
- package/dist/private/select/useSelect.cjs +3 -4
- package/dist/private/select/useSelect.cjs.map +1 -1
- package/dist/private/select/useSelect.js +3 -4
- package/dist/private/select/useSelect.js.map +1 -1
- package/dist/private/select/useSelect.mjs +3 -4
- package/dist/private/select/useSelect.mjs.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.cjs +56 -28
- package/dist/private/selection/ListKeyboardDelegate.cjs.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.js +57 -29
- package/dist/private/selection/ListKeyboardDelegate.js.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.mjs +56 -28
- package/dist/private/selection/ListKeyboardDelegate.mjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.cjs +21 -14
- package/dist/private/selection/useSelectableCollection.cjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.js +27 -19
- package/dist/private/selection/useSelectableCollection.js.map +1 -1
- package/dist/private/selection/useSelectableCollection.mjs +21 -14
- package/dist/private/selection/useSelectableCollection.mjs.map +1 -1
- package/dist/private/selection/useSelectableItem.cjs.map +1 -1
- package/dist/private/selection/useSelectableItem.js.map +1 -1
- package/dist/private/selection/useSelectableItem.mjs.map +1 -1
- package/dist/private/selection/useSelectableList.cjs.map +1 -1
- package/dist/private/selection/useSelectableList.js.map +1 -1
- package/dist/private/selection/useSelectableList.mjs.map +1 -1
- package/dist/private/selection/useTypeSelect.cjs +50 -18
- package/dist/private/selection/useTypeSelect.cjs.map +1 -1
- package/dist/private/selection/useTypeSelect.js +51 -19
- package/dist/private/selection/useTypeSelect.js.map +1 -1
- package/dist/private/selection/useTypeSelect.mjs +51 -19
- package/dist/private/selection/useTypeSelect.mjs.map +1 -1
- package/dist/private/selection/utils.cjs.map +1 -1
- package/dist/private/selection/utils.js.map +1 -1
- package/dist/private/selection/utils.mjs.map +1 -1
- package/dist/private/separator/useSeparator.cjs.map +1 -1
- package/dist/private/separator/useSeparator.js.map +1 -1
- package/dist/private/separator/useSeparator.mjs.map +1 -1
- package/dist/private/slider/useSlider.cjs +4 -2
- package/dist/private/slider/useSlider.cjs.map +1 -1
- package/dist/private/slider/useSlider.js +4 -2
- package/dist/private/slider/useSlider.js.map +1 -1
- package/dist/private/slider/useSlider.mjs +4 -2
- package/dist/private/slider/useSlider.mjs.map +1 -1
- package/dist/private/slider/useSliderThumb.cjs.map +1 -1
- package/dist/private/slider/useSliderThumb.js.map +1 -1
- package/dist/private/slider/useSliderThumb.mjs.map +1 -1
- package/dist/private/slider/utils.cjs.map +1 -1
- package/dist/private/slider/utils.js.map +1 -1
- package/dist/private/slider/utils.mjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.cjs +2 -0
- package/dist/private/spinbutton/useSpinButton.cjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.js +2 -0
- package/dist/private/spinbutton/useSpinButton.js.map +1 -1
- package/dist/private/spinbutton/useSpinButton.mjs +2 -0
- package/dist/private/spinbutton/useSpinButton.mjs.map +1 -1
- package/dist/private/ssr/SSRProvider.cjs +6 -6
- package/dist/private/ssr/SSRProvider.cjs.map +1 -1
- package/dist/private/ssr/SSRProvider.js +6 -6
- package/dist/private/ssr/SSRProvider.js.map +1 -1
- package/dist/private/ssr/SSRProvider.mjs +6 -6
- package/dist/private/ssr/SSRProvider.mjs.map +1 -1
- package/dist/private/steplist/useStepList.cjs.map +1 -1
- package/dist/private/steplist/useStepList.js.map +1 -1
- package/dist/private/steplist/useStepList.mjs.map +1 -1
- package/dist/private/steplist/useStepListItem.cjs.map +1 -1
- package/dist/private/steplist/useStepListItem.js.map +1 -1
- package/dist/private/steplist/useStepListItem.mjs.map +1 -1
- package/dist/private/switch/useSwitch.cjs +2 -4
- package/dist/private/switch/useSwitch.cjs.map +1 -1
- package/dist/private/switch/useSwitch.js +2 -4
- package/dist/private/switch/useSwitch.js.map +1 -1
- package/dist/private/switch/useSwitch.mjs +2 -4
- package/dist/private/switch/useSwitch.mjs.map +1 -1
- package/dist/private/table/TableKeyboardDelegate.cjs +4 -4
- package/dist/private/table/TableKeyboardDelegate.cjs.map +1 -1
- package/dist/private/table/TableKeyboardDelegate.js +4 -4
- package/dist/private/table/TableKeyboardDelegate.js.map +1 -1
- package/dist/private/table/TableKeyboardDelegate.mjs +4 -4
- package/dist/private/table/TableKeyboardDelegate.mjs.map +1 -1
- package/dist/private/table/useTable.cjs.map +1 -1
- package/dist/private/table/useTable.js.map +1 -1
- package/dist/private/table/useTable.mjs.map +1 -1
- package/dist/private/table/useTableCell.cjs.map +1 -1
- package/dist/private/table/useTableCell.js.map +1 -1
- package/dist/private/table/useTableCell.mjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.cjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.js.map +1 -1
- package/dist/private/table/useTableColumnHeader.mjs.map +1 -1
- package/dist/private/table/useTableColumnResize.cjs +1 -1
- package/dist/private/table/useTableColumnResize.cjs.map +1 -1
- package/dist/private/table/useTableColumnResize.js +1 -1
- package/dist/private/table/useTableColumnResize.js.map +1 -1
- package/dist/private/table/useTableColumnResize.mjs +1 -1
- package/dist/private/table/useTableColumnResize.mjs.map +1 -1
- package/dist/private/table/useTableHeaderRow.cjs +2 -1
- package/dist/private/table/useTableHeaderRow.cjs.map +1 -1
- package/dist/private/table/useTableHeaderRow.js +2 -1
- package/dist/private/table/useTableHeaderRow.js.map +1 -1
- package/dist/private/table/useTableHeaderRow.mjs +2 -1
- package/dist/private/table/useTableHeaderRow.mjs.map +1 -1
- package/dist/private/table/useTableRow.cjs +2 -2
- package/dist/private/table/useTableRow.cjs.map +1 -1
- package/dist/private/table/useTableRow.js +2 -2
- package/dist/private/table/useTableRow.js.map +1 -1
- package/dist/private/table/useTableRow.mjs +2 -2
- package/dist/private/table/useTableRow.mjs.map +1 -1
- package/dist/private/table/useTableSelectionCheckbox.cjs.map +1 -1
- package/dist/private/table/useTableSelectionCheckbox.js.map +1 -1
- package/dist/private/table/useTableSelectionCheckbox.mjs.map +1 -1
- package/dist/private/table/utils.cjs.map +1 -1
- package/dist/private/table/utils.js.map +1 -1
- package/dist/private/table/utils.mjs.map +1 -1
- package/dist/private/tabs/TabsKeyboardDelegate.cjs +2 -2
- package/dist/private/tabs/TabsKeyboardDelegate.cjs.map +1 -1
- package/dist/private/tabs/TabsKeyboardDelegate.js +2 -2
- package/dist/private/tabs/TabsKeyboardDelegate.js.map +1 -1
- package/dist/private/tabs/TabsKeyboardDelegate.mjs +2 -2
- package/dist/private/tabs/TabsKeyboardDelegate.mjs.map +1 -1
- package/dist/private/tabs/useTab.cjs.map +1 -1
- package/dist/private/tabs/useTab.js.map +1 -1
- package/dist/private/tabs/useTab.mjs.map +1 -1
- package/dist/private/tabs/useTabList.cjs +10 -10
- package/dist/private/tabs/useTabList.cjs.map +1 -1
- package/dist/private/tabs/useTabList.js +10 -10
- package/dist/private/tabs/useTabList.js.map +1 -1
- package/dist/private/tabs/useTabList.mjs +10 -10
- package/dist/private/tabs/useTabList.mjs.map +1 -1
- package/dist/private/tabs/useTabPanel.cjs.map +1 -1
- package/dist/private/tabs/useTabPanel.js.map +1 -1
- package/dist/private/tabs/useTabPanel.mjs.map +1 -1
- package/dist/private/tabs/utils.cjs.map +1 -1
- package/dist/private/tabs/utils.js.map +1 -1
- package/dist/private/tabs/utils.mjs.map +1 -1
- package/dist/private/tag/useTag.cjs.map +1 -1
- package/dist/private/tag/useTag.js.map +1 -1
- package/dist/private/tag/useTag.mjs.map +1 -1
- package/dist/private/tag/useTagGroup.cjs.map +1 -1
- package/dist/private/tag/useTagGroup.js.map +1 -1
- package/dist/private/tag/useTagGroup.mjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.cjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.js.map +1 -1
- package/dist/private/textfield/useFormattedTextField.mjs.map +1 -1
- package/dist/private/textfield/useTextField.cjs.map +1 -1
- package/dist/private/textfield/useTextField.js.map +1 -1
- package/dist/private/textfield/useTextField.mjs.map +1 -1
- package/dist/private/toast/useToast.cjs +2 -1
- package/dist/private/toast/useToast.cjs.map +1 -1
- package/dist/private/toast/useToast.js +2 -1
- package/dist/private/toast/useToast.js.map +1 -1
- package/dist/private/toast/useToast.mjs +2 -1
- package/dist/private/toast/useToast.mjs.map +1 -1
- package/dist/private/toast/useToastRegion.cjs.map +1 -1
- package/dist/private/toast/useToastRegion.js.map +1 -1
- package/dist/private/toast/useToastRegion.mjs.map +1 -1
- package/dist/private/toggle/useToggle.cjs +70 -8
- package/dist/private/toggle/useToggle.cjs.map +1 -1
- package/dist/private/toggle/useToggle.js +70 -8
- package/dist/private/toggle/useToggle.js.map +1 -1
- package/dist/private/toggle/useToggle.mjs +70 -8
- package/dist/private/toggle/useToggle.mjs.map +1 -1
- package/dist/private/toolbar/useToolbar.cjs +0 -1
- package/dist/private/toolbar/useToolbar.cjs.map +1 -1
- package/dist/private/toolbar/useToolbar.js +0 -1
- package/dist/private/toolbar/useToolbar.js.map +1 -1
- package/dist/private/toolbar/useToolbar.mjs +0 -1
- package/dist/private/toolbar/useToolbar.mjs.map +1 -1
- package/dist/private/tooltip/useTooltip.cjs.map +1 -1
- package/dist/private/tooltip/useTooltip.js.map +1 -1
- package/dist/private/tooltip/useTooltip.mjs.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.cjs.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.js.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.mjs.map +1 -1
- package/dist/private/tree/useTree.cjs.map +1 -1
- package/dist/private/tree/useTree.js.map +1 -1
- package/dist/private/tree/useTree.mjs.map +1 -1
- package/dist/private/tree/useTreeItem.cjs.map +1 -1
- package/dist/private/tree/useTreeItem.js.map +1 -1
- package/dist/private/tree/useTreeItem.mjs.map +1 -1
- package/dist/private/utils/animation.cjs.map +1 -1
- package/dist/private/utils/animation.js.map +1 -1
- package/dist/private/utils/animation.mjs.map +1 -1
- package/dist/private/utils/domHelpers.cjs +2 -1
- package/dist/private/utils/domHelpers.cjs.map +1 -1
- package/dist/private/utils/domHelpers.js +2 -1
- package/dist/private/utils/domHelpers.js.map +1 -1
- package/dist/private/utils/domHelpers.mjs +2 -1
- package/dist/private/utils/domHelpers.mjs.map +1 -1
- package/dist/private/utils/filterDOMProps.cjs.map +1 -1
- package/dist/private/utils/filterDOMProps.js.map +1 -1
- package/dist/private/utils/filterDOMProps.mjs.map +1 -1
- package/dist/private/utils/focusWithoutScrolling.cjs.map +1 -1
- package/dist/private/utils/focusWithoutScrolling.js.map +1 -1
- package/dist/private/utils/focusWithoutScrolling.mjs.map +1 -1
- package/dist/private/utils/getNonce.cjs.map +1 -1
- package/dist/private/utils/getNonce.js.map +1 -1
- package/dist/private/utils/getNonce.mjs.map +1 -1
- package/dist/private/utils/getOffset.cjs.map +1 -1
- package/dist/private/utils/getOffset.js.map +1 -1
- package/dist/private/utils/getOffset.mjs.map +1 -1
- package/dist/private/utils/getScrollParent.cjs.map +1 -1
- package/dist/private/utils/getScrollParent.js.map +1 -1
- package/dist/private/utils/getScrollParent.mjs.map +1 -1
- package/dist/private/utils/getScrollParents.cjs +3 -2
- package/dist/private/utils/getScrollParents.cjs.map +1 -1
- package/dist/private/utils/getScrollParents.js +3 -2
- package/dist/private/utils/getScrollParents.js.map +1 -1
- package/dist/private/utils/getScrollParents.mjs +3 -2
- package/dist/private/utils/getScrollParents.mjs.map +1 -1
- package/dist/private/utils/isElementVisible.cjs +1 -1
- package/dist/private/utils/isElementVisible.cjs.map +1 -1
- package/dist/private/utils/isElementVisible.js +1 -1
- package/dist/private/utils/isElementVisible.js.map +1 -1
- package/dist/private/utils/isElementVisible.mjs +1 -1
- package/dist/private/utils/isElementVisible.mjs.map +1 -1
- package/dist/private/utils/isFocusable.cjs +3 -1
- package/dist/private/utils/isFocusable.cjs.map +1 -1
- package/dist/private/utils/isFocusable.js +3 -1
- package/dist/private/utils/isFocusable.js.map +1 -1
- package/dist/private/utils/isFocusable.mjs +3 -1
- package/dist/private/utils/isFocusable.mjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.cjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.js.map +1 -1
- package/dist/private/utils/isVirtualEvent.mjs.map +1 -1
- package/dist/private/utils/keyboard.cjs.map +1 -1
- package/dist/private/utils/keyboard.js.map +1 -1
- package/dist/private/utils/keyboard.mjs.map +1 -1
- package/dist/private/utils/mergeProps.cjs.map +1 -1
- package/dist/private/utils/mergeProps.js.map +1 -1
- package/dist/private/utils/mergeProps.mjs.map +1 -1
- package/dist/private/utils/mergeRefs.cjs.map +1 -1
- package/dist/private/utils/mergeRefs.js.map +1 -1
- package/dist/private/utils/mergeRefs.mjs.map +1 -1
- package/dist/private/utils/openLink.cjs +12 -8
- package/dist/private/utils/openLink.cjs.map +1 -1
- package/dist/private/utils/openLink.js +12 -8
- package/dist/private/utils/openLink.js.map +1 -1
- package/dist/private/utils/openLink.mjs +12 -8
- package/dist/private/utils/openLink.mjs.map +1 -1
- package/dist/private/utils/platform.cjs.map +1 -1
- package/dist/private/utils/platform.js.map +1 -1
- package/dist/private/utils/platform.mjs.map +1 -1
- package/dist/private/utils/scrollIntoView.cjs +21 -18
- package/dist/private/utils/scrollIntoView.cjs.map +1 -1
- package/dist/private/utils/scrollIntoView.js +21 -18
- package/dist/private/utils/scrollIntoView.js.map +1 -1
- package/dist/private/utils/scrollIntoView.mjs +21 -18
- package/dist/private/utils/scrollIntoView.mjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/private/utils/shadowdom/ShadowTreeWalker.cjs +6 -6
- package/dist/private/utils/shadowdom/ShadowTreeWalker.cjs.map +1 -1
- package/dist/private/utils/shadowdom/ShadowTreeWalker.js +6 -6
- package/dist/private/utils/shadowdom/ShadowTreeWalker.js.map +1 -1
- package/dist/private/utils/shadowdom/ShadowTreeWalker.mjs +6 -6
- package/dist/private/utils/shadowdom/ShadowTreeWalker.mjs.map +1 -1
- package/dist/private/utils/useDeepMemo.cjs +1 -1
- package/dist/private/utils/useDeepMemo.cjs.map +1 -1
- package/dist/private/utils/useDeepMemo.js +1 -1
- package/dist/private/utils/useDeepMemo.js.map +1 -1
- package/dist/private/utils/useDeepMemo.mjs +1 -1
- package/dist/private/utils/useDeepMemo.mjs.map +1 -1
- package/dist/private/utils/useDescription.cjs.map +1 -1
- package/dist/private/utils/useDescription.js.map +1 -1
- package/dist/private/utils/useDescription.mjs.map +1 -1
- package/dist/private/utils/useDrag1D.cjs +1 -1
- package/dist/private/utils/useDrag1D.cjs.map +1 -1
- package/dist/private/utils/useDrag1D.js +1 -1
- package/dist/private/utils/useDrag1D.js.map +1 -1
- package/dist/private/utils/useDrag1D.mjs +1 -1
- package/dist/private/utils/useDrag1D.mjs.map +1 -1
- package/dist/private/utils/useFormReset.cjs.map +1 -1
- package/dist/private/utils/useFormReset.js.map +1 -1
- package/dist/private/utils/useFormReset.mjs.map +1 -1
- package/dist/private/utils/useGlobalListeners.cjs.map +1 -1
- package/dist/private/utils/useGlobalListeners.js.map +1 -1
- package/dist/private/utils/useGlobalListeners.mjs.map +1 -1
- package/dist/private/utils/useId.cjs.map +1 -1
- package/dist/private/utils/useId.js.map +1 -1
- package/dist/private/utils/useId.mjs.map +1 -1
- package/dist/private/utils/useLabels.cjs.map +1 -1
- package/dist/private/utils/useLabels.js.map +1 -1
- package/dist/private/utils/useLabels.mjs.map +1 -1
- package/dist/private/utils/useLayoutEffect.cjs.map +1 -1
- package/dist/private/utils/useLayoutEffect.js.map +1 -1
- package/dist/private/utils/useLayoutEffect.mjs.map +1 -1
- package/dist/private/utils/useLoadMore.cjs.map +1 -1
- package/dist/private/utils/useLoadMore.js.map +1 -1
- package/dist/private/utils/useLoadMore.mjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.cjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.js.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.mjs.map +1 -1
- package/dist/private/utils/useObjectRef.cjs.map +1 -1
- package/dist/private/utils/useObjectRef.js.map +1 -1
- package/dist/private/utils/useObjectRef.mjs.map +1 -1
- package/dist/private/utils/useResizeObserver.cjs.map +1 -1
- package/dist/private/utils/useResizeObserver.js.map +1 -1
- package/dist/private/utils/useResizeObserver.mjs.map +1 -1
- package/dist/private/utils/useSlot.cjs +54 -0
- package/dist/private/utils/useSlot.cjs.map +1 -0
- package/dist/private/utils/useSlot.js +49 -0
- package/dist/private/utils/useSlot.js.map +1 -0
- package/dist/private/utils/useSlot.mjs +49 -0
- package/dist/private/utils/useSlot.mjs.map +1 -0
- package/dist/private/utils/useSyncRef.cjs +2 -1
- package/dist/private/utils/useSyncRef.cjs.map +1 -1
- package/dist/private/utils/useSyncRef.js +2 -1
- package/dist/private/utils/useSyncRef.js.map +1 -1
- package/dist/private/utils/useSyncRef.mjs +2 -1
- package/dist/private/utils/useSyncRef.mjs.map +1 -1
- package/dist/private/utils/useUpdateEffect.cjs.map +1 -1
- package/dist/private/utils/useUpdateEffect.js.map +1 -1
- package/dist/private/utils/useUpdateEffect.mjs.map +1 -1
- package/dist/private/utils/useValueEffect.cjs.map +1 -1
- package/dist/private/utils/useValueEffect.js.map +1 -1
- package/dist/private/utils/useValueEffect.mjs.map +1 -1
- package/dist/private/utils/useViewportSize.cjs +3 -1
- package/dist/private/utils/useViewportSize.cjs.map +1 -1
- package/dist/private/utils/useViewportSize.js +3 -1
- package/dist/private/utils/useViewportSize.js.map +1 -1
- package/dist/private/utils/useViewportSize.mjs +3 -1
- package/dist/private/utils/useViewportSize.mjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.cjs +2 -2
- package/dist/private/virtualizer/ScrollView.cjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.js +2 -2
- package/dist/private/virtualizer/ScrollView.js.map +1 -1
- package/dist/private/virtualizer/ScrollView.mjs +2 -2
- package/dist/private/virtualizer/ScrollView.mjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.cjs.map +1 -1
- package/dist/private/virtualizer/Virtualizer.js.map +1 -1
- package/dist/private/virtualizer/Virtualizer.mjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.mjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
- package/dist/private/virtualizer/utils.cjs.map +1 -1
- package/dist/private/virtualizer/utils.js.map +1 -1
- package/dist/private/virtualizer/utils.mjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.cjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.js.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.mjs.map +1 -1
- package/dist/types/exports/index.d.ts +7 -0
- package/dist/types/exports/useCalendar.d.ts +6 -0
- package/dist/types/exports/useRangeCalendar.d.ts +11 -0
- package/dist/types/src/actiongroup/useActionGroup.d.ts +5 -1
- package/dist/types/src/aria-modal-polyfill/ariaModalPolyfill.d.ts +2 -1
- package/dist/types/src/autocomplete/useAutocomplete.d.ts +21 -9
- package/dist/types/src/autocomplete/useSearchAutocomplete.d.ts +15 -8
- package/dist/types/src/breadcrumbs/useBreadcrumbItem.d.ts +2 -0
- package/dist/types/src/button/useButton.d.ts +25 -7
- package/dist/types/src/button/useToggleButtonGroup.d.ts +1 -0
- package/dist/types/src/calendar/useCalendar.d.ts +3 -3
- package/dist/types/src/calendar/useCalendarBase.d.ts +2 -2
- package/dist/types/src/calendar/useCalendarCell.d.ts +9 -8
- package/dist/types/src/calendar/useCalendarGrid.d.ts +8 -4
- package/dist/types/src/calendar/useCalendarHeading.d.ts +22 -0
- package/dist/types/src/calendar/useCalendarMonthPicker.d.ts +22 -0
- package/dist/types/src/calendar/useCalendarYearPicker.d.ts +32 -0
- package/dist/types/src/calendar/useRangeCalendar.d.ts +5 -5
- package/dist/types/src/calendar/utils.d.ts +3 -3
- package/dist/types/src/checkbox/useCheckbox.d.ts +6 -1
- package/dist/types/src/checkbox/useCheckboxGroup.d.ts +1 -0
- package/dist/types/src/checkbox/useCheckboxGroupItem.d.ts +3 -2
- package/dist/types/src/collections/CollectionBuilder.d.ts +8 -7
- package/dist/types/src/collections/useCachedChildren.d.ts +1 -1
- package/dist/types/src/color/useColorArea.d.ts +7 -4
- package/dist/types/src/color/useColorChannelField.d.ts +2 -2
- package/dist/types/src/combobox/useComboBox.d.ts +5 -3
- package/dist/types/src/datepicker/useDateField.d.ts +2 -1
- package/dist/types/src/datepicker/useDatePicker.d.ts +5 -3
- package/dist/types/src/dialog/useDialog.d.ts +1 -0
- package/dist/types/src/disclosure/useDisclosure.d.ts +1 -0
- package/dist/types/src/dnd/ListDropTargetDelegate.d.ts +3 -0
- package/dist/types/src/dnd/useDrag.d.ts +11 -4
- package/dist/types/src/dnd/useDraggableCollection.d.ts +2 -2
- package/dist/types/src/dnd/useDraggableItem.d.ts +7 -6
- package/dist/types/src/dnd/useDrop.d.ts +5 -4
- package/dist/types/src/dnd/useDroppableCollection.d.ts +2 -2
- package/dist/types/src/dnd/utils.d.ts +3 -3
- package/dist/types/src/focus/FocusRing.d.ts +1 -0
- package/dist/types/src/focus/useFocusRing.d.ts +1 -0
- package/dist/types/src/focus/useHasTabbableChild.d.ts +1 -0
- package/dist/types/src/grid/GridKeyboardDelegate.d.ts +8 -4
- package/dist/types/src/grid/useGrid.d.ts +12 -4
- package/dist/types/src/grid/useGridCell.d.ts +11 -3
- package/dist/types/src/grid/useGridRow.d.ts +7 -2
- package/dist/types/src/grid/useGridSelectionAnnouncement.d.ts +3 -1
- package/dist/types/src/grid/useGridSelectionCheckbox.d.ts +1 -0
- package/dist/types/src/grid/useHighlightSelectionDescription.d.ts +1 -0
- package/dist/types/src/gridlist/useGridList.d.ts +20 -5
- package/dist/types/src/gridlist/useGridListItem.d.ts +5 -1
- package/dist/types/src/gridlist/useGridListSection.d.ts +1 -0
- package/dist/types/src/gridlist/useGridListSelectionCheckbox.d.ts +1 -0
- package/dist/types/src/i18n/useCollator.d.ts +3 -2
- package/dist/types/src/i18n/useDateFormatter.d.ts +3 -2
- package/dist/types/src/i18n/useFilter.d.ts +3 -2
- package/dist/types/src/i18n/useListFormatter.d.ts +3 -2
- package/dist/types/src/i18n/useLocalizedStringFormatter.d.ts +3 -1
- package/dist/types/src/i18n/useNumberFormatter.d.ts +3 -2
- package/dist/types/src/i18n/utils.d.ts +2 -1
- package/dist/types/src/interactions/createEventHandler.d.ts +2 -1
- package/dist/types/src/interactions/useFocusVisible.d.ts +11 -9
- package/dist/types/src/interactions/useLongPress.d.ts +3 -2
- package/dist/types/src/interactions/utils.d.ts +4 -3
- package/dist/types/src/label/useField.d.ts +3 -2
- package/dist/types/src/label/useLabel.d.ts +2 -0
- package/dist/types/src/landmark/useLandmark.d.ts +4 -1
- package/dist/types/src/link/useLink.d.ts +1 -0
- package/dist/types/src/listbox/useListBox.d.ts +8 -3
- package/dist/types/src/listbox/useListBoxSection.d.ts +1 -0
- package/dist/types/src/listbox/useOption.d.ts +7 -0
- package/dist/types/src/menu/useMenu.d.ts +3 -1
- package/dist/types/src/menu/useMenuItem.d.ts +10 -1
- package/dist/types/src/menu/useMenuSection.d.ts +1 -0
- package/dist/types/src/menu/useMenuTrigger.d.ts +1 -0
- package/dist/types/src/menu/useSafelyMouseToSubmenu.d.ts +3 -2
- package/dist/types/src/menu/useSubmenuTrigger.d.ts +7 -2
- package/dist/types/src/menu/utils.d.ts +1 -1
- package/dist/types/src/numberfield/useNumberField.d.ts +11 -4
- package/dist/types/src/overlays/Overlay.d.ts +1 -0
- package/dist/types/src/overlays/PortalProvider.d.ts +4 -1
- package/dist/types/src/overlays/ariaHideOutside.d.ts +1 -0
- package/dist/types/src/overlays/calculatePosition.d.ts +3 -1
- package/dist/types/src/overlays/useModal.d.ts +8 -7
- package/dist/types/src/overlays/useModalOverlay.d.ts +2 -0
- package/dist/types/src/overlays/useOverlay.d.ts +2 -0
- package/dist/types/src/overlays/useOverlayPosition.d.ts +18 -0
- package/dist/types/src/progress/useProgressBar.d.ts +5 -1
- package/dist/types/src/radio/useRadio.d.ts +4 -1
- package/dist/types/src/radio/useRadioGroup.d.ts +1 -0
- package/dist/types/src/searchfield/useSearchField.d.ts +7 -2
- package/dist/types/src/select/HiddenSelect.d.ts +2 -1
- package/dist/types/src/select/useSelect.d.ts +3 -1
- package/dist/types/src/selection/ListKeyboardDelegate.d.ts +19 -6
- package/dist/types/src/selection/useSelectableCollection.d.ts +17 -2
- package/dist/types/src/selection/useSelectableItem.d.ts +9 -7
- package/dist/types/src/selection/useSelectableList.d.ts +5 -2
- package/dist/types/src/separator/useSeparator.d.ts +1 -0
- package/dist/types/src/slider/useSlider.d.ts +5 -4
- package/dist/types/src/slider/useSliderThumb.d.ts +3 -1
- package/dist/types/src/switch/useSwitch.d.ts +14 -27
- package/dist/types/src/table/TableKeyboardDelegate.d.ts +6 -2
- package/dist/types/src/table/useTable.d.ts +8 -4
- package/dist/types/src/table/useTableCell.d.ts +7 -2
- package/dist/types/src/table/useTableColumnHeader.d.ts +9 -2
- package/dist/types/src/table/useTableColumnResize.d.ts +12 -6
- package/dist/types/src/table/useTableHeaderRow.d.ts +1 -0
- package/dist/types/src/table/useTableRow.d.ts +1 -0
- package/dist/types/src/table/useTableSelectionCheckbox.d.ts +2 -0
- package/dist/types/src/tabs/useTabList.d.ts +2 -0
- package/dist/types/src/tabs/useTabPanel.d.ts +2 -2
- package/dist/types/src/tag/useTag.d.ts +1 -0
- package/dist/types/src/tag/useTagGroup.d.ts +7 -3
- package/dist/types/src/textfield/useTextField.d.ts +26 -11
- package/dist/types/src/toast/useToast.d.ts +2 -2
- package/dist/types/src/toast/useToastRegion.d.ts +5 -3
- package/dist/types/src/toggle/useToggle.d.ts +8 -3
- package/dist/types/src/toolbar/useToolbar.d.ts +2 -0
- package/dist/types/src/tree/useTree.d.ts +5 -3
- package/dist/types/src/tree/useTreeItem.d.ts +5 -1
- package/dist/types/src/utils/filterDOMProps.d.ts +1 -0
- package/dist/types/src/utils/getNonce.d.ts +3 -2
- package/dist/types/src/utils/isElementVisible.d.ts +1 -0
- package/dist/types/src/utils/mergeProps.d.ts +3 -2
- package/dist/types/src/utils/scrollIntoView.d.ts +5 -3
- package/dist/types/src/utils/shadowdom/DOMFunctions.d.ts +1 -0
- package/dist/types/src/utils/useId.d.ts +2 -0
- package/dist/types/src/utils/useLabels.d.ts +1 -0
- package/dist/types/src/utils/useLoadMore.d.ts +6 -4
- package/dist/types/src/utils/useLoadMoreSentinel.d.ts +5 -3
- package/dist/types/src/utils/useSlot.d.ts +8 -0
- package/dist/types/src/visually-hidden/VisuallyHidden.d.ts +1 -0
- package/package.json +10 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BD,MAAM,8CAAU,CAAA,GAAA,sCAAI,EAAE,aAAa,CAAsB;AAUlD,SAAS,yCAAc,KAAyB;IACrD,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,IAAI,SAAS,CAAA,GAAA,uBAAS,EAAE;IACxB,IAAI,CAAC,YAAY,cAAc,GAAG,CAAA,GAAA,qBAAO,EAAE;IAC3C,IAAI,UAAU,CAAA,GAAA,oBAAM,EAClB,IAAO,CAAA;oBACL;wBACA;YACA;gBACE,cAAc,CAAA,QAAS,QAAQ;gBAC/B,IAAI,QACF,OAAO,QAAQ;YAEnB;YACA;gBACE,cAAc,CAAA,QAAS,QAAQ;gBAC/B,IAAI,QACF,OAAO,WAAW;YAEtB;QACF,CAAA,GACA;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AQ,MAAM,CAAC,QAAQ;QACvB,OAAO;YACL,IAAI,WAAW,QAAQ,MAAM,EAC3B,QAAQ,MAAM,CAAC,WAAW;QAE9B;IACF,GAAG;QAAC;QAAS,QAAQ,MAAM;QAAE,SAAS;KAAW;IAEjD,OAAO;QACL,YAAY;YACV,gBAAgB,CAAC,SAAS;QAC5B;IACF;AACF","sources":["packages/react-aria/src/overlays/useModal.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport React, {\n AriaAttributes,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '../ssr/SSRProvider';\nimport {useUNSAFE_PortalContext} from './PortalProvider';\n\nexport interface ModalProviderProps extends DOMAttributes {\n children: ReactNode;\n}\n\ninterface ModalContext {\n parent: ModalContext | null;\n modalCount: number;\n addModal: () => void;\n removeModal: () => void;\n}\n\nconst Context = React.createContext<ModalContext | null>(null);\n\n/**\n * Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals trigger\n * `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it. This is\n * done recursively so that all parent providers are incremented and decremented. If the modal count\n * is greater than zero, we add `aria-hidden` to this provider to hide its subtree from screen\n * readers. This is done using React context in order to account for things like portals, which can\n * cause the React tree and the DOM tree to differ significantly in structure.\n */\nexport function ModalProvider(props: ModalProviderProps): JSX.Element {\n let {children} = props;\n let parent = useContext(Context);\n let [modalCount, setModalCount] = useState(0);\n let context = useMemo(\n () => ({\n parent,\n modalCount,\n addModal() {\n setModalCount(count => count + 1);\n if (parent) {\n parent.addModal();\n }\n },\n removeModal() {\n setModalCount(count => count - 1);\n if (parent) {\n parent.removeModal();\n }\n }\n }),\n [parent, modalCount]\n );\n\n return <Context.Provider value={context}>{children}</Context.Provider>;\n}\n\nexport interface ModalProviderAria {\n /**\n * Props to be spread on the container element.\n */\n modalProviderProps: AriaAttributes;\n}\n\n/**\n * Used to determine if the tree should be aria-hidden based on how many\n * modals are open.\n */\nexport function useModalProvider(): ModalProviderAria {\n let context = useContext(Context);\n return {\n modalProviderProps: {\n 'aria-hidden': context && context.modalCount > 0 ? true : undefined\n }\n };\n}\n\n/**\n * Creates a root node that will be aria-hidden if there are other modals open.\n */\nfunction OverlayContainerDOM(props: ModalProviderProps) {\n let {modalProviderProps} = useModalProvider();\n return <div data-overlay-container {...props} {...modalProviderProps} />;\n}\n\n/**\n * An OverlayProvider acts as a container for the top-level application.\n * Any application that uses modal dialogs or other overlays should\n * be wrapped in a `<OverlayProvider>`. This is used to ensure that\n * the main content of the application is hidden from screen readers\n * if a modal or other overlay is opened. Only the top-most modal or\n * overlay should be accessible at once.\n */\nexport function OverlayProvider(props: ModalProviderProps): JSX.Element {\n return (\n <ModalProvider>\n <OverlayContainerDOM {...props} />\n </ModalProvider>\n );\n}\n\nexport interface OverlayContainerProps extends ModalProviderProps {\n /**\n * The container element in which the overlay portal will be placed.\n *\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n * @default document.body\n */\n portalContainer?: Element;\n}\n\n/**\n * A container for overlays like modals and popovers. Renders the overlay\n * into a Portal which is placed at the end of the document body.\n * Also ensures that the overlay is hidden from screen readers if a\n * nested modal is opened. Only the top-most modal or overlay should\n * be accessible at once.\n */\nexport function OverlayContainer(props: OverlayContainerProps): React.ReactPortal | null {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, ...rest} = props;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n React.useEffect(() => {\n if (portalContainer?.closest('[data-overlay-container]')) {\n throw new Error(\n 'An OverlayContainer must not be inside another container. Please change the portalContainer prop.'\n );\n }\n }, [portalContainer]);\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = <OverlayProvider {...rest} />;\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\ninterface ModalAriaProps extends DOMAttributes {\n /** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */\n 'data-ismodal': boolean;\n}\n\nexport interface AriaModalOptions {\n isDisabled?: boolean;\n}\n\nexport interface ModalAria {\n /** Props for the modal content element. */\n modalProps: ModalAriaProps;\n}\n\n/**\n * Hides content outside the current `<OverlayContainer>` from screen readers\n * on mount and restores it on unmount. Typically used by modal dialogs and\n * other types of overlays to ensure that only the top-most modal is\n * accessible at once.\n */\nexport function useModal(options?: AriaModalOptions): ModalAria {\n // Add aria-hidden to all parent providers on mount, and restore on unmount.\n let context = useContext(Context);\n if (!context) {\n throw new Error('Modal is not contained within a provider');\n }\n\n useEffect(() => {\n if (options?.isDisabled || !context || !context.parent) {\n return;\n }\n\n // The immediate context is from the provider containing this modal, so we only\n // want to trigger aria-hidden on its parents not on the modal provider itself.\n context.parent.addModal();\n return () => {\n if (context && context.parent) {\n context.parent.removeModal();\n }\n };\n }, [context, context.parent, options?.isDisabled]);\n\n return {\n modalProps: {\n 'data-ismodal': !options?.isDisabled\n }\n };\n}\n"],"names":[],"version":3,"file":"useModal.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;
|
|
1
|
+
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AA2BD,MAAM,8CAAU,CAAA,GAAA,YAAI,EAAE,aAAa,CAAsB;AAUlD,SAAS,yCAAc,KAAyB;IACrD,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,IAAI,SAAS,CAAA,GAAA,iBAAS,EAAE;IACxB,I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GAAA,eAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAsBO,SAAS,0CAAS,OAA0B;IACjD,4EAA4E;IAC5E,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE;IACzB,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,CAAA,oBAAA,8BAAA,QAAS,UAAU,KAAI,CAAC,WAAW,CAAC,QAAQ,MAAM,EACpD;QAGF,+EAA+E;QAC/E,+EAA+E;QAC/E,QAAQ,MAAM,CAAC,QAAQ;QACvB,OAAO;YACL,IAAI,WAAW,QAAQ,MAAM,EAC3B,QAAQ,MAAM,CAAC,WAAW;QAE9B;IACF,GAAG;QAAC;QAAS,QAAQ,MAAM;QAAE,oBAAA,8BAAA,QAAS,UAAU;KAAC;IAEjD,OAAO;QACL,YAAY;YACV,gBAAgB,EAAC,oBAAA,8BAAA,QAAS,UAAU;QACtC;IACF;AACF","sources":["packages/react-aria/src/overlays/useModal.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport React, {\n AriaAttributes,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '../ssr/SSRProvider';\nimport {useUNSAFE_PortalContext} from './PortalProvider';\n\nexport interface ModalProviderProps extends DOMAttributes {\n children: ReactNode;\n}\n\ninterface ModalContext {\n parent: ModalContext | null;\n modalCount: number;\n addModal: () => void;\n removeModal: () => void;\n}\n\nconst Context = React.createContext<ModalContext | null>(null);\n\n/**\n * Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals trigger\n * `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it. This is\n * done recursively so that all parent providers are incremented and decremented. If the modal count\n * is greater than zero, we add `aria-hidden` to this provider to hide its subtree from screen\n * readers. This is done using React context in order to account for things like portals, which can\n * cause the React tree and the DOM tree to differ significantly in structure.\n */\nexport function ModalProvider(props: ModalProviderProps): JSX.Element {\n let {children} = props;\n let parent = useContext(Context);\n let [modalCount, setModalCount] = useState(0);\n let context = useMemo(\n () => ({\n parent,\n modalCount,\n addModal() {\n setModalCount(count => count + 1);\n if (parent) {\n parent.addModal();\n }\n },\n removeModal() {\n setModalCount(count => count - 1);\n if (parent) {\n parent.removeModal();\n }\n }\n }),\n [parent, modalCount]\n );\n\n return <Context.Provider value={context}>{children}</Context.Provider>;\n}\n\nexport interface ModalProviderAria {\n /**\n * Props to be spread on the container element.\n */\n modalProviderProps: AriaAttributes;\n}\n\n/**\n * Used to determine if the tree should be aria-hidden based on how many\n * modals are open.\n */\nexport function useModalProvider(): ModalProviderAria {\n let context = useContext(Context);\n return {\n modalProviderProps: {\n 'aria-hidden': context && context.modalCount > 0 ? true : undefined\n }\n };\n}\n\n/**\n * Creates a root node that will be aria-hidden if there are other modals open.\n */\nfunction OverlayContainerDOM(props: ModalProviderProps) {\n let {modalProviderProps} = useModalProvider();\n return <div data-overlay-container {...props} {...modalProviderProps} />;\n}\n\n/**\n * An OverlayProvider acts as a container for the top-level application.\n * Any application that uses modal dialogs or other overlays should\n * be wrapped in a `<OverlayProvider>`. This is used to ensure that\n * the main content of the application is hidden from screen readers\n * if a modal or other overlay is opened. Only the top-most modal or\n * overlay should be accessible at once.\n */\nexport function OverlayProvider(props: ModalProviderProps): JSX.Element {\n return (\n <ModalProvider>\n <OverlayContainerDOM {...props} />\n </ModalProvider>\n );\n}\n\nexport interface OverlayContainerProps extends ModalProviderProps {\n /**\n * The container element in which the overlay portal will be placed.\n *\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n * @default document.body\n */\n portalContainer?: Element;\n}\n\n/**\n * A container for overlays like modals and popovers. Renders the overlay\n * into a Portal which is placed at the end of the document body.\n * Also ensures that the overlay is hidden from screen readers if a\n * nested modal is opened. Only the top-most modal or overlay should\n * be accessible at once.\n */\nexport function OverlayContainer(props: OverlayContainerProps): React.ReactPortal | null {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, ...rest} = props;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n React.useEffect(() => {\n if (portalContainer?.closest('[data-overlay-container]')) {\n throw new Error(\n 'An OverlayContainer must not be inside another container. Please change the portalContainer prop.'\n );\n }\n }, [portalContainer]);\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = <OverlayProvider {...rest} />;\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\ninterface ModalAriaProps extends DOMAttributes {\n /** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */\n 'data-ismodal': boolean;\n}\n\nexport interface AriaModalOptions {\n isDisabled?: boolean;\n}\n\nexport interface ModalAria {\n /** Props for the modal content element. */\n modalProps: ModalAriaProps;\n}\n\n/**\n * Hides content outside the current `<OverlayContainer>` from screen readers\n * on mount and restores it on unmount. Typically used by modal dialogs and\n * other types of overlays to ensure that only the top-most modal is\n * accessible at once.\n */\nexport function useModal(options?: AriaModalOptions): ModalAria {\n // Add aria-hidden to all parent providers on mount, and restore on unmount.\n let context = useContext(Context);\n if (!context) {\n throw new Error('Modal is not contained within a provider');\n }\n\n useEffect(() => {\n if (options?.isDisabled || !context || !context.parent) {\n return;\n }\n\n // The immediate context is from the provider containing this modal, so we only\n // want to trigger aria-hidden on its parents not on the modal provider itself.\n context.parent.addModal();\n return () => {\n if (context && context.parent) {\n context.parent.removeModal();\n }\n };\n }, [context, context.parent, options?.isDisabled]);\n\n return {\n modalProps: {\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,IAAI,EAAE,GAAG,MAAK,GAAG;IAChE,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAsB;IAC3C,IAAI,CAAC,MAAM,eAAe,IAAI,cAC5B,kBAAkB;IAGpB,CAAA,GAAA,YAAI,EAAE,SAAS,CAAC;QACd,IAAI,iBAAiB,QAAQ,6BAC3B,MAAM,IAAI,MACR;IAGN,GAAG;QAAC;KAAgB;IAEpB,IAAI,CAAC,iBACH,OAAO;IAGT,IAAI,yBAAW,gCAAC,2CAAoB;IACpC,qBAAO,CAAA,GAAA,eAAO,EAAE,YAAY,CAAC,UAAU;AACzC;AAsBO,SAAS,0CAAS,OAA0B;IACjD,4EAA4E;IAC5E,IAAI,UAAU,CAAA,GAAA,iBAAS,EAAE;IACzB,IAAI,CAAC,SACH,MAAM,IAAI,MAAM;IAGlB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,SAAS,cAAc,CAAC,WAAW,CAAC,QAAQ,MAAM,EACpD;QAGF,+EAA+E;QAC/E,+EAA+E;QAC/E,QAAQ,MAAM,CAAC,QAAQ;QACvB,OAAO;YACL,IAAI,WAAW,QAAQ,MAAM,EAC3B,QAAQ,MAAM,CAAC,WAAW;QAE9B;IACF,GAAG;QAAC;QAAS,QAAQ,MAAM;QAAE,SAAS;KAAW;IAEjD,OAAO;QACL,YAAY;YACV,gBAAgB,CAAC,SAAS;QAC5B;IACF;AACF","sources":["packages/react-aria/src/overlays/useModal.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport React, {\n AriaAttributes,\n JSX,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport {useIsSSR} from '../ssr/SSRProvider';\nimport {useUNSAFE_PortalContext} from './PortalProvider';\n\nexport interface ModalProviderProps extends DOMAttributes {\n children: ReactNode;\n}\n\ninterface ModalContext {\n parent: ModalContext | null;\n modalCount: number;\n addModal: () => void;\n removeModal: () => void;\n}\n\nconst Context = React.createContext<ModalContext | null>(null);\n\n/**\n * Each ModalProvider tracks how many modals are open in its subtree. On mount, the modals trigger\n * `addModal` to increment the count, and trigger `removeModal` on unmount to decrement it. This is\n * done recursively so that all parent providers are incremented and decremented. If the modal count\n * is greater than zero, we add `aria-hidden` to this provider to hide its subtree from screen\n * readers. This is done using React context in order to account for things like portals, which can\n * cause the React tree and the DOM tree to differ significantly in structure.\n */\nexport function ModalProvider(props: ModalProviderProps): JSX.Element {\n let {children} = props;\n let parent = useContext(Context);\n let [modalCount, setModalCount] = useState(0);\n let context = useMemo(\n () => ({\n parent,\n modalCount,\n addModal() {\n setModalCount(count => count + 1);\n if (parent) {\n parent.addModal();\n }\n },\n removeModal() {\n setModalCount(count => count - 1);\n if (parent) {\n parent.removeModal();\n }\n }\n }),\n [parent, modalCount]\n );\n\n return <Context.Provider value={context}>{children}</Context.Provider>;\n}\n\nexport interface ModalProviderAria {\n /**\n * Props to be spread on the container element.\n */\n modalProviderProps: AriaAttributes;\n}\n\n/**\n * Used to determine if the tree should be aria-hidden based on how many\n * modals are open.\n */\nexport function useModalProvider(): ModalProviderAria {\n let context = useContext(Context);\n return {\n modalProviderProps: {\n 'aria-hidden': context && context.modalCount > 0 ? true : undefined\n }\n };\n}\n\n/**\n * Creates a root node that will be aria-hidden if there are other modals open.\n */\nfunction OverlayContainerDOM(props: ModalProviderProps) {\n let {modalProviderProps} = useModalProvider();\n return <div data-overlay-container {...props} {...modalProviderProps} />;\n}\n\n/**\n * An OverlayProvider acts as a container for the top-level application.\n * Any application that uses modal dialogs or other overlays should\n * be wrapped in a `<OverlayProvider>`. This is used to ensure that\n * the main content of the application is hidden from screen readers\n * if a modal or other overlay is opened. Only the top-most modal or\n * overlay should be accessible at once.\n */\nexport function OverlayProvider(props: ModalProviderProps): JSX.Element {\n return (\n <ModalProvider>\n <OverlayContainerDOM {...props} />\n </ModalProvider>\n );\n}\n\nexport interface OverlayContainerProps extends ModalProviderProps {\n /**\n * The container element in which the overlay portal will be placed.\n *\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n * @default document.body\n */\n portalContainer?: Element;\n}\n\n/**\n * A container for overlays like modals and popovers. Renders the overlay\n * into a Portal which is placed at the end of the document body.\n * Also ensures that the overlay is hidden from screen readers if a\n * nested modal is opened. Only the top-most modal or overlay should\n * be accessible at once.\n */\nexport function OverlayContainer(props: OverlayContainerProps): React.ReactPortal | null {\n let isSSR = useIsSSR();\n let {portalContainer = isSSR ? null : document.body, ...rest} = props;\n let {getContainer} = useUNSAFE_PortalContext();\n if (!props.portalContainer && getContainer) {\n portalContainer = getContainer();\n }\n\n React.useEffect(() => {\n if (portalContainer?.closest('[data-overlay-container]')) {\n throw new Error(\n 'An OverlayContainer must not be inside another container. Please change the portalContainer prop.'\n );\n }\n }, [portalContainer]);\n\n if (!portalContainer) {\n return null;\n }\n\n let contents = <OverlayProvider {...rest} />;\n return ReactDOM.createPortal(contents, portalContainer);\n}\n\ninterface ModalAriaProps extends DOMAttributes {\n /** Data attribute marks the dom node as a modal for the aria-modal-polyfill. */\n 'data-ismodal': boolean;\n}\n\nexport interface AriaModalOptions {\n isDisabled?: boolean;\n}\n\nexport interface ModalAria {\n /** Props for the modal content element. */\n modalProps: ModalAriaProps;\n}\n\n/**\n * Hides content outside the current `<OverlayContainer>` from screen readers\n * on mount and restores it on unmount. Typically used by modal dialogs and\n * other types of overlays to ensure that only the top-most modal is\n * accessible at once.\n */\nexport function useModal(options?: AriaModalOptions): ModalAria {\n // Add aria-hidden to all parent providers on mount, and restore on unmount.\n let context = useContext(Context);\n if (!context) {\n throw new Error('Modal is not contained within a provider');\n }\n\n useEffect(() => {\n if (options?.isDisabled || !context || !context.parent) {\n return;\n }\n\n // The immediate context is from the provider containing this modal, so we only\n // want to trigger aria-hidden on its parents not on the modal provider itself.\n context.parent.addModal();\n return () => {\n if (context && context.parent) {\n context.parent.removeModal();\n }\n };\n }, [context, context.parent, options?.isDisabled]);\n\n return {\n modalProps: {\n 'data-ismodal': !options?.isDisabled\n }\n };\n}\n"],"names":[],"version":3,"file":"useModal.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAwCM,SAAS,0CACd,KAA4B,EAC5B,KAA0B,EAC1B,GAAkC;IAElC,IAAI,gBAAC,YAAY,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,oCAAS,EAC3C;QACE,GAAG,KAAK;QACR,QAAQ,MAAM,MAAM;QACpB,SAAS,MAAM,KAAK;IACtB,GACA;IAGF,CAAA,GAAA,0CAAe,EAAE;QACf,YAAY,CAAC,MAAM,MAAM;IAC3B;IAEA,CAAA,GAAA,gDAAqB;IAErB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,MAAM,MAAM,IAAI,IAAI,OAAO,EAC7B,OAAO,CAAA,GAAA,yCAAc,EAAE;YAAC,IAAI,OAAO;SAAC,EAAE;YAAC,gBAAgB;QAAI;IAE/D,GAAG;QAAC,MAAM,MAAM;QAAE;KAAI;IAEtB,OAAO;QACL,YAAY,CAAA,GAAA,oCAAS,EAAE;uBACvB;IACF;AACF","sources":["packages/react-aria/src/overlays/useModalOverlay.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ariaHideOutside} from './ariaHideOutside';\nimport {AriaOverlayProps, useOverlay} from './useOverlay';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {mergeProps} from '../utils/mergeProps';\nimport {OverlayTriggerState} from 'react-stately/useOverlayTriggerState';\nimport {useEffect} from 'react';\nimport {useOverlayFocusContain} from './Overlay';\nimport {usePreventScroll} from './usePreventScroll';\n\nexport interface AriaModalOverlayProps extends Pick<\n AriaOverlayProps,\n 'shouldCloseOnInteractOutside'\n> {\n /**\n * Whether to close the modal when the user interacts outside it.\n *\n * @default false\n */\n isDismissable?: boolean;\n /**\n * Whether pressing the escape key to close the modal should be disabled.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean;\n}\n\nexport interface ModalOverlayAria {\n /** Props for the modal element. */\n modalProps: DOMAttributes;\n /** Props for the underlay element. */\n underlayProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a modal component.\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport function useModalOverlay(\n props: AriaModalOverlayProps,\n state: OverlayTriggerState,\n ref: RefObject<HTMLElement | null>\n): ModalOverlayAria {\n let {overlayProps, underlayProps} = useOverlay(\n {\n ...props,\n isOpen: state.isOpen,\n onClose: state.close\n },\n ref\n );\n\n usePreventScroll({\n isDisabled: !state.isOpen\n });\n\n useOverlayFocusContain();\n\n useEffect(() => {\n if (state.isOpen && ref.current) {\n return ariaHideOutside([ref.current], {shouldUseInert: true});\n }\n }, [state.isOpen, ref]);\n\n return {\n modalProps: mergeProps(overlayProps),\n underlayProps\n };\n}\n"],"names":[],"version":3,"file":"useModalOverlay.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAwCM,SAAS,0CACd,KAA4B,EAC5B,KAA0B,EAC1B,GAAkC;IAElC,IAAI,gBAAC,YAAY,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,yCAAS,EAC3C;QACE,GAAG,KAAK;QACR,QAAQ,MAAM,MAAM;QACpB,SAAS,MAAM,KAAK;IACtB,GACA;IAGF,CAAA,GAAA,yCAAe,EAAE;QACf,YAAY,CAAC,MAAM,MAAM;IAC3B;IAEA,CAAA,GAAA,yCAAqB;IAErB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,MAAM,IAAI,IAAI,OAAO,EAC7B,OAAO,CAAA,GAAA,yCAAc,EAAE;YAAC,IAAI,OAAO;SAAC,EAAE;YAAC,gBAAgB;QAAI;IAE/D,GAAG;QAAC,MAAM,MAAM;QAAE;KAAI;IAEtB,OAAO;QACL,YAAY,CAAA,GAAA,yCAAS,EAAE;uBACvB;IACF;AACF","sources":["packages/react-aria/src/overlays/useModalOverlay.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ariaHideOutside} from './ariaHideOutside';\nimport {AriaOverlayProps, useOverlay} from './useOverlay';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {mergeProps} from '../utils/mergeProps';\nimport {OverlayTriggerState} from 'react-stately/useOverlayTriggerState';\nimport {useEffect} from 'react';\nimport {useOverlayFocusContain} from './Overlay';\nimport {usePreventScroll} from './usePreventScroll';\n\nexport interface AriaModalOverlayProps extends Pick<\n AriaOverlayProps,\n 'shouldCloseOnInteractOutside'\n> {\n /**\n * Whether to close the modal when the user interacts outside it.\n *\n * @default false\n */\n isDismissable?: boolean;\n /**\n * Whether pressing the escape key to close the modal should be disabled.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean;\n}\n\nexport interface ModalOverlayAria {\n /** Props for the modal element. */\n modalProps: DOMAttributes;\n /** Props for the underlay element. */\n underlayProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a modal component.\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport function useModalOverlay(\n props: AriaModalOverlayProps,\n state: OverlayTriggerState,\n ref: RefObject<HTMLElement | null>\n): ModalOverlayAria {\n let {overlayProps, underlayProps} = useOverlay(\n {\n ...props,\n isOpen: state.isOpen,\n onClose: state.close\n },\n ref\n );\n\n usePreventScroll({\n isDisabled: !state.isOpen\n });\n\n useOverlayFocusContain();\n\n useEffect(() => {\n if (state.isOpen && ref.current) {\n return ariaHideOutside([ref.current], {shouldUseInert: true});\n }\n }, [state.isOpen, ref]);\n\n return {\n modalProps: mergeProps(overlayProps),\n underlayProps\n };\n}\n"],"names":[],"version":3,"file":"useModalOverlay.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AAwCM,SAAS,0CACd,KAA4B,EAC5B,KAA0B,EAC1B,GAAkC;IAElC,IAAI,gBAAC,YAAY,iBAAE,aAAa,EAAC,GAAG,CAAA,GAAA,yCAAS,EAC3C;QACE,GAAG,KAAK;QACR,QAAQ,MAAM,MAAM;QACpB,SAAS,MAAM,KAAK;IACtB,GACA;IAGF,CAAA,GAAA,yCAAe,EAAE;QACf,YAAY,CAAC,MAAM,MAAM;IAC3B;IAEA,CAAA,GAAA,yCAAqB;IAErB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,MAAM,MAAM,IAAI,IAAI,OAAO,EAC7B,OAAO,CAAA,GAAA,yCAAc,EAAE;YAAC,IAAI,OAAO;SAAC,EAAE;YAAC,gBAAgB;QAAI;IAE/D,GAAG;QAAC,MAAM,MAAM;QAAE;KAAI;IAEtB,OAAO;QACL,YAAY,CAAA,GAAA,yCAAS,EAAE;uBACvB;IACF;AACF","sources":["packages/react-aria/src/overlays/useModalOverlay.ts"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ariaHideOutside} from './ariaHideOutside';\nimport {AriaOverlayProps, useOverlay} from './useOverlay';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {mergeProps} from '../utils/mergeProps';\nimport {OverlayTriggerState} from 'react-stately/useOverlayTriggerState';\nimport {useEffect} from 'react';\nimport {useOverlayFocusContain} from './Overlay';\nimport {usePreventScroll} from './usePreventScroll';\n\nexport interface AriaModalOverlayProps extends Pick<\n AriaOverlayProps,\n 'shouldCloseOnInteractOutside'\n> {\n /**\n * Whether to close the modal when the user interacts outside it.\n *\n * @default false\n */\n isDismissable?: boolean;\n /**\n * Whether pressing the escape key to close the modal should be disabled.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean;\n}\n\nexport interface ModalOverlayAria {\n /** Props for the modal element. */\n modalProps: DOMAttributes;\n /** Props for the underlay element. */\n underlayProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a modal component.\n * A modal is an overlay element which blocks interaction with elements outside it.\n */\nexport function useModalOverlay(\n props: AriaModalOverlayProps,\n state: OverlayTriggerState,\n ref: RefObject<HTMLElement | null>\n): ModalOverlayAria {\n let {overlayProps, underlayProps} = useOverlay(\n {\n ...props,\n isOpen: state.isOpen,\n onClose: state.close\n },\n ref\n );\n\n usePreventScroll({\n isDisabled: !state.isOpen\n });\n\n useOverlayFocusContain();\n\n useEffect(() => {\n if (state.isOpen && ref.current) {\n return ariaHideOutside([ref.current], {shouldUseInert: true});\n }\n }, [state.isOpen, ref]);\n\n return {\n modalProps: mergeProps(overlayProps),\n underlayProps\n };\n}\n"],"names":[],"version":3,"file":"useModalOverlay.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiDD,MAAM,wCAA+C,EAAE;AAOhD,SAAS,0CAAW,KAAuB,EAAE,GAA8B;IAChF,IAAI,WACF,OAAO,qBACP,iBAAiB,UACjB,MAAM,iBACN,gBAAgB,kCAChB,4BAA4B,qCAC5B,4BAA4B,EAC7B,GAAG;IAEJ,IAAI,qBAAqB,CAAA,GAAA,mBAAK,EAA6B;IAE3D,wFAAwF;IACxF,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,UAAU,CAAC,sCAAgB,QAAQ,CAAC,MAAM;YAC5C,sCAAgB,IAAI,CAAC;YACrB,OAAO;gBACL,IAAI,QAAQ,sCAAgB,OAAO,CAAC;gBACpC,IAAI,SAAS,GACX,sCAAgB,MAAM,CAAC,OAAO;YAElC;QACF;IACF,GAAG;QAAC;QAAQ;KAAI;IAEhB,4EAA4E;IAC5E,IAAI,SAAS;QACX,IAAI,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE,KAAK,OAAO,SACzD;IAEJ;IAEA,IAAI,yBAAyB,CAAC;QAC5B,MAAM,iBAAiB,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE;QAClE,mBAAmB,OAAO,GAAG;QAC7B,IACE,CAAC,gCACD,6BAA6B,CAAA,GAAA,wCAAa,EAAE,KAE5C;YAAA,IAAI,mBAAmB,KACrB,EAAE,eAAe;QACnB;IAEJ;IAEA,IAAI,oBAAoB,CAAC;QACvB,IACE,CAAC,gCACD,6BAA6B,CAAA,GAAA,wCAAa,EAAE,KAC5C;YACA,IAAI,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE,KAAK,KAClD,EAAE,eAAe;YAEnB,IAAI,mBAAmB,OAAO,KAAK,KACjC;QAEJ;QACA,mBAAmB,OAAO,GAAG;IAC/B;IAEA,wBAAwB;IACxB,IAAI,YAAY,CAAA;QACd,IAAI,EAAE,GAAG,KAAK,YAAY,CAAC,6BAA6B,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE;YAClF,EAAE,eAAe;YACjB,EAAE,cAAc;YAChB;QACF;IACF;IAEA,kDAAkD;IAClD,CAAA,GAAA,4CAAiB,EAAE;aACjB;QACA,mBAAmB,iBAAiB,SAAS,oBAAoB;gCACjE;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,wCAAa,EAAE;QACtC,YAAY,CAAC;QACb,cAAc,CAAA;YACZ,gFAAgF;YAChF,8GAA8G;YAC9G,6FAA6F;YAC7F,sDAAsD;YACtD,sDAAsD;YACtD,EAAE;YACF,2EAA2E;YAC3E,yEAAyE;YACzE,kEAAkE;YAClE,IAAI,CAAC,EAAE,aAAa,IAAI,CAAA,GAAA,uDAA4B,EAAE,EAAE,aAAa,GACnE;YAGF,IACE,CAAC,gCACD,6BAA6B,EAAE,aAAa,GAE5C;QAEJ;IACF;IAEA,OAAO;QACL,cAAc;uBACZ;YACA,GAAG,gBAAgB;QACrB;QACA,eAAe,CAAC;IAClB;AACF","sources":["packages/react-aria/src/overlays/useOverlay.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {isElementInChildOfActiveScope} from '../focus/FocusScope';\nimport {useEffect, useRef} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useInteractOutside} from '../interactions/useInteractOutside';\n\nexport interface AriaOverlayProps {\n /** Whether the overlay is currently open. */\n isOpen?: boolean;\n\n /** Handler that is called when the overlay should close. */\n onClose?: () => void;\n\n /**\n * Whether to close the overlay when the user interacts outside it.\n *\n * @default false\n */\n isDismissable?: boolean;\n\n /** Whether the overlay should close when focus is lost or moves outside it. */\n shouldCloseOnBlur?: boolean;\n\n /**\n * Whether pressing the escape key to close the overlay should be disabled.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean;\n\n /**\n * When user interacts with the argument element outside of the overlay ref,\n * return true if onClose should be called. This gives you a chance to filter\n * out interaction with elements that should not dismiss the overlay.\n * By default, onClose will always be called on interaction outside the overlay ref.\n */\n shouldCloseOnInteractOutside?: (element: Element) => boolean;\n}\n\nexport interface OverlayAria {\n /** Props to apply to the overlay container element. */\n overlayProps: DOMAttributes;\n /** Props to apply to the underlay element, if any. */\n underlayProps: DOMAttributes;\n}\n\nconst visibleOverlays: RefObject<Element | null>[] = [];\n\n/**\n * Provides the behavior for overlays such as dialogs, popovers, and menus.\n * Hides the overlay when the user interacts outside it, when the Escape key is pressed,\n * or optionally, on blur. Only the top-most overlay will close at once.\n */\nexport function useOverlay(props: AriaOverlayProps, ref: RefObject<Element | null>): OverlayAria {\n let {\n onClose,\n shouldCloseOnBlur,\n isOpen,\n isDismissable = false,\n isKeyboardDismissDisabled = false,\n shouldCloseOnInteractOutside\n } = props;\n\n let lastVisibleOverlay = useRef<RefObject<Element | null>>(undefined);\n\n // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.\n useEffect(() => {\n if (isOpen && !visibleOverlays.includes(ref)) {\n visibleOverlays.push(ref);\n return () => {\n let index = visibleOverlays.indexOf(ref);\n if (index >= 0) {\n visibleOverlays.splice(index, 1);\n }\n };\n }\n }, [isOpen, ref]);\n\n // Only hide the overlay when it is the topmost visible overlay in the stack\n let onHide = () => {\n if (visibleOverlays[visibleOverlays.length - 1] === ref && onClose) {\n onClose();\n }\n };\n\n let onInteractOutsideStart = (e: PointerEvent) => {\n const topMostOverlay = visibleOverlays[visibleOverlays.length - 1];\n lastVisibleOverlay.current = topMostOverlay;\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(getEventTarget(e) as Element)\n ) {\n if (topMostOverlay === ref) {\n e.stopPropagation();\n }\n }\n };\n\n let onInteractOutside = (e: PointerEvent) => {\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(getEventTarget(e) as Element)\n ) {\n if (visibleOverlays[visibleOverlays.length - 1] === ref) {\n e.stopPropagation();\n }\n if (lastVisibleOverlay.current === ref) {\n onHide();\n }\n }\n lastVisibleOverlay.current = undefined;\n };\n\n // Handle the escape key\n let onKeyDown = e => {\n if (e.key === 'Escape' && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {\n e.stopPropagation();\n e.preventDefault();\n onHide();\n }\n };\n\n // Handle clicking outside the overlay to close it\n useInteractOutside({\n ref,\n onInteractOutside: isDismissable && isOpen ? onInteractOutside : undefined,\n onInteractOutsideStart\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !shouldCloseOnBlur,\n onBlurWithin: e => {\n // Do not close if relatedTarget is null, which means focus is lost to the body.\n // That can happen when switching tabs, or due to a VoiceOver/Chrome bug with Control+Option+Arrow navigation.\n // Clicking on the body to close the overlay should already be handled by useInteractOutside.\n // https://github.com/adobe/react-spectrum/issues/4130\n // https://github.com/adobe/react-spectrum/issues/4922\n //\n // If focus is moving into a child focus scope (e.g. menu inside a dialog),\n // do not close the outer overlay. At this point, the active scope should\n // still be the outer overlay, since blur events run before focus.\n if (!e.relatedTarget || isElementInChildOfActiveScope(e.relatedTarget)) {\n return;\n }\n\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(e.relatedTarget as Element)\n ) {\n onClose?.();\n }\n }\n });\n\n return {\n overlayProps: {\n onKeyDown,\n ...focusWithinProps\n },\n underlayProps: {}\n };\n}\n"],"names":[],"version":3,"file":"useOverlay.cjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiDD,MAAM,wCAA+C,EAAE;AAOhD,SAAS,0CAAW,KAAuB,EAAE,GAA8B;IAChF,IAAI,WACF,OAAO,qBACP,iBAAiB,UACjB,MAAM,iBACN,gBAAgB,kCAChB,4BAA4B,qCAC5B,4BAA4B,EAC7B,GAAG;IAEJ,IAAI,qBAAqB,CAAA,GAAA,aAAK,EAA6B;IAE3D,wFAAwF;IACxF,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,UAAU,CAAC,sCAAgB,QAAQ,CAAC,MAAM;YAC5C,sCAAgB,IAAI,CAAC;YACrB,OAAO;gBACL,IAAI,QAAQ,sCAAgB,OAAO,CAAC;gBACpC,IAAI,SAAS,GACX,sCAAgB,MAAM,CAAC,OAAO;YAElC;QACF;IACF,GAAG;QAAC;QAAQ;KAAI;IAEhB,4EAA4E;IAC5E,IAAI,SAAS;QACX,IAAI,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE,KAAK,OAAO,SACzD;IAEJ;IAEA,IAAI,yBAAyB,CAAC;QAC5B,MAAM,iBAAiB,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE;QAClE,mBAAmB,OAAO,GAAG;QAC7B,IACE,CAAC,gCACD,6BAA6B,CAAA,GAAA,yCAAa,EAAE,KAE5C;YAAA,IAAI,mBAAmB,KACrB,EAAE,eAAe;QACnB;IAEJ;IAEA,IAAI,oBAAoB,CAAC;QACvB,IACE,CAAC,gCACD,6BAA6B,CAAA,GAAA,yCAAa,EAAE,KAC5C;YACA,IAAI,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE,KAAK,KAClD,EAAE,eAAe;YAEnB,IAAI,mBAAmB,OAAO,KAAK,KACjC;QAEJ;QACA,mBAAmB,OAAO,GAAG;IAC/B;IAEA,wBAAwB;IACxB,IAAI,YAAY,CAAA;QACd,IAAI,EAAE,GAAG,KAAK,YAAY,CAAC,6BAA6B,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE;YAClF,EAAE,eAAe;YACjB,EAAE,cAAc;YAChB;QACF;IACF;IAEA,kDAAkD;IAClD,CAAA,GAAA,yCAAiB,EAAE;aACjB;QACA,mBAAmB,iBAAiB,SAAS,oBAAoB;gCACjE;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE;QACtC,YAAY,CAAC;QACb,cAAc,CAAA;YACZ,gFAAgF;YAChF,8GAA8G;YAC9G,6FAA6F;YAC7F,sDAAsD;YACtD,sDAAsD;YACtD,EAAE;YACF,2EAA2E;YAC3E,yEAAyE;YACzE,kEAAkE;YAClE,IAAI,CAAC,EAAE,aAAa,IAAI,CAAA,GAAA,yCAA4B,EAAE,EAAE,aAAa,GACnE;YAGF,IACE,CAAC,gCACD,6BAA6B,EAAE,aAAa,GAE5C,oBAAA,8BAAA;QAEJ;IACF;IAEA,OAAO;QACL,cAAc;uBACZ;YACA,GAAG,gBAAgB;QACrB;QACA,eAAe,CAAC;IAClB;AACF","sources":["packages/react-aria/src/overlays/useOverlay.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {isElementInChildOfActiveScope} from '../focus/FocusScope';\nimport {useEffect, useRef} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useInteractOutside} from '../interactions/useInteractOutside';\n\nexport interface AriaOverlayProps {\n /** Whether the overlay is currently open. */\n isOpen?: boolean;\n\n /** Handler that is called when the overlay should close. */\n onClose?: () => void;\n\n /**\n * Whether to close the overlay when the user interacts outside it.\n *\n * @default false\n */\n isDismissable?: boolean;\n\n /** Whether the overlay should close when focus is lost or moves outside it. */\n shouldCloseOnBlur?: boolean;\n\n /**\n * Whether pressing the escape key to close the overlay should be disabled.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean;\n\n /**\n * When user interacts with the argument element outside of the overlay ref,\n * return true if onClose should be called. This gives you a chance to filter\n * out interaction with elements that should not dismiss the overlay.\n * By default, onClose will always be called on interaction outside the overlay ref.\n */\n shouldCloseOnInteractOutside?: (element: Element) => boolean;\n}\n\nexport interface OverlayAria {\n /** Props to apply to the overlay container element. */\n overlayProps: DOMAttributes;\n /** Props to apply to the underlay element, if any. */\n underlayProps: DOMAttributes;\n}\n\nconst visibleOverlays: RefObject<Element | null>[] = [];\n\n/**\n * Provides the behavior for overlays such as dialogs, popovers, and menus.\n * Hides the overlay when the user interacts outside it, when the Escape key is pressed,\n * or optionally, on blur. Only the top-most overlay will close at once.\n */\nexport function useOverlay(props: AriaOverlayProps, ref: RefObject<Element | null>): OverlayAria {\n let {\n onClose,\n shouldCloseOnBlur,\n isOpen,\n isDismissable = false,\n isKeyboardDismissDisabled = false,\n shouldCloseOnInteractOutside\n } = props;\n\n let lastVisibleOverlay = useRef<RefObject<Element | null>>(undefined);\n\n // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.\n useEffect(() => {\n if (isOpen && !visibleOverlays.includes(ref)) {\n visibleOverlays.push(ref);\n return () => {\n let index = visibleOverlays.indexOf(ref);\n if (index >= 0) {\n visibleOverlays.splice(index, 1);\n }\n };\n }\n }, [isOpen, ref]);\n\n // Only hide the overlay when it is the topmost visible overlay in the stack\n let onHide = () => {\n if (visibleOverlays[visibleOverlays.length - 1] === ref && onClose) {\n onClose();\n }\n };\n\n let onInteractOutsideStart = (e: PointerEvent) => {\n const topMostOverlay = visibleOverlays[visibleOverlays.length - 1];\n lastVisibleOverlay.current = topMostOverlay;\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(getEventTarget(e) as Element)\n ) {\n if (topMostOverlay === ref) {\n e.stopPropagation();\n }\n }\n };\n\n let onInteractOutside = (e: PointerEvent) => {\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(getEventTarget(e) as Element)\n ) {\n if (visibleOverlays[visibleOverlays.length - 1] === ref) {\n e.stopPropagation();\n }\n if (lastVisibleOverlay.current === ref) {\n onHide();\n }\n }\n lastVisibleOverlay.current = undefined;\n };\n\n // Handle the escape key\n let onKeyDown = e => {\n if (e.key === 'Escape' && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {\n e.stopPropagation();\n e.preventDefault();\n onHide();\n }\n };\n\n // Handle clicking outside the overlay to close it\n useInteractOutside({\n ref,\n onInteractOutside: isDismissable && isOpen ? onInteractOutside : undefined,\n onInteractOutsideStart\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !shouldCloseOnBlur,\n onBlurWithin: e => {\n // Do not close if relatedTarget is null, which means focus is lost to the body.\n // That can happen when switching tabs, or due to a VoiceOver/Chrome bug with Control+Option+Arrow navigation.\n // Clicking on the body to close the overlay should already be handled by useInteractOutside.\n // https://github.com/adobe/react-spectrum/issues/4130\n // https://github.com/adobe/react-spectrum/issues/4922\n //\n // If focus is moving into a child focus scope (e.g. menu inside a dialog),\n // do not close the outer overlay. At this point, the active scope should\n // still be the outer overlay, since blur events run before focus.\n if (!e.relatedTarget || isElementInChildOfActiveScope(e.relatedTarget)) {\n return;\n }\n\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(e.relatedTarget as Element)\n ) {\n onClose?.();\n }\n }\n });\n\n return {\n overlayProps: {\n onKeyDown,\n ...focusWithinProps\n },\n underlayProps: {}\n };\n}\n"],"names":[],"version":3,"file":"useOverlay.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiDD,MAAM,wCAA+C,EAAE;AAOhD,SAAS,0CAAW,KAAuB,EAAE,GAA8B;IAChF,IAAI,WACF,OAAO,qBACP,iBAAiB,UACjB,MAAM,iBACN,gBAAgB,kCAChB,4BAA4B,qCAC5B,4BAA4B,EAC7B,GAAG;IAEJ,IAAI,qBAAqB,CAAA,GAAA,aAAK,EAA6B;IAE3D,wFAAwF;IACxF,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,UAAU,CAAC,sCAAgB,QAAQ,CAAC,MAAM;YAC5C,sCAAgB,IAAI,CAAC;YACrB,OAAO;gBACL,IAAI,QAAQ,sCAAgB,OAAO,CAAC;gBACpC,IAAI,SAAS,GACX,sCAAgB,MAAM,CAAC,OAAO;YAElC;QACF;IACF,GAAG;QAAC;QAAQ;KAAI;IAEhB,4EAA4E;IAC5E,IAAI,SAAS;QACX,IAAI,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE,KAAK,OAAO,SACzD;IAEJ;IAEA,IAAI,yBAAyB,CAAC;QAC5B,MAAM,iBAAiB,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE;QAClE,mBAAmB,OAAO,GAAG;QAC7B,IACE,CAAC,gCACD,6BAA6B,CAAA,GAAA,yCAAa,EAAE,KAE5C;YAAA,IAAI,mBAAmB,KACrB,EAAE,eAAe;QACnB;IAEJ;IAEA,IAAI,oBAAoB,CAAC;QACvB,IACE,CAAC,gCACD,6BAA6B,CAAA,GAAA,yCAAa,EAAE,KAC5C;YACA,IAAI,qCAAe,CAAC,sCAAgB,MAAM,GAAG,EAAE,KAAK,KAClD,EAAE,eAAe;YAEnB,IAAI,mBAAmB,OAAO,KAAK,KACjC;QAEJ;QACA,mBAAmB,OAAO,GAAG;IAC/B;IAEA,wBAAwB;IACxB,IAAI,YAAY,CAAA;QACd,IAAI,EAAE,GAAG,KAAK,YAAY,CAAC,6BAA6B,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE;YAClF,EAAE,eAAe;YACjB,EAAE,cAAc;YAChB;QACF;IACF;IAEA,kDAAkD;IAClD,CAAA,GAAA,yCAAiB,EAAE;aACjB;QACA,mBAAmB,iBAAiB,SAAS,oBAAoB;gCACjE;IACF;IAEA,IAAI,oBAAC,gBAAgB,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE;QACtC,YAAY,CAAC;QACb,cAAc,CAAA;YACZ,gFAAgF;YAChF,8GAA8G;YAC9G,6FAA6F;YAC7F,sDAAsD;YACtD,sDAAsD;YACtD,EAAE;YACF,2EAA2E;YAC3E,yEAAyE;YACzE,kEAAkE;YAClE,IAAI,CAAC,EAAE,aAAa,IAAI,CAAA,GAAA,yCAA4B,EAAE,EAAE,aAAa,GACnE;YAGF,IACE,CAAC,gCACD,6BAA6B,EAAE,aAAa,GAE5C;QAEJ;IACF;IAEA,OAAO;QACL,cAAc;uBACZ;YACA,GAAG,gBAAgB;QACrB;QACA,eAAe,CAAC;IAClB;AACF","sources":["packages/react-aria/src/overlays/useOverlay.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {isElementInChildOfActiveScope} from '../focus/FocusScope';\nimport {useEffect, useRef} from 'react';\nimport {useFocusWithin} from '../interactions/useFocusWithin';\nimport {useInteractOutside} from '../interactions/useInteractOutside';\n\nexport interface AriaOverlayProps {\n /** Whether the overlay is currently open. */\n isOpen?: boolean;\n\n /** Handler that is called when the overlay should close. */\n onClose?: () => void;\n\n /**\n * Whether to close the overlay when the user interacts outside it.\n *\n * @default false\n */\n isDismissable?: boolean;\n\n /** Whether the overlay should close when focus is lost or moves outside it. */\n shouldCloseOnBlur?: boolean;\n\n /**\n * Whether pressing the escape key to close the overlay should be disabled.\n *\n * @default false\n */\n isKeyboardDismissDisabled?: boolean;\n\n /**\n * When user interacts with the argument element outside of the overlay ref,\n * return true if onClose should be called. This gives you a chance to filter\n * out interaction with elements that should not dismiss the overlay.\n * By default, onClose will always be called on interaction outside the overlay ref.\n */\n shouldCloseOnInteractOutside?: (element: Element) => boolean;\n}\n\nexport interface OverlayAria {\n /** Props to apply to the overlay container element. */\n overlayProps: DOMAttributes;\n /** Props to apply to the underlay element, if any. */\n underlayProps: DOMAttributes;\n}\n\nconst visibleOverlays: RefObject<Element | null>[] = [];\n\n/**\n * Provides the behavior for overlays such as dialogs, popovers, and menus.\n * Hides the overlay when the user interacts outside it, when the Escape key is pressed,\n * or optionally, on blur. Only the top-most overlay will close at once.\n */\nexport function useOverlay(props: AriaOverlayProps, ref: RefObject<Element | null>): OverlayAria {\n let {\n onClose,\n shouldCloseOnBlur,\n isOpen,\n isDismissable = false,\n isKeyboardDismissDisabled = false,\n shouldCloseOnInteractOutside\n } = props;\n\n let lastVisibleOverlay = useRef<RefObject<Element | null>>(undefined);\n\n // Add the overlay ref to the stack of visible overlays on mount, and remove on unmount.\n useEffect(() => {\n if (isOpen && !visibleOverlays.includes(ref)) {\n visibleOverlays.push(ref);\n return () => {\n let index = visibleOverlays.indexOf(ref);\n if (index >= 0) {\n visibleOverlays.splice(index, 1);\n }\n };\n }\n }, [isOpen, ref]);\n\n // Only hide the overlay when it is the topmost visible overlay in the stack\n let onHide = () => {\n if (visibleOverlays[visibleOverlays.length - 1] === ref && onClose) {\n onClose();\n }\n };\n\n let onInteractOutsideStart = (e: PointerEvent) => {\n const topMostOverlay = visibleOverlays[visibleOverlays.length - 1];\n lastVisibleOverlay.current = topMostOverlay;\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(getEventTarget(e) as Element)\n ) {\n if (topMostOverlay === ref) {\n e.stopPropagation();\n }\n }\n };\n\n let onInteractOutside = (e: PointerEvent) => {\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(getEventTarget(e) as Element)\n ) {\n if (visibleOverlays[visibleOverlays.length - 1] === ref) {\n e.stopPropagation();\n }\n if (lastVisibleOverlay.current === ref) {\n onHide();\n }\n }\n lastVisibleOverlay.current = undefined;\n };\n\n // Handle the escape key\n let onKeyDown = e => {\n if (e.key === 'Escape' && !isKeyboardDismissDisabled && !e.nativeEvent.isComposing) {\n e.stopPropagation();\n e.preventDefault();\n onHide();\n }\n };\n\n // Handle clicking outside the overlay to close it\n useInteractOutside({\n ref,\n onInteractOutside: isDismissable && isOpen ? onInteractOutside : undefined,\n onInteractOutsideStart\n });\n\n let {focusWithinProps} = useFocusWithin({\n isDisabled: !shouldCloseOnBlur,\n onBlurWithin: e => {\n // Do not close if relatedTarget is null, which means focus is lost to the body.\n // That can happen when switching tabs, or due to a VoiceOver/Chrome bug with Control+Option+Arrow navigation.\n // Clicking on the body to close the overlay should already be handled by useInteractOutside.\n // https://github.com/adobe/react-spectrum/issues/4130\n // https://github.com/adobe/react-spectrum/issues/4922\n //\n // If focus is moving into a child focus scope (e.g. menu inside a dialog),\n // do not close the outer overlay. At this point, the active scope should\n // still be the outer overlay, since blur events run before focus.\n if (!e.relatedTarget || isElementInChildOfActiveScope(e.relatedTarget)) {\n return;\n }\n\n if (\n !shouldCloseOnInteractOutside ||\n shouldCloseOnInteractOutside(e.relatedTarget as Element)\n ) {\n onClose?.();\n }\n }\n });\n\n return {\n overlayProps: {\n onKeyDown,\n ...focusWithinProps\n },\n underlayProps: {}\n };\n}\n"],"names":[],"version":3,"file":"useOverlay.mjs.map"}
|
|
@@ -32,7 +32,7 @@ $parcel$export(module.exports, "useOverlayPosition", function () { return $9b275
|
|
|
32
32
|
let $9b27591aafdd7244$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
|
|
33
33
|
function $9b27591aafdd7244$export$d39e1813b3bdd0e1(props) {
|
|
34
34
|
let { direction: direction } = (0, $2522e612fa919664$exports.useLocale)();
|
|
35
|
-
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
|
|
35
|
+
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0, getTargetRect: getTargetRect } = props;
|
|
36
36
|
let [position, setPosition] = (0, $kA7qX$react.useState)(null);
|
|
37
37
|
let deps = [
|
|
38
38
|
shouldUpdatePosition,
|
|
@@ -103,7 +103,8 @@ function $9b27591aafdd7244$export$d39e1813b3bdd0e1(props) {
|
|
|
103
103
|
crossOffset: crossOffset,
|
|
104
104
|
maxHeight: maxHeight,
|
|
105
105
|
arrowSize: arrowSize ?? (arrowRef?.current ? (0, $43b053bcc899501d$exports.getRect)(arrowRef.current, true).width : 0),
|
|
106
|
-
arrowBoundaryOffset: arrowBoundaryOffset
|
|
106
|
+
arrowBoundaryOffset: arrowBoundaryOffset,
|
|
107
|
+
targetRect: getTargetRect?.(targetRef.current)
|
|
107
108
|
});
|
|
108
109
|
if (!position.position) return;
|
|
109
110
|
// Modify overlay styles directly so positioning happens immediately without the need of a second render
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4HD,IAAI,uCAAiB,OAAO,aAAa,cAAc,OAAO,cAAc,GAAG;AAMxE,SAAS,0CAAmB,KAAwB;IACzD,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAC1B,IAAI,aACF,SAAS,aACT,SAAS,cACT,UAAU,YACV,QAAQ,aACR,YAAY,uBACZ,YAAY,4BACZ,mBAAmB,gBACnB,aAAa,uBACb,kBAAkB,OAAO,aAAa,cAAc,SAAS,IAAI,GAAG,cACpE,SAAS,gBACT,cAAc,yBACd,uBAAuB,cACvB,SAAS,eACT,OAAO,aACP,SAAS,uBACT,sBAAsB,GACvB,GAAG;IACJ,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAyB;IAE9D,IAAI,OAAO;QACT;QACA;QACA,WAAW,OAAO;QAClB,UAAU,OAAO;QACjB,UAAU;QACV,UAAU,OAAO;QAC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AAU,QAAQ;IACzB,CAAA,GAAA,yCAAc,EAAE;QACd,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;KAAS;AACf;AAEA,SAAS,mCAAa,QAAQ,EAAE,SAAS;IACvC,IAAI,cAAc,OAChB,OAAO,SAAS,OAAO,CAAC,SAAS,SAAS,OAAO,CAAC,OAAO;IAE3D,OAAO,SAAS,OAAO,CAAC,SAAS,QAAQ,OAAO,CAAC,OAAO;AAC1D","sources":["packages/react-aria/src/overlays/useOverlayPosition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {calculatePosition, getRect, PositionResult} from './calculatePosition';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getActiveElement, isFocusWithin} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useCloseOnScroll} from './useCloseOnScroll';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useResizeObserver} from '../utils/useResizeObserver';\n\nexport type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' |\n 'top' | 'top left' | 'top right' | 'top start' | 'top end' |\n 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' |\n 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';\n\nexport type Axis = 'top' | 'bottom' | 'left' | 'right';\nexport type SizeAxis = 'width' | 'height';\nexport type PlacementAxis = Axis | 'center';\n\nexport interface PositionProps {\n /**\n * The placement of the element with respect to its anchor element.\n * @default 'bottom'\n */\n placement?: Placement,\n /**\n * The placement padding that should be applied between the element and its\n * surrounding container.\n * @default 12\n */\n containerPadding?: number,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 0\n */\n offset?: number,\n /**\n * The additional offset applied along the cross axis between the element and its\n * anchor element.\n * @default 0\n */\n crossOffset?: number,\n /**\n * Whether the element should flip its orientation (e.g. top to bottom or left to right) when\n * there is insufficient room for it to render completely.\n * @default true\n */\n shouldFlip?: boolean,\n // /**\n // * The element that should be used as the bounding container when calculating container offset\n // * or whether it should flip.\n // */\n // boundaryElement?: Element,\n /** Whether the element is rendered. */\n isOpen?: boolean\n}\n\nexport interface AriaPositionProps extends PositionProps {\n /**\n * Cross size of the overlay arrow in pixels.\n * @default 0\n */\n arrowSize?: number,\n /**\n * Element that that serves as the positioning boundary.\n * @default document.body\n */\n boundaryElement?: Element,\n /**\n * The ref for the element which the overlay positions itself with respect to.\n */\n targetRef: RefObject<Element | null>,\n /**\n * The ref for the overlay element.\n */\n overlayRef: RefObject<Element | null>,\n /**\n * The ref for the arrow element.\n */\n arrowRef?: RefObject<Element | null>,\n /**\n * A ref for the scrollable region within the overlay.\n * @default overlayRef\n */\n scrollRef?: RefObject<Element | null>,\n /**\n * Whether the overlay should update its position automatically.\n * @default true\n */\n shouldUpdatePosition?: boolean,\n /** Handler that is called when the overlay should close. */\n onClose?: (() => void) | null,\n /**\n * The maxHeight specified for the overlay element.\n * By default, it will take all space up to the current viewport height.\n */\n maxHeight?: number,\n /**\n * The minimum distance the arrow's edge should be from the edge of the overlay element.\n * @default 0\n */\n arrowBoundaryOffset?: number\n}\n\nexport interface PositionAria {\n /** Props for the overlay container element. */\n overlayProps: DOMAttributes,\n /** Props for the overlay tip arrow if any. */\n arrowProps: DOMAttributes,\n /** Placement of the overlay with respect to the overlay trigger. */\n placement: PlacementAxis | null,\n /** The origin of the target in the overlay's coordinate system. Useful for animations. */\n triggerAnchorPoint: {x: number, y: number} | null,\n /** Updates the position of the overlay. */\n updatePosition(): void\n}\n\ninterface ScrollAnchor {\n type: 'top' | 'bottom',\n offset: number\n}\n\nlet visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;\n\n/**\n * Handles positioning overlays like popovers and menus relative to a trigger\n * element, and updating the position when the window resizes.\n */\nexport function useOverlayPosition(props: AriaPositionProps): PositionAria {\n let {direction} = useLocale();\n let {\n arrowSize,\n targetRef,\n overlayRef,\n arrowRef,\n scrollRef = overlayRef,\n placement = 'bottom' as Placement,\n containerPadding = 12,\n shouldFlip = true,\n boundaryElement = typeof document !== 'undefined' ? document.body : null,\n offset = 0,\n crossOffset = 0,\n shouldUpdatePosition = true,\n isOpen = true,\n onClose,\n maxHeight,\n arrowBoundaryOffset = 0\n } = props;\n let [position, setPosition] = useState<PositionResult | null>(null);\n\n let deps = [\n shouldUpdatePosition,\n placement,\n overlayRef.current,\n targetRef.current,\n arrowRef?.current,\n scrollRef.current,\n containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n isOpen,\n direction,\n maxHeight,\n arrowBoundaryOffset,\n arrowSize\n ];\n\n // Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might\n // just be a non-realistic use case\n // Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles\n let lastScale = useRef(visualViewport?.scale);\n useEffect(() => {\n if (isOpen) {\n lastScale.current = visualViewport?.scale;\n }\n }, [isOpen]);\n\n let updatePosition = useCallback(() => {\n if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) {\n return;\n }\n\n if (visualViewport?.scale !== lastScale.current) {\n return;\n }\n\n // Determine a scroll anchor based on the focused element.\n // This stores the offset of the anchor element from the scroll container\n // so it can be restored after repositioning. This way if the overlay height\n // changes, the focused element appears to stay in the same position.\n let anchor: ScrollAnchor | null = null;\n if (scrollRef.current && isFocusWithin(scrollRef.current)) {\n let anchorRect = getActiveElement()?.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n // Anchor from the top if the offset is in the top half of the scrollable element,\n // otherwise anchor from the bottom.\n anchor = {\n type: 'top',\n offset: (anchorRect?.top ?? 0) - scrollRect.top\n };\n if (anchor.offset > scrollRect.height / 2) {\n anchor.type = 'bottom';\n anchor.offset = (anchorRect?.bottom ?? 0) - scrollRect.bottom;\n }\n }\n\n // Always reset the overlay's previous max height if not defined by the user so that we can compensate for\n // RAC collections populating after a second render and properly set a correct max height + positioning when it populates.\n let overlay = (overlayRef.current as HTMLElement);\n if (!maxHeight && overlayRef.current) {\n overlay.style.top = '0px';\n overlay.style.bottom = '';\n overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + 'px';\n }\n\n let position = calculatePosition({\n placement: translateRTL(placement, direction),\n overlayNode: overlayRef.current,\n targetNode: targetRef.current,\n scrollNode: scrollRef.current || overlayRef.current,\n padding: containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n maxHeight,\n arrowSize: arrowSize ?? (arrowRef?.current ? getRect(arrowRef.current, true).width : 0),\n arrowBoundaryOffset\n });\n\n if (!position.position) {\n return;\n }\n\n // Modify overlay styles directly so positioning happens immediately without the need of a second render\n // This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers\n overlay.style.top = '';\n overlay.style.bottom = '';\n overlay.style.left = '';\n overlay.style.right = '';\n\n Object.keys(position.position).forEach(key => overlay.style[key] = (position.position!)[key] + 'px');\n overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';\n\n // Restore scroll position relative to anchor element.\n let activeElement = getActiveElement();\n if (anchor && activeElement && scrollRef.current) {\n let anchorRect = activeElement.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];\n scrollRef.current.scrollTop += newOffset - anchor.offset;\n }\n\n // Trigger a set state for a second render anyway for arrow positioning\n setPosition(position);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n\n // Update position when anything changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(updatePosition, deps);\n\n // Update position on window resize\n useResize(updatePosition);\n\n // Update position when the overlay changes size (might need to flip).\n useResizeObserver({\n ref: overlayRef,\n onResize: updatePosition\n });\n\n // Update position when the target changes size (might need to flip).\n useResizeObserver({\n ref: targetRef,\n onResize: updatePosition\n });\n\n // Reposition the overlay and do not close on scroll while the visual viewport is resizing.\n // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.\n let isResizing = useRef(false);\n useLayoutEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n let onResize = () => {\n isResizing.current = true;\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n isResizing.current = false;\n }, 500);\n\n updatePosition();\n };\n\n // Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)\n // We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.\n let onScroll = () => {\n if (isResizing.current) {\n onResize();\n }\n };\n\n visualViewport?.addEventListener('resize', onResize);\n visualViewport?.addEventListener('scroll', onScroll);\n return () => {\n visualViewport?.removeEventListener('resize', onResize);\n visualViewport?.removeEventListener('scroll', onScroll);\n };\n }, [updatePosition]);\n\n let close = useCallback(() => {\n if (!isResizing.current) {\n onClose?.();\n }\n }, [onClose, isResizing]);\n\n // When scrolling a parent scrollable region of the trigger (other than the body),\n // we hide the popover. Otherwise, its position would be incorrect.\n useCloseOnScroll({\n triggerRef: targetRef,\n isOpen,\n onClose: onClose && close\n });\n\n return {\n overlayProps: {\n style: {\n position: position ? 'absolute' : 'fixed',\n top: !position ? 0 : undefined,\n left: !position ? 0 : undefined,\n zIndex: 100000, // should match the z-index in ModalTrigger\n ...position?.position,\n maxHeight: position?.maxHeight ?? '100vh'\n }\n },\n placement: position?.placement ?? null,\n triggerAnchorPoint: position?.triggerAnchorPoint ?? null,\n arrowProps: {\n 'aria-hidden': 'true',\n role: 'presentation',\n style: {\n left: position?.arrowOffsetLeft,\n top: position?.arrowOffsetTop\n }\n },\n updatePosition\n };\n}\n\nfunction useResize(onResize) {\n useLayoutEffect(() => {\n window.addEventListener('resize', onResize, false);\n return () => {\n window.removeEventListener('resize', onResize, false);\n };\n }, [onResize]);\n}\n\nfunction translateRTL(position, direction) {\n if (direction === 'rtl') {\n return position.replace('start', 'right').replace('end', 'left');\n }\n return position.replace('start', 'left').replace('end', 'right');\n}\n"],"names":[],"version":3,"file":"useOverlayPosition.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiKD,IAAI,uCAAiB,OAAO,aAAa,cAAc,OAAO,cAAc,GAAG;AAMxE,SAAS,0CAAmB,KAAwB;IACzD,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,mCAAQ;IAC1B,IAAI,aACF,SAAS,aACT,SAAS,cACT,UAAU,YACV,QAAQ,aACR,YAAY,uBACZ,YAAY,4BACZ,mBAAmB,gBACnB,aAAa,uBACb,kBAAkB,OAAO,aAAa,cAAc,SAAS,IAAI,GAAG,cACpE,SAAS,gBACT,cAAc,yBACd,uBAAuB,cACvB,SAAS,eACT,OAAO,aACP,SAAS,uBACT,sBAAsB,kBACtB,aAAa,EACd,GAAG;IACJ,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,qBAAO,EAAyB;IAE9D,IAAI,OAAO;QACT;QACA;QACA,WAAW,OAAO;QAClB,UAAU,OAAO;QACjB,UAAU;QACV,UAAU,OAAO;QACjB;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;KACD;IAED,4GAA4G;IAC5G,mCAAmC;IACnC,uGAAuG;IACvG,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE,sCAAgB;IACvC,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,QACF,UAAU,OAAO,GAAG,sCAAgB;IAExC,GAAG;QAAC;KAAO;IAEX,IA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AO,SAAS,OAAO,CAAC,SAAS,SAAS,OAAO,CAAC,OAAO;IAE3D,OAAO,SAAS,OAAO,CAAC,SAAS,QAAQ,OAAO,CAAC,OAAO;AAC1D","sources":["packages/react-aria/src/overlays/useOverlayPosition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {calculatePosition, getRect, PositionResult} from './calculatePosition';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getActiveElement, isFocusWithin} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useCloseOnScroll} from './useCloseOnScroll';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useResizeObserver} from '../utils/useResizeObserver';\n\nexport type Placement =\n | 'bottom'\n | 'bottom left'\n | 'bottom right'\n | 'bottom start'\n | 'bottom end'\n | 'top'\n | 'top left'\n | 'top right'\n | 'top start'\n | 'top end'\n | 'left'\n | 'left top'\n | 'left bottom'\n | 'start'\n | 'start top'\n | 'start bottom'\n | 'right'\n | 'right top'\n | 'right bottom'\n | 'end'\n | 'end top'\n | 'end bottom';\n\nexport type Axis = 'top' | 'bottom' | 'left' | 'right';\nexport type SizeAxis = 'width' | 'height';\nexport type PlacementAxis = Axis | 'center';\n\nexport interface PositionProps {\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'bottom'\n */\n placement?: Placement;\n /**\n * The placement padding that should be applied between the element and its\n * surrounding container.\n *\n * @default 12\n */\n containerPadding?: number;\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n *\n * @default 0\n */\n offset?: number;\n /**\n * The additional offset applied along the cross axis between the element and its\n * anchor element.\n *\n * @default 0\n */\n crossOffset?: number;\n /**\n * Whether the element should flip its orientation (e.g. top to bottom or left to right) when\n * there is insufficient room for it to render completely.\n *\n * @default true\n */\n shouldFlip?: boolean;\n // /**\n // * The element that should be used as the bounding container when calculating container offset\n // * or whether it should flip.\n // */\n // boundaryElement?: Element,\n /** Whether the element is rendered. */\n isOpen?: boolean;\n}\n\nexport interface AriaPositionProps extends PositionProps {\n /**\n * Cross size of the overlay arrow in pixels.\n *\n * @default 0\n */\n arrowSize?: number;\n /**\n * Element that that serves as the positioning boundary.\n *\n * @default document.body\n */\n boundaryElement?: Element;\n /**\n * The ref for the element which the overlay positions itself with respect to.\n */\n targetRef: RefObject<Element | null>;\n /**\n * The ref for the overlay element.\n */\n overlayRef: RefObject<Element | null>;\n /**\n * The ref for the arrow element.\n */\n arrowRef?: RefObject<Element | null>;\n /**\n * A ref for the scrollable region within the overlay.\n *\n * @default overlayRef\n */\n scrollRef?: RefObject<Element | null>;\n /**\n * Whether the overlay should update its position automatically.\n *\n * @default true\n */\n shouldUpdatePosition?: boolean;\n /** Handler that is called when the overlay should close. */\n onClose?: (() => void) | null;\n /**\n * The maxHeight specified for the overlay element.\n * By default, it will take all space up to the current viewport height.\n */\n maxHeight?: number;\n /**\n * The minimum distance the arrow's edge should be from the edge of the overlay element.\n *\n * @default 0\n */\n arrowBoundaryOffset?: number;\n /**\n * Overrides the target element's bounding rectangle. Useful for positioning relative to\n * a specific point such as the mouse cursor (e.g. context menus) or text selection.\n *\n * @default target.getBoundingClientRect()\n * @param target - The target element.\n */\n getTargetRect?: (target: Element) => DOMRect | null | undefined;\n}\n\nexport interface PositionAria {\n /** Props for the overlay container element. */\n overlayProps: DOMAttributes;\n /** Props for the overlay tip arrow if any. */\n arrowProps: DOMAttributes;\n /** Placement of the overlay with respect to the overlay trigger. */\n placement: PlacementAxis | null;\n /** The origin of the target in the overlay's coordinate system. Useful for animations. */\n triggerAnchorPoint: {x: number; y: number} | null;\n /** Updates the position of the overlay. */\n updatePosition(): void;\n}\n\ninterface ScrollAnchor {\n type: 'top' | 'bottom';\n offset: number;\n}\n\nlet visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;\n\n/**\n * Handles positioning overlays like popovers and menus relative to a trigger\n * element, and updating the position when the window resizes.\n */\nexport function useOverlayPosition(props: AriaPositionProps): PositionAria {\n let {direction} = useLocale();\n let {\n arrowSize,\n targetRef,\n overlayRef,\n arrowRef,\n scrollRef = overlayRef,\n placement = 'bottom' as Placement,\n containerPadding = 12,\n shouldFlip = true,\n boundaryElement = typeof document !== 'undefined' ? document.body : null,\n offset = 0,\n crossOffset = 0,\n shouldUpdatePosition = true,\n isOpen = true,\n onClose,\n maxHeight,\n arrowBoundaryOffset = 0,\n getTargetRect\n } = props;\n let [position, setPosition] = useState<PositionResult | null>(null);\n\n let deps = [\n shouldUpdatePosition,\n placement,\n overlayRef.current,\n targetRef.current,\n arrowRef?.current,\n scrollRef.current,\n containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n isOpen,\n direction,\n maxHeight,\n arrowBoundaryOffset,\n arrowSize\n ];\n\n // Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might\n // just be a non-realistic use case\n // Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles\n let lastScale = useRef(visualViewport?.scale);\n useEffect(() => {\n if (isOpen) {\n lastScale.current = visualViewport?.scale;\n }\n }, [isOpen]);\n\n let updatePosition = useCallback(() => {\n if (\n shouldUpdatePosition === false ||\n !isOpen ||\n !overlayRef.current ||\n !targetRef.current ||\n !boundaryElement\n ) {\n return;\n }\n\n if (visualViewport?.scale !== lastScale.current) {\n return;\n }\n\n // Determine a scroll anchor based on the focused element.\n // This stores the offset of the anchor element from the scroll container\n // so it can be restored after repositioning. This way if the overlay height\n // changes, the focused element appears to stay in the same position.\n let anchor: ScrollAnchor | null = null;\n if (scrollRef.current && isFocusWithin(scrollRef.current)) {\n let anchorRect = getActiveElement()?.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n // Anchor from the top if the offset is in the top half of the scrollable element,\n // otherwise anchor from the bottom.\n anchor = {\n type: 'top',\n offset: (anchorRect?.top ?? 0) - scrollRect.top\n };\n if (anchor.offset > scrollRect.height / 2) {\n anchor.type = 'bottom';\n anchor.offset = (anchorRect?.bottom ?? 0) - scrollRect.bottom;\n }\n }\n\n // Always reset the overlay's previous max height if not defined by the user so that we can compensate for\n // RAC collections populating after a second render and properly set a correct max height + positioning when it populates.\n let overlay = overlayRef.current as HTMLElement;\n if (!maxHeight && overlayRef.current) {\n overlay.style.top = '0px';\n overlay.style.bottom = '';\n overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + 'px';\n }\n\n let position = calculatePosition({\n placement: translateRTL(placement, direction),\n overlayNode: overlayRef.current,\n targetNode: targetRef.current,\n scrollNode: scrollRef.current || overlayRef.current,\n padding: containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n maxHeight,\n arrowSize: arrowSize ?? (arrowRef?.current ? getRect(arrowRef.current, true).width : 0),\n arrowBoundaryOffset,\n targetRect: getTargetRect?.(targetRef.current)\n });\n\n if (!position.position) {\n return;\n }\n\n // Modify overlay styles directly so positioning happens immediately without the need of a second render\n // This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers\n overlay.style.top = '';\n overlay.style.bottom = '';\n overlay.style.left = '';\n overlay.style.right = '';\n\n Object.keys(position.position).forEach(\n key => (overlay.style[key] = position.position![key] + 'px')\n );\n overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';\n\n // Restore scroll position relative to anchor element.\n let activeElement = getActiveElement();\n if (anchor && activeElement && scrollRef.current) {\n let anchorRect = activeElement.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];\n scrollRef.current.scrollTop += newOffset - anchor.offset;\n }\n\n // Trigger a set state for a second render anyway for arrow positioning\n setPosition(position);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n\n // Update position when anything changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(updatePosition, deps);\n\n // Update position on window resize\n useResize(updatePosition);\n\n // Update position when the overlay changes size (might need to flip).\n useResizeObserver({\n ref: overlayRef,\n onResize: updatePosition\n });\n\n // Update position when the target changes size (might need to flip).\n useResizeObserver({\n ref: targetRef,\n onResize: updatePosition\n });\n\n // Reposition the overlay and do not close on scroll while the visual viewport is resizing.\n // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.\n let isResizing = useRef(false);\n useLayoutEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n let onResize = () => {\n isResizing.current = true;\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n isResizing.current = false;\n }, 500);\n\n updatePosition();\n };\n\n // Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)\n // We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.\n let onScroll = () => {\n if (isResizing.current) {\n onResize();\n }\n };\n\n visualViewport?.addEventListener('resize', onResize);\n visualViewport?.addEventListener('scroll', onScroll);\n return () => {\n visualViewport?.removeEventListener('resize', onResize);\n visualViewport?.removeEventListener('scroll', onScroll);\n };\n }, [updatePosition]);\n\n let close = useCallback(() => {\n if (!isResizing.current) {\n onClose?.();\n }\n }, [onClose, isResizing]);\n\n // When scrolling a parent scrollable region of the trigger (other than the body),\n // we hide the popover. Otherwise, its position would be incorrect.\n useCloseOnScroll({\n triggerRef: targetRef,\n isOpen,\n onClose: onClose && close\n });\n\n return {\n overlayProps: {\n style: {\n position: position ? 'absolute' : 'fixed',\n top: !position ? 0 : undefined,\n left: !position ? 0 : undefined,\n zIndex: 100000, // should match the z-index in ModalTrigger\n ...position?.position,\n maxHeight: position?.maxHeight ?? '100vh'\n }\n },\n placement: position?.placement ?? null,\n triggerAnchorPoint: position?.triggerAnchorPoint ?? null,\n arrowProps: {\n 'aria-hidden': 'true',\n role: 'presentation',\n style: {\n left: position?.arrowOffsetLeft,\n top: position?.arrowOffsetTop\n }\n },\n updatePosition\n };\n}\n\nfunction useResize(onResize) {\n useLayoutEffect(() => {\n window.addEventListener('resize', onResize, false);\n return () => {\n window.removeEventListener('resize', onResize, false);\n };\n }, [onResize]);\n}\n\nfunction translateRTL(position, direction) {\n if (direction === 'rtl') {\n return position.replace('start', 'right').replace('end', 'left');\n }\n return position.replace('start', 'left').replace('end', 'right');\n}\n"],"names":[],"version":3,"file":"useOverlayPosition.cjs.map"}
|
|
@@ -26,7 +26,7 @@ import {useState as $dzWlW$useState, useRef as $dzWlW$useRef, useEffect as $dzWl
|
|
|
26
26
|
let $e55325afa7851309$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
|
|
27
27
|
function $e55325afa7851309$export$d39e1813b3bdd0e1(props) {
|
|
28
28
|
let { direction: direction } = (0, $4defb058003b3e05$export$43bb16f9c6d9e3f7)();
|
|
29
|
-
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
|
|
29
|
+
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0, getTargetRect: getTargetRect } = props;
|
|
30
30
|
let [position, setPosition] = (0, $dzWlW$useState)(null);
|
|
31
31
|
let deps = [
|
|
32
32
|
shouldUpdatePosition,
|
|
@@ -102,7 +102,8 @@ function $e55325afa7851309$export$d39e1813b3bdd0e1(props) {
|
|
|
102
102
|
crossOffset: crossOffset,
|
|
103
103
|
maxHeight: maxHeight,
|
|
104
104
|
arrowSize: arrowSize !== null && arrowSize !== void 0 ? arrowSize : (arrowRef === null || arrowRef === void 0 ? void 0 : arrowRef.current) ? (0, $ba2991ee81d3897a$export$4b834cebd9e5cebe)(arrowRef.current, true).width : 0,
|
|
105
|
-
arrowBoundaryOffset: arrowBoundaryOffset
|
|
105
|
+
arrowBoundaryOffset: arrowBoundaryOffset,
|
|
106
|
+
targetRect: getTargetRect === null || getTargetRect === void 0 ? void 0 : getTargetRect(targetRef.current)
|
|
106
107
|
});
|
|
107
108
|
if (!position.position) return;
|
|
108
109
|
// Modify overlay styles directly so positioning happens immediately without the need of a second render
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4HD,IAAI,uCAAiB,OAAO,aAAa,cAAc,OAAO,cAAc,GAAG;AAMxE,SAAS,0CAAmB,KAAwB;IACzD,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAQ;IAC1B,IAAI,aACF,SAAS,aACT,SAAS,cACT,UAAU,YACV,QAAQ,aACR,YAAY,uBACZ,YAAY,4BACZ,mBAAmB,gBACnB,aAAa,uBACb,kBAAkB,OAAO,aAAa,cAAc,SAAS,IAAI,GAAG,cACpE,SAAS,gBACT,cAAc,yBACd,uBAAuB,cACvB,SAAS,eACT,OAAO,aACP,SAAS,uBACT,sBAAsB,GACvB,GAAG;IACJ,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,eAAO,EAAyB;IA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AC,WAAW,OAAO,EACrB,oBAAA,8BAAA;IAEJ,GAAG;QAAC;QAAS;KAAW;IAExB,kFAAkF;IAClF,mEAAmE;IACnE,CAAA,GAAA,yCAAe,EAAE;QACf,YAAY;gBACZ;QACA,SAAS,WAAW;IACtB;QAUiB,qBAGJ,qBACS;IAZtB,OAAO;QACL,cAAc;YACZ,OAAO;gBACL,UAAU,WAAW,aAAa;gBAClC,KAAK,CAAC,WAAW,IAAI;gBACrB,MAAM,CAAC,WAAW,IAAI;gBACtB,QAAQ;mBACL,qBAAA,+BAAA,SAAU,QAAQ,AAArB;gBACA,WAAW,CAAA,sBAAA,qBAAA,+BAAA,SAAU,SAAS,cAAnB,iCAAA,sBAAuB;YACpC;QACF;QACA,WAAW,CAAA,sBAAA,qBAAA,+BAAA,SAAU,SAAS,cAAnB,iCAAA,sBAAuB;QAClC,oBAAoB,CAAA,+BAAA,qBAAA,+BAAA,SAAU,kBAAkB,cAA5B,0CAAA,+BAAgC;QACpD,YAAY;YACV,eAAe;YACf,MAAM;YACN,OAAO;gBACL,IAAI,EAAE,qBAAA,+BAAA,SAAU,eAAe;gBAC/B,GAAG,EAAE,qBAAA,+BAAA,SAAU,cAAc;YAC/B;QACF;wBACA;IACF;AACF;AAEA,SAAS,gCAAU,QAAQ;IACzB,CAAA,GAAA,yCAAc,EAAE;QACd,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;KAAS;AACf;AAEA,SAAS,mCAAa,QAAQ,EAAE,SAAS;IACvC,IAAI,cAAc,OAChB,OAAO,SAAS,OAAO,CAAC,SAAS,SAAS,OAAO,CAAC,OAAO;IAE3D,OAAO,SAAS,OAAO,CAAC,SAAS,QAAQ,OAAO,CAAC,OAAO;AAC1D","sources":["packages/react-aria/src/overlays/useOverlayPosition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {calculatePosition, getRect, PositionResult} from './calculatePosition';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getActiveElement, isFocusWithin} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useCloseOnScroll} from './useCloseOnScroll';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useResizeObserver} from '../utils/useResizeObserver';\n\nexport type Placement = 'bottom' | 'bottom left' | 'bottom right' | 'bottom start' | 'bottom end' |\n 'top' | 'top left' | 'top right' | 'top start' | 'top end' |\n 'left' | 'left top' | 'left bottom' | 'start' | 'start top' | 'start bottom' |\n 'right' | 'right top' | 'right bottom' | 'end' | 'end top' | 'end bottom';\n\nexport type Axis = 'top' | 'bottom' | 'left' | 'right';\nexport type SizeAxis = 'width' | 'height';\nexport type PlacementAxis = Axis | 'center';\n\nexport interface PositionProps {\n /**\n * The placement of the element with respect to its anchor element.\n * @default 'bottom'\n */\n placement?: Placement,\n /**\n * The placement padding that should be applied between the element and its\n * surrounding container.\n * @default 12\n */\n containerPadding?: number,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 0\n */\n offset?: number,\n /**\n * The additional offset applied along the cross axis between the element and its\n * anchor element.\n * @default 0\n */\n crossOffset?: number,\n /**\n * Whether the element should flip its orientation (e.g. top to bottom or left to right) when\n * there is insufficient room for it to render completely.\n * @default true\n */\n shouldFlip?: boolean,\n // /**\n // * The element that should be used as the bounding container when calculating container offset\n // * or whether it should flip.\n // */\n // boundaryElement?: Element,\n /** Whether the element is rendered. */\n isOpen?: boolean\n}\n\nexport interface AriaPositionProps extends PositionProps {\n /**\n * Cross size of the overlay arrow in pixels.\n * @default 0\n */\n arrowSize?: number,\n /**\n * Element that that serves as the positioning boundary.\n * @default document.body\n */\n boundaryElement?: Element,\n /**\n * The ref for the element which the overlay positions itself with respect to.\n */\n targetRef: RefObject<Element | null>,\n /**\n * The ref for the overlay element.\n */\n overlayRef: RefObject<Element | null>,\n /**\n * The ref for the arrow element.\n */\n arrowRef?: RefObject<Element | null>,\n /**\n * A ref for the scrollable region within the overlay.\n * @default overlayRef\n */\n scrollRef?: RefObject<Element | null>,\n /**\n * Whether the overlay should update its position automatically.\n * @default true\n */\n shouldUpdatePosition?: boolean,\n /** Handler that is called when the overlay should close. */\n onClose?: (() => void) | null,\n /**\n * The maxHeight specified for the overlay element.\n * By default, it will take all space up to the current viewport height.\n */\n maxHeight?: number,\n /**\n * The minimum distance the arrow's edge should be from the edge of the overlay element.\n * @default 0\n */\n arrowBoundaryOffset?: number\n}\n\nexport interface PositionAria {\n /** Props for the overlay container element. */\n overlayProps: DOMAttributes,\n /** Props for the overlay tip arrow if any. */\n arrowProps: DOMAttributes,\n /** Placement of the overlay with respect to the overlay trigger. */\n placement: PlacementAxis | null,\n /** The origin of the target in the overlay's coordinate system. Useful for animations. */\n triggerAnchorPoint: {x: number, y: number} | null,\n /** Updates the position of the overlay. */\n updatePosition(): void\n}\n\ninterface ScrollAnchor {\n type: 'top' | 'bottom',\n offset: number\n}\n\nlet visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;\n\n/**\n * Handles positioning overlays like popovers and menus relative to a trigger\n * element, and updating the position when the window resizes.\n */\nexport function useOverlayPosition(props: AriaPositionProps): PositionAria {\n let {direction} = useLocale();\n let {\n arrowSize,\n targetRef,\n overlayRef,\n arrowRef,\n scrollRef = overlayRef,\n placement = 'bottom' as Placement,\n containerPadding = 12,\n shouldFlip = true,\n boundaryElement = typeof document !== 'undefined' ? document.body : null,\n offset = 0,\n crossOffset = 0,\n shouldUpdatePosition = true,\n isOpen = true,\n onClose,\n maxHeight,\n arrowBoundaryOffset = 0\n } = props;\n let [position, setPosition] = useState<PositionResult | null>(null);\n\n let deps = [\n shouldUpdatePosition,\n placement,\n overlayRef.current,\n targetRef.current,\n arrowRef?.current,\n scrollRef.current,\n containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n isOpen,\n direction,\n maxHeight,\n arrowBoundaryOffset,\n arrowSize\n ];\n\n // Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might\n // just be a non-realistic use case\n // Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles\n let lastScale = useRef(visualViewport?.scale);\n useEffect(() => {\n if (isOpen) {\n lastScale.current = visualViewport?.scale;\n }\n }, [isOpen]);\n\n let updatePosition = useCallback(() => {\n if (shouldUpdatePosition === false || !isOpen || !overlayRef.current || !targetRef.current || !boundaryElement) {\n return;\n }\n\n if (visualViewport?.scale !== lastScale.current) {\n return;\n }\n\n // Determine a scroll anchor based on the focused element.\n // This stores the offset of the anchor element from the scroll container\n // so it can be restored after repositioning. This way if the overlay height\n // changes, the focused element appears to stay in the same position.\n let anchor: ScrollAnchor | null = null;\n if (scrollRef.current && isFocusWithin(scrollRef.current)) {\n let anchorRect = getActiveElement()?.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n // Anchor from the top if the offset is in the top half of the scrollable element,\n // otherwise anchor from the bottom.\n anchor = {\n type: 'top',\n offset: (anchorRect?.top ?? 0) - scrollRect.top\n };\n if (anchor.offset > scrollRect.height / 2) {\n anchor.type = 'bottom';\n anchor.offset = (anchorRect?.bottom ?? 0) - scrollRect.bottom;\n }\n }\n\n // Always reset the overlay's previous max height if not defined by the user so that we can compensate for\n // RAC collections populating after a second render and properly set a correct max height + positioning when it populates.\n let overlay = (overlayRef.current as HTMLElement);\n if (!maxHeight && overlayRef.current) {\n overlay.style.top = '0px';\n overlay.style.bottom = '';\n overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + 'px';\n }\n\n let position = calculatePosition({\n placement: translateRTL(placement, direction),\n overlayNode: overlayRef.current,\n targetNode: targetRef.current,\n scrollNode: scrollRef.current || overlayRef.current,\n padding: containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n maxHeight,\n arrowSize: arrowSize ?? (arrowRef?.current ? getRect(arrowRef.current, true).width : 0),\n arrowBoundaryOffset\n });\n\n if (!position.position) {\n return;\n }\n\n // Modify overlay styles directly so positioning happens immediately without the need of a second render\n // This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers\n overlay.style.top = '';\n overlay.style.bottom = '';\n overlay.style.left = '';\n overlay.style.right = '';\n\n Object.keys(position.position).forEach(key => overlay.style[key] = (position.position!)[key] + 'px');\n overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';\n\n // Restore scroll position relative to anchor element.\n let activeElement = getActiveElement();\n if (anchor && activeElement && scrollRef.current) {\n let anchorRect = activeElement.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];\n scrollRef.current.scrollTop += newOffset - anchor.offset;\n }\n\n // Trigger a set state for a second render anyway for arrow positioning\n setPosition(position);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n\n // Update position when anything changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(updatePosition, deps);\n\n // Update position on window resize\n useResize(updatePosition);\n\n // Update position when the overlay changes size (might need to flip).\n useResizeObserver({\n ref: overlayRef,\n onResize: updatePosition\n });\n\n // Update position when the target changes size (might need to flip).\n useResizeObserver({\n ref: targetRef,\n onResize: updatePosition\n });\n\n // Reposition the overlay and do not close on scroll while the visual viewport is resizing.\n // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.\n let isResizing = useRef(false);\n useLayoutEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n let onResize = () => {\n isResizing.current = true;\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n isResizing.current = false;\n }, 500);\n\n updatePosition();\n };\n\n // Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)\n // We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.\n let onScroll = () => {\n if (isResizing.current) {\n onResize();\n }\n };\n\n visualViewport?.addEventListener('resize', onResize);\n visualViewport?.addEventListener('scroll', onScroll);\n return () => {\n visualViewport?.removeEventListener('resize', onResize);\n visualViewport?.removeEventListener('scroll', onScroll);\n };\n }, [updatePosition]);\n\n let close = useCallback(() => {\n if (!isResizing.current) {\n onClose?.();\n }\n }, [onClose, isResizing]);\n\n // When scrolling a parent scrollable region of the trigger (other than the body),\n // we hide the popover. Otherwise, its position would be incorrect.\n useCloseOnScroll({\n triggerRef: targetRef,\n isOpen,\n onClose: onClose && close\n });\n\n return {\n overlayProps: {\n style: {\n position: position ? 'absolute' : 'fixed',\n top: !position ? 0 : undefined,\n left: !position ? 0 : undefined,\n zIndex: 100000, // should match the z-index in ModalTrigger\n ...position?.position,\n maxHeight: position?.maxHeight ?? '100vh'\n }\n },\n placement: position?.placement ?? null,\n triggerAnchorPoint: position?.triggerAnchorPoint ?? null,\n arrowProps: {\n 'aria-hidden': 'true',\n role: 'presentation',\n style: {\n left: position?.arrowOffsetLeft,\n top: position?.arrowOffsetTop\n }\n },\n updatePosition\n };\n}\n\nfunction useResize(onResize) {\n useLayoutEffect(() => {\n window.addEventListener('resize', onResize, false);\n return () => {\n window.removeEventListener('resize', onResize, false);\n };\n }, [onResize]);\n}\n\nfunction translateRTL(position, direction) {\n if (direction === 'rtl') {\n return position.replace('start', 'right').replace('end', 'left');\n }\n return position.replace('start', 'left').replace('end', 'right');\n}\n"],"names":[],"version":3,"file":"useOverlayPosition.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiKD,IAAI,uCAAiB,OAAO,aAAa,cAAc,OAAO,cAAc,G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;AACF;AAEA,SAAS,gCAAU,QAAQ;IACzB,CAAA,GAAA,yCAAc,EAAE;QACd,OAAO,gBAAgB,CAAC,UAAU,UAAU;QAC5C,OAAO;YACL,OAAO,mBAAmB,CAAC,UAAU,UAAU;QACjD;IACF,GAAG;QAAC;KAAS;AACf;AAEA,SAAS,mCAAa,QAAQ,EAAE,SAAS;IACvC,IAAI,cAAc,OAChB,OAAO,SAAS,OAAO,CAAC,SAAS,SAAS,OAAO,CAAC,OAAO;IAE3D,OAAO,SAAS,OAAO,CAAC,SAAS,QAAQ,OAAO,CAAC,OAAO;AAC1D","sources":["packages/react-aria/src/overlays/useOverlayPosition.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {calculatePosition, getRect, PositionResult} from './calculatePosition';\nimport {DOMAttributes, RefObject} from '@react-types/shared';\nimport {getActiveElement, isFocusWithin} from '../utils/shadowdom/DOMFunctions';\nimport {useCallback, useEffect, useRef, useState} from 'react';\nimport {useCloseOnScroll} from './useCloseOnScroll';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocale} from '../i18n/I18nProvider';\nimport {useResizeObserver} from '../utils/useResizeObserver';\n\nexport type Placement =\n | 'bottom'\n | 'bottom left'\n | 'bottom right'\n | 'bottom start'\n | 'bottom end'\n | 'top'\n | 'top left'\n | 'top right'\n | 'top start'\n | 'top end'\n | 'left'\n | 'left top'\n | 'left bottom'\n | 'start'\n | 'start top'\n | 'start bottom'\n | 'right'\n | 'right top'\n | 'right bottom'\n | 'end'\n | 'end top'\n | 'end bottom';\n\nexport type Axis = 'top' | 'bottom' | 'left' | 'right';\nexport type SizeAxis = 'width' | 'height';\nexport type PlacementAxis = Axis | 'center';\n\nexport interface PositionProps {\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'bottom'\n */\n placement?: Placement;\n /**\n * The placement padding that should be applied between the element and its\n * surrounding container.\n *\n * @default 12\n */\n containerPadding?: number;\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n *\n * @default 0\n */\n offset?: number;\n /**\n * The additional offset applied along the cross axis between the element and its\n * anchor element.\n *\n * @default 0\n */\n crossOffset?: number;\n /**\n * Whether the element should flip its orientation (e.g. top to bottom or left to right) when\n * there is insufficient room for it to render completely.\n *\n * @default true\n */\n shouldFlip?: boolean;\n // /**\n // * The element that should be used as the bounding container when calculating container offset\n // * or whether it should flip.\n // */\n // boundaryElement?: Element,\n /** Whether the element is rendered. */\n isOpen?: boolean;\n}\n\nexport interface AriaPositionProps extends PositionProps {\n /**\n * Cross size of the overlay arrow in pixels.\n *\n * @default 0\n */\n arrowSize?: number;\n /**\n * Element that that serves as the positioning boundary.\n *\n * @default document.body\n */\n boundaryElement?: Element;\n /**\n * The ref for the element which the overlay positions itself with respect to.\n */\n targetRef: RefObject<Element | null>;\n /**\n * The ref for the overlay element.\n */\n overlayRef: RefObject<Element | null>;\n /**\n * The ref for the arrow element.\n */\n arrowRef?: RefObject<Element | null>;\n /**\n * A ref for the scrollable region within the overlay.\n *\n * @default overlayRef\n */\n scrollRef?: RefObject<Element | null>;\n /**\n * Whether the overlay should update its position automatically.\n *\n * @default true\n */\n shouldUpdatePosition?: boolean;\n /** Handler that is called when the overlay should close. */\n onClose?: (() => void) | null;\n /**\n * The maxHeight specified for the overlay element.\n * By default, it will take all space up to the current viewport height.\n */\n maxHeight?: number;\n /**\n * The minimum distance the arrow's edge should be from the edge of the overlay element.\n *\n * @default 0\n */\n arrowBoundaryOffset?: number;\n /**\n * Overrides the target element's bounding rectangle. Useful for positioning relative to\n * a specific point such as the mouse cursor (e.g. context menus) or text selection.\n *\n * @default target.getBoundingClientRect()\n * @param target - The target element.\n */\n getTargetRect?: (target: Element) => DOMRect | null | undefined;\n}\n\nexport interface PositionAria {\n /** Props for the overlay container element. */\n overlayProps: DOMAttributes;\n /** Props for the overlay tip arrow if any. */\n arrowProps: DOMAttributes;\n /** Placement of the overlay with respect to the overlay trigger. */\n placement: PlacementAxis | null;\n /** The origin of the target in the overlay's coordinate system. Useful for animations. */\n triggerAnchorPoint: {x: number; y: number} | null;\n /** Updates the position of the overlay. */\n updatePosition(): void;\n}\n\ninterface ScrollAnchor {\n type: 'top' | 'bottom';\n offset: number;\n}\n\nlet visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;\n\n/**\n * Handles positioning overlays like popovers and menus relative to a trigger\n * element, and updating the position when the window resizes.\n */\nexport function useOverlayPosition(props: AriaPositionProps): PositionAria {\n let {direction} = useLocale();\n let {\n arrowSize,\n targetRef,\n overlayRef,\n arrowRef,\n scrollRef = overlayRef,\n placement = 'bottom' as Placement,\n containerPadding = 12,\n shouldFlip = true,\n boundaryElement = typeof document !== 'undefined' ? document.body : null,\n offset = 0,\n crossOffset = 0,\n shouldUpdatePosition = true,\n isOpen = true,\n onClose,\n maxHeight,\n arrowBoundaryOffset = 0,\n getTargetRect\n } = props;\n let [position, setPosition] = useState<PositionResult | null>(null);\n\n let deps = [\n shouldUpdatePosition,\n placement,\n overlayRef.current,\n targetRef.current,\n arrowRef?.current,\n scrollRef.current,\n containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n isOpen,\n direction,\n maxHeight,\n arrowBoundaryOffset,\n arrowSize\n ];\n\n // Note, the position freezing breaks if body sizes itself dynamicly with the visual viewport but that might\n // just be a non-realistic use case\n // Upon opening a overlay, record the current visual viewport scale so we can freeze the overlay styles\n let lastScale = useRef(visualViewport?.scale);\n useEffect(() => {\n if (isOpen) {\n lastScale.current = visualViewport?.scale;\n }\n }, [isOpen]);\n\n let updatePosition = useCallback(() => {\n if (\n shouldUpdatePosition === false ||\n !isOpen ||\n !overlayRef.current ||\n !targetRef.current ||\n !boundaryElement\n ) {\n return;\n }\n\n if (visualViewport?.scale !== lastScale.current) {\n return;\n }\n\n // Determine a scroll anchor based on the focused element.\n // This stores the offset of the anchor element from the scroll container\n // so it can be restored after repositioning. This way if the overlay height\n // changes, the focused element appears to stay in the same position.\n let anchor: ScrollAnchor | null = null;\n if (scrollRef.current && isFocusWithin(scrollRef.current)) {\n let anchorRect = getActiveElement()?.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n // Anchor from the top if the offset is in the top half of the scrollable element,\n // otherwise anchor from the bottom.\n anchor = {\n type: 'top',\n offset: (anchorRect?.top ?? 0) - scrollRect.top\n };\n if (anchor.offset > scrollRect.height / 2) {\n anchor.type = 'bottom';\n anchor.offset = (anchorRect?.bottom ?? 0) - scrollRect.bottom;\n }\n }\n\n // Always reset the overlay's previous max height if not defined by the user so that we can compensate for\n // RAC collections populating after a second render and properly set a correct max height + positioning when it populates.\n let overlay = overlayRef.current as HTMLElement;\n if (!maxHeight && overlayRef.current) {\n overlay.style.top = '0px';\n overlay.style.bottom = '';\n overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + 'px';\n }\n\n let position = calculatePosition({\n placement: translateRTL(placement, direction),\n overlayNode: overlayRef.current,\n targetNode: targetRef.current,\n scrollNode: scrollRef.current || overlayRef.current,\n padding: containerPadding,\n shouldFlip,\n boundaryElement,\n offset,\n crossOffset,\n maxHeight,\n arrowSize: arrowSize ?? (arrowRef?.current ? getRect(arrowRef.current, true).width : 0),\n arrowBoundaryOffset,\n targetRect: getTargetRect?.(targetRef.current)\n });\n\n if (!position.position) {\n return;\n }\n\n // Modify overlay styles directly so positioning happens immediately without the need of a second render\n // This is so we don't have to delay autoFocus scrolling or delay applying preventScroll for popovers\n overlay.style.top = '';\n overlay.style.bottom = '';\n overlay.style.left = '';\n overlay.style.right = '';\n\n Object.keys(position.position).forEach(\n key => (overlay.style[key] = position.position![key] + 'px')\n );\n overlay.style.maxHeight = position.maxHeight != null ? position.maxHeight + 'px' : '';\n\n // Restore scroll position relative to anchor element.\n let activeElement = getActiveElement();\n if (anchor && activeElement && scrollRef.current) {\n let anchorRect = activeElement.getBoundingClientRect();\n let scrollRect = scrollRef.current.getBoundingClientRect();\n let newOffset = anchorRect[anchor.type] - scrollRect[anchor.type];\n scrollRef.current.scrollTop += newOffset - anchor.offset;\n }\n\n // Trigger a set state for a second render anyway for arrow positioning\n setPosition(position);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, deps);\n\n // Update position when anything changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useLayoutEffect(updatePosition, deps);\n\n // Update position on window resize\n useResize(updatePosition);\n\n // Update position when the overlay changes size (might need to flip).\n useResizeObserver({\n ref: overlayRef,\n onResize: updatePosition\n });\n\n // Update position when the target changes size (might need to flip).\n useResizeObserver({\n ref: targetRef,\n onResize: updatePosition\n });\n\n // Reposition the overlay and do not close on scroll while the visual viewport is resizing.\n // This will ensure that overlays adjust their positioning when the iOS virtual keyboard appears.\n let isResizing = useRef(false);\n useLayoutEffect(() => {\n let timeout: ReturnType<typeof setTimeout>;\n let onResize = () => {\n isResizing.current = true;\n clearTimeout(timeout);\n\n timeout = setTimeout(() => {\n isResizing.current = false;\n }, 500);\n\n updatePosition();\n };\n\n // Only reposition the overlay if a scroll event happens immediately as a result of resize (aka the virtual keyboard has appears)\n // We don't want to reposition the overlay if the user has pinch zoomed in and is scrolling the viewport around.\n let onScroll = () => {\n if (isResizing.current) {\n onResize();\n }\n };\n\n visualViewport?.addEventListener('resize', onResize);\n visualViewport?.addEventListener('scroll', onScroll);\n return () => {\n visualViewport?.removeEventListener('resize', onResize);\n visualViewport?.removeEventListener('scroll', onScroll);\n };\n }, [updatePosition]);\n\n let close = useCallback(() => {\n if (!isResizing.current) {\n onClose?.();\n }\n }, [onClose, isResizing]);\n\n // When scrolling a parent scrollable region of the trigger (other than the body),\n // we hide the popover. Otherwise, its position would be incorrect.\n useCloseOnScroll({\n triggerRef: targetRef,\n isOpen,\n onClose: onClose && close\n });\n\n return {\n overlayProps: {\n style: {\n position: position ? 'absolute' : 'fixed',\n top: !position ? 0 : undefined,\n left: !position ? 0 : undefined,\n zIndex: 100000, // should match the z-index in ModalTrigger\n ...position?.position,\n maxHeight: position?.maxHeight ?? '100vh'\n }\n },\n placement: position?.placement ?? null,\n triggerAnchorPoint: position?.triggerAnchorPoint ?? null,\n arrowProps: {\n 'aria-hidden': 'true',\n role: 'presentation',\n style: {\n left: position?.arrowOffsetLeft,\n top: position?.arrowOffsetTop\n }\n },\n updatePosition\n };\n}\n\nfunction useResize(onResize) {\n useLayoutEffect(() => {\n window.addEventListener('resize', onResize, false);\n return () => {\n window.removeEventListener('resize', onResize, false);\n };\n }, [onResize]);\n}\n\nfunction translateRTL(position, direction) {\n if (direction === 'rtl') {\n return position.replace('start', 'right').replace('end', 'left');\n }\n return position.replace('start', 'left').replace('end', 'right');\n}\n"],"names":[],"version":3,"file":"useOverlayPosition.js.map"}
|
|
@@ -26,7 +26,7 @@ import {useState as $jKzS8$useState, useRef as $jKzS8$useRef, useEffect as $jKzS
|
|
|
26
26
|
let $b3526bc71400be8d$var$visualViewport = typeof document !== 'undefined' ? window.visualViewport : null;
|
|
27
27
|
function $b3526bc71400be8d$export$d39e1813b3bdd0e1(props) {
|
|
28
28
|
let { direction: direction } = (0, $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7)();
|
|
29
|
-
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0 } = props;
|
|
29
|
+
let { arrowSize: arrowSize, targetRef: targetRef, overlayRef: overlayRef, arrowRef: arrowRef, scrollRef: scrollRef = overlayRef, placement: placement = 'bottom', containerPadding: containerPadding = 12, shouldFlip: shouldFlip = true, boundaryElement: boundaryElement = typeof document !== 'undefined' ? document.body : null, offset: offset = 0, crossOffset: crossOffset = 0, shouldUpdatePosition: shouldUpdatePosition = true, isOpen: isOpen = true, onClose: onClose, maxHeight: maxHeight, arrowBoundaryOffset: arrowBoundaryOffset = 0, getTargetRect: getTargetRect } = props;
|
|
30
30
|
let [position, setPosition] = (0, $jKzS8$useState)(null);
|
|
31
31
|
let deps = [
|
|
32
32
|
shouldUpdatePosition,
|
|
@@ -97,7 +97,8 @@ function $b3526bc71400be8d$export$d39e1813b3bdd0e1(props) {
|
|
|
97
97
|
crossOffset: crossOffset,
|
|
98
98
|
maxHeight: maxHeight,
|
|
99
99
|
arrowSize: arrowSize ?? (arrowRef?.current ? (0, $954926fb6168ae2a$export$4b834cebd9e5cebe)(arrowRef.current, true).width : 0),
|
|
100
|
-
arrowBoundaryOffset: arrowBoundaryOffset
|
|
100
|
+
arrowBoundaryOffset: arrowBoundaryOffset,
|
|
101
|
+
targetRect: getTargetRect?.(targetRef.current)
|
|
101
102
|
});
|
|
102
103
|
if (!position.position) return;
|
|
103
104
|
// Modify overlay styles directly so positioning happens immediately without the need of a second render
|