@proyecto-viviana/solidaria 0.4.0 → 0.4.2
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 +13 -79
- package/dist/_chunk/actiongroup.js.map +1 -1
- package/dist/_chunk/actiongroup.jsx +13 -79
- package/dist/_chunk/actiongroup.jsx.map +1 -1
- package/dist/_chunk/{live-announcer.js → announce.js} +1 -1
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/{live-announcer.jsx → announce.jsx} +1 -1
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +56 -8
- package/dist/_chunk/autocomplete.js.map +1 -1
- package/dist/_chunk/autocomplete.jsx +56 -8
- package/dist/_chunk/autocomplete.jsx.map +1 -1
- package/dist/_chunk/breadcrumbs.js +6 -4
- package/dist/_chunk/breadcrumbs.js.map +1 -1
- package/dist/_chunk/breadcrumbs.jsx +6 -4
- package/dist/_chunk/breadcrumbs.jsx.map +1 -1
- package/dist/_chunk/button.js +8 -9
- package/dist/_chunk/button.js.map +1 -1
- package/dist/_chunk/button.jsx +8 -9
- package/dist/_chunk/button.jsx.map +1 -1
- package/dist/_chunk/calendar.js +27 -26
- package/dist/_chunk/calendar.js.map +1 -1
- package/dist/_chunk/calendar.jsx +27 -26
- package/dist/_chunk/calendar.jsx.map +1 -1
- package/dist/_chunk/checkbox.js +5 -4
- package/dist/_chunk/checkbox.js.map +1 -1
- package/dist/_chunk/checkbox.jsx +5 -4
- package/dist/_chunk/checkbox.jsx.map +1 -1
- package/dist/_chunk/color.js +302 -18
- package/dist/_chunk/color.js.map +1 -1
- package/dist/_chunk/color.jsx +302 -18
- package/dist/_chunk/color.jsx.map +1 -1
- package/dist/_chunk/combobox.js +638 -12
- package/dist/_chunk/combobox.js.map +1 -1
- package/dist/_chunk/combobox.jsx +638 -12
- package/dist/_chunk/combobox.jsx.map +1 -1
- 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 +3 -171
- package/dist/_chunk/createCollator.js.map +1 -1
- package/dist/_chunk/createCollator.jsx +3 -165
- package/dist/_chunk/createCollator.jsx.map +1 -1
- package/dist/_chunk/createField.js +2 -1
- package/dist/_chunk/createField.js.map +1 -1
- package/dist/_chunk/createField.jsx +2 -1
- package/dist/_chunk/createField.jsx.map +1 -1
- package/dist/_chunk/createFocus.js +12 -8
- package/dist/_chunk/createFocus.js.map +1 -1
- package/dist/_chunk/createFocus.jsx +12 -8
- package/dist/_chunk/createFocus.jsx.map +1 -1
- package/dist/_chunk/createFocusWithin.js +12 -13
- package/dist/_chunk/createFocusWithin.js.map +1 -1
- package/dist/_chunk/createFocusWithin.jsx +12 -13
- package/dist/_chunk/createFocusWithin.jsx.map +1 -1
- package/dist/_chunk/createFocusable.js +3 -3
- package/dist/_chunk/createFocusable.js.map +1 -1
- package/dist/_chunk/createFocusable.jsx +3 -3
- package/dist/_chunk/createFocusable.jsx.map +1 -1
- package/dist/_chunk/{form.js → createFormReset.js} +1 -1
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/{form.jsx → createFormReset.jsx} +1 -1
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createHover.js +2 -1
- package/dist/_chunk/createHover.js.map +1 -1
- package/dist/_chunk/createHover.jsx +2 -1
- package/dist/_chunk/createHover.jsx.map +1 -1
- package/dist/_chunk/createInteractionModality.js +2 -3
- package/dist/_chunk/createInteractionModality.js.map +1 -1
- package/dist/_chunk/createInteractionModality.jsx +2 -3
- package/dist/_chunk/createInteractionModality.jsx.map +1 -1
- package/dist/_chunk/createLabel.js +2 -1
- package/dist/_chunk/createLabel.js.map +1 -1
- package/dist/_chunk/createLabel.jsx +2 -1
- package/dist/_chunk/createLabel.jsx.map +1 -1
- package/dist/_chunk/createLabels.js +3 -2
- package/dist/_chunk/createLabels.js.map +1 -1
- package/dist/_chunk/createLabels.jsx +3 -2
- package/dist/_chunk/createLabels.jsx.map +1 -1
- package/dist/_chunk/createLandmark.js +1 -1
- package/dist/_chunk/createLandmark.jsx +1 -1
- package/dist/_chunk/createProgressBar.js +2 -1
- package/dist/_chunk/createProgressBar.js.map +1 -1
- package/dist/_chunk/createProgressBar.jsx +2 -1
- package/dist/_chunk/createProgressBar.jsx.map +1 -1
- package/dist/_chunk/createSelectableItem.js +7 -3
- package/dist/_chunk/createSelectableItem.js.map +1 -1
- package/dist/_chunk/createSelectableItem.jsx +7 -3
- package/dist/_chunk/createSelectableItem.jsx.map +1 -1
- 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 +5 -4
- package/dist/_chunk/createToggle.js.map +1 -1
- package/dist/_chunk/createToggle.jsx +5 -4
- package/dist/_chunk/createToggle.jsx.map +1 -1
- package/dist/_chunk/datepicker.js +1413 -1100
- package/dist/_chunk/datepicker.js.map +1 -1
- package/dist/_chunk/datepicker.jsx +1413 -1100
- package/dist/_chunk/datepicker.jsx.map +1 -1
- package/dist/_chunk/disclosure.js +2 -2
- package/dist/_chunk/disclosure.js.map +1 -1
- package/dist/_chunk/disclosure.jsx +2 -2
- package/dist/_chunk/disclosure.jsx.map +1 -1
- package/dist/_chunk/dnd.js +1586 -495
- package/dist/_chunk/dnd.js.map +1 -1
- package/dist/_chunk/dnd.jsx +1586 -495
- package/dist/_chunk/dnd.jsx.map +1 -1
- package/dist/_chunk/env.js +1 -19
- package/dist/_chunk/env.js.map +1 -1
- package/dist/_chunk/env.jsx +1 -19
- package/dist/_chunk/env.jsx.map +1 -1
- package/dist/_chunk/focus.js +1 -1
- package/dist/_chunk/focus.js.map +1 -1
- package/dist/_chunk/focus.jsx +1 -1
- package/dist/_chunk/focus.jsx.map +1 -1
- package/dist/_chunk/focus2.js +54 -318
- package/dist/_chunk/focus2.js.map +1 -1
- package/dist/_chunk/focus2.jsx +53 -292
- package/dist/_chunk/focus2.jsx.map +1 -1
- package/dist/_chunk/grid.js +1 -1
- package/dist/_chunk/grid.jsx +1 -1
- package/dist/_chunk/gridlist.js +14 -9
- package/dist/_chunk/gridlist.js.map +1 -1
- package/dist/_chunk/gridlist.jsx +14 -9
- package/dist/_chunk/gridlist.jsx.map +1 -1
- package/dist/_chunk/i18n.js +3 -58
- package/dist/_chunk/i18n.js.map +1 -1
- package/dist/_chunk/i18n.jsx +3 -58
- package/dist/_chunk/i18n.jsx.map +1 -1
- package/dist/_chunk/interactions.js +99 -9
- package/dist/_chunk/interactions.js.map +1 -1
- package/dist/_chunk/interactions.jsx +97 -9
- package/dist/_chunk/interactions.jsx.map +1 -1
- package/dist/_chunk/link.js +2 -1
- package/dist/_chunk/link.js.map +1 -1
- package/dist/_chunk/link.jsx +2 -1
- package/dist/_chunk/link.jsx.map +1 -1
- package/dist/_chunk/listbox.js +42 -10
- package/dist/_chunk/listbox.js.map +1 -1
- package/dist/_chunk/listbox.jsx +42 -10
- package/dist/_chunk/listbox.jsx.map +1 -1
- 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 +5 -4
- package/dist/_chunk/menu.js.map +1 -1
- package/dist/_chunk/menu.jsx +5 -4
- package/dist/_chunk/menu.jsx.map +1 -1
- package/dist/_chunk/numberfield.js +3 -2
- package/dist/_chunk/numberfield.js.map +1 -1
- package/dist/_chunk/numberfield.jsx +3 -2
- package/dist/_chunk/numberfield.jsx.map +1 -1
- package/dist/_chunk/overlays.js +1 -1
- package/dist/_chunk/overlays.jsx +1 -1
- package/dist/_chunk/popover.js +3 -3
- package/dist/_chunk/popover.js.map +1 -1
- package/dist/_chunk/popover.jsx +3 -3
- package/dist/_chunk/popover.jsx.map +1 -1
- package/dist/_chunk/radio.js +7 -6
- package/dist/_chunk/radio.js.map +1 -1
- package/dist/_chunk/radio.jsx +7 -6
- package/dist/_chunk/radio.jsx.map +1 -1
- 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 +2 -1
- package/dist/_chunk/searchfield.js.map +1 -1
- package/dist/_chunk/searchfield.jsx +2 -1
- package/dist/_chunk/searchfield.jsx.map +1 -1
- package/dist/_chunk/select.js +8 -5
- package/dist/_chunk/select.js.map +1 -1
- package/dist/_chunk/select.jsx +8 -5
- package/dist/_chunk/select.jsx.map +1 -1
- package/dist/_chunk/selection.js +8 -21
- package/dist/_chunk/selection.js.map +1 -1
- package/dist/_chunk/selection.jsx +8 -21
- package/dist/_chunk/selection.jsx.map +1 -1
- package/dist/_chunk/separator.js +1 -1
- package/dist/_chunk/separator.jsx +1 -1
- package/dist/_chunk/slider.js +5 -4
- package/dist/_chunk/slider.js.map +1 -1
- package/dist/_chunk/slider.jsx +5 -4
- package/dist/_chunk/slider.jsx.map +1 -1
- 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/table.js +45 -8
- package/dist/_chunk/table.js.map +1 -1
- package/dist/_chunk/table.jsx +45 -8
- package/dist/_chunk/table.jsx.map +1 -1
- package/dist/_chunk/tabs.js +11 -8
- package/dist/_chunk/tabs.js.map +1 -1
- package/dist/_chunk/tabs.jsx +11 -8
- package/dist/_chunk/tabs.jsx.map +1 -1
- package/dist/_chunk/tag.js +54 -18
- package/dist/_chunk/tag.js.map +1 -1
- package/dist/_chunk/tag.jsx +54 -18
- package/dist/_chunk/tag.jsx.map +1 -1
- package/dist/_chunk/textfield.js +2 -1
- package/dist/_chunk/textfield.js.map +1 -1
- package/dist/_chunk/textfield.jsx +2 -1
- package/dist/_chunk/textfield.jsx.map +1 -1
- package/dist/_chunk/toolbar.js +4 -36
- package/dist/_chunk/toolbar.js.map +1 -1
- package/dist/_chunk/toolbar.jsx +4 -36
- package/dist/_chunk/toolbar.jsx.map +1 -1
- package/dist/_chunk/tooltip.js +2 -2
- package/dist/_chunk/tooltip.js.map +1 -1
- package/dist/_chunk/tooltip.jsx +2 -2
- package/dist/_chunk/tooltip.jsx.map +1 -1
- package/dist/_chunk/tree.js +42 -14
- package/dist/_chunk/tree.js.map +1 -1
- package/dist/_chunk/tree.jsx +42 -14
- package/dist/_chunk/tree.jsx.map +1 -1
- package/dist/_chunk/utils.js +59 -19
- package/dist/_chunk/utils.js.map +1 -1
- package/dist/_chunk/utils.jsx +59 -19
- package/dist/_chunk/utils.jsx.map +1 -1
- package/dist/_chunk/visually-hidden.js +3 -2
- package/dist/_chunk/visually-hidden.js.map +1 -1
- package/dist/_chunk/visually-hidden.jsx +3 -2
- package/dist/_chunk/visually-hidden.jsx.map +1 -1
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/autocomplete/createAutocomplete.d.ts +10 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- 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/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/collections/index.js +1 -1
- package/dist/collections/index.jsx +1 -1
- 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/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/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 -2
- package/dist/datepicker/index.jsx +2 -2
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -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 -2
- package/dist/dnd/index.jsx +3 -2
- 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 +5 -0
- 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 -2
- package/dist/focus/index.jsx +3 -2
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/index.js +1 -1
- package/dist/form/index.jsx +1 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/i18n/index.js +4 -2
- package/dist/i18n/index.jsx +4 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.jsx +18 -12
- package/dist/interactions/FocusableProvider.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.map +1 -1
- package/dist/interactions/index.js +1 -2
- package/dist/interactions/index.jsx +1 -2
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +1 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/live-announcer/index.js +1 -1
- package/dist/live-announcer/index.jsx +1 -1
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/selection/createSelectableItem.d.ts.map +1 -1
- package/dist/selection/index.js +2 -1
- package/dist/selection/index.jsx +2 -1
- 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/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/types.d.ts +8 -0
- 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 +1 -0
- package/dist/tabs/createTabs.d.ts.map +1 -1
- 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/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/utils/animation.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -3
- package/dist/utils/index.jsx +4 -3
- package/package.json +2 -2
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +136 -15
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +3 -4
- package/src/calendar/createCalendarCell.ts +17 -3
- package/src/calendar/createCalendarGrid.ts +5 -4
- package/src/calendar/createRangeCalendar.ts +27 -17
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/intl/index.ts +8 -0
- 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 -389
- 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 +487 -373
- 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 +36 -0
- package/src/focus/FocusScope.tsx +120 -12
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/gridlist/createGridList.ts +52 -16
- package/src/index.ts +11 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +5 -3
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +74 -2
- package/src/listbox/createOption.ts +16 -1
- package/src/select/createSelect.ts +23 -2
- package/src/selection/createSelectableItem.ts +14 -0
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/table/createTable.ts +26 -1
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +10 -0
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +8 -0
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +53 -12
- package/src/tag/createTag.ts +21 -32
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toolbar/createToolbar.ts +6 -58
- package/src/tree/createTree.ts +69 -14
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/utils/animation.ts +119 -27
- package/src/utils/dom.ts +3 -2
- package/src/utils/index.ts +2 -0
- package/dist/_chunk/createLongPress.js +0 -91
- package/dist/_chunk/createLongPress.js.map +0 -1
- package/dist/_chunk/createLongPress.jsx +0 -91
- package/dist/_chunk/createLongPress.jsx.map +0 -1
- package/dist/_chunk/form.js.map +0 -1
- package/dist/_chunk/form.jsx.map +0 -1
- package/dist/_chunk/live-announcer.js.map +0 -1
- package/dist/_chunk/live-announcer.jsx.map +0 -1
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* createDatePicker hook for Solidaria
|
|
3
3
|
*
|
|
4
|
-
* Provides the behavior and accessibility implementation for a date picker
|
|
5
|
-
*
|
|
4
|
+
* Provides the behavior and accessibility implementation for a date picker
|
|
5
|
+
* component. Faithful port of @react-aria/datepicker `useDatePicker`.
|
|
6
|
+
*
|
|
7
|
+
* The composed picker does NOT re-implement the segmented field; it hands its
|
|
8
|
+
* `fieldProps` (stamped `[roleSymbol]="presentation"`) to `createDateField`,
|
|
9
|
+
* which is what actually names the segments and publishes the value description
|
|
10
|
+
* through the shared `hookData` WeakMap. Here we only provide:
|
|
11
|
+
* - `groupProps`: a ROLELESS wrapper carrying the outer arrow-navigation
|
|
12
|
+
* (`createDatePickerGroup` with arrow-nav ENABLED — the inner presentation
|
|
13
|
+
* field disables its own and lets the key event bubble up to this handler).
|
|
14
|
+
* - `fieldProps`: the presentation marker + labelledby/describedby + value model.
|
|
15
|
+
* - `buttonProps` / `dialogProps` / `calendarProps` for the trigger + popover.
|
|
6
16
|
*/
|
|
7
17
|
|
|
8
18
|
import { createMemo } from "solid-js";
|
|
9
19
|
import { createId } from "../ssr";
|
|
10
|
-
import {
|
|
20
|
+
import { createField } from "../label/createField";
|
|
21
|
+
import { createDescription } from "../utils/createDescription";
|
|
22
|
+
import { createFocusManager } from "../focus/FocusScope";
|
|
23
|
+
import { createStringFormatter } from "../i18n";
|
|
11
24
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
12
25
|
import { mergeProps } from "../utils/mergeProps";
|
|
13
26
|
import { useLocale } from "../i18n";
|
|
14
27
|
import { createPress } from "../interactions/createPress";
|
|
15
|
-
import {
|
|
28
|
+
import { datePickerStrings } from "./intl";
|
|
29
|
+
import { createDatePickerGroup } from "./createDatePickerGroup";
|
|
30
|
+
import { roleSymbol } from "./createDateField";
|
|
16
31
|
import type { DateFieldState, CalendarState } from "@proyecto-viviana/solid-stately";
|
|
17
32
|
|
|
18
33
|
export interface AriaDatePickerProps {
|
|
@@ -62,10 +77,16 @@ export interface AriaDatePickerProps {
|
|
|
62
77
|
onFocus?: (e: FocusEvent) => void;
|
|
63
78
|
/** Callback when blurred. */
|
|
64
79
|
onBlur?: (e: FocusEvent) => void;
|
|
80
|
+
/** Callback for key down (forwarded to the field when the popover is closed). */
|
|
81
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
82
|
+
/** Callback for key up (forwarded to the field when the popover is closed). */
|
|
83
|
+
onKeyUp?: (e: KeyboardEvent) => void;
|
|
65
84
|
/** The name attribute for form submission. */
|
|
66
85
|
name?: string;
|
|
67
86
|
/** The form attribute. */
|
|
68
87
|
form?: string;
|
|
88
|
+
/** Whether HTML form validation is used. */
|
|
89
|
+
validationBehavior?: "aria" | "native";
|
|
69
90
|
/** Auto focus the field. */
|
|
70
91
|
autoFocus?: boolean;
|
|
71
92
|
/** The placeholder value. */
|
|
@@ -98,6 +119,21 @@ export interface DatePickerAria {
|
|
|
98
119
|
fieldProps: Record<string, unknown>;
|
|
99
120
|
/** Props for the button that opens the calendar. */
|
|
100
121
|
buttonProps: Record<string, unknown>;
|
|
122
|
+
/**
|
|
123
|
+
* Whether the trigger button is currently pressed. Upstream RAC renders the
|
|
124
|
+
* trigger as a `<Button>` whose own `usePress` drives its `data-pressed`
|
|
125
|
+
* paint state; the port owns the press here (see `buttonPress`), so it
|
|
126
|
+
* surfaces the same signal for the button element to emit `data-pressed`.
|
|
127
|
+
*/
|
|
128
|
+
isButtonPressed: () => boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Whether the trigger button is disabled. Upstream RAC's `buttonProps`
|
|
131
|
+
* carries `isDisabled: props.isDisabled || props.isReadOnly` (a read-only
|
|
132
|
+
* picker can't open its calendar), which drives the `<Button>`'s disabled
|
|
133
|
+
* paint. The port's `buttonProps` only reflects `aria-disabled`, so it
|
|
134
|
+
* surfaces the same signal here for the button's render `isDisabled`.
|
|
135
|
+
*/
|
|
136
|
+
isButtonDisabled: () => boolean;
|
|
101
137
|
/** Props for the calendar dialog. */
|
|
102
138
|
dialogProps: Record<string, unknown>;
|
|
103
139
|
/** Props for the calendar. */
|
|
@@ -116,9 +152,6 @@ export interface DatePickerAria {
|
|
|
116
152
|
focusManager: {
|
|
117
153
|
focusFirst: () => void;
|
|
118
154
|
focusLast: () => void;
|
|
119
|
-
} & {
|
|
120
|
-
/** @internal Wires the actual focus implementations from the component layer */
|
|
121
|
-
_register?: (first: () => void, last: () => void) => void;
|
|
122
155
|
};
|
|
123
156
|
}
|
|
124
157
|
|
|
@@ -130,90 +163,106 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
130
163
|
state: T,
|
|
131
164
|
overlayState: DatePickerState,
|
|
132
165
|
_calendarState?: C,
|
|
166
|
+
ref: () => HTMLElement | null = () => null,
|
|
133
167
|
): DatePickerAria {
|
|
134
168
|
const locale = useLocale();
|
|
135
169
|
const getProps = () => access(props);
|
|
136
|
-
const id = createId(getProps().id);
|
|
137
|
-
const descriptionId = createId();
|
|
138
|
-
const errorMessageId = createId();
|
|
139
170
|
const dialogId = createId();
|
|
140
171
|
const buttonId = createId();
|
|
141
172
|
const fieldId = createId();
|
|
142
173
|
|
|
143
|
-
//
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
174
|
+
// Label + description/error-message ids, mirroring upstream `useField`.
|
|
175
|
+
const field = createField(() => {
|
|
176
|
+
const p = getProps();
|
|
177
|
+
const dv = state.displayValidation();
|
|
178
|
+
return {
|
|
179
|
+
id: p.id,
|
|
180
|
+
label: p.label,
|
|
181
|
+
"aria-label": p["aria-label"],
|
|
182
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
183
|
+
"aria-describedby": p["aria-describedby"],
|
|
184
|
+
description: p.description,
|
|
185
|
+
labelElementType: "span",
|
|
186
|
+
isInvalid: p.isInvalid || dv.isInvalid,
|
|
187
|
+
errorMessage: p.errorMessage || dv.validationErrors,
|
|
188
|
+
};
|
|
155
189
|
});
|
|
156
190
|
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
ids.push(p["aria-describedby"]);
|
|
163
|
-
}
|
|
164
|
-
if (valueDescription()) {
|
|
165
|
-
ids.push(valueDescriptionId);
|
|
166
|
-
}
|
|
167
|
-
if (p.description) {
|
|
168
|
-
ids.push(descriptionId);
|
|
169
|
-
}
|
|
170
|
-
if ((p.isInvalid || state.isInvalid()) && p.errorMessage) {
|
|
171
|
-
ids.push(errorMessageId);
|
|
172
|
-
}
|
|
173
|
-
return ids.length > 0 ? ids.join(" ") : undefined;
|
|
191
|
+
// labelledBy = the field label id (or the field id when there is no label),
|
|
192
|
+
// reused by the button and dialog. Mirrors useDatePicker.
|
|
193
|
+
const labelledBy = (): string | undefined => {
|
|
194
|
+
const fp = field.fieldProps as Record<string, string | undefined>;
|
|
195
|
+
return fp["aria-labelledby"] || fp.id;
|
|
174
196
|
};
|
|
175
197
|
|
|
176
|
-
// Selected
|
|
177
|
-
const
|
|
198
|
+
// Selected-date description for screen readers: "Selected Date: February 14, 2025".
|
|
199
|
+
const stringFormatter = createStringFormatter(datePickerStrings, "@react-aria/datepicker");
|
|
178
200
|
const valueDescription = createMemo(() => {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
day: "numeric",
|
|
185
|
-
});
|
|
186
|
-
return formatter.format(v.toDate(getLocalTimeZone()));
|
|
201
|
+
if (!state.value?.()) {
|
|
202
|
+
return "";
|
|
203
|
+
}
|
|
204
|
+
const date = state.formatValue({ month: "long" });
|
|
205
|
+
return date ? stringFormatter().format("selectedDateDescription", { date }) : "";
|
|
187
206
|
});
|
|
207
|
+
const descProps = createDescription(valueDescription);
|
|
188
208
|
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
|
|
209
|
+
// The picker's own describedby = value description + the field's describedby
|
|
210
|
+
// (which already folds in the visible description / error message ids).
|
|
211
|
+
const ariaDescribedBy = (): string | undefined => {
|
|
212
|
+
const fp = field.fieldProps as Record<string, string | undefined>;
|
|
213
|
+
return (
|
|
214
|
+
[descProps["aria-describedby"], fp["aria-describedby"]].filter(Boolean).join(" ") || undefined
|
|
215
|
+
);
|
|
216
|
+
};
|
|
195
217
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
218
|
+
// FieldGroup props. Mirrors RAC `useDatePicker`, whose `groupProps.role` is
|
|
219
|
+
// 'group' (useDatePicker.mjs) — the field label (`aria-labelledby`), describedby
|
|
220
|
+
// (value description + help/error), `aria-disabled`, and the arrow-navigation /
|
|
221
|
+
// press layer all live on this shell. The styled S2 layer OVERRIDES this to
|
|
222
|
+
// role="presentation" at `DatePickerFieldGroup` (S2 seeds its FieldGroup's Group
|
|
223
|
+
// with role="presentation"); keeping the hook faithful to 'group' means a bare
|
|
224
|
+
// RAC-style consumer gets the correct group semantics. The OUTER root stays
|
|
225
|
+
// bare/roleless — putting the describedby on the roleless root would surface a
|
|
226
|
+
// spurious described node in the AX tree that the oracle (bare root) does not
|
|
227
|
+
// have, so it lands on this shell instead. The nested DateInput group is
|
|
228
|
+
// role="presentation" and carries NO aria (createDateField's presentation branch
|
|
229
|
+
// drops it) and lets ArrowLeft/Right bubble up here.
|
|
230
|
+
const outerGroup = createDatePickerGroup(
|
|
231
|
+
{
|
|
232
|
+
setOpen: (isOpen: boolean) => (isOpen ? overlayState.open() : overlayState.close()),
|
|
233
|
+
},
|
|
234
|
+
ref,
|
|
235
|
+
false,
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
const groupProps = createMemo(() =>
|
|
239
|
+
mergeProps(outerGroup(), {
|
|
240
|
+
role: "group" as const,
|
|
241
|
+
"aria-disabled": getProps().isDisabled || undefined,
|
|
242
|
+
"aria-labelledby": labelledBy(),
|
|
243
|
+
"aria-describedby": ariaDescribedBy(),
|
|
244
|
+
onKeyDown(e: KeyboardEvent) {
|
|
245
|
+
if (!overlayState.isOpen) {
|
|
246
|
+
getProps().onKeyDown?.(e);
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
onKeyUp(e: KeyboardEvent) {
|
|
250
|
+
if (!overlayState.isOpen) {
|
|
251
|
+
getProps().onKeyUp?.(e);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
}),
|
|
255
|
+
);
|
|
208
256
|
|
|
209
|
-
// Field props
|
|
257
|
+
// Field props — handed to createDateField, which turns them into the segmented
|
|
258
|
+
// spinbutton group (role="presentation" here) and names the segments.
|
|
210
259
|
const fieldProps = createMemo(() => {
|
|
211
260
|
const p = getProps();
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
return {
|
|
261
|
+
return mergeProps(field.fieldProps as Record<string, unknown>, {
|
|
215
262
|
id: fieldId,
|
|
216
|
-
"
|
|
263
|
+
[roleSymbol]: "presentation",
|
|
264
|
+
"aria-labelledby": labelledBy(),
|
|
265
|
+
"aria-describedby": ariaDescribedBy(),
|
|
217
266
|
value: state.value?.(),
|
|
218
267
|
defaultValue: state.defaultValue,
|
|
219
268
|
onChange: (value: unknown) => {
|
|
@@ -227,17 +276,23 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
227
276
|
isDisabled: p.isDisabled || state.isDisabled(),
|
|
228
277
|
isReadOnly: p.isReadOnly || state.isReadOnly(),
|
|
229
278
|
isRequired: p.isRequired || state.isRequired(),
|
|
279
|
+
validationBehavior: p.validationBehavior,
|
|
230
280
|
autoFocus: p.autoFocus,
|
|
231
281
|
name: p.name,
|
|
232
282
|
form: p.form,
|
|
233
|
-
};
|
|
283
|
+
});
|
|
234
284
|
});
|
|
235
285
|
|
|
236
|
-
//
|
|
286
|
+
// Trigger button. Disabled when the picker is disabled OR read-only (upstream:
|
|
287
|
+
// `isDisabled: props.isDisabled || props.isReadOnly`).
|
|
288
|
+
const isButtonDisabled = () => {
|
|
289
|
+
const p = getProps();
|
|
290
|
+
return p.isDisabled || state.isDisabled() || p.isReadOnly || state.isReadOnly();
|
|
291
|
+
};
|
|
292
|
+
|
|
237
293
|
const buttonPress = createPress({
|
|
238
294
|
get isDisabled() {
|
|
239
|
-
|
|
240
|
-
return p.isDisabled || state.isDisabled();
|
|
295
|
+
return isButtonDisabled();
|
|
241
296
|
},
|
|
242
297
|
onPress: () => {
|
|
243
298
|
overlayState.open();
|
|
@@ -246,41 +301,27 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
246
301
|
|
|
247
302
|
const buttonProps = createMemo(() => {
|
|
248
303
|
const p = getProps();
|
|
249
|
-
const isDisabled = p.isDisabled || state.isDisabled();
|
|
250
|
-
const defaults = getDatePickerLabelDefaults(locale().locale);
|
|
251
|
-
const labelId = (labelProps as Record<string, unknown>)["id"] as string | undefined;
|
|
252
|
-
const labelledBy = labelId ? `${buttonId} ${labelId}` : buttonId;
|
|
253
|
-
const describedBy = getAriaDescribedBy();
|
|
254
|
-
|
|
255
304
|
return mergeProps(buttonPress.pressProps as Record<string, unknown>, {
|
|
256
305
|
id: buttonId,
|
|
257
306
|
type: "button" as const,
|
|
258
|
-
"aria-label": p.buttonAriaLabel ?? defaults.button,
|
|
259
|
-
"aria-labelledby": labelledBy,
|
|
260
307
|
"aria-haspopup": "dialog" as const,
|
|
308
|
+
"aria-label": p.buttonAriaLabel ?? stringFormatter().format("calendar"),
|
|
309
|
+
"aria-labelledby": `${buttonId} ${labelledBy()}`,
|
|
310
|
+
"aria-describedby": ariaDescribedBy(),
|
|
261
311
|
"aria-expanded": overlayState.isOpen,
|
|
262
|
-
"aria-
|
|
263
|
-
"aria-describedby": describedBy,
|
|
264
|
-
"aria-disabled": isDisabled || undefined,
|
|
312
|
+
"aria-disabled": isButtonDisabled() || undefined,
|
|
265
313
|
tabIndex: 0,
|
|
266
314
|
});
|
|
267
315
|
});
|
|
268
316
|
|
|
269
|
-
// Dialog props
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
id: dialogId,
|
|
278
|
-
role: "dialog",
|
|
279
|
-
"aria-modal": true,
|
|
280
|
-
"aria-labelledby": labelledBy,
|
|
281
|
-
"aria-label": p.dialogAriaLabel ?? defaults.dialog,
|
|
282
|
-
};
|
|
283
|
-
});
|
|
317
|
+
// Dialog props. Upstream is only `{id, 'aria-labelledby'}`; the port keeps
|
|
318
|
+
// `role="dialog"` because DatePickerContent spreads these props onto the popover
|
|
319
|
+
// container and this is the only role source there (RAC's Dialog would add it).
|
|
320
|
+
const dialogProps = createMemo(() => ({
|
|
321
|
+
id: dialogId,
|
|
322
|
+
role: "dialog" as const,
|
|
323
|
+
"aria-labelledby": `${buttonId} ${labelledBy()}`,
|
|
324
|
+
}));
|
|
284
325
|
|
|
285
326
|
// Calendar props
|
|
286
327
|
const calendarProps = createMemo(() => {
|
|
@@ -315,48 +356,21 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
315
356
|
};
|
|
316
357
|
});
|
|
317
358
|
|
|
318
|
-
//
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
id: valueDescriptionId,
|
|
326
|
-
"aria-hidden": true,
|
|
327
|
-
}));
|
|
328
|
-
|
|
329
|
-
// Error message props
|
|
330
|
-
const errorMessageProps = createMemo(() => ({
|
|
331
|
-
id: errorMessageId,
|
|
332
|
-
role: "alert",
|
|
359
|
+
// Label click focuses the first segment.
|
|
360
|
+
const labelFocusManager = createFocusManager(ref);
|
|
361
|
+
const enhancedLabelProps = createMemo(() => ({
|
|
362
|
+
...(field.labelProps as Record<string, unknown>),
|
|
363
|
+
onClick: () => {
|
|
364
|
+
labelFocusManager.focusFirst();
|
|
365
|
+
},
|
|
333
366
|
}));
|
|
334
367
|
|
|
335
|
-
// Label click focuses first segment — component layer wires the actual ref
|
|
336
|
-
let focusFirstSegment: (() => void) | undefined;
|
|
337
|
-
let focusLastSegment: (() => void) | undefined;
|
|
338
|
-
|
|
339
|
-
const enhancedLabelProps = createMemo(() => {
|
|
340
|
-
return {
|
|
341
|
-
...labelProps,
|
|
342
|
-
onClick: () => {
|
|
343
|
-
focusFirstSegment?.();
|
|
344
|
-
},
|
|
345
|
-
};
|
|
346
|
-
});
|
|
347
|
-
|
|
348
368
|
const isInvalid = createMemo(() => {
|
|
349
369
|
const p = getProps();
|
|
350
370
|
return p.isInvalid || state.isInvalid();
|
|
351
371
|
});
|
|
352
372
|
|
|
353
|
-
const validationErrors = createMemo(() =>
|
|
354
|
-
const p = getProps();
|
|
355
|
-
if (p.isInvalid && typeof p.errorMessage === "string") {
|
|
356
|
-
return [p.errorMessage];
|
|
357
|
-
}
|
|
358
|
-
return [];
|
|
359
|
-
});
|
|
373
|
+
const validationErrors = createMemo(() => state.displayValidation().validationErrors);
|
|
360
374
|
|
|
361
375
|
const validationDetails = createMemo(() => {
|
|
362
376
|
const p = getProps();
|
|
@@ -381,6 +395,8 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
381
395
|
get buttonProps() {
|
|
382
396
|
return buttonProps();
|
|
383
397
|
},
|
|
398
|
+
isButtonPressed: () => buttonPress.isPressed(),
|
|
399
|
+
isButtonDisabled: () => isButtonDisabled(),
|
|
384
400
|
get dialogProps() {
|
|
385
401
|
return dialogProps();
|
|
386
402
|
},
|
|
@@ -388,10 +404,10 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
388
404
|
return calendarProps();
|
|
389
405
|
},
|
|
390
406
|
get descriptionProps() {
|
|
391
|
-
return descriptionProps
|
|
407
|
+
return field.descriptionProps as Record<string, unknown>;
|
|
392
408
|
},
|
|
393
409
|
get errorMessageProps() {
|
|
394
|
-
return errorMessageProps
|
|
410
|
+
return field.errorMessageProps as Record<string, unknown>;
|
|
395
411
|
},
|
|
396
412
|
get isInvalid() {
|
|
397
413
|
return isInvalid();
|
|
@@ -403,13 +419,8 @@ export function createDatePicker<T extends DateFieldState, C extends CalendarSta
|
|
|
403
419
|
return validationDetails();
|
|
404
420
|
},
|
|
405
421
|
focusManager: {
|
|
406
|
-
focusFirst: () =>
|
|
407
|
-
focusLast: () =>
|
|
408
|
-
/** @internal Wires the actual focus implementations from the component layer */
|
|
409
|
-
_register: (first: () => void, last: () => void) => {
|
|
410
|
-
focusFirstSegment = first;
|
|
411
|
-
focusLastSegment = last;
|
|
412
|
-
},
|
|
422
|
+
focusFirst: () => labelFocusManager.focusFirst(),
|
|
423
|
+
focusLast: () => labelFocusManager.focusLast(),
|
|
413
424
|
},
|
|
414
425
|
};
|
|
415
426
|
}
|
|
@@ -1,149 +1,155 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* createDatePickerGroup hook for Solidaria
|
|
3
3
|
*
|
|
4
|
-
* Provides keyboard
|
|
5
|
-
*
|
|
4
|
+
* Provides keyboard (arrow navigation between segments) and pointer (focus the
|
|
5
|
+
* last non-placeholder segment on press) behavior for the date field group.
|
|
6
|
+
* Faithful port of @react-aria/datepicker `useDatePickerGroup`: LTR arrow
|
|
7
|
+
* navigation goes through the focus manager, RTL uses geometric segment lookup,
|
|
8
|
+
* and alt+ArrowDown/Up opens the popover only when the state exposes `setOpen`
|
|
9
|
+
* (i.e. a date picker, never a standalone field).
|
|
6
10
|
*/
|
|
7
11
|
|
|
8
|
-
import { createMemo } from "solid-js";
|
|
9
|
-
import { type MaybeAccessor, access } from "../utils/reactivity";
|
|
12
|
+
import { createMemo, type Accessor } from "solid-js";
|
|
10
13
|
import { mergeProps } from "../utils/mergeProps";
|
|
11
14
|
import { useLocale } from "../i18n";
|
|
12
15
|
import { createPress } from "../interactions/createPress";
|
|
16
|
+
import { createFocusManager } from "../focus/FocusScope";
|
|
17
|
+
import { getFocusableTreeWalker } from "../utils/dom";
|
|
13
18
|
import { nodeContains, getEventTarget } from "../utils";
|
|
14
|
-
import { focusSafely } from "../utils/focus";
|
|
15
19
|
|
|
16
|
-
export interface
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface DatePickerGroupAria {
|
|
21
|
-
groupProps: Record<string, unknown>;
|
|
20
|
+
export interface DatePickerGroupState {
|
|
21
|
+
setOpen?: (isOpen: boolean) => void;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Provides keyboard and pointer behavior for the date field/picker segment group.
|
|
26
|
+
*/
|
|
24
27
|
export function createDatePickerGroup(
|
|
25
|
-
|
|
26
|
-
state: { setOpen: (isOpen: boolean) => void; isOpen: boolean; isDisabled: () => boolean },
|
|
28
|
+
state: DatePickerGroupState,
|
|
27
29
|
ref: () => HTMLElement | null,
|
|
28
30
|
disableArrowNavigation?: boolean,
|
|
29
|
-
):
|
|
30
|
-
const
|
|
31
|
-
const
|
|
31
|
+
): Accessor<Record<string, unknown>> {
|
|
32
|
+
const localeInfo = useLocale();
|
|
33
|
+
const focusManager = createFocusManager(ref);
|
|
34
|
+
|
|
35
|
+
// Geometric segment lookup for RTL, where DOM order does not match visual order.
|
|
36
|
+
const findNextSegment = (group: HTMLElement, fromX: number, direction: number): HTMLElement | null => {
|
|
37
|
+
const walker = getFocusableTreeWalker(group, { tabbable: true });
|
|
38
|
+
let node = walker.nextNode() as HTMLElement | null;
|
|
39
|
+
let closest: HTMLElement | null = null;
|
|
40
|
+
let closestDistance = Infinity;
|
|
41
|
+
while (node) {
|
|
42
|
+
const x = node.getBoundingClientRect().left;
|
|
43
|
+
const distance = x - fromX;
|
|
44
|
+
const absoluteDistance = Math.abs(distance);
|
|
45
|
+
if (Math.sign(distance) === direction && absoluteDistance < closestDistance) {
|
|
46
|
+
closest = node;
|
|
47
|
+
closestDistance = absoluteDistance;
|
|
48
|
+
}
|
|
49
|
+
node = walker.nextNode() as HTMLElement | null;
|
|
50
|
+
}
|
|
51
|
+
return closest;
|
|
52
|
+
};
|
|
32
53
|
|
|
33
54
|
const onKeyDown = (e: KeyboardEvent) => {
|
|
34
55
|
if (!nodeContains(e.currentTarget as Node | null, getEventTarget(e) as Node | null)) {
|
|
35
56
|
return;
|
|
36
57
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
58
|
+
// Open the popover on alt + arrow down (date pickers only).
|
|
59
|
+
if (e.altKey && (e.key === "ArrowDown" || e.key === "ArrowUp") && "setOpen" in state) {
|
|
40
60
|
e.preventDefault();
|
|
41
61
|
e.stopPropagation();
|
|
42
|
-
state.setOpen(true);
|
|
43
|
-
return;
|
|
62
|
+
state.setOpen?.(true);
|
|
44
63
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const root = ref();
|
|
49
|
-
if (!root) return;
|
|
50
|
-
|
|
51
|
-
const segments = Array.from(root.querySelectorAll('[role="spinbutton"]')) as HTMLElement[];
|
|
52
|
-
if (segments.length === 0) return;
|
|
53
|
-
|
|
54
|
-
const activeElement = root.ownerDocument.activeElement;
|
|
55
|
-
let currentIndex = -1;
|
|
56
|
-
if (activeElement) {
|
|
57
|
-
currentIndex = segments.indexOf(activeElement as HTMLElement);
|
|
64
|
+
if (disableArrowNavigation) {
|
|
65
|
+
return;
|
|
58
66
|
}
|
|
59
|
-
|
|
60
|
-
const direction = locale().direction;
|
|
61
|
-
|
|
67
|
+
const direction = localeInfo().direction;
|
|
62
68
|
switch (e.key) {
|
|
63
69
|
case "ArrowLeft": {
|
|
64
70
|
e.preventDefault();
|
|
65
71
|
e.stopPropagation();
|
|
72
|
+
const root = ref();
|
|
66
73
|
if (direction === "rtl") {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
74
|
+
if (root) {
|
|
75
|
+
const target = getEventTarget(e) as HTMLElement;
|
|
76
|
+
const prev = findNextSegment(root, target.getBoundingClientRect().left, -1);
|
|
77
|
+
prev?.focus();
|
|
71
78
|
}
|
|
72
79
|
} else {
|
|
73
|
-
|
|
74
|
-
if (prevIndex >= 0) {
|
|
75
|
-
focusSafely(segments[prevIndex]);
|
|
76
|
-
}
|
|
80
|
+
focusManager.focusPrevious();
|
|
77
81
|
}
|
|
78
82
|
break;
|
|
79
83
|
}
|
|
80
84
|
case "ArrowRight": {
|
|
81
85
|
e.preventDefault();
|
|
82
86
|
e.stopPropagation();
|
|
87
|
+
const root = ref();
|
|
83
88
|
if (direction === "rtl") {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
if (root) {
|
|
90
|
+
const target = getEventTarget(e) as HTMLElement;
|
|
91
|
+
const next = findNextSegment(root, target.getBoundingClientRect().left, 1);
|
|
92
|
+
next?.focus();
|
|
88
93
|
}
|
|
89
94
|
} else {
|
|
90
|
-
|
|
91
|
-
if (nextIndex < segments.length) {
|
|
92
|
-
focusSafely(segments[nextIndex]);
|
|
93
|
-
}
|
|
95
|
+
focusManager.focusNext();
|
|
94
96
|
}
|
|
95
97
|
break;
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
100
|
};
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
// Focus the last non-placeholder segment on press within the field.
|
|
103
|
+
const focusLast = () => {
|
|
101
104
|
const root = ref();
|
|
102
|
-
if (!root)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
if (!root) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
// Try to find the segment prior to the element that was clicked on.
|
|
109
|
+
let target = (typeof window !== "undefined" ? (window.event as Event | undefined)?.target : null) as
|
|
110
|
+
| HTMLElement
|
|
111
|
+
| null;
|
|
112
|
+
const walker = getFocusableTreeWalker(root, { tabbable: true });
|
|
110
113
|
if (target) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
startIndex = targetIndex;
|
|
114
|
-
}
|
|
114
|
+
walker.currentNode = target;
|
|
115
|
+
target = walker.previousNode() as HTMLElement | null;
|
|
115
116
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
// If no target found, find the last element from the end.
|
|
118
|
+
if (!target) {
|
|
119
|
+
let last: Node | null;
|
|
120
|
+
do {
|
|
121
|
+
last = walker.lastChild();
|
|
122
|
+
if (last) {
|
|
123
|
+
target = last as HTMLElement;
|
|
124
|
+
}
|
|
125
|
+
} while (last);
|
|
126
|
+
}
|
|
127
|
+
// Now go backwards until we find an element that is not a placeholder.
|
|
128
|
+
while (target?.hasAttribute("data-placeholder")) {
|
|
129
|
+
const prev = walker.previousNode() as HTMLElement | null;
|
|
130
|
+
if (prev && prev.hasAttribute("data-placeholder")) {
|
|
131
|
+
target = prev;
|
|
132
|
+
} else {
|
|
133
|
+
break;
|
|
122
134
|
}
|
|
123
135
|
}
|
|
136
|
+
target?.focus();
|
|
124
137
|
};
|
|
125
138
|
|
|
126
139
|
const { pressProps } = createPress({
|
|
127
|
-
isDisabled: () => resolvedProps().isDisabled || state.isDisabled(),
|
|
128
140
|
preventFocusOnPress: true,
|
|
129
141
|
allowTextSelectionOnPress: true,
|
|
130
142
|
onPressStart(e) {
|
|
131
143
|
if (e.pointerType === "mouse") {
|
|
132
|
-
focusLast(
|
|
144
|
+
focusLast();
|
|
133
145
|
}
|
|
134
146
|
},
|
|
135
147
|
onPress(e) {
|
|
136
148
|
if (e.pointerType === "touch" || e.pointerType === "pen") {
|
|
137
|
-
focusLast(
|
|
149
|
+
focusLast();
|
|
138
150
|
}
|
|
139
151
|
},
|
|
140
152
|
});
|
|
141
153
|
|
|
142
|
-
return {
|
|
143
|
-
get groupProps() {
|
|
144
|
-
return mergeProps(pressProps, {
|
|
145
|
-
onKeyDown,
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
};
|
|
154
|
+
return createMemo(() => mergeProps(pressProps, { onKeyDown }));
|
|
149
155
|
}
|