@proyecto-viviana/solidaria 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/actiongroup.js +207 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +207 -0
- package/dist/_chunk/actiongroup.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 +196 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +196 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +119 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +119 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +276 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +276 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1036 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1036 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +234 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +234 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1174 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1174 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +436 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +436 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +229 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +223 -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 +54 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +54 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +101 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +101 -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 +121 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +121 -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/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 +130 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +130 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +269 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +269 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +46 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +46 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +31 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +31 -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/createLongPress.js +91 -0
- package/dist/_chunk/createLongPress.js.map +1 -0
- package/dist/_chunk/createLongPress.jsx +91 -0
- package/dist/_chunk/createLongPress.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 +81 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +81 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +298 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +298 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +158 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +158 -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 +1393 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1393 -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 +1304 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +1304 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +105 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +105 -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 +895 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +870 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/form.js +39 -0
- package/dist/_chunk/form.js.map +1 -0
- package/dist/_chunk/form.jsx +39 -0
- package/dist/_chunk/form.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 +364 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +364 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +254 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +254 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +241 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +237 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +96 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +96 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +324 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +324 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/live-announcer.js +207 -0
- package/dist/_chunk/live-announcer.js.map +1 -0
- package/dist/_chunk/live-announcer.jsx +207 -0
- package/dist/_chunk/live-announcer.jsx.map +1 -0
- package/dist/_chunk/menu.js +518 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +518 -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 +258 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +258 -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 +319 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +319 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +209 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +209 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +403 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +394 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +679 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +679 -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 +255 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +255 -0
- package/dist/_chunk/slider.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 +1051 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1051 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +260 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +260 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +286 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +286 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +109 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +109 -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 +258 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +258 -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 +424 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +424 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +665 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +665 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +92 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +92 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +2 -0
- 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/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- 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/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/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/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -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/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.js +2 -0
- package/dist/dnd/index.jsx +2 -0
- package/dist/dnd/utils.d.ts +2 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.js +2 -0
- package/dist/focus/index.jsx +2 -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 +3 -0
- package/dist/i18n/index.jsx +3 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -18311
- package/dist/index.jsx +71 -18242
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.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 +10 -0
- package/dist/interactions/index.jsx +10 -0
- 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 +6 -0
- 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.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 +4 -0
- package/dist/selection/index.jsx +4 -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/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/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/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +27 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +4 -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/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/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 +48 -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 +5 -0
- package/dist/utils/index.jsx +5 -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/autocomplete/createAutocomplete.ts +67 -21
- package/src/calendar/createCalendar.ts +2 -0
- package/src/calendar/createCalendarCell.ts +19 -2
- package/src/calendar/createCalendarGrid.ts +43 -9
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +2 -0
- package/src/calendar/index.ts +17 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/datepicker/createDateSegment.ts +6 -1
- package/src/dnd/createDroppableCollection.ts +4 -1
- package/src/dnd/utils.ts +27 -3
- package/src/focus/FocusScope.tsx +152 -18
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +145 -42
- 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 +40 -0
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createInteractionModality.ts +21 -12
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/listbox/createListBox.ts +129 -8
- package/src/listbox/createOption.ts +68 -73
- 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 +18 -2
- 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 +498 -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/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +56 -26
- package/src/table/createTableRow.ts +198 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/types.ts +29 -1
- package/src/tabs/createTabs.ts +50 -20
- package/src/tag/createTag.ts +9 -4
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -42
- package/src/tree/createTree.ts +100 -42
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +151 -0
- package/src/utils/dom.ts +215 -25
- package/src/utils/index.ts +8 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
package/src/focus/FocusScope.tsx
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
onMount,
|
|
16
16
|
} from "solid-js";
|
|
17
17
|
import { isServer } from "solid-js/web";
|
|
18
|
-
import { getOwnerDocument, isFocusable } from "../utils";
|
|
18
|
+
import { getOwnerDocument, isFocusable, isTabbable } from "../utils";
|
|
19
19
|
import { focusSafely } from "../utils/focus";
|
|
20
20
|
|
|
21
21
|
export interface FocusScopeProps {
|
|
@@ -73,23 +73,6 @@ export function useFocusManager(): FocusManager | undefined {
|
|
|
73
73
|
return useContext(FocusScopeContext)?.focusManager;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
/**
|
|
77
|
-
* Checks if an element is tabbable (focusable via Tab key).
|
|
78
|
-
*/
|
|
79
|
-
function isTabbable(element: Element): boolean {
|
|
80
|
-
if (!isFocusable(element)) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Check tabIndex
|
|
85
|
-
const tabIndex = element.getAttribute("tabindex");
|
|
86
|
-
if (tabIndex != null) {
|
|
87
|
-
return parseInt(tabIndex, 10) >= 0;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
76
|
/**
|
|
94
77
|
* Gets all focusable elements within a scope.
|
|
95
78
|
*/
|
|
@@ -135,6 +118,99 @@ function getActiveElement(doc: Document): Element | null {
|
|
|
135
118
|
return activeElement;
|
|
136
119
|
}
|
|
137
120
|
|
|
121
|
+
/**
|
|
122
|
+
* A scope is identified by its (stable) scope-elements accessor; `null` is the
|
|
123
|
+
* tree root. Mirrors @react-aria/focus's `ScopeRef`.
|
|
124
|
+
*/
|
|
125
|
+
type ScopeRef = Accessor<Element[]> | null;
|
|
126
|
+
|
|
127
|
+
interface FocusScopeTreeNode {
|
|
128
|
+
scopeRef: ScopeRef;
|
|
129
|
+
parent: FocusScopeTreeNode | null;
|
|
130
|
+
children: Set<FocusScopeTreeNode>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* A registry of the live FocusScopes and their parent/child relationships,
|
|
135
|
+
* mirroring @react-aria/focus's `focusScopeTree`. The DOM tree alone can't
|
|
136
|
+
* express scope nesting because a child scope (e.g. a menu opened from inside a
|
|
137
|
+
* modal popover) is rendered in a portal, outside its parent scope's subtree.
|
|
138
|
+
* The tree records that nesting so containment can recognize a portaled
|
|
139
|
+
* descendant scope as "inside".
|
|
140
|
+
*/
|
|
141
|
+
class FocusScopeTree {
|
|
142
|
+
root: FocusScopeTreeNode;
|
|
143
|
+
private fastMap = new Map<ScopeRef, FocusScopeTreeNode>();
|
|
144
|
+
|
|
145
|
+
constructor() {
|
|
146
|
+
this.root = { scopeRef: null, parent: null, children: new Set() };
|
|
147
|
+
this.fastMap.set(null, this.root);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
getTreeNode(scopeRef: ScopeRef): FocusScopeTreeNode | undefined {
|
|
151
|
+
return this.fastMap.get(scopeRef);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
addTreeNode(scopeRef: ScopeRef, parent: ScopeRef): void {
|
|
155
|
+
const parentNode = this.fastMap.get(parent) ?? this.root;
|
|
156
|
+
const node: FocusScopeTreeNode = { scopeRef, parent: parentNode, children: new Set() };
|
|
157
|
+
parentNode.children.add(node);
|
|
158
|
+
this.fastMap.set(scopeRef, node);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
removeTreeNode(scopeRef: ScopeRef): void {
|
|
162
|
+
// never remove the root
|
|
163
|
+
if (scopeRef === null) return;
|
|
164
|
+
const node = this.fastMap.get(scopeRef);
|
|
165
|
+
if (!node) return;
|
|
166
|
+
const parentNode = node.parent;
|
|
167
|
+
if (parentNode) {
|
|
168
|
+
parentNode.children.delete(node);
|
|
169
|
+
// Re-parent any children so a mid-tree unmount doesn't orphan descendants.
|
|
170
|
+
for (const child of node.children) {
|
|
171
|
+
child.parent = parentNode;
|
|
172
|
+
parentNode.children.add(child);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
this.fastMap.delete(scopeRef);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Pre-order depth-first; skips the null-scoped root, like upstream.
|
|
179
|
+
*traverse(node: FocusScopeTreeNode = this.root): Generator<FocusScopeTreeNode> {
|
|
180
|
+
if (node.scopeRef != null) {
|
|
181
|
+
yield node;
|
|
182
|
+
}
|
|
183
|
+
for (const child of node.children) {
|
|
184
|
+
yield* this.traverse(child);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const focusScopeTree = new FocusScopeTree();
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Whether the element is inside `scope` or any of its descendant scopes.
|
|
193
|
+
*
|
|
194
|
+
* `isElementInScope`'s `node.contains` already covers descendant scopes that
|
|
195
|
+
* are DOM children, but not those rendered in a portal. Walking the scope
|
|
196
|
+
* subtree closes that gap so focus moving into a portaled child scope still
|
|
197
|
+
* counts as "inside". Mirrors @react-aria/focus's `isElementInChildScope`.
|
|
198
|
+
*/
|
|
199
|
+
function isElementInChildScope(element: Element, scope: ScopeRef = null): boolean {
|
|
200
|
+
// Always allow focus to move into a top-layer element (e.g. toasts).
|
|
201
|
+
if (element instanceof Element && element.closest("[data-react-aria-top-layer]")) {
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
for (const node of focusScopeTree.traverse(focusScopeTree.getTreeNode(scope))) {
|
|
206
|
+
if (node.scopeRef && isElementInScope(element, node.scopeRef())) {
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
|
|
138
214
|
/**
|
|
139
215
|
* A FocusScope manages focus for its descendants. It supports containing focus inside
|
|
140
216
|
* the scope, restoring focus to the previously focused element on unmount, and auto
|
|
@@ -151,6 +227,11 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
151
227
|
let endRef: HTMLSpanElement | undefined;
|
|
152
228
|
const [scopeElements, setScopeElements] = createSignal<Element[]>([]);
|
|
153
229
|
|
|
230
|
+
// The nearest enclosing FocusScope (through context, which Solid propagates
|
|
231
|
+
// across portals) is this scope's parent in the focus-scope tree. Read it
|
|
232
|
+
// before we shadow the context with our own provider below.
|
|
233
|
+
const parentScopeRef = useContext(FocusScopeContext)?.scopeRef ?? null;
|
|
234
|
+
|
|
154
235
|
// Store the element that was focused when the scope mounted
|
|
155
236
|
let nodeToRestore: Element | null = null;
|
|
156
237
|
|
|
@@ -272,6 +353,16 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
272
353
|
setScopeElements(nodes);
|
|
273
354
|
});
|
|
274
355
|
|
|
356
|
+
// Register this scope in the focus-scope tree so containment can recognize a
|
|
357
|
+
// portaled descendant scope as "inside" it. The scope-elements accessor is a
|
|
358
|
+
// stable identity, so it works as the tree key even before it's populated.
|
|
359
|
+
onMount(() => {
|
|
360
|
+
focusScopeTree.addTreeNode(scopeElements, parentScopeRef);
|
|
361
|
+
});
|
|
362
|
+
onCleanup(() => {
|
|
363
|
+
focusScopeTree.removeTreeNode(scopeElements);
|
|
364
|
+
});
|
|
365
|
+
|
|
275
366
|
// Save the currently focused element for restoration (must happen before autoFocus/contain effects run).
|
|
276
367
|
onMount(() => {
|
|
277
368
|
if (!props.restoreFocus) return;
|
|
@@ -354,6 +445,12 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
354
445
|
|
|
355
446
|
if (isElementInScope(target, scope)) {
|
|
356
447
|
focusedNode = target;
|
|
448
|
+
} else if (isElementInChildScope(target, scopeElements)) {
|
|
449
|
+
// Focus moved into a descendant scope — e.g. a menu opened from inside
|
|
450
|
+
// this modal popover, rendered in a portal outside this scope's DOM
|
|
451
|
+
// subtree. Track it but don't pull focus back, which would tear the
|
|
452
|
+
// nested overlay down.
|
|
453
|
+
focusedNode = target;
|
|
357
454
|
} else if (focusedNode) {
|
|
358
455
|
// Focus escaped the scope, bring it back
|
|
359
456
|
focusSafely(focusedNode as HTMLElement);
|
|
@@ -363,12 +460,49 @@ export const FocusScope: ParentComponent<FocusScopeProps> = (props) => {
|
|
|
363
460
|
}
|
|
364
461
|
};
|
|
365
462
|
|
|
463
|
+
let restoreRaf: number | null = null;
|
|
464
|
+
|
|
465
|
+
const onFocusOut = (e: FocusEvent) => {
|
|
466
|
+
const target = e.target as Element;
|
|
467
|
+
if (!isElementInScope(target, scopeElements())) return;
|
|
468
|
+
|
|
469
|
+
// Focus left an element inside the scope. Wait a frame (like upstream's
|
|
470
|
+
// onBlur) so a synchronous refocus elsewhere can settle; if focus ended
|
|
471
|
+
// up outside every scope (e.g. blur() to body), pull it back.
|
|
472
|
+
const win = doc.defaultView ?? window;
|
|
473
|
+
if (restoreRaf != null) win.cancelAnimationFrame(restoreRaf);
|
|
474
|
+
restoreRaf = win.requestAnimationFrame(() => {
|
|
475
|
+
restoreRaf = null;
|
|
476
|
+
const scope = scopeElements();
|
|
477
|
+
const activeElement = getActiveElement(doc);
|
|
478
|
+
if (
|
|
479
|
+
activeElement &&
|
|
480
|
+
(isElementInScope(activeElement, scope) ||
|
|
481
|
+
isElementInChildScope(activeElement, scopeElements))
|
|
482
|
+
) {
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if (doc.body.contains(target)) {
|
|
487
|
+
focusedNode = target;
|
|
488
|
+
focusSafely(target as HTMLElement);
|
|
489
|
+
} else {
|
|
490
|
+
focusManager.focusFirst();
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
|
|
366
495
|
doc.addEventListener("keydown", onKeyDown, true);
|
|
367
496
|
doc.addEventListener("focusin", onFocusIn, true);
|
|
497
|
+
doc.addEventListener("focusout", onFocusOut, true);
|
|
368
498
|
|
|
369
499
|
onCleanup(() => {
|
|
370
500
|
doc.removeEventListener("keydown", onKeyDown, true);
|
|
371
501
|
doc.removeEventListener("focusin", onFocusIn, true);
|
|
502
|
+
doc.removeEventListener("focusout", onFocusOut, true);
|
|
503
|
+
if (restoreRaf != null) {
|
|
504
|
+
(doc.defaultView ?? window).cancelAnimationFrame(restoreRaf);
|
|
505
|
+
}
|
|
372
506
|
});
|
|
373
507
|
});
|
|
374
508
|
|
|
@@ -108,7 +108,14 @@ export function createFormValidation(
|
|
|
108
108
|
// Set custom validity on the native input
|
|
109
109
|
createEffect(() => {
|
|
110
110
|
const input = ref();
|
|
111
|
-
|
|
111
|
+
// `'setCustomValidity' in input` guards refs that aren't true form elements
|
|
112
|
+
// (e.g. a custom element), matching upstream useFormValidation.
|
|
113
|
+
if (
|
|
114
|
+
validationBehavior() === "native" &&
|
|
115
|
+
input &&
|
|
116
|
+
"setCustomValidity" in input &&
|
|
117
|
+
!input.disabled
|
|
118
|
+
) {
|
|
112
119
|
const realtimeValidation = state.realtimeValidation();
|
|
113
120
|
const errorMessage = realtimeValidation.isInvalid
|
|
114
121
|
? realtimeValidation.validationErrors.join(" ") || "Invalid value."
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Based on @react-aria/gridlist/useGridList.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createMemo, type Accessor } from "solid-js";
|
|
6
|
+
import { createMemo, createEffect, type Accessor } from "solid-js";
|
|
7
7
|
import type { JSX } from "solid-js";
|
|
8
8
|
import { createId } from "@proyecto-viviana/solid-stately";
|
|
9
9
|
import type { GridState, GridCollection, Key } from "@proyecto-viviana/solid-stately";
|
|
10
10
|
import type { AriaGridListProps, GridListAria } from "./types";
|
|
11
|
+
import { scrollIntoViewport } from "../utils";
|
|
12
|
+
import { getInteractionModality } from "../interactions/createInteractionModality";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Metadata stored for a grid list instance.
|
|
@@ -17,6 +19,12 @@ interface GridListData {
|
|
|
17
19
|
gridListId: string;
|
|
18
20
|
/** How selection should behave when pressing an item. */
|
|
19
21
|
selectionBehavior: "replace" | "toggle";
|
|
22
|
+
/** Whether row selection should occur on press up. */
|
|
23
|
+
shouldSelectOnPressUp: boolean;
|
|
24
|
+
/** How keyboard navigation behaves within row children. */
|
|
25
|
+
keyboardNavigationBehavior: "arrow" | "tab";
|
|
26
|
+
/** Text direction for row-child arrow navigation. */
|
|
27
|
+
direction: "ltr" | "rtl";
|
|
20
28
|
/** Actions registered for the grid list. */
|
|
21
29
|
actions: {
|
|
22
30
|
onAction?: (key: Key) => void;
|
|
@@ -37,13 +45,45 @@ export function getGridListData<T extends object, C extends GridCollection<T>>(
|
|
|
37
45
|
return gridListDataMap.get(state);
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Whether a key should be skipped during keyboard navigation. Disabled keys only
|
|
50
|
+
* block navigation under `disabledBehavior: "all"` (the default); under
|
|
51
|
+
* `"selection"` they remain focusable (selection is still blocked elsewhere).
|
|
52
|
+
* Mirrors `ListKeyboardDelegate.isDisabled` in React Aria.
|
|
53
|
+
*/
|
|
54
|
+
function isNavigationDisabled<T extends object, C extends GridCollection<T>>(
|
|
55
|
+
state: GridState<T, C>,
|
|
56
|
+
key: Key,
|
|
57
|
+
): boolean {
|
|
58
|
+
return state.isDisabled(key) && state.disabledBehavior === "all";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Walks from `startKey` via `step` until reaching a navigable (not
|
|
63
|
+
* navigation-disabled) key, mirroring React Aria's
|
|
64
|
+
* `ListKeyboardDelegate.findNextNonDisabled`. The next/previous lookups and the
|
|
65
|
+
* `getFirstKey`/`getLastKey` boundaries all funnel through this so arrow keys,
|
|
66
|
+
* Home and End land on enabled rows only.
|
|
67
|
+
*/
|
|
68
|
+
function findNextNavigableKey<T extends object, C extends GridCollection<T>>(
|
|
69
|
+
state: GridState<T, C>,
|
|
70
|
+
startKey: Key | null,
|
|
71
|
+
step: (key: Key) => Key | null,
|
|
72
|
+
): Key | null {
|
|
73
|
+
let key = startKey;
|
|
74
|
+
while (key != null && isNavigationDisabled(state, key)) {
|
|
75
|
+
key = step(key);
|
|
76
|
+
}
|
|
77
|
+
return key;
|
|
78
|
+
}
|
|
79
|
+
|
|
40
80
|
/**
|
|
41
81
|
* Creates accessibility props for a grid list.
|
|
42
82
|
*/
|
|
43
83
|
export function createGridList<T extends object, C extends GridCollection<T> = GridCollection<T>>(
|
|
44
84
|
props: Accessor<AriaGridListProps>,
|
|
45
85
|
state: Accessor<GridState<T, C>>,
|
|
46
|
-
|
|
86
|
+
ref: Accessor<HTMLElement | null>,
|
|
47
87
|
): GridListAria {
|
|
48
88
|
// Generate a unique ID for the grid list
|
|
49
89
|
const gridListId = props().id ?? createId();
|
|
@@ -54,6 +94,15 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
54
94
|
get selectionBehavior() {
|
|
55
95
|
return props().selectionBehavior ?? "replace";
|
|
56
96
|
},
|
|
97
|
+
get shouldSelectOnPressUp() {
|
|
98
|
+
return props().shouldSelectOnPressUp ?? false;
|
|
99
|
+
},
|
|
100
|
+
get keyboardNavigationBehavior() {
|
|
101
|
+
return props().keyboardNavigationBehavior ?? "arrow";
|
|
102
|
+
},
|
|
103
|
+
get direction() {
|
|
104
|
+
return props().direction ?? "ltr";
|
|
105
|
+
},
|
|
57
106
|
actions: {
|
|
58
107
|
get onAction() {
|
|
59
108
|
return props().onAction;
|
|
@@ -76,37 +125,58 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
76
125
|
switch (e.key) {
|
|
77
126
|
case "ArrowDown": {
|
|
78
127
|
e.preventDefault();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
s.setFocusedKey(firstKey);
|
|
88
|
-
}
|
|
128
|
+
const nextKey =
|
|
129
|
+
focusedKey != null
|
|
130
|
+
? findNextNavigableKey(s, collection.getKeyAfter(focusedKey), (k) =>
|
|
131
|
+
collection.getKeyAfter(k),
|
|
132
|
+
)
|
|
133
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
134
|
+
if (nextKey != null) {
|
|
135
|
+
s.setFocusedKey(nextKey);
|
|
89
136
|
}
|
|
90
137
|
break;
|
|
91
138
|
}
|
|
92
139
|
case "ArrowUp": {
|
|
93
140
|
e.preventDefault();
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
141
|
+
const prevKey =
|
|
142
|
+
focusedKey != null
|
|
143
|
+
? findNextNavigableKey(s, collection.getKeyBefore(focusedKey), (k) =>
|
|
144
|
+
collection.getKeyBefore(k),
|
|
145
|
+
)
|
|
146
|
+
: findNextNavigableKey(s, collection.getLastKey(), (k) => collection.getKeyBefore(k));
|
|
147
|
+
if (prevKey != null) {
|
|
148
|
+
s.setFocusedKey(prevKey);
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case "ArrowRight":
|
|
153
|
+
case "ArrowLeft": {
|
|
154
|
+
// Horizontal orientation promotes the inline axis to the primary
|
|
155
|
+
// navigation axis. Upstream's ListKeyboardDelegate strips
|
|
156
|
+
// getKeyLeftOf/getKeyRightOf for a vertical stack, so Left/Right stay
|
|
157
|
+
// no-ops there; in a horizontal stack they move prev/next, flipped
|
|
158
|
+
// under RTL (Right=next, Left=prev in LTR).
|
|
159
|
+
if (p.orientation !== "horizontal") break;
|
|
160
|
+
e.preventDefault();
|
|
161
|
+
const isRtl = p.direction === "rtl";
|
|
162
|
+
const forward = e.key === "ArrowRight" ? !isRtl : isRtl;
|
|
163
|
+
const step = forward
|
|
164
|
+
? (k: Key) => collection.getKeyAfter(k)
|
|
165
|
+
: (k: Key) => collection.getKeyBefore(k);
|
|
166
|
+
const nextKey =
|
|
167
|
+
focusedKey != null
|
|
168
|
+
? findNextNavigableKey(s, step(focusedKey), step)
|
|
169
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
170
|
+
if (nextKey != null) {
|
|
171
|
+
s.setFocusedKey(nextKey);
|
|
104
172
|
}
|
|
105
173
|
break;
|
|
106
174
|
}
|
|
107
175
|
case "Home": {
|
|
108
176
|
e.preventDefault();
|
|
109
|
-
const firstKey = collection.getFirstKey()
|
|
177
|
+
const firstKey = findNextNavigableKey(s, collection.getFirstKey(), (k) =>
|
|
178
|
+
collection.getKeyAfter(k),
|
|
179
|
+
);
|
|
110
180
|
if (firstKey != null) {
|
|
111
181
|
s.setFocusedKey(firstKey);
|
|
112
182
|
}
|
|
@@ -114,7 +184,9 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
114
184
|
}
|
|
115
185
|
case "End": {
|
|
116
186
|
e.preventDefault();
|
|
117
|
-
const lastKey = collection.getLastKey()
|
|
187
|
+
const lastKey = findNextNavigableKey(s, collection.getLastKey(), (k) =>
|
|
188
|
+
collection.getKeyBefore(k),
|
|
189
|
+
);
|
|
118
190
|
if (lastKey != null) {
|
|
119
191
|
s.setFocusedKey(lastKey);
|
|
120
192
|
}
|
|
@@ -128,22 +200,13 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
128
200
|
}
|
|
129
201
|
break;
|
|
130
202
|
}
|
|
131
|
-
|
|
132
|
-
case
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
case "Enter": {
|
|
141
|
-
if (focusedKey != null && !s.isDisabled(focusedKey)) {
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
p.onAction?.(focusedKey);
|
|
144
|
-
}
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
203
|
+
// Space (toggle selection) and Enter (onAction) are intentionally absent
|
|
204
|
+
// here. Upstream's useSelectableCollection has no Space/Enter case — the
|
|
205
|
+
// focused item owns both, via useSelectableItem. We follow browser focus
|
|
206
|
+
// onto the focused row (the effect below), so the row's own handlers in
|
|
207
|
+
// createGridListItem fire. Handling them here too would double-toggle a
|
|
208
|
+
// focused row, because Solid delegates keydown and bubbles the row event
|
|
209
|
+
// up to this grid handler.
|
|
147
210
|
case "Escape": {
|
|
148
211
|
if (s.selectionMode !== "none") {
|
|
149
212
|
e.preventDefault();
|
|
@@ -158,9 +221,11 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
158
221
|
const s = state();
|
|
159
222
|
s.setFocused(true);
|
|
160
223
|
|
|
161
|
-
// If nothing is focused, focus the first item
|
|
224
|
+
// If nothing is focused, focus the first navigable item
|
|
162
225
|
if (s.focusedKey == null) {
|
|
163
|
-
const firstKey = s.collection.getFirstKey()
|
|
226
|
+
const firstKey = findNextNavigableKey(s, s.collection.getFirstKey(), (k) =>
|
|
227
|
+
s.collection.getKeyAfter(k),
|
|
228
|
+
);
|
|
164
229
|
if (firstKey != null) {
|
|
165
230
|
s.setFocusedKey(firstKey);
|
|
166
231
|
}
|
|
@@ -172,6 +237,44 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
172
237
|
s.setFocused(false);
|
|
173
238
|
};
|
|
174
239
|
|
|
240
|
+
// Mirror React Aria's useSelectableCollection: once the roving tabindex for the
|
|
241
|
+
// focused key has been committed to the DOM, move browser focus onto that row
|
|
242
|
+
// from a post-commit effect, looking it up by its stable data-key rather than by
|
|
243
|
+
// transient tabindex. Selection and activation live on the row
|
|
244
|
+
// (createGridListItem) to match upstream, so keyboard nav has to carry focus
|
|
245
|
+
// there for the row's Space/Enter handlers to act on.
|
|
246
|
+
createEffect(() => {
|
|
247
|
+
const s = state();
|
|
248
|
+
const key = s.focusedKey;
|
|
249
|
+
const el = ref();
|
|
250
|
+
if (!el || key == null) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Only manage focus while it already lives inside the grid — i.e. the user is
|
|
255
|
+
// navigating with the keyboard. Gate on the physical position of browser focus
|
|
256
|
+
// rather than the grid's logical isFocused signal: focus can land directly on a
|
|
257
|
+
// row (a pointer click) without ever firing the grid's own focus handler, and
|
|
258
|
+
// the contains() check keeps us from yanking focus back from elsewhere on the
|
|
259
|
+
// page when the focused key changes from a background interaction.
|
|
260
|
+
const active = document.activeElement;
|
|
261
|
+
if (!active || (active !== el && !el.contains(active))) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const target = el.querySelector<HTMLElement>(`[data-key="${key}"]`);
|
|
266
|
+
if (target && target !== active) {
|
|
267
|
+
target.focus();
|
|
268
|
+
|
|
269
|
+
// Reveal the newly focused row when navigating with the keyboard, mirroring
|
|
270
|
+
// useSelectableCollection. Pointer-driven focus changes should not shift the
|
|
271
|
+
// scroll position under the user's finger.
|
|
272
|
+
if (getInteractionModality() !== "pointer") {
|
|
273
|
+
scrollIntoViewport(target, { containingElement: el });
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
|
|
175
278
|
const gridProps = createMemo(() => {
|
|
176
279
|
const p = props();
|
|
177
280
|
const s = state();
|