@proyecto-viviana/solidaria 0.4.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 +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,16 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* createDateRangePicker hook for Solidaria
|
|
3
3
|
*
|
|
4
|
-
* Provides behavior and accessibility wiring for range date pickers.
|
|
5
|
-
*
|
|
4
|
+
* Provides behavior and accessibility wiring for range date pickers. Faithful
|
|
5
|
+
* port of @react-aria/datepicker `useDateRangePicker`.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the composed `createDatePicker`: the range picker does NOT re-implement
|
|
8
|
+
* the two segmented fields. It hands each field its own field props (stamped
|
|
9
|
+
* `[roleSymbol]="presentation"` + a SHARED `[focusManagerSymbol]` so arrow keys
|
|
10
|
+
* and auto-advance walk across BOTH fields) to `createDateField`, which is what
|
|
11
|
+
* names the segments ("month, Start Date" / "month, End Date") and publishes them
|
|
12
|
+
* through the shared `hookData` WeakMap. Here we only provide:
|
|
13
|
+
* - `groupProps`: the labelled `role="group"` shell carrying the OUTER
|
|
14
|
+
* arrow-navigation (`createDatePickerGroup` with arrow-nav ENABLED — each inner
|
|
15
|
+
* presentation field disables its own and lets the key event bubble up here).
|
|
16
|
+
* The styled S2 layer overrides this to `role="presentation"`; the roleless
|
|
17
|
+
* root stays bare.
|
|
18
|
+
* - `startFieldProps` / `endFieldProps`: the presentation markers + shared focus
|
|
19
|
+
* manager + start/end labels, handed to `createDateField`.
|
|
20
|
+
* - `buttonProps` / `dialogProps` / `calendarProps` for the trigger + popover.
|
|
6
21
|
*/
|
|
7
22
|
|
|
8
23
|
import { createMemo } from "solid-js";
|
|
9
24
|
import { createId } from "../ssr";
|
|
10
|
-
import {
|
|
25
|
+
import { createField } from "../label/createField";
|
|
26
|
+
import { createDescription } from "../utils/createDescription";
|
|
27
|
+
import { createFocusManager } from "../focus/FocusScope";
|
|
28
|
+
import { createStringFormatter } from "../i18n";
|
|
29
|
+
import { useLocale } from "../i18n";
|
|
11
30
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
12
31
|
import { mergeProps } from "../utils/mergeProps";
|
|
13
|
-
import {
|
|
32
|
+
import { createPress } from "../interactions/createPress";
|
|
33
|
+
import { datePickerStrings } from "./intl";
|
|
34
|
+
import { createDatePickerGroup } from "./createDatePickerGroup";
|
|
35
|
+
import { roleSymbol, focusManagerSymbol } from "./createDateField";
|
|
14
36
|
import type { RangeCalendarState } from "@proyecto-viviana/solid-stately";
|
|
15
37
|
import type { DatePickerState } from "./createDatePicker";
|
|
16
38
|
|
|
@@ -26,214 +48,268 @@ export interface AriaDateRangePickerProps {
|
|
|
26
48
|
isInvalid?: boolean;
|
|
27
49
|
description?: string;
|
|
28
50
|
errorMessage?: string;
|
|
51
|
+
/** Accessible label for the calendar trigger button. */
|
|
29
52
|
buttonAriaLabel?: string;
|
|
53
|
+
/** Accessible label for the calendar dialog. */
|
|
30
54
|
dialogAriaLabel?: string;
|
|
55
|
+
/** Accessible label for the calendar grid region. */
|
|
31
56
|
calendarAriaLabel?: string;
|
|
32
|
-
|
|
33
|
-
|
|
57
|
+
/** The `name` attribute for the start date's hidden form input. */
|
|
58
|
+
startName?: string;
|
|
59
|
+
/** The `name` attribute for the end date's hidden form input. */
|
|
60
|
+
endName?: string;
|
|
61
|
+
/** The `<form>` the hidden inputs are associated with. */
|
|
62
|
+
form?: string;
|
|
63
|
+
/** Whether HTML form validation is used. */
|
|
64
|
+
validationBehavior?: "aria" | "native";
|
|
65
|
+
/** Auto focus the start field. */
|
|
66
|
+
autoFocus?: boolean;
|
|
67
|
+
/** Callback for key down (forwarded when the popover is closed). */
|
|
68
|
+
onKeyDown?: (e: KeyboardEvent) => void;
|
|
69
|
+
/** Callback for key up (forwarded when the popover is closed). */
|
|
70
|
+
onKeyUp?: (e: KeyboardEvent) => void;
|
|
34
71
|
}
|
|
35
72
|
|
|
36
73
|
export interface DateRangePickerAria {
|
|
74
|
+
/** Props for the labelled group shell (S2 overrides to role="presentation"). */
|
|
37
75
|
groupProps: Record<string, unknown>;
|
|
76
|
+
/** Props for the label element. */
|
|
38
77
|
labelProps: Record<string, unknown>;
|
|
78
|
+
/** Field props for the start date field — handed to createDateField. */
|
|
39
79
|
startFieldProps: Record<string, unknown>;
|
|
80
|
+
/** Field props for the end date field — handed to createDateField. */
|
|
40
81
|
endFieldProps: Record<string, unknown>;
|
|
41
|
-
|
|
42
|
-
endInputProps: Record<string, unknown>;
|
|
82
|
+
/** Props for the button that opens the calendar. */
|
|
43
83
|
buttonProps: Record<string, unknown>;
|
|
84
|
+
/** Whether the trigger button is currently pressed. */
|
|
85
|
+
isButtonPressed: () => boolean;
|
|
86
|
+
/** Whether the trigger button is disabled (picker disabled OR read-only). */
|
|
87
|
+
isButtonDisabled: () => boolean;
|
|
88
|
+
/** Props for the calendar dialog. */
|
|
44
89
|
dialogProps: Record<string, unknown>;
|
|
90
|
+
/** Props for the calendar. */
|
|
45
91
|
calendarProps: Record<string, unknown>;
|
|
92
|
+
/** Props for the description element. */
|
|
46
93
|
descriptionProps: Record<string, unknown>;
|
|
94
|
+
/** Props for the error message element. */
|
|
47
95
|
errorMessageProps: Record<string, unknown>;
|
|
96
|
+
/** Whether the picker is invalid. */
|
|
97
|
+
isInvalid: boolean;
|
|
98
|
+
/** Focus manager for programmatic segment focus (shared across both fields). */
|
|
99
|
+
focusManager: {
|
|
100
|
+
focusFirst: () => void;
|
|
101
|
+
focusLast: () => void;
|
|
102
|
+
};
|
|
48
103
|
}
|
|
49
104
|
|
|
50
105
|
export function createDateRangePicker<T extends RangeCalendarState>(
|
|
51
106
|
props: MaybeAccessor<AriaDateRangePickerProps>,
|
|
52
107
|
state: T,
|
|
53
108
|
overlayState: DatePickerState,
|
|
109
|
+
ref: () => HTMLElement | null = () => null,
|
|
54
110
|
): DateRangePickerAria {
|
|
55
|
-
const locale = useLocale();
|
|
56
111
|
const getProps = () => access(props);
|
|
57
|
-
const
|
|
112
|
+
const buttonId = createId();
|
|
113
|
+
const dialogId = createId();
|
|
58
114
|
const startFieldId = createId();
|
|
59
115
|
const endFieldId = createId();
|
|
60
|
-
const descriptionId = createId();
|
|
61
|
-
const errorMessageId = createId();
|
|
62
|
-
const dialogId = createId();
|
|
63
116
|
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
return getProps().label;
|
|
67
|
-
},
|
|
68
|
-
get "aria-label"() {
|
|
69
|
-
return getProps()["aria-label"];
|
|
70
|
-
},
|
|
71
|
-
get "aria-labelledby"() {
|
|
72
|
-
return getProps()["aria-labelledby"];
|
|
73
|
-
},
|
|
74
|
-
labelElementType: "span",
|
|
75
|
-
});
|
|
117
|
+
const stringFormatter = createStringFormatter(datePickerStrings, "@react-aria/datepicker");
|
|
118
|
+
const locale = useLocale();
|
|
76
119
|
|
|
77
|
-
|
|
120
|
+
// Label + description/error-message ids, mirroring upstream `useField`.
|
|
121
|
+
const field = createField(() => {
|
|
78
122
|
const p = getProps();
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
123
|
+
return {
|
|
124
|
+
id: p.id,
|
|
125
|
+
label: p.label,
|
|
126
|
+
"aria-label": p["aria-label"],
|
|
127
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
128
|
+
"aria-describedby": p["aria-describedby"],
|
|
129
|
+
description: p.description,
|
|
130
|
+
labelElementType: "span",
|
|
131
|
+
isInvalid: p.isInvalid,
|
|
132
|
+
errorMessage: p.errorMessage,
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// labelledBy = the field label id (or the field id when there is no label),
|
|
137
|
+
// reused by the fields, button and dialog. Mirrors useDateRangePicker.
|
|
138
|
+
const labelledBy = (): string | undefined => {
|
|
139
|
+
const fp = field.fieldProps as Record<string, string | undefined>;
|
|
140
|
+
return fp["aria-labelledby"] || fp.id;
|
|
84
141
|
};
|
|
85
142
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
143
|
+
// Selected-range description for screen readers:
|
|
144
|
+
// "Selected Range: February 3 to 14, 2025". Mirrors useDateRangePicker, which
|
|
145
|
+
// formats the range with `{month: 'long'}` and folds the hidden description id
|
|
146
|
+
// ahead of the visible describedby.
|
|
147
|
+
const valueDescription = createMemo(() => {
|
|
148
|
+
const range = state.formatValue(locale().locale, { month: "long" });
|
|
149
|
+
return range
|
|
150
|
+
? stringFormatter().format("selectedRangeDescription", {
|
|
151
|
+
startDate: range.start,
|
|
152
|
+
endDate: range.end,
|
|
153
|
+
})
|
|
154
|
+
: "";
|
|
98
155
|
});
|
|
156
|
+
const descProps = createDescription(valueDescription);
|
|
99
157
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
158
|
+
// The picker's own describedby = value description + the field's describedby
|
|
159
|
+
// (visible description / error message ids folded in by createField).
|
|
160
|
+
const ariaDescribedBy = (): string | undefined => {
|
|
161
|
+
const fp = field.fieldProps as Record<string, string | undefined>;
|
|
162
|
+
return (
|
|
163
|
+
[descProps["aria-describedby"], fp["aria-describedby"]].filter(Boolean).join(" ") || undefined
|
|
164
|
+
);
|
|
165
|
+
};
|
|
106
166
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
167
|
+
// Shared focus manager scoped to the whole group element, handed to BOTH fields
|
|
168
|
+
// via focusManagerSymbol so auto-advance and programmatic focus (label click,
|
|
169
|
+
// autoFocus) walk across the start/end field boundary.
|
|
170
|
+
const sharedFocusManager = createFocusManager(ref);
|
|
171
|
+
|
|
172
|
+
// FieldGroup shell. Faithful to useDateRangePicker `groupProps.role === 'group'`;
|
|
173
|
+
// the label association, describedby, `aria-disabled` and the arrow-navigation /
|
|
174
|
+
// press layer live here. The styled S2 layer OVERRIDES this to role="presentation".
|
|
175
|
+
const outerGroup = createDatePickerGroup(
|
|
176
|
+
{
|
|
177
|
+
setOpen: (isOpen: boolean) => (isOpen ? overlayState.open() : overlayState.close()),
|
|
178
|
+
},
|
|
179
|
+
ref,
|
|
180
|
+
false,
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
const groupProps = createMemo(() =>
|
|
184
|
+
mergeProps(outerGroup(), {
|
|
185
|
+
role: "group" as const,
|
|
186
|
+
"aria-disabled": getProps().isDisabled || undefined,
|
|
187
|
+
"aria-labelledby": labelledBy(),
|
|
188
|
+
"aria-describedby": ariaDescribedBy(),
|
|
189
|
+
onKeyDown(e: KeyboardEvent) {
|
|
190
|
+
if (!overlayState.isOpen) {
|
|
191
|
+
getProps().onKeyDown?.(e);
|
|
118
192
|
}
|
|
119
193
|
},
|
|
120
|
-
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
event.preventDefault();
|
|
124
|
-
overlayState.open();
|
|
194
|
+
onKeyUp(e: KeyboardEvent) {
|
|
195
|
+
if (!overlayState.isOpen) {
|
|
196
|
+
getProps().onKeyUp?.(e);
|
|
125
197
|
}
|
|
126
198
|
},
|
|
127
|
-
}
|
|
128
|
-
|
|
199
|
+
}),
|
|
200
|
+
);
|
|
129
201
|
|
|
130
|
-
|
|
202
|
+
// Props shared by both fields: presentation marker + the shared focus manager +
|
|
203
|
+
// validation flags. Display options (granularity/hourCycle/…) live on the field
|
|
204
|
+
// STATE (createDateFieldState), so they are not repeated here.
|
|
205
|
+
const commonFieldProps = () => {
|
|
131
206
|
const p = getProps();
|
|
132
|
-
const defaults = getDateRangePickerLabelDefaults(locale().locale);
|
|
133
|
-
const isDisabled = p.isDisabled || state.isDisabled();
|
|
134
|
-
const isReadOnly = p.isReadOnly || state.isReadOnly();
|
|
135
|
-
const isInvalid = p.isInvalid;
|
|
136
|
-
|
|
137
207
|
return {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"aria-
|
|
141
|
-
"aria-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
overlayState.open();
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
onKeyDown: (event: KeyboardEvent) => {
|
|
151
|
-
if (isDisabled) return;
|
|
152
|
-
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
153
|
-
event.preventDefault();
|
|
154
|
-
overlayState.open();
|
|
155
|
-
}
|
|
156
|
-
},
|
|
208
|
+
[roleSymbol]: "presentation",
|
|
209
|
+
[focusManagerSymbol]: sharedFocusManager,
|
|
210
|
+
"aria-labelledby": labelledBy(),
|
|
211
|
+
"aria-describedby": ariaDescribedBy(),
|
|
212
|
+
isDisabled: p.isDisabled || state.isDisabled(),
|
|
213
|
+
isReadOnly: p.isReadOnly || state.isReadOnly(),
|
|
214
|
+
isRequired: p.isRequired,
|
|
215
|
+
validationBehavior: p.validationBehavior,
|
|
216
|
+
form: p.form,
|
|
157
217
|
};
|
|
158
|
-
}
|
|
218
|
+
};
|
|
159
219
|
|
|
160
|
-
const
|
|
220
|
+
const startFieldProps = createMemo(() => {
|
|
161
221
|
const p = getProps();
|
|
162
|
-
|
|
163
|
-
const isDisabled = p.isDisabled || state.isDisabled();
|
|
164
|
-
const isReadOnly = p.isReadOnly || state.isReadOnly();
|
|
165
|
-
const isInvalid = p.isInvalid;
|
|
166
|
-
|
|
167
|
-
return {
|
|
222
|
+
return mergeProps(commonFieldProps() as Record<string, unknown>, {
|
|
168
223
|
id: startFieldId,
|
|
169
|
-
"aria-label":
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
"aria-invalid": isInvalid || undefined,
|
|
174
|
-
};
|
|
224
|
+
"aria-label": stringFormatter().format("startDate"),
|
|
225
|
+
autoFocus: p.autoFocus,
|
|
226
|
+
name: p.startName,
|
|
227
|
+
});
|
|
175
228
|
});
|
|
176
229
|
|
|
177
|
-
const
|
|
230
|
+
const endFieldProps = createMemo(() => {
|
|
178
231
|
const p = getProps();
|
|
179
|
-
|
|
180
|
-
const isDisabled = p.isDisabled || state.isDisabled();
|
|
181
|
-
const isReadOnly = p.isReadOnly || state.isReadOnly();
|
|
182
|
-
const isInvalid = p.isInvalid;
|
|
183
|
-
|
|
184
|
-
return {
|
|
232
|
+
return mergeProps(commonFieldProps() as Record<string, unknown>, {
|
|
185
233
|
id: endFieldId,
|
|
186
|
-
"aria-label":
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
234
|
+
"aria-label": stringFormatter().format("endDate"),
|
|
235
|
+
name: p.endName,
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// Trigger button. Disabled when the picker is disabled OR read-only.
|
|
240
|
+
const isButtonDisabled = () => {
|
|
241
|
+
const p = getProps();
|
|
242
|
+
return p.isDisabled || state.isDisabled() || p.isReadOnly || state.isReadOnly();
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
const buttonPress = createPress({
|
|
246
|
+
get isDisabled() {
|
|
247
|
+
return isButtonDisabled();
|
|
248
|
+
},
|
|
249
|
+
onPress: () => {
|
|
250
|
+
overlayState.open();
|
|
251
|
+
},
|
|
192
252
|
});
|
|
193
253
|
|
|
194
254
|
const buttonProps = createMemo(() => {
|
|
195
255
|
const p = getProps();
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"aria-label": p.buttonAriaLabel ?? defaults.button,
|
|
256
|
+
return mergeProps(buttonPress.pressProps as Record<string, unknown>, {
|
|
257
|
+
id: buttonId,
|
|
258
|
+
type: "button" as const,
|
|
200
259
|
"aria-haspopup": "dialog" as const,
|
|
260
|
+
"aria-label": p.buttonAriaLabel ?? stringFormatter().format("calendar"),
|
|
261
|
+
"aria-labelledby": `${buttonId} ${labelledBy()}`,
|
|
262
|
+
"aria-describedby": ariaDescribedBy(),
|
|
201
263
|
"aria-expanded": overlayState.isOpen,
|
|
202
|
-
"aria-
|
|
203
|
-
disabled: isDisabled,
|
|
264
|
+
"aria-disabled": isButtonDisabled() || undefined,
|
|
204
265
|
tabIndex: 0,
|
|
205
|
-
|
|
206
|
-
if (!isDisabled) overlayState.toggle();
|
|
207
|
-
},
|
|
208
|
-
};
|
|
266
|
+
});
|
|
209
267
|
});
|
|
210
268
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
});
|
|
269
|
+
// Dialog props. Upstream is only `{id, 'aria-labelledby'}`; the port keeps
|
|
270
|
+
// `role="dialog"` because DateRangePickerContent spreads these onto the popover
|
|
271
|
+
// container and this is the only role source there (RAC's Dialog would add it).
|
|
272
|
+
const dialogProps = createMemo(() => ({
|
|
273
|
+
id: dialogId,
|
|
274
|
+
role: "dialog" as const,
|
|
275
|
+
"aria-labelledby": `${buttonId} ${labelledBy()}`,
|
|
276
|
+
}));
|
|
220
277
|
|
|
278
|
+
// Calendar props. Faithful to useDateRangePicker (NO aria-label upstream); a
|
|
279
|
+
// provided calendar/dialog aria-label is threaded through for parity with the
|
|
280
|
+
// styled escape hatches. Largely vestigial in the port — the popover
|
|
281
|
+
// RangeCalendar reads its state through RangeCalendarContext directly.
|
|
221
282
|
const calendarProps = createMemo(() => {
|
|
222
|
-
const
|
|
283
|
+
const p = getProps();
|
|
284
|
+
const label = p.calendarAriaLabel ?? p.dialogAriaLabel;
|
|
223
285
|
return {
|
|
224
|
-
|
|
286
|
+
autoFocus: true,
|
|
287
|
+
value: state.value(),
|
|
288
|
+
minValue: undefined,
|
|
289
|
+
maxValue: undefined,
|
|
290
|
+
isDisabled: p.isDisabled || state.isDisabled(),
|
|
291
|
+
isReadOnly: p.isReadOnly || state.isReadOnly(),
|
|
292
|
+
isInvalid: p.isInvalid,
|
|
293
|
+
...(label ? { "aria-label": label } : {}),
|
|
225
294
|
};
|
|
226
295
|
});
|
|
227
296
|
|
|
228
|
-
|
|
229
|
-
const
|
|
297
|
+
// Label click focuses the first segment (of the start field).
|
|
298
|
+
const enhancedLabelProps = createMemo(() => ({
|
|
299
|
+
...(field.labelProps as Record<string, unknown>),
|
|
300
|
+
onClick: () => {
|
|
301
|
+
sharedFocusManager.focusFirst();
|
|
302
|
+
},
|
|
303
|
+
}));
|
|
304
|
+
|
|
305
|
+
const isInvalid = createMemo(() => Boolean(getProps().isInvalid));
|
|
230
306
|
|
|
231
307
|
return {
|
|
232
308
|
get groupProps() {
|
|
233
309
|
return groupProps();
|
|
234
310
|
},
|
|
235
311
|
get labelProps() {
|
|
236
|
-
return
|
|
312
|
+
return enhancedLabelProps() as Record<string, unknown>;
|
|
237
313
|
},
|
|
238
314
|
get startFieldProps() {
|
|
239
315
|
return startFieldProps();
|
|
@@ -241,15 +317,11 @@ export function createDateRangePicker<T extends RangeCalendarState>(
|
|
|
241
317
|
get endFieldProps() {
|
|
242
318
|
return endFieldProps();
|
|
243
319
|
},
|
|
244
|
-
get startInputProps() {
|
|
245
|
-
return startInputProps();
|
|
246
|
-
},
|
|
247
|
-
get endInputProps() {
|
|
248
|
-
return endInputProps();
|
|
249
|
-
},
|
|
250
320
|
get buttonProps() {
|
|
251
321
|
return buttonProps();
|
|
252
322
|
},
|
|
323
|
+
isButtonPressed: () => buttonPress.isPressed(),
|
|
324
|
+
isButtonDisabled: () => isButtonDisabled(),
|
|
253
325
|
get dialogProps() {
|
|
254
326
|
return dialogProps();
|
|
255
327
|
},
|
|
@@ -257,38 +329,17 @@ export function createDateRangePicker<T extends RangeCalendarState>(
|
|
|
257
329
|
return calendarProps();
|
|
258
330
|
},
|
|
259
331
|
get descriptionProps() {
|
|
260
|
-
return descriptionProps
|
|
332
|
+
return field.descriptionProps as Record<string, unknown>;
|
|
261
333
|
},
|
|
262
334
|
get errorMessageProps() {
|
|
263
|
-
return errorMessageProps
|
|
335
|
+
return field.errorMessageProps as Record<string, unknown>;
|
|
336
|
+
},
|
|
337
|
+
get isInvalid() {
|
|
338
|
+
return isInvalid();
|
|
339
|
+
},
|
|
340
|
+
focusManager: {
|
|
341
|
+
focusFirst: () => sharedFocusManager.focusFirst(),
|
|
342
|
+
focusLast: () => sharedFocusManager.focusLast(),
|
|
264
343
|
},
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function getDateRangePickerLabelDefaults(locale: string): {
|
|
269
|
-
button: string;
|
|
270
|
-
dialog: string;
|
|
271
|
-
calendar: string;
|
|
272
|
-
startField: string;
|
|
273
|
-
endField: string;
|
|
274
|
-
} {
|
|
275
|
-
const language = locale.toLowerCase().split("-")[0] ?? "en";
|
|
276
|
-
|
|
277
|
-
if (language === "es") {
|
|
278
|
-
return {
|
|
279
|
-
button: "Abrir calendario de rango",
|
|
280
|
-
dialog: "Calendario de rango",
|
|
281
|
-
calendar: "Calendario de rango",
|
|
282
|
-
startField: "Fecha de inicio",
|
|
283
|
-
endField: "Fecha de fin",
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return {
|
|
288
|
-
button: "Open range calendar",
|
|
289
|
-
dialog: "Range calendar",
|
|
290
|
-
calendar: "Range calendar",
|
|
291
|
-
startField: "Start date",
|
|
292
|
-
endField: "End date",
|
|
293
344
|
};
|
|
294
345
|
}
|