@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/tabs/createTabs.ts
CHANGED
|
@@ -54,8 +54,10 @@ export interface TabListAria {
|
|
|
54
54
|
"aria-labelledby"?: string;
|
|
55
55
|
"aria-describedby"?: string;
|
|
56
56
|
onKeyDown: (e: KeyboardEvent) => void;
|
|
57
|
-
onFocus
|
|
58
|
-
|
|
57
|
+
// React's bubbling onFocus/onBlur map to focusin/focusout in Solid; the
|
|
58
|
+
// tab list must observe focus entering/leaving its child tabs.
|
|
59
|
+
onFocusIn: (e: FocusEvent) => void;
|
|
60
|
+
onFocusOut: (e: FocusEvent) => void;
|
|
59
61
|
};
|
|
60
62
|
}
|
|
61
63
|
|
|
@@ -80,12 +82,13 @@ export interface TabAria {
|
|
|
80
82
|
"aria-controls": string | undefined;
|
|
81
83
|
"aria-label"?: string;
|
|
82
84
|
"aria-labelledby"?: string;
|
|
83
|
-
tabIndex: number;
|
|
85
|
+
tabIndex: number | undefined;
|
|
84
86
|
onKeyDown: (e: KeyboardEvent) => void;
|
|
85
87
|
onMouseDown: (e: MouseEvent) => void;
|
|
86
88
|
onPointerDown: (e: PointerEvent) => void;
|
|
87
89
|
onClick: (e: MouseEvent) => void;
|
|
88
90
|
onFocus: (e: FocusEvent) => void;
|
|
91
|
+
onBlur: (e: FocusEvent) => void;
|
|
89
92
|
};
|
|
90
93
|
/** Whether the tab is selected. */
|
|
91
94
|
isSelected: Accessor<boolean>;
|
|
@@ -269,6 +272,11 @@ export function createTabList<T>(props: AriaTabListProps, state: TabListState<T>
|
|
|
269
272
|
if (nextKey !== null) {
|
|
270
273
|
e.preventDefault();
|
|
271
274
|
state.setFocusedKey(nextKey);
|
|
275
|
+
// Selection follows focus only for keyboard navigation in automatic mode
|
|
276
|
+
// (mirrors useSelectableCollection's selectOnFocus in navigateToKey).
|
|
277
|
+
if (keyboardActivation() === "automatic") {
|
|
278
|
+
state.setSelectedKey(nextKey);
|
|
279
|
+
}
|
|
272
280
|
}
|
|
273
281
|
};
|
|
274
282
|
|
|
@@ -297,8 +305,8 @@ export function createTabList<T>(props: AriaTabListProps, state: TabListState<T>
|
|
|
297
305
|
"aria-labelledby": props["aria-labelledby"],
|
|
298
306
|
"aria-describedby": props["aria-describedby"],
|
|
299
307
|
onKeyDown: handleKeyDown,
|
|
300
|
-
|
|
301
|
-
|
|
308
|
+
onFocusIn: handleFocus,
|
|
309
|
+
onFocusOut: handleBlur,
|
|
302
310
|
},
|
|
303
311
|
};
|
|
304
312
|
}
|
|
@@ -319,24 +327,35 @@ export function createTab<T>(
|
|
|
319
327
|
return state.isKeyDisabled(key());
|
|
320
328
|
});
|
|
321
329
|
|
|
322
|
-
|
|
330
|
+
// Whether this tab is the roving-focus target (state layer), used for the
|
|
331
|
+
// roving tabIndex and DOM focus alignment. The returned isFocused is the
|
|
332
|
+
// DOM-focus-based ring state, matching upstream's useFocusRing semantics.
|
|
333
|
+
const isKeyFocused = createMemo(() => state.focusedKey() === key());
|
|
323
334
|
|
|
324
335
|
// Focus ring
|
|
325
|
-
const { isFocusVisible, focusProps } = createFocusRing();
|
|
326
|
-
|
|
327
|
-
// Press handling
|
|
336
|
+
const { isFocused, isFocusVisible, focusProps } = createFocusRing();
|
|
337
|
+
|
|
338
|
+
// Press handling. Selection timing mirrors useSelectableItem's default
|
|
339
|
+
// (non-shouldSelectOnPressUp) path: mouse selects on press start and
|
|
340
|
+
// keyboard on key down, while touch, pen, and virtual pointers select on
|
|
341
|
+
// press up.
|
|
342
|
+
const selectTab = () => {
|
|
343
|
+
const tabKey = key();
|
|
344
|
+
state.setFocusedKey(tabKey);
|
|
345
|
+
state.setSelectedKey(tabKey);
|
|
346
|
+
};
|
|
328
347
|
const { isPressed, pressProps } = createPress({
|
|
329
348
|
get isDisabled() {
|
|
330
349
|
return isDisabled();
|
|
331
350
|
},
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
if (
|
|
339
|
-
|
|
351
|
+
onPressStart: (e) => {
|
|
352
|
+
if (e.pointerType === "mouse" || e.pointerType === "keyboard") {
|
|
353
|
+
selectTab();
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
onPress: (e) => {
|
|
357
|
+
if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual") {
|
|
358
|
+
selectTab();
|
|
340
359
|
}
|
|
341
360
|
},
|
|
342
361
|
});
|
|
@@ -369,6 +388,10 @@ export function createTab<T>(
|
|
|
369
388
|
callHandler(focusProps.onFocus, e);
|
|
370
389
|
};
|
|
371
390
|
|
|
391
|
+
const handleBlur = (e: FocusEvent) => {
|
|
392
|
+
callHandler(focusProps.onBlur, e);
|
|
393
|
+
};
|
|
394
|
+
|
|
372
395
|
// Combine all handlers
|
|
373
396
|
const handleKeyDown = (e: KeyboardEvent) => {
|
|
374
397
|
callHandler(pressProps.onKeyDown, e);
|
|
@@ -386,10 +409,13 @@ export function createTab<T>(
|
|
|
386
409
|
callHandler(pressProps.onClick, e);
|
|
387
410
|
};
|
|
388
411
|
|
|
389
|
-
// Keep DOM focus aligned with focusedKey updates from keyboard
|
|
412
|
+
// Keep DOM focus aligned with focusedKey updates from keyboard navigation.
|
|
413
|
+
// Only while the tab list itself is focused (mirrors useSelectableItem's
|
|
414
|
+
// manager.isFocused guard), so programmatic selection changes don't steal
|
|
415
|
+
// focus from elsewhere in the document.
|
|
390
416
|
createEffect(() => {
|
|
391
417
|
const element = ref?.();
|
|
392
|
-
if (!isFocused() || !element) return;
|
|
418
|
+
if (!state.isFocused() || !isKeyFocused() || !element) return;
|
|
393
419
|
|
|
394
420
|
const activeElement = element.ownerDocument?.activeElement;
|
|
395
421
|
if (activeElement !== element) {
|
|
@@ -413,13 +439,17 @@ export function createTab<T>(
|
|
|
413
439
|
"aria-label": props["aria-label"],
|
|
414
440
|
"aria-labelledby": props["aria-labelledby"],
|
|
415
441
|
get tabIndex() {
|
|
416
|
-
|
|
442
|
+
// Roving tabIndex follows the focused key (mirrors useSelectableItem);
|
|
443
|
+
// disabled tabs get no tabIndex at all (mirrors useTab).
|
|
444
|
+
if (isDisabled()) return undefined;
|
|
445
|
+
return isKeyFocused() ? 0 : -1;
|
|
417
446
|
},
|
|
418
447
|
onKeyDown: handleKeyDown,
|
|
419
448
|
onMouseDown: handleMouseDown,
|
|
420
449
|
onPointerDown: handlePointerDown,
|
|
421
450
|
onClick: handleClick,
|
|
422
451
|
onFocus: handleFocus,
|
|
452
|
+
onBlur: handleBlur,
|
|
423
453
|
},
|
|
424
454
|
isSelected,
|
|
425
455
|
isDisabled,
|
package/src/tag/createTag.ts
CHANGED
|
@@ -20,6 +20,8 @@ import type { ListState, Key } from "@proyecto-viviana/solid-stately";
|
|
|
20
20
|
export interface AriaTagProps {
|
|
21
21
|
/** The unique key for this tag. */
|
|
22
22
|
key: Key;
|
|
23
|
+
/** The role for the tag root. Components use row semantics inside a grid. */
|
|
24
|
+
role?: "option" | "row";
|
|
23
25
|
/** Whether the tag is disabled. */
|
|
24
26
|
isDisabled?: boolean;
|
|
25
27
|
/** A text value for the tag used for accessibility. */
|
|
@@ -149,9 +151,9 @@ export function createTag<T>(
|
|
|
149
151
|
return;
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
const nextTag = Array.from(
|
|
153
|
-
|
|
154
|
-
);
|
|
154
|
+
const nextTag = Array.from(
|
|
155
|
+
tagList.querySelectorAll<HTMLElement>('[role="option"], [role="row"]'),
|
|
156
|
+
).find((el) => el.getAttribute("data-key") === String(nextKey));
|
|
155
157
|
|
|
156
158
|
nextTag?.focus();
|
|
157
159
|
};
|
|
@@ -268,6 +270,8 @@ export function createTag<T>(
|
|
|
268
270
|
return !!data?.onRemove;
|
|
269
271
|
});
|
|
270
272
|
|
|
273
|
+
const rootRole = createMemo(() => getProps().role ?? "option");
|
|
274
|
+
|
|
271
275
|
return {
|
|
272
276
|
get rowProps() {
|
|
273
277
|
return mergeProps(
|
|
@@ -276,9 +280,10 @@ export function createTag<T>(
|
|
|
276
280
|
pressProps as Record<string, unknown>,
|
|
277
281
|
{
|
|
278
282
|
id: rowId,
|
|
279
|
-
role:
|
|
283
|
+
role: rootRole(),
|
|
280
284
|
tabIndex: tabIndex(),
|
|
281
285
|
"data-key": String(key()),
|
|
286
|
+
"aria-label": getProps().textValue,
|
|
282
287
|
"aria-selected": isSelectable() ? isSelected() : undefined,
|
|
283
288
|
"aria-disabled": isDisabled() || undefined,
|
|
284
289
|
onKeyDown: handleKeyDown,
|
package/src/toast/createToast.ts
CHANGED
|
@@ -79,6 +79,7 @@ export function createToast<T>(props: AriaToastProps<T>): ToastAria {
|
|
|
79
79
|
"aria-modal": "false",
|
|
80
80
|
"aria-labelledby": hasTitle ? titleId : undefined,
|
|
81
81
|
"aria-describedby": hasDescription ? descriptionId : undefined,
|
|
82
|
+
tabIndex: 0,
|
|
82
83
|
"data-animation": props.toast.animation,
|
|
83
84
|
"data-key": props.toast.key,
|
|
84
85
|
}));
|
|
@@ -13,6 +13,7 @@ import { mergeProps } from "../utils/mergeProps";
|
|
|
13
13
|
import { filterDOMProps } from "../utils/filterDOMProps";
|
|
14
14
|
import { type MaybeAccessor, access } from "../utils/reactivity";
|
|
15
15
|
import { isDevEnv } from "../utils/env";
|
|
16
|
+
import { createSlotId } from "../ssr";
|
|
16
17
|
import { type ToggleState } from "@proyecto-viviana/solid-stately";
|
|
17
18
|
import { type PressEvent } from "../interactions/PressEvent";
|
|
18
19
|
|
|
@@ -84,6 +85,10 @@ export interface ToggleAria {
|
|
|
84
85
|
labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;
|
|
85
86
|
/** Props to be spread on the input element. */
|
|
86
87
|
inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
88
|
+
/** Props for the description element, if any. */
|
|
89
|
+
descriptionProps: JSX.HTMLAttributes<HTMLElement>;
|
|
90
|
+
/** Props for the error message element, if any. */
|
|
91
|
+
errorMessageProps: JSX.HTMLAttributes<HTMLElement>;
|
|
87
92
|
/** Whether the toggle is selected. */
|
|
88
93
|
isSelected: Accessor<boolean>;
|
|
89
94
|
/** Whether the toggle is in a pressed state. */
|
|
@@ -233,6 +238,12 @@ export function createToggle(
|
|
|
233
238
|
// Combined pressed state
|
|
234
239
|
const combinedIsPressed: Accessor<boolean> = () => isPressed() || isLabelPressed();
|
|
235
240
|
|
|
241
|
+
// Mint ids for the description and error message slots. Copied from createField
|
|
242
|
+
// because we don't want the label behavior that provides — the id resolves only
|
|
243
|
+
// once an element with that id is actually rendered (e.g. via TextContext slots).
|
|
244
|
+
const descriptionId = createSlotId();
|
|
245
|
+
const errorMessageId = createSlotId();
|
|
246
|
+
|
|
236
247
|
return {
|
|
237
248
|
labelProps: mergeProps(labelPressProps, {
|
|
238
249
|
onClick: (e: MouseEvent) => e.preventDefault(),
|
|
@@ -244,6 +255,9 @@ export function createToggle(
|
|
|
244
255
|
"aria-errormessage": p["aria-errormessage"],
|
|
245
256
|
"aria-controls": p["aria-controls"],
|
|
246
257
|
"aria-readonly": isReadOnly() || undefined,
|
|
258
|
+
"aria-describedby":
|
|
259
|
+
[descriptionId(), errorMessageId(), p["aria-describedby"]].filter(Boolean).join(" ") ||
|
|
260
|
+
undefined,
|
|
247
261
|
onChange,
|
|
248
262
|
disabled: isDisabled(),
|
|
249
263
|
...(p.value == null ? {} : { value: p.value }),
|
|
@@ -256,6 +270,12 @@ export function createToggle(
|
|
|
256
270
|
onClick: (e: MouseEvent) => e.stopPropagation(),
|
|
257
271
|
}) as JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
258
272
|
},
|
|
273
|
+
get descriptionProps() {
|
|
274
|
+
return { id: descriptionId() };
|
|
275
|
+
},
|
|
276
|
+
get errorMessageProps() {
|
|
277
|
+
return { id: errorMessageId() };
|
|
278
|
+
},
|
|
259
279
|
isSelected: state.isSelected,
|
|
260
280
|
isPressed: combinedIsPressed,
|
|
261
281
|
isDisabled: isDisabled(),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { createSignal, onMount, onCleanup, type Accessor } from "solid-js";
|
|
9
9
|
import { type MaybeAccessor, access } from "../utils";
|
|
10
10
|
import { useLocale } from "../i18n";
|
|
11
|
-
import { getOwnerDocument, isFocusable } from "../utils";
|
|
11
|
+
import { getOwnerDocument, isFocusable, isTabbable } from "../utils";
|
|
12
12
|
import { focusSafely } from "../utils/focus";
|
|
13
13
|
|
|
14
14
|
export type Orientation = "horizontal" | "vertical";
|
|
@@ -26,7 +26,7 @@ export interface ToolbarAria {
|
|
|
26
26
|
/** Props for the toolbar container element. */
|
|
27
27
|
toolbarProps: {
|
|
28
28
|
role: "toolbar" | "group";
|
|
29
|
-
"aria-orientation"
|
|
29
|
+
"aria-orientation"?: Orientation;
|
|
30
30
|
"aria-label"?: string;
|
|
31
31
|
"aria-labelledby"?: string;
|
|
32
32
|
tabIndex?: number;
|
|
@@ -50,17 +50,6 @@ interface FocusManager {
|
|
|
50
50
|
focusLast(opts?: FocusManagerOptions): HTMLElement | null;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
function isTabbable(element: Element): boolean {
|
|
54
|
-
if (!isFocusable(element)) {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
const tabIndex = element.getAttribute("tabindex");
|
|
58
|
-
if (tabIndex != null) {
|
|
59
|
-
return parseInt(tabIndex, 10) >= 0;
|
|
60
|
-
}
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
53
|
function getFocusableElements(root: Element, tabbable = false): HTMLElement[] {
|
|
65
54
|
const elements: HTMLElement[] = [];
|
|
66
55
|
const filter = tabbable ? isTabbable : isFocusable;
|
|
@@ -292,20 +281,18 @@ export function createToolbar(props: AriaToolbarProps = {}): ToolbarAria {
|
|
|
292
281
|
return;
|
|
293
282
|
}
|
|
294
283
|
|
|
295
|
-
|
|
296
|
-
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) {
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
284
|
+
const doc = getOwnerDocument(root);
|
|
299
285
|
|
|
300
|
-
// Text entry controls
|
|
286
|
+
// Text entry controls keep the arrow keys for caret/value navigation.
|
|
287
|
+
// Upstream useToolbar has no such guard; a text input placed inside a
|
|
288
|
+
// toolbar would otherwise lose caret movement. Kept (narrowed to arrows)
|
|
289
|
+
// as a suspected divergence pending a dedicated ActionBar/Toolbar cert.
|
|
301
290
|
if (isTextInputLikeElement(target)) {
|
|
302
291
|
switch (e.key) {
|
|
303
292
|
case "ArrowRight":
|
|
304
293
|
case "ArrowLeft":
|
|
305
294
|
case "ArrowDown":
|
|
306
295
|
case "ArrowUp":
|
|
307
|
-
case "Home":
|
|
308
|
-
case "End":
|
|
309
296
|
return;
|
|
310
297
|
}
|
|
311
298
|
}
|
|
@@ -349,18 +336,18 @@ export function createToolbar(props: AriaToolbarProps = {}): ToolbarAria {
|
|
|
349
336
|
handled = true;
|
|
350
337
|
}
|
|
351
338
|
break;
|
|
352
|
-
case "Home":
|
|
353
|
-
focusManager.focusFirst({ tabbable: true });
|
|
354
|
-
handled = true;
|
|
355
|
-
break;
|
|
356
|
-
case "End":
|
|
357
|
-
focusManager.focusLast({ tabbable: true });
|
|
358
|
-
handled = true;
|
|
359
|
-
break;
|
|
360
339
|
case "Tab":
|
|
361
|
-
//
|
|
362
|
-
|
|
363
|
-
|
|
340
|
+
// Move focus to the first/last child so the browser's own Tab handling
|
|
341
|
+
// then carries focus OUT of the whole toolbar. Faithful to upstream
|
|
342
|
+
// useToolbar: there is no roving tabindex — every item stays tabbable,
|
|
343
|
+
// so a bare Tab would otherwise step to the next item instead of leaving.
|
|
344
|
+
lastFocusedElement = getActiveElement(doc);
|
|
345
|
+
if (e.shiftKey) {
|
|
346
|
+
focusManager.focusFirst({ tabbable: true });
|
|
347
|
+
} else {
|
|
348
|
+
focusManager.focusLast({ tabbable: true });
|
|
349
|
+
}
|
|
350
|
+
return;
|
|
364
351
|
}
|
|
365
352
|
|
|
366
353
|
if (handled) {
|
|
@@ -369,24 +356,36 @@ export function createToolbar(props: AriaToolbarProps = {}): ToolbarAria {
|
|
|
369
356
|
}
|
|
370
357
|
};
|
|
371
358
|
|
|
372
|
-
//
|
|
373
|
-
const
|
|
359
|
+
// Record the last focused child when focus moves out of the toolbar.
|
|
360
|
+
const onBlur = (e: FocusEvent) => {
|
|
361
|
+
const root = toolbarRef;
|
|
362
|
+
if (!root) return;
|
|
374
363
|
if (isInToolbar()) return;
|
|
375
364
|
|
|
376
|
-
|
|
365
|
+
const relatedTarget = e.relatedTarget as Node | null;
|
|
366
|
+
if (!(relatedTarget && root.contains(relatedTarget)) && !lastFocusedElement) {
|
|
367
|
+
lastFocusedElement = e.target as Element;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
// Restore focus to the last focused child when focus returns into the toolbar.
|
|
372
|
+
// If that element was removed, focus() is a no-op and the browser lands on the
|
|
373
|
+
// first/last child per direction — matching upstream useToolbar.
|
|
374
|
+
const onFocus = (e: FocusEvent) => {
|
|
377
375
|
const root = toolbarRef;
|
|
378
376
|
if (!root) return;
|
|
377
|
+
if (isInToolbar()) return;
|
|
379
378
|
|
|
380
|
-
const relatedTarget = e.relatedTarget as
|
|
381
|
-
|
|
382
|
-
// If focus came from outside and we have a last focused element
|
|
379
|
+
const relatedTarget = e.relatedTarget as Node | null;
|
|
380
|
+
const target = e.target;
|
|
383
381
|
if (
|
|
384
382
|
lastFocusedElement &&
|
|
385
|
-
root.contains(
|
|
386
|
-
|
|
383
|
+
!(relatedTarget && root.contains(relatedTarget)) &&
|
|
384
|
+
target instanceof Node &&
|
|
385
|
+
root.contains(target)
|
|
387
386
|
) {
|
|
388
|
-
// Restore focus to the last focused element
|
|
389
387
|
focusSafely(lastFocusedElement as HTMLElement);
|
|
388
|
+
lastFocusedElement = null;
|
|
390
389
|
}
|
|
391
390
|
};
|
|
392
391
|
|
|
@@ -394,13 +393,15 @@ export function createToolbar(props: AriaToolbarProps = {}): ToolbarAria {
|
|
|
394
393
|
const setRef = (el: HTMLElement) => {
|
|
395
394
|
toolbarRef = el;
|
|
396
395
|
|
|
397
|
-
// Use capture phase
|
|
396
|
+
// Use capture phase so container handlers run before the focused child's.
|
|
398
397
|
el.addEventListener("keydown", onKeyDown, true);
|
|
399
398
|
el.addEventListener("focus", onFocus, true);
|
|
399
|
+
el.addEventListener("blur", onBlur, true);
|
|
400
400
|
|
|
401
401
|
onCleanup(() => {
|
|
402
402
|
el.removeEventListener("keydown", onKeyDown, true);
|
|
403
403
|
el.removeEventListener("focus", onFocus, true);
|
|
404
|
+
el.removeEventListener("blur", onBlur, true);
|
|
404
405
|
});
|
|
405
406
|
};
|
|
406
407
|
|
|
@@ -410,7 +411,7 @@ export function createToolbar(props: AriaToolbarProps = {}): ToolbarAria {
|
|
|
410
411
|
return isInToolbar() ? "group" : "toolbar";
|
|
411
412
|
},
|
|
412
413
|
get "aria-orientation"() {
|
|
413
|
-
return orientation();
|
|
414
|
+
return isInToolbar() ? undefined : orientation();
|
|
414
415
|
},
|
|
415
416
|
get "aria-label"() {
|
|
416
417
|
return ariaLabel();
|
package/src/tree/createTree.ts
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Based on @react-aria/tree/useTree.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createMemo, type Accessor } from "solid-js";
|
|
6
|
+
import { createEffect, createMemo, 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 { TreeState, TreeCollection, Key } from "@proyecto-viviana/solid-stately";
|
|
10
10
|
import type { AriaTreeProps, TreeAria } from "./types";
|
|
11
|
+
import { scrollIntoViewport } from "../utils";
|
|
12
|
+
import { getInteractionModality } from "../interactions/createInteractionModality";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Metadata stored for a tree instance.
|
|
@@ -15,6 +17,10 @@ import type { AriaTreeProps, TreeAria } from "./types";
|
|
|
15
17
|
interface TreeData {
|
|
16
18
|
/** The generated ID for the tree. */
|
|
17
19
|
treeId: string;
|
|
20
|
+
/** How keyboard navigation behaves within row children. */
|
|
21
|
+
keyboardNavigationBehavior: "arrow" | "tab";
|
|
22
|
+
/** Text direction for row-child arrow navigation and tree expansion keys. */
|
|
23
|
+
direction: "ltr" | "rtl";
|
|
18
24
|
/** Actions registered for the tree. */
|
|
19
25
|
actions: {
|
|
20
26
|
onAction?: (key: Key) => void;
|
|
@@ -35,13 +41,45 @@ export function getTreeData<T extends object, C extends TreeCollection<T>>(
|
|
|
35
41
|
return treeDataMap.get(state);
|
|
36
42
|
}
|
|
37
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Whether a key should be skipped during keyboard navigation. Disabled keys only
|
|
46
|
+
* block navigation under `disabledBehavior: "all"` (the default); under
|
|
47
|
+
* `"selection"` they remain focusable (selection is still blocked elsewhere).
|
|
48
|
+
* Mirrors `ListKeyboardDelegate.isDisabled` in React Aria.
|
|
49
|
+
*/
|
|
50
|
+
function isNavigationDisabled<T extends object, C extends TreeCollection<T>>(
|
|
51
|
+
state: TreeState<T, C>,
|
|
52
|
+
key: Key,
|
|
53
|
+
): boolean {
|
|
54
|
+
return state.isDisabled(key) && state.disabledBehavior === "all";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Walks from `startKey` via `step` until reaching a key that is navigable (not
|
|
59
|
+
* disabled for navigation), mirroring React Aria's
|
|
60
|
+
* `ListKeyboardDelegate.findNextNonDisabled`. `getFirstKey`/`getLastKey` and the
|
|
61
|
+
* next/previous lookups all funnel through this so arrow keys, Home and End land
|
|
62
|
+
* on enabled rows only.
|
|
63
|
+
*/
|
|
64
|
+
function findNextNavigableKey<T extends object, C extends TreeCollection<T>>(
|
|
65
|
+
state: TreeState<T, C>,
|
|
66
|
+
startKey: Key | null,
|
|
67
|
+
step: (key: Key) => Key | null,
|
|
68
|
+
): Key | null {
|
|
69
|
+
let key = startKey;
|
|
70
|
+
while (key != null && isNavigationDisabled(state, key)) {
|
|
71
|
+
key = step(key);
|
|
72
|
+
}
|
|
73
|
+
return key;
|
|
74
|
+
}
|
|
75
|
+
|
|
38
76
|
/**
|
|
39
77
|
* Creates accessibility props for a tree.
|
|
40
78
|
*/
|
|
41
79
|
export function createTree<T extends object, C extends TreeCollection<T> = TreeCollection<T>>(
|
|
42
80
|
props: Accessor<AriaTreeProps>,
|
|
43
81
|
state: Accessor<TreeState<T, C>>,
|
|
44
|
-
|
|
82
|
+
ref: Accessor<HTMLDivElement | null>,
|
|
45
83
|
): TreeAria {
|
|
46
84
|
// Generate a unique ID for the tree
|
|
47
85
|
const treeId = props().id ?? createId();
|
|
@@ -49,6 +87,12 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
49
87
|
// Store tree data for child components
|
|
50
88
|
const treeData: TreeData = {
|
|
51
89
|
treeId,
|
|
90
|
+
get keyboardNavigationBehavior() {
|
|
91
|
+
return props().keyboardNavigationBehavior ?? "arrow";
|
|
92
|
+
},
|
|
93
|
+
get direction() {
|
|
94
|
+
return props().direction ?? "ltr";
|
|
95
|
+
},
|
|
52
96
|
actions: {
|
|
53
97
|
get onAction() {
|
|
54
98
|
return props().onAction;
|
|
@@ -75,31 +119,27 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
75
119
|
switch (e.key) {
|
|
76
120
|
case "ArrowDown": {
|
|
77
121
|
e.preventDefault();
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
s.setFocusedKey(firstKey);
|
|
87
|
-
}
|
|
122
|
+
const nextKey =
|
|
123
|
+
focusedKey != null
|
|
124
|
+
? findNextNavigableKey(s, collection.getKeyAfter(focusedKey), (k) =>
|
|
125
|
+
collection.getKeyAfter(k),
|
|
126
|
+
)
|
|
127
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
128
|
+
if (nextKey != null) {
|
|
129
|
+
s.setFocusedKey(nextKey);
|
|
88
130
|
}
|
|
89
131
|
break;
|
|
90
132
|
}
|
|
91
133
|
case "ArrowUp": {
|
|
92
134
|
e.preventDefault();
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
s.setFocusedKey(lastKey);
|
|
102
|
-
}
|
|
135
|
+
const prevKey =
|
|
136
|
+
focusedKey != null
|
|
137
|
+
? findNextNavigableKey(s, collection.getKeyBefore(focusedKey), (k) =>
|
|
138
|
+
collection.getKeyBefore(k),
|
|
139
|
+
)
|
|
140
|
+
: findNextNavigableKey(s, collection.getLastKey(), (k) => collection.getKeyBefore(k));
|
|
141
|
+
if (prevKey != null) {
|
|
142
|
+
s.setFocusedKey(prevKey);
|
|
103
143
|
}
|
|
104
144
|
break;
|
|
105
145
|
}
|
|
@@ -133,7 +173,9 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
133
173
|
}
|
|
134
174
|
case "Home": {
|
|
135
175
|
e.preventDefault();
|
|
136
|
-
const firstKey = collection.getFirstKey()
|
|
176
|
+
const firstKey = findNextNavigableKey(s, collection.getFirstKey(), (k) =>
|
|
177
|
+
collection.getKeyAfter(k),
|
|
178
|
+
);
|
|
137
179
|
if (firstKey != null) {
|
|
138
180
|
s.setFocusedKey(firstKey);
|
|
139
181
|
}
|
|
@@ -141,7 +183,9 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
141
183
|
}
|
|
142
184
|
case "End": {
|
|
143
185
|
e.preventDefault();
|
|
144
|
-
const lastKey = collection.getLastKey()
|
|
186
|
+
const lastKey = findNextNavigableKey(s, collection.getLastKey(), (k) =>
|
|
187
|
+
collection.getKeyBefore(k),
|
|
188
|
+
);
|
|
145
189
|
if (lastKey != null) {
|
|
146
190
|
s.setFocusedKey(lastKey);
|
|
147
191
|
}
|
|
@@ -155,22 +199,11 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
155
199
|
}
|
|
156
200
|
break;
|
|
157
201
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
s.toggleSelection(focusedKey);
|
|
164
|
-
}
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
case "Enter": {
|
|
168
|
-
if (focusedKey != null && !s.isDisabled(focusedKey)) {
|
|
169
|
-
e.preventDefault();
|
|
170
|
-
p.onAction?.(focusedKey);
|
|
171
|
-
}
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
202
|
+
// Space (selection) and Enter (action) are intentionally absent here.
|
|
203
|
+
// Upstream's useSelectableCollection leaves activation to useSelectableItem.
|
|
204
|
+
// The focus effect below moves DOM focus onto the focused row, so the row's
|
|
205
|
+
// own createSelectableItem handlers receive those keys without duplicating
|
|
206
|
+
// work in the bubbling tree handler.
|
|
174
207
|
case "Escape": {
|
|
175
208
|
if (s.selectionMode !== "none") {
|
|
176
209
|
e.preventDefault();
|
|
@@ -211,9 +244,11 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
211
244
|
const s = state();
|
|
212
245
|
s.setFocused(true);
|
|
213
246
|
|
|
214
|
-
// If nothing is focused, focus the first item
|
|
247
|
+
// If nothing is focused, focus the first navigable item
|
|
215
248
|
if (s.focusedKey == null) {
|
|
216
|
-
const firstKey = s.collection.getFirstKey()
|
|
249
|
+
const firstKey = findNextNavigableKey(s, s.collection.getFirstKey(), (k) =>
|
|
250
|
+
s.collection.getKeyAfter(k),
|
|
251
|
+
);
|
|
217
252
|
if (firstKey != null) {
|
|
218
253
|
s.setFocusedKey(firstKey);
|
|
219
254
|
}
|
|
@@ -225,6 +260,29 @@ export function createTree<T extends object, C extends TreeCollection<T> = TreeC
|
|
|
225
260
|
s.setFocused(false);
|
|
226
261
|
};
|
|
227
262
|
|
|
263
|
+
createEffect(() => {
|
|
264
|
+
const s = state();
|
|
265
|
+
const key = s.focusedKey;
|
|
266
|
+
const el = ref();
|
|
267
|
+
if (!el || key == null) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const active = document.activeElement;
|
|
272
|
+
if (!active || (active !== el && !el.contains(active))) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const target = el.querySelector<HTMLElement>(`[data-key="${key}"]`);
|
|
277
|
+
if (target && target !== active) {
|
|
278
|
+
target.focus();
|
|
279
|
+
|
|
280
|
+
if (getInteractionModality() !== "pointer") {
|
|
281
|
+
scrollIntoViewport(target, { containingElement: el });
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
|
|
228
286
|
const treeProps = createMemo(() => {
|
|
229
287
|
const p = props();
|
|
230
288
|
const s = state();
|