@proyecto-viviana/solidaria 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +141 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +141 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/announce.js +207 -0
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/announce.jsx +207 -0
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +244 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +244 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +121 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +121 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +275 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +275 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1037 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1037 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +235 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +235 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1458 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1458 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +1062 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +1062 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +61 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +61 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +55 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +55 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +105 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +105 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +120 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +120 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormReset.js +39 -0
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/createFormReset.jsx +39 -0
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +131 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +131 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +268 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +268 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +47 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +47 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +32 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +32 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +82 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +82 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +302 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +302 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +159 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +159 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1706 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1706 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +2395 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +2395 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +87 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +87 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +631 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +631 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +369 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +369 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +199 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +199 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +331 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +325 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +97 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +97 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +356 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +356 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +519 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +519 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +259 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +259 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +320 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +320 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +210 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +210 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +406 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +397 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +666 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +666 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +256 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +256 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1088 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1088 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +263 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +263 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +322 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +322 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +110 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +110 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +226 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +226 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +452 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +452 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +705 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +705 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +93 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +93 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -0
- package/dist/dnd/index.jsx +3 -0
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +7 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -0
- package/dist/focus/index.jsx +3 -0
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.jsx +5 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -18311
- package/dist/index.jsx +77 -18242
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +9 -0
- package/dist/interactions/index.jsx +9 -0
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +7 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +5 -0
- package/dist/selection/index.jsx +5 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +35 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +5 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +49 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.jsx +6 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +202 -35
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +5 -4
- package/src/calendar/createCalendarCell.ts +36 -5
- package/src/calendar/createCalendarGrid.ts +47 -12
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +27 -15
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/index.ts +17 -0
- package/src/calendar/intl/index.ts +8 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -384
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +488 -371
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +63 -3
- package/src/focus/FocusScope.tsx +266 -24
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +187 -48
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +51 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +26 -15
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +203 -10
- package/src/listbox/createOption.ts +84 -74
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +41 -4
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +512 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +82 -27
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +208 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +37 -1
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +95 -24
- package/src/tag/createTag.ts +30 -36
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -94
- package/src/tree/createTree.ts +165 -52
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +243 -0
- package/src/utils/dom.ts +216 -25
- package/src/utils/index.ts +10 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Based on @react-aria/gridlist/useGridList.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createMemo, type Accessor } from "solid-js";
|
|
6
|
+
import { createMemo, createEffect, type Accessor } from "solid-js";
|
|
7
7
|
import type { JSX } from "solid-js";
|
|
8
8
|
import { createId } from "@proyecto-viviana/solid-stately";
|
|
9
9
|
import type { GridState, GridCollection, Key } from "@proyecto-viviana/solid-stately";
|
|
10
10
|
import type { AriaGridListProps, GridListAria } from "./types";
|
|
11
|
+
import { scrollIntoViewport } from "../utils";
|
|
12
|
+
import { getInteractionModality } from "../interactions/createInteractionModality";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Metadata stored for a grid list instance.
|
|
@@ -17,6 +19,12 @@ interface GridListData {
|
|
|
17
19
|
gridListId: string;
|
|
18
20
|
/** How selection should behave when pressing an item. */
|
|
19
21
|
selectionBehavior: "replace" | "toggle";
|
|
22
|
+
/** Whether row selection should occur on press up. */
|
|
23
|
+
shouldSelectOnPressUp: boolean;
|
|
24
|
+
/** How keyboard navigation behaves within row children. */
|
|
25
|
+
keyboardNavigationBehavior: "arrow" | "tab";
|
|
26
|
+
/** Text direction for row-child arrow navigation. */
|
|
27
|
+
direction: "ltr" | "rtl";
|
|
20
28
|
/** Actions registered for the grid list. */
|
|
21
29
|
actions: {
|
|
22
30
|
onAction?: (key: Key) => void;
|
|
@@ -37,13 +45,45 @@ export function getGridListData<T extends object, C extends GridCollection<T>>(
|
|
|
37
45
|
return gridListDataMap.get(state);
|
|
38
46
|
}
|
|
39
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Whether a key should be skipped during keyboard navigation. Disabled keys only
|
|
50
|
+
* block navigation under `disabledBehavior: "all"` (the default); under
|
|
51
|
+
* `"selection"` they remain focusable (selection is still blocked elsewhere).
|
|
52
|
+
* Mirrors `ListKeyboardDelegate.isDisabled` in React Aria.
|
|
53
|
+
*/
|
|
54
|
+
function isNavigationDisabled<T extends object, C extends GridCollection<T>>(
|
|
55
|
+
state: GridState<T, C>,
|
|
56
|
+
key: Key,
|
|
57
|
+
): boolean {
|
|
58
|
+
return state.isDisabled(key) && state.disabledBehavior === "all";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Walks from `startKey` via `step` until reaching a navigable (not
|
|
63
|
+
* navigation-disabled) key, mirroring React Aria's
|
|
64
|
+
* `ListKeyboardDelegate.findNextNonDisabled`. The next/previous lookups and the
|
|
65
|
+
* `getFirstKey`/`getLastKey` boundaries all funnel through this so arrow keys,
|
|
66
|
+
* Home and End land on enabled rows only.
|
|
67
|
+
*/
|
|
68
|
+
function findNextNavigableKey<T extends object, C extends GridCollection<T>>(
|
|
69
|
+
state: GridState<T, C>,
|
|
70
|
+
startKey: Key | null,
|
|
71
|
+
step: (key: Key) => Key | null,
|
|
72
|
+
): Key | null {
|
|
73
|
+
let key = startKey;
|
|
74
|
+
while (key != null && isNavigationDisabled(state, key)) {
|
|
75
|
+
key = step(key);
|
|
76
|
+
}
|
|
77
|
+
return key;
|
|
78
|
+
}
|
|
79
|
+
|
|
40
80
|
/**
|
|
41
81
|
* Creates accessibility props for a grid list.
|
|
42
82
|
*/
|
|
43
83
|
export function createGridList<T extends object, C extends GridCollection<T> = GridCollection<T>>(
|
|
44
84
|
props: Accessor<AriaGridListProps>,
|
|
45
85
|
state: Accessor<GridState<T, C>>,
|
|
46
|
-
|
|
86
|
+
ref: Accessor<HTMLElement | null>,
|
|
47
87
|
): GridListAria {
|
|
48
88
|
// Generate a unique ID for the grid list
|
|
49
89
|
const gridListId = props().id ?? createId();
|
|
@@ -54,6 +94,15 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
54
94
|
get selectionBehavior() {
|
|
55
95
|
return props().selectionBehavior ?? "replace";
|
|
56
96
|
},
|
|
97
|
+
get shouldSelectOnPressUp() {
|
|
98
|
+
return props().shouldSelectOnPressUp ?? false;
|
|
99
|
+
},
|
|
100
|
+
get keyboardNavigationBehavior() {
|
|
101
|
+
return props().keyboardNavigationBehavior ?? "arrow";
|
|
102
|
+
},
|
|
103
|
+
get direction() {
|
|
104
|
+
return props().direction ?? "ltr";
|
|
105
|
+
},
|
|
57
106
|
actions: {
|
|
58
107
|
get onAction() {
|
|
59
108
|
return props().onAction;
|
|
@@ -76,37 +125,67 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
76
125
|
switch (e.key) {
|
|
77
126
|
case "ArrowDown": {
|
|
78
127
|
e.preventDefault();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
s.setFocusedKey(firstKey);
|
|
88
|
-
}
|
|
128
|
+
const nextKey =
|
|
129
|
+
focusedKey != null
|
|
130
|
+
? findNextNavigableKey(s, collection.getKeyAfter(focusedKey), (k) =>
|
|
131
|
+
collection.getKeyAfter(k),
|
|
132
|
+
)
|
|
133
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
134
|
+
if (nextKey != null) {
|
|
135
|
+
s.setFocusedKey(nextKey);
|
|
89
136
|
}
|
|
90
137
|
break;
|
|
91
138
|
}
|
|
92
139
|
case "ArrowUp": {
|
|
93
140
|
e.preventDefault();
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
141
|
+
const prevKey =
|
|
142
|
+
focusedKey != null
|
|
143
|
+
? findNextNavigableKey(s, collection.getKeyBefore(focusedKey), (k) =>
|
|
144
|
+
collection.getKeyBefore(k),
|
|
145
|
+
)
|
|
146
|
+
: findNextNavigableKey(s, collection.getLastKey(), (k) => collection.getKeyBefore(k));
|
|
147
|
+
if (prevKey != null) {
|
|
148
|
+
s.setFocusedKey(prevKey);
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
case "ArrowRight":
|
|
153
|
+
case "ArrowLeft": {
|
|
154
|
+
// The inline axis (Left/Right) belongs to the ROW under the default
|
|
155
|
+
// "arrow" navigation behavior: createGridListItem's onKeyDownCapture
|
|
156
|
+
// intercepts Left/Right for intra-row focus movement (a no-op for
|
|
157
|
+
// text-only rows), exactly as useGridListItem does upstream, so the
|
|
158
|
+
// container must NOT step between rows here. Only under "tab" navigation
|
|
159
|
+
// does the row stop intercepting and the event reach the collection —
|
|
160
|
+
// mirroring how useSelectableCollection handles Left/Right via
|
|
161
|
+
// ListKeyboardDelegate. Even then it strips getKeyLeftOf/getKeyRightOf
|
|
162
|
+
// for a vertical stack, so this stays a no-op unless the stack is
|
|
163
|
+
// horizontal, where Right=next / Left=prev in LTR, flipped under RTL.
|
|
164
|
+
// (In Solid the row's capture-phase stopPropagation does not reliably
|
|
165
|
+
// prevent the container's delegated onKeyDown, so this gate — not the
|
|
166
|
+
// row's stopPropagation — is what keeps the axes from double-firing.)
|
|
167
|
+
const behavior = p.keyboardNavigationBehavior ?? "arrow";
|
|
168
|
+
if (p.orientation !== "horizontal" || behavior !== "tab") break;
|
|
169
|
+
e.preventDefault();
|
|
170
|
+
const isRtl = p.direction === "rtl";
|
|
171
|
+
const forward = e.key === "ArrowRight" ? !isRtl : isRtl;
|
|
172
|
+
const step = forward
|
|
173
|
+
? (k: Key) => collection.getKeyAfter(k)
|
|
174
|
+
: (k: Key) => collection.getKeyBefore(k);
|
|
175
|
+
const nextKey =
|
|
176
|
+
focusedKey != null
|
|
177
|
+
? findNextNavigableKey(s, step(focusedKey), step)
|
|
178
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
179
|
+
if (nextKey != null) {
|
|
180
|
+
s.setFocusedKey(nextKey);
|
|
104
181
|
}
|
|
105
182
|
break;
|
|
106
183
|
}
|
|
107
184
|
case "Home": {
|
|
108
185
|
e.preventDefault();
|
|
109
|
-
const firstKey = collection.getFirstKey()
|
|
186
|
+
const firstKey = findNextNavigableKey(s, collection.getFirstKey(), (k) =>
|
|
187
|
+
collection.getKeyAfter(k),
|
|
188
|
+
);
|
|
110
189
|
if (firstKey != null) {
|
|
111
190
|
s.setFocusedKey(firstKey);
|
|
112
191
|
}
|
|
@@ -114,7 +193,9 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
114
193
|
}
|
|
115
194
|
case "End": {
|
|
116
195
|
e.preventDefault();
|
|
117
|
-
const lastKey = collection.getLastKey()
|
|
196
|
+
const lastKey = findNextNavigableKey(s, collection.getLastKey(), (k) =>
|
|
197
|
+
collection.getKeyBefore(k),
|
|
198
|
+
);
|
|
118
199
|
if (lastKey != null) {
|
|
119
200
|
s.setFocusedKey(lastKey);
|
|
120
201
|
}
|
|
@@ -128,22 +209,13 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
128
209
|
}
|
|
129
210
|
break;
|
|
130
211
|
}
|
|
131
|
-
|
|
132
|
-
case
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
case "Enter": {
|
|
141
|
-
if (focusedKey != null && !s.isDisabled(focusedKey)) {
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
p.onAction?.(focusedKey);
|
|
144
|
-
}
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
212
|
+
// Space (toggle selection) and Enter (onAction) are intentionally absent
|
|
213
|
+
// here. Upstream's useSelectableCollection has no Space/Enter case — the
|
|
214
|
+
// focused item owns both, via useSelectableItem. We follow browser focus
|
|
215
|
+
// onto the focused row (the effect below), so the row's own handlers in
|
|
216
|
+
// createGridListItem fire. Handling them here too would double-toggle a
|
|
217
|
+
// focused row, because Solid delegates keydown and bubbles the row event
|
|
218
|
+
// up to this grid handler.
|
|
147
219
|
case "Escape": {
|
|
148
220
|
if (s.selectionMode !== "none") {
|
|
149
221
|
e.preventDefault();
|
|
@@ -154,16 +226,41 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
154
226
|
}
|
|
155
227
|
};
|
|
156
228
|
|
|
157
|
-
|
|
229
|
+
// Focus marshalling — the grid container is a trampoline. Its roving tabIndex
|
|
230
|
+
// is 0 only while `focusedKey == null` (see gridProps below), so a Tab that
|
|
231
|
+
// reaches a standalone grid lands on the container itself; move the focused key
|
|
232
|
+
// onto the first/last row and the post-commit effect below pulls REAL DOM focus
|
|
233
|
+
// there while the container rolls to tabIndex -1. This mirrors
|
|
234
|
+
// useSelectableCollection's `onFocus` — the same direction-aware trampoline the
|
|
235
|
+
// standalone ListBox uses (createListBox.ts) — and is why a standalone grid
|
|
236
|
+
// announces the active row through real focus, never `aria-activedescendant`.
|
|
237
|
+
const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {
|
|
158
238
|
const s = state();
|
|
239
|
+
const p = props();
|
|
159
240
|
s.setFocused(true);
|
|
160
241
|
|
|
161
|
-
//
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
242
|
+
// onFocus is non-bubbling in Solid, so this fires only when the container
|
|
243
|
+
// itself receives focus; ignore anything that bubbled from a descendant.
|
|
244
|
+
// (`currentTarget` is null only in synthetic unit-test FocusEvents — treat
|
|
245
|
+
// those as a direct container focus.)
|
|
246
|
+
const container = e.currentTarget as HTMLElement | null;
|
|
247
|
+
if (container && !container.contains(e.target as Node)) return;
|
|
248
|
+
// Only marshal when no row is focused yet.
|
|
249
|
+
if (s.focusedKey != null || p.isDisabled) return;
|
|
250
|
+
|
|
251
|
+
const collection = s.collection;
|
|
252
|
+
const relatedTarget = e.relatedTarget as Element | null;
|
|
253
|
+
// Detect tab direction: focus arriving from an element that FOLLOWS the grid
|
|
254
|
+
// in document order means the user shift-tabbed backward into it, so enter at
|
|
255
|
+
// the LAST row; otherwise (forward Tab, or programmatic) enter at the FIRST.
|
|
256
|
+
const enterKey =
|
|
257
|
+
relatedTarget &&
|
|
258
|
+
container &&
|
|
259
|
+
container.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING
|
|
260
|
+
? findNextNavigableKey(s, collection.getLastKey(), (k) => collection.getKeyBefore(k))
|
|
261
|
+
: findNextNavigableKey(s, collection.getFirstKey(), (k) => collection.getKeyAfter(k));
|
|
262
|
+
if (enterKey != null) {
|
|
263
|
+
s.setFocusedKey(enterKey);
|
|
167
264
|
}
|
|
168
265
|
};
|
|
169
266
|
|
|
@@ -172,6 +269,44 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
172
269
|
s.setFocused(false);
|
|
173
270
|
};
|
|
174
271
|
|
|
272
|
+
// Mirror React Aria's useSelectableCollection: once the roving tabindex for the
|
|
273
|
+
// focused key has been committed to the DOM, move browser focus onto that row
|
|
274
|
+
// from a post-commit effect, looking it up by its stable data-key rather than by
|
|
275
|
+
// transient tabindex. Selection and activation live on the row
|
|
276
|
+
// (createGridListItem) to match upstream, so keyboard nav has to carry focus
|
|
277
|
+
// there for the row's Space/Enter handlers to act on.
|
|
278
|
+
createEffect(() => {
|
|
279
|
+
const s = state();
|
|
280
|
+
const key = s.focusedKey;
|
|
281
|
+
const el = ref();
|
|
282
|
+
if (!el || key == null) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Only manage focus while it already lives inside the grid — i.e. the user is
|
|
287
|
+
// navigating with the keyboard. Gate on the physical position of browser focus
|
|
288
|
+
// rather than the grid's logical isFocused signal: focus can land directly on a
|
|
289
|
+
// row (a pointer click) without ever firing the grid's own focus handler, and
|
|
290
|
+
// the contains() check keeps us from yanking focus back from elsewhere on the
|
|
291
|
+
// page when the focused key changes from a background interaction.
|
|
292
|
+
const active = document.activeElement;
|
|
293
|
+
if (!active || (active !== el && !el.contains(active))) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const target = el.querySelector<HTMLElement>(`[data-key="${key}"]`);
|
|
298
|
+
if (target && target !== active) {
|
|
299
|
+
target.focus();
|
|
300
|
+
|
|
301
|
+
// Reveal the newly focused row when navigating with the keyboard, mirroring
|
|
302
|
+
// useSelectableCollection. Pointer-driven focus changes should not shift the
|
|
303
|
+
// scroll position under the user's finger.
|
|
304
|
+
if (getInteractionModality() !== "pointer") {
|
|
305
|
+
scrollIntoViewport(target, { containingElement: el });
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
|
|
175
310
|
const gridProps = createMemo(() => {
|
|
176
311
|
const p = props();
|
|
177
312
|
const s = state();
|
|
@@ -184,7 +319,11 @@ export function createGridList<T extends object, C extends GridCollection<T> = G
|
|
|
184
319
|
"aria-describedby": p["aria-describedby"],
|
|
185
320
|
"aria-multiselectable": s.selectionMode === "multiple" ? true : undefined,
|
|
186
321
|
"aria-disabled": p.isDisabled || undefined,
|
|
187
|
-
|
|
322
|
+
// Roving container tabIndex mirrors useSelectableCollection: the container
|
|
323
|
+
// is tabbable (0) only while nothing is focused, then rolls to -1 once a row
|
|
324
|
+
// takes focus so Tab exits the grid. A standalone grid drives AT through
|
|
325
|
+
// real row focus, so it never needs (nor emits) aria-activedescendant.
|
|
326
|
+
tabIndex: p.isDisabled ? undefined : s.focusedKey != null ? -1 : 0,
|
|
188
327
|
onKeyDown,
|
|
189
328
|
onFocus,
|
|
190
329
|
onBlur,
|
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
* Based on @react-aria/gridlist/useGridListItem.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { createMemo,
|
|
6
|
+
import { createMemo, type Accessor } from "solid-js";
|
|
7
7
|
import type { JSX } from "solid-js";
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
Collection,
|
|
10
|
+
GridState,
|
|
11
|
+
GridCollection,
|
|
12
|
+
Key,
|
|
13
|
+
Selection,
|
|
14
|
+
} from "@proyecto-viviana/solid-stately";
|
|
9
15
|
import type { AriaGridListItemProps, GridListItemAria } from "./types";
|
|
10
16
|
import { getGridListData } from "./createGridList";
|
|
17
|
+
import { createSelectableItem, type SelectableItemState } from "../selection/createSelectableItem";
|
|
18
|
+
import { mergeCollectionRowInteractionProps } from "../selection/createCollectionRowInteraction";
|
|
19
|
+
import { mergeProps } from "../utils/mergeProps";
|
|
11
20
|
|
|
12
21
|
/**
|
|
13
22
|
* Creates accessibility props for a grid list item.
|
|
@@ -18,159 +27,80 @@ export function createGridListItem<
|
|
|
18
27
|
>(
|
|
19
28
|
props: Accessor<AriaGridListItemProps>,
|
|
20
29
|
state: Accessor<GridState<T, C>>,
|
|
21
|
-
|
|
30
|
+
ref: Accessor<HTMLElement | null>,
|
|
22
31
|
): GridListItemAria {
|
|
23
|
-
const [isPressed, setIsPressed] = createSignal(false);
|
|
24
|
-
let isPointerPressed = false;
|
|
25
|
-
let ignoreNextClick = false;
|
|
26
|
-
|
|
27
32
|
const isSelected = createMemo(() => {
|
|
28
33
|
const s = state();
|
|
29
34
|
const p = props();
|
|
30
35
|
return s.isSelected(p.node.key);
|
|
31
36
|
});
|
|
32
37
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} else {
|
|
74
|
-
s.replaceSelection(p.node.key);
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
s.replaceSelection(p.node.key);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
} else {
|
|
81
|
-
// No selection mode, just trigger action
|
|
82
|
-
if (onAction) {
|
|
83
|
-
onAction(p.node.key);
|
|
84
|
-
}
|
|
85
|
-
if (p.onAction) {
|
|
86
|
-
p.onAction();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
// Handle click/press for selection and actions.
|
|
92
|
-
const onClick = (e: MouseEvent) => {
|
|
93
|
-
if (ignoreNextClick) {
|
|
94
|
-
ignoreNextClick = false;
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
handleActivation(e);
|
|
38
|
+
const selectableState: SelectableItemState<T> = {
|
|
39
|
+
collection: () => state().collection as unknown as Collection<T>,
|
|
40
|
+
isFocused: () => state().isFocused,
|
|
41
|
+
setFocused: (focused: boolean) => state().setFocused(focused),
|
|
42
|
+
focusedKey: () => state().focusedKey,
|
|
43
|
+
childFocusStrategy: () => state().childFocusStrategy,
|
|
44
|
+
setFocusedKey: (key: Key | null, strategy) => state().setFocusedKey(key, strategy),
|
|
45
|
+
selectionMode: () => state().selectionMode,
|
|
46
|
+
selectionBehavior: () => props().selectionBehavior ?? state().selectionBehavior,
|
|
47
|
+
disallowEmptySelection: () => state().disallowEmptySelection,
|
|
48
|
+
selectedKeys: () => state().selectedKeys as Selection,
|
|
49
|
+
disabledKeys: () => state().disabledKeys,
|
|
50
|
+
disabledBehavior: () => state().disabledBehavior,
|
|
51
|
+
isEmpty: () => {
|
|
52
|
+
const keys = state().selectedKeys;
|
|
53
|
+
return keys !== "all" && keys.size === 0;
|
|
54
|
+
},
|
|
55
|
+
isSelectAll: () => state().selectedKeys === "all",
|
|
56
|
+
isSelected: (key: Key) => state().isSelected(key),
|
|
57
|
+
isDisabled: (key: Key) => {
|
|
58
|
+
const s = state();
|
|
59
|
+
const item = s.collection.getItem(key);
|
|
60
|
+
return (
|
|
61
|
+
s.disabledBehavior === "all" &&
|
|
62
|
+
s.isDisabled(key) &&
|
|
63
|
+
item?.props?.disabledBehavior !== "selection"
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
canSelectItem: (key: Key) => {
|
|
67
|
+
const s = state();
|
|
68
|
+
return s.selectionMode !== "none" && !s.isDisabled(key);
|
|
69
|
+
},
|
|
70
|
+
setSelectionBehavior: (behavior) => state().setSelectionBehavior(behavior),
|
|
71
|
+
toggleSelection: (key: Key) => state().toggleSelection(key),
|
|
72
|
+
replaceSelection: (key: Key) => state().replaceSelection(key),
|
|
73
|
+
setSelectedKeys: (keys: Iterable<Key>) => state().setSelectedKeys(keys),
|
|
74
|
+
selectAll: () => state().selectAll(),
|
|
75
|
+
clearSelection: () => state().clearSelection(),
|
|
76
|
+
toggleSelectAll: () => state().toggleSelectAll(),
|
|
77
|
+
extendSelection: (toKey: Key, _collection: Collection<T>) => state().extendSelection(toKey),
|
|
99
78
|
};
|
|
100
79
|
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (isDisabled()) return;
|
|
106
|
-
|
|
107
|
-
if (e.key === "Enter") {
|
|
108
|
-
// Get grid list metadata for actions
|
|
80
|
+
const selectableItem = createSelectableItem<T>(
|
|
81
|
+
() => {
|
|
82
|
+
const s = state();
|
|
83
|
+
const p = props();
|
|
109
84
|
const gridListData = getGridListData(s);
|
|
110
85
|
const onAction = gridListData?.actions.onAction;
|
|
111
86
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const onFocus = () => {
|
|
133
|
-
const s = state();
|
|
134
|
-
const p = props();
|
|
135
|
-
s.setFocusedKey(p.node.key);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const onPointerDown = () => {
|
|
139
|
-
if (isDisabled()) return;
|
|
140
|
-
isPointerPressed = true;
|
|
141
|
-
setIsPressed(true);
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const onPointerUp = (e: PointerEvent) => {
|
|
145
|
-
const wasPointerPressed = isPointerPressed;
|
|
146
|
-
isPointerPressed = false;
|
|
147
|
-
setIsPressed(false);
|
|
148
|
-
|
|
149
|
-
if (!wasPointerPressed || isDisabled()) return;
|
|
150
|
-
|
|
151
|
-
const currentTarget = e.currentTarget;
|
|
152
|
-
const target = e.target;
|
|
153
|
-
if (
|
|
154
|
-
currentTarget instanceof HTMLElement &&
|
|
155
|
-
target instanceof Node &&
|
|
156
|
-
!currentTarget.contains(target)
|
|
157
|
-
) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
ignoreNextClick = true;
|
|
162
|
-
handleActivation(e);
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const onPointerCancel = () => {
|
|
166
|
-
isPointerPressed = false;
|
|
167
|
-
setIsPressed(false);
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
const onPointerLeave = () => {
|
|
171
|
-
isPointerPressed = false;
|
|
172
|
-
setIsPressed(false);
|
|
173
|
-
};
|
|
87
|
+
return {
|
|
88
|
+
key: p.node.key,
|
|
89
|
+
id: `${gridListData?.gridListId ?? "gridlist"}-row-${String(p.node.key)}`,
|
|
90
|
+
isVirtualized: p.isVirtualized,
|
|
91
|
+
shouldSelectOnPressUp: gridListData?.shouldSelectOnPressUp ?? false,
|
|
92
|
+
onAction:
|
|
93
|
+
onAction || p.onAction
|
|
94
|
+
? () => {
|
|
95
|
+
p.onAction?.();
|
|
96
|
+
onAction?.(p.node.key);
|
|
97
|
+
}
|
|
98
|
+
: undefined,
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
selectableState,
|
|
102
|
+
ref,
|
|
103
|
+
);
|
|
174
104
|
|
|
175
105
|
const rowProps = createMemo(() => {
|
|
176
106
|
const s = state();
|
|
@@ -180,15 +110,7 @@ export function createGridListItem<
|
|
|
180
110
|
const baseProps: Record<string, unknown> = {
|
|
181
111
|
role: "row",
|
|
182
112
|
"aria-selected": s.selectionMode !== "none" ? isSelected() : undefined,
|
|
183
|
-
"aria-disabled": isDisabled() || undefined,
|
|
184
|
-
tabIndex: isFocused() ? 0 : -1,
|
|
185
|
-
onClick,
|
|
186
|
-
onKeyDown,
|
|
187
|
-
onFocus,
|
|
188
|
-
onPointerDown,
|
|
189
|
-
onPointerUp,
|
|
190
|
-
onPointerCancel,
|
|
191
|
-
onPointerLeave,
|
|
113
|
+
"aria-disabled": selectableItem.isDisabled() || undefined,
|
|
192
114
|
};
|
|
193
115
|
|
|
194
116
|
// Add aria-rowindex for virtualized lists
|
|
@@ -196,7 +118,17 @@ export function createGridListItem<
|
|
|
196
118
|
baseProps["aria-rowindex"] = node.rowIndex + 1; // 1-based
|
|
197
119
|
}
|
|
198
120
|
|
|
199
|
-
|
|
121
|
+
const gridListData = getGridListData(s);
|
|
122
|
+
const mergedProps = mergeProps<JSX.HTMLAttributes<HTMLElement>>(
|
|
123
|
+
selectableItem.itemProps,
|
|
124
|
+
baseProps,
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
return mergeCollectionRowInteractionProps(mergedProps, {
|
|
128
|
+
ref,
|
|
129
|
+
keyboardNavigationBehavior: () => gridListData?.keyboardNavigationBehavior ?? "arrow",
|
|
130
|
+
direction: () => gridListData?.direction ?? "ltr",
|
|
131
|
+
});
|
|
200
132
|
});
|
|
201
133
|
|
|
202
134
|
const gridCellProps = createMemo(() => {
|
|
@@ -216,10 +148,10 @@ export function createGridListItem<
|
|
|
216
148
|
return isSelected();
|
|
217
149
|
},
|
|
218
150
|
get isDisabled() {
|
|
219
|
-
return isDisabled();
|
|
151
|
+
return selectableItem.isDisabled();
|
|
220
152
|
},
|
|
221
153
|
get isPressed() {
|
|
222
|
-
return isPressed();
|
|
154
|
+
return selectableItem.isPressed();
|
|
223
155
|
},
|
|
224
156
|
};
|
|
225
157
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createGridListSection - Provides accessibility for a grid list section.
|
|
3
|
+
* Based on @react-aria/gridlist/useGridListSection.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { createMemo } from "solid-js";
|
|
7
|
+
import { createId, createSlotId } from "../ssr";
|
|
8
|
+
import { createLabels } from "../label/createLabels";
|
|
9
|
+
import type { AriaGridListSectionProps, GridListSectionAria } from "./types";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates accessibility props for a grid list section.
|
|
13
|
+
*
|
|
14
|
+
* Mirrors upstream `useGridListSection`: a section is a `role="rowgroup"`
|
|
15
|
+
* wrapper whose optional header renders as `role="row"` › `role="rowheader"`.
|
|
16
|
+
* The `aria-labelledby` of the wrapper points at the header's id via a slot id
|
|
17
|
+
* that resolves to `undefined` when no header is rendered.
|
|
18
|
+
*/
|
|
19
|
+
export function createGridListSection(props: AriaGridListSectionProps): GridListSectionAria {
|
|
20
|
+
const headingId = createSlotId();
|
|
21
|
+
// Stable id for the rowgroup so `createLabels` does not regenerate one each
|
|
22
|
+
// time the slot id resolves (it short-circuits on a provided id).
|
|
23
|
+
const rowGroupId = createId();
|
|
24
|
+
|
|
25
|
+
const labelProps = createMemo(() =>
|
|
26
|
+
createLabels({
|
|
27
|
+
id: rowGroupId,
|
|
28
|
+
"aria-label": props["aria-label"],
|
|
29
|
+
"aria-labelledby": headingId(),
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
rowProps: { role: "row" },
|
|
35
|
+
rowHeaderProps: {
|
|
36
|
+
get id() {
|
|
37
|
+
return headingId();
|
|
38
|
+
},
|
|
39
|
+
role: "rowheader",
|
|
40
|
+
},
|
|
41
|
+
rowGroupProps: {
|
|
42
|
+
role: "rowgroup",
|
|
43
|
+
get id() {
|
|
44
|
+
return labelProps().id;
|
|
45
|
+
},
|
|
46
|
+
get "aria-label"() {
|
|
47
|
+
return labelProps()["aria-label"];
|
|
48
|
+
},
|
|
49
|
+
get "aria-labelledby"() {
|
|
50
|
+
return labelProps()["aria-labelledby"];
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|