@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
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
import { createSignal, createEffect, onCleanup, type Accessor } from "solid-js";
|
|
11
11
|
import { createId, getOwnerDocument } from "../ssr";
|
|
12
|
-
import { type AutocompleteState } from "@proyecto-viviana/solid-stately";
|
|
12
|
+
import { type AutocompleteState, type CollectionNode } from "@proyecto-viviana/solid-stately";
|
|
13
|
+
import { FOCUS_EVENT, CLEAR_FOCUS_EVENT } from "../selection/constants";
|
|
14
|
+
import { getActiveElement, getEventTarget } from "../utils/dom";
|
|
15
|
+
import { getPointerType } from "../interactions";
|
|
13
16
|
|
|
14
17
|
export interface CollectionOptions {
|
|
15
18
|
/** The id of the collection element. */
|
|
@@ -20,6 +23,8 @@ export interface CollectionOptions {
|
|
|
20
23
|
shouldUseVirtualFocus: boolean;
|
|
21
24
|
/** Whether typeahead is disabled. */
|
|
22
25
|
disallowTypeAhead: boolean;
|
|
26
|
+
/** Whether and where to focus an item when the collection mounts. */
|
|
27
|
+
autoFocus?: boolean | "first" | "last";
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
export interface AutocompleteInputProps {
|
|
@@ -49,7 +54,7 @@ export interface AutocompleteInputProps {
|
|
|
49
54
|
autoComplete: "off";
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
export interface AriaAutocompleteOptions<
|
|
57
|
+
export interface AriaAutocompleteOptions<T = unknown> {
|
|
53
58
|
/** Ref accessor for the input element. */
|
|
54
59
|
inputRef: Accessor<HTMLInputElement | undefined>;
|
|
55
60
|
/** Ref accessor for the collection element. */
|
|
@@ -62,8 +67,9 @@ export interface AriaAutocompleteOptions<_T = unknown> {
|
|
|
62
67
|
* An optional filter function used to determine if an option should be included.
|
|
63
68
|
* @param textValue - The text value of the item
|
|
64
69
|
* @param inputValue - The current input value
|
|
70
|
+
* @param node - The collection node being filtered
|
|
65
71
|
*/
|
|
66
|
-
filter?: (textValue: string, inputValue: string) => boolean;
|
|
72
|
+
filter?: (textValue: string, inputValue: string, node: CollectionNode<T>) => boolean;
|
|
67
73
|
/**
|
|
68
74
|
* Whether to focus the first item after filtering.
|
|
69
75
|
* @default false
|
|
@@ -76,13 +82,13 @@ export interface AriaAutocompleteOptions<_T = unknown> {
|
|
|
76
82
|
disableVirtualFocus?: boolean;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
|
-
export interface AutocompleteAria<
|
|
85
|
+
export interface AutocompleteAria<T = unknown> {
|
|
80
86
|
/** Props for the autocomplete input element. */
|
|
81
87
|
inputProps: AutocompleteInputProps;
|
|
82
88
|
/** Props for the collection (ListBox/Menu). */
|
|
83
89
|
collectionProps: CollectionOptions;
|
|
84
90
|
/** A filter function that returns if the item should be shown. */
|
|
85
|
-
filter?: (
|
|
91
|
+
filter?: (nodeTextValue: string, node: CollectionNode<T>) => boolean;
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
function toKeyboardEventInit(e: KeyboardEvent): KeyboardEventInit {
|
|
@@ -101,9 +107,14 @@ function toKeyboardEventInit(e: KeyboardEvent): KeyboardEventInit {
|
|
|
101
107
|
};
|
|
102
108
|
}
|
|
103
109
|
|
|
104
|
-
// Custom event names for collection communication
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
// Custom event names for collection communication.
|
|
111
|
+
// These are the shared @react-aria/selection constants the collection's
|
|
112
|
+
// createSelectableCollection listens for (FOCUS_EVENT / CLEAR_FOCUS_EVENT);
|
|
113
|
+
// the aliases below are retained for backwards-compatible re-exports.
|
|
114
|
+
/** @deprecated Use {@link FOCUS_EVENT} from the selection layer. */
|
|
115
|
+
export const AUTOCOMPLETE_FOCUS_EVENT = FOCUS_EVENT;
|
|
116
|
+
/** @deprecated Use {@link CLEAR_FOCUS_EVENT} from the selection layer. */
|
|
117
|
+
export const AUTOCOMPLETE_CLEAR_FOCUS_EVENT = CLEAR_FOCUS_EVENT;
|
|
107
118
|
|
|
108
119
|
/**
|
|
109
120
|
* Provides the behavior and accessibility implementation for an autocomplete component.
|
|
@@ -150,46 +161,84 @@ export function createAutocomplete<T = unknown>(
|
|
|
150
161
|
|
|
151
162
|
const collectionId = collectionIdProp ?? createId();
|
|
152
163
|
const [shouldUseVirtualFocus] = createSignal(!disableVirtualFocus);
|
|
164
|
+
// When the first item should be focused but the collection hasn't mounted yet,
|
|
165
|
+
// defer it by threading autoFocus through collectionProps so the collection
|
|
166
|
+
// focuses on mount (mirrors upstream's autoFocusOnMount state).
|
|
167
|
+
const [autoFocusOnMount, setAutoFocusOnMount] = createSignal(false);
|
|
153
168
|
let lastInputType = "";
|
|
154
169
|
|
|
155
|
-
//
|
|
156
|
-
|
|
170
|
+
// Reverse-focus (collection → input aria-activedescendant) bookkeeping, mirroring
|
|
171
|
+
// useAutocomplete's queuedActiveDescendant / delayNextActiveDescendant / timeout
|
|
172
|
+
// refs. `queuedActiveDescendant` is the id of the option the collection has
|
|
173
|
+
// virtually focused — tracked synchronously on every collection `focusin`, even
|
|
174
|
+
// while the visible aria-activedescendant reflection is deferred, so key
|
|
175
|
+
// navigation always dispatches to the right item. When typing forward,
|
|
176
|
+
// `delayNextActiveDescendant` defers the next reflection behind a 500ms timeout so
|
|
177
|
+
// a screen reader finishes announcing the just-typed letter before naming the
|
|
178
|
+
// active option; every new focusin (and teardown) clears the pending timeout.
|
|
179
|
+
let queuedActiveDescendant: string | null = null;
|
|
180
|
+
let delayNextActiveDescendant = false;
|
|
181
|
+
let activeDescendantTimeout: ReturnType<typeof setTimeout> | undefined;
|
|
182
|
+
const ACTIVE_DESCENDANT_DELAY = 500;
|
|
183
|
+
|
|
184
|
+
// Track the input type for determining focus behavior. We listen to
|
|
185
|
+
// `beforeinput` (not `input`) so `lastInputType` is set before the input's
|
|
186
|
+
// `onChange` runs, mirroring @react-aria/autocomplete.
|
|
187
|
+
const handleBeforeInput = (e: Event) => {
|
|
157
188
|
const inputEvent = e as InputEvent;
|
|
158
189
|
lastInputType = inputEvent.inputType || "";
|
|
159
190
|
};
|
|
160
191
|
|
|
161
|
-
// Set up
|
|
192
|
+
// Set up beforeinput event listener
|
|
162
193
|
createEffect(() => {
|
|
163
194
|
const input = inputRef();
|
|
164
195
|
if (input) {
|
|
165
|
-
input.addEventListener("
|
|
196
|
+
input.addEventListener("beforeinput", handleBeforeInput);
|
|
166
197
|
onCleanup(() => {
|
|
167
|
-
input.removeEventListener("
|
|
198
|
+
input.removeEventListener("beforeinput", handleBeforeInput);
|
|
168
199
|
});
|
|
169
200
|
}
|
|
170
201
|
});
|
|
171
202
|
|
|
172
203
|
// Focus first item in collection
|
|
173
204
|
const focusFirstItem = () => {
|
|
205
|
+
// Typing forward focuses the first filtered row, but the resulting
|
|
206
|
+
// aria-activedescendant reflection must wait so the SR announces the typed
|
|
207
|
+
// letter first (see updateActiveDescendant). Mirrors useAutocomplete
|
|
208
|
+
// setting delayNextActiveDescendant.current = true before the focus event.
|
|
209
|
+
delayNextActiveDescendant = true;
|
|
174
210
|
const collection = collectionRef();
|
|
175
|
-
if (collection) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}),
|
|
182
|
-
);
|
|
211
|
+
if (!collection) {
|
|
212
|
+
// Collection isn't mounted yet — defer focusing the first item to mount
|
|
213
|
+
// time via collectionProps.autoFocus instead of firing a focus event into
|
|
214
|
+
// a not-yet-rendered collection.
|
|
215
|
+
setAutoFocusOnMount(true);
|
|
216
|
+
return;
|
|
183
217
|
}
|
|
218
|
+
collection.dispatchEvent(
|
|
219
|
+
new CustomEvent(FOCUS_EVENT, {
|
|
220
|
+
cancelable: true,
|
|
221
|
+
bubbles: true,
|
|
222
|
+
detail: { focusStrategy: "first" },
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
184
225
|
};
|
|
185
226
|
|
|
186
227
|
// Clear virtual focus
|
|
187
228
|
const clearVirtualFocus = (clearFocusKey = false) => {
|
|
229
|
+
setAutoFocusOnMount(false);
|
|
230
|
+
// Drop any pending delayed reflection and the tracked item alongside the
|
|
231
|
+
// active descendant so a subsequent focusin can't resurrect a stale id
|
|
232
|
+
// (mirrors useAutocomplete clearing queuedActiveDescendant / the timeout /
|
|
233
|
+
// delayNextActiveDescendant in clearVirtualFocus).
|
|
234
|
+
clearTimeout(activeDescendantTimeout);
|
|
235
|
+
queuedActiveDescendant = null;
|
|
236
|
+
delayNextActiveDescendant = false;
|
|
188
237
|
state.setFocusedNodeId(null);
|
|
189
238
|
const collection = collectionRef();
|
|
190
239
|
if (collection) {
|
|
191
240
|
collection.dispatchEvent(
|
|
192
|
-
new CustomEvent(
|
|
241
|
+
new CustomEvent(CLEAR_FOCUS_EVENT, {
|
|
193
242
|
cancelable: true,
|
|
194
243
|
bubbles: true,
|
|
195
244
|
detail: { clearFocusKey },
|
|
@@ -200,8 +249,16 @@ export function createAutocomplete<T = unknown>(
|
|
|
200
249
|
|
|
201
250
|
// Handle input value changes
|
|
202
251
|
const onChange = (value: string) => {
|
|
203
|
-
// Focus first item when typing forward, clear when backspacing/pasting
|
|
204
|
-
|
|
252
|
+
// Focus first item when typing forward, clear when backspacing/pasting.
|
|
253
|
+
// IME composition (e.g. CJK input) reports 'insertCompositionText'/
|
|
254
|
+
// 'insertFromComposition' instead of 'insertText'; treat those as forward
|
|
255
|
+
// typing so the first item still gets virtual focus.
|
|
256
|
+
if (
|
|
257
|
+
(lastInputType === "insertText" ||
|
|
258
|
+
lastInputType === "insertCompositionText" ||
|
|
259
|
+
lastInputType === "insertFromComposition") &&
|
|
260
|
+
!disableAutoFocusFirst
|
|
261
|
+
) {
|
|
205
262
|
focusFirstItem();
|
|
206
263
|
} else if (
|
|
207
264
|
lastInputType &&
|
|
@@ -221,7 +278,13 @@ export function createAutocomplete<T = unknown>(
|
|
|
221
278
|
return;
|
|
222
279
|
}
|
|
223
280
|
|
|
224
|
-
|
|
281
|
+
// Navigate against the id the collection has virtually focused, tracked
|
|
282
|
+
// synchronously on every focusin, NOT the (possibly still-delayed)
|
|
283
|
+
// aria-activedescendant reflection in state — mirrors useAutocomplete
|
|
284
|
+
// reading queuedActiveDescendant.current here. Reading state.focusedNodeId()
|
|
285
|
+
// would be null during the post-type reflection delay, so arrows would
|
|
286
|
+
// re-focus the first row instead of advancing.
|
|
287
|
+
const focusedNodeId = queuedActiveDescendant;
|
|
225
288
|
const collection = collectionRef();
|
|
226
289
|
const ownerDocument = getOwnerDocument(inputRef() ?? collection);
|
|
227
290
|
|
|
@@ -253,7 +316,7 @@ export function createAutocomplete<T = unknown>(
|
|
|
253
316
|
// Dispatch focus event to collection
|
|
254
317
|
if (collection) {
|
|
255
318
|
collection.dispatchEvent(
|
|
256
|
-
new CustomEvent(
|
|
319
|
+
new CustomEvent(FOCUS_EVENT, {
|
|
257
320
|
cancelable: true,
|
|
258
321
|
bubbles: true,
|
|
259
322
|
}),
|
|
@@ -264,9 +327,15 @@ export function createAutocomplete<T = unknown>(
|
|
|
264
327
|
|
|
265
328
|
case "ArrowLeft":
|
|
266
329
|
case "ArrowRight":
|
|
267
|
-
//
|
|
268
|
-
|
|
269
|
-
|
|
330
|
+
// With no virtual focus, just let the arrow move the text cursor; stop
|
|
331
|
+
// propagation so it doesn't leak into the collection. With virtual focus,
|
|
332
|
+
// fall through to dispatch the key to the focused item below, then clear
|
|
333
|
+
// the active descendant only after the item has seen it.
|
|
334
|
+
if (!focusedNodeId) {
|
|
335
|
+
e.stopPropagation();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
break;
|
|
270
339
|
|
|
271
340
|
case "Enter":
|
|
272
341
|
// Trigger click on focused item
|
|
@@ -280,17 +349,36 @@ export function createAutocomplete<T = unknown>(
|
|
|
280
349
|
return;
|
|
281
350
|
}
|
|
282
351
|
|
|
283
|
-
// Forward keyboard events to
|
|
284
|
-
|
|
352
|
+
// Forward keyboard events to the focused item (or the collection when there
|
|
353
|
+
// is no virtual focus) so the collection can act on them, e.g. onAction.
|
|
354
|
+
// Gated only on the collection existing — NOT on e.defaultPrevented: arrows
|
|
355
|
+
// call preventDefault above to stop the input's text cursor moving, but the
|
|
356
|
+
// key must still be re-dispatched to the row so navigation advances (mirrors
|
|
357
|
+
// useAutocomplete forwarding whenever collectionRef.current !== null).
|
|
358
|
+
if (collection) {
|
|
285
359
|
e.stopPropagation();
|
|
286
360
|
|
|
361
|
+
let shouldPerformDefaultAction = true;
|
|
287
362
|
if (focusedNodeId) {
|
|
288
363
|
const item = ownerDocument?.getElementById(focusedNodeId);
|
|
289
364
|
if (item) {
|
|
290
|
-
item.dispatchEvent(
|
|
365
|
+
shouldPerformDefaultAction = item.dispatchEvent(
|
|
366
|
+
new KeyboardEvent(e.type, toKeyboardEventInit(e)),
|
|
367
|
+
);
|
|
291
368
|
}
|
|
292
369
|
} else {
|
|
293
|
-
collection.dispatchEvent(
|
|
370
|
+
shouldPerformDefaultAction = collection.dispatchEvent(
|
|
371
|
+
new KeyboardEvent(e.type, toKeyboardEventInit(e)),
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// After the focused item has seen ArrowLeft/ArrowRight, clear the active
|
|
376
|
+
// descendant so SR announcements aren't interrupted, but retain the
|
|
377
|
+
// collection's focused key so navigation restarts where it left off. If
|
|
378
|
+
// the item consumed the key (e.g. an expandable row collapsing), it
|
|
379
|
+
// cancels the event and we keep virtual focus.
|
|
380
|
+
if (shouldPerformDefaultAction && (e.key === "ArrowLeft" || e.key === "ArrowRight")) {
|
|
381
|
+
clearVirtualFocus();
|
|
294
382
|
}
|
|
295
383
|
}
|
|
296
384
|
};
|
|
@@ -314,9 +402,85 @@ export function createAutocomplete<T = unknown>(
|
|
|
314
402
|
// Virtual focus blur handling would go here
|
|
315
403
|
};
|
|
316
404
|
|
|
317
|
-
//
|
|
405
|
+
// Reverse path: mirror the collection's virtually-focused option into the
|
|
406
|
+
// input's aria-activedescendant. The collection dispatches a synthetic,
|
|
407
|
+
// bubbling `focusin` (via moveVirtualFocus) on its focused option; we read the
|
|
408
|
+
// target id, track it in `queuedActiveDescendant` synchronously (so key nav
|
|
409
|
+
// always dispatches to the right item), and reflect it into AutocompleteState
|
|
410
|
+
// — immediately, or, when `delayNextActiveDescendant` was set by forward
|
|
411
|
+
// typing, behind a 500ms timeout so the SR finishes announcing the typed
|
|
412
|
+
// letter before naming the active option. Faithful port of useAutocomplete's
|
|
413
|
+
// updateActiveDescendantEvent.
|
|
414
|
+
const updateActiveDescendant = (e: Event) => {
|
|
415
|
+
const input = inputRef();
|
|
416
|
+
// If the user clicks/taps an option directly (non-touch), pull real focus
|
|
417
|
+
// back to the input so typing keeps working.
|
|
418
|
+
if (
|
|
419
|
+
!e.isTrusted &&
|
|
420
|
+
shouldUseVirtualFocus() &&
|
|
421
|
+
input &&
|
|
422
|
+
getActiveElement(getOwnerDocument(input)) !== input &&
|
|
423
|
+
getPointerType() !== "touch"
|
|
424
|
+
) {
|
|
425
|
+
input.focus();
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
const target = getEventTarget<Element>(e);
|
|
429
|
+
if (e.isTrusted || !target || queuedActiveDescendant === target.id) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
const collection = collectionRef();
|
|
434
|
+
// A new focusin supersedes any pending delayed reflection.
|
|
435
|
+
clearTimeout(activeDescendantTimeout);
|
|
436
|
+
if (target !== collection) {
|
|
437
|
+
const targetId = target.id;
|
|
438
|
+
if (delayNextActiveDescendant) {
|
|
439
|
+
// Forward typing just focused the first row: track it now, but defer the
|
|
440
|
+
// aria-activedescendant reflection so the just-typed letter is announced
|
|
441
|
+
// before the active option.
|
|
442
|
+
queuedActiveDescendant = targetId;
|
|
443
|
+
activeDescendantTimeout = setTimeout(() => {
|
|
444
|
+
state.setFocusedNodeId(targetId);
|
|
445
|
+
}, ACTIVE_DESCENDANT_DELAY);
|
|
446
|
+
} else {
|
|
447
|
+
queuedActiveDescendant = targetId;
|
|
448
|
+
state.setFocusedNodeId(targetId);
|
|
449
|
+
}
|
|
450
|
+
} else if (
|
|
451
|
+
queuedActiveDescendant &&
|
|
452
|
+
!getOwnerDocument(collection)?.getElementById(queuedActiveDescendant)
|
|
453
|
+
) {
|
|
454
|
+
// Refocus of the collection itself while the previously focused node no
|
|
455
|
+
// longer exists (filtered away, or the input was refocused): clear the
|
|
456
|
+
// tracked item and the active descendant.
|
|
457
|
+
queuedActiveDescendant = null;
|
|
458
|
+
state.setFocusedNodeId(null);
|
|
459
|
+
}
|
|
460
|
+
// Reflection delay is a one-shot; the next focusin reflects immediately
|
|
461
|
+
// unless forward typing sets the flag again.
|
|
462
|
+
delayNextActiveDescendant = false;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
createEffect(() => {
|
|
466
|
+
if (!shouldUseVirtualFocus()) return;
|
|
467
|
+
const collection = collectionRef();
|
|
468
|
+
if (collection) {
|
|
469
|
+
collection.addEventListener("focusin", updateActiveDescendant);
|
|
470
|
+
onCleanup(() => {
|
|
471
|
+
collection.removeEventListener("focusin", updateActiveDescendant);
|
|
472
|
+
clearTimeout(activeDescendantTimeout);
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// Create filter function. The user's 3-arg predicate (textValue, inputValue,
|
|
478
|
+
// node) is closed over the current input value and exposed to the collection
|
|
479
|
+
// as the 2-arg (nodeTextValue, node) shape that UNSTABLE_useFilteredListState
|
|
480
|
+
// (createFilteredListState) expects.
|
|
318
481
|
const filterFn = filter
|
|
319
|
-
? (
|
|
482
|
+
? (nodeTextValue: string, node: CollectionNode<T>) =>
|
|
483
|
+
filter(nodeTextValue, state.inputValue(), node)
|
|
320
484
|
: undefined;
|
|
321
485
|
|
|
322
486
|
return {
|
|
@@ -341,6 +505,9 @@ export function createAutocomplete<T = unknown>(
|
|
|
341
505
|
"aria-label": collectionAriaLabel,
|
|
342
506
|
shouldUseVirtualFocus: shouldUseVirtualFocus(),
|
|
343
507
|
disallowTypeAhead: shouldUseVirtualFocus(),
|
|
508
|
+
get autoFocus() {
|
|
509
|
+
return autoFocusOnMount() ? "first" : false;
|
|
510
|
+
},
|
|
344
511
|
},
|
|
345
512
|
filter: filterFn,
|
|
346
513
|
};
|
|
@@ -84,8 +84,14 @@ export function createBreadcrumbItem(
|
|
|
84
84
|
const elementType = () => getProps().elementType ?? "a";
|
|
85
85
|
|
|
86
86
|
// Use createLink for base link behavior
|
|
87
|
-
// Current items are treated as disabled (can't navigate to current page)
|
|
88
|
-
|
|
87
|
+
// Current items are treated as disabled (can't navigate to current page).
|
|
88
|
+
// Keep the whole return value (do NOT destructure linkProps): `linkProps` is a
|
|
89
|
+
// reactive getter, and destructuring it here would snapshot getLinkProps() once
|
|
90
|
+
// at mount — freezing role/tabIndex to whatever elementType was during the
|
|
91
|
+
// transient first render (e.g. before isCurrent settles). Reading
|
|
92
|
+
// linkAria.linkProps fresh inside getItemProps keeps it live, mirroring React
|
|
93
|
+
// re-running useLink every render.
|
|
94
|
+
const linkAria = createLink({
|
|
89
95
|
get isDisabled() {
|
|
90
96
|
return isDisabled() || isCurrent();
|
|
91
97
|
},
|
|
@@ -148,6 +154,8 @@ export function createBreadcrumbItem(
|
|
|
148
154
|
const getItemProps = (): Record<string, unknown> => {
|
|
149
155
|
const p = getProps();
|
|
150
156
|
const current = isCurrent();
|
|
157
|
+
// Read fresh each call so elementType-driven role/tabIndex stay reactive.
|
|
158
|
+
const linkProps = linkAria.linkProps;
|
|
151
159
|
|
|
152
160
|
// Start with link props, forwarding id if provided
|
|
153
161
|
let baseProps: Record<string, unknown> = p.id ? mergeProps(linkProps, { id: p.id }) : linkProps;
|
|
@@ -175,8 +183,8 @@ export function createBreadcrumbItem(
|
|
|
175
183
|
return getItemProps();
|
|
176
184
|
},
|
|
177
185
|
get linkProps() {
|
|
178
|
-
return linkProps;
|
|
186
|
+
return linkAria.linkProps;
|
|
179
187
|
},
|
|
180
|
-
isPressed,
|
|
188
|
+
isPressed: linkAria.isPressed,
|
|
181
189
|
};
|
|
182
190
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JSX } from "solid-js";
|
|
2
|
+
import { splitProps } from "solid-js";
|
|
2
3
|
import type { Key, ToggleGroupProps, ToggleGroupState } from "@proyecto-viviana/solid-stately";
|
|
3
4
|
import { createToolbar, type Orientation } from "../toolbar";
|
|
4
5
|
import { mergeProps } from "../utils";
|
|
@@ -75,21 +76,25 @@ export function createToggleButtonGroupItem(
|
|
|
75
76
|
props: AriaToggleButtonGroupItemProps,
|
|
76
77
|
state: ToggleGroupState,
|
|
77
78
|
): ToggleButtonAria {
|
|
78
|
-
|
|
79
|
+
// splitProps keeps `toggleProps` a reactive proxy; an object-rest destructure
|
|
80
|
+
// (`{ id, ...toggleProps }`) eagerly reads and freezes every key. `id` is
|
|
81
|
+
// dropped here and re-read live via props.id below. guard:idiomatic-solid.
|
|
82
|
+
const [, toggleProps] = splitProps(props, ["id"]);
|
|
79
83
|
|
|
80
|
-
const toggleButton = createToggleButton(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
const toggleButton = createToggleButton(
|
|
85
|
+
mergeProps(toggleProps, {
|
|
86
|
+
get isSelected() {
|
|
87
|
+
return state.selectedKeys.has(props.id);
|
|
88
|
+
},
|
|
89
|
+
onChange(isSelected: boolean) {
|
|
90
|
+
state.setSelected(props.id, isSelected);
|
|
91
|
+
props.onChange?.(isSelected);
|
|
92
|
+
},
|
|
93
|
+
get isDisabled() {
|
|
94
|
+
return isDisabledValue(props.isDisabled) || state.isDisabled;
|
|
95
|
+
},
|
|
96
|
+
}) as AriaToggleButtonProps,
|
|
97
|
+
);
|
|
93
98
|
|
|
94
99
|
const baseButtonProps = toggleButton.buttonProps as Record<string, unknown>;
|
|
95
100
|
const buttonProps: Record<string, unknown> = {
|
|
@@ -11,6 +11,7 @@ import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
|
11
11
|
import { mergeProps } from "../utils/mergeProps";
|
|
12
12
|
import type { CalendarState } from "@proyecto-viviana/solid-stately";
|
|
13
13
|
import { formatVisibleRangeDescription, setCalendarHookData } from "./utils";
|
|
14
|
+
import { formatCalendarLabel } from "./intl";
|
|
14
15
|
|
|
15
16
|
export interface AriaCalendarProps {
|
|
16
17
|
/** An ID for the calendar. */
|
|
@@ -88,6 +89,8 @@ export function createCalendar<T extends CalendarState>(
|
|
|
88
89
|
setCalendarHookData(state, {
|
|
89
90
|
errorMessageId:
|
|
90
91
|
initialProps.errorMessage || initialProps.errorMessageId ? errorMessageId : undefined,
|
|
92
|
+
ariaLabel: initialProps["aria-label"],
|
|
93
|
+
ariaLabelledBy: initialProps["aria-labelledby"],
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
|
|
@@ -97,14 +100,13 @@ export function createCalendar<T extends CalendarState>(
|
|
|
97
100
|
const isDisabled = p.isDisabled || state.isDisabled();
|
|
98
101
|
|
|
99
102
|
return {
|
|
100
|
-
"aria-label":
|
|
103
|
+
"aria-label": formatCalendarLabel(state.locale(), "previous"),
|
|
101
104
|
onClick: () => {
|
|
102
105
|
if (!isDisabled) {
|
|
103
106
|
state.focusPreviousPage();
|
|
104
107
|
}
|
|
105
108
|
},
|
|
106
109
|
disabled: isDisabled,
|
|
107
|
-
tabIndex: -1,
|
|
108
110
|
};
|
|
109
111
|
});
|
|
110
112
|
|
|
@@ -114,14 +116,13 @@ export function createCalendar<T extends CalendarState>(
|
|
|
114
116
|
const isDisabled = p.isDisabled || state.isDisabled();
|
|
115
117
|
|
|
116
118
|
return {
|
|
117
|
-
"aria-label":
|
|
119
|
+
"aria-label": formatCalendarLabel(state.locale(), "next"),
|
|
118
120
|
onClick: () => {
|
|
119
121
|
if (!isDisabled) {
|
|
120
122
|
state.focusNextPage();
|
|
121
123
|
}
|
|
122
124
|
},
|
|
123
125
|
disabled: isDisabled,
|
|
124
|
-
tabIndex: -1,
|
|
125
126
|
};
|
|
126
127
|
});
|
|
127
128
|
|
|
@@ -8,13 +8,20 @@
|
|
|
8
8
|
import { createSignal, createMemo, createEffect, type Accessor } from "solid-js";
|
|
9
9
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
10
10
|
import { focusSafely } from "../utils/focus";
|
|
11
|
+
import { scrollIntoViewport, getScrollParent } from "../utils";
|
|
11
12
|
import { createFocusRing } from "../interactions/createFocusRing";
|
|
12
13
|
import { getInteractionModality } from "../interactions/createInteractionModality";
|
|
13
14
|
import { useLocale } from "../i18n";
|
|
14
15
|
import { mergeProps } from "../utils/mergeProps";
|
|
15
16
|
import type { CalendarState, CalendarDate, DateValue } from "@proyecto-viviana/solid-stately";
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
isToday as isTodayUtil,
|
|
19
|
+
DateFormatter,
|
|
20
|
+
getLocalTimeZone,
|
|
21
|
+
isSameDay,
|
|
22
|
+
} from "@internationalized/date";
|
|
17
23
|
import { getCalendarHookData } from "./utils";
|
|
24
|
+
import { formatCalendarLabel } from "./intl";
|
|
18
25
|
|
|
19
26
|
export interface AriaCalendarCellProps {
|
|
20
27
|
/** The date represented by the cell. */
|
|
@@ -74,7 +81,6 @@ export function createCalendarCell<T extends CalendarState>(
|
|
|
74
81
|
|
|
75
82
|
// Check states
|
|
76
83
|
const isSelected = createMemo(() => state.isSelected(date()));
|
|
77
|
-
const isFocused = createMemo(() => state.isCellFocused(date()));
|
|
78
84
|
const isInvalid = createMemo(() => state.isValueInvalid() && isSelected());
|
|
79
85
|
const isDisabled = createMemo(() => {
|
|
80
86
|
return getProps().isDisabled || state.isCellDisabled(date());
|
|
@@ -83,6 +89,11 @@ export function createCalendarCell<T extends CalendarState>(
|
|
|
83
89
|
const isOutsideMonth = createMemo(
|
|
84
90
|
() => getProps().isOutsideMonth ?? state.isOutsideVisibleRange(date()),
|
|
85
91
|
);
|
|
92
|
+
// Mirror @react-aria/calendar useCalendarCell: `isCellFocused(date) &&
|
|
93
|
+
// !isOutsideMonth`. isCellFocused is gated on the calendar-level focus flag,
|
|
94
|
+
// so this drives the focusSafely effect (never on mount) — NOT the roving
|
|
95
|
+
// tabIndex, which tracks focusedDate directly below.
|
|
96
|
+
const isFocused = createMemo(() => state.isCellFocused(date()) && !isOutsideMonth());
|
|
86
97
|
const isToday = createMemo(() => isTodayUtil(date(), timeZone));
|
|
87
98
|
const isCellFocusVisible = createMemo(
|
|
88
99
|
() => isFocused() && isRingFocusVisible() && getInteractionModality() !== null,
|
|
@@ -145,6 +156,14 @@ export function createCalendarCell<T extends CalendarState>(
|
|
|
145
156
|
const element = ref?.();
|
|
146
157
|
if (element && isFocused()) {
|
|
147
158
|
focusSafely(element);
|
|
159
|
+
|
|
160
|
+
// Scroll into view if navigating with a keyboard, otherwise try not to
|
|
161
|
+
// shift the view under the user's mouse/finger. If in an overlay,
|
|
162
|
+
// scrollIntoViewport only scrolls up to the overlay scroll body. Only
|
|
163
|
+
// scroll if the cell actually got focused.
|
|
164
|
+
if (getInteractionModality() !== "pointer" && document.activeElement === element) {
|
|
165
|
+
scrollIntoViewport(element, { containingElement: getScrollParent(element) });
|
|
166
|
+
}
|
|
148
167
|
}
|
|
149
168
|
});
|
|
150
169
|
|
|
@@ -166,9 +185,16 @@ export function createCalendarCell<T extends CalendarState>(
|
|
|
166
185
|
day: "numeric",
|
|
167
186
|
calendar: d.calendar.identifier,
|
|
168
187
|
} as Intl.DateTimeFormatOptions);
|
|
188
|
+
// Mirror @react-aria/calendar useCalendarCell: route the selected/today
|
|
189
|
+
// suffix through the localized string formatter instead of hardcoding
|
|
190
|
+
// " selected" (which dropped "Today" and never localized).
|
|
169
191
|
let label = formatter.format(d.toDate(timeZone));
|
|
170
|
-
if (
|
|
171
|
-
label
|
|
192
|
+
if (isToday()) {
|
|
193
|
+
label = formatCalendarLabel(locale(), isSelected() ? "todayDateSelected" : "todayDate", {
|
|
194
|
+
date: label,
|
|
195
|
+
});
|
|
196
|
+
} else if (isSelected()) {
|
|
197
|
+
label = formatCalendarLabel(locale(), "dateSelected", { date: label });
|
|
172
198
|
}
|
|
173
199
|
const errorMessageId = getCalendarHookData(state)?.errorMessageId;
|
|
174
200
|
|
|
@@ -176,7 +202,12 @@ export function createCalendarCell<T extends CalendarState>(
|
|
|
176
202
|
focusProps as Record<string, unknown>,
|
|
177
203
|
{
|
|
178
204
|
role: "button",
|
|
179
|
-
|
|
205
|
+
// Roving tabbable cell = the focusedDate cell, ungated by calendar
|
|
206
|
+
// focus, mirroring @react-aria/calendar useCalendarCell
|
|
207
|
+
// (`tabIndex = isSameDay(date, state.focusedDate) ? 0 : -1`, undefined
|
|
208
|
+
// when disabled). Keeps one cell tabbable on mount without stealing
|
|
209
|
+
// focus, and prunes tabindex from disabled cells like upstream.
|
|
210
|
+
tabIndex: isDisabled() ? undefined : isSameDay(date(), state.focusedDate()) ? 0 : -1,
|
|
180
211
|
"aria-label": label,
|
|
181
212
|
"aria-disabled": isDisabled() || isUnavailable() || undefined,
|
|
182
213
|
"aria-invalid": isInvalid() || undefined,
|
|
@@ -9,6 +9,7 @@ import { createMemo } from "solid-js";
|
|
|
9
9
|
import { DateFormatter, startOfWeek, today } from "@internationalized/date";
|
|
10
10
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
11
11
|
import type { CalendarState, CalendarDate } from "@proyecto-viviana/solid-stately";
|
|
12
|
+
import { formatVisibleRangeDescription, getCalendarHookData } from "./utils";
|
|
12
13
|
|
|
13
14
|
export interface AriaCalendarGridProps {
|
|
14
15
|
/** The start date of the grid (defaults to start of focused month). */
|
|
@@ -142,20 +143,54 @@ export function createCalendarGrid<T extends CalendarState>(
|
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
145
|
|
|
146
|
+
// Whether more than one date can be selected at once. Mirrors
|
|
147
|
+
// @react-aria/calendar useCalendarGrid: true for a RangeCalendar (highlightable
|
|
148
|
+
// range) or a Calendar in multiple-selection mode.
|
|
149
|
+
const isMultiSelectable = (): boolean => {
|
|
150
|
+
if ("highlightedRange" in state) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
return (
|
|
154
|
+
"selectionMode" in state &&
|
|
155
|
+
typeof state.selectionMode === "function" &&
|
|
156
|
+
state.selectionMode() === "multiple"
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// The grid's accessible name combines the calendar's label with a description
|
|
161
|
+
// of this grid's visible month/range, mirroring @react-aria/calendar
|
|
162
|
+
// useCalendarGrid (useVisibleRangeDescription over the grid's own start/end so
|
|
163
|
+
// multi-month calendars name each grid by its own month).
|
|
164
|
+
const visibleRangeDescription = createMemo(() => {
|
|
165
|
+
const gridProps = access(props);
|
|
166
|
+
const start = gridProps.startDate ?? state.visibleRange().start;
|
|
167
|
+
const end = gridProps.endDate ?? state.visibleRange().end;
|
|
168
|
+
return formatVisibleRangeDescription(start, end, state.timeZone, state.locale());
|
|
169
|
+
});
|
|
170
|
+
|
|
145
171
|
// Grid props
|
|
146
|
-
const gridProps = createMemo(() =>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
172
|
+
const gridProps = createMemo(() => {
|
|
173
|
+
const data = getCalendarHookData(state);
|
|
174
|
+
const gridLabel = [data?.ariaLabel, visibleRangeDescription()].filter(Boolean).join(", ");
|
|
175
|
+
|
|
176
|
+
return {
|
|
177
|
+
role: "grid",
|
|
178
|
+
"aria-label": gridLabel || undefined,
|
|
179
|
+
"aria-labelledby": data?.ariaLabelledBy,
|
|
180
|
+
"aria-readonly": state.isReadOnly() || undefined,
|
|
181
|
+
"aria-disabled": state.isDisabled() || undefined,
|
|
182
|
+
"aria-multiselectable": isMultiSelectable() || undefined,
|
|
183
|
+
onFocus: () => state.setFocused(true),
|
|
184
|
+
onBlur: () => state.setFocused(false),
|
|
185
|
+
onKeyDown: handleKeyDown,
|
|
186
|
+
};
|
|
187
|
+
});
|
|
155
188
|
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
|
|
189
|
+
// Column headers are hidden to screen readers to make navigating with a touch
|
|
190
|
+
// screen reader easier — the day names are already included in each cell's
|
|
191
|
+
// label, so there's no need to announce them twice. Consumers render this on
|
|
192
|
+
// <thead>. Mirrors @react-aria/calendar useCalendarGrid headerProps.
|
|
193
|
+
const headerProps = createMemo(() => ({ "aria-hidden": true }));
|
|
159
194
|
|
|
160
195
|
return {
|
|
161
196
|
get gridProps() {
|