react-aria 3.49.0 → 3.51.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/index.cjs +15 -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/utils/domHelpers.cjs +1 -0
- package/dist/exports/private/utils/domHelpers.cjs.map +1 -1
- package/dist/exports/private/utils/domHelpers.js +2 -2
- package/dist/exports/private/utils/domHelpers.js.map +1 -1
- package/dist/exports/private/utils/domHelpers.mjs +2 -2
- package/dist/exports/private/utils/domHelpers.mjs.map +1 -1
- package/dist/exports/private/utils/platform.cjs +1 -0
- package/dist/exports/private/utils/platform.cjs.map +1 -1
- package/dist/exports/private/utils/platform.js +2 -2
- package/dist/exports/private/utils/platform.js.map +1 -1
- package/dist/exports/private/utils/platform.mjs +2 -2
- package/dist/exports/private/utils/platform.mjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs +1 -0
- package/dist/exports/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.js +2 -2
- package/dist/exports/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs +2 -2
- package/dist/exports/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/exports/useContextMenu.cjs +22 -0
- package/dist/exports/useContextMenu.cjs.map +1 -0
- package/dist/exports/useContextMenu.js +17 -0
- package/dist/exports/useContextMenu.js.map +1 -0
- package/dist/exports/useContextMenu.mjs +17 -0
- package/dist/exports/useContextMenu.mjs.map +1 -0
- package/dist/exports/usePreviewTrigger.cjs +22 -0
- package/dist/exports/usePreviewTrigger.cjs.map +1 -0
- package/dist/exports/usePreviewTrigger.js +17 -0
- package/dist/exports/usePreviewTrigger.js.map +1 -0
- package/dist/exports/usePreviewTrigger.mjs +17 -0
- package/dist/exports/usePreviewTrigger.mjs.map +1 -0
- package/dist/exports/useTokenField.cjs +27 -0
- package/dist/exports/useTokenField.cjs.map +1 -0
- package/dist/exports/useTokenField.js +19 -0
- package/dist/exports/useTokenField.js.map +1 -0
- package/dist/exports/useTokenField.mjs +19 -0
- package/dist/exports/useTokenField.mjs.map +1 -0
- package/dist/private/actiongroup/useActionGroup.cjs +24 -19
- package/dist/private/actiongroup/useActionGroup.cjs.map +1 -1
- package/dist/private/actiongroup/useActionGroup.js +24 -19
- package/dist/private/actiongroup/useActionGroup.js.map +1 -1
- package/dist/private/actiongroup/useActionGroup.mjs +24 -19
- package/dist/private/actiongroup/useActionGroup.mjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.cjs +18 -8
- package/dist/private/autocomplete/useAutocomplete.cjs.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.js +18 -8
- package/dist/private/autocomplete/useAutocomplete.js.map +1 -1
- package/dist/private/autocomplete/useAutocomplete.mjs +18 -8
- package/dist/private/autocomplete/useAutocomplete.mjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.cjs +2 -0
- package/dist/private/breadcrumbs/useBreadcrumbItem.cjs.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.js +2 -0
- package/dist/private/breadcrumbs/useBreadcrumbItem.js.map +1 -1
- package/dist/private/breadcrumbs/useBreadcrumbItem.mjs +2 -0
- 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 +2 -1
- package/dist/private/button/useButton.cjs.map +1 -1
- package/dist/private/button/useButton.js +2 -1
- package/dist/private/button/useButton.js.map +1 -1
- package/dist/private/button/useButton.mjs +2 -1
- package/dist/private/button/useButton.mjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.cjs +3 -0
- package/dist/private/button/useToggleButtonGroup.cjs.map +1 -1
- package/dist/private/button/useToggleButtonGroup.js +3 -0
- package/dist/private/button/useToggleButtonGroup.js.map +1 -1
- package/dist/private/button/useToggleButtonGroup.mjs +3 -0
- package/dist/private/button/useToggleButtonGroup.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 +3 -0
- package/dist/private/calendar/useCalendarCell.cjs.map +1 -1
- package/dist/private/calendar/useCalendarCell.js +3 -0
- package/dist/private/calendar/useCalendarCell.js.map +1 -1
- package/dist/private/calendar/useCalendarCell.mjs +3 -0
- package/dist/private/calendar/useCalendarCell.mjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.cjs +47 -52
- package/dist/private/calendar/useCalendarGrid.cjs.map +1 -1
- package/dist/private/calendar/useCalendarGrid.js +47 -52
- package/dist/private/calendar/useCalendarGrid.js.map +1 -1
- package/dist/private/calendar/useCalendarGrid.mjs +47 -52
- package/dist/private/calendar/useCalendarGrid.mjs.map +1 -1
- package/dist/private/calendar/useCalendarYearPicker.cjs +4 -4
- package/dist/private/calendar/useCalendarYearPicker.cjs.map +1 -1
- package/dist/private/calendar/useCalendarYearPicker.js +4 -4
- package/dist/private/calendar/useCalendarYearPicker.js.map +1 -1
- package/dist/private/calendar/useCalendarYearPicker.mjs +4 -4
- package/dist/private/calendar/useCalendarYearPicker.mjs.map +1 -1
- package/dist/private/calendar/useRangeCalendar.cjs +1 -0
- package/dist/private/calendar/useRangeCalendar.cjs.map +1 -1
- package/dist/private/calendar/useRangeCalendar.js +1 -0
- package/dist/private/calendar/useRangeCalendar.js.map +1 -1
- package/dist/private/calendar/useRangeCalendar.mjs +1 -0
- package/dist/private/calendar/useRangeCalendar.mjs.map +1 -1
- package/dist/private/calendar/utils.cjs.map +1 -1
- package/dist/private/calendar/utils.js.map +1 -1
- package/dist/private/calendar/utils.mjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.cjs +8 -3
- package/dist/private/collections/CollectionBuilder.cjs.map +1 -1
- package/dist/private/collections/CollectionBuilder.js +8 -3
- package/dist/private/collections/CollectionBuilder.js.map +1 -1
- package/dist/private/collections/CollectionBuilder.mjs +8 -3
- package/dist/private/collections/CollectionBuilder.mjs.map +1 -1
- package/dist/private/collections/Document.cjs +4 -0
- package/dist/private/collections/Document.cjs.map +1 -1
- package/dist/private/collections/Document.js +4 -0
- package/dist/private/collections/Document.js.map +1 -1
- package/dist/private/collections/Document.mjs +4 -0
- package/dist/private/collections/Document.mjs.map +1 -1
- package/dist/private/collections/Hidden.cjs +1 -0
- package/dist/private/collections/Hidden.cjs.map +1 -1
- package/dist/private/collections/Hidden.js +1 -0
- package/dist/private/collections/Hidden.js.map +1 -1
- package/dist/private/collections/Hidden.mjs +1 -0
- package/dist/private/collections/Hidden.mjs.map +1 -1
- package/dist/private/collections/useCachedChildren.cjs +1 -0
- package/dist/private/collections/useCachedChildren.cjs.map +1 -1
- package/dist/private/collections/useCachedChildren.js +1 -0
- package/dist/private/collections/useCachedChildren.js.map +1 -1
- package/dist/private/collections/useCachedChildren.mjs +1 -0
- package/dist/private/collections/useCachedChildren.mjs.map +1 -1
- package/dist/private/color/useColorArea.cjs +31 -34
- package/dist/private/color/useColorArea.cjs.map +1 -1
- package/dist/private/color/useColorArea.js +31 -34
- package/dist/private/color/useColorArea.js.map +1 -1
- package/dist/private/color/useColorArea.mjs +31 -34
- package/dist/private/color/useColorArea.mjs.map +1 -1
- package/dist/private/color/useColorSlider.cjs +4 -2
- package/dist/private/color/useColorSlider.cjs.map +1 -1
- package/dist/private/color/useColorSlider.js +4 -2
- package/dist/private/color/useColorSlider.js.map +1 -1
- package/dist/private/color/useColorSlider.mjs +4 -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 +16 -23
- package/dist/private/color/useColorWheel.cjs.map +1 -1
- package/dist/private/color/useColorWheel.js +16 -23
- package/dist/private/color/useColorWheel.js.map +1 -1
- package/dist/private/color/useColorWheel.mjs +16 -23
- package/dist/private/color/useColorWheel.mjs.map +1 -1
- package/dist/private/combobox/useComboBox.cjs +93 -28
- package/dist/private/combobox/useComboBox.cjs.map +1 -1
- package/dist/private/combobox/useComboBox.js +94 -28
- package/dist/private/combobox/useComboBox.js.map +1 -1
- package/dist/private/combobox/useComboBox.mjs +93 -28
- package/dist/private/combobox/useComboBox.mjs.map +1 -1
- package/dist/private/datepicker/useDateField.cjs +3 -6
- package/dist/private/datepicker/useDateField.cjs.map +1 -1
- package/dist/private/datepicker/useDateField.js +3 -6
- package/dist/private/datepicker/useDateField.js.map +1 -1
- package/dist/private/datepicker/useDateField.mjs +3 -6
- 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 +48 -27
- package/dist/private/datepicker/useDatePickerGroup.cjs.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.js +49 -28
- package/dist/private/datepicker/useDatePickerGroup.js.map +1 -1
- package/dist/private/datepicker/useDatePickerGroup.mjs +49 -28
- 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 +21 -16
- package/dist/private/datepicker/useDateSegment.cjs.map +1 -1
- package/dist/private/datepicker/useDateSegment.js +22 -17
- package/dist/private/datepicker/useDateSegment.js.map +1 -1
- package/dist/private/datepicker/useDateSegment.mjs +22 -17
- 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 +8 -1
- package/dist/private/dialog/useDialog.cjs.map +1 -1
- package/dist/private/dialog/useDialog.js +10 -1
- package/dist/private/dialog/useDialog.js.map +1 -1
- package/dist/private/dialog/useDialog.mjs +8 -1
- package/dist/private/dialog/useDialog.mjs.map +1 -1
- package/dist/private/dnd/DragManager.cjs +7 -2
- package/dist/private/dnd/DragManager.cjs.map +1 -1
- package/dist/private/dnd/DragManager.js +7 -2
- package/dist/private/dnd/DragManager.js.map +1 -1
- package/dist/private/dnd/DragManager.mjs +7 -2
- package/dist/private/dnd/DragManager.mjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.cjs +3 -1
- package/dist/private/dnd/useAutoScroll.cjs.map +1 -1
- package/dist/private/dnd/useAutoScroll.js +3 -1
- package/dist/private/dnd/useAutoScroll.js.map +1 -1
- package/dist/private/dnd/useAutoScroll.mjs +3 -1
- package/dist/private/dnd/useAutoScroll.mjs.map +1 -1
- package/dist/private/dnd/useDrag.cjs +4 -1
- package/dist/private/dnd/useDrag.cjs.map +1 -1
- package/dist/private/dnd/useDrag.js +4 -1
- package/dist/private/dnd/useDrag.js.map +1 -1
- package/dist/private/dnd/useDrag.mjs +4 -1
- package/dist/private/dnd/useDrag.mjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.cjs +4 -0
- package/dist/private/dnd/useDraggableItem.cjs.map +1 -1
- package/dist/private/dnd/useDraggableItem.js +4 -0
- package/dist/private/dnd/useDraggableItem.js.map +1 -1
- package/dist/private/dnd/useDraggableItem.mjs +4 -0
- package/dist/private/dnd/useDraggableItem.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 +4 -0
- package/dist/private/dnd/useDroppableCollection.cjs.map +1 -1
- package/dist/private/dnd/useDroppableCollection.js +4 -0
- package/dist/private/dnd/useDroppableCollection.js.map +1 -1
- package/dist/private/dnd/useDroppableCollection.mjs +4 -0
- package/dist/private/dnd/useDroppableCollection.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 +13 -3
- package/dist/private/dnd/utils.cjs.map +1 -1
- package/dist/private/dnd/utils.js +13 -3
- package/dist/private/dnd/utils.js.map +1 -1
- package/dist/private/dnd/utils.mjs +13 -3
- package/dist/private/dnd/utils.mjs.map +1 -1
- package/dist/private/focus/FocusScope.cjs +5 -3
- package/dist/private/focus/FocusScope.cjs.map +1 -1
- package/dist/private/focus/FocusScope.js +5 -4
- package/dist/private/focus/FocusScope.js.map +1 -1
- package/dist/private/focus/FocusScope.mjs +5 -3
- package/dist/private/focus/FocusScope.mjs.map +1 -1
- package/dist/private/focus/useFocusRing.cjs +2 -1
- package/dist/private/focus/useFocusRing.cjs.map +1 -1
- package/dist/private/focus/useFocusRing.js +2 -1
- package/dist/private/focus/useFocusRing.js.map +1 -1
- package/dist/private/focus/useFocusRing.mjs +2 -1
- package/dist/private/focus/useFocusRing.mjs.map +1 -1
- package/dist/private/form/useFormValidation.cjs +7 -1
- package/dist/private/form/useFormValidation.cjs.map +1 -1
- package/dist/private/form/useFormValidation.js +7 -1
- package/dist/private/form/useFormValidation.js.map +1 -1
- package/dist/private/form/useFormValidation.mjs +7 -1
- package/dist/private/form/useFormValidation.mjs.map +1 -1
- package/dist/private/grid/useGrid.cjs +3 -2
- package/dist/private/grid/useGrid.cjs.map +1 -1
- package/dist/private/grid/useGrid.js +3 -2
- package/dist/private/grid/useGrid.js.map +1 -1
- package/dist/private/grid/useGrid.mjs +3 -2
- package/dist/private/grid/useGrid.mjs.map +1 -1
- package/dist/private/grid/useGridCell.cjs +44 -8
- package/dist/private/grid/useGridCell.cjs.map +1 -1
- package/dist/private/grid/useGridCell.js +44 -8
- package/dist/private/grid/useGridCell.js.map +1 -1
- package/dist/private/grid/useGridCell.mjs +44 -8
- package/dist/private/grid/useGridCell.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 +74 -25
- package/dist/private/gridlist/useGridListItem.cjs.map +1 -1
- package/dist/private/gridlist/useGridListItem.js +75 -26
- package/dist/private/gridlist/useGridListItem.js.map +1 -1
- package/dist/private/gridlist/useGridListItem.mjs +74 -25
- package/dist/private/gridlist/useGridListItem.mjs.map +1 -1
- package/dist/private/interactions/PressResponder.cjs +1 -0
- package/dist/private/interactions/PressResponder.cjs.map +1 -1
- package/dist/private/interactions/PressResponder.js +1 -0
- package/dist/private/interactions/PressResponder.js.map +1 -1
- package/dist/private/interactions/PressResponder.mjs +1 -0
- package/dist/private/interactions/PressResponder.mjs.map +1 -1
- package/dist/private/interactions/Pressable.cjs +1 -0
- package/dist/private/interactions/Pressable.cjs.map +1 -1
- package/dist/private/interactions/Pressable.js +1 -0
- package/dist/private/interactions/Pressable.js.map +1 -1
- package/dist/private/interactions/Pressable.mjs +1 -0
- package/dist/private/interactions/Pressable.mjs.map +1 -1
- package/dist/private/interactions/createEventHandler.cjs +6 -2
- package/dist/private/interactions/createEventHandler.cjs.map +1 -1
- package/dist/private/interactions/createEventHandler.js +6 -2
- package/dist/private/interactions/createEventHandler.js.map +1 -1
- package/dist/private/interactions/createEventHandler.mjs +6 -2
- package/dist/private/interactions/createEventHandler.mjs.map +1 -1
- package/dist/private/interactions/createKeyboardShortcutHandler.cjs +130 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.cjs.map +1 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.js +125 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.js.map +1 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.mjs +125 -0
- package/dist/private/interactions/createKeyboardShortcutHandler.mjs.map +1 -0
- package/dist/private/interactions/textSelection.cjs +2 -2
- package/dist/private/interactions/textSelection.cjs.map +1 -1
- package/dist/private/interactions/textSelection.js +3 -3
- package/dist/private/interactions/textSelection.js.map +1 -1
- package/dist/private/interactions/textSelection.mjs +3 -3
- package/dist/private/interactions/textSelection.mjs.map +1 -1
- package/dist/private/interactions/useContextMenu.cjs +104 -0
- package/dist/private/interactions/useContextMenu.cjs.map +1 -0
- package/dist/private/interactions/useContextMenu.js +99 -0
- package/dist/private/interactions/useContextMenu.js.map +1 -0
- package/dist/private/interactions/useContextMenu.mjs +99 -0
- package/dist/private/interactions/useContextMenu.mjs.map +1 -0
- package/dist/private/interactions/useFocusVisible.cjs +18 -7
- package/dist/private/interactions/useFocusVisible.cjs.map +1 -1
- package/dist/private/interactions/useFocusVisible.js +18 -7
- package/dist/private/interactions/useFocusVisible.js.map +1 -1
- package/dist/private/interactions/useFocusVisible.mjs +18 -7
- package/dist/private/interactions/useFocusVisible.mjs.map +1 -1
- package/dist/private/interactions/useFocusable.cjs +1 -0
- package/dist/private/interactions/useFocusable.cjs.map +1 -1
- package/dist/private/interactions/useFocusable.js +1 -0
- package/dist/private/interactions/useFocusable.js.map +1 -1
- package/dist/private/interactions/useFocusable.mjs +1 -0
- package/dist/private/interactions/useFocusable.mjs.map +1 -1
- package/dist/private/interactions/useHover.cjs +2 -1
- package/dist/private/interactions/useHover.cjs.map +1 -1
- package/dist/private/interactions/useHover.js +2 -1
- package/dist/private/interactions/useHover.js.map +1 -1
- package/dist/private/interactions/useHover.mjs +2 -1
- package/dist/private/interactions/useHover.mjs.map +1 -1
- package/dist/private/interactions/useKeyboard.cjs +46 -2
- package/dist/private/interactions/useKeyboard.cjs.map +1 -1
- package/dist/private/interactions/useKeyboard.js +48 -2
- package/dist/private/interactions/useKeyboard.js.map +1 -1
- package/dist/private/interactions/useKeyboard.mjs +46 -2
- package/dist/private/interactions/useKeyboard.mjs.map +1 -1
- package/dist/private/interactions/useLongPress.cjs +22 -22
- package/dist/private/interactions/useLongPress.cjs.map +1 -1
- package/dist/private/interactions/useLongPress.js +22 -22
- package/dist/private/interactions/useLongPress.js.map +1 -1
- package/dist/private/interactions/useLongPress.mjs +22 -22
- package/dist/private/interactions/useLongPress.mjs.map +1 -1
- package/dist/private/interactions/useMove.cjs +1 -8
- package/dist/private/interactions/useMove.cjs.map +1 -1
- package/dist/private/interactions/useMove.js +1 -8
- package/dist/private/interactions/useMove.js.map +1 -1
- package/dist/private/interactions/useMove.mjs +1 -8
- package/dist/private/interactions/useMove.mjs.map +1 -1
- package/dist/private/interactions/usePress.cjs +18 -33
- package/dist/private/interactions/usePress.cjs.map +1 -1
- package/dist/private/interactions/usePress.js +18 -33
- package/dist/private/interactions/usePress.js.map +1 -1
- package/dist/private/interactions/usePress.mjs +18 -33
- package/dist/private/interactions/usePress.mjs.map +1 -1
- package/dist/private/interactions/utils.cjs +10 -10
- package/dist/private/interactions/utils.cjs.map +1 -1
- package/dist/private/interactions/utils.js +10 -10
- package/dist/private/interactions/utils.js.map +1 -1
- package/dist/private/interactions/utils.mjs +10 -10
- package/dist/private/interactions/utils.mjs.map +1 -1
- package/dist/private/intl/combobox/fi-FI.cjs +5 -5
- package/dist/private/intl/combobox/fi-FI.cjs.map +1 -1
- package/dist/private/intl/combobox/fi-FI.js +5 -5
- package/dist/private/intl/combobox/fi-FI.js.map +1 -1
- package/dist/private/intl/combobox/fi-FI.mjs +5 -5
- package/dist/private/intl/combobox/fi-FI.mjs.map +1 -1
- package/dist/private/intl/previewtrigger/ar-AE.cjs +6 -0
- package/dist/private/intl/previewtrigger/ar-AE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ar-AE.js +8 -0
- package/dist/private/intl/previewtrigger/ar-AE.js.map +1 -0
- package/dist/private/intl/previewtrigger/ar-AE.mjs +8 -0
- package/dist/private/intl/previewtrigger/ar-AE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/bg-BG.cjs +6 -0
- package/dist/private/intl/previewtrigger/bg-BG.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/bg-BG.js +8 -0
- package/dist/private/intl/previewtrigger/bg-BG.js.map +1 -0
- package/dist/private/intl/previewtrigger/bg-BG.mjs +8 -0
- package/dist/private/intl/previewtrigger/bg-BG.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/cs-CZ.cjs +6 -0
- package/dist/private/intl/previewtrigger/cs-CZ.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/cs-CZ.js +8 -0
- package/dist/private/intl/previewtrigger/cs-CZ.js.map +1 -0
- package/dist/private/intl/previewtrigger/cs-CZ.mjs +8 -0
- package/dist/private/intl/previewtrigger/cs-CZ.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/da-DK.cjs +6 -0
- package/dist/private/intl/previewtrigger/da-DK.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/da-DK.js +8 -0
- package/dist/private/intl/previewtrigger/da-DK.js.map +1 -0
- package/dist/private/intl/previewtrigger/da-DK.mjs +8 -0
- package/dist/private/intl/previewtrigger/da-DK.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/de-DE.cjs +6 -0
- package/dist/private/intl/previewtrigger/de-DE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/de-DE.js +8 -0
- package/dist/private/intl/previewtrigger/de-DE.js.map +1 -0
- package/dist/private/intl/previewtrigger/de-DE.mjs +8 -0
- package/dist/private/intl/previewtrigger/de-DE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/el-GR.cjs +6 -0
- package/dist/private/intl/previewtrigger/el-GR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/el-GR.js +8 -0
- package/dist/private/intl/previewtrigger/el-GR.js.map +1 -0
- package/dist/private/intl/previewtrigger/el-GR.mjs +8 -0
- package/dist/private/intl/previewtrigger/el-GR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/en-US.cjs +6 -0
- package/dist/private/intl/previewtrigger/en-US.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/en-US.js +8 -0
- package/dist/private/intl/previewtrigger/en-US.js.map +1 -0
- package/dist/private/intl/previewtrigger/en-US.mjs +8 -0
- package/dist/private/intl/previewtrigger/en-US.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/es-ES.cjs +6 -0
- package/dist/private/intl/previewtrigger/es-ES.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/es-ES.js +8 -0
- package/dist/private/intl/previewtrigger/es-ES.js.map +1 -0
- package/dist/private/intl/previewtrigger/es-ES.mjs +8 -0
- package/dist/private/intl/previewtrigger/es-ES.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/et-EE.cjs +6 -0
- package/dist/private/intl/previewtrigger/et-EE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/et-EE.js +8 -0
- package/dist/private/intl/previewtrigger/et-EE.js.map +1 -0
- package/dist/private/intl/previewtrigger/et-EE.mjs +8 -0
- package/dist/private/intl/previewtrigger/et-EE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/fi-FI.cjs +6 -0
- package/dist/private/intl/previewtrigger/fi-FI.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/fi-FI.js +8 -0
- package/dist/private/intl/previewtrigger/fi-FI.js.map +1 -0
- package/dist/private/intl/previewtrigger/fi-FI.mjs +8 -0
- package/dist/private/intl/previewtrigger/fi-FI.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/fr-FR.cjs +6 -0
- package/dist/private/intl/previewtrigger/fr-FR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/fr-FR.js +8 -0
- package/dist/private/intl/previewtrigger/fr-FR.js.map +1 -0
- package/dist/private/intl/previewtrigger/fr-FR.mjs +8 -0
- package/dist/private/intl/previewtrigger/fr-FR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/he-IL.cjs +6 -0
- package/dist/private/intl/previewtrigger/he-IL.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/he-IL.js +8 -0
- package/dist/private/intl/previewtrigger/he-IL.js.map +1 -0
- package/dist/private/intl/previewtrigger/he-IL.mjs +8 -0
- package/dist/private/intl/previewtrigger/he-IL.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/hr-HR.cjs +6 -0
- package/dist/private/intl/previewtrigger/hr-HR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/hr-HR.js +8 -0
- package/dist/private/intl/previewtrigger/hr-HR.js.map +1 -0
- package/dist/private/intl/previewtrigger/hr-HR.mjs +8 -0
- package/dist/private/intl/previewtrigger/hr-HR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/hu-HU.cjs +6 -0
- package/dist/private/intl/previewtrigger/hu-HU.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/hu-HU.js +8 -0
- package/dist/private/intl/previewtrigger/hu-HU.js.map +1 -0
- package/dist/private/intl/previewtrigger/hu-HU.mjs +8 -0
- package/dist/private/intl/previewtrigger/hu-HU.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/it-IT.cjs +6 -0
- package/dist/private/intl/previewtrigger/it-IT.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/it-IT.js +8 -0
- package/dist/private/intl/previewtrigger/it-IT.js.map +1 -0
- package/dist/private/intl/previewtrigger/it-IT.mjs +8 -0
- package/dist/private/intl/previewtrigger/it-IT.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ja-JP.cjs +6 -0
- package/dist/private/intl/previewtrigger/ja-JP.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ja-JP.js +8 -0
- package/dist/private/intl/previewtrigger/ja-JP.js.map +1 -0
- package/dist/private/intl/previewtrigger/ja-JP.mjs +8 -0
- package/dist/private/intl/previewtrigger/ja-JP.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ko-KR.cjs +6 -0
- package/dist/private/intl/previewtrigger/ko-KR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ko-KR.js +8 -0
- package/dist/private/intl/previewtrigger/ko-KR.js.map +1 -0
- package/dist/private/intl/previewtrigger/ko-KR.mjs +8 -0
- package/dist/private/intl/previewtrigger/ko-KR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/lt-LT.cjs +6 -0
- package/dist/private/intl/previewtrigger/lt-LT.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/lt-LT.js +8 -0
- package/dist/private/intl/previewtrigger/lt-LT.js.map +1 -0
- package/dist/private/intl/previewtrigger/lt-LT.mjs +8 -0
- package/dist/private/intl/previewtrigger/lt-LT.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/lv-LV.cjs +6 -0
- package/dist/private/intl/previewtrigger/lv-LV.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/lv-LV.js +8 -0
- package/dist/private/intl/previewtrigger/lv-LV.js.map +1 -0
- package/dist/private/intl/previewtrigger/lv-LV.mjs +8 -0
- package/dist/private/intl/previewtrigger/lv-LV.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/nb-NO.cjs +6 -0
- package/dist/private/intl/previewtrigger/nb-NO.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/nb-NO.js +8 -0
- package/dist/private/intl/previewtrigger/nb-NO.js.map +1 -0
- package/dist/private/intl/previewtrigger/nb-NO.mjs +8 -0
- package/dist/private/intl/previewtrigger/nb-NO.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/nl-NL.cjs +6 -0
- package/dist/private/intl/previewtrigger/nl-NL.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/nl-NL.js +8 -0
- package/dist/private/intl/previewtrigger/nl-NL.js.map +1 -0
- package/dist/private/intl/previewtrigger/nl-NL.mjs +8 -0
- package/dist/private/intl/previewtrigger/nl-NL.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/pl-PL.cjs +6 -0
- package/dist/private/intl/previewtrigger/pl-PL.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/pl-PL.js +8 -0
- package/dist/private/intl/previewtrigger/pl-PL.js.map +1 -0
- package/dist/private/intl/previewtrigger/pl-PL.mjs +8 -0
- package/dist/private/intl/previewtrigger/pl-PL.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-BR.cjs +6 -0
- package/dist/private/intl/previewtrigger/pt-BR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-BR.js +8 -0
- package/dist/private/intl/previewtrigger/pt-BR.js.map +1 -0
- package/dist/private/intl/previewtrigger/pt-BR.mjs +8 -0
- package/dist/private/intl/previewtrigger/pt-BR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-PT.cjs +6 -0
- package/dist/private/intl/previewtrigger/pt-PT.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/pt-PT.js +8 -0
- package/dist/private/intl/previewtrigger/pt-PT.js.map +1 -0
- package/dist/private/intl/previewtrigger/pt-PT.mjs +8 -0
- package/dist/private/intl/previewtrigger/pt-PT.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ro-RO.cjs +6 -0
- package/dist/private/intl/previewtrigger/ro-RO.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ro-RO.js +8 -0
- package/dist/private/intl/previewtrigger/ro-RO.js.map +1 -0
- package/dist/private/intl/previewtrigger/ro-RO.mjs +8 -0
- package/dist/private/intl/previewtrigger/ro-RO.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/ru-RU.cjs +6 -0
- package/dist/private/intl/previewtrigger/ru-RU.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/ru-RU.js +8 -0
- package/dist/private/intl/previewtrigger/ru-RU.js.map +1 -0
- package/dist/private/intl/previewtrigger/ru-RU.mjs +8 -0
- package/dist/private/intl/previewtrigger/ru-RU.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sk-SK.cjs +6 -0
- package/dist/private/intl/previewtrigger/sk-SK.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sk-SK.js +8 -0
- package/dist/private/intl/previewtrigger/sk-SK.js.map +1 -0
- package/dist/private/intl/previewtrigger/sk-SK.mjs +8 -0
- package/dist/private/intl/previewtrigger/sk-SK.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sl-SI.cjs +6 -0
- package/dist/private/intl/previewtrigger/sl-SI.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sl-SI.js +8 -0
- package/dist/private/intl/previewtrigger/sl-SI.js.map +1 -0
- package/dist/private/intl/previewtrigger/sl-SI.mjs +8 -0
- package/dist/private/intl/previewtrigger/sl-SI.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sr-SP.cjs +6 -0
- package/dist/private/intl/previewtrigger/sr-SP.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sr-SP.js +8 -0
- package/dist/private/intl/previewtrigger/sr-SP.js.map +1 -0
- package/dist/private/intl/previewtrigger/sr-SP.mjs +8 -0
- package/dist/private/intl/previewtrigger/sr-SP.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/sv-SE.cjs +6 -0
- package/dist/private/intl/previewtrigger/sv-SE.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/sv-SE.js +8 -0
- package/dist/private/intl/previewtrigger/sv-SE.js.map +1 -0
- package/dist/private/intl/previewtrigger/sv-SE.mjs +8 -0
- package/dist/private/intl/previewtrigger/sv-SE.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/tr-TR.cjs +6 -0
- package/dist/private/intl/previewtrigger/tr-TR.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/tr-TR.js +8 -0
- package/dist/private/intl/previewtrigger/tr-TR.js.map +1 -0
- package/dist/private/intl/previewtrigger/tr-TR.mjs +8 -0
- package/dist/private/intl/previewtrigger/tr-TR.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/uk-UA.cjs +6 -0
- package/dist/private/intl/previewtrigger/uk-UA.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/uk-UA.js +8 -0
- package/dist/private/intl/previewtrigger/uk-UA.js.map +1 -0
- package/dist/private/intl/previewtrigger/uk-UA.mjs +8 -0
- package/dist/private/intl/previewtrigger/uk-UA.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-CN.cjs +6 -0
- package/dist/private/intl/previewtrigger/zh-CN.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-CN.js +8 -0
- package/dist/private/intl/previewtrigger/zh-CN.js.map +1 -0
- package/dist/private/intl/previewtrigger/zh-CN.mjs +8 -0
- package/dist/private/intl/previewtrigger/zh-CN.mjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-TW.cjs +6 -0
- package/dist/private/intl/previewtrigger/zh-TW.cjs.map +1 -0
- package/dist/private/intl/previewtrigger/zh-TW.js +8 -0
- package/dist/private/intl/previewtrigger/zh-TW.js.map +1 -0
- package/dist/private/intl/previewtrigger/zh-TW.mjs +8 -0
- package/dist/private/intl/previewtrigger/zh-TW.mjs.map +1 -0
- package/dist/private/intl/table/ar-AE.cjs +3 -3
- package/dist/private/intl/table/ar-AE.cjs.map +1 -1
- package/dist/private/intl/table/ar-AE.js +3 -3
- package/dist/private/intl/table/ar-AE.js.map +1 -1
- package/dist/private/intl/table/ar-AE.mjs +3 -3
- package/dist/private/intl/table/ar-AE.mjs.map +1 -1
- package/dist/private/intl/table/bg-BG.cjs +3 -3
- package/dist/private/intl/table/bg-BG.cjs.map +1 -1
- package/dist/private/intl/table/bg-BG.js +3 -3
- package/dist/private/intl/table/bg-BG.js.map +1 -1
- package/dist/private/intl/table/bg-BG.mjs +3 -3
- package/dist/private/intl/table/bg-BG.mjs.map +1 -1
- package/dist/private/intl/table/cs-CZ.cjs +3 -3
- package/dist/private/intl/table/cs-CZ.cjs.map +1 -1
- package/dist/private/intl/table/cs-CZ.js +3 -3
- package/dist/private/intl/table/cs-CZ.js.map +1 -1
- package/dist/private/intl/table/cs-CZ.mjs +3 -3
- package/dist/private/intl/table/cs-CZ.mjs.map +1 -1
- package/dist/private/intl/table/da-DK.cjs +3 -3
- package/dist/private/intl/table/da-DK.cjs.map +1 -1
- package/dist/private/intl/table/da-DK.js +3 -3
- package/dist/private/intl/table/da-DK.js.map +1 -1
- package/dist/private/intl/table/da-DK.mjs +3 -3
- package/dist/private/intl/table/da-DK.mjs.map +1 -1
- package/dist/private/intl/table/de-DE.cjs +3 -3
- package/dist/private/intl/table/de-DE.cjs.map +1 -1
- package/dist/private/intl/table/de-DE.js +3 -3
- package/dist/private/intl/table/de-DE.js.map +1 -1
- package/dist/private/intl/table/de-DE.mjs +3 -3
- package/dist/private/intl/table/de-DE.mjs.map +1 -1
- package/dist/private/intl/table/el-GR.cjs +3 -3
- package/dist/private/intl/table/el-GR.cjs.map +1 -1
- package/dist/private/intl/table/el-GR.js +3 -3
- package/dist/private/intl/table/el-GR.js.map +1 -1
- package/dist/private/intl/table/el-GR.mjs +3 -3
- package/dist/private/intl/table/el-GR.mjs.map +1 -1
- package/dist/private/intl/table/es-ES.cjs +3 -3
- package/dist/private/intl/table/es-ES.cjs.map +1 -1
- package/dist/private/intl/table/es-ES.js +3 -3
- package/dist/private/intl/table/es-ES.js.map +1 -1
- package/dist/private/intl/table/es-ES.mjs +3 -3
- package/dist/private/intl/table/es-ES.mjs.map +1 -1
- package/dist/private/intl/table/et-EE.cjs +3 -3
- package/dist/private/intl/table/et-EE.cjs.map +1 -1
- package/dist/private/intl/table/et-EE.js +3 -3
- package/dist/private/intl/table/et-EE.js.map +1 -1
- package/dist/private/intl/table/et-EE.mjs +3 -3
- package/dist/private/intl/table/et-EE.mjs.map +1 -1
- package/dist/private/intl/table/fi-FI.cjs +3 -3
- package/dist/private/intl/table/fi-FI.cjs.map +1 -1
- package/dist/private/intl/table/fi-FI.js +3 -3
- package/dist/private/intl/table/fi-FI.js.map +1 -1
- package/dist/private/intl/table/fi-FI.mjs +3 -3
- package/dist/private/intl/table/fi-FI.mjs.map +1 -1
- package/dist/private/intl/table/fr-FR.cjs +3 -3
- package/dist/private/intl/table/fr-FR.cjs.map +1 -1
- package/dist/private/intl/table/fr-FR.js +3 -3
- package/dist/private/intl/table/fr-FR.js.map +1 -1
- package/dist/private/intl/table/fr-FR.mjs +3 -3
- package/dist/private/intl/table/fr-FR.mjs.map +1 -1
- package/dist/private/intl/table/he-IL.cjs +3 -3
- package/dist/private/intl/table/he-IL.cjs.map +1 -1
- package/dist/private/intl/table/he-IL.js +3 -3
- package/dist/private/intl/table/he-IL.js.map +1 -1
- package/dist/private/intl/table/he-IL.mjs +3 -3
- package/dist/private/intl/table/he-IL.mjs.map +1 -1
- package/dist/private/intl/table/hr-HR.cjs +3 -3
- package/dist/private/intl/table/hr-HR.cjs.map +1 -1
- package/dist/private/intl/table/hr-HR.js +3 -3
- package/dist/private/intl/table/hr-HR.js.map +1 -1
- package/dist/private/intl/table/hr-HR.mjs +3 -3
- package/dist/private/intl/table/hr-HR.mjs.map +1 -1
- package/dist/private/intl/table/hu-HU.cjs +3 -3
- package/dist/private/intl/table/hu-HU.cjs.map +1 -1
- package/dist/private/intl/table/hu-HU.js +3 -3
- package/dist/private/intl/table/hu-HU.js.map +1 -1
- package/dist/private/intl/table/hu-HU.mjs +3 -3
- package/dist/private/intl/table/hu-HU.mjs.map +1 -1
- package/dist/private/intl/table/it-IT.cjs +3 -3
- package/dist/private/intl/table/it-IT.cjs.map +1 -1
- package/dist/private/intl/table/it-IT.js +3 -3
- package/dist/private/intl/table/it-IT.js.map +1 -1
- package/dist/private/intl/table/it-IT.mjs +3 -3
- package/dist/private/intl/table/it-IT.mjs.map +1 -1
- package/dist/private/intl/table/ja-JP.cjs +3 -3
- package/dist/private/intl/table/ja-JP.cjs.map +1 -1
- package/dist/private/intl/table/ja-JP.js +3 -3
- package/dist/private/intl/table/ja-JP.js.map +1 -1
- package/dist/private/intl/table/ja-JP.mjs +3 -3
- package/dist/private/intl/table/ja-JP.mjs.map +1 -1
- package/dist/private/intl/table/ko-KR.cjs +3 -3
- package/dist/private/intl/table/ko-KR.cjs.map +1 -1
- package/dist/private/intl/table/ko-KR.js +3 -3
- package/dist/private/intl/table/ko-KR.js.map +1 -1
- package/dist/private/intl/table/ko-KR.mjs +3 -3
- package/dist/private/intl/table/ko-KR.mjs.map +1 -1
- package/dist/private/intl/table/lt-LT.cjs +3 -3
- package/dist/private/intl/table/lt-LT.cjs.map +1 -1
- package/dist/private/intl/table/lt-LT.js +3 -3
- package/dist/private/intl/table/lt-LT.js.map +1 -1
- package/dist/private/intl/table/lt-LT.mjs +3 -3
- package/dist/private/intl/table/lt-LT.mjs.map +1 -1
- package/dist/private/intl/table/lv-LV.cjs +3 -3
- package/dist/private/intl/table/lv-LV.cjs.map +1 -1
- package/dist/private/intl/table/lv-LV.js +3 -3
- package/dist/private/intl/table/lv-LV.js.map +1 -1
- package/dist/private/intl/table/lv-LV.mjs +3 -3
- package/dist/private/intl/table/lv-LV.mjs.map +1 -1
- package/dist/private/intl/table/nb-NO.cjs +3 -3
- package/dist/private/intl/table/nb-NO.cjs.map +1 -1
- package/dist/private/intl/table/nb-NO.js +3 -3
- package/dist/private/intl/table/nb-NO.js.map +1 -1
- package/dist/private/intl/table/nb-NO.mjs +3 -3
- package/dist/private/intl/table/nb-NO.mjs.map +1 -1
- package/dist/private/intl/table/nl-NL.cjs +3 -3
- package/dist/private/intl/table/nl-NL.cjs.map +1 -1
- package/dist/private/intl/table/nl-NL.js +3 -3
- package/dist/private/intl/table/nl-NL.js.map +1 -1
- package/dist/private/intl/table/nl-NL.mjs +3 -3
- package/dist/private/intl/table/nl-NL.mjs.map +1 -1
- package/dist/private/intl/table/pl-PL.cjs +3 -3
- package/dist/private/intl/table/pl-PL.cjs.map +1 -1
- package/dist/private/intl/table/pl-PL.js +3 -3
- package/dist/private/intl/table/pl-PL.js.map +1 -1
- package/dist/private/intl/table/pl-PL.mjs +3 -3
- package/dist/private/intl/table/pl-PL.mjs.map +1 -1
- package/dist/private/intl/table/pt-BR.cjs +3 -3
- package/dist/private/intl/table/pt-BR.cjs.map +1 -1
- package/dist/private/intl/table/pt-BR.js +3 -3
- package/dist/private/intl/table/pt-BR.js.map +1 -1
- package/dist/private/intl/table/pt-BR.mjs +3 -3
- package/dist/private/intl/table/pt-BR.mjs.map +1 -1
- package/dist/private/intl/table/pt-PT.cjs +3 -3
- package/dist/private/intl/table/pt-PT.cjs.map +1 -1
- package/dist/private/intl/table/pt-PT.js +3 -3
- package/dist/private/intl/table/pt-PT.js.map +1 -1
- package/dist/private/intl/table/pt-PT.mjs +3 -3
- package/dist/private/intl/table/pt-PT.mjs.map +1 -1
- package/dist/private/intl/table/ro-RO.cjs +3 -3
- package/dist/private/intl/table/ro-RO.cjs.map +1 -1
- package/dist/private/intl/table/ro-RO.js +3 -3
- package/dist/private/intl/table/ro-RO.js.map +1 -1
- package/dist/private/intl/table/ro-RO.mjs +3 -3
- package/dist/private/intl/table/ro-RO.mjs.map +1 -1
- package/dist/private/intl/table/ru-RU.cjs +3 -3
- package/dist/private/intl/table/ru-RU.cjs.map +1 -1
- package/dist/private/intl/table/ru-RU.js +3 -3
- package/dist/private/intl/table/ru-RU.js.map +1 -1
- package/dist/private/intl/table/ru-RU.mjs +3 -3
- package/dist/private/intl/table/ru-RU.mjs.map +1 -1
- package/dist/private/intl/table/sk-SK.cjs +3 -3
- package/dist/private/intl/table/sk-SK.cjs.map +1 -1
- package/dist/private/intl/table/sk-SK.js +3 -3
- package/dist/private/intl/table/sk-SK.js.map +1 -1
- package/dist/private/intl/table/sk-SK.mjs +3 -3
- package/dist/private/intl/table/sk-SK.mjs.map +1 -1
- package/dist/private/intl/table/sl-SI.cjs +3 -3
- package/dist/private/intl/table/sl-SI.cjs.map +1 -1
- package/dist/private/intl/table/sl-SI.js +3 -3
- package/dist/private/intl/table/sl-SI.js.map +1 -1
- package/dist/private/intl/table/sl-SI.mjs +3 -3
- package/dist/private/intl/table/sl-SI.mjs.map +1 -1
- package/dist/private/intl/table/sr-SP.cjs +3 -3
- package/dist/private/intl/table/sr-SP.cjs.map +1 -1
- package/dist/private/intl/table/sr-SP.js +3 -3
- package/dist/private/intl/table/sr-SP.js.map +1 -1
- package/dist/private/intl/table/sr-SP.mjs +3 -3
- package/dist/private/intl/table/sr-SP.mjs.map +1 -1
- package/dist/private/intl/table/sv-SE.cjs +3 -3
- package/dist/private/intl/table/sv-SE.cjs.map +1 -1
- package/dist/private/intl/table/sv-SE.js +3 -3
- package/dist/private/intl/table/sv-SE.js.map +1 -1
- package/dist/private/intl/table/sv-SE.mjs +3 -3
- package/dist/private/intl/table/sv-SE.mjs.map +1 -1
- package/dist/private/intl/table/tr-TR.cjs +3 -3
- package/dist/private/intl/table/tr-TR.cjs.map +1 -1
- package/dist/private/intl/table/tr-TR.js +3 -3
- package/dist/private/intl/table/tr-TR.js.map +1 -1
- package/dist/private/intl/table/tr-TR.mjs +3 -3
- package/dist/private/intl/table/tr-TR.mjs.map +1 -1
- package/dist/private/intl/table/uk-UA.cjs +3 -3
- package/dist/private/intl/table/uk-UA.cjs.map +1 -1
- package/dist/private/intl/table/uk-UA.js +3 -3
- package/dist/private/intl/table/uk-UA.js.map +1 -1
- package/dist/private/intl/table/uk-UA.mjs +3 -3
- package/dist/private/intl/table/uk-UA.mjs.map +1 -1
- package/dist/private/intl/table/zh-CN.cjs +4 -4
- package/dist/private/intl/table/zh-CN.cjs.map +1 -1
- package/dist/private/intl/table/zh-CN.js +4 -4
- package/dist/private/intl/table/zh-CN.js.map +1 -1
- package/dist/private/intl/table/zh-CN.mjs +4 -4
- package/dist/private/intl/table/zh-CN.mjs.map +1 -1
- package/dist/private/intl/table/zh-TW.cjs +3 -3
- package/dist/private/intl/table/zh-TW.cjs.map +1 -1
- package/dist/private/intl/table/zh-TW.js +3 -3
- package/dist/private/intl/table/zh-TW.js.map +1 -1
- package/dist/private/intl/table/zh-TW.mjs +3 -3
- package/dist/private/intl/table/zh-TW.mjs.map +1 -1
- package/dist/private/intl/tree/es-ES.cjs +1 -1
- package/dist/private/intl/tree/es-ES.cjs.map +1 -1
- package/dist/private/intl/tree/es-ES.js +1 -1
- package/dist/private/intl/tree/es-ES.js.map +1 -1
- package/dist/private/intl/tree/es-ES.mjs +1 -1
- package/dist/private/intl/tree/es-ES.mjs.map +1 -1
- package/dist/private/link/useLink.cjs +2 -1
- package/dist/private/link/useLink.cjs.map +1 -1
- package/dist/private/link/useLink.js +2 -1
- package/dist/private/link/useLink.js.map +1 -1
- package/dist/private/link/useLink.mjs +2 -1
- package/dist/private/link/useLink.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 +34 -34
- package/dist/private/menu/useMenuItem.cjs.map +1 -1
- package/dist/private/menu/useMenuItem.js +34 -34
- package/dist/private/menu/useMenuItem.js.map +1 -1
- package/dist/private/menu/useMenuItem.mjs +34 -34
- package/dist/private/menu/useMenuItem.mjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.cjs +96 -30
- package/dist/private/menu/useMenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useMenuTrigger.js +96 -30
- package/dist/private/menu/useMenuTrigger.js.map +1 -1
- package/dist/private/menu/useMenuTrigger.mjs +96 -30
- package/dist/private/menu/useMenuTrigger.mjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.cjs +44 -36
- package/dist/private/menu/useSubmenuTrigger.cjs.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.js +44 -36
- package/dist/private/menu/useSubmenuTrigger.js.map +1 -1
- package/dist/private/menu/useSubmenuTrigger.mjs +44 -36
- 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/numberfield/useNumberField.cjs +24 -19
- package/dist/private/numberfield/useNumberField.cjs.map +1 -1
- package/dist/private/numberfield/useNumberField.js +24 -19
- package/dist/private/numberfield/useNumberField.js.map +1 -1
- package/dist/private/numberfield/useNumberField.mjs +24 -19
- 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 +5 -1
- package/dist/private/overlays/Overlay.cjs.map +1 -1
- package/dist/private/overlays/Overlay.js +5 -1
- package/dist/private/overlays/Overlay.js.map +1 -1
- package/dist/private/overlays/Overlay.mjs +5 -1
- package/dist/private/overlays/Overlay.mjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.cjs +12 -8
- package/dist/private/overlays/ariaHideOutside.cjs.map +1 -1
- package/dist/private/overlays/ariaHideOutside.js +13 -9
- package/dist/private/overlays/ariaHideOutside.js.map +1 -1
- package/dist/private/overlays/ariaHideOutside.mjs +13 -9
- package/dist/private/overlays/ariaHideOutside.mjs.map +1 -1
- package/dist/private/overlays/calculatePosition.cjs +7 -7
- package/dist/private/overlays/calculatePosition.cjs.map +1 -1
- package/dist/private/overlays/calculatePosition.js +7 -7
- package/dist/private/overlays/calculatePosition.js.map +1 -1
- package/dist/private/overlays/calculatePosition.mjs +7 -7
- package/dist/private/overlays/calculatePosition.mjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.cjs +3 -4
- package/dist/private/overlays/useCloseOnScroll.cjs.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.js +4 -5
- package/dist/private/overlays/useCloseOnScroll.js.map +1 -1
- package/dist/private/overlays/useCloseOnScroll.mjs +4 -5
- package/dist/private/overlays/useCloseOnScroll.mjs.map +1 -1
- package/dist/private/overlays/useOverlay.cjs +13 -7
- package/dist/private/overlays/useOverlay.cjs.map +1 -1
- package/dist/private/overlays/useOverlay.js +13 -7
- package/dist/private/overlays/useOverlay.js.map +1 -1
- package/dist/private/overlays/useOverlay.mjs +13 -7
- package/dist/private/overlays/useOverlay.mjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.cjs +9 -2
- package/dist/private/overlays/useOverlayPosition.cjs.map +1 -1
- package/dist/private/overlays/useOverlayPosition.js +9 -2
- package/dist/private/overlays/useOverlayPosition.js.map +1 -1
- package/dist/private/overlays/useOverlayPosition.mjs +9 -2
- package/dist/private/overlays/useOverlayPosition.mjs.map +1 -1
- package/dist/private/overlays/usePopover.cjs +6 -2
- package/dist/private/overlays/usePopover.cjs.map +1 -1
- package/dist/private/overlays/usePopover.js +7 -2
- package/dist/private/overlays/usePopover.js.map +1 -1
- package/dist/private/overlays/usePopover.mjs +6 -2
- package/dist/private/overlays/usePopover.mjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.cjs +2 -5
- package/dist/private/overlays/usePreventScroll.cjs.map +1 -1
- package/dist/private/overlays/usePreventScroll.js +3 -6
- package/dist/private/overlays/usePreventScroll.js.map +1 -1
- package/dist/private/overlays/usePreventScroll.mjs +3 -6
- package/dist/private/overlays/usePreventScroll.mjs.map +1 -1
- package/dist/private/progress/useProgressBar.cjs +2 -1
- package/dist/private/progress/useProgressBar.cjs.map +1 -1
- package/dist/private/progress/useProgressBar.js +2 -1
- package/dist/private/progress/useProgressBar.js.map +1 -1
- package/dist/private/progress/useProgressBar.mjs +2 -1
- package/dist/private/progress/useProgressBar.mjs.map +1 -1
- package/dist/private/radio/useRadioGroup.cjs +26 -23
- package/dist/private/radio/useRadioGroup.cjs.map +1 -1
- package/dist/private/radio/useRadioGroup.js +26 -23
- package/dist/private/radio/useRadioGroup.js.map +1 -1
- package/dist/private/radio/useRadioGroup.mjs +26 -23
- package/dist/private/radio/useRadioGroup.mjs.map +1 -1
- package/dist/private/searchfield/useSearchField.cjs +28 -22
- package/dist/private/searchfield/useSearchField.cjs.map +1 -1
- package/dist/private/searchfield/useSearchField.js +28 -22
- package/dist/private/searchfield/useSearchField.js.map +1 -1
- package/dist/private/searchfield/useSearchField.mjs +28 -22
- package/dist/private/searchfield/useSearchField.mjs.map +1 -1
- package/dist/private/select/useSelect.cjs +22 -25
- package/dist/private/select/useSelect.cjs.map +1 -1
- package/dist/private/select/useSelect.js +24 -27
- package/dist/private/select/useSelect.js.map +1 -1
- package/dist/private/select/useSelect.mjs +22 -25
- package/dist/private/select/useSelect.mjs.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.cjs +31 -3
- package/dist/private/selection/ListKeyboardDelegate.cjs.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.js +31 -3
- package/dist/private/selection/ListKeyboardDelegate.js.map +1 -1
- package/dist/private/selection/ListKeyboardDelegate.mjs +31 -3
- package/dist/private/selection/ListKeyboardDelegate.mjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.cjs +222 -159
- package/dist/private/selection/useSelectableCollection.cjs.map +1 -1
- package/dist/private/selection/useSelectableCollection.js +232 -168
- package/dist/private/selection/useSelectableCollection.js.map +1 -1
- package/dist/private/selection/useSelectableCollection.mjs +222 -159
- package/dist/private/selection/useSelectableCollection.mjs.map +1 -1
- package/dist/private/selection/useSelectableItem.cjs +58 -13
- package/dist/private/selection/useSelectableItem.cjs.map +1 -1
- package/dist/private/selection/useSelectableItem.js +58 -13
- package/dist/private/selection/useSelectableItem.js.map +1 -1
- package/dist/private/selection/useSelectableItem.mjs +58 -13
- package/dist/private/selection/useSelectableItem.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/slider/useSlider.cjs.map +1 -1
- package/dist/private/slider/useSlider.js.map +1 -1
- package/dist/private/slider/useSlider.mjs.map +1 -1
- package/dist/private/slider/useSliderThumb.cjs +28 -26
- package/dist/private/slider/useSliderThumb.cjs.map +1 -1
- package/dist/private/slider/useSliderThumb.js +28 -26
- package/dist/private/slider/useSliderThumb.js.map +1 -1
- package/dist/private/slider/useSliderThumb.mjs +28 -26
- package/dist/private/slider/useSliderThumb.mjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.cjs +49 -34
- package/dist/private/spinbutton/useSpinButton.cjs.map +1 -1
- package/dist/private/spinbutton/useSpinButton.js +49 -34
- package/dist/private/spinbutton/useSpinButton.js.map +1 -1
- package/dist/private/spinbutton/useSpinButton.mjs +49 -34
- package/dist/private/spinbutton/useSpinButton.mjs.map +1 -1
- package/dist/private/ssr/SSRProvider.cjs +12 -3
- package/dist/private/ssr/SSRProvider.cjs.map +1 -1
- package/dist/private/ssr/SSRProvider.js +12 -3
- package/dist/private/ssr/SSRProvider.js.map +1 -1
- package/dist/private/ssr/SSRProvider.mjs +12 -3
- 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 +0 -9
- package/dist/private/steplist/useStepListItem.cjs.map +1 -1
- package/dist/private/steplist/useStepListItem.js +0 -10
- package/dist/private/steplist/useStepListItem.js.map +1 -1
- package/dist/private/steplist/useStepListItem.mjs +0 -9
- package/dist/private/steplist/useStepListItem.mjs.map +1 -1
- package/dist/private/table/useTable.cjs +4 -2
- package/dist/private/table/useTable.cjs.map +1 -1
- package/dist/private/table/useTable.js +4 -2
- package/dist/private/table/useTable.js.map +1 -1
- package/dist/private/table/useTable.mjs +4 -2
- package/dist/private/table/useTable.mjs.map +1 -1
- package/dist/private/table/useTableCell.cjs +2 -0
- package/dist/private/table/useTableCell.cjs.map +1 -1
- package/dist/private/table/useTableCell.js +2 -0
- package/dist/private/table/useTableCell.js.map +1 -1
- package/dist/private/table/useTableCell.mjs +2 -0
- package/dist/private/table/useTableCell.mjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.cjs +2 -3
- package/dist/private/table/useTableColumnHeader.cjs.map +1 -1
- package/dist/private/table/useTableColumnHeader.js +2 -3
- package/dist/private/table/useTableColumnHeader.js.map +1 -1
- package/dist/private/table/useTableColumnHeader.mjs +2 -3
- package/dist/private/table/useTableColumnHeader.mjs.map +1 -1
- package/dist/private/table/useTableColumnResize.cjs +32 -14
- package/dist/private/table/useTableColumnResize.cjs.map +1 -1
- package/dist/private/table/useTableColumnResize.js +33 -15
- package/dist/private/table/useTableColumnResize.js.map +1 -1
- package/dist/private/table/useTableColumnResize.mjs +33 -15
- package/dist/private/table/useTableColumnResize.mjs.map +1 -1
- package/dist/private/table/useTableRow.cjs +4 -2
- package/dist/private/table/useTableRow.cjs.map +1 -1
- package/dist/private/table/useTableRow.js +4 -2
- package/dist/private/table/useTableRow.js.map +1 -1
- package/dist/private/table/useTableRow.mjs +4 -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/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/tag/useTag.cjs +21 -11
- package/dist/private/tag/useTag.cjs.map +1 -1
- package/dist/private/tag/useTag.js +21 -11
- package/dist/private/tag/useTag.js.map +1 -1
- package/dist/private/tag/useTag.mjs +21 -11
- package/dist/private/tag/useTag.mjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.cjs +1 -0
- package/dist/private/textfield/useFormattedTextField.cjs.map +1 -1
- package/dist/private/textfield/useFormattedTextField.js +1 -0
- package/dist/private/textfield/useFormattedTextField.js.map +1 -1
- package/dist/private/textfield/useFormattedTextField.mjs +1 -0
- package/dist/private/textfield/useFormattedTextField.mjs.map +1 -1
- package/dist/private/toast/useToast.cjs.map +1 -1
- package/dist/private/toast/useToast.js.map +1 -1
- package/dist/private/toast/useToast.mjs.map +1 -1
- package/dist/private/toast/useToastRegion.cjs +5 -0
- package/dist/private/toast/useToastRegion.cjs.map +1 -1
- package/dist/private/toast/useToastRegion.js +5 -0
- package/dist/private/toast/useToastRegion.js.map +1 -1
- package/dist/private/toast/useToastRegion.mjs +5 -0
- package/dist/private/toast/useToastRegion.mjs.map +1 -1
- package/dist/private/toggle/useToggle.cjs +1 -0
- package/dist/private/toggle/useToggle.cjs.map +1 -1
- package/dist/private/toggle/useToggle.js +1 -0
- package/dist/private/toggle/useToggle.js.map +1 -1
- package/dist/private/toggle/useToggle.mjs +1 -0
- package/dist/private/toggle/useToggle.mjs.map +1 -1
- package/dist/private/tokenfield/useToken.cjs +46 -0
- package/dist/private/tokenfield/useToken.cjs.map +1 -0
- package/dist/private/tokenfield/useToken.js +41 -0
- package/dist/private/tokenfield/useToken.js.map +1 -0
- package/dist/private/tokenfield/useToken.mjs +41 -0
- package/dist/private/tokenfield/useToken.mjs.map +1 -0
- package/dist/private/tokenfield/useTokenField.cjs +587 -0
- package/dist/private/tokenfield/useTokenField.cjs.map +1 -0
- package/dist/private/tokenfield/useTokenField.js +590 -0
- package/dist/private/tokenfield/useTokenField.js.map +1 -0
- package/dist/private/tokenfield/useTokenField.mjs +579 -0
- package/dist/private/tokenfield/useTokenField.mjs.map +1 -0
- package/dist/private/toolbar/useToolbar.cjs +1 -1
- package/dist/private/toolbar/useToolbar.cjs.map +1 -1
- package/dist/private/toolbar/useToolbar.js +1 -1
- package/dist/private/toolbar/useToolbar.js.map +1 -1
- package/dist/private/toolbar/useToolbar.mjs +1 -1
- package/dist/private/toolbar/useToolbar.mjs.map +1 -1
- package/dist/private/tooltip/intlStrings.cjs +108 -0
- package/dist/private/tooltip/intlStrings.cjs.map +1 -0
- package/dist/private/tooltip/intlStrings.js +110 -0
- package/dist/private/tooltip/intlStrings.js.map +1 -0
- package/dist/private/tooltip/intlStrings.mjs +110 -0
- package/dist/private/tooltip/intlStrings.mjs.map +1 -0
- package/dist/private/tooltip/usePreviewTrigger.cjs +212 -0
- package/dist/private/tooltip/usePreviewTrigger.cjs.map +1 -0
- package/dist/private/tooltip/usePreviewTrigger.js +208 -0
- package/dist/private/tooltip/usePreviewTrigger.js.map +1 -0
- package/dist/private/tooltip/usePreviewTrigger.mjs +207 -0
- package/dist/private/tooltip/usePreviewTrigger.mjs.map +1 -0
- package/dist/private/tooltip/useSafeArea.cjs +134 -0
- package/dist/private/tooltip/useSafeArea.cjs.map +1 -0
- package/dist/private/tooltip/useSafeArea.js +130 -0
- package/dist/private/tooltip/useSafeArea.js.map +1 -0
- package/dist/private/tooltip/useSafeArea.mjs +129 -0
- package/dist/private/tooltip/useSafeArea.mjs.map +1 -0
- package/dist/private/tooltip/useTooltipTrigger.cjs +1 -0
- package/dist/private/tooltip/useTooltipTrigger.cjs.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.js +1 -0
- package/dist/private/tooltip/useTooltipTrigger.js.map +1 -1
- package/dist/private/tooltip/useTooltipTrigger.mjs +1 -0
- package/dist/private/tooltip/useTooltipTrigger.mjs.map +1 -1
- package/dist/private/tree/useTree.cjs +1 -0
- package/dist/private/tree/useTree.cjs.map +1 -1
- package/dist/private/tree/useTree.js +1 -0
- package/dist/private/tree/useTree.js.map +1 -1
- package/dist/private/tree/useTree.mjs +1 -0
- 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/domHelpers.cjs +43 -12
- package/dist/private/utils/domHelpers.cjs.map +1 -1
- package/dist/private/utils/domHelpers.js +45 -14
- package/dist/private/utils/domHelpers.js.map +1 -1
- package/dist/private/utils/domHelpers.mjs +43 -13
- package/dist/private/utils/domHelpers.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 +1 -1
- package/dist/private/utils/isVirtualEvent.cjs.map +1 -1
- package/dist/private/utils/isVirtualEvent.js +1 -1
- package/dist/private/utils/isVirtualEvent.js.map +1 -1
- package/dist/private/utils/isVirtualEvent.mjs +1 -1
- package/dist/private/utils/isVirtualEvent.mjs.map +1 -1
- package/dist/private/utils/openLink.cjs +4 -2
- package/dist/private/utils/openLink.cjs.map +1 -1
- package/dist/private/utils/openLink.js +4 -2
- package/dist/private/utils/openLink.js.map +1 -1
- package/dist/private/utils/openLink.mjs +4 -2
- package/dist/private/utils/openLink.mjs.map +1 -1
- package/dist/private/utils/platform.cjs +8 -4
- package/dist/private/utils/platform.cjs.map +1 -1
- package/dist/private/utils/platform.js +7 -4
- package/dist/private/utils/platform.js.map +1 -1
- package/dist/private/utils/platform.mjs +7 -4
- package/dist/private/utils/platform.mjs.map +1 -1
- package/dist/private/utils/scrollIntoView.cjs +3 -3
- package/dist/private/utils/scrollIntoView.cjs.map +1 -1
- package/dist/private/utils/scrollIntoView.js +4 -4
- package/dist/private/utils/scrollIntoView.js.map +1 -1
- package/dist/private/utils/scrollIntoView.mjs +4 -4
- package/dist/private/utils/scrollIntoView.mjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.cjs +28 -1
- package/dist/private/utils/shadowdom/DOMFunctions.cjs.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.js +30 -2
- package/dist/private/utils/shadowdom/DOMFunctions.js.map +1 -1
- package/dist/private/utils/shadowdom/DOMFunctions.mjs +28 -2
- package/dist/private/utils/shadowdom/DOMFunctions.mjs.map +1 -1
- package/dist/private/utils/useDeepMemo.cjs +4 -1
- package/dist/private/utils/useDeepMemo.cjs.map +1 -1
- package/dist/private/utils/useDeepMemo.js +4 -1
- package/dist/private/utils/useDeepMemo.js.map +1 -1
- package/dist/private/utils/useDeepMemo.mjs +4 -1
- package/dist/private/utils/useDeepMemo.mjs.map +1 -1
- package/dist/private/utils/useDrag1D.cjs +2 -0
- package/dist/private/utils/useDrag1D.cjs.map +1 -1
- package/dist/private/utils/useDrag1D.js +2 -0
- package/dist/private/utils/useDrag1D.js.map +1 -1
- package/dist/private/utils/useDrag1D.mjs +2 -0
- package/dist/private/utils/useDrag1D.mjs.map +1 -1
- package/dist/private/utils/useFormReset.cjs +4 -0
- package/dist/private/utils/useFormReset.cjs.map +1 -1
- package/dist/private/utils/useFormReset.js +4 -0
- package/dist/private/utils/useFormReset.js.map +1 -1
- package/dist/private/utils/useFormReset.mjs +4 -0
- package/dist/private/utils/useFormReset.mjs.map +1 -1
- package/dist/private/utils/useId.cjs +23 -4
- package/dist/private/utils/useId.cjs.map +1 -1
- package/dist/private/utils/useId.js +23 -4
- package/dist/private/utils/useId.js.map +1 -1
- package/dist/private/utils/useId.mjs +23 -4
- package/dist/private/utils/useId.mjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.cjs +7 -3
- package/dist/private/utils/useLoadMoreSentinel.cjs.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.js +7 -3
- package/dist/private/utils/useLoadMoreSentinel.js.map +1 -1
- package/dist/private/utils/useLoadMoreSentinel.mjs +7 -3
- package/dist/private/utils/useLoadMoreSentinel.mjs.map +1 -1
- package/dist/private/utils/useObjectRef.cjs +3 -1
- package/dist/private/utils/useObjectRef.cjs.map +1 -1
- package/dist/private/utils/useObjectRef.js +3 -1
- package/dist/private/utils/useObjectRef.js.map +1 -1
- package/dist/private/utils/useObjectRef.mjs +3 -1
- package/dist/private/utils/useObjectRef.mjs.map +1 -1
- package/dist/private/utils/useSyncRef.cjs +2 -0
- package/dist/private/utils/useSyncRef.cjs.map +1 -1
- package/dist/private/utils/useSyncRef.js +2 -0
- package/dist/private/utils/useSyncRef.js.map +1 -1
- package/dist/private/utils/useSyncRef.mjs +2 -0
- package/dist/private/utils/useSyncRef.mjs.map +1 -1
- package/dist/private/utils/useViewportSize.cjs +3 -3
- package/dist/private/utils/useViewportSize.cjs.map +1 -1
- package/dist/private/utils/useViewportSize.js +4 -4
- package/dist/private/utils/useViewportSize.js.map +1 -1
- package/dist/private/utils/useViewportSize.mjs +4 -4
- package/dist/private/utils/useViewportSize.mjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.cjs +7 -4
- package/dist/private/virtualizer/ScrollView.cjs.map +1 -1
- package/dist/private/virtualizer/ScrollView.js +8 -5
- package/dist/private/virtualizer/ScrollView.js.map +1 -1
- package/dist/private/virtualizer/ScrollView.mjs +8 -5
- package/dist/private/virtualizer/ScrollView.mjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.cjs +3 -2
- package/dist/private/virtualizer/VirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.js +3 -2
- package/dist/private/virtualizer/VirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/VirtualizerItem.mjs +3 -2
- package/dist/private/virtualizer/VirtualizerItem.mjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.cjs +35 -2
- package/dist/private/virtualizer/useVirtualizerItem.cjs.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.js +36 -3
- package/dist/private/virtualizer/useVirtualizerItem.js.map +1 -1
- package/dist/private/virtualizer/useVirtualizerItem.mjs +36 -3
- package/dist/private/virtualizer/useVirtualizerItem.mjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.cjs +2 -1
- package/dist/private/visually-hidden/VisuallyHidden.cjs.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.js +2 -1
- package/dist/private/visually-hidden/VisuallyHidden.js.map +1 -1
- package/dist/private/visually-hidden/VisuallyHidden.mjs +2 -1
- package/dist/private/visually-hidden/VisuallyHidden.mjs.map +1 -1
- package/dist/types/exports/index.d.ts +9 -0
- package/dist/types/exports/private/utils/domHelpers.d.ts +1 -1
- package/dist/types/exports/private/utils/platform.d.ts +1 -1
- package/dist/types/exports/private/utils/shadowdom/DOMFunctions.d.ts +1 -1
- package/dist/types/exports/useContextMenu.d.ts +2 -0
- package/dist/types/exports/usePreviewTrigger.d.ts +2 -0
- package/dist/types/exports/useTokenField.d.ts +4 -0
- package/dist/types/src/button/useToggleButtonGroup.d.ts +8 -0
- package/dist/types/src/combobox/useComboBox.d.ts +7 -1
- package/dist/types/src/dialog/useDialog.d.ts +2 -0
- package/dist/types/src/dnd/utils.d.ts +2 -2
- package/dist/types/src/grid/useGrid.d.ts +7 -0
- package/dist/types/src/grid/useGridCell.d.ts +8 -1
- package/dist/types/src/grid/utils.d.ts +1 -0
- package/dist/types/src/gridlist/useGridList.d.ts +7 -0
- package/dist/types/src/gridlist/useGridListItem.d.ts +13 -0
- package/dist/types/src/interactions/createKeyboardShortcutHandler.d.ts +56 -0
- package/dist/types/src/interactions/useContextMenu.d.ts +21 -0
- package/dist/types/src/interactions/useKeyboard.d.ts +7 -0
- package/dist/types/src/interactions/useLongPress.d.ts +2 -0
- package/dist/types/src/menu/useMenu.d.ts +1 -1
- package/dist/types/src/menu/utils.d.ts +1 -1
- package/dist/types/src/overlays/calculatePosition.d.ts +1 -0
- package/dist/types/src/overlays/useOverlayPosition.d.ts +8 -0
- package/dist/types/src/overlays/usePopover.d.ts +2 -1
- package/dist/types/src/selection/ListKeyboardDelegate.d.ts +1 -0
- package/dist/types/src/selection/useSelectableCollection.d.ts +7 -0
- package/dist/types/src/table/useTableCell.d.ts +12 -0
- package/dist/types/src/table/useTableColumnHeader.d.ts +12 -0
- package/dist/types/src/table/useTableColumnResize.d.ts +5 -0
- package/dist/types/src/tokenfield/useToken.d.ts +14 -0
- package/dist/types/src/tokenfield/useTokenField.d.ts +57 -0
- package/dist/types/src/tooltip/usePreviewTrigger.d.ts +27 -0
- package/dist/types/src/tooltip/useSafeArea.d.ts +26 -0
- package/dist/types/src/tree/useTree.d.ts +1 -1
- package/dist/types/src/utils/domHelpers.d.ts +20 -5
- package/dist/types/src/utils/platform.d.ts +1 -0
- package/dist/types/src/utils/shadowdom/DOMFunctions.d.ts +11 -0
- package/dist/types/src/utils/useLoadMoreSentinel.d.ts +7 -0
- package/dist/types/src/virtualizer/VirtualizerItem.d.ts +1 -0
- package/dist/types/src/virtualizer/useVirtualizerItem.d.ts +1 -0
- package/i18n/ar-AE.js +1 -1
- package/i18n/ar-AE.mjs +1 -1
- package/i18n/bg-BG.js +1 -1
- package/i18n/bg-BG.mjs +1 -1
- package/i18n/cs-CZ.js +1 -1
- package/i18n/cs-CZ.mjs +1 -1
- package/i18n/da-DK.js +1 -1
- package/i18n/da-DK.mjs +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/i18n/el-GR.js +1 -1
- package/i18n/el-GR.mjs +1 -1
- package/i18n/en-US.js +1 -1
- package/i18n/en-US.mjs +1 -1
- package/i18n/es-ES.js +1 -1
- package/i18n/es-ES.mjs +1 -1
- package/i18n/et-EE.js +1 -1
- package/i18n/et-EE.mjs +1 -1
- package/i18n/fi-FI.js +1 -1
- package/i18n/fi-FI.mjs +1 -1
- package/i18n/fr-FR.js +1 -1
- package/i18n/fr-FR.mjs +1 -1
- package/i18n/he-IL.js +1 -1
- package/i18n/he-IL.mjs +1 -1
- package/i18n/hr-HR.js +1 -1
- package/i18n/hr-HR.mjs +1 -1
- package/i18n/hu-HU.js +1 -1
- package/i18n/hu-HU.mjs +1 -1
- package/i18n/it-IT.js +1 -1
- package/i18n/it-IT.mjs +1 -1
- package/i18n/ja-JP.js +1 -1
- package/i18n/ja-JP.mjs +1 -1
- package/i18n/ko-KR.js +1 -1
- package/i18n/ko-KR.mjs +1 -1
- package/i18n/lt-LT.js +1 -1
- package/i18n/lt-LT.mjs +1 -1
- package/i18n/lv-LV.js +1 -1
- package/i18n/lv-LV.mjs +1 -1
- package/i18n/nb-NO.js +1 -1
- package/i18n/nb-NO.mjs +1 -1
- package/i18n/nl-NL.js +1 -1
- package/i18n/nl-NL.mjs +1 -1
- package/i18n/pl-PL.js +1 -1
- package/i18n/pl-PL.mjs +1 -1
- package/i18n/pt-BR.js +1 -1
- package/i18n/pt-BR.mjs +1 -1
- package/i18n/pt-PT.js +1 -1
- package/i18n/pt-PT.mjs +1 -1
- package/i18n/ro-RO.js +1 -1
- package/i18n/ro-RO.mjs +1 -1
- package/i18n/ru-RU.js +1 -1
- package/i18n/ru-RU.mjs +1 -1
- package/i18n/sk-SK.js +1 -1
- package/i18n/sk-SK.mjs +1 -1
- package/i18n/sl-SI.js +1 -1
- package/i18n/sl-SI.mjs +1 -1
- package/i18n/sr-SP.js +1 -1
- package/i18n/sr-SP.mjs +1 -1
- package/i18n/sv-SE.js +1 -1
- package/i18n/sv-SE.mjs +1 -1
- package/i18n/tr-TR.js +1 -1
- package/i18n/tr-TR.mjs +1 -1
- package/i18n/uk-UA.js +1 -1
- package/i18n/uk-UA.mjs +1 -1
- package/i18n/zh-CN.js +1 -1
- package/i18n/zh-CN.mjs +1 -1
- package/i18n/zh-TW.js +1 -1
- package/i18n/zh-TW.mjs +1 -1
- package/package.json +6 -6
- package/useContextMenu/package.json +5 -0
- package/usePreviewTrigger/package.json +5 -0
- package/useTokenField/package.json +5 -0
|
@@ -62,6 +62,7 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
62
62
|
// Tracks if a collection has been connected to the autocomplete. If false, we don't want to add various attributes to the autocomplete input
|
|
63
63
|
// since it isn't attached to a filterable collection (e.g. Tabs)
|
|
64
64
|
let [hasCollection, setHasCollection] = (0, $8FiQn$useState)(false);
|
|
65
|
+
let [autoFocusOnMount, setAutoFocusOnMount] = (0, $8FiQn$useState)(false);
|
|
65
66
|
(0, $8FiQn$useEffect)(()=>{
|
|
66
67
|
return ()=>clearTimeout(timeout.current);
|
|
67
68
|
}, []);
|
|
@@ -114,12 +115,17 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
114
115
|
collectionNode
|
|
115
116
|
]);
|
|
116
117
|
// Make sure to memo so that React doesn't keep registering a new event listeners on every rerender of the wrapped collection
|
|
117
|
-
let mergedCollectionRef = (0, $5f169cf7bc5a96a9$export$4338b53315abf666)(
|
|
118
|
+
let mergedCollectionRef = (0, $5f169cf7bc5a96a9$export$4338b53315abf666)(// oxlint-disable-next-line react/react-compiler
|
|
119
|
+
(0, $8FiQn$useMemo)(()=>(0, $d49e67a55e1d0418$export$c9058316764c140e)(collectionRef, callbackRef), [
|
|
118
120
|
collectionRef,
|
|
119
121
|
callbackRef
|
|
120
122
|
]));
|
|
121
123
|
let focusFirstItem = (0, $8FiQn$useCallback)(()=>{
|
|
122
124
|
var _collectionRef_current;
|
|
125
|
+
if (!collectionRef.current) {
|
|
126
|
+
setAutoFocusOnMount(true);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
123
129
|
delayNextActiveDescendant.current = true;
|
|
124
130
|
(_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dispatchEvent(new CustomEvent((0, $7376cba1b89d16ef$export$831c820ad60f9d12), {
|
|
125
131
|
cancelable: true,
|
|
@@ -133,6 +139,7 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
133
139
|
]);
|
|
134
140
|
let clearVirtualFocus = (0, $8FiQn$useCallback)((clearFocusKey)=>{
|
|
135
141
|
var _collectionRef_current;
|
|
142
|
+
setAutoFocusOnMount(false);
|
|
136
143
|
(0, $57a86975180d30a8$export$76e4e37e5339496d)((0, $d8ac7ed472840322$export$cd4e5573fbe2b576)());
|
|
137
144
|
queuedActiveDescendant.current = null;
|
|
138
145
|
state.setFocusedNodeId(null);
|
|
@@ -151,14 +158,16 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
151
158
|
state
|
|
152
159
|
]);
|
|
153
160
|
let lastInputType = (0, $8FiQn$useRef)('');
|
|
154
|
-
(0, $c3cab330536504ec$export$90fc3a17d93f704c)(inputRef, '
|
|
161
|
+
(0, $c3cab330536504ec$export$90fc3a17d93f704c)(inputRef, 'beforeinput', (e)=>{
|
|
155
162
|
let { inputType: inputType } = e;
|
|
156
163
|
lastInputType.current = inputType;
|
|
157
164
|
});
|
|
158
165
|
let onChange = (value)=>{
|
|
159
166
|
// Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via
|
|
160
167
|
// copy paste/backspacing/undo/redo for screen reader announcements
|
|
161
|
-
if (lastInputType.current === 'insertText'
|
|
168
|
+
if ((lastInputType.current === 'insertText' || // IME composition (e.g. CJK input) reports 'insertCompositionText'/'insertFromComposition'
|
|
169
|
+
// instead of 'insertText'. Treat these as forward typing so the first item gets virtual focus.
|
|
170
|
+
lastInputType.current === 'insertCompositionText' || lastInputType.current === 'insertFromComposition') && !disableAutoFocusFirst) focusFirstItem();
|
|
162
171
|
else if (lastInputType.current && (lastInputType.current.includes('insert') || lastInputType.current.includes('delete') || lastInputType.current.includes('history'))) {
|
|
163
172
|
clearVirtualFocus(true);
|
|
164
173
|
// If onChange was triggered before the timeout actually updated the activedescendant, we need to fire
|
|
@@ -213,7 +222,7 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
213
222
|
// to the wrapped collection if there is a focused node so that a user can continue moving the
|
|
214
223
|
// virtual focus. However, if the user doesn't have a focus in the collection, just move the text
|
|
215
224
|
// cursor instead. They can move focus down into the collection via down/up arrow if need be
|
|
216
|
-
if (
|
|
225
|
+
if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
|
|
217
226
|
if (focusedNodeId == null) {
|
|
218
227
|
if (!e.isPropagationStopped()) e.stopPropagation();
|
|
219
228
|
return;
|
|
@@ -337,11 +346,11 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
337
346
|
onFocus: onFocus,
|
|
338
347
|
onPointerDown: onPointerDown
|
|
339
348
|
};
|
|
340
|
-
|
|
349
|
+
inputProps = {
|
|
341
350
|
...inputProps,
|
|
342
|
-
...shouldUseVirtualFocus && virtualFocusProps,
|
|
351
|
+
...shouldUseVirtualFocus && hasCollection && virtualFocusProps,
|
|
343
352
|
enterKeyHint: 'go',
|
|
344
|
-
'aria-controls': collectionId,
|
|
353
|
+
'aria-controls': hasCollection ? collectionId : undefined,
|
|
345
354
|
// TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)
|
|
346
355
|
'aria-autocomplete': 'list',
|
|
347
356
|
// This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.
|
|
@@ -354,7 +363,8 @@ function $e9f66e10c06d1e5c$export$1e40b3ca02d92d21(props, state) {
|
|
|
354
363
|
inputProps: inputProps,
|
|
355
364
|
collectionProps: (0, $64c36edd757dfa16$export$9d1611c77c2fe928)(collectionProps, {
|
|
356
365
|
shouldUseVirtualFocus: shouldUseVirtualFocus,
|
|
357
|
-
disallowTypeAhead: shouldUseVirtualFocus
|
|
366
|
+
disallowTypeAhead: shouldUseVirtualFocus,
|
|
367
|
+
autoFocus: autoFocusOnMount ? 'first' : false
|
|
358
368
|
}),
|
|
359
369
|
collectionRef: mergedCollectionRef,
|
|
360
370
|
filter: filter != null ? filterFn : undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAuIM,SAAS,0CACd,KAAiC,EACjC,KAAwB;IAExB,IAAI,YACF,QAAQ,iBACR,aAAa,UACb,MAAM,yBACN,wBAAwB,4BACxB,sBAAsB,OACvB,GAAG;IAEJ,IAAI,eAAe,CAAA,GAAA,yCAAI;IACvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAA6C;IAChE,IAAI,4BAA4B,CAAA,GAAA,aAAK,EAAE;IACvC,IAAI,yBAAyB,CAAA,GAAA,aAAK,EAAiB;IAEnD,2HAA2H;IAC3H,uCAAuC;IACvC,IAAI,uBAAuB,CAAA,GAAA,yCAAqB,QAAQ,aAAc,CAAA,CAAA,GAAA,yCAAI,OAAO,CAAA,GAAA,yCAAQ,GAAE;IAC3F,IAAI,CAAC,uBAAuB,yBAAyB,GAAG,CAAA,GAAA,eAAO,EAC7D,CAAC,wBAAwB,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,yBAAyB,iBAAiB;QAC9C,cAAc;QACd,iBAAiB;QACjB,mFAAmF;QACnF,qBAAqB;QACrB,qGAAqG;QACrG,aAAa;QACb,gEAAgE;QAChE,YAAY;QACZ,cAAc;IAChB;IAGF,OAAO;oBACL;QACA,iBAAiB,CAAA,GAAA,yCAAS,EAAE,iBAAiB;mCAC3C;YACA,mBAAmB;QACrB;QACA,eAAe;QACf,QAAQ,UAAU,OAAO,WAAW;IACtC;AACF","sources":["packages/react-aria/src/autocomplete/useAutocomplete.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n AriaLabelingProps,\n BaseEvent,\n DOMProps,\n FocusableElement,\n FocusEvents,\n KeyboardEvents,\n Node,\n RefObject,\n ValueBase\n} from '@react-types/shared';\nimport {AriaTextFieldProps} from '../textfield/useTextField';\nimport {\n AutocompleteProps,\n AutocompleteState\n} from 'react-stately/private/autocomplete/useAutocompleteState';\nimport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from '../utils/constants';\nimport {\n dispatchVirtualBlur,\n dispatchVirtualFocus,\n getVirtuallyFocusedElement,\n moveVirtualFocus\n} from '../focus/virtualFocus';\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {getInteractionModality, getPointerType} from '../interactions/useFocusVisible';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport intlMessages from '../../intl/autocomplete/*.json';\nimport {isAndroid, isIOS} from '../utils/platform';\nimport {isCtrlKeyPressed} from '../utils/keyboard';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport {\n FocusEvent as ReactFocusEvent,\n KeyboardEvent as ReactKeyboardEvent,\n PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {useEffectEvent} from '../utils/useEffectEvent';\nimport {useEvent} from '../utils/useEvent';\n\nimport {useId} from '../utils/useId';\n\nimport {useLabels} from '../utils/useLabels';\n// @ts-ignore\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useObjectRef} from '../utils/useObjectRef';\n\nexport interface CollectionOptions extends DOMProps, AriaLabelingProps {\n /** Whether the collection items should use virtual focus instead of being focused directly. */\n shouldUseVirtualFocus: boolean;\n /** Whether typeahead is disabled. */\n disallowTypeAhead: boolean;\n}\n\nexport interface InputProps<T = FocusableElement>\n extends\n DOMProps,\n FocusEvents<T>,\n KeyboardEvents,\n Pick<ValueBase<string>, 'onChange' | 'value'>,\n Pick<\n AriaTextFieldProps,\n | 'enterKeyHint'\n | 'aria-controls'\n | 'aria-autocomplete'\n | 'aria-activedescendant'\n | 'spellCheck'\n | 'autoCorrect'\n | 'autoComplete'\n > {}\n\nexport interface AriaAutocompleteProps<T> extends AutocompleteProps {\n /**\n * An optional filter function used to determine if a option should be included in the\n * autocomplete list. Include this if the items you are providing to your wrapped collection\n * aren't filtered by default.\n */\n filter?: (textValue: string, inputValue: string, node: Node<T>) => boolean;\n\n /**\n * Whether or not to focus the first item in the collection after a filter is performed. Note this\n * is only applicable if virtual focus behavior is not turned off via `disableVirtualFocus`.\n *\n * @default false\n */\n disableAutoFocusFirst?: boolean;\n\n /**\n * Whether the autocomplete should disable virtual focus, instead making the wrapped collection\n * directly tabbable.\n *\n * @default false\n */\n disableVirtualFocus?: boolean;\n}\n\nexport interface AriaAutocompleteOptions<T> extends Omit<AriaAutocompleteProps<T>, 'children'> {\n /** The ref for the wrapped collection element. */\n inputRef: RefObject<HTMLInputElement | null>;\n /** The ref for the wrapped collection element. */\n collectionRef: RefObject<HTMLElement | null>;\n}\n\nexport interface AutocompleteAria<T> {\n /**\n * Props for the autocomplete input element. These should be passed to the input's aria hooks\n * (e.g. useTextField/useSearchField/etc) respectively.\n */\n inputProps: InputProps;\n /** Props for the collection, to be passed to collection's respective aria hook (e.g. useMenu). */\n collectionProps: CollectionOptions;\n /** Ref to attach to the wrapped collection. */\n collectionRef: RefObject<HTMLElement | null>;\n /**\n * A filter function that returns if the provided collection node should be filtered out of the\n * collection.\n */\n filter?: (nodeTextValue: string, node: Node<T>) => boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an autocomplete component. An\n * autocomplete combines a text input with a collection, allowing users to filter the collection's\n * contents match a query.\n *\n * @param props - Props for the autocomplete.\n * @param state - State for the autocomplete, as returned by `useAutocompleteState`.\n */\nexport function useAutocomplete<T>(\n props: AriaAutocompleteOptions<T>,\n state: AutocompleteState\n): AutocompleteAria<T> {\n let {\n inputRef,\n collectionRef,\n filter,\n disableAutoFocusFirst = false,\n disableVirtualFocus = false\n } = props;\n\n let collectionId = useId();\n let timeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n let delayNextActiveDescendant = useRef(false);\n let queuedActiveDescendant = useRef<string | null>(null);\n\n // For mobile screen readers, we don't want virtual focus, instead opting to disable FocusScope's restoreFocus and manually\n // moving focus back to the subtriggers\n let isMobileScreenReader = getInteractionModality() === 'virtual' && (isIOS() || isAndroid());\n let [shouldUseVirtualFocus, setShouldUseVirtualFocus] = useState(\n !isMobileScreenReader && !disableVirtualFocus\n );\n // Tracks if a collection has been connected to the autocomplete. If false, we don't want to add various attributes to the autocomplete input\n // since it isn't attached to a filterable collection (e.g. Tabs)\n let [hasCollection, setHasCollection] = useState(false);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n let updateActiveDescendantEvent = useEffectEvent((e: Event) => {\n // Ensure input is focused if the user clicks on the collection directly.\n // don't trigger on touch so that mobile keyboard doesnt appear when tapping on options\n if (\n !e.isTrusted &&\n shouldUseVirtualFocus &&\n inputRef.current &&\n getActiveElement(getOwnerDocument(inputRef.current)) !== inputRef.current &&\n getPointerType() !== 'touch'\n ) {\n inputRef.current.focus();\n }\n\n let target = getEventTarget(e) as Element | null;\n if (e.isTrusted || !target || queuedActiveDescendant.current === target.id) {\n return;\n }\n\n clearTimeout(timeout.current);\n if (target !== collectionRef.current) {\n if (delayNextActiveDescendant.current) {\n queuedActiveDescendant.current = target.id;\n timeout.current = setTimeout(() => {\n state.setFocusedNodeId(target.id);\n }, 500);\n } else {\n queuedActiveDescendant.current = target.id;\n state.setFocusedNodeId(target.id);\n }\n } else if (\n queuedActiveDescendant.current &&\n !document.getElementById(queuedActiveDescendant.current)\n ) {\n // If we recieve a focus event refocusing the collection, either we have newly refocused the input and are waiting for the\n // wrapped collection to refocus the previously focused node if any OR\n // we are in a state where we've filtered to such a point that there aren't any matching items in the collection to focus.\n // In this case we want to clear tracked item if any and clear active descendant\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n }\n\n delayNextActiveDescendant.current = false;\n });\n\n let [collectionNode, setCollectionNode] = useState<HTMLElement | null>(null);\n let callbackRef = useCallback(node => {\n setCollectionNode(node);\n if (node != null) {\n // If useSelectableCollection isn't passed shouldUseVirtualFocus even when useAutocomplete provides it\n // that means the collection doesn't support it (e.g. Table). If that is the case, we need to disable it here regardless\n // of what the user's provided so that the input doesn't recieve the onKeyDown and autocomplete props.\n if (node.getAttribute('tabindex') != null) {\n setShouldUseVirtualFocus(false);\n }\n setHasCollection(true);\n } else {\n setHasCollection(false);\n }\n }, []);\n useLayoutEffect(() => {\n if (collectionNode != null) {\n // When typing forward, we want to delay the setting of active descendant to not interrupt the native screen reader announcement\n // of the letter you just typed. If we recieve another focus event then we clear the queued update\n collectionNode.addEventListener('focusin', updateActiveDescendantEvent);\n }\n return () => {\n collectionNode?.removeEventListener('focusin', updateActiveDescendantEvent);\n };\n }, [collectionNode]);\n\n // Make sure to memo so that React doesn't keep registering a new event listeners on every rerender of the wrapped collection\n let mergedCollectionRef = useObjectRef(\n useMemo(() => mergeRefs(collectionRef, callbackRef), [collectionRef, callbackRef])\n );\n\n let focusFirstItem = useCallback(() => {\n delayNextActiveDescendant.current = true;\n collectionRef.current?.dispatchEvent(\n new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n focusStrategy: 'first'\n }\n })\n );\n }, [collectionRef]);\n\n let clearVirtualFocus = useCallback(\n (clearFocusKey?: boolean) => {\n moveVirtualFocus(getActiveElement());\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n let clearFocusEvent = new CustomEvent(CLEAR_FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n clearFocusKey\n }\n });\n clearTimeout(timeout.current);\n delayNextActiveDescendant.current = false;\n collectionRef.current?.dispatchEvent(clearFocusEvent);\n },\n [collectionRef, state]\n );\n\n let lastInputType = useRef('');\n useEvent(inputRef, 'input', e => {\n let {inputType} = e as InputEvent;\n lastInputType.current = inputType;\n });\n\n let onChange = (value: string) => {\n // Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via\n // copy paste/backspacing/undo/redo for screen reader announcements\n if (lastInputType.current === 'insertText' && !disableAutoFocusFirst) {\n focusFirstItem();\n } else if (\n lastInputType.current &&\n (lastInputType.current.includes('insert') ||\n lastInputType.current.includes('delete') ||\n lastInputType.current.includes('history'))\n ) {\n clearVirtualFocus(true);\n\n // If onChange was triggered before the timeout actually updated the activedescendant, we need to fire\n // our own dispatchVirtualFocus so focusVisible gets reapplied on the input\n if (getVirtuallyFocusedElement(document) === inputRef.current) {\n dispatchVirtualFocus(inputRef.current!, null);\n }\n }\n\n state.setInputValue(value);\n };\n\n let keyDownTarget = useRef<Element | null>(null);\n // For textfield specific keydown operations\n let onKeyDown = (e: BaseEvent<ReactKeyboardEvent<any>>) => {\n keyDownTarget.current = getEventTarget(e) as Element;\n if (e.nativeEvent.isComposing) {\n return;\n }\n\n let focusedNodeId = queuedActiveDescendant.current;\n if (\n focusedNodeId !== null &&\n getOwnerDocument(inputRef.current).getElementById(focusedNodeId) == null\n ) {\n // if the focused id doesn't exist in document, then we need to clear the tracked focused node, otherwise\n // we will be attempting to fire key events on a non-existing node instead of trying to focus the newly swapped wrapped collection.\n // This can happen if you are swapping out the Autocomplete wrapped collection component like in the docs search.\n queuedActiveDescendant.current = null;\n focusedNodeId = null;\n }\n\n switch (e.key) {\n case 'a':\n if (isCtrlKeyPressed(e)) {\n return;\n }\n break;\n case 'Escape':\n // Early return for Escape here so it doesn't leak the Escape event from the simulated collection event below and\n // close the dialog prematurely. Ideally that should be up to the discretion of the input element hence the check\n // for isPropagationStopped\n if (e.isDefaultPrevented()) {\n return;\n }\n break;\n case ' ':\n // Space shouldn't trigger onAction so early return.\n return;\n case 'Tab':\n // Don't propogate Tab down to the collection, otherwise we will try to focus the collection via useSelectableCollection's Tab handler (aka shift tab logic)\n // We want FocusScope to handle Tab if one exists (aka sub dialog), so special casepropogate\n if ('continuePropagation' in e) {\n e.continuePropagation();\n }\n return;\n case 'Home':\n case 'End':\n case 'PageDown':\n case 'PageUp':\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowRight':\n case 'ArrowLeft': {\n if ((e.key === 'Home' || e.key === 'End') && focusedNodeId == null && e.shiftKey) {\n return;\n }\n\n // If there is text within the input field, we'll want continue propagating events down\n // to the wrapped collection if there is a focused node so that a user can continue moving the\n // virtual focus. However, if the user doesn't have a focus in the collection, just move the text\n // cursor instead. They can move focus down into the collection via down/up arrow if need be\n if ((e.key === 'ArrowRight' || e.key === 'ArrowLeft') && state.inputValue.length > 0) {\n if (focusedNodeId == null) {\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n return;\n }\n\n break;\n }\n\n // Prevent these keys from moving the text cursor in the input\n e.preventDefault();\n // Move virtual focus into the wrapped collection\n let focusCollection = new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true\n });\n\n collectionRef.current?.dispatchEvent(focusCollection);\n break;\n }\n }\n\n // Emulate the keyboard events that happen in the input field in the wrapped collection. This is for triggering things like onAction via Enter\n // or moving focus from one item to another. Stop propagation on the input event if it isn't already stopped so it doesn't leak out. For events\n // like ESC, the dispatched event below will bubble out of the collection and be stopped if handled by useSelectableCollection, otherwise will bubble\n // as expected\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n\n let shouldPerformDefaultAction = true;\n if (collectionRef.current !== null) {\n if (focusedNodeId == null) {\n shouldPerformDefaultAction =\n collectionRef.current?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n ) || false;\n } else {\n let item = document.getElementById(focusedNodeId);\n if (item) {\n shouldPerformDefaultAction =\n item?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)) || false;\n }\n }\n }\n\n if (shouldPerformDefaultAction) {\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowRight': {\n // Clear the activedescendant so NVDA announcements aren't interrupted but retain the focused key in the collection so the\n // user's keyboard navigation restarts from where they left off\n clearVirtualFocus();\n break;\n }\n case 'Enter':\n // Trigger click action on item when Enter key was pressed.\n if (focusedNodeId != null) {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new PointerEvent('click', e.nativeEvent));\n }\n break;\n }\n } else {\n // TODO: check if we can do this, want to stop textArea from using its default Enter behavior so items are properly triggered\n e.preventDefault();\n }\n };\n\n let onKeyUpCapture = useEffectEvent(e => {\n // Dispatch simulated key up events for things like triggering links in listbox\n // Make sure to stop the propagation of the input keyup event so that the simulated keyup/down pair\n // is detected by usePress instead of the original keyup originating from the input\n if (getEventTarget(e) === keyDownTarget.current) {\n e.stopImmediatePropagation();\n let focusedNodeId = queuedActiveDescendant.current;\n if (focusedNodeId == null) {\n collectionRef.current?.dispatchEvent(new KeyboardEvent(e.type, e));\n } else {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new KeyboardEvent(e.type, e));\n }\n }\n });\n\n useEffect(() => {\n document.addEventListener('keyup', onKeyUpCapture, true);\n return () => {\n document.removeEventListener('keyup', onKeyUpCapture, true);\n };\n }, []);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/autocomplete');\n let collectionProps = useLabels({\n id: collectionId,\n 'aria-label': stringFormatter.format('collectionLabel')\n });\n\n let filterFn = useCallback(\n (nodeTextValue: string, node: Node<T>) => {\n if (filter) {\n return filter(nodeTextValue, state.inputValue, node);\n }\n\n return true;\n },\n [state.inputValue, filter]\n );\n\n // Be sure to clear/restore the virtual + collection focus when blurring/refocusing the field so we only show the\n // focus ring on the virtually focused collection when are actually interacting with the Autocomplete\n let onBlur = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let lastFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (lastFocusedNode) {\n dispatchVirtualBlur(lastFocusedNode, e.relatedTarget);\n }\n };\n\n let onFocus = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let curFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (curFocusedNode) {\n let target = getEventTarget(e);\n queueMicrotask(() => {\n // instead of focusing the last focused node, just focus the collection instead and have the collection handle what item to focus via useSelectableCollection/Item\n dispatchVirtualBlur(target, collectionRef.current);\n dispatchVirtualFocus(collectionRef.current!, target);\n });\n }\n };\n\n // Clicking back into the input can happen after focus moved elsewhere in the dialog, while\n // virtual focus is still on an option. Clear virtual focus on pointer down so mouse\n // interactions restore the input state before the click's focus handling runs.\n // Touch is excluded because touch interactions should not move focus back to the input.\n let onPointerDown = (e: ReactPointerEvent) => {\n if (\n e.button !== 0 ||\n e.pointerType === 'touch' ||\n queuedActiveDescendant.current == null ||\n inputRef.current == null\n ) {\n return;\n }\n\n if (getEventTarget(e) === inputRef.current) {\n clearVirtualFocus();\n }\n };\n\n // Only apply the autocomplete specific behaviors if the collection component wrapped by it is actually\n // being filtered/allows filtering by the Autocomplete.\n let inputProps = {\n value: state.inputValue,\n onChange\n } as AriaTextFieldProps<FocusableElement>;\n\n let virtualFocusProps = {\n onKeyDown,\n 'aria-activedescendant': state.focusedNodeId ?? undefined,\n onBlur,\n onFocus,\n onPointerDown\n };\n\n if (hasCollection) {\n inputProps = {\n ...inputProps,\n ...(shouldUseVirtualFocus && virtualFocusProps),\n enterKeyHint: 'go',\n 'aria-controls': collectionId,\n // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)\n 'aria-autocomplete': 'list',\n // This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.\n autoCorrect: 'off',\n // This disable's the macOS Safari spell check auto corrections.\n spellCheck: 'false',\n autoComplete: 'off'\n };\n }\n\n return {\n inputProps,\n collectionProps: mergeProps(collectionProps, {\n shouldUseVirtualFocus,\n disallowTypeAhead: shouldUseVirtualFocus\n }),\n collectionRef: mergedCollectionRef,\n filter: filter != null ? filterFn : undefined\n };\n}\n"],"names":[],"version":3,"file":"useAutocomplete.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAoIM,SAAS,0CACd,KAAiC,EACjC,KAAwB;IAExB,IAAI,YACF,QAAQ,iBACR,aAAa,UACb,MAAM,yBACN,wBAAwB,4BACxB,sBAAsB,OACvB,GAAG;IAEJ,IAAI,eAAe,CAAA,GAAA,yCAAI;IACvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAA6C;IAChE,IAAI,4BAA4B,CAAA,GAAA,aAAK,EAAE;IACvC,IAAI,yBAAyB,CAAA,GAAA,aAAK,EAAiB;IAEnD,2HAA2H;IAC3H,uCAAuC;IACvC,IAAI,uBAAuB,CAAA,GAAA,yCAAqB,QAAQ,aAAc,CAAA,CAAA,GAAA,yCAAI,OAAO,CAAA,GAAA,yCAAQ,GAAE;IAC3F,IAAI,CAAC,uBAAuB,yBAAyB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GAAuG;IACvG,uDAAuD;IACvD,IAAI,aAAa;QACf,OAAO,MAAM,UAAU;kBACvB;IACF;QAI2B;IAF3B,IAAI,oBAAoB;mBACtB;QACA,yBAAyB,CAAA,uBAAA,MAAM,aAAa,cAAnB,kCAAA,uBAAuB;gBAChD;iBACA;uBACA;IACF;IAEA,aAAa;QACX,GAAG,UAAU;QACb,GAAI,yBAAyB,iBAAiB,iBAAiB;QAC/D,cAAc;QACd,iBAAiB,gBAAgB,eAAe;QAChD,mFAAmF;QACnF,qBAAqB;QACrB,qGAAqG;QACrG,aAAa;QACb,gEAAgE;QAChE,YAAY;QACZ,cAAc;IAChB;IAEA,OAAO;oBACL;QACA,iBAAiB,CAAA,GAAA,yCAAS,EAAE,iBAAiB;mCAC3C;YACA,mBAAmB;YACnB,WAAW,mBAAmB,UAAU;QAC1C;QACA,eAAe;QACf,QAAQ,UAAU,OAAO,WAAW;IACtC;AACF","sources":["packages/react-aria/src/autocomplete/useAutocomplete.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n AriaLabelingProps,\n BaseEvent,\n DOMProps,\n FocusableElement,\n FocusEvents,\n KeyboardEvents,\n Node,\n RefObject,\n ValueBase\n} from '@react-types/shared';\nimport {AriaTextFieldProps} from '../textfield/useTextField';\nimport {\n AutocompleteProps,\n AutocompleteState\n} from 'react-stately/private/autocomplete/useAutocompleteState';\nimport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from '../utils/constants';\nimport {\n dispatchVirtualBlur,\n dispatchVirtualFocus,\n getVirtuallyFocusedElement,\n moveVirtualFocus\n} from '../focus/virtualFocus';\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {getInteractionModality, getPointerType} from '../interactions/useFocusVisible';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport intlMessages from '../../intl/autocomplete/*.json';\nimport {isAndroid, isIOS} from '../utils/platform';\nimport {isCtrlKeyPressed} from '../utils/keyboard';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport {\n FocusEvent as ReactFocusEvent,\n KeyboardEvent as ReactKeyboardEvent,\n PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {useEffectEvent} from '../utils/useEffectEvent';\nimport {useEvent} from '../utils/useEvent';\nimport {useId} from '../utils/useId';\nimport {useLabels} from '../utils/useLabels';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useObjectRef} from '../utils/useObjectRef';\n\nexport interface CollectionOptions extends DOMProps, AriaLabelingProps {\n /** Whether the collection items should use virtual focus instead of being focused directly. */\n shouldUseVirtualFocus: boolean;\n /** Whether typeahead is disabled. */\n disallowTypeAhead: boolean;\n}\n\nexport interface InputProps<T = FocusableElement>\n extends\n DOMProps,\n FocusEvents<T>,\n KeyboardEvents,\n Pick<ValueBase<string>, 'onChange' | 'value'>,\n Pick<\n AriaTextFieldProps,\n | 'enterKeyHint'\n | 'aria-controls'\n | 'aria-autocomplete'\n | 'aria-activedescendant'\n | 'spellCheck'\n | 'autoCorrect'\n | 'autoComplete'\n > {}\n\nexport interface AriaAutocompleteProps<T> extends AutocompleteProps {\n /**\n * An optional filter function used to determine if a option should be included in the\n * autocomplete list. Include this if the items you are providing to your wrapped collection\n * aren't filtered by default.\n */\n filter?: (textValue: string, inputValue: string, node: Node<T>) => boolean;\n\n /**\n * Whether or not to focus the first item in the collection after a filter is performed. Note this\n * is only applicable if virtual focus behavior is not turned off via `disableVirtualFocus`.\n *\n * @default false\n */\n disableAutoFocusFirst?: boolean;\n\n /**\n * Whether the autocomplete should disable virtual focus, instead making the wrapped collection\n * directly tabbable.\n *\n * @default false\n */\n disableVirtualFocus?: boolean;\n}\n\nexport interface AriaAutocompleteOptions<T> extends Omit<AriaAutocompleteProps<T>, 'children'> {\n /** The ref for the wrapped collection element. */\n inputRef: RefObject<HTMLInputElement | null>;\n /** The ref for the wrapped collection element. */\n collectionRef: RefObject<HTMLElement | null>;\n}\n\nexport interface AutocompleteAria<T> {\n /**\n * Props for the autocomplete input element. These should be passed to the input's aria hooks\n * (e.g. useTextField/useSearchField/etc) respectively.\n */\n inputProps: InputProps;\n /** Props for the collection, to be passed to collection's respective aria hook (e.g. useMenu). */\n collectionProps: CollectionOptions;\n /** Ref to attach to the wrapped collection. */\n collectionRef: RefObject<HTMLElement | null>;\n /**\n * A filter function that returns if the provided collection node should be filtered out of the\n * collection.\n */\n filter?: (nodeTextValue: string, node: Node<T>) => boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an autocomplete component. An\n * autocomplete combines a text input with a collection, allowing users to filter the collection's\n * contents match a query.\n *\n * @param props - Props for the autocomplete.\n * @param state - State for the autocomplete, as returned by `useAutocompleteState`.\n */\nexport function useAutocomplete<T>(\n props: AriaAutocompleteOptions<T>,\n state: AutocompleteState\n): AutocompleteAria<T> {\n let {\n inputRef,\n collectionRef,\n filter,\n disableAutoFocusFirst = false,\n disableVirtualFocus = false\n } = props;\n\n let collectionId = useId();\n let timeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n let delayNextActiveDescendant = useRef(false);\n let queuedActiveDescendant = useRef<string | null>(null);\n\n // For mobile screen readers, we don't want virtual focus, instead opting to disable FocusScope's restoreFocus and manually\n // moving focus back to the subtriggers\n let isMobileScreenReader = getInteractionModality() === 'virtual' && (isIOS() || isAndroid());\n let [shouldUseVirtualFocus, setShouldUseVirtualFocus] = useState(\n !isMobileScreenReader && !disableVirtualFocus\n );\n // Tracks if a collection has been connected to the autocomplete. If false, we don't want to add various attributes to the autocomplete input\n // since it isn't attached to a filterable collection (e.g. Tabs)\n let [hasCollection, setHasCollection] = useState(false);\n let [autoFocusOnMount, setAutoFocusOnMount] = useState(false);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n let updateActiveDescendantEvent = useEffectEvent((e: Event) => {\n // Ensure input is focused if the user clicks on the collection directly.\n // don't trigger on touch so that mobile keyboard doesnt appear when tapping on options\n if (\n !e.isTrusted &&\n shouldUseVirtualFocus &&\n inputRef.current &&\n getActiveElement(getOwnerDocument(inputRef.current)) !== inputRef.current &&\n getPointerType() !== 'touch'\n ) {\n inputRef.current.focus();\n }\n\n let target = getEventTarget(e) as Element | null;\n if (e.isTrusted || !target || queuedActiveDescendant.current === target.id) {\n return;\n }\n\n clearTimeout(timeout.current);\n if (target !== collectionRef.current) {\n if (delayNextActiveDescendant.current) {\n queuedActiveDescendant.current = target.id;\n timeout.current = setTimeout(() => {\n state.setFocusedNodeId(target.id);\n }, 500);\n } else {\n queuedActiveDescendant.current = target.id;\n state.setFocusedNodeId(target.id);\n }\n } else if (\n queuedActiveDescendant.current &&\n !document.getElementById(queuedActiveDescendant.current)\n ) {\n // If we recieve a focus event refocusing the collection, either we have newly refocused the input and are waiting for the\n // wrapped collection to refocus the previously focused node if any OR\n // we are in a state where we've filtered to such a point that there aren't any matching items in the collection to focus.\n // In this case we want to clear tracked item if any and clear active descendant\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n }\n\n delayNextActiveDescendant.current = false;\n });\n\n let [collectionNode, setCollectionNode] = useState<HTMLElement | null>(null);\n let callbackRef = useCallback(node => {\n setCollectionNode(node);\n if (node != null) {\n // If useSelectableCollection isn't passed shouldUseVirtualFocus even when useAutocomplete provides it\n // that means the collection doesn't support it (e.g. Table). If that is the case, we need to disable it here regardless\n // of what the user's provided so that the input doesn't recieve the onKeyDown and autocomplete props.\n if (node.getAttribute('tabindex') != null) {\n setShouldUseVirtualFocus(false);\n }\n setHasCollection(true);\n } else {\n setHasCollection(false);\n }\n }, []);\n useLayoutEffect(() => {\n if (collectionNode != null) {\n // When typing forward, we want to delay the setting of active descendant to not interrupt the native screen reader announcement\n // of the letter you just typed. If we recieve another focus event then we clear the queued update\n collectionNode.addEventListener('focusin', updateActiveDescendantEvent);\n }\n return () => {\n collectionNode?.removeEventListener('focusin', updateActiveDescendantEvent);\n };\n }, [collectionNode]);\n\n // Make sure to memo so that React doesn't keep registering a new event listeners on every rerender of the wrapped collection\n let mergedCollectionRef = useObjectRef(\n // oxlint-disable-next-line react/react-compiler\n useMemo(() => mergeRefs(collectionRef, callbackRef), [collectionRef, callbackRef])\n );\n\n let focusFirstItem = useCallback(() => {\n if (!collectionRef.current) {\n setAutoFocusOnMount(true);\n return;\n }\n\n delayNextActiveDescendant.current = true;\n collectionRef.current?.dispatchEvent(\n new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n focusStrategy: 'first'\n }\n })\n );\n }, [collectionRef]);\n\n let clearVirtualFocus = useCallback(\n (clearFocusKey?: boolean) => {\n setAutoFocusOnMount(false);\n moveVirtualFocus(getActiveElement());\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n let clearFocusEvent = new CustomEvent(CLEAR_FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n clearFocusKey\n }\n });\n clearTimeout(timeout.current);\n delayNextActiveDescendant.current = false;\n collectionRef.current?.dispatchEvent(clearFocusEvent);\n },\n [collectionRef, state]\n );\n\n let lastInputType = useRef('');\n useEvent(inputRef, 'beforeinput', e => {\n let {inputType} = e as InputEvent;\n lastInputType.current = inputType;\n });\n\n let onChange = (value: string) => {\n // Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via\n // copy paste/backspacing/undo/redo for screen reader announcements\n if (\n (lastInputType.current === 'insertText' ||\n // IME composition (e.g. CJK input) reports 'insertCompositionText'/'insertFromComposition'\n // instead of 'insertText'. Treat these as forward typing so the first item gets virtual focus.\n lastInputType.current === 'insertCompositionText' ||\n lastInputType.current === 'insertFromComposition') &&\n !disableAutoFocusFirst\n ) {\n focusFirstItem();\n } else if (\n lastInputType.current &&\n (lastInputType.current.includes('insert') ||\n lastInputType.current.includes('delete') ||\n lastInputType.current.includes('history'))\n ) {\n clearVirtualFocus(true);\n\n // If onChange was triggered before the timeout actually updated the activedescendant, we need to fire\n // our own dispatchVirtualFocus so focusVisible gets reapplied on the input\n if (getVirtuallyFocusedElement(document) === inputRef.current) {\n dispatchVirtualFocus(inputRef.current!, null);\n }\n }\n\n state.setInputValue(value);\n };\n\n let keyDownTarget = useRef<Element | null>(null);\n // For textfield specific keydown operations\n let onKeyDown = (e: BaseEvent<ReactKeyboardEvent<any>>) => {\n keyDownTarget.current = getEventTarget(e) as Element;\n if (e.nativeEvent.isComposing) {\n return;\n }\n\n let focusedNodeId = queuedActiveDescendant.current;\n if (\n focusedNodeId !== null &&\n getOwnerDocument(inputRef.current).getElementById(focusedNodeId) == null\n ) {\n // if the focused id doesn't exist in document, then we need to clear the tracked focused node, otherwise\n // we will be attempting to fire key events on a non-existing node instead of trying to focus the newly swapped wrapped collection.\n // This can happen if you are swapping out the Autocomplete wrapped collection component like in the docs search.\n queuedActiveDescendant.current = null;\n focusedNodeId = null;\n }\n\n switch (e.key) {\n case 'a':\n if (isCtrlKeyPressed(e)) {\n return;\n }\n break;\n case 'Escape':\n // Early return for Escape here so it doesn't leak the Escape event from the simulated collection event below and\n // close the dialog prematurely. Ideally that should be up to the discretion of the input element hence the check\n // for isPropagationStopped\n if (e.isDefaultPrevented()) {\n return;\n }\n break;\n case ' ':\n // Space shouldn't trigger onAction so early return.\n return;\n case 'Tab':\n // Don't propogate Tab down to the collection, otherwise we will try to focus the collection via useSelectableCollection's Tab handler (aka shift tab logic)\n // We want FocusScope to handle Tab if one exists (aka sub dialog), so special casepropogate\n if ('continuePropagation' in e) {\n e.continuePropagation();\n }\n return;\n case 'Home':\n case 'End':\n case 'PageDown':\n case 'PageUp':\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowRight':\n case 'ArrowLeft': {\n if ((e.key === 'Home' || e.key === 'End') && focusedNodeId == null && e.shiftKey) {\n return;\n }\n\n // If there is text within the input field, we'll want continue propagating events down\n // to the wrapped collection if there is a focused node so that a user can continue moving the\n // virtual focus. However, if the user doesn't have a focus in the collection, just move the text\n // cursor instead. They can move focus down into the collection via down/up arrow if need be\n if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n if (focusedNodeId == null) {\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n return;\n }\n\n break;\n }\n\n // Prevent these keys from moving the text cursor in the input\n e.preventDefault();\n // Move virtual focus into the wrapped collection\n let focusCollection = new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true\n });\n\n collectionRef.current?.dispatchEvent(focusCollection);\n break;\n }\n }\n\n // Emulate the keyboard events that happen in the input field in the wrapped collection. This is for triggering things like onAction via Enter\n // or moving focus from one item to another. Stop propagation on the input event if it isn't already stopped so it doesn't leak out. For events\n // like ESC, the dispatched event below will bubble out of the collection and be stopped if handled by useSelectableCollection, otherwise will bubble\n // as expected\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n\n let shouldPerformDefaultAction = true;\n if (collectionRef.current !== null) {\n if (focusedNodeId == null) {\n shouldPerformDefaultAction =\n collectionRef.current?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n ) || false;\n } else {\n let item = document.getElementById(focusedNodeId);\n if (item) {\n shouldPerformDefaultAction =\n item?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)) || false;\n }\n }\n }\n\n if (shouldPerformDefaultAction) {\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowRight': {\n // Clear the activedescendant so NVDA announcements aren't interrupted but retain the focused key in the collection so the\n // user's keyboard navigation restarts from where they left off\n clearVirtualFocus();\n break;\n }\n case 'Enter':\n // Trigger click action on item when Enter key was pressed.\n if (focusedNodeId != null) {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new PointerEvent('click', e.nativeEvent));\n }\n break;\n }\n } else {\n // TODO: check if we can do this, want to stop textArea from using its default Enter behavior so items are properly triggered\n e.preventDefault();\n }\n };\n\n let onKeyUpCapture = useEffectEvent(e => {\n // Dispatch simulated key up events for things like triggering links in listbox\n // Make sure to stop the propagation of the input keyup event so that the simulated keyup/down pair\n // is detected by usePress instead of the original keyup originating from the input\n if (getEventTarget(e) === keyDownTarget.current) {\n e.stopImmediatePropagation();\n let focusedNodeId = queuedActiveDescendant.current;\n if (focusedNodeId == null) {\n collectionRef.current?.dispatchEvent(new KeyboardEvent(e.type, e));\n } else {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new KeyboardEvent(e.type, e));\n }\n }\n });\n\n useEffect(() => {\n document.addEventListener('keyup', onKeyUpCapture, true);\n return () => {\n document.removeEventListener('keyup', onKeyUpCapture, true);\n };\n }, []);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/autocomplete');\n let collectionProps = useLabels({\n id: collectionId,\n 'aria-label': stringFormatter.format('collectionLabel')\n });\n\n let filterFn = useCallback(\n (nodeTextValue: string, node: Node<T>) => {\n if (filter) {\n return filter(nodeTextValue, state.inputValue, node);\n }\n\n return true;\n },\n [state.inputValue, filter]\n );\n\n // Be sure to clear/restore the virtual + collection focus when blurring/refocusing the field so we only show the\n // focus ring on the virtually focused collection when are actually interacting with the Autocomplete\n let onBlur = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let lastFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (lastFocusedNode) {\n dispatchVirtualBlur(lastFocusedNode, e.relatedTarget);\n }\n };\n\n let onFocus = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let curFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (curFocusedNode) {\n let target = getEventTarget(e);\n queueMicrotask(() => {\n // instead of focusing the last focused node, just focus the collection instead and have the collection handle what item to focus via useSelectableCollection/Item\n dispatchVirtualBlur(target, collectionRef.current);\n dispatchVirtualFocus(collectionRef.current!, target);\n });\n }\n };\n\n // Clicking back into the input can happen after focus moved elsewhere in the dialog, while\n // virtual focus is still on an option. Clear virtual focus on pointer down so mouse\n // interactions restore the input state before the click's focus handling runs.\n // Touch is excluded because touch interactions should not move focus back to the input.\n let onPointerDown = (e: ReactPointerEvent) => {\n if (\n e.button !== 0 ||\n e.pointerType === 'touch' ||\n queuedActiveDescendant.current == null ||\n inputRef.current == null\n ) {\n return;\n }\n\n if (getEventTarget(e) === inputRef.current) {\n clearVirtualFocus();\n }\n };\n\n // Only apply the autocomplete specific behaviors if the collection component wrapped by it is actually\n // being filtered/allows filtering by the Autocomplete.\n let inputProps = {\n value: state.inputValue,\n onChange\n } as AriaTextFieldProps<FocusableElement>;\n\n let virtualFocusProps = {\n onKeyDown,\n 'aria-activedescendant': state.focusedNodeId ?? undefined,\n onBlur,\n onFocus,\n onPointerDown\n };\n\n inputProps = {\n ...inputProps,\n ...(shouldUseVirtualFocus && hasCollection && virtualFocusProps),\n enterKeyHint: 'go',\n 'aria-controls': hasCollection ? collectionId : undefined,\n // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)\n 'aria-autocomplete': 'list',\n // This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.\n autoCorrect: 'off',\n // This disable's the macOS Safari spell check auto corrections.\n spellCheck: 'false',\n autoComplete: 'off'\n };\n\n return {\n inputProps,\n collectionProps: mergeProps(collectionProps, {\n shouldUseVirtualFocus,\n disallowTypeAhead: shouldUseVirtualFocus,\n autoFocus: autoFocusOnMount ? 'first' : false\n }),\n collectionRef: mergedCollectionRef,\n filter: filter != null ? filterFn : undefined\n };\n}\n"],"names":[],"version":3,"file":"useAutocomplete.js.map"}
|
|
@@ -62,6 +62,7 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
62
62
|
// Tracks if a collection has been connected to the autocomplete. If false, we don't want to add various attributes to the autocomplete input
|
|
63
63
|
// since it isn't attached to a filterable collection (e.g. Tabs)
|
|
64
64
|
let [hasCollection, setHasCollection] = (0, $7qCLe$useState)(false);
|
|
65
|
+
let [autoFocusOnMount, setAutoFocusOnMount] = (0, $7qCLe$useState)(false);
|
|
65
66
|
(0, $7qCLe$useEffect)(()=>{
|
|
66
67
|
return ()=>clearTimeout(timeout.current);
|
|
67
68
|
}, []);
|
|
@@ -114,11 +115,16 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
114
115
|
collectionNode
|
|
115
116
|
]);
|
|
116
117
|
// Make sure to memo so that React doesn't keep registering a new event listeners on every rerender of the wrapped collection
|
|
117
|
-
let mergedCollectionRef = (0, $03e8ab2d84d7657a$export$4338b53315abf666)(
|
|
118
|
+
let mergedCollectionRef = (0, $03e8ab2d84d7657a$export$4338b53315abf666)(// oxlint-disable-next-line react/react-compiler
|
|
119
|
+
(0, $7qCLe$useMemo)(()=>(0, $4064df0d6f9620e1$export$c9058316764c140e)(collectionRef, callbackRef), [
|
|
118
120
|
collectionRef,
|
|
119
121
|
callbackRef
|
|
120
122
|
]));
|
|
121
123
|
let focusFirstItem = (0, $7qCLe$useCallback)(()=>{
|
|
124
|
+
if (!collectionRef.current) {
|
|
125
|
+
setAutoFocusOnMount(true);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
122
128
|
delayNextActiveDescendant.current = true;
|
|
123
129
|
collectionRef.current?.dispatchEvent(new CustomEvent((0, $8b2399d051d06d4c$export$831c820ad60f9d12), {
|
|
124
130
|
cancelable: true,
|
|
@@ -131,6 +137,7 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
131
137
|
collectionRef
|
|
132
138
|
]);
|
|
133
139
|
let clearVirtualFocus = (0, $7qCLe$useCallback)((clearFocusKey)=>{
|
|
140
|
+
setAutoFocusOnMount(false);
|
|
134
141
|
(0, $b72f3f7b3b5f42c6$export$76e4e37e5339496d)((0, $23f2114a1b82827e$export$cd4e5573fbe2b576)());
|
|
135
142
|
queuedActiveDescendant.current = null;
|
|
136
143
|
state.setFocusedNodeId(null);
|
|
@@ -149,14 +156,16 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
149
156
|
state
|
|
150
157
|
]);
|
|
151
158
|
let lastInputType = (0, $7qCLe$useRef)('');
|
|
152
|
-
(0, $600b3cf69ae46262$export$90fc3a17d93f704c)(inputRef, '
|
|
159
|
+
(0, $600b3cf69ae46262$export$90fc3a17d93f704c)(inputRef, 'beforeinput', (e)=>{
|
|
153
160
|
let { inputType: inputType } = e;
|
|
154
161
|
lastInputType.current = inputType;
|
|
155
162
|
});
|
|
156
163
|
let onChange = (value)=>{
|
|
157
164
|
// Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via
|
|
158
165
|
// copy paste/backspacing/undo/redo for screen reader announcements
|
|
159
|
-
if (lastInputType.current === 'insertText'
|
|
166
|
+
if ((lastInputType.current === 'insertText' || // IME composition (e.g. CJK input) reports 'insertCompositionText'/'insertFromComposition'
|
|
167
|
+
// instead of 'insertText'. Treat these as forward typing so the first item gets virtual focus.
|
|
168
|
+
lastInputType.current === 'insertCompositionText' || lastInputType.current === 'insertFromComposition') && !disableAutoFocusFirst) focusFirstItem();
|
|
160
169
|
else if (lastInputType.current && (lastInputType.current.includes('insert') || lastInputType.current.includes('delete') || lastInputType.current.includes('history'))) {
|
|
161
170
|
clearVirtualFocus(true);
|
|
162
171
|
// If onChange was triggered before the timeout actually updated the activedescendant, we need to fire
|
|
@@ -210,7 +219,7 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
210
219
|
// to the wrapped collection if there is a focused node so that a user can continue moving the
|
|
211
220
|
// virtual focus. However, if the user doesn't have a focus in the collection, just move the text
|
|
212
221
|
// cursor instead. They can move focus down into the collection via down/up arrow if need be
|
|
213
|
-
if (
|
|
222
|
+
if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
|
|
214
223
|
if (focusedNodeId == null) {
|
|
215
224
|
if (!e.isPropagationStopped()) e.stopPropagation();
|
|
216
225
|
return;
|
|
@@ -331,11 +340,11 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
331
340
|
onFocus: onFocus,
|
|
332
341
|
onPointerDown: onPointerDown
|
|
333
342
|
};
|
|
334
|
-
|
|
343
|
+
inputProps = {
|
|
335
344
|
...inputProps,
|
|
336
|
-
...shouldUseVirtualFocus && virtualFocusProps,
|
|
345
|
+
...shouldUseVirtualFocus && hasCollection && virtualFocusProps,
|
|
337
346
|
enterKeyHint: 'go',
|
|
338
|
-
'aria-controls': collectionId,
|
|
347
|
+
'aria-controls': hasCollection ? collectionId : undefined,
|
|
339
348
|
// TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)
|
|
340
349
|
'aria-autocomplete': 'list',
|
|
341
350
|
// This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.
|
|
@@ -348,7 +357,8 @@ function $134103e19bdfd846$export$1e40b3ca02d92d21(props, state) {
|
|
|
348
357
|
inputProps: inputProps,
|
|
349
358
|
collectionProps: (0, $bbaa08b3cd72f041$export$9d1611c77c2fe928)(collectionProps, {
|
|
350
359
|
shouldUseVirtualFocus: shouldUseVirtualFocus,
|
|
351
|
-
disallowTypeAhead: shouldUseVirtualFocus
|
|
360
|
+
disallowTypeAhead: shouldUseVirtualFocus,
|
|
361
|
+
autoFocus: autoFocusOnMount ? 'first' : false
|
|
352
362
|
}),
|
|
353
363
|
collectionRef: mergedCollectionRef,
|
|
354
364
|
filter: filter != null ? filterFn : undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AA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,uGAAuG;IACvG,uDAAuD;IACvD,IAAI,aAAa;QACf,OAAO,MAAM,UAAU;kBACvB;IACF;IAEA,IAAI,oBAAoB;mBACtB;QACA,yBAAyB,MAAM,aAAa,IAAI;gBAChD;iBACA;uBACA;IACF;IAEA,IAAI,eACF,aAAa;QACX,GAAG,UAAU;QACb,GAAI,yBAAyB,iBAAiB;QAC9C,cAAc;QACd,iBAAiB;QACjB,mFAAmF;QACnF,qBAAqB;QACrB,qGAAqG;QACrG,aAAa;QACb,gEAAgE;QAChE,YAAY;QACZ,cAAc;IAChB;IAGF,OAAO;oBACL;QACA,iBAAiB,CAAA,GAAA,yCAAS,EAAE,iBAAiB;mCAC3C;YACA,mBAAmB;QACrB;QACA,eAAe;QACf,QAAQ,UAAU,OAAO,WAAW;IACtC;AACF","sources":["packages/react-aria/src/autocomplete/useAutocomplete.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n AriaLabelingProps,\n BaseEvent,\n DOMProps,\n FocusableElement,\n FocusEvents,\n KeyboardEvents,\n Node,\n RefObject,\n ValueBase\n} from '@react-types/shared';\nimport {AriaTextFieldProps} from '../textfield/useTextField';\nimport {\n AutocompleteProps,\n AutocompleteState\n} from 'react-stately/private/autocomplete/useAutocompleteState';\nimport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from '../utils/constants';\nimport {\n dispatchVirtualBlur,\n dispatchVirtualFocus,\n getVirtuallyFocusedElement,\n moveVirtualFocus\n} from '../focus/virtualFocus';\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {getInteractionModality, getPointerType} from '../interactions/useFocusVisible';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport intlMessages from '../../intl/autocomplete/*.json';\nimport {isAndroid, isIOS} from '../utils/platform';\nimport {isCtrlKeyPressed} from '../utils/keyboard';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport {\n FocusEvent as ReactFocusEvent,\n KeyboardEvent as ReactKeyboardEvent,\n PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {useEffectEvent} from '../utils/useEffectEvent';\nimport {useEvent} from '../utils/useEvent';\n\nimport {useId} from '../utils/useId';\n\nimport {useLabels} from '../utils/useLabels';\n// @ts-ignore\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useObjectRef} from '../utils/useObjectRef';\n\nexport interface CollectionOptions extends DOMProps, AriaLabelingProps {\n /** Whether the collection items should use virtual focus instead of being focused directly. */\n shouldUseVirtualFocus: boolean;\n /** Whether typeahead is disabled. */\n disallowTypeAhead: boolean;\n}\n\nexport interface InputProps<T = FocusableElement>\n extends\n DOMProps,\n FocusEvents<T>,\n KeyboardEvents,\n Pick<ValueBase<string>, 'onChange' | 'value'>,\n Pick<\n AriaTextFieldProps,\n | 'enterKeyHint'\n | 'aria-controls'\n | 'aria-autocomplete'\n | 'aria-activedescendant'\n | 'spellCheck'\n | 'autoCorrect'\n | 'autoComplete'\n > {}\n\nexport interface AriaAutocompleteProps<T> extends AutocompleteProps {\n /**\n * An optional filter function used to determine if a option should be included in the\n * autocomplete list. Include this if the items you are providing to your wrapped collection\n * aren't filtered by default.\n */\n filter?: (textValue: string, inputValue: string, node: Node<T>) => boolean;\n\n /**\n * Whether or not to focus the first item in the collection after a filter is performed. Note this\n * is only applicable if virtual focus behavior is not turned off via `disableVirtualFocus`.\n *\n * @default false\n */\n disableAutoFocusFirst?: boolean;\n\n /**\n * Whether the autocomplete should disable virtual focus, instead making the wrapped collection\n * directly tabbable.\n *\n * @default false\n */\n disableVirtualFocus?: boolean;\n}\n\nexport interface AriaAutocompleteOptions<T> extends Omit<AriaAutocompleteProps<T>, 'children'> {\n /** The ref for the wrapped collection element. */\n inputRef: RefObject<HTMLInputElement | null>;\n /** The ref for the wrapped collection element. */\n collectionRef: RefObject<HTMLElement | null>;\n}\n\nexport interface AutocompleteAria<T> {\n /**\n * Props for the autocomplete input element. These should be passed to the input's aria hooks\n * (e.g. useTextField/useSearchField/etc) respectively.\n */\n inputProps: InputProps;\n /** Props for the collection, to be passed to collection's respective aria hook (e.g. useMenu). */\n collectionProps: CollectionOptions;\n /** Ref to attach to the wrapped collection. */\n collectionRef: RefObject<HTMLElement | null>;\n /**\n * A filter function that returns if the provided collection node should be filtered out of the\n * collection.\n */\n filter?: (nodeTextValue: string, node: Node<T>) => boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an autocomplete component. An\n * autocomplete combines a text input with a collection, allowing users to filter the collection's\n * contents match a query.\n *\n * @param props - Props for the autocomplete.\n * @param state - State for the autocomplete, as returned by `useAutocompleteState`.\n */\nexport function useAutocomplete<T>(\n props: AriaAutocompleteOptions<T>,\n state: AutocompleteState\n): AutocompleteAria<T> {\n let {\n inputRef,\n collectionRef,\n filter,\n disableAutoFocusFirst = false,\n disableVirtualFocus = false\n } = props;\n\n let collectionId = useId();\n let timeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n let delayNextActiveDescendant = useRef(false);\n let queuedActiveDescendant = useRef<string | null>(null);\n\n // For mobile screen readers, we don't want virtual focus, instead opting to disable FocusScope's restoreFocus and manually\n // moving focus back to the subtriggers\n let isMobileScreenReader = getInteractionModality() === 'virtual' && (isIOS() || isAndroid());\n let [shouldUseVirtualFocus, setShouldUseVirtualFocus] = useState(\n !isMobileScreenReader && !disableVirtualFocus\n );\n // Tracks if a collection has been connected to the autocomplete. If false, we don't want to add various attributes to the autocomplete input\n // since it isn't attached to a filterable collection (e.g. Tabs)\n let [hasCollection, setHasCollection] = useState(false);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n let updateActiveDescendantEvent = useEffectEvent((e: Event) => {\n // Ensure input is focused if the user clicks on the collection directly.\n // don't trigger on touch so that mobile keyboard doesnt appear when tapping on options\n if (\n !e.isTrusted &&\n shouldUseVirtualFocus &&\n inputRef.current &&\n getActiveElement(getOwnerDocument(inputRef.current)) !== inputRef.current &&\n getPointerType() !== 'touch'\n ) {\n inputRef.current.focus();\n }\n\n let target = getEventTarget(e) as Element | null;\n if (e.isTrusted || !target || queuedActiveDescendant.current === target.id) {\n return;\n }\n\n clearTimeout(timeout.current);\n if (target !== collectionRef.current) {\n if (delayNextActiveDescendant.current) {\n queuedActiveDescendant.current = target.id;\n timeout.current = setTimeout(() => {\n state.setFocusedNodeId(target.id);\n }, 500);\n } else {\n queuedActiveDescendant.current = target.id;\n state.setFocusedNodeId(target.id);\n }\n } else if (\n queuedActiveDescendant.current &&\n !document.getElementById(queuedActiveDescendant.current)\n ) {\n // If we recieve a focus event refocusing the collection, either we have newly refocused the input and are waiting for the\n // wrapped collection to refocus the previously focused node if any OR\n // we are in a state where we've filtered to such a point that there aren't any matching items in the collection to focus.\n // In this case we want to clear tracked item if any and clear active descendant\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n }\n\n delayNextActiveDescendant.current = false;\n });\n\n let [collectionNode, setCollectionNode] = useState<HTMLElement | null>(null);\n let callbackRef = useCallback(node => {\n setCollectionNode(node);\n if (node != null) {\n // If useSelectableCollection isn't passed shouldUseVirtualFocus even when useAutocomplete provides it\n // that means the collection doesn't support it (e.g. Table). If that is the case, we need to disable it here regardless\n // of what the user's provided so that the input doesn't recieve the onKeyDown and autocomplete props.\n if (node.getAttribute('tabindex') != null) {\n setShouldUseVirtualFocus(false);\n }\n setHasCollection(true);\n } else {\n setHasCollection(false);\n }\n }, []);\n useLayoutEffect(() => {\n if (collectionNode != null) {\n // When typing forward, we want to delay the setting of active descendant to not interrupt the native screen reader announcement\n // of the letter you just typed. If we recieve another focus event then we clear the queued update\n collectionNode.addEventListener('focusin', updateActiveDescendantEvent);\n }\n return () => {\n collectionNode?.removeEventListener('focusin', updateActiveDescendantEvent);\n };\n }, [collectionNode]);\n\n // Make sure to memo so that React doesn't keep registering a new event listeners on every rerender of the wrapped collection\n let mergedCollectionRef = useObjectRef(\n useMemo(() => mergeRefs(collectionRef, callbackRef), [collectionRef, callbackRef])\n );\n\n let focusFirstItem = useCallback(() => {\n delayNextActiveDescendant.current = true;\n collectionRef.current?.dispatchEvent(\n new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n focusStrategy: 'first'\n }\n })\n );\n }, [collectionRef]);\n\n let clearVirtualFocus = useCallback(\n (clearFocusKey?: boolean) => {\n moveVirtualFocus(getActiveElement());\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n let clearFocusEvent = new CustomEvent(CLEAR_FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n clearFocusKey\n }\n });\n clearTimeout(timeout.current);\n delayNextActiveDescendant.current = false;\n collectionRef.current?.dispatchEvent(clearFocusEvent);\n },\n [collectionRef, state]\n );\n\n let lastInputType = useRef('');\n useEvent(inputRef, 'input', e => {\n let {inputType} = e as InputEvent;\n lastInputType.current = inputType;\n });\n\n let onChange = (value: string) => {\n // Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via\n // copy paste/backspacing/undo/redo for screen reader announcements\n if (lastInputType.current === 'insertText' && !disableAutoFocusFirst) {\n focusFirstItem();\n } else if (\n lastInputType.current &&\n (lastInputType.current.includes('insert') ||\n lastInputType.current.includes('delete') ||\n lastInputType.current.includes('history'))\n ) {\n clearVirtualFocus(true);\n\n // If onChange was triggered before the timeout actually updated the activedescendant, we need to fire\n // our own dispatchVirtualFocus so focusVisible gets reapplied on the input\n if (getVirtuallyFocusedElement(document) === inputRef.current) {\n dispatchVirtualFocus(inputRef.current!, null);\n }\n }\n\n state.setInputValue(value);\n };\n\n let keyDownTarget = useRef<Element | null>(null);\n // For textfield specific keydown operations\n let onKeyDown = (e: BaseEvent<ReactKeyboardEvent<any>>) => {\n keyDownTarget.current = getEventTarget(e) as Element;\n if (e.nativeEvent.isComposing) {\n return;\n }\n\n let focusedNodeId = queuedActiveDescendant.current;\n if (\n focusedNodeId !== null &&\n getOwnerDocument(inputRef.current).getElementById(focusedNodeId) == null\n ) {\n // if the focused id doesn't exist in document, then we need to clear the tracked focused node, otherwise\n // we will be attempting to fire key events on a non-existing node instead of trying to focus the newly swapped wrapped collection.\n // This can happen if you are swapping out the Autocomplete wrapped collection component like in the docs search.\n queuedActiveDescendant.current = null;\n focusedNodeId = null;\n }\n\n switch (e.key) {\n case 'a':\n if (isCtrlKeyPressed(e)) {\n return;\n }\n break;\n case 'Escape':\n // Early return for Escape here so it doesn't leak the Escape event from the simulated collection event below and\n // close the dialog prematurely. Ideally that should be up to the discretion of the input element hence the check\n // for isPropagationStopped\n if (e.isDefaultPrevented()) {\n return;\n }\n break;\n case ' ':\n // Space shouldn't trigger onAction so early return.\n return;\n case 'Tab':\n // Don't propogate Tab down to the collection, otherwise we will try to focus the collection via useSelectableCollection's Tab handler (aka shift tab logic)\n // We want FocusScope to handle Tab if one exists (aka sub dialog), so special casepropogate\n if ('continuePropagation' in e) {\n e.continuePropagation();\n }\n return;\n case 'Home':\n case 'End':\n case 'PageDown':\n case 'PageUp':\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowRight':\n case 'ArrowLeft': {\n if ((e.key === 'Home' || e.key === 'End') && focusedNodeId == null && e.shiftKey) {\n return;\n }\n\n // If there is text within the input field, we'll want continue propagating events down\n // to the wrapped collection if there is a focused node so that a user can continue moving the\n // virtual focus. However, if the user doesn't have a focus in the collection, just move the text\n // cursor instead. They can move focus down into the collection via down/up arrow if need be\n if ((e.key === 'ArrowRight' || e.key === 'ArrowLeft') && state.inputValue.length > 0) {\n if (focusedNodeId == null) {\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n return;\n }\n\n break;\n }\n\n // Prevent these keys from moving the text cursor in the input\n e.preventDefault();\n // Move virtual focus into the wrapped collection\n let focusCollection = new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true\n });\n\n collectionRef.current?.dispatchEvent(focusCollection);\n break;\n }\n }\n\n // Emulate the keyboard events that happen in the input field in the wrapped collection. This is for triggering things like onAction via Enter\n // or moving focus from one item to another. Stop propagation on the input event if it isn't already stopped so it doesn't leak out. For events\n // like ESC, the dispatched event below will bubble out of the collection and be stopped if handled by useSelectableCollection, otherwise will bubble\n // as expected\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n\n let shouldPerformDefaultAction = true;\n if (collectionRef.current !== null) {\n if (focusedNodeId == null) {\n shouldPerformDefaultAction =\n collectionRef.current?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n ) || false;\n } else {\n let item = document.getElementById(focusedNodeId);\n if (item) {\n shouldPerformDefaultAction =\n item?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)) || false;\n }\n }\n }\n\n if (shouldPerformDefaultAction) {\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowRight': {\n // Clear the activedescendant so NVDA announcements aren't interrupted but retain the focused key in the collection so the\n // user's keyboard navigation restarts from where they left off\n clearVirtualFocus();\n break;\n }\n case 'Enter':\n // Trigger click action on item when Enter key was pressed.\n if (focusedNodeId != null) {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new PointerEvent('click', e.nativeEvent));\n }\n break;\n }\n } else {\n // TODO: check if we can do this, want to stop textArea from using its default Enter behavior so items are properly triggered\n e.preventDefault();\n }\n };\n\n let onKeyUpCapture = useEffectEvent(e => {\n // Dispatch simulated key up events for things like triggering links in listbox\n // Make sure to stop the propagation of the input keyup event so that the simulated keyup/down pair\n // is detected by usePress instead of the original keyup originating from the input\n if (getEventTarget(e) === keyDownTarget.current) {\n e.stopImmediatePropagation();\n let focusedNodeId = queuedActiveDescendant.current;\n if (focusedNodeId == null) {\n collectionRef.current?.dispatchEvent(new KeyboardEvent(e.type, e));\n } else {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new KeyboardEvent(e.type, e));\n }\n }\n });\n\n useEffect(() => {\n document.addEventListener('keyup', onKeyUpCapture, true);\n return () => {\n document.removeEventListener('keyup', onKeyUpCapture, true);\n };\n }, []);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/autocomplete');\n let collectionProps = useLabels({\n id: collectionId,\n 'aria-label': stringFormatter.format('collectionLabel')\n });\n\n let filterFn = useCallback(\n (nodeTextValue: string, node: Node<T>) => {\n if (filter) {\n return filter(nodeTextValue, state.inputValue, node);\n }\n\n return true;\n },\n [state.inputValue, filter]\n );\n\n // Be sure to clear/restore the virtual + collection focus when blurring/refocusing the field so we only show the\n // focus ring on the virtually focused collection when are actually interacting with the Autocomplete\n let onBlur = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let lastFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (lastFocusedNode) {\n dispatchVirtualBlur(lastFocusedNode, e.relatedTarget);\n }\n };\n\n let onFocus = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let curFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (curFocusedNode) {\n let target = getEventTarget(e);\n queueMicrotask(() => {\n // instead of focusing the last focused node, just focus the collection instead and have the collection handle what item to focus via useSelectableCollection/Item\n dispatchVirtualBlur(target, collectionRef.current);\n dispatchVirtualFocus(collectionRef.current!, target);\n });\n }\n };\n\n // Clicking back into the input can happen after focus moved elsewhere in the dialog, while\n // virtual focus is still on an option. Clear virtual focus on pointer down so mouse\n // interactions restore the input state before the click's focus handling runs.\n // Touch is excluded because touch interactions should not move focus back to the input.\n let onPointerDown = (e: ReactPointerEvent) => {\n if (\n e.button !== 0 ||\n e.pointerType === 'touch' ||\n queuedActiveDescendant.current == null ||\n inputRef.current == null\n ) {\n return;\n }\n\n if (getEventTarget(e) === inputRef.current) {\n clearVirtualFocus();\n }\n };\n\n // Only apply the autocomplete specific behaviors if the collection component wrapped by it is actually\n // being filtered/allows filtering by the Autocomplete.\n let inputProps = {\n value: state.inputValue,\n onChange\n } as AriaTextFieldProps<FocusableElement>;\n\n let virtualFocusProps = {\n onKeyDown,\n 'aria-activedescendant': state.focusedNodeId ?? undefined,\n onBlur,\n onFocus,\n onPointerDown\n };\n\n if (hasCollection) {\n inputProps = {\n ...inputProps,\n ...(shouldUseVirtualFocus && virtualFocusProps),\n enterKeyHint: 'go',\n 'aria-controls': collectionId,\n // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)\n 'aria-autocomplete': 'list',\n // This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.\n autoCorrect: 'off',\n // This disable's the macOS Safari spell check auto corrections.\n spellCheck: 'false',\n autoComplete: 'off'\n };\n }\n\n return {\n inputProps,\n collectionProps: mergeProps(collectionProps, {\n shouldUseVirtualFocus,\n disallowTypeAhead: shouldUseVirtualFocus\n }),\n collectionRef: mergedCollectionRef,\n filter: filter != null ? filterFn : undefined\n };\n}\n"],"names":[],"version":3,"file":"useAutocomplete.mjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;AAoIM,SAAS,0CACd,KAAiC,EACjC,KAAwB;IAExB,IAAI,YACF,QAAQ,iBACR,aAAa,UACb,MAAM,yBACN,wBAAwB,4BACxB,sBAAsB,OACvB,GAAG;IAEJ,IAAI,eAAe,CAAA,GAAA,yCAAI;IACvB,IAAI,UAAU,CAAA,GAAA,aAAK,EAA6C;IAChE,IAAI,4BAA4B,CAAA,GAAA,aAAK,EAAE;IACvC,IAAI,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BACvB;IACF;IAEA,IAAI,oBAAoB;mBACtB;QACA,yBAAyB,MAAM,aAAa,IAAI;gBAChD;iBACA;uBACA;IACF;IAEA,aAAa;QACX,GAAG,UAAU;QACb,GAAI,yBAAyB,iBAAiB,iBAAiB;QAC/D,cAAc;QACd,iBAAiB,gBAAgB,eAAe;QAChD,mFAAmF;QACnF,qBAAqB;QACrB,qGAAqG;QACrG,aAAa;QACb,gEAAgE;QAChE,YAAY;QACZ,cAAc;IAChB;IAEA,OAAO;oBACL;QACA,iBAAiB,CAAA,GAAA,yCAAS,EAAE,iBAAiB;mCAC3C;YACA,mBAAmB;YACnB,WAAW,mBAAmB,UAAU;QAC1C;QACA,eAAe;QACf,QAAQ,UAAU,OAAO,WAAW;IACtC;AACF","sources":["packages/react-aria/src/autocomplete/useAutocomplete.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n AriaLabelingProps,\n BaseEvent,\n DOMProps,\n FocusableElement,\n FocusEvents,\n KeyboardEvents,\n Node,\n RefObject,\n ValueBase\n} from '@react-types/shared';\nimport {AriaTextFieldProps} from '../textfield/useTextField';\nimport {\n AutocompleteProps,\n AutocompleteState\n} from 'react-stately/private/autocomplete/useAutocompleteState';\nimport {CLEAR_FOCUS_EVENT, FOCUS_EVENT} from '../utils/constants';\nimport {\n dispatchVirtualBlur,\n dispatchVirtualFocus,\n getVirtuallyFocusedElement,\n moveVirtualFocus\n} from '../focus/virtualFocus';\nimport {getActiveElement, getEventTarget} from '../utils/shadowdom/DOMFunctions';\nimport {getInteractionModality, getPointerType} from '../interactions/useFocusVisible';\nimport {getOwnerDocument} from '../utils/domHelpers';\nimport intlMessages from '../../intl/autocomplete/*.json';\nimport {isAndroid, isIOS} from '../utils/platform';\nimport {isCtrlKeyPressed} from '../utils/keyboard';\nimport {mergeProps} from '../utils/mergeProps';\nimport {mergeRefs} from '../utils/mergeRefs';\nimport {\n FocusEvent as ReactFocusEvent,\n KeyboardEvent as ReactKeyboardEvent,\n PointerEvent as ReactPointerEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState\n} from 'react';\nimport {useEffectEvent} from '../utils/useEffectEvent';\nimport {useEvent} from '../utils/useEvent';\nimport {useId} from '../utils/useId';\nimport {useLabels} from '../utils/useLabels';\nimport {useLayoutEffect} from '../utils/useLayoutEffect';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\nimport {useObjectRef} from '../utils/useObjectRef';\n\nexport interface CollectionOptions extends DOMProps, AriaLabelingProps {\n /** Whether the collection items should use virtual focus instead of being focused directly. */\n shouldUseVirtualFocus: boolean;\n /** Whether typeahead is disabled. */\n disallowTypeAhead: boolean;\n}\n\nexport interface InputProps<T = FocusableElement>\n extends\n DOMProps,\n FocusEvents<T>,\n KeyboardEvents,\n Pick<ValueBase<string>, 'onChange' | 'value'>,\n Pick<\n AriaTextFieldProps,\n | 'enterKeyHint'\n | 'aria-controls'\n | 'aria-autocomplete'\n | 'aria-activedescendant'\n | 'spellCheck'\n | 'autoCorrect'\n | 'autoComplete'\n > {}\n\nexport interface AriaAutocompleteProps<T> extends AutocompleteProps {\n /**\n * An optional filter function used to determine if a option should be included in the\n * autocomplete list. Include this if the items you are providing to your wrapped collection\n * aren't filtered by default.\n */\n filter?: (textValue: string, inputValue: string, node: Node<T>) => boolean;\n\n /**\n * Whether or not to focus the first item in the collection after a filter is performed. Note this\n * is only applicable if virtual focus behavior is not turned off via `disableVirtualFocus`.\n *\n * @default false\n */\n disableAutoFocusFirst?: boolean;\n\n /**\n * Whether the autocomplete should disable virtual focus, instead making the wrapped collection\n * directly tabbable.\n *\n * @default false\n */\n disableVirtualFocus?: boolean;\n}\n\nexport interface AriaAutocompleteOptions<T> extends Omit<AriaAutocompleteProps<T>, 'children'> {\n /** The ref for the wrapped collection element. */\n inputRef: RefObject<HTMLInputElement | null>;\n /** The ref for the wrapped collection element. */\n collectionRef: RefObject<HTMLElement | null>;\n}\n\nexport interface AutocompleteAria<T> {\n /**\n * Props for the autocomplete input element. These should be passed to the input's aria hooks\n * (e.g. useTextField/useSearchField/etc) respectively.\n */\n inputProps: InputProps;\n /** Props for the collection, to be passed to collection's respective aria hook (e.g. useMenu). */\n collectionProps: CollectionOptions;\n /** Ref to attach to the wrapped collection. */\n collectionRef: RefObject<HTMLElement | null>;\n /**\n * A filter function that returns if the provided collection node should be filtered out of the\n * collection.\n */\n filter?: (nodeTextValue: string, node: Node<T>) => boolean;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an autocomplete component. An\n * autocomplete combines a text input with a collection, allowing users to filter the collection's\n * contents match a query.\n *\n * @param props - Props for the autocomplete.\n * @param state - State for the autocomplete, as returned by `useAutocompleteState`.\n */\nexport function useAutocomplete<T>(\n props: AriaAutocompleteOptions<T>,\n state: AutocompleteState\n): AutocompleteAria<T> {\n let {\n inputRef,\n collectionRef,\n filter,\n disableAutoFocusFirst = false,\n disableVirtualFocus = false\n } = props;\n\n let collectionId = useId();\n let timeout = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n let delayNextActiveDescendant = useRef(false);\n let queuedActiveDescendant = useRef<string | null>(null);\n\n // For mobile screen readers, we don't want virtual focus, instead opting to disable FocusScope's restoreFocus and manually\n // moving focus back to the subtriggers\n let isMobileScreenReader = getInteractionModality() === 'virtual' && (isIOS() || isAndroid());\n let [shouldUseVirtualFocus, setShouldUseVirtualFocus] = useState(\n !isMobileScreenReader && !disableVirtualFocus\n );\n // Tracks if a collection has been connected to the autocomplete. If false, we don't want to add various attributes to the autocomplete input\n // since it isn't attached to a filterable collection (e.g. Tabs)\n let [hasCollection, setHasCollection] = useState(false);\n let [autoFocusOnMount, setAutoFocusOnMount] = useState(false);\n\n useEffect(() => {\n return () => clearTimeout(timeout.current);\n }, []);\n\n let updateActiveDescendantEvent = useEffectEvent((e: Event) => {\n // Ensure input is focused if the user clicks on the collection directly.\n // don't trigger on touch so that mobile keyboard doesnt appear when tapping on options\n if (\n !e.isTrusted &&\n shouldUseVirtualFocus &&\n inputRef.current &&\n getActiveElement(getOwnerDocument(inputRef.current)) !== inputRef.current &&\n getPointerType() !== 'touch'\n ) {\n inputRef.current.focus();\n }\n\n let target = getEventTarget(e) as Element | null;\n if (e.isTrusted || !target || queuedActiveDescendant.current === target.id) {\n return;\n }\n\n clearTimeout(timeout.current);\n if (target !== collectionRef.current) {\n if (delayNextActiveDescendant.current) {\n queuedActiveDescendant.current = target.id;\n timeout.current = setTimeout(() => {\n state.setFocusedNodeId(target.id);\n }, 500);\n } else {\n queuedActiveDescendant.current = target.id;\n state.setFocusedNodeId(target.id);\n }\n } else if (\n queuedActiveDescendant.current &&\n !document.getElementById(queuedActiveDescendant.current)\n ) {\n // If we recieve a focus event refocusing the collection, either we have newly refocused the input and are waiting for the\n // wrapped collection to refocus the previously focused node if any OR\n // we are in a state where we've filtered to such a point that there aren't any matching items in the collection to focus.\n // In this case we want to clear tracked item if any and clear active descendant\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n }\n\n delayNextActiveDescendant.current = false;\n });\n\n let [collectionNode, setCollectionNode] = useState<HTMLElement | null>(null);\n let callbackRef = useCallback(node => {\n setCollectionNode(node);\n if (node != null) {\n // If useSelectableCollection isn't passed shouldUseVirtualFocus even when useAutocomplete provides it\n // that means the collection doesn't support it (e.g. Table). If that is the case, we need to disable it here regardless\n // of what the user's provided so that the input doesn't recieve the onKeyDown and autocomplete props.\n if (node.getAttribute('tabindex') != null) {\n setShouldUseVirtualFocus(false);\n }\n setHasCollection(true);\n } else {\n setHasCollection(false);\n }\n }, []);\n useLayoutEffect(() => {\n if (collectionNode != null) {\n // When typing forward, we want to delay the setting of active descendant to not interrupt the native screen reader announcement\n // of the letter you just typed. If we recieve another focus event then we clear the queued update\n collectionNode.addEventListener('focusin', updateActiveDescendantEvent);\n }\n return () => {\n collectionNode?.removeEventListener('focusin', updateActiveDescendantEvent);\n };\n }, [collectionNode]);\n\n // Make sure to memo so that React doesn't keep registering a new event listeners on every rerender of the wrapped collection\n let mergedCollectionRef = useObjectRef(\n // oxlint-disable-next-line react/react-compiler\n useMemo(() => mergeRefs(collectionRef, callbackRef), [collectionRef, callbackRef])\n );\n\n let focusFirstItem = useCallback(() => {\n if (!collectionRef.current) {\n setAutoFocusOnMount(true);\n return;\n }\n\n delayNextActiveDescendant.current = true;\n collectionRef.current?.dispatchEvent(\n new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n focusStrategy: 'first'\n }\n })\n );\n }, [collectionRef]);\n\n let clearVirtualFocus = useCallback(\n (clearFocusKey?: boolean) => {\n setAutoFocusOnMount(false);\n moveVirtualFocus(getActiveElement());\n queuedActiveDescendant.current = null;\n state.setFocusedNodeId(null);\n let clearFocusEvent = new CustomEvent(CLEAR_FOCUS_EVENT, {\n cancelable: true,\n bubbles: true,\n detail: {\n clearFocusKey\n }\n });\n clearTimeout(timeout.current);\n delayNextActiveDescendant.current = false;\n collectionRef.current?.dispatchEvent(clearFocusEvent);\n },\n [collectionRef, state]\n );\n\n let lastInputType = useRef('');\n useEvent(inputRef, 'beforeinput', e => {\n let {inputType} = e as InputEvent;\n lastInputType.current = inputType;\n });\n\n let onChange = (value: string) => {\n // Tell wrapped collection to focus the first element in the list when typing forward and to clear focused key when modifying the text via\n // copy paste/backspacing/undo/redo for screen reader announcements\n if (\n (lastInputType.current === 'insertText' ||\n // IME composition (e.g. CJK input) reports 'insertCompositionText'/'insertFromComposition'\n // instead of 'insertText'. Treat these as forward typing so the first item gets virtual focus.\n lastInputType.current === 'insertCompositionText' ||\n lastInputType.current === 'insertFromComposition') &&\n !disableAutoFocusFirst\n ) {\n focusFirstItem();\n } else if (\n lastInputType.current &&\n (lastInputType.current.includes('insert') ||\n lastInputType.current.includes('delete') ||\n lastInputType.current.includes('history'))\n ) {\n clearVirtualFocus(true);\n\n // If onChange was triggered before the timeout actually updated the activedescendant, we need to fire\n // our own dispatchVirtualFocus so focusVisible gets reapplied on the input\n if (getVirtuallyFocusedElement(document) === inputRef.current) {\n dispatchVirtualFocus(inputRef.current!, null);\n }\n }\n\n state.setInputValue(value);\n };\n\n let keyDownTarget = useRef<Element | null>(null);\n // For textfield specific keydown operations\n let onKeyDown = (e: BaseEvent<ReactKeyboardEvent<any>>) => {\n keyDownTarget.current = getEventTarget(e) as Element;\n if (e.nativeEvent.isComposing) {\n return;\n }\n\n let focusedNodeId = queuedActiveDescendant.current;\n if (\n focusedNodeId !== null &&\n getOwnerDocument(inputRef.current).getElementById(focusedNodeId) == null\n ) {\n // if the focused id doesn't exist in document, then we need to clear the tracked focused node, otherwise\n // we will be attempting to fire key events on a non-existing node instead of trying to focus the newly swapped wrapped collection.\n // This can happen if you are swapping out the Autocomplete wrapped collection component like in the docs search.\n queuedActiveDescendant.current = null;\n focusedNodeId = null;\n }\n\n switch (e.key) {\n case 'a':\n if (isCtrlKeyPressed(e)) {\n return;\n }\n break;\n case 'Escape':\n // Early return for Escape here so it doesn't leak the Escape event from the simulated collection event below and\n // close the dialog prematurely. Ideally that should be up to the discretion of the input element hence the check\n // for isPropagationStopped\n if (e.isDefaultPrevented()) {\n return;\n }\n break;\n case ' ':\n // Space shouldn't trigger onAction so early return.\n return;\n case 'Tab':\n // Don't propogate Tab down to the collection, otherwise we will try to focus the collection via useSelectableCollection's Tab handler (aka shift tab logic)\n // We want FocusScope to handle Tab if one exists (aka sub dialog), so special casepropogate\n if ('continuePropagation' in e) {\n e.continuePropagation();\n }\n return;\n case 'Home':\n case 'End':\n case 'PageDown':\n case 'PageUp':\n case 'ArrowUp':\n case 'ArrowDown':\n case 'ArrowRight':\n case 'ArrowLeft': {\n if ((e.key === 'Home' || e.key === 'End') && focusedNodeId == null && e.shiftKey) {\n return;\n }\n\n // If there is text within the input field, we'll want continue propagating events down\n // to the wrapped collection if there is a focused node so that a user can continue moving the\n // virtual focus. However, if the user doesn't have a focus in the collection, just move the text\n // cursor instead. They can move focus down into the collection via down/up arrow if need be\n if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n if (focusedNodeId == null) {\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n return;\n }\n\n break;\n }\n\n // Prevent these keys from moving the text cursor in the input\n e.preventDefault();\n // Move virtual focus into the wrapped collection\n let focusCollection = new CustomEvent(FOCUS_EVENT, {\n cancelable: true,\n bubbles: true\n });\n\n collectionRef.current?.dispatchEvent(focusCollection);\n break;\n }\n }\n\n // Emulate the keyboard events that happen in the input field in the wrapped collection. This is for triggering things like onAction via Enter\n // or moving focus from one item to another. Stop propagation on the input event if it isn't already stopped so it doesn't leak out. For events\n // like ESC, the dispatched event below will bubble out of the collection and be stopped if handled by useSelectableCollection, otherwise will bubble\n // as expected\n if (!e.isPropagationStopped()) {\n e.stopPropagation();\n }\n\n let shouldPerformDefaultAction = true;\n if (collectionRef.current !== null) {\n if (focusedNodeId == null) {\n shouldPerformDefaultAction =\n collectionRef.current?.dispatchEvent(\n new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)\n ) || false;\n } else {\n let item = document.getElementById(focusedNodeId);\n if (item) {\n shouldPerformDefaultAction =\n item?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type, e.nativeEvent)) || false;\n }\n }\n }\n\n if (shouldPerformDefaultAction) {\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowRight': {\n // Clear the activedescendant so NVDA announcements aren't interrupted but retain the focused key in the collection so the\n // user's keyboard navigation restarts from where they left off\n clearVirtualFocus();\n break;\n }\n case 'Enter':\n // Trigger click action on item when Enter key was pressed.\n if (focusedNodeId != null) {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new PointerEvent('click', e.nativeEvent));\n }\n break;\n }\n } else {\n // TODO: check if we can do this, want to stop textArea from using its default Enter behavior so items are properly triggered\n e.preventDefault();\n }\n };\n\n let onKeyUpCapture = useEffectEvent(e => {\n // Dispatch simulated key up events for things like triggering links in listbox\n // Make sure to stop the propagation of the input keyup event so that the simulated keyup/down pair\n // is detected by usePress instead of the original keyup originating from the input\n if (getEventTarget(e) === keyDownTarget.current) {\n e.stopImmediatePropagation();\n let focusedNodeId = queuedActiveDescendant.current;\n if (focusedNodeId == null) {\n collectionRef.current?.dispatchEvent(new KeyboardEvent(e.type, e));\n } else {\n let item = document.getElementById(focusedNodeId);\n item?.dispatchEvent(new KeyboardEvent(e.type, e));\n }\n }\n });\n\n useEffect(() => {\n document.addEventListener('keyup', onKeyUpCapture, true);\n return () => {\n document.removeEventListener('keyup', onKeyUpCapture, true);\n };\n }, []);\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/autocomplete');\n let collectionProps = useLabels({\n id: collectionId,\n 'aria-label': stringFormatter.format('collectionLabel')\n });\n\n let filterFn = useCallback(\n (nodeTextValue: string, node: Node<T>) => {\n if (filter) {\n return filter(nodeTextValue, state.inputValue, node);\n }\n\n return true;\n },\n [state.inputValue, filter]\n );\n\n // Be sure to clear/restore the virtual + collection focus when blurring/refocusing the field so we only show the\n // focus ring on the virtually focused collection when are actually interacting with the Autocomplete\n let onBlur = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let lastFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (lastFocusedNode) {\n dispatchVirtualBlur(lastFocusedNode, e.relatedTarget);\n }\n };\n\n let onFocus = (e: ReactFocusEvent) => {\n if (!e.isTrusted) {\n return;\n }\n\n let curFocusedNode = queuedActiveDescendant.current\n ? document.getElementById(queuedActiveDescendant.current)\n : null;\n if (curFocusedNode) {\n let target = getEventTarget(e);\n queueMicrotask(() => {\n // instead of focusing the last focused node, just focus the collection instead and have the collection handle what item to focus via useSelectableCollection/Item\n dispatchVirtualBlur(target, collectionRef.current);\n dispatchVirtualFocus(collectionRef.current!, target);\n });\n }\n };\n\n // Clicking back into the input can happen after focus moved elsewhere in the dialog, while\n // virtual focus is still on an option. Clear virtual focus on pointer down so mouse\n // interactions restore the input state before the click's focus handling runs.\n // Touch is excluded because touch interactions should not move focus back to the input.\n let onPointerDown = (e: ReactPointerEvent) => {\n if (\n e.button !== 0 ||\n e.pointerType === 'touch' ||\n queuedActiveDescendant.current == null ||\n inputRef.current == null\n ) {\n return;\n }\n\n if (getEventTarget(e) === inputRef.current) {\n clearVirtualFocus();\n }\n };\n\n // Only apply the autocomplete specific behaviors if the collection component wrapped by it is actually\n // being filtered/allows filtering by the Autocomplete.\n let inputProps = {\n value: state.inputValue,\n onChange\n } as AriaTextFieldProps<FocusableElement>;\n\n let virtualFocusProps = {\n onKeyDown,\n 'aria-activedescendant': state.focusedNodeId ?? undefined,\n onBlur,\n onFocus,\n onPointerDown\n };\n\n inputProps = {\n ...inputProps,\n ...(shouldUseVirtualFocus && hasCollection && virtualFocusProps),\n enterKeyHint: 'go',\n 'aria-controls': hasCollection ? collectionId : undefined,\n // TODO: readd proper logic for completionMode = complete (aria-autocomplete: both)\n 'aria-autocomplete': 'list',\n // This disable's iOS's autocorrect suggestions, since the autocomplete provides its own suggestions.\n autoCorrect: 'off',\n // This disable's the macOS Safari spell check auto corrections.\n spellCheck: 'false',\n autoComplete: 'off'\n };\n\n return {\n inputProps,\n collectionProps: mergeProps(collectionProps, {\n shouldUseVirtualFocus,\n disallowTypeAhead: shouldUseVirtualFocus,\n autoFocus: autoFocusOnMount ? 'first' : false\n }),\n collectionRef: mergedCollectionRef,\n filter: filter != null ? filterFn : undefined\n };\n}\n"],"names":[],"version":3,"file":"useAutocomplete.mjs.map"}
|
|
@@ -28,9 +28,11 @@ function $63c4f1a143b4577e$export$452b38fce62c9384(props, ref) {
|
|
|
28
28
|
let itemProps = {};
|
|
29
29
|
if (!isHeading) itemProps = linkProps;
|
|
30
30
|
if (isCurrent) {
|
|
31
|
+
// oxlint-disable-next-line react/react-compiler
|
|
31
32
|
itemProps['aria-current'] = ariaCurrent || 'page';
|
|
32
33
|
// isCurrent sets isDisabled === true for the current item,
|
|
33
34
|
// so we have to restore the tabIndex in order to support autoFocus.
|
|
35
|
+
// oxlint-disable-next-line react/react-compiler
|
|
34
36
|
itemProps.tabIndex = props.autoFocus ? -1 : undefined;
|
|
35
37
|
}
|
|
36
38
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6CM,SAAS,0CACd,KAA8B,EAC9B,GAAuC;IAEvC,IAAI,aACF,SAAS,cACT,UAAU,EACV,gBAAgB,WAAW,eAC3B,cAAc,KACd,GAAG,YACJ,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAM,EAAE;QAAC,YAAY,cAAc;qBAAW;QAAa,GAAG,UAAU;IAAA,GAAG;IAC7F,IAAI,YAAY,WAAW,IAAI,CAAC;IAChC,IAAI,YAA2B,CAAC;IAEhC,IAAI,CAAC,WACH,YAAY;IAGd,IAAI,WAAW;QACb,SAAS,CAAC,eAAe,GAAG,eAAe;QAC3C,2DAA2D;QAC3D,oEAAoE;QACpE,UAAU,QAAQ,GAAG,MAAM,SAAS,GAAG,KAAK;IAC9C;IAEA,OAAO;QACL,WAAW;YACT,iBAAiB;YACjB,GAAG,SAAS;QACd;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbItem.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 {AriaLinkProps, useLink} from '../link/useLink';\nimport {\n DOMAttributes,\n DOMProps,\n FocusableElement,\n LinkDOMProps,\n RefObject\n} from '@react-types/shared';\nimport {ReactNode} from 'react';\n\nexport interface BreadcrumbItemProps extends AriaLinkProps, LinkDOMProps {\n /** Whether the breadcrumb item represents the current page. */\n isCurrent?: boolean;\n /**\n * The type of current location the breadcrumb item represents, if `isCurrent` is true.\n *\n * @default 'page'\n */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false';\n /** Whether the breadcrumb item is disabled. */\n isDisabled?: boolean;\n /** The contents of the breadcrumb item. */\n children: ReactNode;\n}\n\nexport interface AriaBreadcrumbItemProps extends BreadcrumbItemProps, DOMProps {\n /**\n * The HTML element used to render the breadcrumb link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface BreadcrumbItemAria {\n /** Props for the breadcrumb item link element. */\n itemProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an in a breadcrumbs component.\n * See `useBreadcrumbs` for details about breadcrumbs.\n */\nexport function useBreadcrumbItem(\n props: AriaBreadcrumbItemProps,\n ref: RefObject<FocusableElement | null>\n): BreadcrumbItemAria {\n let {\n isCurrent,\n isDisabled,\n 'aria-current': ariaCurrent,\n elementType = 'a',\n ...otherProps\n } = props;\n\n let {linkProps} = useLink({isDisabled: isDisabled || isCurrent, elementType, ...otherProps}, ref);\n let isHeading = /^h[1-6]$/.test(elementType);\n let itemProps: DOMAttributes = {};\n\n if (!isHeading) {\n itemProps = linkProps;\n }\n\n if (isCurrent) {\n itemProps['aria-current'] = ariaCurrent || 'page';\n // isCurrent sets isDisabled === true for the current item,\n // so we have to restore the tabIndex in order to support autoFocus.\n itemProps.tabIndex = props.autoFocus ? -1 : undefined;\n }\n\n return {\n itemProps: {\n 'aria-disabled': isDisabled,\n ...itemProps\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbItem.cjs.map"}
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6CM,SAAS,0CACd,KAA8B,EAC9B,GAAuC;IAEvC,IAAI,aACF,SAAS,cACT,UAAU,EACV,gBAAgB,WAAW,eAC3B,cAAc,KACd,GAAG,YACJ,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAM,EAAE;QAAC,YAAY,cAAc;qBAAW;QAAa,GAAG,UAAU;IAAA,GAAG;IAC7F,IAAI,YAAY,WAAW,IAAI,CAAC;IAChC,IAAI,YAA2B,CAAC;IAEhC,IAAI,CAAC,WACH,YAAY;IAGd,IAAI,WAAW;QACb,gDAAgD;QAChD,SAAS,CAAC,eAAe,GAAG,eAAe;QAC3C,2DAA2D;QAC3D,oEAAoE;QACpE,gDAAgD;QAChD,UAAU,QAAQ,GAAG,MAAM,SAAS,GAAG,KAAK;IAC9C;IAEA,OAAO;QACL,WAAW;YACT,iBAAiB;YACjB,GAAG,SAAS;QACd;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbItem.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 {AriaLinkProps, useLink} from '../link/useLink';\nimport {\n DOMAttributes,\n DOMProps,\n FocusableElement,\n LinkDOMProps,\n RefObject\n} from '@react-types/shared';\nimport {ReactNode} from 'react';\n\nexport interface BreadcrumbItemProps extends AriaLinkProps, LinkDOMProps {\n /** Whether the breadcrumb item represents the current page. */\n isCurrent?: boolean;\n /**\n * The type of current location the breadcrumb item represents, if `isCurrent` is true.\n *\n * @default 'page'\n */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false';\n /** Whether the breadcrumb item is disabled. */\n isDisabled?: boolean;\n /** The contents of the breadcrumb item. */\n children: ReactNode;\n}\n\nexport interface AriaBreadcrumbItemProps extends BreadcrumbItemProps, DOMProps {\n /**\n * The HTML element used to render the breadcrumb link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface BreadcrumbItemAria {\n /** Props for the breadcrumb item link element. */\n itemProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an in a breadcrumbs component.\n * See `useBreadcrumbs` for details about breadcrumbs.\n */\nexport function useBreadcrumbItem(\n props: AriaBreadcrumbItemProps,\n ref: RefObject<FocusableElement | null>\n): BreadcrumbItemAria {\n let {\n isCurrent,\n isDisabled,\n 'aria-current': ariaCurrent,\n elementType = 'a',\n ...otherProps\n } = props;\n\n let {linkProps} = useLink({isDisabled: isDisabled || isCurrent, elementType, ...otherProps}, ref);\n let isHeading = /^h[1-6]$/.test(elementType);\n let itemProps: DOMAttributes = {};\n\n if (!isHeading) {\n itemProps = linkProps;\n }\n\n if (isCurrent) {\n // oxlint-disable-next-line react/react-compiler\n itemProps['aria-current'] = ariaCurrent || 'page';\n // isCurrent sets isDisabled === true for the current item,\n // so we have to restore the tabIndex in order to support autoFocus.\n // oxlint-disable-next-line react/react-compiler\n itemProps.tabIndex = props.autoFocus ? -1 : undefined;\n }\n\n return {\n itemProps: {\n 'aria-disabled': isDisabled,\n ...itemProps\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbItem.cjs.map"}
|
|
@@ -22,9 +22,11 @@ function $3544e2ba99f68ddf$export$452b38fce62c9384(props, ref) {
|
|
|
22
22
|
let itemProps = {};
|
|
23
23
|
if (!isHeading) itemProps = linkProps;
|
|
24
24
|
if (isCurrent) {
|
|
25
|
+
// oxlint-disable-next-line react/react-compiler
|
|
25
26
|
itemProps['aria-current'] = ariaCurrent || 'page';
|
|
26
27
|
// isCurrent sets isDisabled === true for the current item,
|
|
27
28
|
// so we have to restore the tabIndex in order to support autoFocus.
|
|
29
|
+
// oxlint-disable-next-line react/react-compiler
|
|
28
30
|
itemProps.tabIndex = props.autoFocus ? -1 : undefined;
|
|
29
31
|
}
|
|
30
32
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AA6CM,SAAS,0CACd,KAA8B,EAC9B,GAAuC;IAEvC,IAAI,aACF,SAAS,cACT,UAAU,EACV,gBAAgB,WAAW,eAC3B,cAAc,KACd,GAAG,YACJ,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAM,EAAE;QAAC,YAAY,cAAc;qBAAW;QAAa,GAAG,UAAU;IAAA,GAAG;IAC7F,IAAI,YAAY,WAAW,IAAI,CAAC;IAChC,IAAI,YAA2B,CAAC;IAEhC,IAAI,CAAC,WACH,YAAY;IAGd,IAAI,WAAW;QACb,SAAS,CAAC,eAAe,GAAG,eAAe;QAC3C,2DAA2D;QAC3D,oEAAoE;QACpE,UAAU,QAAQ,GAAG,MAAM,SAAS,GAAG,KAAK;IAC9C;IAEA,OAAO;QACL,WAAW;YACT,iBAAiB;YACjB,GAAG,SAAS;QACd;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbItem.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 {AriaLinkProps, useLink} from '../link/useLink';\nimport {\n DOMAttributes,\n DOMProps,\n FocusableElement,\n LinkDOMProps,\n RefObject\n} from '@react-types/shared';\nimport {ReactNode} from 'react';\n\nexport interface BreadcrumbItemProps extends AriaLinkProps, LinkDOMProps {\n /** Whether the breadcrumb item represents the current page. */\n isCurrent?: boolean;\n /**\n * The type of current location the breadcrumb item represents, if `isCurrent` is true.\n *\n * @default 'page'\n */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false';\n /** Whether the breadcrumb item is disabled. */\n isDisabled?: boolean;\n /** The contents of the breadcrumb item. */\n children: ReactNode;\n}\n\nexport interface AriaBreadcrumbItemProps extends BreadcrumbItemProps, DOMProps {\n /**\n * The HTML element used to render the breadcrumb link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface BreadcrumbItemAria {\n /** Props for the breadcrumb item link element. */\n itemProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an in a breadcrumbs component.\n * See `useBreadcrumbs` for details about breadcrumbs.\n */\nexport function useBreadcrumbItem(\n props: AriaBreadcrumbItemProps,\n ref: RefObject<FocusableElement | null>\n): BreadcrumbItemAria {\n let {\n isCurrent,\n isDisabled,\n 'aria-current': ariaCurrent,\n elementType = 'a',\n ...otherProps\n } = props;\n\n let {linkProps} = useLink({isDisabled: isDisabled || isCurrent, elementType, ...otherProps}, ref);\n let isHeading = /^h[1-6]$/.test(elementType);\n let itemProps: DOMAttributes = {};\n\n if (!isHeading) {\n itemProps = linkProps;\n }\n\n if (isCurrent) {\n itemProps['aria-current'] = ariaCurrent || 'page';\n // isCurrent sets isDisabled === true for the current item,\n // so we have to restore the tabIndex in order to support autoFocus.\n itemProps.tabIndex = props.autoFocus ? -1 : undefined;\n }\n\n return {\n itemProps: {\n 'aria-disabled': isDisabled,\n ...itemProps\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbItem.js.map"}
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AA6CM,SAAS,0CACd,KAA8B,EAC9B,GAAuC;IAEvC,IAAI,aACF,SAAS,cACT,UAAU,EACV,gBAAgB,WAAW,eAC3B,cAAc,KACd,GAAG,YACJ,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAM,EAAE;QAAC,YAAY,cAAc;qBAAW;QAAa,GAAG,UAAU;IAAA,GAAG;IAC7F,IAAI,YAAY,WAAW,IAAI,CAAC;IAChC,IAAI,YAA2B,CAAC;IAEhC,IAAI,CAAC,WACH,YAAY;IAGd,IAAI,WAAW;QACb,gDAAgD;QAChD,SAAS,CAAC,eAAe,GAAG,eAAe;QAC3C,2DAA2D;QAC3D,oEAAoE;QACpE,gDAAgD;QAChD,UAAU,QAAQ,GAAG,MAAM,SAAS,GAAG,KAAK;IAC9C;IAEA,OAAO;QACL,WAAW;YACT,iBAAiB;YACjB,GAAG,SAAS;QACd;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbItem.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 {AriaLinkProps, useLink} from '../link/useLink';\nimport {\n DOMAttributes,\n DOMProps,\n FocusableElement,\n LinkDOMProps,\n RefObject\n} from '@react-types/shared';\nimport {ReactNode} from 'react';\n\nexport interface BreadcrumbItemProps extends AriaLinkProps, LinkDOMProps {\n /** Whether the breadcrumb item represents the current page. */\n isCurrent?: boolean;\n /**\n * The type of current location the breadcrumb item represents, if `isCurrent` is true.\n *\n * @default 'page'\n */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false';\n /** Whether the breadcrumb item is disabled. */\n isDisabled?: boolean;\n /** The contents of the breadcrumb item. */\n children: ReactNode;\n}\n\nexport interface AriaBreadcrumbItemProps extends BreadcrumbItemProps, DOMProps {\n /**\n * The HTML element used to render the breadcrumb link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface BreadcrumbItemAria {\n /** Props for the breadcrumb item link element. */\n itemProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an in a breadcrumbs component.\n * See `useBreadcrumbs` for details about breadcrumbs.\n */\nexport function useBreadcrumbItem(\n props: AriaBreadcrumbItemProps,\n ref: RefObject<FocusableElement | null>\n): BreadcrumbItemAria {\n let {\n isCurrent,\n isDisabled,\n 'aria-current': ariaCurrent,\n elementType = 'a',\n ...otherProps\n } = props;\n\n let {linkProps} = useLink({isDisabled: isDisabled || isCurrent, elementType, ...otherProps}, ref);\n let isHeading = /^h[1-6]$/.test(elementType);\n let itemProps: DOMAttributes = {};\n\n if (!isHeading) {\n itemProps = linkProps;\n }\n\n if (isCurrent) {\n // oxlint-disable-next-line react/react-compiler\n itemProps['aria-current'] = ariaCurrent || 'page';\n // isCurrent sets isDisabled === true for the current item,\n // so we have to restore the tabIndex in order to support autoFocus.\n // oxlint-disable-next-line react/react-compiler\n itemProps.tabIndex = props.autoFocus ? -1 : undefined;\n }\n\n return {\n itemProps: {\n 'aria-disabled': isDisabled,\n ...itemProps\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbItem.js.map"}
|
|
@@ -22,9 +22,11 @@ function $9db6b1f57564cbf4$export$452b38fce62c9384(props, ref) {
|
|
|
22
22
|
let itemProps = {};
|
|
23
23
|
if (!isHeading) itemProps = linkProps;
|
|
24
24
|
if (isCurrent) {
|
|
25
|
+
// oxlint-disable-next-line react/react-compiler
|
|
25
26
|
itemProps['aria-current'] = ariaCurrent || 'page';
|
|
26
27
|
// isCurrent sets isDisabled === true for the current item,
|
|
27
28
|
// so we have to restore the tabIndex in order to support autoFocus.
|
|
29
|
+
// oxlint-disable-next-line react/react-compiler
|
|
28
30
|
itemProps.tabIndex = props.autoFocus ? -1 : undefined;
|
|
29
31
|
}
|
|
30
32
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAAA;;;;;;;;;;CAUC;AA6CM,SAAS,0CACd,KAA8B,EAC9B,GAAuC;IAEvC,IAAI,aACF,SAAS,cACT,UAAU,EACV,gBAAgB,WAAW,eAC3B,cAAc,KACd,GAAG,YACJ,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAM,EAAE;QAAC,YAAY,cAAc;qBAAW;QAAa,GAAG,UAAU;IAAA,GAAG;IAC7F,IAAI,YAAY,WAAW,IAAI,CAAC;IAChC,IAAI,YAA2B,CAAC;IAEhC,IAAI,CAAC,WACH,YAAY;IAGd,IAAI,WAAW;QACb,SAAS,CAAC,eAAe,GAAG,eAAe;QAC3C,2DAA2D;QAC3D,oEAAoE;QACpE,UAAU,QAAQ,GAAG,MAAM,SAAS,GAAG,KAAK;IAC9C;IAEA,OAAO;QACL,WAAW;YACT,iBAAiB;YACjB,GAAG,SAAS;QACd;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbItem.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 {AriaLinkProps, useLink} from '../link/useLink';\nimport {\n DOMAttributes,\n DOMProps,\n FocusableElement,\n LinkDOMProps,\n RefObject\n} from '@react-types/shared';\nimport {ReactNode} from 'react';\n\nexport interface BreadcrumbItemProps extends AriaLinkProps, LinkDOMProps {\n /** Whether the breadcrumb item represents the current page. */\n isCurrent?: boolean;\n /**\n * The type of current location the breadcrumb item represents, if `isCurrent` is true.\n *\n * @default 'page'\n */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false';\n /** Whether the breadcrumb item is disabled. */\n isDisabled?: boolean;\n /** The contents of the breadcrumb item. */\n children: ReactNode;\n}\n\nexport interface AriaBreadcrumbItemProps extends BreadcrumbItemProps, DOMProps {\n /**\n * The HTML element used to render the breadcrumb link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface BreadcrumbItemAria {\n /** Props for the breadcrumb item link element. */\n itemProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an in a breadcrumbs component.\n * See `useBreadcrumbs` for details about breadcrumbs.\n */\nexport function useBreadcrumbItem(\n props: AriaBreadcrumbItemProps,\n ref: RefObject<FocusableElement | null>\n): BreadcrumbItemAria {\n let {\n isCurrent,\n isDisabled,\n 'aria-current': ariaCurrent,\n elementType = 'a',\n ...otherProps\n } = props;\n\n let {linkProps} = useLink({isDisabled: isDisabled || isCurrent, elementType, ...otherProps}, ref);\n let isHeading = /^h[1-6]$/.test(elementType);\n let itemProps: DOMAttributes = {};\n\n if (!isHeading) {\n itemProps = linkProps;\n }\n\n if (isCurrent) {\n itemProps['aria-current'] = ariaCurrent || 'page';\n // isCurrent sets isDisabled === true for the current item,\n // so we have to restore the tabIndex in order to support autoFocus.\n itemProps.tabIndex = props.autoFocus ? -1 : undefined;\n }\n\n return {\n itemProps: {\n 'aria-disabled': isDisabled,\n ...itemProps\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbItem.mjs.map"}
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC;AA6CM,SAAS,0CACd,KAA8B,EAC9B,GAAuC;IAEvC,IAAI,aACF,SAAS,cACT,UAAU,EACV,gBAAgB,WAAW,eAC3B,cAAc,KACd,GAAG,YACJ,GAAG;IAEJ,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAM,EAAE;QAAC,YAAY,cAAc;qBAAW;QAAa,GAAG,UAAU;IAAA,GAAG;IAC7F,IAAI,YAAY,WAAW,IAAI,CAAC;IAChC,IAAI,YAA2B,CAAC;IAEhC,IAAI,CAAC,WACH,YAAY;IAGd,IAAI,WAAW;QACb,gDAAgD;QAChD,SAAS,CAAC,eAAe,GAAG,eAAe;QAC3C,2DAA2D;QAC3D,oEAAoE;QACpE,gDAAgD;QAChD,UAAU,QAAQ,GAAG,MAAM,SAAS,GAAG,KAAK;IAC9C;IAEA,OAAO;QACL,WAAW;YACT,iBAAiB;YACjB,GAAG,SAAS;QACd;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbItem.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 {AriaLinkProps, useLink} from '../link/useLink';\nimport {\n DOMAttributes,\n DOMProps,\n FocusableElement,\n LinkDOMProps,\n RefObject\n} from '@react-types/shared';\nimport {ReactNode} from 'react';\n\nexport interface BreadcrumbItemProps extends AriaLinkProps, LinkDOMProps {\n /** Whether the breadcrumb item represents the current page. */\n isCurrent?: boolean;\n /**\n * The type of current location the breadcrumb item represents, if `isCurrent` is true.\n *\n * @default 'page'\n */\n 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | boolean | 'true' | 'false';\n /** Whether the breadcrumb item is disabled. */\n isDisabled?: boolean;\n /** The contents of the breadcrumb item. */\n children: ReactNode;\n}\n\nexport interface AriaBreadcrumbItemProps extends BreadcrumbItemProps, DOMProps {\n /**\n * The HTML element used to render the breadcrumb link, e.g. 'a', or 'span'.\n *\n * @default 'a'\n */\n elementType?: string;\n}\n\nexport interface BreadcrumbItemAria {\n /** Props for the breadcrumb item link element. */\n itemProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for an in a breadcrumbs component.\n * See `useBreadcrumbs` for details about breadcrumbs.\n */\nexport function useBreadcrumbItem(\n props: AriaBreadcrumbItemProps,\n ref: RefObject<FocusableElement | null>\n): BreadcrumbItemAria {\n let {\n isCurrent,\n isDisabled,\n 'aria-current': ariaCurrent,\n elementType = 'a',\n ...otherProps\n } = props;\n\n let {linkProps} = useLink({isDisabled: isDisabled || isCurrent, elementType, ...otherProps}, ref);\n let isHeading = /^h[1-6]$/.test(elementType);\n let itemProps: DOMAttributes = {};\n\n if (!isHeading) {\n itemProps = linkProps;\n }\n\n if (isCurrent) {\n // oxlint-disable-next-line react/react-compiler\n itemProps['aria-current'] = ariaCurrent || 'page';\n // isCurrent sets isDisabled === true for the current item,\n // so we have to restore the tabIndex in order to support autoFocus.\n // oxlint-disable-next-line react/react-compiler\n itemProps.tabIndex = props.autoFocus ? -1 : undefined;\n }\n\n return {\n itemProps: {\n 'aria-disabled': isDisabled,\n ...itemProps\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbItem.mjs.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;AAkBM,SAAS,0CAAe,KAA2B;IACxD,IAAI,EAAC,cAAc,SAAS,EAAE,GAAG,YAAW,GAAG;IAE/C,IAAI,UAAU,CAAA,GAAA,qDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IACxD,OAAO;QACL,UAAU;YACR,GAAG,CAAA,GAAA,wCAAa,EAAE,YAAY;gBAAC,WAAW;YAAI,EAAE;YAChD,cAAc,aAAa,QAAQ,MAAM,CAAC;QAC5C;IACF;AACF","sources":["packages/react-aria/src/breadcrumbs/useBreadcrumbs.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 {AriaLabelingProps, DOMAttributes, DOMProps} from '@react-types/shared';\nimport {filterDOMProps} from '../utils/filterDOMProps';\nimport intlMessages from '../../intl/breadcrumbs/*.json';\nimport {useLocalizedStringFormatter} from '../i18n/useLocalizedStringFormatter';\n\nexport interface AriaBreadcrumbsProps extends DOMProps, AriaLabelingProps {}\n\nexport interface BreadcrumbsAria {\n /** Props for the breadcrumbs navigation element. */\n navProps: DOMAttributes;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a breadcrumbs component.\n * Breadcrumbs display a hierarchy of links to the current page or resource in an application.\n */\nexport function useBreadcrumbs(props: AriaBreadcrumbsProps): BreadcrumbsAria {\n let {'aria-label': ariaLabel, ...otherProps} = props;\n\n let strings = useLocalizedStringFormatter(intlMessages, '@react-aria/breadcrumbs');\n return {\n navProps: {\n ...filterDOMProps(otherProps, {labelable: true}),\n 'aria-label': ariaLabel || strings.format('breadcrumbs')\n }\n };\n}\n"],"names":[],"version":3,"file":"useBreadcrumbs.cjs.map"}
|