@proyecto-viviana/solidaria 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/actiongroup.js +207 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +207 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +196 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +196 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +119 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +119 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +276 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +276 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1036 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1036 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +234 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +234 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1174 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1174 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +436 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +436 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +229 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +223 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +54 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +54 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +101 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +101 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +121 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +121 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +130 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +130 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +269 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +269 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +46 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +46 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +31 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +31 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createLongPress.js +91 -0
- package/dist/_chunk/createLongPress.js.map +1 -0
- package/dist/_chunk/createLongPress.jsx +91 -0
- package/dist/_chunk/createLongPress.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +81 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +81 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +298 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +298 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +158 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +158 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1393 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1393 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +1304 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +1304 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +105 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +105 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +895 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +870 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/form.js +39 -0
- package/dist/_chunk/form.js.map +1 -0
- package/dist/_chunk/form.jsx +39 -0
- package/dist/_chunk/form.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +364 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +364 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +254 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +254 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +241 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +237 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +96 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +96 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +324 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +324 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/live-announcer.js +207 -0
- package/dist/_chunk/live-announcer.js.map +1 -0
- package/dist/_chunk/live-announcer.jsx +207 -0
- package/dist/_chunk/live-announcer.jsx.map +1 -0
- package/dist/_chunk/menu.js +518 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +518 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +258 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +258 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +319 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +319 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +209 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +209 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +403 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +394 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +679 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +679 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +255 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +255 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1051 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1051 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +260 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +260 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +286 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +286 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +109 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +109 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +258 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +258 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +424 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +424 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +665 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +665 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +92 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +92 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.js +2 -0
- package/dist/dnd/index.jsx +2 -0
- package/dist/dnd/utils.d.ts +2 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.js +2 -0
- package/dist/focus/index.jsx +2 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/index.jsx +3 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -18311
- package/dist/index.jsx +71 -18242
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +10 -0
- package/dist/interactions/index.jsx +10 -0
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +6 -0
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +4 -0
- package/dist/selection/index.jsx +4 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +27 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +4 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +48 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.jsx +5 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/autocomplete/createAutocomplete.ts +67 -21
- package/src/calendar/createCalendar.ts +2 -0
- package/src/calendar/createCalendarCell.ts +19 -2
- package/src/calendar/createCalendarGrid.ts +43 -9
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +2 -0
- package/src/calendar/index.ts +17 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/datepicker/createDateSegment.ts +6 -1
- package/src/dnd/createDroppableCollection.ts +4 -1
- package/src/dnd/utils.ts +27 -3
- package/src/focus/FocusScope.tsx +152 -18
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +145 -42
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +40 -0
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createInteractionModality.ts +21 -12
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/listbox/createListBox.ts +129 -8
- package/src/listbox/createOption.ts +68 -73
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +18 -2
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +498 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +56 -26
- package/src/table/createTableRow.ts +198 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/types.ts +29 -1
- package/src/tabs/createTabs.ts +50 -20
- package/src/tag/createTag.ts +9 -4
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -42
- package/src/tree/createTree.ts +100 -42
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +151 -0
- package/src/utils/dom.ts +215 -25
- package/src/utils/index.ts +8 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { i as access, o as mergeProps } from "./env.jsx";
|
|
2
|
+
import { t as createTextField } from "./textfield.jsx";
|
|
3
|
+
//#region src/searchfield/createSearchField.ts
|
|
4
|
+
/**
|
|
5
|
+
* Provides the behavior and accessibility implementation for a search field.
|
|
6
|
+
*/
|
|
7
|
+
function createSearchField(props, state, inputRef) {
|
|
8
|
+
const getProps = () => access(props);
|
|
9
|
+
const setValue = (value) => {
|
|
10
|
+
if (state.value() === value) return;
|
|
11
|
+
state.setValue(value);
|
|
12
|
+
getProps().onChange?.(value);
|
|
13
|
+
};
|
|
14
|
+
const textFieldAria = createTextField({
|
|
15
|
+
get value() {
|
|
16
|
+
return state.value();
|
|
17
|
+
},
|
|
18
|
+
get isDisabled() {
|
|
19
|
+
return getProps().isDisabled;
|
|
20
|
+
},
|
|
21
|
+
get isReadOnly() {
|
|
22
|
+
return getProps().isReadOnly;
|
|
23
|
+
},
|
|
24
|
+
get isRequired() {
|
|
25
|
+
return getProps().isRequired;
|
|
26
|
+
},
|
|
27
|
+
get isInvalid() {
|
|
28
|
+
return getProps().isInvalid;
|
|
29
|
+
},
|
|
30
|
+
get label() {
|
|
31
|
+
return getProps().label;
|
|
32
|
+
},
|
|
33
|
+
get "aria-label"() {
|
|
34
|
+
return getProps()["aria-label"];
|
|
35
|
+
},
|
|
36
|
+
get "aria-labelledby"() {
|
|
37
|
+
return getProps()["aria-labelledby"];
|
|
38
|
+
},
|
|
39
|
+
get "aria-describedby"() {
|
|
40
|
+
return getProps()["aria-describedby"];
|
|
41
|
+
},
|
|
42
|
+
get description() {
|
|
43
|
+
return getProps().description;
|
|
44
|
+
},
|
|
45
|
+
get errorMessage() {
|
|
46
|
+
return getProps().errorMessage;
|
|
47
|
+
},
|
|
48
|
+
get placeholder() {
|
|
49
|
+
return getProps().placeholder;
|
|
50
|
+
},
|
|
51
|
+
get name() {
|
|
52
|
+
return getProps().name;
|
|
53
|
+
},
|
|
54
|
+
get form() {
|
|
55
|
+
return getProps().form;
|
|
56
|
+
},
|
|
57
|
+
get validationBehavior() {
|
|
58
|
+
return getProps().validationBehavior ?? "native";
|
|
59
|
+
},
|
|
60
|
+
get type() {
|
|
61
|
+
return getProps().type ?? "search";
|
|
62
|
+
},
|
|
63
|
+
get autoFocus() {
|
|
64
|
+
return getProps().autoFocus;
|
|
65
|
+
},
|
|
66
|
+
get excludeFromTabOrder() {
|
|
67
|
+
return getProps().excludeFromTabOrder;
|
|
68
|
+
},
|
|
69
|
+
get autoComplete() {
|
|
70
|
+
return getProps().autoComplete;
|
|
71
|
+
},
|
|
72
|
+
get inputMode() {
|
|
73
|
+
return getProps().inputMode;
|
|
74
|
+
},
|
|
75
|
+
get enterKeyHint() {
|
|
76
|
+
return getProps().enterKeyHint;
|
|
77
|
+
},
|
|
78
|
+
get autoCorrect() {
|
|
79
|
+
return getProps().autoCorrect;
|
|
80
|
+
},
|
|
81
|
+
get autoCapitalize() {
|
|
82
|
+
return getProps().autoCapitalize;
|
|
83
|
+
},
|
|
84
|
+
get spellCheck() {
|
|
85
|
+
return getProps().spellCheck;
|
|
86
|
+
},
|
|
87
|
+
get maxLength() {
|
|
88
|
+
return getProps().maxLength;
|
|
89
|
+
},
|
|
90
|
+
get minLength() {
|
|
91
|
+
return getProps().minLength;
|
|
92
|
+
},
|
|
93
|
+
get pattern() {
|
|
94
|
+
return getProps().pattern;
|
|
95
|
+
},
|
|
96
|
+
get onFocus() {
|
|
97
|
+
return getProps().onFocus;
|
|
98
|
+
},
|
|
99
|
+
get onBlur() {
|
|
100
|
+
return getProps().onBlur;
|
|
101
|
+
},
|
|
102
|
+
get onFocusChange() {
|
|
103
|
+
return getProps().onFocusChange;
|
|
104
|
+
},
|
|
105
|
+
get onKeyDown() {
|
|
106
|
+
return getProps().onKeyDown;
|
|
107
|
+
},
|
|
108
|
+
get onKeyUp() {
|
|
109
|
+
return getProps().onKeyUp;
|
|
110
|
+
},
|
|
111
|
+
get onCopy() {
|
|
112
|
+
return getProps().onCopy;
|
|
113
|
+
},
|
|
114
|
+
get onCut() {
|
|
115
|
+
return getProps().onCut;
|
|
116
|
+
},
|
|
117
|
+
get onPaste() {
|
|
118
|
+
return getProps().onPaste;
|
|
119
|
+
},
|
|
120
|
+
get onCompositionStart() {
|
|
121
|
+
return getProps().onCompositionStart;
|
|
122
|
+
},
|
|
123
|
+
get onCompositionEnd() {
|
|
124
|
+
return getProps().onCompositionEnd;
|
|
125
|
+
},
|
|
126
|
+
get onCompositionUpdate() {
|
|
127
|
+
return getProps().onCompositionUpdate;
|
|
128
|
+
},
|
|
129
|
+
get onSelect() {
|
|
130
|
+
return getProps().onSelect;
|
|
131
|
+
},
|
|
132
|
+
get onBeforeInput() {
|
|
133
|
+
return getProps().onBeforeInput;
|
|
134
|
+
},
|
|
135
|
+
get onInput() {
|
|
136
|
+
return getProps().onInput;
|
|
137
|
+
},
|
|
138
|
+
onChange: setValue
|
|
139
|
+
});
|
|
140
|
+
const onKeyDown = (e) => {
|
|
141
|
+
const p = getProps();
|
|
142
|
+
if (p.isDisabled || p.isReadOnly) {
|
|
143
|
+
if (e.key === "Enter") e.preventDefault();
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (e.key === "Enter" && p.onSubmit) {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
p.onSubmit(state.value());
|
|
149
|
+
}
|
|
150
|
+
if (e.key === "Escape") {
|
|
151
|
+
const currentValue = state.value();
|
|
152
|
+
const inputValue = inputRef?.()?.value ?? "";
|
|
153
|
+
if (currentValue !== "" || inputValue !== "") {
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
e.stopPropagation();
|
|
156
|
+
const input = inputRef?.();
|
|
157
|
+
if (input) input.value = "";
|
|
158
|
+
setValue("");
|
|
159
|
+
p.onClear?.();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const onClearButtonClick = () => {
|
|
164
|
+
const p = getProps();
|
|
165
|
+
if (p.isDisabled || p.isReadOnly) return;
|
|
166
|
+
const input = inputRef?.();
|
|
167
|
+
if (input) input.value = "";
|
|
168
|
+
setValue("");
|
|
169
|
+
p.onClear?.();
|
|
170
|
+
inputRef?.()?.focus();
|
|
171
|
+
};
|
|
172
|
+
const onClearButtonMouseDown = (e) => {
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
get labelProps() {
|
|
177
|
+
return textFieldAria.labelProps;
|
|
178
|
+
},
|
|
179
|
+
get inputProps() {
|
|
180
|
+
return mergeProps({
|
|
181
|
+
onKeyDown,
|
|
182
|
+
defaultValue: void 0
|
|
183
|
+
}, textFieldAria.inputProps);
|
|
184
|
+
},
|
|
185
|
+
get clearButtonProps() {
|
|
186
|
+
const p = getProps();
|
|
187
|
+
return {
|
|
188
|
+
"aria-label": "Clear search",
|
|
189
|
+
tabIndex: -1,
|
|
190
|
+
disabled: p.isDisabled || p.isReadOnly,
|
|
191
|
+
onMouseDown: onClearButtonMouseDown,
|
|
192
|
+
onClick: onClearButtonClick
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
get descriptionProps() {
|
|
196
|
+
return textFieldAria.descriptionProps;
|
|
197
|
+
},
|
|
198
|
+
get errorMessageProps() {
|
|
199
|
+
return textFieldAria.errorMessageProps;
|
|
200
|
+
},
|
|
201
|
+
get isInvalid() {
|
|
202
|
+
return textFieldAria.isInvalid;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
export { createSearchField as t };
|
|
208
|
+
|
|
209
|
+
//# sourceMappingURL=searchfield.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchfield.jsx","names":[],"sources":["../../src/searchfield/createSearchField.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a search field.\n * A search field allows a user to enter and clear a search query.\n * Based on @react-aria/searchfield useSearchField.\n */\n\nimport { type JSX } from \"solid-js\";\nimport { createTextField, type AriaTextFieldProps, type TextFieldAria } from \"../textfield\";\nimport { mergeProps } from \"../utils\";\nimport { type MaybeAccessor, access } from \"../utils/reactivity\";\nimport type { SearchFieldState } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaSearchFieldProps extends AriaTextFieldProps {\n /** Handler that is called when the user submits the search (pressing Enter). */\n onSubmit?: (value: string) => void;\n /** Handler that is called when the clear button is pressed or Escape clears the field. */\n onClear?: () => void;\n}\n\nexport interface SearchFieldAria extends Omit<TextFieldAria, \"inputProps\"> {\n /** Props for the input element. */\n inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;\n /** Props for the clear button. */\n clearButtonProps: {\n \"aria-label\": string;\n tabIndex: number;\n disabled?: boolean;\n onMouseDown: (e: MouseEvent) => void;\n onClick: () => void;\n };\n}\n\n/**\n * Provides the behavior and accessibility implementation for a search field.\n */\nexport function createSearchField(\n props: MaybeAccessor<AriaSearchFieldProps>,\n state: SearchFieldState,\n inputRef?: () => HTMLInputElement | null,\n): SearchFieldAria {\n const getProps = () => access(props);\n\n const setValue = (value: string) => {\n if (state.value() === value) {\n return;\n }\n\n state.setValue(value);\n getProps().onChange?.(value);\n };\n\n // Use createTextField for the base implementation\n const textFieldAria = createTextField({\n get value() {\n return state.value();\n },\n get isDisabled() {\n return getProps().isDisabled;\n },\n get isReadOnly() {\n return getProps().isReadOnly;\n },\n get isRequired() {\n return getProps().isRequired;\n },\n get isInvalid() {\n return getProps().isInvalid;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n get \"aria-describedby\"() {\n return getProps()[\"aria-describedby\"];\n },\n get description() {\n return getProps().description;\n },\n get errorMessage() {\n return getProps().errorMessage;\n },\n get placeholder() {\n return getProps().placeholder;\n },\n get name() {\n return getProps().name;\n },\n get form() {\n return getProps().form;\n },\n get validationBehavior() {\n return getProps().validationBehavior ?? \"native\";\n },\n get type() {\n return getProps().type ?? \"search\";\n },\n get autoFocus() {\n return getProps().autoFocus;\n },\n get excludeFromTabOrder() {\n return getProps().excludeFromTabOrder;\n },\n get autoComplete() {\n return getProps().autoComplete;\n },\n get inputMode() {\n return getProps().inputMode;\n },\n get enterKeyHint() {\n return getProps().enterKeyHint;\n },\n get autoCorrect() {\n return getProps().autoCorrect;\n },\n get autoCapitalize() {\n return getProps().autoCapitalize;\n },\n get spellCheck() {\n return getProps().spellCheck;\n },\n get maxLength() {\n return getProps().maxLength;\n },\n get minLength() {\n return getProps().minLength;\n },\n get pattern() {\n return getProps().pattern;\n },\n get onFocus() {\n return getProps().onFocus;\n },\n get onBlur() {\n return getProps().onBlur;\n },\n get onFocusChange() {\n return getProps().onFocusChange;\n },\n get onKeyDown() {\n return getProps().onKeyDown;\n },\n get onKeyUp() {\n return getProps().onKeyUp;\n },\n get onCopy() {\n return getProps().onCopy;\n },\n get onCut() {\n return getProps().onCut;\n },\n get onPaste() {\n return getProps().onPaste;\n },\n get onCompositionStart() {\n return getProps().onCompositionStart;\n },\n get onCompositionEnd() {\n return getProps().onCompositionEnd;\n },\n get onCompositionUpdate() {\n return getProps().onCompositionUpdate;\n },\n get onSelect() {\n return getProps().onSelect;\n },\n get onBeforeInput() {\n return getProps().onBeforeInput;\n },\n get onInput() {\n return getProps().onInput;\n },\n onChange: setValue,\n });\n\n // Handle keyboard events for search field\n const onKeyDown: JSX.EventHandler<HTMLInputElement, KeyboardEvent> = (e) => {\n const p = getProps();\n\n if (p.isDisabled || p.isReadOnly) {\n if (e.key === \"Enter\") {\n e.preventDefault();\n }\n return;\n }\n\n if (e.key === \"Enter\" && p.onSubmit) {\n e.preventDefault();\n p.onSubmit(state.value());\n }\n\n if (e.key === \"Escape\") {\n const currentValue = state.value();\n const inputValue = inputRef?.()?.value ?? \"\";\n\n // Only clear if there's a value\n if (currentValue !== \"\" || inputValue !== \"\") {\n e.preventDefault();\n e.stopPropagation();\n const input = inputRef?.();\n if (input) {\n input.value = \"\";\n }\n setValue(\"\");\n p.onClear?.();\n }\n }\n };\n\n // Handle clear button click\n const onClearButtonClick = () => {\n const p = getProps();\n if (p.isDisabled || p.isReadOnly) return;\n const input = inputRef?.();\n if (input) {\n input.value = \"\";\n }\n setValue(\"\");\n p.onClear?.();\n // Focus the input after clearing\n inputRef?.()?.focus();\n };\n\n // Prevent focus from leaving input on mobile when clicking clear button\n const onClearButtonMouseDown = (e: MouseEvent) => {\n e.preventDefault();\n };\n\n return {\n get labelProps() {\n return textFieldAria.labelProps;\n },\n get inputProps() {\n return mergeProps(\n {\n onKeyDown,\n // Clear defaultValue since it's handled by state\n defaultValue: undefined,\n } as Record<string, unknown>,\n textFieldAria.inputProps as Record<string, unknown>,\n ) as JSX.InputHTMLAttributes<HTMLInputElement>;\n },\n get clearButtonProps() {\n const p = getProps();\n const isDisabled = p.isDisabled || p.isReadOnly;\n\n return {\n \"aria-label\": \"Clear search\",\n tabIndex: -1, // Exclude from tab order\n disabled: isDisabled,\n onMouseDown: onClearButtonMouseDown,\n onClick: onClearButtonClick,\n };\n },\n get descriptionProps() {\n return textFieldAria.descriptionProps;\n },\n get errorMessageProps() {\n return textFieldAria.errorMessageProps;\n },\n get isInvalid() {\n return textFieldAria.isInvalid;\n },\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { t as createPress } from "./createPress.js";
|
|
2
|
+
import { i as access, o as mergeProps } from "./env.js";
|
|
3
|
+
import { t as filterDOMProps } from "./filterDOMProps.js";
|
|
4
|
+
import { t as createFocusRing } from "./createFocusRing.js";
|
|
5
|
+
import { createId } from "../ssr/index.js";
|
|
6
|
+
import { t as createLabel } from "./createLabel.js";
|
|
7
|
+
import { t as createTypeSelect } from "./createTypeSelect.js";
|
|
8
|
+
import { t as createFormValidation } from "./createFormValidation.js";
|
|
9
|
+
import { For, createEffect, onCleanup } from "solid-js";
|
|
10
|
+
import { createComponent, effect, getNextElement, getNextMarker, insert, runHydrationEvents, setProperty, spread, template } from "solid-js/web";
|
|
11
|
+
//#region src/select/createSelect.ts
|
|
12
|
+
/**
|
|
13
|
+
* Provides the behavior and accessibility implementation for a select component.
|
|
14
|
+
* A select displays a collapsible list of options and allows a user to select one of them.
|
|
15
|
+
* Based on @react-aria/select useSelect.
|
|
16
|
+
*/
|
|
17
|
+
const selectData = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
function getSelectData(state) {
|
|
19
|
+
return selectData.get(state);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Provides the behavior and accessibility implementation for a select component.
|
|
23
|
+
*/
|
|
24
|
+
function createSelect(props, state, _ref) {
|
|
25
|
+
const getProps = () => access(props);
|
|
26
|
+
const id = createId(getProps().id);
|
|
27
|
+
const buttonId = `${id}-button`;
|
|
28
|
+
const listBoxId = `${id}-listbox`;
|
|
29
|
+
const valueId = `${id}-value`;
|
|
30
|
+
const descriptionId = `${id}-description`;
|
|
31
|
+
const errorMessageId = `${id}-error`;
|
|
32
|
+
const domProps = () => filterDOMProps(getProps(), { labelable: true });
|
|
33
|
+
createEffect(() => {
|
|
34
|
+
selectData.set(state, { id });
|
|
35
|
+
onCleanup(() => {
|
|
36
|
+
selectData.delete(state);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
const { labelProps, fieldProps } = createLabel({
|
|
40
|
+
get id() {
|
|
41
|
+
return buttonId;
|
|
42
|
+
},
|
|
43
|
+
get label() {
|
|
44
|
+
return getProps().label;
|
|
45
|
+
},
|
|
46
|
+
get "aria-label"() {
|
|
47
|
+
return getProps()["aria-label"];
|
|
48
|
+
},
|
|
49
|
+
get "aria-labelledby"() {
|
|
50
|
+
return getProps()["aria-labelledby"];
|
|
51
|
+
},
|
|
52
|
+
labelElementType: "span"
|
|
53
|
+
});
|
|
54
|
+
const { isFocusVisible, focusProps } = createFocusRing({ get autoFocus() {
|
|
55
|
+
return getProps().autoFocus;
|
|
56
|
+
} });
|
|
57
|
+
const isFocused = state.isFocused;
|
|
58
|
+
const canOpen = () => getProps().allowsEmptyCollection || state.collection().getFirstKey() != null;
|
|
59
|
+
const isKeyDisabled = (key) => {
|
|
60
|
+
const collection = state.collection();
|
|
61
|
+
return state.isKeyDisabled?.(key) || collection.getItem(key)?.isDisabled || false;
|
|
62
|
+
};
|
|
63
|
+
const findNextKey = (fromKey, direction) => {
|
|
64
|
+
const collection = state.collection();
|
|
65
|
+
const getAdjacent = direction === "forward" ? (k) => collection.getKeyAfter(k) : (k) => collection.getKeyBefore(k);
|
|
66
|
+
let key = fromKey == null ? (direction === "forward" ? () => collection.getFirstKey() : () => collection.getLastKey())() : getAdjacent(fromKey);
|
|
67
|
+
while (key != null && isKeyDisabled(key)) key = getAdjacent(key);
|
|
68
|
+
return key;
|
|
69
|
+
};
|
|
70
|
+
const focusKeyForOpen = () => {
|
|
71
|
+
const selectedKey = state.selectedKey();
|
|
72
|
+
if (selectedKey != null && !isKeyDisabled(selectedKey)) return selectedKey;
|
|
73
|
+
return findNextKey(null, "forward");
|
|
74
|
+
};
|
|
75
|
+
const openWithFocus = () => {
|
|
76
|
+
if (state.isOpen() || !canOpen()) return;
|
|
77
|
+
state.open();
|
|
78
|
+
const focusKey = focusKeyForOpen();
|
|
79
|
+
if (focusKey != null) state.setFocusedKey(focusKey);
|
|
80
|
+
};
|
|
81
|
+
const { pressProps } = createPress({
|
|
82
|
+
get isDisabled() {
|
|
83
|
+
return getProps().isDisabled ?? state.isDisabled;
|
|
84
|
+
},
|
|
85
|
+
onPress(e) {
|
|
86
|
+
if (e.pointerType === "keyboard") return;
|
|
87
|
+
if (state.isOpen()) state.close();
|
|
88
|
+
else openWithFocus();
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const { typeSelectProps } = createTypeSelect({
|
|
92
|
+
collection: () => state.collection(),
|
|
93
|
+
focusedKey: () => state.selectedKey(),
|
|
94
|
+
onFocusedKeyChange: (key) => {
|
|
95
|
+
if (!state.isOpen()) state.setSelectedKey(key);
|
|
96
|
+
else state.setFocusedKey(key);
|
|
97
|
+
},
|
|
98
|
+
isKeyDisabled,
|
|
99
|
+
get isDisabled() {
|
|
100
|
+
return Boolean((getProps().disallowTypeAhead ?? false) || getProps().isDisabled || state.isDisabled);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const onKeyDown = (e) => {
|
|
104
|
+
if (getProps().isDisabled ?? state.isDisabled) return;
|
|
105
|
+
const currentKey = state.focusedKey() ?? state.selectedKey();
|
|
106
|
+
switch (e.key) {
|
|
107
|
+
case "Enter":
|
|
108
|
+
case " ":
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
if (state.isOpen()) state.close();
|
|
111
|
+
else openWithFocus();
|
|
112
|
+
break;
|
|
113
|
+
case "ArrowDown":
|
|
114
|
+
e.preventDefault();
|
|
115
|
+
if (!state.isOpen()) {
|
|
116
|
+
if (!canOpen()) return;
|
|
117
|
+
state.open();
|
|
118
|
+
const focusKey = currentKey != null && !isKeyDisabled(currentKey) ? currentKey : findNextKey(currentKey, "forward");
|
|
119
|
+
if (focusKey) state.setFocusedKey(focusKey);
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
case "ArrowUp":
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
if (!state.isOpen()) {
|
|
125
|
+
if (!canOpen()) return;
|
|
126
|
+
state.open();
|
|
127
|
+
const focusKey = currentKey != null && !isKeyDisabled(currentKey) ? currentKey : findNextKey(currentKey, "backward");
|
|
128
|
+
if (focusKey) state.setFocusedKey(focusKey);
|
|
129
|
+
}
|
|
130
|
+
break;
|
|
131
|
+
case "ArrowRight":
|
|
132
|
+
if (!state.isOpen()) {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
const nextKey = findNextKey(currentKey, "forward");
|
|
135
|
+
if (nextKey != null) state.setSelectedKey(nextKey);
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
case "ArrowLeft":
|
|
139
|
+
if (!state.isOpen()) {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
const prevKey = findNextKey(currentKey, "backward");
|
|
142
|
+
if (prevKey != null) state.setSelectedKey(prevKey);
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
case "Home":
|
|
146
|
+
if (!state.isOpen()) {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
const firstKey = findNextKey(null, "forward");
|
|
149
|
+
if (firstKey != null) state.setSelectedKey(firstKey);
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case "End":
|
|
153
|
+
if (!state.isOpen()) {
|
|
154
|
+
e.preventDefault();
|
|
155
|
+
const lastKey = findNextKey(null, "backward");
|
|
156
|
+
if (lastKey != null) state.setSelectedKey(lastKey);
|
|
157
|
+
}
|
|
158
|
+
break;
|
|
159
|
+
case "Escape":
|
|
160
|
+
if (state.isOpen()) {
|
|
161
|
+
e.preventDefault();
|
|
162
|
+
state.close();
|
|
163
|
+
}
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
const handleFocus = (e) => {
|
|
168
|
+
getProps().onFocus?.(e);
|
|
169
|
+
getProps().onFocusChange?.(true);
|
|
170
|
+
state.setFocused(true);
|
|
171
|
+
};
|
|
172
|
+
const handleBlur = (e) => {
|
|
173
|
+
if (state.isOpen()) return;
|
|
174
|
+
getProps().onBlur?.(e);
|
|
175
|
+
getProps().onFocusChange?.(false);
|
|
176
|
+
state.setFocused(false);
|
|
177
|
+
};
|
|
178
|
+
return {
|
|
179
|
+
get labelProps() {
|
|
180
|
+
return labelProps;
|
|
181
|
+
},
|
|
182
|
+
get triggerProps() {
|
|
183
|
+
const p = getProps();
|
|
184
|
+
const isOpen = state.isOpen();
|
|
185
|
+
const isDisabled = p.isDisabled ?? state.isDisabled;
|
|
186
|
+
const baseProps = mergeProps(domProps(), pressProps, focusProps, fieldProps, {
|
|
187
|
+
id: buttonId,
|
|
188
|
+
type: "button",
|
|
189
|
+
tabIndex: isDisabled ? void 0 : 0,
|
|
190
|
+
"aria-haspopup": "listbox",
|
|
191
|
+
"aria-expanded": isOpen,
|
|
192
|
+
"aria-controls": isOpen ? listBoxId : void 0,
|
|
193
|
+
"aria-disabled": isDisabled || void 0,
|
|
194
|
+
"aria-required": p.isRequired || void 0,
|
|
195
|
+
"aria-describedby": p["aria-describedby"] || void 0,
|
|
196
|
+
onKeyDown,
|
|
197
|
+
onFocus: handleFocus,
|
|
198
|
+
onBlur: handleBlur,
|
|
199
|
+
"data-open": isOpen || void 0,
|
|
200
|
+
"data-disabled": isDisabled || void 0,
|
|
201
|
+
"data-focus-visible": isFocusVisible() || void 0
|
|
202
|
+
});
|
|
203
|
+
if (!p.disallowTypeAhead) return mergeProps(baseProps, typeSelectProps);
|
|
204
|
+
return baseProps;
|
|
205
|
+
},
|
|
206
|
+
get valueProps() {
|
|
207
|
+
return { id: valueId };
|
|
208
|
+
},
|
|
209
|
+
get menuProps() {
|
|
210
|
+
return {
|
|
211
|
+
id: listBoxId,
|
|
212
|
+
role: "listbox",
|
|
213
|
+
"aria-labelledby": buttonId,
|
|
214
|
+
"aria-multiselectable": state.selectionMode() === "multiple" ? true : void 0,
|
|
215
|
+
tabIndex: -1,
|
|
216
|
+
onBlur: (e) => {
|
|
217
|
+
if (e.currentTarget?.contains(e.relatedTarget)) return;
|
|
218
|
+
getProps().onBlur?.(e);
|
|
219
|
+
getProps().onFocusChange?.(false);
|
|
220
|
+
state.setFocused(false);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
get descriptionProps() {
|
|
225
|
+
return { id: descriptionId };
|
|
226
|
+
},
|
|
227
|
+
get errorMessageProps() {
|
|
228
|
+
return { id: errorMessageId };
|
|
229
|
+
},
|
|
230
|
+
isFocused,
|
|
231
|
+
isFocusVisible: () => isFocused() && isFocusVisible(),
|
|
232
|
+
isOpen: state.isOpen,
|
|
233
|
+
selectedItem: state.selectedItem
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/select/createHiddenSelect.tsx
|
|
238
|
+
/**
|
|
239
|
+
* Provides a hidden native select element for form integration.
|
|
240
|
+
* Based on @react-aria/select useHiddenSelect.
|
|
241
|
+
*/
|
|
242
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div><label><!$><!/><select><option></option><!$><!/>`), _tmpl$2 = /*#__PURE__*/ template(`<option>`);
|
|
243
|
+
/**
|
|
244
|
+
* Provides the accessibility implementation for a hidden select.
|
|
245
|
+
* This is used for native form submission and accessibility on mobile devices.
|
|
246
|
+
*/
|
|
247
|
+
function createHiddenSelect(props) {
|
|
248
|
+
const getProps = () => access(props);
|
|
249
|
+
let selectRef;
|
|
250
|
+
createEffect(() => {
|
|
251
|
+
const p = getProps();
|
|
252
|
+
if (!selectRef) return;
|
|
253
|
+
const form = selectRef.form;
|
|
254
|
+
if (!form) return;
|
|
255
|
+
const handleReset = () => {
|
|
256
|
+
const defaultKey = p.state.collection().getFirstKey();
|
|
257
|
+
p.state.setSelectedKey(defaultKey);
|
|
258
|
+
};
|
|
259
|
+
form.addEventListener("reset", handleReset);
|
|
260
|
+
onCleanup(() => {
|
|
261
|
+
form.removeEventListener("reset", handleReset);
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
createEffect(() => {
|
|
265
|
+
const p = getProps();
|
|
266
|
+
if (!selectRef || p.validationBehavior !== "native" || !p.validationState) return;
|
|
267
|
+
createFormValidation({
|
|
268
|
+
validationBehavior: p.validationBehavior,
|
|
269
|
+
focus: () => p.triggerRef?.()?.focus()
|
|
270
|
+
}, p.validationState, () => selectRef);
|
|
271
|
+
});
|
|
272
|
+
return {
|
|
273
|
+
get containerProps() {
|
|
274
|
+
return {
|
|
275
|
+
"aria-hidden": true,
|
|
276
|
+
"data-a11y-ignore": "aria-hidden-focus"
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
get selectProps() {
|
|
280
|
+
const p = getProps();
|
|
281
|
+
const state = p.state;
|
|
282
|
+
const selectedKey = state.selectedKey();
|
|
283
|
+
const selectedKeys = typeof state.selectedKeys === "function" ? state.selectedKeys() : selectedKey != null ? new Set([selectedKey]) : /* @__PURE__ */ new Set();
|
|
284
|
+
const validationBehavior = p.validationBehavior ?? "aria";
|
|
285
|
+
const isMultiple = typeof state.selectionMode === "function" && state.selectionMode() === "multiple";
|
|
286
|
+
const multipleValue = selectedKeys === "all" ? Array.from(state.collection()).map((item) => String(item.key)) : Array.from(selectedKeys).map(String);
|
|
287
|
+
return {
|
|
288
|
+
ref: (el) => {
|
|
289
|
+
selectRef = el;
|
|
290
|
+
},
|
|
291
|
+
tabIndex: -1,
|
|
292
|
+
autoComplete: p.autoComplete,
|
|
293
|
+
disabled: p.isDisabled ?? state.isDisabled,
|
|
294
|
+
multiple: isMultiple || void 0,
|
|
295
|
+
name: p.name,
|
|
296
|
+
form: p.form,
|
|
297
|
+
required: validationBehavior === "native" && p.isRequired,
|
|
298
|
+
value: isMultiple ? multipleValue : selectedKey != null ? String(selectedKey) : "",
|
|
299
|
+
onChange: (e) => {
|
|
300
|
+
const target = e.target;
|
|
301
|
+
if (isMultiple) if (typeof state.setSelectedKeys === "function") state.setSelectedKeys(Array.from(target.selectedOptions).map((o) => o.value));
|
|
302
|
+
else {
|
|
303
|
+
const first = target.selectedOptions[0]?.value;
|
|
304
|
+
state.setSelectedKey(first ?? null);
|
|
305
|
+
}
|
|
306
|
+
else state.setSelectedKey(target.value);
|
|
307
|
+
},
|
|
308
|
+
style: {
|
|
309
|
+
position: "absolute",
|
|
310
|
+
top: 0,
|
|
311
|
+
left: 0,
|
|
312
|
+
width: "100%",
|
|
313
|
+
height: "100%",
|
|
314
|
+
opacity: 0,
|
|
315
|
+
"font-size": "16px",
|
|
316
|
+
border: "none",
|
|
317
|
+
cursor: "default",
|
|
318
|
+
margin: 0,
|
|
319
|
+
padding: 0,
|
|
320
|
+
"pointer-events": "none"
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
},
|
|
324
|
+
get inputProps() {
|
|
325
|
+
const p = getProps();
|
|
326
|
+
const state = p.state;
|
|
327
|
+
const selectedKey = state.selectedKey();
|
|
328
|
+
const useTextInput = (p.validationBehavior ?? "aria") === "native" && p.isRequired;
|
|
329
|
+
return {
|
|
330
|
+
type: useTextInput ? "text" : "hidden",
|
|
331
|
+
name: p.name,
|
|
332
|
+
form: p.form,
|
|
333
|
+
value: selectedKey != null ? String(selectedKey) : "",
|
|
334
|
+
disabled: p.isDisabled ?? state.isDisabled,
|
|
335
|
+
required: useTextInput ? p.isRequired : void 0,
|
|
336
|
+
style: useTextInput ? { display: "none" } : void 0
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* A component that renders a hidden native select for form submission.
|
|
343
|
+
* This is useful on mobile devices where native select behavior is preferred.
|
|
344
|
+
*/
|
|
345
|
+
function HiddenSelect(props) {
|
|
346
|
+
const { containerProps, selectProps } = createHiddenSelect({
|
|
347
|
+
get state() {
|
|
348
|
+
return props.state;
|
|
349
|
+
},
|
|
350
|
+
get name() {
|
|
351
|
+
return props.name;
|
|
352
|
+
},
|
|
353
|
+
get isDisabled() {
|
|
354
|
+
return props.isDisabled;
|
|
355
|
+
},
|
|
356
|
+
get isRequired() {
|
|
357
|
+
return props.isRequired;
|
|
358
|
+
},
|
|
359
|
+
get autoComplete() {
|
|
360
|
+
return props.autoComplete;
|
|
361
|
+
},
|
|
362
|
+
get form() {
|
|
363
|
+
return props.form;
|
|
364
|
+
},
|
|
365
|
+
get validationBehavior() {
|
|
366
|
+
return props.validationBehavior;
|
|
367
|
+
},
|
|
368
|
+
get triggerRef() {
|
|
369
|
+
return props.triggerRef;
|
|
370
|
+
},
|
|
371
|
+
get validationState() {
|
|
372
|
+
return props.validationState;
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
const collection = () => props.state.collection();
|
|
376
|
+
const selectedKey = () => props.state.selectedKey();
|
|
377
|
+
const selectedKeys = () => typeof props.state.selectedKeys === "function" ? props.state.selectedKeys() : selectedKey() != null ? new Set([selectedKey()]) : /* @__PURE__ */ new Set();
|
|
378
|
+
const isMultiple = () => typeof props.state.selectionMode === "function" && props.state.selectionMode() === "multiple";
|
|
379
|
+
return (() => {
|
|
380
|
+
var _el$ = getNextElement(_tmpl$), _el$2 = _el$.firstChild, _el$7 = _el$2.firstChild, [_el$8, _co$2] = getNextMarker(_el$7.nextSibling), _el$3 = _el$8.nextSibling, _el$5 = _el$3.firstChild.nextSibling, [_el$6, _co$] = getNextMarker(_el$5.nextSibling);
|
|
381
|
+
spread(_el$, containerProps, false, true);
|
|
382
|
+
insert(_el$2, () => props.label, _el$8, _co$2);
|
|
383
|
+
spread(_el$3, selectProps, false, true);
|
|
384
|
+
insert(_el$3, createComponent(For, {
|
|
385
|
+
get each() {
|
|
386
|
+
return Array.from(collection());
|
|
387
|
+
},
|
|
388
|
+
children: (item) => (() => {
|
|
389
|
+
var _el$9 = getNextElement(_tmpl$2);
|
|
390
|
+
insert(_el$9, () => item.textValue);
|
|
391
|
+
effect(() => setProperty(_el$9, "selected", isMultiple() ? selectedKeys() === "all" ? true : selectedKeys().has(item.key) : item.key === selectedKey()));
|
|
392
|
+
effect(() => setProperty(_el$9, "value", String(item.key)));
|
|
393
|
+
return _el$9;
|
|
394
|
+
})()
|
|
395
|
+
}), _el$6, _co$);
|
|
396
|
+
runHydrationEvents();
|
|
397
|
+
return _el$;
|
|
398
|
+
})();
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
export { getSelectData as i, createHiddenSelect as n, createSelect as r, HiddenSelect as t };
|
|
402
|
+
|
|
403
|
+
//# sourceMappingURL=select.js.map
|