@proyecto-viviana/solidaria 0.3.0 → 0.4.1
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/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +141 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +141 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/announce.js +207 -0
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/announce.jsx +207 -0
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +244 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +244 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +121 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +121 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +275 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +275 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1037 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1037 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +235 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +235 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1458 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1458 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +1062 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +1062 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +61 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +61 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +55 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +55 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +105 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +105 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +120 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +120 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormReset.js +39 -0
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/createFormReset.jsx +39 -0
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +131 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +131 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +268 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +268 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +47 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +47 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +32 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +32 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +82 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +82 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +302 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +302 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +159 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +159 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1706 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1706 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +2395 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +2395 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +87 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +87 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +631 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +631 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +369 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +369 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +199 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +199 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +331 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +325 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +97 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +97 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +356 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +356 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +519 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +519 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +259 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +259 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +320 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +320 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +210 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +210 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +406 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +397 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +666 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +666 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +256 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +256 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1088 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1088 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +263 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +263 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +322 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +322 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +110 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +110 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +226 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +226 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +452 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +452 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +705 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +705 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +93 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +93 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -0
- package/dist/dnd/index.jsx +3 -0
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +7 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -0
- package/dist/focus/index.jsx +3 -0
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.jsx +5 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -18311
- package/dist/index.jsx +77 -18242
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +9 -0
- package/dist/interactions/index.jsx +9 -0
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +7 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +5 -0
- package/dist/selection/index.jsx +5 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +35 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +5 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +49 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.jsx +6 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +202 -35
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +5 -4
- package/src/calendar/createCalendarCell.ts +36 -5
- package/src/calendar/createCalendarGrid.ts +47 -12
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +27 -15
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/index.ts +17 -0
- package/src/calendar/intl/index.ts +8 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -384
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +488 -371
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +63 -3
- package/src/focus/FocusScope.tsx +266 -24
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +187 -48
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +51 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +26 -15
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +203 -10
- package/src/listbox/createOption.ts +84 -74
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +41 -4
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +512 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +82 -27
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +208 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +37 -1
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +95 -24
- package/src/tag/createTag.ts +30 -36
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -94
- package/src/tree/createTree.ts +165 -52
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +243 -0
- package/src/utils/dom.ts +216 -25
- package/src/utils/index.ts +10 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import { i as getActiveElement$1, s as getOwnerDocument, t as focusSafely } from "./focus.js";
|
|
2
|
+
import { createSignal, onCleanup, onMount } from "solid-js";
|
|
3
|
+
import { isServer } from "solid-js/web";
|
|
4
|
+
//#region src/focus/createFocusRestore.ts
|
|
5
|
+
/**
|
|
6
|
+
* Focus restoration utilities for solidaria
|
|
7
|
+
*
|
|
8
|
+
* Provides enhanced focus restoration with retry logic, cross-scope tracking,
|
|
9
|
+
* and safe restoration patterns.
|
|
10
|
+
*/
|
|
11
|
+
const focusStack = [];
|
|
12
|
+
/**
|
|
13
|
+
* Push an element onto the focus stack.
|
|
14
|
+
*/
|
|
15
|
+
function pushFocusStack(element) {
|
|
16
|
+
focusStack.push(element);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Pop the last element from the focus stack.
|
|
20
|
+
*/
|
|
21
|
+
function popFocusStack() {
|
|
22
|
+
return focusStack.pop();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the current focus stack length.
|
|
26
|
+
*/
|
|
27
|
+
function getFocusStackLength() {
|
|
28
|
+
return focusStack.length;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Clear the entire focus stack.
|
|
32
|
+
*/
|
|
33
|
+
function clearFocusStack() {
|
|
34
|
+
focusStack.length = 0;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gets the active element, accounting for shadow DOM.
|
|
38
|
+
*/
|
|
39
|
+
function getActiveElement(doc) {
|
|
40
|
+
let activeElement = doc.activeElement;
|
|
41
|
+
while (activeElement?.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot.activeElement;
|
|
42
|
+
return activeElement;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Checks if an element is still valid for focus restoration.
|
|
46
|
+
*/
|
|
47
|
+
function isValidForRestore(element) {
|
|
48
|
+
if (!element) return false;
|
|
49
|
+
if (!document.body.contains(element)) return false;
|
|
50
|
+
if (element.hasAttribute("disabled")) return false;
|
|
51
|
+
if (element.getAttribute("aria-disabled") === "true") return false;
|
|
52
|
+
if (element.getAttribute("aria-hidden") === "true") return false;
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Attempts to restore focus with retries.
|
|
57
|
+
*/
|
|
58
|
+
function tryRestoreFocus(element, options) {
|
|
59
|
+
const { maxRetries, retryDelay, preventScroll, onRestore, onRestoreFailed } = options;
|
|
60
|
+
let attempts = 0;
|
|
61
|
+
const attempt = () => {
|
|
62
|
+
if (!element) {
|
|
63
|
+
onRestoreFailed?.();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (isValidForRestore(element)) {
|
|
67
|
+
if (preventScroll) focusSafely(element);
|
|
68
|
+
else element.focus();
|
|
69
|
+
onRestore?.(element);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
attempts++;
|
|
73
|
+
if (attempts < maxRetries) setTimeout(attempt, retryDelay);
|
|
74
|
+
else onRestoreFailed?.();
|
|
75
|
+
};
|
|
76
|
+
requestAnimationFrame(attempt);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Creates a focus restoration manager.
|
|
80
|
+
*
|
|
81
|
+
* This hook saves the currently focused element when mounted and provides
|
|
82
|
+
* methods to restore focus later, with retry logic for reliability.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* function Modal(props) {
|
|
87
|
+
* const focusRestore = createFocusRestore({
|
|
88
|
+
* restoreOnUnmount: true,
|
|
89
|
+
* onRestore: () => console.log('Focus restored'),
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* return (
|
|
93
|
+
* <div role="dialog">
|
|
94
|
+
* {props.children}
|
|
95
|
+
* <button onClick={() => focusRestore.restore()}>
|
|
96
|
+
* Close
|
|
97
|
+
* </button>
|
|
98
|
+
* </div>
|
|
99
|
+
* );
|
|
100
|
+
* }
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```tsx
|
|
105
|
+
* // Manual focus management
|
|
106
|
+
* function Dropdown() {
|
|
107
|
+
* const focusRestore = createFocusRestore({ restoreOnUnmount: false });
|
|
108
|
+
*
|
|
109
|
+
* const onOpen = () => {
|
|
110
|
+
* focusRestore.saveCurrentFocus();
|
|
111
|
+
* // Focus dropdown content
|
|
112
|
+
* };
|
|
113
|
+
*
|
|
114
|
+
* const onClose = () => {
|
|
115
|
+
* focusRestore.restore();
|
|
116
|
+
* };
|
|
117
|
+
*
|
|
118
|
+
* return <div>...</div>;
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
function createFocusRestore(options = {}) {
|
|
123
|
+
const { restoreOnUnmount = true, maxRetries = 3, retryDelay = 50, onRestore, onRestoreFailed, preventScroll = true } = options;
|
|
124
|
+
if (isServer) return {
|
|
125
|
+
restore: () => false,
|
|
126
|
+
getSavedElement: () => null,
|
|
127
|
+
saveCurrentFocus: () => {},
|
|
128
|
+
clear: () => {}
|
|
129
|
+
};
|
|
130
|
+
let savedElement = null;
|
|
131
|
+
onMount(() => {
|
|
132
|
+
saveCurrentFocus();
|
|
133
|
+
});
|
|
134
|
+
onCleanup(() => {
|
|
135
|
+
if (restoreOnUnmount && savedElement) tryRestoreFocus(savedElement, {
|
|
136
|
+
maxRetries,
|
|
137
|
+
retryDelay,
|
|
138
|
+
preventScroll,
|
|
139
|
+
onRestore: onRestore ?? (() => {}),
|
|
140
|
+
onRestoreFailed: onRestoreFailed ?? (() => {})
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
function saveCurrentFocus() {
|
|
144
|
+
const doc = typeof document !== "undefined" ? document : null;
|
|
145
|
+
if (!doc) return;
|
|
146
|
+
const active = getActiveElement(doc);
|
|
147
|
+
if (active && active !== doc.body) {
|
|
148
|
+
savedElement = active;
|
|
149
|
+
pushFocusStack(active);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function restore() {
|
|
153
|
+
if (!savedElement) return false;
|
|
154
|
+
if (isValidForRestore(savedElement)) {
|
|
155
|
+
if (preventScroll) focusSafely(savedElement);
|
|
156
|
+
else savedElement.focus();
|
|
157
|
+
onRestore?.(savedElement);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
while (focusStack.length > 0) {
|
|
161
|
+
const stackElement = popFocusStack();
|
|
162
|
+
if (stackElement && isValidForRestore(stackElement)) {
|
|
163
|
+
if (preventScroll) focusSafely(stackElement);
|
|
164
|
+
else stackElement.focus();
|
|
165
|
+
onRestore?.(stackElement);
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
onRestoreFailed?.();
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
function getSavedElement() {
|
|
173
|
+
return savedElement;
|
|
174
|
+
}
|
|
175
|
+
function clear() {
|
|
176
|
+
savedElement = null;
|
|
177
|
+
}
|
|
178
|
+
return {
|
|
179
|
+
restore,
|
|
180
|
+
getSavedElement,
|
|
181
|
+
saveCurrentFocus,
|
|
182
|
+
clear
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/focus/createVirtualFocus.ts
|
|
187
|
+
/**
|
|
188
|
+
* Virtual focus management for solidaria
|
|
189
|
+
*
|
|
190
|
+
* Provides virtual focus for large collections where tracking DOM focus
|
|
191
|
+
* on every item is impractical. Instead, a single element receives real
|
|
192
|
+
* focus while aria-activedescendant indicates the virtually focused item.
|
|
193
|
+
*
|
|
194
|
+
* This is commonly used in:
|
|
195
|
+
* - Virtualized lists (where not all items are in the DOM)
|
|
196
|
+
* - Large trees
|
|
197
|
+
* - Autocomplete/combobox suggestions
|
|
198
|
+
* - Grid/table navigation
|
|
199
|
+
*/
|
|
200
|
+
const DEFAULT_PAGE_SIZE = 10;
|
|
201
|
+
/**
|
|
202
|
+
* Creates virtual focus management for a collection.
|
|
203
|
+
*
|
|
204
|
+
* Virtual focus uses aria-activedescendant to indicate which item is
|
|
205
|
+
* "focused" while keeping real DOM focus on a container element. This
|
|
206
|
+
* is more performant for large collections and required for virtualized
|
|
207
|
+
* lists where items may not be in the DOM.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```tsx
|
|
211
|
+
* function Listbox(props) {
|
|
212
|
+
* const virtualFocus = createVirtualFocus({
|
|
213
|
+
* items: () => props.items,
|
|
214
|
+
* getKey: (item) => item.id,
|
|
215
|
+
* isDisabled: (item) => item.disabled,
|
|
216
|
+
* });
|
|
217
|
+
*
|
|
218
|
+
* return (
|
|
219
|
+
* <ul
|
|
220
|
+
* role="listbox"
|
|
221
|
+
* tabIndex={0}
|
|
222
|
+
* aria-activedescendant={virtualFocus.containerProps['aria-activedescendant']()}
|
|
223
|
+
* onKeyDown={virtualFocus.containerProps.onKeyDown}
|
|
224
|
+
* >
|
|
225
|
+
* <For each={props.items}>
|
|
226
|
+
* {(item) => (
|
|
227
|
+
* <li
|
|
228
|
+
* {...virtualFocus.getItemProps(item.id)}
|
|
229
|
+
* role="option"
|
|
230
|
+
* aria-selected={virtualFocus.isFocused(item.id)}
|
|
231
|
+
* >
|
|
232
|
+
* {item.name}
|
|
233
|
+
* </li>
|
|
234
|
+
* )}
|
|
235
|
+
* </For>
|
|
236
|
+
* </ul>
|
|
237
|
+
* );
|
|
238
|
+
* }
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```tsx
|
|
243
|
+
* // With controlled focus
|
|
244
|
+
* function ControlledListbox() {
|
|
245
|
+
* const [focusedKey, setFocusedKey] = createSignal<string | null>(null);
|
|
246
|
+
*
|
|
247
|
+
* const virtualFocus = createVirtualFocus({
|
|
248
|
+
* items: () => items,
|
|
249
|
+
* getKey: (item) => item.id,
|
|
250
|
+
* focusedKey: focusedKey,
|
|
251
|
+
* onFocusChange: setFocusedKey,
|
|
252
|
+
* });
|
|
253
|
+
*
|
|
254
|
+
* return <ul>...</ul>;
|
|
255
|
+
* }
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
function createVirtualFocus(options) {
|
|
259
|
+
const { items, getKey, isDisabled = () => false, defaultFocusedKey, focusedKey: controlledFocusedKey, onFocusChange, wrap = true, skipDisabled = true, orientation = "vertical" } = options;
|
|
260
|
+
if (isServer) {
|
|
261
|
+
const emptyAccessor = () => null;
|
|
262
|
+
return {
|
|
263
|
+
focusedKey: emptyAccessor,
|
|
264
|
+
focusedItem: emptyAccessor,
|
|
265
|
+
setFocusedKey: () => {},
|
|
266
|
+
focusNext: () => {},
|
|
267
|
+
focusPrevious: () => {},
|
|
268
|
+
focusFirst: () => {},
|
|
269
|
+
focusLast: () => {},
|
|
270
|
+
focusPageDown: () => {},
|
|
271
|
+
focusPageUp: () => {},
|
|
272
|
+
isFocused: () => false,
|
|
273
|
+
containerProps: {
|
|
274
|
+
"aria-activedescendant": () => void 0,
|
|
275
|
+
onKeyDown: () => {}
|
|
276
|
+
},
|
|
277
|
+
getItemProps: (key) => ({ id: `item-${key}` })
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
const [internalKey, setInternalKey] = createSignal(defaultFocusedKey ?? null);
|
|
281
|
+
const focusedKey = controlledFocusedKey ?? internalKey;
|
|
282
|
+
const setFocusedKey = (key) => {
|
|
283
|
+
if (controlledFocusedKey) onFocusChange?.(key);
|
|
284
|
+
else {
|
|
285
|
+
setInternalKey(key);
|
|
286
|
+
onFocusChange?.(key);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
const focusedItem = () => {
|
|
290
|
+
const key = focusedKey();
|
|
291
|
+
if (!key) return null;
|
|
292
|
+
return items().find((item) => getKey(item) === key) ?? null;
|
|
293
|
+
};
|
|
294
|
+
const getValidItems = () => {
|
|
295
|
+
if (!skipDisabled) return items();
|
|
296
|
+
return items().filter((item) => !isDisabled(item));
|
|
297
|
+
};
|
|
298
|
+
const getKeyIndex = (key) => {
|
|
299
|
+
if (!key) return -1;
|
|
300
|
+
return getValidItems().findIndex((item) => getKey(item) === key);
|
|
301
|
+
};
|
|
302
|
+
const focusByIndex = (index) => {
|
|
303
|
+
const validItems = getValidItems();
|
|
304
|
+
if (validItems.length === 0) return;
|
|
305
|
+
let targetIndex = index;
|
|
306
|
+
if (wrap) targetIndex = (index % validItems.length + validItems.length) % validItems.length;
|
|
307
|
+
else targetIndex = Math.max(0, Math.min(index, validItems.length - 1));
|
|
308
|
+
const item = validItems[targetIndex];
|
|
309
|
+
if (item) setFocusedKey(getKey(item));
|
|
310
|
+
};
|
|
311
|
+
const focusNext = () => {
|
|
312
|
+
focusByIndex(getKeyIndex(focusedKey()) + 1);
|
|
313
|
+
};
|
|
314
|
+
const focusPrevious = () => {
|
|
315
|
+
const currentIndex = getKeyIndex(focusedKey());
|
|
316
|
+
if (currentIndex === -1) focusByIndex(getValidItems().length - 1);
|
|
317
|
+
else focusByIndex(currentIndex - 1);
|
|
318
|
+
};
|
|
319
|
+
const focusFirst = () => {
|
|
320
|
+
focusByIndex(0);
|
|
321
|
+
};
|
|
322
|
+
const focusLast = () => {
|
|
323
|
+
focusByIndex(getValidItems().length - 1);
|
|
324
|
+
};
|
|
325
|
+
const focusPageDown = (pageSize = DEFAULT_PAGE_SIZE) => {
|
|
326
|
+
focusByIndex(getKeyIndex(focusedKey()) + pageSize);
|
|
327
|
+
};
|
|
328
|
+
const focusPageUp = (pageSize = DEFAULT_PAGE_SIZE) => {
|
|
329
|
+
const currentIndex = getKeyIndex(focusedKey());
|
|
330
|
+
if (currentIndex === -1) focusByIndex(getValidItems().length - 1);
|
|
331
|
+
else focusByIndex(currentIndex - pageSize);
|
|
332
|
+
};
|
|
333
|
+
const isFocused = (key) => {
|
|
334
|
+
return focusedKey() === key;
|
|
335
|
+
};
|
|
336
|
+
const onKeyDown = (e) => {
|
|
337
|
+
const isVertical = orientation === "vertical" || orientation === "both";
|
|
338
|
+
const isHorizontal = orientation === "horizontal" || orientation === "both";
|
|
339
|
+
switch (e.key) {
|
|
340
|
+
case "ArrowDown":
|
|
341
|
+
if (isVertical) {
|
|
342
|
+
e.preventDefault();
|
|
343
|
+
focusNext();
|
|
344
|
+
}
|
|
345
|
+
break;
|
|
346
|
+
case "ArrowUp":
|
|
347
|
+
if (isVertical) {
|
|
348
|
+
e.preventDefault();
|
|
349
|
+
focusPrevious();
|
|
350
|
+
}
|
|
351
|
+
break;
|
|
352
|
+
case "ArrowRight":
|
|
353
|
+
if (isHorizontal) {
|
|
354
|
+
e.preventDefault();
|
|
355
|
+
focusNext();
|
|
356
|
+
}
|
|
357
|
+
break;
|
|
358
|
+
case "ArrowLeft":
|
|
359
|
+
if (isHorizontal) {
|
|
360
|
+
e.preventDefault();
|
|
361
|
+
focusPrevious();
|
|
362
|
+
}
|
|
363
|
+
break;
|
|
364
|
+
case "Home":
|
|
365
|
+
e.preventDefault();
|
|
366
|
+
focusFirst();
|
|
367
|
+
break;
|
|
368
|
+
case "End":
|
|
369
|
+
e.preventDefault();
|
|
370
|
+
focusLast();
|
|
371
|
+
break;
|
|
372
|
+
case "PageDown":
|
|
373
|
+
e.preventDefault();
|
|
374
|
+
focusPageDown();
|
|
375
|
+
break;
|
|
376
|
+
case "PageUp":
|
|
377
|
+
e.preventDefault();
|
|
378
|
+
focusPageUp();
|
|
379
|
+
break;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
const containerProps = {
|
|
383
|
+
"aria-activedescendant": () => {
|
|
384
|
+
const key = focusedKey();
|
|
385
|
+
return key ? `item-${key}` : void 0;
|
|
386
|
+
},
|
|
387
|
+
onKeyDown
|
|
388
|
+
};
|
|
389
|
+
const getItemProps = (key) => ({ id: `item-${key}` });
|
|
390
|
+
return {
|
|
391
|
+
focusedKey,
|
|
392
|
+
focusedItem,
|
|
393
|
+
setFocusedKey,
|
|
394
|
+
focusNext,
|
|
395
|
+
focusPrevious,
|
|
396
|
+
focusFirst,
|
|
397
|
+
focusLast,
|
|
398
|
+
focusPageDown,
|
|
399
|
+
focusPageUp,
|
|
400
|
+
isFocused,
|
|
401
|
+
containerProps,
|
|
402
|
+
getItemProps
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/focus/virtualFocus.ts
|
|
407
|
+
/**
|
|
408
|
+
* Virtual-focus event dispatch primitives.
|
|
409
|
+
*
|
|
410
|
+
* A faithful port of @react-aria/focus's `virtualFocus` module. Under virtual
|
|
411
|
+
* focus (e.g. Autocomplete), real DOM focus stays on an input while the
|
|
412
|
+
* "focused" collection option is indicated by `aria-activedescendant`. Moving
|
|
413
|
+
* that virtual cursor dispatches synthetic `focus`/`blur` events (with matching
|
|
414
|
+
* bubbling `focusin`/`focusout`) on the option elements so listeners — notably
|
|
415
|
+
* the autocomplete input's `focusin` handler that mirrors the active descendant
|
|
416
|
+
* — react as if the element were really focused.
|
|
417
|
+
*/
|
|
418
|
+
/**
|
|
419
|
+
* Moves virtual focus to `to`, dispatching a virtual blur on the previously
|
|
420
|
+
* virtually-focused element (if any) and a virtual focus on `to` (if non-null).
|
|
421
|
+
*/
|
|
422
|
+
function moveVirtualFocus(to) {
|
|
423
|
+
const from = getVirtuallyFocusedElement(getOwnerDocument(to));
|
|
424
|
+
if (from !== to) {
|
|
425
|
+
if (from) dispatchVirtualBlur(from, to);
|
|
426
|
+
if (to) dispatchVirtualFocus(to, from);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
/** Dispatches synthetic `blur` + bubbling `focusout` events on `from`. */
|
|
430
|
+
function dispatchVirtualBlur(from, to) {
|
|
431
|
+
from.dispatchEvent(new FocusEvent("blur", { relatedTarget: to }));
|
|
432
|
+
from.dispatchEvent(new FocusEvent("focusout", {
|
|
433
|
+
bubbles: true,
|
|
434
|
+
relatedTarget: to
|
|
435
|
+
}));
|
|
436
|
+
}
|
|
437
|
+
/** Dispatches synthetic `focus` + bubbling `focusin` events on `to`. */
|
|
438
|
+
function dispatchVirtualFocus(to, from) {
|
|
439
|
+
to.dispatchEvent(new FocusEvent("focus", { relatedTarget: from }));
|
|
440
|
+
to.dispatchEvent(new FocusEvent("focusin", {
|
|
441
|
+
bubbles: true,
|
|
442
|
+
relatedTarget: from
|
|
443
|
+
}));
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Returns the currently virtually-focused element: the element referenced by the
|
|
447
|
+
* active element's `aria-activedescendant`, or the active element itself.
|
|
448
|
+
*/
|
|
449
|
+
function getVirtuallyFocusedElement(document) {
|
|
450
|
+
const activeElement = getActiveElement$1(document);
|
|
451
|
+
const activeDescendant = activeElement?.getAttribute("aria-activedescendant");
|
|
452
|
+
if (activeDescendant) return document.getElementById(activeDescendant) || activeElement;
|
|
453
|
+
return activeElement;
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/focus/createAutoFocus.ts
|
|
457
|
+
/**
|
|
458
|
+
* Auto-focus management for solidaria
|
|
459
|
+
*
|
|
460
|
+
* Provides priority-based auto-focus with deferred execution
|
|
461
|
+
* and conflict resolution for multiple auto-focus elements.
|
|
462
|
+
*/
|
|
463
|
+
let autoFocusQueue = [];
|
|
464
|
+
let processingTimeout = null;
|
|
465
|
+
/**
|
|
466
|
+
* Process the auto-focus queue and focus the highest priority element.
|
|
467
|
+
*/
|
|
468
|
+
function processAutoFocusQueue() {
|
|
469
|
+
if (processingTimeout) {
|
|
470
|
+
clearTimeout(processingTimeout);
|
|
471
|
+
processingTimeout = null;
|
|
472
|
+
}
|
|
473
|
+
if (autoFocusQueue.length === 0) return;
|
|
474
|
+
autoFocusQueue.sort((a, b) => b.priority - a.priority);
|
|
475
|
+
const winner = autoFocusQueue[0];
|
|
476
|
+
const losers = autoFocusQueue.slice(1);
|
|
477
|
+
autoFocusQueue = [];
|
|
478
|
+
for (const loser of losers) loser.onSkip?.();
|
|
479
|
+
const element = winner.ref();
|
|
480
|
+
if (!element) {
|
|
481
|
+
winner.onSkip?.();
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
const activeElement = document.activeElement;
|
|
485
|
+
if (!(winner.force || !activeElement || activeElement === document.body || activeElement === document.documentElement)) {
|
|
486
|
+
winner.onSkip?.();
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
if (winner.delay > 0) setTimeout(() => {
|
|
490
|
+
const el = winner.ref();
|
|
491
|
+
if (el && document.body.contains(el)) {
|
|
492
|
+
if (winner.preventScroll) focusSafely(el);
|
|
493
|
+
else el.focus();
|
|
494
|
+
winner.onFocus?.(el);
|
|
495
|
+
}
|
|
496
|
+
}, winner.delay);
|
|
497
|
+
else {
|
|
498
|
+
if (winner.preventScroll) focusSafely(element);
|
|
499
|
+
else element.focus();
|
|
500
|
+
winner.onFocus?.(element);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Queue an element for auto-focus.
|
|
505
|
+
*/
|
|
506
|
+
function queueAutoFocus(item) {
|
|
507
|
+
autoFocusQueue.push(item);
|
|
508
|
+
if (processingTimeout === null) processingTimeout = setTimeout(processAutoFocusQueue, 0);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Remove an item from the auto-focus queue.
|
|
512
|
+
*/
|
|
513
|
+
function removeFromQueue(ref) {
|
|
514
|
+
autoFocusQueue = autoFocusQueue.filter((item) => item.ref !== ref);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Creates auto-focus behavior for an element.
|
|
518
|
+
*
|
|
519
|
+
* This hook registers the element for auto-focus when mounted. If multiple
|
|
520
|
+
* elements request auto-focus, the one with the highest priority wins.
|
|
521
|
+
*
|
|
522
|
+
* @param ref - Accessor for the element to focus
|
|
523
|
+
* @param options - Auto-focus options
|
|
524
|
+
*
|
|
525
|
+
* @example
|
|
526
|
+
* ```tsx
|
|
527
|
+
* function Dialog(props) {
|
|
528
|
+
* let contentRef: HTMLDivElement | undefined;
|
|
529
|
+
*
|
|
530
|
+
* createAutoFocus(() => contentRef, {
|
|
531
|
+
* priority: 10, // High priority for dialogs
|
|
532
|
+
* onFocus: () => console.log('Dialog focused'),
|
|
533
|
+
* });
|
|
534
|
+
*
|
|
535
|
+
* return (
|
|
536
|
+
* <div ref={contentRef} tabIndex={-1}>
|
|
537
|
+
* {props.children}
|
|
538
|
+
* </div>
|
|
539
|
+
* );
|
|
540
|
+
* }
|
|
541
|
+
* ```
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```tsx
|
|
545
|
+
* // With delay for animations
|
|
546
|
+
* function AnimatedPanel() {
|
|
547
|
+
* let panelRef: HTMLDivElement | undefined;
|
|
548
|
+
*
|
|
549
|
+
* createAutoFocus(() => panelRef, {
|
|
550
|
+
* delay: 300, // Wait for animation
|
|
551
|
+
* });
|
|
552
|
+
*
|
|
553
|
+
* return <div ref={panelRef} class="animated-panel">...</div>;
|
|
554
|
+
* }
|
|
555
|
+
* ```
|
|
556
|
+
*
|
|
557
|
+
* @example
|
|
558
|
+
* ```tsx
|
|
559
|
+
* // Conditional auto-focus
|
|
560
|
+
* function Input(props) {
|
|
561
|
+
* let inputRef: HTMLInputElement | undefined;
|
|
562
|
+
*
|
|
563
|
+
* createAutoFocus(() => inputRef, {
|
|
564
|
+
* isEnabled: props.autoFocus,
|
|
565
|
+
* });
|
|
566
|
+
*
|
|
567
|
+
* return <input ref={inputRef} />;
|
|
568
|
+
* }
|
|
569
|
+
* ```
|
|
570
|
+
*/
|
|
571
|
+
function createAutoFocus(ref, options = {}) {
|
|
572
|
+
const { isEnabled = true, priority = 0, delay = 0, force = false, preventScroll = true, onFocus, onSkip } = options;
|
|
573
|
+
if (isServer) return {
|
|
574
|
+
focus: () => {},
|
|
575
|
+
cancel: () => {}
|
|
576
|
+
};
|
|
577
|
+
let canceled = false;
|
|
578
|
+
onMount(() => {
|
|
579
|
+
if (!isEnabled || canceled) return;
|
|
580
|
+
queueAutoFocus({
|
|
581
|
+
ref,
|
|
582
|
+
priority,
|
|
583
|
+
delay,
|
|
584
|
+
force,
|
|
585
|
+
preventScroll,
|
|
586
|
+
onFocus,
|
|
587
|
+
onSkip
|
|
588
|
+
});
|
|
589
|
+
});
|
|
590
|
+
onCleanup(() => {
|
|
591
|
+
removeFromQueue(ref);
|
|
592
|
+
});
|
|
593
|
+
const focus = () => {
|
|
594
|
+
if (canceled) return;
|
|
595
|
+
const element = ref();
|
|
596
|
+
if (!element) return;
|
|
597
|
+
if (preventScroll) focusSafely(element);
|
|
598
|
+
else element.focus();
|
|
599
|
+
onFocus?.(element);
|
|
600
|
+
};
|
|
601
|
+
const cancel = () => {
|
|
602
|
+
canceled = true;
|
|
603
|
+
removeFromQueue(ref);
|
|
604
|
+
};
|
|
605
|
+
return {
|
|
606
|
+
focus,
|
|
607
|
+
cancel
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Clears all pending auto-focus requests.
|
|
612
|
+
* Useful for testing or when navigating away.
|
|
613
|
+
*/
|
|
614
|
+
function clearAutoFocusQueue() {
|
|
615
|
+
if (processingTimeout) {
|
|
616
|
+
clearTimeout(processingTimeout);
|
|
617
|
+
processingTimeout = null;
|
|
618
|
+
}
|
|
619
|
+
autoFocusQueue = [];
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Gets the current auto-focus queue length.
|
|
623
|
+
* Useful for debugging.
|
|
624
|
+
*/
|
|
625
|
+
function getAutoFocusQueueLength() {
|
|
626
|
+
return autoFocusQueue.length;
|
|
627
|
+
}
|
|
628
|
+
//#endregion
|
|
629
|
+
export { dispatchVirtualFocus as a, createVirtualFocus as c, getFocusStackLength as d, popFocusStack as f, dispatchVirtualBlur as i, clearFocusStack as l, createAutoFocus as n, getVirtuallyFocusedElement as o, pushFocusStack as p, getAutoFocusQueueLength as r, moveVirtualFocus as s, clearAutoFocusQueue as t, createFocusRestore as u };
|
|
630
|
+
|
|
631
|
+
//# sourceMappingURL=focus2.js.map
|