@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
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createSelectableItem - handles interactions with an item in a selectable
|
|
3
|
+
* collection. Port of `@react-aria/selection`'s `useSelectableItem`.
|
|
4
|
+
*
|
|
5
|
+
* This encapsulates the full press-path action model: the
|
|
6
|
+
* selection-vs-action decision per pointer type, the press-up-vs-press timing
|
|
7
|
+
* (menus select on press up, rows on press down), the keyboard Space/Enter
|
|
8
|
+
* split, double-click secondary actions, and long-press-to-toggle. The
|
|
9
|
+
* selection decision itself is delegated to the aria-layer {@link selectItem}
|
|
10
|
+
* (Phase 0), which is also where the platform-aware modifier resolution lives.
|
|
11
|
+
*
|
|
12
|
+
* Documented adaptations from upstream (React → Solid / our thinner state):
|
|
13
|
+
* - **Link model is prop-threaded.** Our collection nodes don't expose
|
|
14
|
+
* `manager.isLink`/`manager.getItemProps`, so link items pass `isLink` /
|
|
15
|
+
* `href` / `routerOptions` via options and navigation goes through
|
|
16
|
+
* {@link openLink} (we have no `RouterProvider` context).
|
|
17
|
+
* - **Selection manager shape is structural.** ListState passes its
|
|
18
|
+
* SelectionManager; grid-like states pass an adapter with the same observable
|
|
19
|
+
* surface. `canSelectItem` is read from that surface when available so
|
|
20
|
+
* `disabledBehavior: 'selection'` keeps actions enabled while selection stays
|
|
21
|
+
* blocked.
|
|
22
|
+
* - **Virtual focus** guards real DOM focus and updates the focused key on
|
|
23
|
+
* press; we have no `moveVirtualFocus`, so no AT cursor move is dispatched.
|
|
24
|
+
* - **`onDragStart`** is bubble phase (upstream uses capture to beat `useDrag`);
|
|
25
|
+
* wired to capture when drag-and-drop integration lands.
|
|
26
|
+
* - **`getItemProps` press-handler chaining** (collection-provided press
|
|
27
|
+
* handlers) is omitted — our nodes don't carry them.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { createEffect, createUniqueId, type Accessor, type JSX } from "solid-js";
|
|
31
|
+
import type {
|
|
32
|
+
Collection,
|
|
33
|
+
DisabledBehavior,
|
|
34
|
+
FocusStrategy,
|
|
35
|
+
Key,
|
|
36
|
+
Selection,
|
|
37
|
+
SelectionBehavior,
|
|
38
|
+
} from "@proyecto-viviana/solid-stately";
|
|
39
|
+
import { createPress, type PressEvent } from "../interactions/createPress";
|
|
40
|
+
import { createLongPress } from "../interactions/createLongPress";
|
|
41
|
+
import { mergeProps } from "../utils/mergeProps";
|
|
42
|
+
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
43
|
+
import { focusSafely } from "../utils/focus";
|
|
44
|
+
import { getOwnerDocument, getEventTarget, openLink } from "../utils/dom";
|
|
45
|
+
import { getCollectionId, isNonContiguousSelectionModifier } from "./utils";
|
|
46
|
+
import { selectItem, type SelectItemState } from "./selectItem";
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* DOM event dispatched when an item action is performed. Mirrors upstream's
|
|
50
|
+
* `react-aria-item-action`; combobox/autocomplete listen for it to close on
|
|
51
|
+
* action. Exported so emitter and listener share one constant.
|
|
52
|
+
*/
|
|
53
|
+
export const ITEM_ACTION_EVENT = "solidaria:item-action";
|
|
54
|
+
|
|
55
|
+
/** How links in the collection behave relative to selection and actions. */
|
|
56
|
+
export type LinkBehavior = "action" | "selection" | "override" | "none";
|
|
57
|
+
|
|
58
|
+
export interface CreateSelectableItemOptions {
|
|
59
|
+
/** A unique key for the item. */
|
|
60
|
+
key: Key;
|
|
61
|
+
/** Optional DOM id for the item element. Defaults to a generated id. */
|
|
62
|
+
id?: string;
|
|
63
|
+
/**
|
|
64
|
+
* By default, selection occurs on pointer down. Set to select on pointer up
|
|
65
|
+
* instead — useful when selecting an item makes the UI disappear (e.g. menus).
|
|
66
|
+
*/
|
|
67
|
+
shouldSelectOnPressUp?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Whether selection may trigger on a pointer up whose pointer down occurred on
|
|
70
|
+
* a different target (e.g. press down on the menu trigger, up on a menu item).
|
|
71
|
+
*/
|
|
72
|
+
allowsDifferentPressOrigin?: boolean;
|
|
73
|
+
/** Whether the item is contained in a virtual scroller. */
|
|
74
|
+
isVirtualized?: boolean;
|
|
75
|
+
/** Function to focus the item, overriding the default DOM focus. */
|
|
76
|
+
focus?: () => void;
|
|
77
|
+
/** Whether the item should use virtual focus instead of receiving DOM focus. */
|
|
78
|
+
shouldUseVirtualFocus?: boolean;
|
|
79
|
+
/** Whether the item is disabled. */
|
|
80
|
+
isDisabled?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Handler called when the user performs an action on the item. The triggering
|
|
83
|
+
* event depends on the collection's `selectionBehavior` and the modality.
|
|
84
|
+
*/
|
|
85
|
+
onAction?: (event: PressEvent | MouseEvent) => void;
|
|
86
|
+
/**
|
|
87
|
+
* The behavior of links in the collection.
|
|
88
|
+
* - `action`: link behaves like onAction.
|
|
89
|
+
* - `selection`: link follows selection interactions (e.g. URL drives selection).
|
|
90
|
+
* - `override`: links override all other interactions (link items aren't selectable).
|
|
91
|
+
* - `none`: links are disabled for both selection and actions.
|
|
92
|
+
* @default 'action'
|
|
93
|
+
*/
|
|
94
|
+
linkBehavior?: LinkBehavior;
|
|
95
|
+
/** Whether this item is a link (prop-threaded; our nodes don't expose `isLink`). */
|
|
96
|
+
isLink?: boolean;
|
|
97
|
+
/** The link target URL, when `isLink`. */
|
|
98
|
+
href?: string;
|
|
99
|
+
/** Router options forwarded to navigation, when `isLink`. */
|
|
100
|
+
routerOptions?: Record<string, unknown>;
|
|
101
|
+
/**
|
|
102
|
+
* Unstable upstream override that forces an item with `onAction` to treat the
|
|
103
|
+
* action as primary (single click), even when it is selectable.
|
|
104
|
+
*/
|
|
105
|
+
UNSTABLE_itemBehavior?: "selection" | "action";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface SelectableItemAria {
|
|
109
|
+
/** Props to spread on the item root element. */
|
|
110
|
+
itemProps: JSX.HTMLAttributes<HTMLElement>;
|
|
111
|
+
/** Whether the item is currently pressed. */
|
|
112
|
+
isPressed: Accessor<boolean>;
|
|
113
|
+
/** Whether the item is currently selected. */
|
|
114
|
+
isSelected: Accessor<boolean>;
|
|
115
|
+
/** Whether the item is currently focused. */
|
|
116
|
+
isFocused: Accessor<boolean>;
|
|
117
|
+
/** Whether the item is non-interactive (selection and actions both disabled). */
|
|
118
|
+
isDisabled: Accessor<boolean>;
|
|
119
|
+
/** Whether the item may be selected. */
|
|
120
|
+
allowsSelection: Accessor<boolean>;
|
|
121
|
+
/** Whether the item has an action (primary or secondary). */
|
|
122
|
+
hasAction: Accessor<boolean>;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface SelectableItemState<T> extends SelectItemState {
|
|
126
|
+
/** The collection the item belongs to. */
|
|
127
|
+
readonly collection: Accessor<Collection<T>>;
|
|
128
|
+
/** Whether the collection is currently focused. */
|
|
129
|
+
readonly isFocused: Accessor<boolean>;
|
|
130
|
+
/** Sets whether the collection is focused. */
|
|
131
|
+
setFocused(isFocused: boolean): void;
|
|
132
|
+
/** The currently focused key in the collection. */
|
|
133
|
+
readonly focusedKey: Accessor<Key | null>;
|
|
134
|
+
/** The strategy for child focus, when applicable. */
|
|
135
|
+
readonly childFocusStrategy?: Accessor<FocusStrategy | null>;
|
|
136
|
+
/** Sets the focused key. */
|
|
137
|
+
setFocusedKey(key: Key | null, childFocusStrategy?: FocusStrategy): void;
|
|
138
|
+
/** The currently selected keys. */
|
|
139
|
+
readonly selectedKeys: Accessor<Selection>;
|
|
140
|
+
/** Disabled keys for the collection. */
|
|
141
|
+
readonly disabledKeys: Accessor<Set<Key>>;
|
|
142
|
+
/** How disabled keys behave. */
|
|
143
|
+
readonly disabledBehavior: Accessor<DisabledBehavior>;
|
|
144
|
+
/** Whether selection is empty. */
|
|
145
|
+
readonly isEmpty: Accessor<boolean>;
|
|
146
|
+
/** Whether all selectable items are selected. */
|
|
147
|
+
readonly isSelectAll?: Accessor<boolean>;
|
|
148
|
+
/** Whether the key is fully disabled for interaction. */
|
|
149
|
+
isDisabled(key: Key): boolean;
|
|
150
|
+
/** Whether the key may be selected. Defaults to SelectionManager when present. */
|
|
151
|
+
canSelectItem?(key: Key): boolean;
|
|
152
|
+
/** Set the selection behavior for the collection. */
|
|
153
|
+
setSelectionBehavior(behavior: SelectionBehavior): void;
|
|
154
|
+
/** Set multiple selected keys. */
|
|
155
|
+
setSelectedKeys(keys: Iterable<Key>): void;
|
|
156
|
+
/** Select all selectable keys. */
|
|
157
|
+
selectAll(): void;
|
|
158
|
+
/** Clear selection. */
|
|
159
|
+
clearSelection(): void;
|
|
160
|
+
/** Toggle select all. */
|
|
161
|
+
toggleSelectAll(): void;
|
|
162
|
+
/** Optional stable object used by selectable collections for DOM scoping. */
|
|
163
|
+
readonly selectionManager?: {
|
|
164
|
+
canSelectItem?(key: Key): boolean;
|
|
165
|
+
} & object;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const isActionKey = (key: string | undefined) => key === "Enter";
|
|
169
|
+
const isSelectionKey = (key: string | undefined) => key === " ";
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Provides the behavior and accessibility implementation for an item in a
|
|
173
|
+
* selectable collection.
|
|
174
|
+
*/
|
|
175
|
+
export function createSelectableItem<T>(
|
|
176
|
+
options: MaybeAccessor<CreateSelectableItemOptions>,
|
|
177
|
+
manager: SelectableItemState<T>,
|
|
178
|
+
ref: () => HTMLElement | null,
|
|
179
|
+
): SelectableItemAria {
|
|
180
|
+
const getOptions = () => access(options);
|
|
181
|
+
const generatedId = createUniqueId();
|
|
182
|
+
|
|
183
|
+
const key = () => getOptions().key;
|
|
184
|
+
const id = () => getOptions().id ?? generatedId;
|
|
185
|
+
const linkBehavior = (): LinkBehavior => getOptions().linkBehavior ?? "action";
|
|
186
|
+
const shouldUseVirtualFocus = () => getOptions().shouldUseVirtualFocus ?? false;
|
|
187
|
+
const allowsDifferentPressOrigin = () => getOptions().allowsDifferentPressOrigin ?? false;
|
|
188
|
+
const shouldSelectOnPressUp = () => getOptions().shouldSelectOnPressUp ?? false;
|
|
189
|
+
const isLink = () => getOptions().isLink ?? !!getOptions().href;
|
|
190
|
+
|
|
191
|
+
const collection = (): Collection<T> => manager.collection();
|
|
192
|
+
|
|
193
|
+
// Final disabled state: explicitly disabled, or disabled by the collection.
|
|
194
|
+
const isDisabled = () => getOptions().isDisabled === true || manager.isDisabled(key());
|
|
195
|
+
|
|
196
|
+
// Mirrors SelectionManager.canSelectItem, while allowing grid/table/tree
|
|
197
|
+
// adapters to expose the raw selection-disabled check separately from
|
|
198
|
+
// interaction disabled.
|
|
199
|
+
const canSelectItem = () => {
|
|
200
|
+
const k = key();
|
|
201
|
+
return (
|
|
202
|
+
manager.canSelectItem?.(k) ??
|
|
203
|
+
manager.selectionManager?.canSelectItem?.(k) ??
|
|
204
|
+
(manager.selectionMode() !== "none" && !manager.isDisabled(k))
|
|
205
|
+
);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const isLinkOverride = () => isLink() && linkBehavior() === "override";
|
|
209
|
+
const isActionOverride = () =>
|
|
210
|
+
getOptions().onAction != null && getOptions().UNSTABLE_itemBehavior === "action";
|
|
211
|
+
const hasLinkAction = () =>
|
|
212
|
+
isLink() && linkBehavior() !== "selection" && linkBehavior() !== "none";
|
|
213
|
+
|
|
214
|
+
const allowsSelection = () =>
|
|
215
|
+
!isDisabled() && canSelectItem() && !isLinkOverride() && !isActionOverride();
|
|
216
|
+
const allowsActions = () => (getOptions().onAction != null || hasLinkAction()) && !isDisabled();
|
|
217
|
+
|
|
218
|
+
// With checkbox selection (behavior 'toggle'), onAction is primary and occurs
|
|
219
|
+
// on a single click. With highlight selection (behavior 'replace'), onAction
|
|
220
|
+
// is secondary and occurs on double click; single click selects.
|
|
221
|
+
const hasPrimaryAction = () =>
|
|
222
|
+
allowsActions() &&
|
|
223
|
+
(manager.selectionBehavior() === "replace"
|
|
224
|
+
? !allowsSelection()
|
|
225
|
+
: !allowsSelection() || manager.isEmpty());
|
|
226
|
+
const hasSecondaryAction = () =>
|
|
227
|
+
allowsActions() && allowsSelection() && manager.selectionBehavior() === "replace";
|
|
228
|
+
const hasAction = () => hasPrimaryAction() || hasSecondaryAction();
|
|
229
|
+
|
|
230
|
+
const longPressEnabled = () => hasAction() && allowsSelection();
|
|
231
|
+
|
|
232
|
+
// Plain mutable state (no reactivity needed): the modality of the active press
|
|
233
|
+
// and snapshots captured at press start.
|
|
234
|
+
let modality: PressEvent["pointerType"] | null = null;
|
|
235
|
+
let longPressEnabledOnPressStart = false;
|
|
236
|
+
let hadPrimaryActionOnPressStart = false;
|
|
237
|
+
|
|
238
|
+
const isSelected = () => manager.selectionMode() !== "none" && manager.isSelected(key());
|
|
239
|
+
const isFocused = () => manager.isFocused() && manager.focusedKey() === key();
|
|
240
|
+
|
|
241
|
+
// The aria-layer selection decision, with the link branch (deferred from
|
|
242
|
+
// selectItem) layered in. Mirrors useSelectableItem.onSelect.
|
|
243
|
+
const onSelect = (e: PressEvent) => {
|
|
244
|
+
const k = key();
|
|
245
|
+
if (e.pointerType === "keyboard" && isNonContiguousSelectionModifier(e)) {
|
|
246
|
+
manager.toggleSelection(k);
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (manager.selectionMode() === "none") {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (isLink()) {
|
|
255
|
+
if (linkBehavior() === "selection") {
|
|
256
|
+
const el = ref();
|
|
257
|
+
if (el instanceof HTMLAnchorElement) {
|
|
258
|
+
openLink(el, e as unknown as Event);
|
|
259
|
+
}
|
|
260
|
+
// Restore the prior selection so select/combobox close cleanly.
|
|
261
|
+
const sel = manager.selectedKeys();
|
|
262
|
+
if (sel !== "all") {
|
|
263
|
+
manager.setSelectedKeys(sel);
|
|
264
|
+
}
|
|
265
|
+
return;
|
|
266
|
+
} else if (linkBehavior() === "override" || linkBehavior() === "none") {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
selectItem(manager, k, e, collection());
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
const performAction = (e: PressEvent | MouseEvent) => {
|
|
275
|
+
const o = getOptions();
|
|
276
|
+
if (o.onAction) {
|
|
277
|
+
o.onAction(e);
|
|
278
|
+
ref()?.dispatchEvent(new CustomEvent(ITEM_ACTION_EVENT, { bubbles: true }));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (hasLinkAction()) {
|
|
282
|
+
const el = ref();
|
|
283
|
+
if (el instanceof HTMLAnchorElement) {
|
|
284
|
+
openLink(el, e as unknown as Event);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// Focus the associated DOM node when this item becomes the focused key. This
|
|
290
|
+
// is the imperative half of roving tabindex — the tabIndex 0/-1 swap below is
|
|
291
|
+
// only declarative.
|
|
292
|
+
createEffect(() => {
|
|
293
|
+
if (key() !== manager.focusedKey() || !manager.isFocused()) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const o = getOptions();
|
|
298
|
+
if (!shouldUseVirtualFocus()) {
|
|
299
|
+
if (o.focus) {
|
|
300
|
+
o.focus();
|
|
301
|
+
} else {
|
|
302
|
+
const el = ref();
|
|
303
|
+
if (el && getOwnerDocument(el).activeElement !== el) {
|
|
304
|
+
focusSafely(el);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
// Virtual focus: no moveVirtualFocus equivalent in our port (documented gap).
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
const { pressProps, isPressed } = createPress({
|
|
312
|
+
get isDisabled() {
|
|
313
|
+
// Press is only wired when the item is interactive (see the merge below),
|
|
314
|
+
// but guard here too so disabled items never fire press handlers.
|
|
315
|
+
return !(
|
|
316
|
+
allowsSelection() ||
|
|
317
|
+
hasPrimaryAction() ||
|
|
318
|
+
(shouldUseVirtualFocus() && !isDisabled())
|
|
319
|
+
);
|
|
320
|
+
},
|
|
321
|
+
get preventFocusOnPress() {
|
|
322
|
+
return shouldUseVirtualFocus();
|
|
323
|
+
},
|
|
324
|
+
onPressStart(e) {
|
|
325
|
+
modality = e.pointerType;
|
|
326
|
+
longPressEnabledOnPressStart = longPressEnabled();
|
|
327
|
+
|
|
328
|
+
if (shouldSelectOnPressUp()) {
|
|
329
|
+
// Selection still happens on key down for the keyboard.
|
|
330
|
+
if (e.pointerType === "keyboard" && (!hasAction() || isSelectionKey(e.key))) {
|
|
331
|
+
onSelect(e);
|
|
332
|
+
}
|
|
333
|
+
} else {
|
|
334
|
+
hadPrimaryActionOnPressStart = hasPrimaryAction();
|
|
335
|
+
// Select on mouse down unless a primary action will occur on mouse up.
|
|
336
|
+
// For keyboard, select on key down; with an action, Space selects on key
|
|
337
|
+
// down and Enter performs the action on key up.
|
|
338
|
+
if (
|
|
339
|
+
allowsSelection() &&
|
|
340
|
+
((e.pointerType === "mouse" && !hasPrimaryAction()) ||
|
|
341
|
+
(e.pointerType === "keyboard" && (!allowsActions() || isSelectionKey(e.key))))
|
|
342
|
+
) {
|
|
343
|
+
onSelect(e);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// When using virtual focus, update the focused key on (non-touch) press.
|
|
348
|
+
if (shouldUseVirtualFocus() && e.pointerType !== "touch") {
|
|
349
|
+
manager.setFocused(true);
|
|
350
|
+
manager.setFocusedKey(key());
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
onPressUp(e) {
|
|
354
|
+
// Only relevant for press-up selection with a different press origin and
|
|
355
|
+
// no primary action: select on the mouse up itself.
|
|
356
|
+
if (
|
|
357
|
+
shouldSelectOnPressUp() &&
|
|
358
|
+
allowsDifferentPressOrigin() &&
|
|
359
|
+
!hasPrimaryAction() &&
|
|
360
|
+
e.pointerType === "mouse" &&
|
|
361
|
+
allowsSelection()
|
|
362
|
+
) {
|
|
363
|
+
onSelect(e);
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
onPress(e) {
|
|
367
|
+
if (shouldSelectOnPressUp()) {
|
|
368
|
+
if (!allowsDifferentPressOrigin()) {
|
|
369
|
+
if (hasPrimaryAction() || (hasSecondaryAction() && e.pointerType !== "mouse")) {
|
|
370
|
+
if (e.pointerType === "keyboard" && !isActionKey(e.key)) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
performAction(e);
|
|
374
|
+
} else if (e.pointerType !== "keyboard" && allowsSelection()) {
|
|
375
|
+
onSelect(e);
|
|
376
|
+
}
|
|
377
|
+
} else if (hasPrimaryAction()) {
|
|
378
|
+
performAction(e);
|
|
379
|
+
} else if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection()) {
|
|
380
|
+
onSelect(e);
|
|
381
|
+
}
|
|
382
|
+
} else if (
|
|
383
|
+
// Selection on touch up; primary actions on pointer up. Both primary and
|
|
384
|
+
// secondary actions on Enter key up. Secondary mouse actions go through
|
|
385
|
+
// double click (below), not here.
|
|
386
|
+
e.pointerType === "touch" ||
|
|
387
|
+
e.pointerType === "pen" ||
|
|
388
|
+
e.pointerType === "virtual" ||
|
|
389
|
+
(e.pointerType === "keyboard" && hasAction() && isActionKey(e.key)) ||
|
|
390
|
+
(e.pointerType === "mouse" && hadPrimaryActionOnPressStart)
|
|
391
|
+
) {
|
|
392
|
+
if (hasAction()) {
|
|
393
|
+
performAction(e);
|
|
394
|
+
} else if (allowsSelection()) {
|
|
395
|
+
onSelect(e);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// When using virtual focus, update the focused key on a touch press.
|
|
400
|
+
if (shouldUseVirtualFocus() && e.pointerType === "touch") {
|
|
401
|
+
manager.setFocused(true);
|
|
402
|
+
manager.setFocusedKey(key());
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
});
|
|
406
|
+
|
|
407
|
+
// Long pressing an item with touch when selectionBehavior = 'replace' switches
|
|
408
|
+
// to 'toggle': single tap now selects (and toggles checkbox affordances)
|
|
409
|
+
// instead of performing the action.
|
|
410
|
+
const { longPressProps } = createLongPress({
|
|
411
|
+
get isDisabled() {
|
|
412
|
+
return !longPressEnabled();
|
|
413
|
+
},
|
|
414
|
+
onLongPress(e) {
|
|
415
|
+
if (e.pointerType === "touch") {
|
|
416
|
+
onSelect(e as unknown as PressEvent);
|
|
417
|
+
manager.setSelectionBehavior("toggle");
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// Double clicking with a mouse with selectionBehavior = 'replace' performs the
|
|
423
|
+
// secondary action.
|
|
424
|
+
const onDblClick = (e: MouseEvent) => {
|
|
425
|
+
if (!hasSecondaryAction()) return;
|
|
426
|
+
if (modality === "mouse") {
|
|
427
|
+
e.stopPropagation();
|
|
428
|
+
e.preventDefault();
|
|
429
|
+
performAction(e as unknown as PressEvent);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
// Prevent native drag and drop on long press when we also select on long
|
|
434
|
+
// press. Upstream uses a capturing listener to beat useDrag; we use bubble
|
|
435
|
+
// until drag-and-drop integration lands (documented adaptation).
|
|
436
|
+
const onDragStart = (e: DragEvent) => {
|
|
437
|
+
if (modality === "touch" && longPressEnabledOnPressStart) {
|
|
438
|
+
e.preventDefault();
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
|
|
442
|
+
// Prevent native link clicks so we control exactly when they open (matching
|
|
443
|
+
// selection behavior).
|
|
444
|
+
const onClick = (e: MouseEvent) => {
|
|
445
|
+
if (linkBehavior() !== "none" && isLink()) {
|
|
446
|
+
if (!(openLink as { isOpening?: boolean }).isOpening) {
|
|
447
|
+
e.preventDefault();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
return {
|
|
453
|
+
get itemProps(): JSX.HTMLAttributes<HTMLElement> {
|
|
454
|
+
const k = key();
|
|
455
|
+
const disabled = isDisabled();
|
|
456
|
+
|
|
457
|
+
const baseProps: Record<string, unknown> = {
|
|
458
|
+
"data-key": String(k),
|
|
459
|
+
// Scopes this item to its collection for getItemElement. Resolves to a
|
|
460
|
+
// value only once a createSelectableCollection container has registered
|
|
461
|
+
// the manager; otherwise undefined (Solid omits the attribute).
|
|
462
|
+
"data-collection": getCollectionId(manager.selectionManager ?? manager),
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
// Roving tabindex: only the focused item is tabbable. With virtual focus,
|
|
466
|
+
// omit tabIndex entirely (so iOS VoiceOver doesn't pull real focus).
|
|
467
|
+
if (!shouldUseVirtualFocus() && !disabled) {
|
|
468
|
+
baseProps.tabIndex = k === manager.focusedKey() ? 0 : -1;
|
|
469
|
+
baseProps.onFocus = (e: FocusEvent) => {
|
|
470
|
+
if (getEventTarget(e) === ref()) {
|
|
471
|
+
manager.setFocusedKey(k);
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
} else if (disabled) {
|
|
475
|
+
// Prevent focus going to the body when clicking a disabled item.
|
|
476
|
+
baseProps.onMouseDown = (e: MouseEvent) => e.preventDefault();
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
const interactive =
|
|
480
|
+
allowsSelection() || hasPrimaryAction() || (shouldUseVirtualFocus() && !disabled);
|
|
481
|
+
|
|
482
|
+
return mergeProps(
|
|
483
|
+
baseProps,
|
|
484
|
+
interactive ? (pressProps as Record<string, unknown>) : {},
|
|
485
|
+
longPressEnabled() ? (longPressProps as Record<string, unknown>) : {},
|
|
486
|
+
{ onDblClick, onDragStart, onClick, id: id() },
|
|
487
|
+
// Prevent DOM focus from moving on mouse down when using virtual focus.
|
|
488
|
+
shouldUseVirtualFocus() ? { onMouseDown: (e: MouseEvent) => e.preventDefault() } : {},
|
|
489
|
+
) as JSX.HTMLAttributes<HTMLElement>;
|
|
490
|
+
},
|
|
491
|
+
isPressed,
|
|
492
|
+
isSelected,
|
|
493
|
+
isFocused,
|
|
494
|
+
isDisabled,
|
|
495
|
+
allowsSelection,
|
|
496
|
+
hasAction,
|
|
497
|
+
};
|
|
498
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createSelectableList - keyboard navigation and selection for a list collection.
|
|
3
|
+
* Based on @react-aria/selection's `useSelectableList`.
|
|
4
|
+
*
|
|
5
|
+
* React → Solid adaptations (faithful to upstream behavior):
|
|
6
|
+
* - `ref` / `scrollRef` are Solid accessors.
|
|
7
|
+
* - The default `ListKeyboardDelegate` is built inside a `createMemo` so it is
|
|
8
|
+
* recreated whenever the collection, disabled keys, disabled behavior, or
|
|
9
|
+
* collator change (the house convention — the delegate stores those as plain
|
|
10
|
+
* values; see {@link ListKeyboardDelegate}). This is the Solid equivalent of
|
|
11
|
+
* upstream's `useMemo` keyed on the same inputs.
|
|
12
|
+
* - Upstream takes `collection` and `disabledKeys` as separate props; our
|
|
13
|
+
* SelectionManager already exposes them as reactive getters
|
|
14
|
+
* (`manager.collection`, `manager.disabledKeys`, `manager.disabledBehavior`),
|
|
15
|
+
* so the delegate is derived from the manager — a single source of truth.
|
|
16
|
+
* A `layoutDelegate` may still be supplied for virtualized collections.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { createMemo } from "solid-js";
|
|
20
|
+
import type { KeyboardDelegate } from "../grid/types";
|
|
21
|
+
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
22
|
+
import { createCollator } from "../i18n";
|
|
23
|
+
import { ListKeyboardDelegate } from "./ListKeyboardDelegate";
|
|
24
|
+
import type { LayoutDelegate } from "./DOMLayoutDelegate";
|
|
25
|
+
import {
|
|
26
|
+
createSelectableCollection,
|
|
27
|
+
type CreateSelectableCollectionOptions,
|
|
28
|
+
type SelectableCollectionAria,
|
|
29
|
+
} from "./createSelectableCollection";
|
|
30
|
+
|
|
31
|
+
export interface CreateSelectableListOptions<T = unknown> extends Omit<
|
|
32
|
+
CreateSelectableCollectionOptions<T>,
|
|
33
|
+
"keyboardDelegate"
|
|
34
|
+
> {
|
|
35
|
+
/**
|
|
36
|
+
* A delegate object that implements behavior for keyboard focus movement.
|
|
37
|
+
* Defaults to a {@link ListKeyboardDelegate} derived from the selection manager.
|
|
38
|
+
*/
|
|
39
|
+
keyboardDelegate?: MaybeAccessor<KeyboardDelegate>;
|
|
40
|
+
/**
|
|
41
|
+
* A delegate object that provides layout information for items in the
|
|
42
|
+
* collection. Supply this for virtualized collections; by default layout is
|
|
43
|
+
* read from the DOM.
|
|
44
|
+
*/
|
|
45
|
+
layoutDelegate?: LayoutDelegate;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface SelectableListAria {
|
|
49
|
+
/** Props for the list element. */
|
|
50
|
+
listProps: SelectableCollectionAria["collectionProps"];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Handles interactions with a selectable list collection.
|
|
55
|
+
*/
|
|
56
|
+
export function createSelectableList<T = unknown>(
|
|
57
|
+
options: CreateSelectableListOptions<T>,
|
|
58
|
+
): SelectableListAria {
|
|
59
|
+
const manager = options.selectionManager;
|
|
60
|
+
|
|
61
|
+
// By default, a ListKeyboardDelegate is provided which queries layout
|
|
62
|
+
// information from the DOM (e.g. for page up/page down). When virtualized, a
|
|
63
|
+
// layoutDelegate is passed in to override that.
|
|
64
|
+
const collator = createCollator({ usage: "search", sensitivity: "base" });
|
|
65
|
+
const keyboardDelegate = createMemo<KeyboardDelegate>(() => {
|
|
66
|
+
if (options.keyboardDelegate != null) {
|
|
67
|
+
return access(options.keyboardDelegate);
|
|
68
|
+
}
|
|
69
|
+
return new ListKeyboardDelegate<T>({
|
|
70
|
+
collection: manager.collection,
|
|
71
|
+
disabledKeys: manager.disabledKeys,
|
|
72
|
+
disabledBehavior: manager.disabledBehavior,
|
|
73
|
+
ref: options.ref,
|
|
74
|
+
collator: collator(),
|
|
75
|
+
layoutDelegate: options.layoutDelegate,
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const collection = createSelectableCollection<T>({
|
|
80
|
+
...options,
|
|
81
|
+
keyboardDelegate,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Forward `collectionProps` as a getter rather than destructuring it: it is a
|
|
85
|
+
// recomputed-per-access getter (the Solid equivalent of React re-rendering the
|
|
86
|
+
// hook), so the roving `tabIndex` stays reactive to the focused key. Reading it
|
|
87
|
+
// into a local would freeze it at its first value.
|
|
88
|
+
return {
|
|
89
|
+
get listProps() {
|
|
90
|
+
return collection.collectionProps;
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|