@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
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* item text values. Supports multi-character search with debouncing.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { onCleanup } from "solid-js";
|
|
9
10
|
import type { JSX, Accessor } from "solid-js";
|
|
10
11
|
import type { Key, Collection, CollectionNode } from "@proyecto-viviana/solid-stately";
|
|
12
|
+
import { createCollator } from "../i18n/createCollator";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Controls how long to wait before clearing the typeahead buffer.
|
|
@@ -58,16 +60,17 @@ function getStringForKey(key: string): string {
|
|
|
58
60
|
|
|
59
61
|
/**
|
|
60
62
|
* Search for a key in the collection that matches the search string.
|
|
61
|
-
* Starts
|
|
63
|
+
* Starts *at* `fromKey` (inclusive) and scans to the end, with no internal
|
|
64
|
+
* wrap; the caller retries from the top to cover earlier items. Matching is
|
|
65
|
+
* locale-aware via the supplied `collator`.
|
|
62
66
|
*/
|
|
63
67
|
function getKeyForSearch<T>(
|
|
64
68
|
collection: Collection<T>,
|
|
65
69
|
search: string,
|
|
66
70
|
fromKey: Key | null,
|
|
71
|
+
collator: Intl.Collator,
|
|
67
72
|
isKeyDisabled?: (key: Key) => boolean,
|
|
68
73
|
): Key | null {
|
|
69
|
-
const searchLower = search.toLowerCase();
|
|
70
|
-
|
|
71
74
|
// Collect all items in order
|
|
72
75
|
const items: CollectionNode<T>[] = [];
|
|
73
76
|
for (const item of collection) {
|
|
@@ -78,19 +81,21 @@ function getKeyForSearch<T>(
|
|
|
78
81
|
|
|
79
82
|
if (items.length === 0) return null;
|
|
80
83
|
|
|
81
|
-
// Find the starting index
|
|
84
|
+
// Find the starting index. Start *at* the currently focused item (inclusive),
|
|
85
|
+
// mirroring upstream ListKeyboardDelegate.getKeyForSearch (`key = fromKey ||
|
|
86
|
+
// getFirstKey()`): typing a prefix the focused item already matches keeps focus
|
|
87
|
+
// on it instead of advancing to the next match.
|
|
82
88
|
let startIndex = 0;
|
|
83
89
|
if (fromKey != null) {
|
|
84
90
|
const fromIndex = items.findIndex((item) => item.key === fromKey);
|
|
85
91
|
if (fromIndex !== -1) {
|
|
86
|
-
|
|
87
|
-
startIndex = (fromIndex + 1) % items.length;
|
|
92
|
+
startIndex = fromIndex;
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
// Scan from startIndex to the end (no wrap). The caller retries from the top to
|
|
97
|
+
// cover items before the focused one, matching upstream useTypeSelect.
|
|
98
|
+
for (let index = startIndex; index < items.length; index++) {
|
|
94
99
|
const item = items[index];
|
|
95
100
|
|
|
96
101
|
// Skip disabled items
|
|
@@ -98,9 +103,14 @@ function getKeyForSearch<T>(
|
|
|
98
103
|
continue;
|
|
99
104
|
}
|
|
100
105
|
|
|
101
|
-
//
|
|
106
|
+
// Match the leading characters of the text value against the search string
|
|
107
|
+
// using locale-aware collation, mirroring upstream ListKeyboardDelegate
|
|
108
|
+
// (`collator.compare(textValue.slice(0, search.length), search) === 0`). The
|
|
109
|
+
// collator's `usage: 'search'` / `sensitivity: 'base'` makes this case- and
|
|
110
|
+
// diacritic-insensitive in a locale-aware way.
|
|
102
111
|
const textValue = item.textValue || "";
|
|
103
|
-
|
|
112
|
+
const substring = textValue.slice(0, search.length);
|
|
113
|
+
if (textValue && collator.compare(substring, search) === 0) {
|
|
104
114
|
return item.key;
|
|
105
115
|
}
|
|
106
116
|
}
|
|
@@ -129,72 +139,123 @@ export function createTypeSelect<T>(options: TypeSelectOptions<T>): TypeSelectAr
|
|
|
129
139
|
timeout: undefined,
|
|
130
140
|
};
|
|
131
141
|
|
|
142
|
+
// Locale-aware search collator, mirroring upstream useSelectableList's
|
|
143
|
+
// `useCollator({ usage: 'search', sensitivity: 'base' })`.
|
|
144
|
+
const collator = createCollator({ usage: "search", sensitivity: "base" });
|
|
145
|
+
|
|
146
|
+
// Append the search buffer, find a matching key (from the focused item,
|
|
147
|
+
// falling back to the whole list), focus it, and (re)start the debounce timer.
|
|
148
|
+
// Shared by both phase handlers below, mirroring the duplicated body in
|
|
149
|
+
// upstream useTypeSelect.
|
|
150
|
+
const searchAndFocus = (): Key | null => {
|
|
151
|
+
const collection = options.collection();
|
|
152
|
+
const currentKey = options.focusedKey();
|
|
153
|
+
|
|
154
|
+
// Prioritize items at/after the focused item, then retry from the top to
|
|
155
|
+
// cover earlier ones (upstream's two getKeyForSearch calls).
|
|
156
|
+
let key = getKeyForSearch(
|
|
157
|
+
collection,
|
|
158
|
+
state.search,
|
|
159
|
+
currentKey,
|
|
160
|
+
collator(),
|
|
161
|
+
options.isKeyDisabled,
|
|
162
|
+
);
|
|
163
|
+
if (key == null) {
|
|
164
|
+
key = getKeyForSearch(collection, state.search, null, collator(), options.isKeyDisabled);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (key != null) {
|
|
168
|
+
options.onFocusedKeyChange(key);
|
|
169
|
+
options.onTypeSelect?.(key);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return key;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const restartDebounce = () => {
|
|
176
|
+
clearTimeout(state.timeout);
|
|
177
|
+
state.timeout = setTimeout(() => {
|
|
178
|
+
state.search = "";
|
|
179
|
+
}, TYPEAHEAD_DEBOUNCE_WAIT_MS);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// Capture phase: mid-search a Spacebar is part of the query, not a selection
|
|
183
|
+
// action, so we consume it before the collection's own keydown handler can act
|
|
184
|
+
// on it. Mirrors upstream useTypeSelect's onKeyDownCapture.
|
|
132
185
|
const onKeyDownCapture: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {
|
|
133
186
|
if (options.isDisabled) return;
|
|
134
187
|
|
|
188
|
+
if (state.search.length > 0 && e.key === " ") {
|
|
189
|
+
e.preventDefault();
|
|
190
|
+
// Upstream guards this with `!('continuePropagation' in e) ||
|
|
191
|
+
// !e.isPropagationStopped()`. Our raw DOM KeyboardEvents never carry
|
|
192
|
+
// `continuePropagation`, so the guard always holds — stop unconditionally.
|
|
193
|
+
e.stopPropagation();
|
|
194
|
+
state.search += " ";
|
|
195
|
+
searchAndFocus();
|
|
196
|
+
restartDebounce();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// Bubble phase: handles ordinary characters (and, in environments where the
|
|
201
|
+
// capture listener above is inert, mid-search Spacebar via its non-bailing
|
|
202
|
+
// branch). Mirrors upstream useTypeSelect's onKeyDown.
|
|
203
|
+
const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {
|
|
204
|
+
if (options.isDisabled) return;
|
|
205
|
+
|
|
135
206
|
const character = getStringForKey(e.key);
|
|
136
207
|
|
|
137
|
-
// Ignore non-printable
|
|
138
|
-
//
|
|
208
|
+
// Ignore non-printable keys, Ctrl/Meta/Alt combos (Alt is excluded to match
|
|
209
|
+
// upstream — AltGr-only layouts shouldn't drive type-select), events from
|
|
210
|
+
// outside the element, and a leading Space (a common action key).
|
|
139
211
|
if (
|
|
140
212
|
!character ||
|
|
141
213
|
e.ctrlKey ||
|
|
142
214
|
e.metaKey ||
|
|
143
215
|
e.altKey ||
|
|
144
|
-
!e.currentTarget.contains(e.target as HTMLElement)
|
|
216
|
+
!e.currentTarget.contains(e.target as HTMLElement) ||
|
|
217
|
+
(state.search.length === 0 && character === " ")
|
|
145
218
|
) {
|
|
146
219
|
return;
|
|
147
220
|
}
|
|
148
221
|
|
|
149
|
-
// Don't start search with space (common action key)
|
|
150
|
-
if (state.search.length === 0 && character === " ") {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// If there's already search text and the user types a space,
|
|
155
|
-
// prevent it from triggering selection and include it in the search
|
|
156
|
-
if (character === " " && state.search.trim().length > 0) {
|
|
157
|
-
e.preventDefault();
|
|
158
|
-
e.stopPropagation();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Append to the search buffer
|
|
162
222
|
state.search += character;
|
|
163
223
|
|
|
164
|
-
|
|
165
|
-
const collection = options.collection();
|
|
166
|
-
const currentKey = options.focusedKey();
|
|
167
|
-
|
|
168
|
-
// First, try to find a match starting after the current key
|
|
169
|
-
let key = getKeyForSearch(collection, state.search, currentKey, options.isKeyDisabled);
|
|
170
|
-
|
|
171
|
-
// If no match found, try from the beginning
|
|
172
|
-
if (key == null && currentKey != null) {
|
|
173
|
-
key = getKeyForSearch(collection, state.search, null, options.isKeyDisabled);
|
|
174
|
-
}
|
|
224
|
+
const key = searchAndFocus();
|
|
175
225
|
|
|
176
226
|
if (key != null) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
227
|
+
e.preventDefault();
|
|
228
|
+
// Our raw DOM events never carry `continuePropagation`, so upstream's
|
|
229
|
+
// `if (!('continuePropagation' in e)) e.stopPropagation()` is unconditional.
|
|
230
|
+
e.stopPropagation();
|
|
231
|
+
} else {
|
|
232
|
+
// Nothing matched even after retrying from the top: type-to-select is done,
|
|
233
|
+
// so reset the buffer and let the key propagate normally.
|
|
234
|
+
state.search = "";
|
|
183
235
|
clearTimeout(state.timeout);
|
|
236
|
+
state.timeout = undefined;
|
|
237
|
+
return;
|
|
184
238
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, TYPEAHEAD_DEBOUNCE_WAIT_MS);
|
|
239
|
+
|
|
240
|
+
restartDebounce();
|
|
188
241
|
};
|
|
189
242
|
|
|
190
|
-
//
|
|
191
|
-
|
|
243
|
+
// Mirror upstream's unmount cleanup (a useEffect teardown) so a pending
|
|
244
|
+
// debounce timer never fires after the consumer is disposed.
|
|
245
|
+
onCleanup(() => {
|
|
246
|
+
clearTimeout(state.timeout);
|
|
247
|
+
});
|
|
192
248
|
|
|
193
249
|
return {
|
|
194
250
|
typeSelectProps: {
|
|
195
|
-
//
|
|
251
|
+
// Upstream binds `onKeyDownCapture` so Spacebar is handled before the
|
|
252
|
+
// collection's own keydown handler. In Solid a capture handler delivered
|
|
253
|
+
// through a `{...typeSelectProps}` spread is inert (it never fires), so the
|
|
254
|
+
// bubble-phase `onKeyDown` is the live path — and it also covers mid-search
|
|
255
|
+
// Space because its bail check only rejects a *leading* Space. True capture
|
|
256
|
+
// would need a ref-based addEventListener threaded through every consumer;
|
|
257
|
+
// see the typeahead follow-up in upstream-sync.md.
|
|
196
258
|
onKeyDownCapture,
|
|
197
|
-
// Also attach to bubble phase for test environments
|
|
198
259
|
onKeyDown,
|
|
199
260
|
} as JSX.HTMLAttributes<HTMLElement>,
|
|
200
261
|
};
|
package/src/selection/index.ts
CHANGED
|
@@ -4,3 +4,34 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export { createTypeSelect, type TypeSelectOptions, type TypeSelectAria } from "./createTypeSelect";
|
|
7
|
+
export {
|
|
8
|
+
createScrollIntoViewOnFocus,
|
|
9
|
+
type ScrollIntoViewOnFocusOptions,
|
|
10
|
+
} from "./createScrollIntoViewOnFocus";
|
|
11
|
+
export { selectItem } from "./selectItem";
|
|
12
|
+
export {
|
|
13
|
+
createSelectableItem,
|
|
14
|
+
ITEM_ACTION_EVENT,
|
|
15
|
+
type CreateSelectableItemOptions,
|
|
16
|
+
type SelectableItemAria,
|
|
17
|
+
type LinkBehavior,
|
|
18
|
+
} from "./createSelectableItem";
|
|
19
|
+
export { isNonContiguousSelectionModifier, getItemElement } from "./utils";
|
|
20
|
+
export { FOCUS_EVENT, CLEAR_FOCUS_EVENT } from "./constants";
|
|
21
|
+
export {
|
|
22
|
+
ListKeyboardDelegate,
|
|
23
|
+
type ListKeyboardDelegateOptions,
|
|
24
|
+
type Orientation,
|
|
25
|
+
type Direction,
|
|
26
|
+
} from "./ListKeyboardDelegate";
|
|
27
|
+
export { DOMLayoutDelegate, type LayoutDelegate, type Rect, type Size } from "./DOMLayoutDelegate";
|
|
28
|
+
export {
|
|
29
|
+
createSelectableCollection,
|
|
30
|
+
type CreateSelectableCollectionOptions,
|
|
31
|
+
type SelectableCollectionAria,
|
|
32
|
+
} from "./createSelectableCollection";
|
|
33
|
+
export {
|
|
34
|
+
createSelectableList,
|
|
35
|
+
type CreateSelectableListOptions,
|
|
36
|
+
type SelectableListAria,
|
|
37
|
+
} from "./createSelectableList";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The aria-layer selection decision, mirroring `@react-aria/selection`'s
|
|
3
|
+
* `useSelectableItem` `onSelect`. This is where the platform-aware modifier
|
|
4
|
+
* resolution lives — react-stately's `SelectionManager.select` only knows
|
|
5
|
+
* `pointerType` + `selectionBehavior`; the ctrl/meta/shift decision belongs one
|
|
6
|
+
* layer up, here, where `isMac` is reachable.
|
|
7
|
+
*
|
|
8
|
+
* The link branch (`linkBehavior` 'selection'/'override'/'none') is deferred to
|
|
9
|
+
* `createSelectableItem` (Phase 1 of the press-path epic); callers here pass
|
|
10
|
+
* non-link items.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { Accessor } from "solid-js";
|
|
14
|
+
import type {
|
|
15
|
+
Collection,
|
|
16
|
+
Key,
|
|
17
|
+
SelectionBehavior,
|
|
18
|
+
SelectionMode,
|
|
19
|
+
SelectionPressEvent,
|
|
20
|
+
} from "@proyecto-viviana/solid-stately";
|
|
21
|
+
|
|
22
|
+
import { isCtrlKeyPressed } from "../utils/keyboard";
|
|
23
|
+
import { isNonContiguousSelectionModifier } from "./utils";
|
|
24
|
+
|
|
25
|
+
export interface SelectItemState {
|
|
26
|
+
readonly selectionMode: Accessor<SelectionMode>;
|
|
27
|
+
readonly selectionBehavior: Accessor<SelectionBehavior>;
|
|
28
|
+
readonly disallowEmptySelection: Accessor<boolean>;
|
|
29
|
+
isSelected(key: Key): boolean;
|
|
30
|
+
toggleSelection(key: Key): void;
|
|
31
|
+
replaceSelection(key: Key): void;
|
|
32
|
+
extendSelection(toKey: Key, collection: Collection): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Resolve a press/keyboard interaction into a selection mutation on `manager`,
|
|
37
|
+
* faithful to `useSelectableItem.onSelect`. `collection` is required for the
|
|
38
|
+
* shift-extend (contiguous range) path.
|
|
39
|
+
*/
|
|
40
|
+
export function selectItem(
|
|
41
|
+
manager: SelectItemState,
|
|
42
|
+
key: Key,
|
|
43
|
+
e: SelectionPressEvent,
|
|
44
|
+
collection: Collection,
|
|
45
|
+
): void {
|
|
46
|
+
// A keyboard non-contiguous modifier (Alt on Apple devices, Ctrl elsewhere)
|
|
47
|
+
// always toggles, independent of mode/behavior.
|
|
48
|
+
if (e.pointerType === "keyboard" && isNonContiguousSelectionModifier(e)) {
|
|
49
|
+
manager.toggleSelection(key);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (manager.selectionMode() === "none") {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (manager.selectionMode() === "single") {
|
|
58
|
+
// Single mode ignores selectionBehavior. Re-selecting the current item
|
|
59
|
+
// deselects it when empty selection is allowed; otherwise it stays
|
|
60
|
+
// selected (replace).
|
|
61
|
+
if (manager.isSelected(key) && !manager.disallowEmptySelection()) {
|
|
62
|
+
manager.toggleSelection(key);
|
|
63
|
+
} else {
|
|
64
|
+
manager.replaceSelection(key);
|
|
65
|
+
}
|
|
66
|
+
} else if (e.shiftKey) {
|
|
67
|
+
manager.extendSelection(key, collection);
|
|
68
|
+
} else if (
|
|
69
|
+
manager.selectionBehavior() === "toggle" ||
|
|
70
|
+
isCtrlKeyPressed(e) ||
|
|
71
|
+
e.pointerType === "touch" ||
|
|
72
|
+
e.pointerType === "virtual"
|
|
73
|
+
) {
|
|
74
|
+
// touch / virtual (VoiceOver) have no modifier keys, so multi-select is
|
|
75
|
+
// only reachable by toggling.
|
|
76
|
+
manager.toggleSelection(key);
|
|
77
|
+
} else {
|
|
78
|
+
manager.replaceSelection(key);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selection helpers shared across collection item hooks.
|
|
3
|
+
* Based on @react-aria/selection's utilities.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { Accessor } from "solid-js";
|
|
7
|
+
import type { Key } from "@proyecto-viviana/solid-stately";
|
|
8
|
+
import { isAppleDevice } from "../utils/platform";
|
|
9
|
+
import { createId } from "../ssr";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the DOM element rendered for a collection item by its key, scoped to
|
|
13
|
+
* the owning collection when a `data-collection` id is present. Mirrors
|
|
14
|
+
* `@react-aria/selection`'s `getItemElement`, adapted to take a Solid ref
|
|
15
|
+
* accessor instead of a React ref object.
|
|
16
|
+
*/
|
|
17
|
+
export function getItemElement(ref: Accessor<HTMLElement | null>, key: Key): HTMLElement | null {
|
|
18
|
+
const root = ref();
|
|
19
|
+
if (!root) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
let selector = `[data-key="${CSS.escape(String(key))}"]`;
|
|
23
|
+
const collectionId = root.dataset.collection;
|
|
24
|
+
if (collectionId) {
|
|
25
|
+
selector = `[data-collection="${CSS.escape(collectionId)}"]${selector}`;
|
|
26
|
+
}
|
|
27
|
+
return root.querySelector<HTMLElement>(selector);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* A stable, SSR-safe id for a collection, shared between the collection
|
|
32
|
+
* container and its items so {@link getItemElement} can scope a query by
|
|
33
|
+
* `data-collection` (needed to disambiguate nested collections).
|
|
34
|
+
*
|
|
35
|
+
* Divergence from upstream: React's `useCollectionId` keys this WeakMap by the
|
|
36
|
+
* collection object and relies on a render-stable `useId`. A Solid collection is
|
|
37
|
+
* rebuilt with a new identity whenever its items change, so we key by the
|
|
38
|
+
* SelectionManager instance instead — it is created once and never replaced, so
|
|
39
|
+
* the container and its items always resolve to the same entry — and generate
|
|
40
|
+
* the id with our SSR-safe `createId`.
|
|
41
|
+
*/
|
|
42
|
+
const collectionIdMap = new WeakMap<object, string>();
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Registers (on first call) and returns the collection id for a SelectionManager.
|
|
46
|
+
* The collection container calls this; its items read the same id via
|
|
47
|
+
* {@link getCollectionId}. Must be called within a reactive owner (uses createId).
|
|
48
|
+
*/
|
|
49
|
+
export function registerCollectionId(manager: object): string {
|
|
50
|
+
let id = collectionIdMap.get(manager);
|
|
51
|
+
if (id == null) {
|
|
52
|
+
id = createId();
|
|
53
|
+
collectionIdMap.set(manager, id);
|
|
54
|
+
}
|
|
55
|
+
return id;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the collection id registered for a SelectionManager, or `undefined`
|
|
60
|
+
* when its container has not registered one (e.g. an item not yet wired into a
|
|
61
|
+
* `createSelectableCollection`). A Solid `undefined` attribute is omitted, so an
|
|
62
|
+
* unregistered item simply renders no `data-collection`.
|
|
63
|
+
*/
|
|
64
|
+
export function getCollectionId(manager: object): string | undefined {
|
|
65
|
+
return collectionIdMap.get(manager);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The modifier-key fields consulted by {@link isNonContiguousSelectionModifier}. */
|
|
69
|
+
interface ModifierKeyEvent {
|
|
70
|
+
altKey?: boolean;
|
|
71
|
+
ctrlKey?: boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns whether the modifier for non-contiguous (toggle) keyboard selection
|
|
76
|
+
* is pressed. Mirrors `@react-aria/selection`'s `isNonContiguousSelectionModifier`:
|
|
77
|
+
* Ctrl + Arrow Up/Down has a system-wide meaning on macOS, so Apple devices use
|
|
78
|
+
* Alt instead; Windows and Ubuntu use Ctrl.
|
|
79
|
+
*/
|
|
80
|
+
export function isNonContiguousSelectionModifier(e: ModifierKeyEvent): boolean {
|
|
81
|
+
return isAppleDevice() ? e.altKey === true : e.ctrlKey === true;
|
|
82
|
+
}
|
|
@@ -11,6 +11,7 @@ import { filterDOMProps } from "../utils/filterDOMProps";
|
|
|
11
11
|
import { focusWithoutScrolling } from "../utils/focus";
|
|
12
12
|
import { mergeProps } from "../utils/mergeProps";
|
|
13
13
|
import { createId } from "../ssr";
|
|
14
|
+
import { useLocale } from "../i18n";
|
|
14
15
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
15
16
|
import type { SliderState, SliderOrientation } from "@proyecto-viviana/solid-stately";
|
|
16
17
|
|
|
@@ -61,6 +62,7 @@ export function createSlider(
|
|
|
61
62
|
): SliderAria {
|
|
62
63
|
const getProps = () => access(props);
|
|
63
64
|
const id = createId(getProps().id);
|
|
65
|
+
const locale = useLocale();
|
|
64
66
|
|
|
65
67
|
// Generate IDs for associated elements
|
|
66
68
|
const inputId = `${id}-input`;
|
|
@@ -158,6 +160,38 @@ export function createSlider(
|
|
|
158
160
|
if (state.isDisabled) return;
|
|
159
161
|
|
|
160
162
|
switch (e.key) {
|
|
163
|
+
case "ArrowRight":
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
if (state.orientation === "horizontal" && locale().direction === "rtl") {
|
|
166
|
+
state.decrement();
|
|
167
|
+
} else {
|
|
168
|
+
state.increment();
|
|
169
|
+
}
|
|
170
|
+
break;
|
|
171
|
+
case "ArrowLeft":
|
|
172
|
+
e.preventDefault();
|
|
173
|
+
if (state.orientation === "horizontal" && locale().direction === "rtl") {
|
|
174
|
+
state.increment();
|
|
175
|
+
} else {
|
|
176
|
+
state.decrement();
|
|
177
|
+
}
|
|
178
|
+
break;
|
|
179
|
+
case "ArrowUp":
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
if (state.orientation === "vertical") {
|
|
182
|
+
state.increment();
|
|
183
|
+
} else {
|
|
184
|
+
state.decrement();
|
|
185
|
+
}
|
|
186
|
+
break;
|
|
187
|
+
case "ArrowDown":
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
if (state.orientation === "vertical") {
|
|
190
|
+
state.decrement();
|
|
191
|
+
} else {
|
|
192
|
+
state.increment();
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
161
195
|
case "PageUp":
|
|
162
196
|
e.preventDefault();
|
|
163
197
|
state.increment(state.pageStep / state.step);
|
|
@@ -277,8 +311,20 @@ export function createSlider(
|
|
|
277
311
|
const isVertical = state.orientation === "vertical";
|
|
278
312
|
|
|
279
313
|
return {
|
|
314
|
+
role: "slider",
|
|
315
|
+
"aria-valuemin": state.minValue,
|
|
316
|
+
"aria-valuemax": state.maxValue,
|
|
317
|
+
"aria-valuenow": state.value(),
|
|
318
|
+
"aria-valuetext": state.getFormattedValue(),
|
|
319
|
+
"aria-orientation": state.orientation,
|
|
320
|
+
"aria-disabled": state.isDisabled || undefined,
|
|
321
|
+
"aria-labelledby": labelledBy(),
|
|
322
|
+
"aria-label": labelledBy() ? undefined : ariaLabel(),
|
|
323
|
+
tabIndex: state.isDisabled ? undefined : 0,
|
|
280
324
|
onPointerDown: onThumbPointerDown,
|
|
281
325
|
onKeyDown: onThumbKeyDown,
|
|
326
|
+
onFocus,
|
|
327
|
+
onBlur,
|
|
282
328
|
style: {
|
|
283
329
|
position: "absolute",
|
|
284
330
|
[isVertical ? "bottom" : "left"]: `${percent * 100}%`,
|
|
@@ -297,6 +343,7 @@ export function createSlider(
|
|
|
297
343
|
{
|
|
298
344
|
type: "range",
|
|
299
345
|
id: inputId,
|
|
346
|
+
"aria-hidden": true,
|
|
300
347
|
min: state.minValue,
|
|
301
348
|
max: state.maxValue,
|
|
302
349
|
step: state.step,
|
|
@@ -308,7 +355,7 @@ export function createSlider(
|
|
|
308
355
|
"aria-valuetext": state.getFormattedValue(),
|
|
309
356
|
"aria-labelledby": labelledBy(),
|
|
310
357
|
"aria-label": labelledBy() ? undefined : ariaLabel(),
|
|
311
|
-
tabIndex:
|
|
358
|
+
tabIndex: -1,
|
|
312
359
|
onInput: (e: Event) => {
|
|
313
360
|
const target = e.target as HTMLInputElement;
|
|
314
361
|
state.setValue(parseFloat(target.value));
|
package/src/ssr/index.tsx
CHANGED
|
@@ -80,6 +80,37 @@ export function createId(defaultId?: string): string {
|
|
|
80
80
|
return ctx.prefix ? `solidaria-${ctx.prefix}-${uniqueId}` : `solidaria-${uniqueId}`;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/**
|
|
84
|
+
* Generates an id, but only resolves to it once an element with that id is
|
|
85
|
+
* actually present in the DOM. Returns `undefined` otherwise.
|
|
86
|
+
*
|
|
87
|
+
* This is a 1:1 port of @react-aria/utils's `useSlotId`. It exists so that an
|
|
88
|
+
* `aria-labelledby` can point at an optional slot (e.g. a section header) and
|
|
89
|
+
* automatically fall back to `undefined` when the slot is not rendered, instead
|
|
90
|
+
* of leaving a dangling reference to a non-existent id.
|
|
91
|
+
*
|
|
92
|
+
* The initial value is the generated id so that server and first client render
|
|
93
|
+
* agree (no hydration mismatch); a client-only effect then probes the DOM and
|
|
94
|
+
* clears the value when no matching element exists.
|
|
95
|
+
*
|
|
96
|
+
* @param deps - Accessors re-probed when their values change (mirrors the
|
|
97
|
+
* dependency array of the upstream hook).
|
|
98
|
+
*/
|
|
99
|
+
export function createSlotId(deps: Array<Accessor<unknown>> = []): Accessor<string | undefined> {
|
|
100
|
+
const id = createId();
|
|
101
|
+
const [resolvedId, setResolvedId] = createSignal<string | undefined>(id);
|
|
102
|
+
|
|
103
|
+
createEffect(() => {
|
|
104
|
+
// Re-probe when any explicit dependency changes.
|
|
105
|
+
for (const dep of deps) {
|
|
106
|
+
dep();
|
|
107
|
+
}
|
|
108
|
+
setResolvedId(document.getElementById(id) ? id : undefined);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
return resolvedId;
|
|
112
|
+
}
|
|
113
|
+
|
|
83
114
|
/**
|
|
84
115
|
* Provides SSR context to the component tree.
|
|
85
116
|
*
|
|
@@ -21,6 +21,10 @@ export interface SwitchAria {
|
|
|
21
21
|
labelProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;
|
|
22
22
|
/** Props for the input element. */
|
|
23
23
|
inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
24
|
+
/** Props for the switch description element, if any. */
|
|
25
|
+
descriptionProps: JSX.HTMLAttributes<HTMLElement>;
|
|
26
|
+
/** Props for the switch error message element, if any. */
|
|
27
|
+
errorMessageProps: JSX.HTMLAttributes<HTMLElement>;
|
|
24
28
|
/** Whether the switch is selected. */
|
|
25
29
|
isSelected: Accessor<boolean>;
|
|
26
30
|
/** Whether the switch is in a pressed state. */
|
|
@@ -56,6 +60,12 @@ export function createSwitch(
|
|
|
56
60
|
checked: toggle.isSelected(),
|
|
57
61
|
};
|
|
58
62
|
},
|
|
63
|
+
get descriptionProps() {
|
|
64
|
+
return toggle.descriptionProps;
|
|
65
|
+
},
|
|
66
|
+
get errorMessageProps() {
|
|
67
|
+
return toggle.errorMessageProps;
|
|
68
|
+
},
|
|
59
69
|
isSelected: toggle.isSelected,
|
|
60
70
|
isPressed: toggle.isPressed,
|
|
61
71
|
isDisabled: toggle.isDisabled,
|