@proyecto-viviana/solidaria 0.2.8 → 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/README.md +31 -236
- 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/createActionGroup.d.ts +5 -5
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.d.ts +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -10
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/autocomplete/index.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts +9 -7
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.d.ts +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createButton.d.ts +1 -1
- package/dist/button/createButton.d.ts.map +1 -1
- package/dist/button/createToggleButton.d.ts +3 -3
- package/dist/button/createToggleButtonGroup.d.ts +7 -7
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.d.ts +6 -6
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/button/types.d.ts +18 -12
- package/dist/button/types.d.ts.map +1 -1
- package/dist/calendar/createCalendar.d.ts +15 -5
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts +6 -2
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts +4 -4
- 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 +15 -5
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts +4 -2
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +7 -5
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +12 -0
- package/dist/calendar/intl/index.d.ts.map +1 -0
- package/dist/calendar/utils.d.ts +16 -0
- package/dist/calendar/utils.d.ts.map +1 -0
- package/dist/checkbox/createCheckbox.d.ts +10 -6
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroup.d.ts +7 -7
- package/dist/checkbox/createCheckboxGroup.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts +4 -4
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupState.d.ts +2 -2
- package/dist/checkbox/createCheckboxGroupState.d.ts.map +1 -1
- package/dist/checkbox/index.d.ts +8 -8
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.d.ts +3 -3
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts +3 -3
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts +4 -4
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts +4 -4
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts +2 -2
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts +3 -3
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.d.ts +6 -6
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/types.d.ts +98 -16
- package/dist/color/types.d.ts.map +1 -1
- package/dist/combobox/createComboBox.d.ts +10 -7
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/index.d.ts +1 -1
- package/dist/datepicker/createDateField.d.ts +18 -6
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +51 -5
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +19 -0
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -0
- package/dist/datepicker/createDateRangePicker.d.ts +8 -6
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +10 -2
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createTimeField.d.ts +11 -5
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/createTimeSegment.d.ts +2 -2
- package/dist/datepicker/createTimeSegment.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +7 -6
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/dialog/createDialog.d.ts +5 -5
- package/dist/dialog/createDialog.d.ts.map +1 -1
- package/dist/dialog/index.d.ts +2 -2
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/dialog/types.d.ts +4 -4
- package/dist/disclosure/createDisclosure.d.ts +5 -2
- package/dist/disclosure/createDisclosure.d.ts.map +1 -1
- package/dist/disclosure/createDisclosureGroup.d.ts +4 -4
- package/dist/disclosure/createDisclosureGroup.d.ts.map +1 -1
- package/dist/disclosure/index.d.ts +2 -2
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/createDrag.d.ts +2 -2
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts +2 -2
- package/dist/dnd/createDraggableItem.d.ts +3 -3
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDrop.d.ts +2 -2
- package/dist/dnd/createDrop.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +26 -6
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/createDroppableItem.d.ts +3 -3
- package/dist/dnd/index.d.ts +12 -12
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +2 -0
- package/dist/dnd/index.jsx +2 -0
- package/dist/dnd/types.d.ts +2 -2
- package/dist/dnd/types.d.ts.map +1 -1
- package/dist/dnd/utils.d.ts +2 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +1 -1
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/createAutoFocus.d.ts.map +1 -1
- package/dist/focus/createFocusRestore.d.ts.map +1 -1
- package/dist/focus/createVirtualFocus.d.ts +4 -4
- package/dist/focus/createVirtualFocus.d.ts.map +1 -1
- package/dist/focus/index.d.ts +4 -4
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +2 -0
- package/dist/focus/index.jsx +2 -0
- package/dist/form/createFormReset.d.ts +1 -1
- package/dist/form/createFormValidation.d.ts +3 -3
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.d.ts +2 -2
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/GridKeyboardDelegate.d.ts +5 -5
- package/dist/grid/createGrid.d.ts +3 -3
- package/dist/grid/createGridCell.d.ts +3 -3
- package/dist/grid/createGridRow.d.ts +3 -3
- package/dist/grid/index.d.ts +5 -5
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/grid/types.d.ts +8 -8
- package/dist/gridlist/createGridList.d.ts +12 -4
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +4 -4
- 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/createGridListSelectionCheckbox.d.ts +3 -3
- package/dist/gridlist/createGridListSelectionCheckbox.d.ts.map +1 -1
- package/dist/gridlist/index.d.ts +5 -4
- 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 +61 -7
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/createCollator.d.ts.map +1 -1
- package/dist/i18n/createDateFormatter.d.ts.map +1 -1
- package/dist/i18n/createFilter.d.ts.map +1 -1
- package/dist/i18n/createNumberFormatter.d.ts +1 -1
- package/dist/i18n/createNumberFormatter.d.ts.map +1 -1
- package/dist/i18n/createStringFormatter.d.ts +2 -2
- package/dist/i18n/createStringFormatter.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +8 -8
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/index.jsx +3 -0
- package/dist/i18n/locale.d.ts +2 -2
- package/dist/i18n/locale.d.ts.map +1 -1
- package/dist/i18n/utils.d.ts.map +1 -1
- package/dist/index.d.ts +56 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -17119
- package/dist/index.jsx +71 -0
- package/dist/interactions/FocusableProvider.d.ts +2 -2
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +13 -2
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusRing.d.ts +1 -1
- package/dist/interactions/createFocusRing.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createFocusable.d.ts +3 -3
- package/dist/interactions/createFocusable.d.ts.map +1 -1
- package/dist/interactions/createHover.d.ts +5 -5
- package/dist/interactions/createHover.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +3 -4
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createLongPress.d.ts +5 -5
- package/dist/interactions/createMove.d.ts +5 -5
- package/dist/interactions/createMove.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts +4 -4
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.d.ts +12 -12
- package/dist/interactions/index.d.ts.map +1 -1
- package/dist/interactions/index.js +10 -0
- package/dist/interactions/index.jsx +10 -0
- package/dist/label/createField.d.ts +4 -4
- package/dist/label/createField.d.ts.map +1 -1
- package/dist/label/createLabel.d.ts +7 -7
- package/dist/label/createLabel.d.ts.map +1 -1
- package/dist/label/createLabels.d.ts +1 -1
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.d.ts +5 -5
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/createLandmark.d.ts +5 -5
- package/dist/landmark/createLandmark.d.ts.map +1 -1
- package/dist/landmark/index.d.ts +1 -1
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/createLink.d.ts +14 -8
- package/dist/link/createLink.d.ts.map +1 -1
- package/dist/link/index.d.ts +1 -1
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +48 -6
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +27 -4
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.d.ts +2 -2
- package/dist/listbox/index.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/announce.d.ts +2 -2
- package/dist/live-announcer/announce.d.ts.map +1 -1
- package/dist/live-announcer/index.d.ts +1 -1
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +14 -11
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +25 -5
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/createMenuTrigger.d.ts +4 -4
- package/dist/menu/index.d.ts +3 -3
- package/dist/menu/index.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/createMeter.d.ts +6 -6
- package/dist/meter/createMeter.d.ts.map +1 -1
- package/dist/meter/index.d.ts +1 -1
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts +9 -8
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.d.ts +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/ariaHideOutside.d.ts.map +1 -1
- package/dist/overlays/createModal.d.ts +3 -3
- package/dist/overlays/createModal.d.ts.map +1 -1
- package/dist/overlays/createOverlay.d.ts +1 -1
- package/dist/overlays/createOverlay.d.ts.map +1 -1
- package/dist/overlays/createOverlayTrigger.d.ts +6 -6
- package/dist/overlays/index.d.ts +6 -6
- package/dist/overlays/index.d.ts.map +1 -1
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +6 -4
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +11 -3
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/createPopover.d.ts +4 -4
- package/dist/popover/createPopover.d.ts.map +1 -1
- package/dist/popover/index.d.ts +3 -3
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/createProgressBar.d.ts +7 -5
- package/dist/progress/createProgressBar.d.ts.map +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +9 -7
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/createRadioGroup.d.ts +10 -10
- package/dist/radio/createRadioGroup.d.ts.map +1 -1
- package/dist/radio/createRadioGroupState.d.ts +3 -3
- package/dist/radio/createRadioGroupState.d.ts.map +1 -1
- package/dist/radio/index.d.ts +3 -3
- package/dist/radio/index.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/createSearchField.d.ts +7 -7
- package/dist/searchfield/createSearchField.d.ts.map +1 -1
- package/dist/searchfield/index.d.ts +2 -2
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createHiddenSelect.d.ts +4 -4
- package/dist/select/createHiddenSelect.d.ts.map +1 -1
- package/dist/select/createSelect.d.ts +14 -6
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.d.ts +2 -2
- package/dist/select/index.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 +2 -2
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +10 -1
- 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/createSeparator.d.ts +9 -5
- package/dist/separator/createSeparator.d.ts.map +1 -1
- package/dist/separator/index.d.ts +1 -1
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts +11 -7
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.d.ts +2 -2
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/ssr/index.d.ts +18 -1
- 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/createStepList.d.ts +36 -0
- package/dist/steplist/createStepList.d.ts.map +1 -0
- package/dist/steplist/index.d.ts +2 -0
- package/dist/steplist/index.d.ts.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +10 -4
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts +3 -3
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableCell.d.ts +3 -3
- package/dist/table/createTableCell.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts +3 -3
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableColumnResize.d.ts +41 -0
- package/dist/table/createTableColumnResize.d.ts.map +1 -0
- package/dist/table/createTableHeaderRow.d.ts +3 -3
- package/dist/table/createTableRow.d.ts +4 -4
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableRowGroup.d.ts +2 -2
- package/dist/table/createTableRowGroup.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts +3 -3
- package/dist/table/createTableSelectionCheckbox.d.ts +3 -3
- package/dist/table/index.d.ts +11 -9
- package/dist/table/index.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 +41 -7
- package/dist/table/types.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +32 -28
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.d.ts +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +4 -2
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +5 -5
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.d.ts +2 -2
- package/dist/tag/index.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/createTextField.d.ts +17 -11
- package/dist/textfield/createTextField.d.ts.map +1 -1
- package/dist/textfield/index.d.ts +1 -1
- package/dist/textfield/index.d.ts.map +1 -1
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts +2 -2
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/createToastRegion.d.ts +5 -3
- package/dist/toast/createToastRegion.d.ts.map +1 -1
- package/dist/toast/index.d.ts +2 -2
- package/dist/toast/index.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 +13 -9
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/createToggleState.d.ts +2 -2
- package/dist/toggle/createToggleState.d.ts.map +1 -1
- package/dist/toggle/index.d.ts +4 -4
- package/dist/toggle/index.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 +9 -9
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +1 -1
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/createTooltip.d.ts +5 -5
- package/dist/tooltip/createTooltip.d.ts.map +1 -1
- package/dist/tooltip/createTooltipTrigger.d.ts +10 -5
- package/dist/tooltip/createTooltipTrigger.d.ts.map +1 -1
- package/dist/tooltip/index.d.ts +2 -2
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +8 -4
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +4 -4
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts +3 -3
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.d.ts +4 -4
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +20 -6
- 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/createDescription.d.ts +2 -2
- package/dist/utils/createDescription.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +48 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/env.d.ts.map +1 -1
- package/dist/utils/focus.d.ts +1 -1
- package/dist/utils/focus.d.ts.map +1 -1
- package/dist/utils/geometry.d.ts.map +1 -1
- package/dist/utils/index.d.ts +15 -12
- 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/reactivity.d.ts +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/createVisuallyHidden.d.ts +2 -2
- package/dist/visually-hidden/createVisuallyHidden.d.ts.map +1 -1
- package/dist/visually-hidden/index.d.ts +1 -1
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +334 -33
- package/src/actiongroup/createActionGroup.ts +101 -91
- package/src/actiongroup/index.ts +1 -1
- package/src/autocomplete/createAutocomplete.ts +177 -148
- package/src/autocomplete/index.ts +1 -1
- package/src/breadcrumbs/createBreadcrumbs.ts +33 -42
- package/src/breadcrumbs/index.ts +1 -1
- package/src/button/createButton.ts +102 -73
- package/src/button/createToggleButton.ts +10 -10
- package/src/button/createToggleButtonGroup.ts +25 -32
- package/src/button/index.ts +6 -9
- package/src/button/types.ts +18 -12
- package/src/calendar/createCalendar.ts +64 -29
- package/src/calendar/createCalendarCell.ts +115 -46
- package/src/calendar/createCalendarGrid.ts +97 -41
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +68 -31
- package/src/calendar/createRangeCalendarCell.ts +92 -31
- package/src/calendar/index.ts +21 -8
- package/src/calendar/intl/index.ts +210 -0
- package/src/calendar/utils.ts +231 -0
- package/src/checkbox/createCheckbox.ts +23 -21
- package/src/checkbox/createCheckboxGroup.ts +68 -44
- package/src/checkbox/createCheckboxGroupItem.ts +26 -41
- package/src/checkbox/createCheckboxGroupState.ts +3 -22
- package/src/checkbox/index.ts +8 -10
- package/src/collections/index.ts +33 -29
- package/src/color/createColorArea.ts +232 -154
- package/src/color/createColorField.ts +107 -58
- package/src/color/createColorSlider.ts +231 -73
- package/src/color/createColorSwatch.ts +38 -13
- package/src/color/createColorWheel.ts +208 -83
- package/src/color/index.ts +6 -6
- package/src/color/types.ts +98 -16
- package/src/combobox/createComboBox.ts +157 -100
- package/src/combobox/index.ts +1 -1
- package/src/combobox/intl/index.ts +5 -5
- package/src/datepicker/createDateField.ts +192 -39
- package/src/datepicker/createDatePicker.ts +260 -67
- package/src/datepicker/createDatePickerGroup.ts +149 -0
- package/src/datepicker/createDateRangePicker.ts +105 -57
- package/src/datepicker/createDateSegment.ts +188 -96
- package/src/datepicker/createTimeField.ts +38 -34
- package/src/datepicker/createTimeSegment.ts +67 -85
- package/src/datepicker/index.ts +13 -14
- package/src/dialog/createDialog.ts +45 -38
- package/src/dialog/index.ts +2 -2
- package/src/dialog/types.ts +4 -4
- package/src/disclosure/createDisclosure.ts +138 -33
- package/src/disclosure/createDisclosureGroup.ts +8 -21
- package/src/disclosure/index.ts +2 -2
- package/src/dnd/createDrag.ts +19 -25
- package/src/dnd/createDraggableCollection.ts +4 -4
- package/src/dnd/createDraggableItem.ts +20 -19
- package/src/dnd/createDrop.ts +42 -51
- package/src/dnd/createDroppableCollection.ts +293 -173
- package/src/dnd/createDroppableItem.ts +34 -34
- package/src/dnd/index.ts +23 -12
- package/src/dnd/types.ts +4 -7
- package/src/dnd/utils.ts +58 -47
- package/src/focus/FocusScope.tsx +301 -176
- package/src/focus/createAutoFocus.ts +4 -20
- package/src/focus/createFocusRestore.ts +15 -28
- package/src/focus/createVirtualFocus.ts +20 -36
- package/src/focus/index.ts +4 -8
- package/src/form/createFormReset.ts +4 -4
- package/src/form/createFormValidation.ts +23 -39
- package/src/form/index.ts +2 -5
- package/src/grid/GridKeyboardDelegate.ts +30 -30
- package/src/grid/createGrid.ts +36 -36
- package/src/grid/createGridCell.ts +18 -18
- package/src/grid/createGridRow.ts +14 -14
- package/src/grid/index.ts +5 -5
- package/src/grid/types.ts +8 -8
- package/src/gridlist/createGridList.ts +172 -64
- package/src/gridlist/createGridListItem.ts +98 -121
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/createGridListSelectionCheckbox.ts +12 -9
- package/src/gridlist/index.ts +7 -4
- package/src/gridlist/types.ts +58 -7
- package/src/i18n/createCollator.ts +5 -18
- package/src/i18n/createDateFormatter.ts +5 -13
- package/src/i18n/createFilter.ts +11 -24
- package/src/i18n/createNumberFormatter.ts +4 -6
- package/src/i18n/createStringFormatter.ts +19 -15
- package/src/i18n/index.ts +8 -11
- package/src/i18n/locale.tsx +15 -40
- package/src/i18n/utils.ts +35 -39
- package/src/index.ts +111 -172
- package/src/interactions/FocusableProvider.tsx +3 -7
- package/src/interactions/PressEvent.ts +18 -4
- package/src/interactions/createFocus.ts +12 -8
- package/src/interactions/createFocusRing.ts +21 -19
- package/src/interactions/createFocusWithin.ts +20 -13
- package/src/interactions/createFocusable.ts +15 -16
- package/src/interactions/createHover.ts +70 -55
- package/src/interactions/createInteractionModality.ts +96 -94
- package/src/interactions/createKeyboard.ts +12 -2
- package/src/interactions/createLongPress.ts +23 -23
- package/src/interactions/createMove.ts +72 -62
- package/src/interactions/createPress.ts +192 -92
- package/src/interactions/index.ts +24 -16
- package/src/label/createField.ts +18 -19
- package/src/label/createLabel.ts +18 -30
- package/src/label/createLabels.ts +8 -12
- package/src/label/index.ts +5 -5
- package/src/landmark/createLandmark.ts +30 -51
- package/src/landmark/index.ts +1 -1
- package/src/link/createLink.ts +83 -56
- package/src/link/index.ts +1 -1
- package/src/listbox/createListBox.ts +198 -66
- package/src/listbox/createOption.ts +112 -71
- package/src/listbox/index.ts +2 -6
- package/src/live-announcer/announce.ts +44 -71
- package/src/live-announcer/index.ts +1 -1
- package/src/menu/createMenu.ts +171 -65
- package/src/menu/createMenuItem.ts +315 -51
- package/src/menu/createMenuTrigger.ts +15 -15
- package/src/menu/index.ts +3 -12
- package/src/meter/createMeter.ts +7 -15
- package/src/meter/index.ts +1 -1
- package/src/numberfield/createNumberField.ts +205 -80
- package/src/numberfield/index.ts +1 -1
- package/src/overlays/ariaHideOutside.ts +14 -10
- package/src/overlays/createInteractOutside.ts +21 -18
- package/src/overlays/createModal.tsx +17 -17
- package/src/overlays/createOverlay.ts +38 -8
- package/src/overlays/createOverlayTrigger.ts +16 -16
- package/src/overlays/createPreventScroll.ts +46 -24
- package/src/overlays/index.ts +6 -17
- package/src/popover/calculatePosition.ts +134 -124
- package/src/popover/createOverlayPosition.ts +55 -40
- package/src/popover/createPopover.ts +42 -17
- package/src/popover/index.ts +3 -3
- package/src/progress/createProgressBar.ts +31 -32
- package/src/progress/index.ts +1 -1
- package/src/radio/createRadio.ts +114 -75
- package/src/radio/createRadioGroup.ts +83 -77
- package/src/radio/createRadioGroupState.ts +7 -31
- package/src/radio/index.ts +3 -8
- package/src/searchfield/createSearchField.ts +57 -29
- package/src/searchfield/index.ts +2 -2
- package/src/select/createHiddenSelect.tsx +57 -44
- package/src/select/createSelect.ts +146 -73
- package/src/select/index.ts +2 -7
- 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 +120 -59
- package/src/selection/index.ts +32 -1
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/separator/createSeparator.ts +20 -25
- package/src/separator/index.ts +1 -1
- package/src/slider/createSlider.ts +128 -112
- package/src/slider/index.ts +2 -2
- package/src/ssr/index.tsx +38 -46
- package/src/steplist/createStepList.ts +106 -0
- package/src/steplist/index.ts +8 -0
- package/src/switch/createSwitch.ts +19 -14
- package/src/switch/index.ts +1 -1
- package/src/table/createTable.ts +192 -95
- package/src/table/createTableCell.ts +17 -16
- package/src/table/createTableColumnHeader.ts +67 -20
- package/src/table/createTableColumnResize.ts +256 -0
- package/src/table/createTableHeaderRow.ts +7 -7
- package/src/table/createTableRow.ts +206 -91
- package/src/table/createTableRowGroup.ts +5 -7
- package/src/table/createTableSelectAllCheckbox.ts +14 -14
- package/src/table/createTableSelectionCheckbox.ts +8 -8
- package/src/table/index.ts +14 -9
- package/src/table/types.ts +43 -7
- package/src/tabs/createTabs.ts +123 -111
- package/src/tabs/index.ts +1 -1
- package/src/tag/createTag.ts +57 -50
- package/src/tag/createTagGroup.ts +47 -41
- package/src/tag/index.ts +2 -6
- package/src/textfield/createTextField.ts +67 -35
- package/src/textfield/index.ts +1 -5
- package/src/toast/createToast.ts +29 -26
- package/src/toast/createToastRegion.ts +169 -26
- package/src/toast/index.ts +2 -6
- package/src/toggle/createToggle.ts +115 -53
- package/src/toggle/createToggleState.ts +2 -10
- package/src/toggle/index.ts +4 -5
- package/src/toolbar/createToolbar.ts +214 -230
- package/src/toolbar/index.ts +1 -1
- package/src/tooltip/createTooltip.ts +11 -24
- package/src/tooltip/createTooltipTrigger.ts +61 -49
- package/src/tooltip/index.ts +2 -2
- package/src/tree/createTree.ts +128 -72
- package/src/tree/createTreeItem.ts +120 -135
- package/src/tree/createTreeSelectionCheckbox.ts +11 -8
- package/src/tree/index.ts +4 -4
- package/src/tree/types.ts +20 -6
- package/src/utils/animation.ts +151 -0
- package/src/utils/createDescription.ts +6 -23
- package/src/utils/dom.ts +265 -68
- package/src/utils/env.ts +9 -11
- package/src/utils/events.ts +7 -7
- package/src/utils/filterDOMProps.ts +49 -49
- package/src/utils/focus.ts +60 -68
- package/src/utils/geometry.ts +1 -4
- package/src/utils/globalListeners.ts +9 -9
- package/src/utils/index.ts +20 -22
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +49 -15
- package/src/utils/platform.ts +2 -2
- package/src/utils/reactivity.ts +3 -3
- package/src/utils/scrollIntoView.ts +181 -0
- package/src/utils/textSelection.ts +16 -16
- package/src/visually-hidden/createVisuallyHidden.ts +16 -28
- package/src/visually-hidden/index.ts +1 -1
- package/dist/i18n/NumberFormatter.d.ts +0 -43
- package/dist/i18n/NumberFormatter.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.ssr.js +0 -17082
- package/dist/index.ssr.js.map +0 -1
- package/src/i18n/NumberFormatter.ts +0 -266
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { S as scrollIntoViewport } from "./utils.jsx";
|
|
2
|
+
import { a as getEventTarget, g as isTabbable, i as getActiveElement, l as getScrollParent, o as getFocusableTreeWalker, t as focusSafely, y as nodeContains } from "./focus.jsx";
|
|
3
|
+
//#region src/selection/createCollectionRowInteraction.ts
|
|
4
|
+
function lastFocusable(walker) {
|
|
5
|
+
let last = null;
|
|
6
|
+
let next;
|
|
7
|
+
while (next = walker.nextNode()) last = next;
|
|
8
|
+
return last instanceof HTMLElement ? last : null;
|
|
9
|
+
}
|
|
10
|
+
function scrollFocusedElementIntoView(row, element) {
|
|
11
|
+
focusSafely(element);
|
|
12
|
+
scrollIntoViewport(element, { containingElement: getScrollParent(row) });
|
|
13
|
+
}
|
|
14
|
+
function redispatchCollectionArrowKey(row, event) {
|
|
15
|
+
row.parentElement?.dispatchEvent(new KeyboardEvent(event.type, {
|
|
16
|
+
altKey: event.altKey,
|
|
17
|
+
bubbles: true,
|
|
18
|
+
cancelable: event.cancelable,
|
|
19
|
+
code: event.code,
|
|
20
|
+
composed: event.composed,
|
|
21
|
+
ctrlKey: event.ctrlKey,
|
|
22
|
+
key: event.key,
|
|
23
|
+
location: event.location,
|
|
24
|
+
metaKey: event.metaKey,
|
|
25
|
+
repeat: event.repeat,
|
|
26
|
+
shiftKey: event.shiftKey
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
function shouldIgnoreRowEvent(event, row) {
|
|
30
|
+
const target = getEventTarget(event);
|
|
31
|
+
const currentTarget = event.currentTarget;
|
|
32
|
+
return !target || !currentTarget || !nodeContains(currentTarget, target) || !nodeContains(row, target);
|
|
33
|
+
}
|
|
34
|
+
function mergeCollectionRowInteractionProps(rowProps, options) {
|
|
35
|
+
const baseOnKeyDownCapture = rowProps.onKeyDownCapture;
|
|
36
|
+
const baseOnKeyDown = rowProps.onKeyDown;
|
|
37
|
+
const baseOnPointerDown = rowProps.onPointerDown;
|
|
38
|
+
const baseOnMouseDown = rowProps.onMouseDown;
|
|
39
|
+
const onKeyDownCapture = (event) => {
|
|
40
|
+
const row = options.ref();
|
|
41
|
+
const activeElement = getActiveElement(row?.ownerDocument);
|
|
42
|
+
if (options.keyboardNavigationBehavior() !== "arrow" || !row || !activeElement || shouldIgnoreRowEvent(event, row)) {
|
|
43
|
+
baseOnKeyDownCapture?.(event);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const direction = options.direction?.() ?? "ltr";
|
|
47
|
+
const walker = getFocusableTreeWalker(row);
|
|
48
|
+
walker.currentNode = activeElement;
|
|
49
|
+
switch (event.key) {
|
|
50
|
+
case "ArrowLeft": {
|
|
51
|
+
const focusable = direction === "rtl" ? walker.nextNode() : walker.previousNode();
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
event.stopPropagation();
|
|
54
|
+
if (focusable) scrollFocusedElementIntoView(row, focusable);
|
|
55
|
+
else if (direction === "rtl") scrollFocusedElementIntoView(row, row);
|
|
56
|
+
else {
|
|
57
|
+
walker.currentNode = row;
|
|
58
|
+
const lastElement = lastFocusable(walker);
|
|
59
|
+
if (lastElement) scrollFocusedElementIntoView(row, lastElement);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
case "ArrowRight": {
|
|
64
|
+
const focusable = direction === "rtl" ? walker.previousNode() : walker.nextNode();
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
if (focusable) scrollFocusedElementIntoView(row, focusable);
|
|
68
|
+
else if (direction === "ltr") scrollFocusedElementIntoView(row, row);
|
|
69
|
+
else {
|
|
70
|
+
walker.currentNode = row;
|
|
71
|
+
const lastElement = lastFocusable(walker);
|
|
72
|
+
if (lastElement) scrollFocusedElementIntoView(row, lastElement);
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case "ArrowUp":
|
|
77
|
+
case "ArrowDown":
|
|
78
|
+
if (!event.altKey) {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
redispatchCollectionArrowKey(row, event);
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
if (!event.cancelBubble) baseOnKeyDownCapture?.(event);
|
|
86
|
+
};
|
|
87
|
+
const onKeyDown = (event) => {
|
|
88
|
+
const row = options.ref();
|
|
89
|
+
const target = getEventTarget(event);
|
|
90
|
+
const activeElement = getActiveElement(row?.ownerDocument);
|
|
91
|
+
if (row && target && activeElement && !shouldIgnoreRowEvent(event, row)) {
|
|
92
|
+
if (options.keyboardNavigationBehavior() === "tab" && target !== row && event.key !== "Tab") {
|
|
93
|
+
event.stopPropagation();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (options.keyboardNavigationBehavior() === "tab" && event.key === "Tab") {
|
|
97
|
+
const walker = getFocusableTreeWalker(row, { tabbable: true });
|
|
98
|
+
walker.currentNode = activeElement;
|
|
99
|
+
if (event.shiftKey ? walker.previousNode() : walker.nextNode()) event.stopPropagation();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (!event.cancelBubble) baseOnKeyDown?.(event);
|
|
103
|
+
};
|
|
104
|
+
const onPointerDown = (event) => {
|
|
105
|
+
const row = options.ref();
|
|
106
|
+
const target = getEventTarget(event);
|
|
107
|
+
if (row && target && target !== row && isTabbable(target)) {
|
|
108
|
+
event.stopPropagation();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
baseOnPointerDown?.(event);
|
|
112
|
+
};
|
|
113
|
+
const onMouseDown = (event) => {
|
|
114
|
+
const row = options.ref();
|
|
115
|
+
const target = getEventTarget(event);
|
|
116
|
+
if (row && target && target !== row && isTabbable(target)) {
|
|
117
|
+
event.stopPropagation();
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
baseOnMouseDown?.(event);
|
|
121
|
+
};
|
|
122
|
+
return {
|
|
123
|
+
...rowProps,
|
|
124
|
+
onKeyDownCapture: options.keyboardNavigationBehavior() === "arrow" ? onKeyDownCapture : baseOnKeyDownCapture,
|
|
125
|
+
onKeyDown,
|
|
126
|
+
onPointerDown,
|
|
127
|
+
onMouseDown
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
export { mergeCollectionRowInteractionProps as t };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=createCollectionRowInteraction.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createCollectionRowInteraction.jsx","names":[],"sources":["../../src/selection/createCollectionRowInteraction.ts"],"sourcesContent":["import type { Accessor, JSX } from \"solid-js\";\nimport {\n getActiveElement,\n getEventTarget,\n getFocusableTreeWalker,\n getScrollParent,\n isTabbable,\n nodeContains,\n} from \"../utils/dom\";\nimport { focusSafely } from \"../utils/focus\";\nimport { scrollIntoViewport } from \"../utils/scrollIntoView\";\n\ntype KeyboardNavigationBehavior = \"arrow\" | \"tab\";\n\ninterface CollectionRowInteractionOptions {\n ref: Accessor<HTMLElement | null>;\n keyboardNavigationBehavior: Accessor<KeyboardNavigationBehavior>;\n direction?: Accessor<\"ltr\" | \"rtl\">;\n}\n\ntype CollectionRowInteractionProps<T extends HTMLElement> = JSX.HTMLAttributes<T> & {\n onKeyDownCapture?: JSX.EventHandler<T, KeyboardEvent>;\n};\n\nfunction lastFocusable(walker: TreeWalker): HTMLElement | null {\n let last: Node | null = null;\n let next: Node | null;\n while ((next = walker.nextNode())) {\n last = next;\n }\n return last instanceof HTMLElement ? last : null;\n}\n\nfunction scrollFocusedElementIntoView(row: HTMLElement, element: HTMLElement): void {\n focusSafely(element);\n scrollIntoViewport(element, { containingElement: getScrollParent(row) });\n}\n\nfunction redispatchCollectionArrowKey(row: HTMLElement, event: KeyboardEvent): void {\n row.parentElement?.dispatchEvent(\n new KeyboardEvent(event.type, {\n altKey: event.altKey,\n bubbles: true,\n cancelable: event.cancelable,\n code: event.code,\n composed: event.composed,\n ctrlKey: event.ctrlKey,\n key: event.key,\n location: event.location,\n metaKey: event.metaKey,\n repeat: event.repeat,\n shiftKey: event.shiftKey,\n }),\n );\n}\n\nfunction shouldIgnoreRowEvent(event: Event, row: HTMLElement): boolean {\n const target = getEventTarget<Element>(event);\n const currentTarget = event.currentTarget as Element | null;\n return (\n !target || !currentTarget || !nodeContains(currentTarget, target) || !nodeContains(row, target)\n );\n}\n\nexport function mergeCollectionRowInteractionProps<T extends HTMLElement>(\n rowProps: CollectionRowInteractionProps<T>,\n options: CollectionRowInteractionOptions,\n): CollectionRowInteractionProps<T> {\n const baseOnKeyDownCapture = rowProps.onKeyDownCapture as\n | ((event: KeyboardEvent) => void)\n | undefined;\n const baseOnKeyDown = rowProps.onKeyDown as ((event: KeyboardEvent) => void) | undefined;\n const baseOnPointerDown = rowProps.onPointerDown as ((event: PointerEvent) => void) | undefined;\n const baseOnMouseDown = rowProps.onMouseDown as ((event: MouseEvent) => void) | undefined;\n\n const onKeyDownCapture = (event: KeyboardEvent) => {\n const row = options.ref();\n const activeElement = getActiveElement(row?.ownerDocument);\n if (\n options.keyboardNavigationBehavior() !== \"arrow\" ||\n !row ||\n !activeElement ||\n shouldIgnoreRowEvent(event, row)\n ) {\n baseOnKeyDownCapture?.(event);\n return;\n }\n\n const direction = options.direction?.() ?? \"ltr\";\n const walker = getFocusableTreeWalker(row);\n walker.currentNode = activeElement;\n\n switch (event.key) {\n case \"ArrowLeft\": {\n const focusable =\n direction === \"rtl\"\n ? (walker.nextNode() as HTMLElement | null)\n : (walker.previousNode() as HTMLElement | null);\n\n event.preventDefault();\n event.stopPropagation();\n\n if (focusable) {\n scrollFocusedElementIntoView(row, focusable);\n } else if (direction === \"rtl\") {\n scrollFocusedElementIntoView(row, row);\n } else {\n walker.currentNode = row;\n const lastElement = lastFocusable(walker);\n if (lastElement) {\n scrollFocusedElementIntoView(row, lastElement);\n }\n }\n break;\n }\n case \"ArrowRight\": {\n const focusable =\n direction === \"rtl\"\n ? (walker.previousNode() as HTMLElement | null)\n : (walker.nextNode() as HTMLElement | null);\n\n event.preventDefault();\n event.stopPropagation();\n\n if (focusable) {\n scrollFocusedElementIntoView(row, focusable);\n } else if (direction === \"ltr\") {\n scrollFocusedElementIntoView(row, row);\n } else {\n walker.currentNode = row;\n const lastElement = lastFocusable(walker);\n if (lastElement) {\n scrollFocusedElementIntoView(row, lastElement);\n }\n }\n break;\n }\n case \"ArrowUp\":\n case \"ArrowDown\": {\n if (!event.altKey) {\n event.preventDefault();\n event.stopPropagation();\n redispatchCollectionArrowKey(row, event);\n }\n break;\n }\n }\n\n if (!event.cancelBubble) {\n baseOnKeyDownCapture?.(event);\n }\n };\n\n const onKeyDown = (event: KeyboardEvent) => {\n const row = options.ref();\n const target = getEventTarget<Element>(event);\n const activeElement = getActiveElement(row?.ownerDocument);\n\n if (row && target && activeElement && !shouldIgnoreRowEvent(event, row)) {\n if (options.keyboardNavigationBehavior() === \"tab\" && target !== row && event.key !== \"Tab\") {\n event.stopPropagation();\n return;\n }\n\n if (options.keyboardNavigationBehavior() === \"tab\" && event.key === \"Tab\") {\n const walker = getFocusableTreeWalker(row, { tabbable: true });\n walker.currentNode = activeElement;\n const next = event.shiftKey ? walker.previousNode() : walker.nextNode();\n\n if (next) {\n event.stopPropagation();\n }\n }\n }\n\n if (!event.cancelBubble) {\n baseOnKeyDown?.(event);\n }\n };\n\n const onPointerDown = (event: PointerEvent) => {\n const row = options.ref();\n const target = getEventTarget<Element>(event);\n if (row && target && target !== row && isTabbable(target)) {\n event.stopPropagation();\n return;\n }\n baseOnPointerDown?.(event);\n };\n\n const onMouseDown = (event: MouseEvent) => {\n const row = options.ref();\n const target = getEventTarget<Element>(event);\n if (row && target && target !== row && isTabbable(target)) {\n event.stopPropagation();\n return;\n }\n baseOnMouseDown?.(event);\n };\n\n return {\n ...rowProps,\n onKeyDownCapture:\n options.keyboardNavigationBehavior() === \"arrow\" ? onKeyDownCapture : baseOnKeyDownCapture,\n onKeyDown,\n onPointerDown,\n onMouseDown,\n };\n}\n"],"mappings":";;;AAwBA,SAAS,cAAc,QAAwC;CAC7D,IAAI,OAAoB;CACxB,IAAI;CACJ,OAAQ,OAAO,OAAO,SAAS,GAC7B,OAAO;CAET,OAAO,gBAAgB,cAAc,OAAO;AAC9C;AAEA,SAAS,6BAA6B,KAAkB,SAA4B;CAClF,YAAY,OAAO;CACnB,mBAAmB,SAAS,EAAE,mBAAmB,gBAAgB,GAAG,EAAE,CAAC;AACzE;AAEA,SAAS,6BAA6B,KAAkB,OAA4B;CAClF,IAAI,eAAe,cACjB,IAAI,cAAc,MAAM,MAAM;EAC5B,QAAQ,MAAM;EACd,SAAS;EACT,YAAY,MAAM;EAClB,MAAM,MAAM;EACZ,UAAU,MAAM;EAChB,SAAS,MAAM;EACf,KAAK,MAAM;EACX,UAAU,MAAM;EAChB,SAAS,MAAM;EACf,QAAQ,MAAM;EACd,UAAU,MAAM;CAClB,CAAC,CACH;AACF;AAEA,SAAS,qBAAqB,OAAc,KAA2B;CACrE,MAAM,SAAS,eAAwB,KAAK;CAC5C,MAAM,gBAAgB,MAAM;CAC5B,OACE,CAAC,UAAU,CAAC,iBAAiB,CAAC,aAAa,eAAe,MAAM,KAAK,CAAC,aAAa,KAAK,MAAM;AAElG;AAEA,SAAgB,mCACd,UACA,SACkC;CAClC,MAAM,uBAAuB,SAAS;CAGtC,MAAM,gBAAgB,SAAS;CAC/B,MAAM,oBAAoB,SAAS;CACnC,MAAM,kBAAkB,SAAS;CAEjC,MAAM,oBAAoB,UAAyB;EACjD,MAAM,MAAM,QAAQ,IAAI;EACxB,MAAM,gBAAgB,iBAAiB,KAAK,aAAa;EACzD,IACE,QAAQ,2BAA2B,MAAM,WACzC,CAAC,OACD,CAAC,iBACD,qBAAqB,OAAO,GAAG,GAC/B;GACA,uBAAuB,KAAK;GAC5B;EACF;EAEA,MAAM,YAAY,QAAQ,YAAY,KAAK;EAC3C,MAAM,SAAS,uBAAuB,GAAG;EACzC,OAAO,cAAc;EAErB,QAAQ,MAAM,KAAd;GACE,KAAK,aAAa;IAChB,MAAM,YACJ,cAAc,QACT,OAAO,SAAS,IAChB,OAAO,aAAa;IAE3B,MAAM,eAAe;IACrB,MAAM,gBAAgB;IAEtB,IAAI,WACF,6BAA6B,KAAK,SAAS;SACtC,IAAI,cAAc,OACvB,6BAA6B,KAAK,GAAG;SAChC;KACL,OAAO,cAAc;KACrB,MAAM,cAAc,cAAc,MAAM;KACxC,IAAI,aACF,6BAA6B,KAAK,WAAW;IAEjD;IACA;GACF;GACA,KAAK,cAAc;IACjB,MAAM,YACJ,cAAc,QACT,OAAO,aAAa,IACpB,OAAO,SAAS;IAEvB,MAAM,eAAe;IACrB,MAAM,gBAAgB;IAEtB,IAAI,WACF,6BAA6B,KAAK,SAAS;SACtC,IAAI,cAAc,OACvB,6BAA6B,KAAK,GAAG;SAChC;KACL,OAAO,cAAc;KACrB,MAAM,cAAc,cAAc,MAAM;KACxC,IAAI,aACF,6BAA6B,KAAK,WAAW;IAEjD;IACA;GACF;GACA,KAAK;GACL,KAAK;IACH,IAAI,CAAC,MAAM,QAAQ;KACjB,MAAM,eAAe;KACrB,MAAM,gBAAgB;KACtB,6BAA6B,KAAK,KAAK;IACzC;IACA;EAEJ;EAEA,IAAI,CAAC,MAAM,cACT,uBAAuB,KAAK;CAEhC;CAEA,MAAM,aAAa,UAAyB;EAC1C,MAAM,MAAM,QAAQ,IAAI;EACxB,MAAM,SAAS,eAAwB,KAAK;EAC5C,MAAM,gBAAgB,iBAAiB,KAAK,aAAa;EAEzD,IAAI,OAAO,UAAU,iBAAiB,CAAC,qBAAqB,OAAO,GAAG,GAAG;GACvE,IAAI,QAAQ,2BAA2B,MAAM,SAAS,WAAW,OAAO,MAAM,QAAQ,OAAO;IAC3F,MAAM,gBAAgB;IACtB;GACF;GAEA,IAAI,QAAQ,2BAA2B,MAAM,SAAS,MAAM,QAAQ,OAAO;IACzE,MAAM,SAAS,uBAAuB,KAAK,EAAE,UAAU,KAAK,CAAC;IAC7D,OAAO,cAAc;IAGrB,IAFa,MAAM,WAAW,OAAO,aAAa,IAAI,OAAO,SAAS,GAGpE,MAAM,gBAAgB;GAE1B;EACF;EAEA,IAAI,CAAC,MAAM,cACT,gBAAgB,KAAK;CAEzB;CAEA,MAAM,iBAAiB,UAAwB;EAC7C,MAAM,MAAM,QAAQ,IAAI;EACxB,MAAM,SAAS,eAAwB,KAAK;EAC5C,IAAI,OAAO,UAAU,WAAW,OAAO,WAAW,MAAM,GAAG;GACzD,MAAM,gBAAgB;GACtB;EACF;EACA,oBAAoB,KAAK;CAC3B;CAEA,MAAM,eAAe,UAAsB;EACzC,MAAM,MAAM,QAAQ,IAAI;EACxB,MAAM,SAAS,eAAwB,KAAK;EAC5C,IAAI,OAAO,UAAU,WAAW,OAAO,WAAW,MAAM,GAAG;GACzD,MAAM,gBAAgB;GACtB;EACF;EACA,kBAAkB,KAAK;CACzB;CAEA,OAAO;EACL,GAAG;EACH,kBACE,QAAQ,2BAA2B,MAAM,UAAU,mBAAmB;EACxE;EACA;EACA;CACF;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { i as access, o as mergeProps } from "./env.js";
|
|
2
|
+
import { createId } from "../ssr/index.js";
|
|
3
|
+
import { t as createLabel } from "./createLabel.js";
|
|
4
|
+
//#region src/label/createField.ts
|
|
5
|
+
/**
|
|
6
|
+
* Provides the accessibility implementation for input fields.
|
|
7
|
+
* Fields accept user input, gain context from their label, and may display
|
|
8
|
+
* a description or error message.
|
|
9
|
+
*
|
|
10
|
+
* @param props - Props for the Field.
|
|
11
|
+
*/
|
|
12
|
+
function createField(props) {
|
|
13
|
+
const getProps = () => access(props);
|
|
14
|
+
const { labelProps, fieldProps: baseLabelFieldProps } = createLabel(props);
|
|
15
|
+
const descriptionId = createId();
|
|
16
|
+
const errorMessageId = createId();
|
|
17
|
+
const getDescriptionProps = () => {
|
|
18
|
+
const { description, errorMessage, isInvalid } = getProps();
|
|
19
|
+
if (!description && !errorMessage && !isInvalid) return {};
|
|
20
|
+
return { id: descriptionId };
|
|
21
|
+
};
|
|
22
|
+
const getErrorMessageProps = () => {
|
|
23
|
+
const { errorMessage, isInvalid } = getProps();
|
|
24
|
+
if (!errorMessage && !isInvalid) return {};
|
|
25
|
+
return { id: errorMessageId };
|
|
26
|
+
};
|
|
27
|
+
const getFieldProps = () => {
|
|
28
|
+
const { description, errorMessage, isInvalid } = getProps();
|
|
29
|
+
const describedByIds = [];
|
|
30
|
+
if (description) describedByIds.push(descriptionId);
|
|
31
|
+
if (isInvalid && errorMessage) describedByIds.push(errorMessageId);
|
|
32
|
+
const existingDescribedBy = getProps()["aria-describedby"];
|
|
33
|
+
if (existingDescribedBy) describedByIds.push(existingDescribedBy);
|
|
34
|
+
return mergeProps(baseLabelFieldProps, { "aria-describedby": describedByIds.length > 0 ? describedByIds.join(" ") : void 0 });
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
get labelProps() {
|
|
38
|
+
return labelProps;
|
|
39
|
+
},
|
|
40
|
+
get fieldProps() {
|
|
41
|
+
return getFieldProps();
|
|
42
|
+
},
|
|
43
|
+
get descriptionProps() {
|
|
44
|
+
return getDescriptionProps();
|
|
45
|
+
},
|
|
46
|
+
get errorMessageProps() {
|
|
47
|
+
return getErrorMessageProps();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { createField as t };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=createField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createField.js","names":[],"sources":["../../src/label/createField.ts"],"sourcesContent":["/**\n * Field hook for Solidaria\n *\n * Provides the accessibility implementation for input fields.\n * Fields accept user input, gain context from their label, and may display\n * a description or error message.\n *\n * This is a 1:1 port of @react-aria/label's useField hook.\n */\n\nimport { JSX } from \"solid-js\";\nimport { createId } from \"../ssr\";\nimport {\n createLabel,\n type LabelAriaProps,\n type LabelAria,\n type AriaLabelingProps,\n type DOMProps,\n} from \"./createLabel\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { type MaybeAccessor, access } from \"../utils/reactivity\";\n\nexport interface HelpTextProps {\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: JSX.Element;\n /** An error message for the field. */\n errorMessage?: JSX.Element | ((validation: ValidationResult) => JSX.Element);\n}\n\nexport interface ValidationResult {\n /** Whether the input value is invalid. */\n isInvalid: boolean;\n /** The current error messages for the input if it is invalid, otherwise an empty array. */\n validationErrors: string[];\n /** The native validity state for the input. */\n validationDetails: ValidityState;\n}\n\nexport interface Validation<T> {\n /** Whether the input value is invalid. */\n isInvalid?: boolean;\n /** Whether the input is required before form submission. */\n isRequired?: boolean;\n /** A function that returns an error message if a given value is invalid. */\n validate?: (value: T) => string | string[] | true | null | undefined;\n}\n\nexport interface AriaFieldProps\n extends LabelAriaProps, HelpTextProps, Omit<Validation<any>, \"isRequired\"> {}\n\nexport interface FieldAria extends LabelAria {\n /** Props for the description element, if any. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element, if any. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the accessibility implementation for input fields.\n * Fields accept user input, gain context from their label, and may display\n * a description or error message.\n *\n * @param props - Props for the Field.\n */\nexport function createField(props: MaybeAccessor<AriaFieldProps>): FieldAria {\n const getProps = () => access(props);\n\n const { labelProps, fieldProps: baseLabelFieldProps } = createLabel(props);\n\n // Generate IDs for description and error message\n const descriptionId = createId();\n const errorMessageId = createId();\n\n const getDescriptionProps = (): FieldAria[\"descriptionProps\"] => {\n const { description, errorMessage, isInvalid } = getProps();\n\n // Only include ID if description exists or there's an error message that might be shown\n if (!description && !errorMessage && !isInvalid) {\n return {};\n }\n\n return {\n id: descriptionId,\n };\n };\n\n const getErrorMessageProps = (): FieldAria[\"errorMessageProps\"] => {\n const { errorMessage, isInvalid } = getProps();\n\n // Only include ID if there's an error message and the field is invalid\n if (!errorMessage && !isInvalid) {\n return {};\n }\n\n return {\n id: errorMessageId,\n };\n };\n\n const getFieldProps = (): AriaLabelingProps & DOMProps => {\n const { description, errorMessage, isInvalid } = getProps();\n\n const describedByIds: string[] = [];\n\n // Add description ID if description exists\n if (description) {\n describedByIds.push(descriptionId);\n }\n\n // Add error message ID if field is invalid and error message exists\n // Use aria-describedby for error message because aria-errormessage is unsupported\n // using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268\n if (isInvalid && errorMessage) {\n describedByIds.push(errorMessageId);\n }\n\n // Add any existing aria-describedby from props\n const existingDescribedBy = getProps()[\"aria-describedby\"];\n if (existingDescribedBy) {\n describedByIds.push(existingDescribedBy);\n }\n\n const ariaDescribedBy = describedByIds.length > 0 ? describedByIds.join(\" \") : undefined;\n\n return mergeProps(baseLabelFieldProps, {\n \"aria-describedby\": ariaDescribedBy,\n }) as AriaLabelingProps & DOMProps;\n };\n\n return {\n get labelProps() {\n return labelProps;\n },\n get fieldProps() {\n return getFieldProps();\n },\n get descriptionProps() {\n return getDescriptionProps();\n },\n get errorMessageProps() {\n return getErrorMessageProps();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAgEA,SAAgB,YAAY,OAAiD;CAC3E,MAAM,iBAAiB,OAAO,KAAK;CAEnC,MAAM,EAAE,YAAY,YAAY,wBAAwB,YAAY,KAAK;CAGzE,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiB,SAAS;CAEhC,MAAM,4BAA2D;EAC/D,MAAM,EAAE,aAAa,cAAc,cAAc,SAAS;EAG1D,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,WACpC,OAAO,CAAC;EAGV,OAAO,EACL,IAAI,cACN;CACF;CAEA,MAAM,6BAA6D;EACjE,MAAM,EAAE,cAAc,cAAc,SAAS;EAG7C,IAAI,CAAC,gBAAgB,CAAC,WACpB,OAAO,CAAC;EAGV,OAAO,EACL,IAAI,eACN;CACF;CAEA,MAAM,sBAAoD;EACxD,MAAM,EAAE,aAAa,cAAc,cAAc,SAAS;EAE1D,MAAM,iBAA2B,CAAC;EAGlC,IAAI,aACF,eAAe,KAAK,aAAa;EAMnC,IAAI,aAAa,cACf,eAAe,KAAK,cAAc;EAIpC,MAAM,sBAAsB,SAAS,CAAC,CAAC;EACvC,IAAI,qBACF,eAAe,KAAK,mBAAmB;EAKzC,OAAO,WAAW,qBAAqB,EACrC,oBAHsB,eAAe,SAAS,IAAI,eAAe,KAAK,GAAG,IAAI,KAAA,EAI/E,CAAC;CACH;CAEA,OAAO;EACL,IAAI,aAAa;GACf,OAAO;EACT;EACA,IAAI,aAAa;GACf,OAAO,cAAc;EACvB;EACA,IAAI,mBAAmB;GACrB,OAAO,oBAAoB;EAC7B;EACA,IAAI,oBAAoB;GACtB,OAAO,qBAAqB;EAC9B;CACF;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { i as access, o as mergeProps } from "./env.jsx";
|
|
2
|
+
import { createId } from "../ssr/index.jsx";
|
|
3
|
+
import { t as createLabel } from "./createLabel.jsx";
|
|
4
|
+
//#region src/label/createField.ts
|
|
5
|
+
/**
|
|
6
|
+
* Provides the accessibility implementation for input fields.
|
|
7
|
+
* Fields accept user input, gain context from their label, and may display
|
|
8
|
+
* a description or error message.
|
|
9
|
+
*
|
|
10
|
+
* @param props - Props for the Field.
|
|
11
|
+
*/
|
|
12
|
+
function createField(props) {
|
|
13
|
+
const getProps = () => access(props);
|
|
14
|
+
const { labelProps, fieldProps: baseLabelFieldProps } = createLabel(props);
|
|
15
|
+
const descriptionId = createId();
|
|
16
|
+
const errorMessageId = createId();
|
|
17
|
+
const getDescriptionProps = () => {
|
|
18
|
+
const { description, errorMessage, isInvalid } = getProps();
|
|
19
|
+
if (!description && !errorMessage && !isInvalid) return {};
|
|
20
|
+
return { id: descriptionId };
|
|
21
|
+
};
|
|
22
|
+
const getErrorMessageProps = () => {
|
|
23
|
+
const { errorMessage, isInvalid } = getProps();
|
|
24
|
+
if (!errorMessage && !isInvalid) return {};
|
|
25
|
+
return { id: errorMessageId };
|
|
26
|
+
};
|
|
27
|
+
const getFieldProps = () => {
|
|
28
|
+
const { description, errorMessage, isInvalid } = getProps();
|
|
29
|
+
const describedByIds = [];
|
|
30
|
+
if (description) describedByIds.push(descriptionId);
|
|
31
|
+
if (isInvalid && errorMessage) describedByIds.push(errorMessageId);
|
|
32
|
+
const existingDescribedBy = getProps()["aria-describedby"];
|
|
33
|
+
if (existingDescribedBy) describedByIds.push(existingDescribedBy);
|
|
34
|
+
return mergeProps(baseLabelFieldProps, { "aria-describedby": describedByIds.length > 0 ? describedByIds.join(" ") : void 0 });
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
get labelProps() {
|
|
38
|
+
return labelProps;
|
|
39
|
+
},
|
|
40
|
+
get fieldProps() {
|
|
41
|
+
return getFieldProps();
|
|
42
|
+
},
|
|
43
|
+
get descriptionProps() {
|
|
44
|
+
return getDescriptionProps();
|
|
45
|
+
},
|
|
46
|
+
get errorMessageProps() {
|
|
47
|
+
return getErrorMessageProps();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { createField as t };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=createField.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createField.jsx","names":[],"sources":["../../src/label/createField.ts"],"sourcesContent":["/**\n * Field hook for Solidaria\n *\n * Provides the accessibility implementation for input fields.\n * Fields accept user input, gain context from their label, and may display\n * a description or error message.\n *\n * This is a 1:1 port of @react-aria/label's useField hook.\n */\n\nimport { JSX } from \"solid-js\";\nimport { createId } from \"../ssr\";\nimport {\n createLabel,\n type LabelAriaProps,\n type LabelAria,\n type AriaLabelingProps,\n type DOMProps,\n} from \"./createLabel\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { type MaybeAccessor, access } from \"../utils/reactivity\";\n\nexport interface HelpTextProps {\n /** A description for the field. Provides a hint such as specific requirements for what to choose. */\n description?: JSX.Element;\n /** An error message for the field. */\n errorMessage?: JSX.Element | ((validation: ValidationResult) => JSX.Element);\n}\n\nexport interface ValidationResult {\n /** Whether the input value is invalid. */\n isInvalid: boolean;\n /** The current error messages for the input if it is invalid, otherwise an empty array. */\n validationErrors: string[];\n /** The native validity state for the input. */\n validationDetails: ValidityState;\n}\n\nexport interface Validation<T> {\n /** Whether the input value is invalid. */\n isInvalid?: boolean;\n /** Whether the input is required before form submission. */\n isRequired?: boolean;\n /** A function that returns an error message if a given value is invalid. */\n validate?: (value: T) => string | string[] | true | null | undefined;\n}\n\nexport interface AriaFieldProps\n extends LabelAriaProps, HelpTextProps, Omit<Validation<any>, \"isRequired\"> {}\n\nexport interface FieldAria extends LabelAria {\n /** Props for the description element, if any. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the error message element, if any. */\n errorMessageProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the accessibility implementation for input fields.\n * Fields accept user input, gain context from their label, and may display\n * a description or error message.\n *\n * @param props - Props for the Field.\n */\nexport function createField(props: MaybeAccessor<AriaFieldProps>): FieldAria {\n const getProps = () => access(props);\n\n const { labelProps, fieldProps: baseLabelFieldProps } = createLabel(props);\n\n // Generate IDs for description and error message\n const descriptionId = createId();\n const errorMessageId = createId();\n\n const getDescriptionProps = (): FieldAria[\"descriptionProps\"] => {\n const { description, errorMessage, isInvalid } = getProps();\n\n // Only include ID if description exists or there's an error message that might be shown\n if (!description && !errorMessage && !isInvalid) {\n return {};\n }\n\n return {\n id: descriptionId,\n };\n };\n\n const getErrorMessageProps = (): FieldAria[\"errorMessageProps\"] => {\n const { errorMessage, isInvalid } = getProps();\n\n // Only include ID if there's an error message and the field is invalid\n if (!errorMessage && !isInvalid) {\n return {};\n }\n\n return {\n id: errorMessageId,\n };\n };\n\n const getFieldProps = (): AriaLabelingProps & DOMProps => {\n const { description, errorMessage, isInvalid } = getProps();\n\n const describedByIds: string[] = [];\n\n // Add description ID if description exists\n if (description) {\n describedByIds.push(descriptionId);\n }\n\n // Add error message ID if field is invalid and error message exists\n // Use aria-describedby for error message because aria-errormessage is unsupported\n // using VoiceOver or NVDA. See https://github.com/adobe/react-spectrum/issues/1346#issuecomment-740136268\n if (isInvalid && errorMessage) {\n describedByIds.push(errorMessageId);\n }\n\n // Add any existing aria-describedby from props\n const existingDescribedBy = getProps()[\"aria-describedby\"];\n if (existingDescribedBy) {\n describedByIds.push(existingDescribedBy);\n }\n\n const ariaDescribedBy = describedByIds.length > 0 ? describedByIds.join(\" \") : undefined;\n\n return mergeProps(baseLabelFieldProps, {\n \"aria-describedby\": ariaDescribedBy,\n }) as AriaLabelingProps & DOMProps;\n };\n\n return {\n get labelProps() {\n return labelProps;\n },\n get fieldProps() {\n return getFieldProps();\n },\n get descriptionProps() {\n return getDescriptionProps();\n },\n get errorMessageProps() {\n return getErrorMessageProps();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAgEA,SAAgB,YAAY,OAAiD;CAC3E,MAAM,iBAAiB,OAAO,KAAK;CAEnC,MAAM,EAAE,YAAY,YAAY,wBAAwB,YAAY,KAAK;CAGzE,MAAM,gBAAgB,SAAS;CAC/B,MAAM,iBAAiB,SAAS;CAEhC,MAAM,4BAA2D;EAC/D,MAAM,EAAE,aAAa,cAAc,cAAc,SAAS;EAG1D,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,WACpC,OAAO,CAAC;EAGV,OAAO,EACL,IAAI,cACN;CACF;CAEA,MAAM,6BAA6D;EACjE,MAAM,EAAE,cAAc,cAAc,SAAS;EAG7C,IAAI,CAAC,gBAAgB,CAAC,WACpB,OAAO,CAAC;EAGV,OAAO,EACL,IAAI,eACN;CACF;CAEA,MAAM,sBAAoD;EACxD,MAAM,EAAE,aAAa,cAAc,cAAc,SAAS;EAE1D,MAAM,iBAA2B,CAAC;EAGlC,IAAI,aACF,eAAe,KAAK,aAAa;EAMnC,IAAI,aAAa,cACf,eAAe,KAAK,cAAc;EAIpC,MAAM,sBAAsB,SAAS,CAAC,CAAC;EACvC,IAAI,qBACF,eAAe,KAAK,mBAAmB;EAKzC,OAAO,WAAW,qBAAqB,EACrC,oBAHsB,eAAe,SAAS,IAAI,eAAe,KAAK,GAAG,IAAI,KAAA,EAI/E,CAAC;CACH;CAEA,OAAO;EACL,IAAI,aAAa;GACf,OAAO;EACT;EACA,IAAI,aAAa;GACf,OAAO,cAAc;EACvB;EACA,IAAI,mBAAmB;GACrB,OAAO,oBAAoB;EAC7B;EACA,IAAI,oBAAoB;GACtB,OAAO,qBAAqB;EAC9B;CACF;AACF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { a as getEventTarget, s as getOwnerDocument } from "./focus.js";
|
|
2
|
+
import { onCleanup } from "solid-js";
|
|
3
|
+
//#region src/interactions/createFocus.ts
|
|
4
|
+
/**
|
|
5
|
+
* createFocus - Handles focus events for the immediate target.
|
|
6
|
+
*
|
|
7
|
+
* This is a 1-1 port of React-Aria's useFocus hook adapted for SolidJS.
|
|
8
|
+
* Focus events on child elements will be ignored.
|
|
9
|
+
*/
|
|
10
|
+
function getActiveElement(doc) {
|
|
11
|
+
let activeElement = doc.activeElement;
|
|
12
|
+
while (activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot?.activeElement ?? null;
|
|
13
|
+
return activeElement;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Synthetic blur event handler for Firefox bug workaround.
|
|
17
|
+
* React (and we) don't fire onBlur when an element is disabled.
|
|
18
|
+
* Most browsers fire a native focusout event in this case, except for Firefox.
|
|
19
|
+
* We use a MutationObserver to watch for the disabled attribute.
|
|
20
|
+
*/
|
|
21
|
+
function createSyntheticBlurHandler() {
|
|
22
|
+
let isFocused = false;
|
|
23
|
+
let observer = null;
|
|
24
|
+
return (_e, target) => {
|
|
25
|
+
if (target instanceof HTMLButtonElement || target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) {
|
|
26
|
+
isFocused = true;
|
|
27
|
+
const onBlurHandler = (_blurEvent) => {
|
|
28
|
+
isFocused = false;
|
|
29
|
+
if (observer) {
|
|
30
|
+
observer.disconnect();
|
|
31
|
+
observer = null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
target.addEventListener("focusout", onBlurHandler, { once: true });
|
|
35
|
+
observer = new MutationObserver(() => {
|
|
36
|
+
if (isFocused && target.disabled) {
|
|
37
|
+
isFocused = false;
|
|
38
|
+
observer?.disconnect();
|
|
39
|
+
observer = null;
|
|
40
|
+
const ownerDocument = target.ownerDocument;
|
|
41
|
+
const relatedTarget = target === ownerDocument.activeElement ? null : ownerDocument.activeElement;
|
|
42
|
+
target.dispatchEvent(new FocusEvent("blur", { relatedTarget }));
|
|
43
|
+
target.dispatchEvent(new FocusEvent("focusout", {
|
|
44
|
+
bubbles: true,
|
|
45
|
+
relatedTarget
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
observer.observe(target, {
|
|
50
|
+
attributes: true,
|
|
51
|
+
attributeFilter: ["disabled"]
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
if (observer) {
|
|
55
|
+
observer.disconnect();
|
|
56
|
+
observer = null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Handles focus events for the immediate target.
|
|
64
|
+
* Focus events on child elements will be ignored.
|
|
65
|
+
*
|
|
66
|
+
* Based on react-aria's useFocus but adapted for SolidJS.
|
|
67
|
+
*/
|
|
68
|
+
function createFocus(props = {}) {
|
|
69
|
+
const { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
|
|
70
|
+
let cleanupRef;
|
|
71
|
+
const syntheticBlurHandler = createSyntheticBlurHandler();
|
|
72
|
+
onCleanup(() => {
|
|
73
|
+
if (cleanupRef) cleanupRef();
|
|
74
|
+
});
|
|
75
|
+
const onBlur = (e) => {
|
|
76
|
+
if (e.target === e.currentTarget) {
|
|
77
|
+
if (onBlurProp) onBlurProp(e);
|
|
78
|
+
if (onFocusChange) onFocusChange(false);
|
|
79
|
+
cleanupRef?.();
|
|
80
|
+
cleanupRef = void 0;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const onFocus = (e) => {
|
|
84
|
+
const ownerDocument = getOwnerDocument(e.target);
|
|
85
|
+
const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;
|
|
86
|
+
if (e.target === e.currentTarget && activeElement === getEventTarget(e)) {
|
|
87
|
+
if (onFocusProp) onFocusProp(e);
|
|
88
|
+
if (onFocusChange) onFocusChange(true);
|
|
89
|
+
cleanupRef = syntheticBlurHandler(e, e.target);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
if (isDisabled) return { focusProps: {} };
|
|
93
|
+
return { focusProps: {
|
|
94
|
+
onFocus: onFocusProp || onFocusChange || onBlurProp ? onFocus : void 0,
|
|
95
|
+
onBlur: onBlurProp || onFocusChange ? onBlur : void 0
|
|
96
|
+
} };
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { createFocus as t };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=createFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocus.js","names":[],"sources":["../../src/interactions/createFocus.ts"],"sourcesContent":["/**\n * createFocus - Handles focus events for the immediate target.\n *\n * This is a 1-1 port of React-Aria's useFocus hook adapted for SolidJS.\n * Focus events on child elements will be ignored.\n */\n\nimport { JSX, onCleanup } from \"solid-js\";\nimport { getOwnerDocument, getEventTarget } from \"../utils\";\nfunction getActiveElement(doc: Document): Element | null {\n let activeElement = doc.activeElement;\n while (activeElement && (activeElement as Element).shadowRoot?.activeElement) {\n activeElement = (activeElement as Element).shadowRoot?.activeElement ?? null;\n }\n return activeElement;\n}\n\nexport interface FocusEvents {\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n}\n\nexport interface CreateFocusProps extends FocusEvents {\n /** Whether the focus events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusResult {\n /** Props to spread onto the target element. */\n focusProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Synthetic blur event handler for Firefox bug workaround.\n * React (and we) don't fire onBlur when an element is disabled.\n * Most browsers fire a native focusout event in this case, except for Firefox.\n * We use a MutationObserver to watch for the disabled attribute.\n */\nfunction createSyntheticBlurHandler(): (\n _e: FocusEvent,\n target: Element,\n) => (() => void) | undefined {\n let isFocused = false;\n let observer: MutationObserver | null = null;\n\n return (_e: FocusEvent, target: Element) => {\n if (\n target instanceof HTMLButtonElement ||\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n ) {\n isFocused = true;\n\n const onBlurHandler = (_blurEvent: Event) => {\n isFocused = false;\n\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n\n target.addEventListener(\"focusout\", onBlurHandler, { once: true });\n\n observer = new MutationObserver(() => {\n if (isFocused && (target as HTMLButtonElement).disabled) {\n isFocused = false;\n observer?.disconnect();\n observer = null;\n const ownerDocument = target.ownerDocument;\n const relatedTarget =\n target === ownerDocument.activeElement ? null : ownerDocument.activeElement;\n target.dispatchEvent(new FocusEvent(\"blur\", { relatedTarget }));\n target.dispatchEvent(new FocusEvent(\"focusout\", { bubbles: true, relatedTarget }));\n }\n });\n\n observer.observe(target, { attributes: true, attributeFilter: [\"disabled\"] });\n\n // Return cleanup function\n return () => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n }\n\n return undefined;\n };\n}\n\n/**\n * Handles focus events for the immediate target.\n * Focus events on child elements will be ignored.\n *\n * Based on react-aria's useFocus but adapted for SolidJS.\n */\nexport function createFocus(props: CreateFocusProps = {}): FocusResult {\n const { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;\n\n let cleanupRef: (() => void) | undefined;\n const syntheticBlurHandler = createSyntheticBlurHandler();\n\n // Cleanup on unmount\n onCleanup(() => {\n if (cleanupRef) {\n cleanupRef();\n }\n });\n\n const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Only handle if target is the currentTarget (not bubbled from children)\n if (e.target === e.currentTarget) {\n if (onBlurProp) {\n onBlurProp(e);\n }\n\n if (onFocusChange) {\n onFocusChange(false);\n }\n\n cleanupRef?.();\n cleanupRef = undefined;\n }\n };\n\n const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Double check that document.activeElement actually matches e.target\n // in case a previously chained focus handler already moved focus somewhere else.\n const ownerDocument = getOwnerDocument(e.target);\n const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;\n\n if (e.target === e.currentTarget && activeElement === getEventTarget(e)) {\n if (onFocusProp) {\n onFocusProp(e);\n }\n\n if (onFocusChange) {\n onFocusChange(true);\n }\n\n // Set up synthetic blur handler for Firefox bug\n cleanupRef = syntheticBlurHandler(e, e.target);\n }\n };\n\n // If disabled or no handlers, return empty props\n if (isDisabled) {\n return {\n focusProps: {},\n };\n }\n\n const hasHandlers = onFocusProp || onFocusChange || onBlurProp;\n\n return {\n focusProps: {\n onFocus: hasHandlers ? onFocus : undefined,\n onBlur: onBlurProp || onFocusChange ? onBlur : undefined,\n },\n };\n}\n"],"mappings":";;;;;;;;;AASA,SAAS,iBAAiB,KAA+B;CACvD,IAAI,gBAAgB,IAAI;CACxB,OAAO,iBAAkB,cAA0B,YAAY,eAC7D,gBAAiB,cAA0B,YAAY,iBAAiB;CAE1E,OAAO;AACT;;;;;;;AA2BA,SAAS,6BAGqB;CAC5B,IAAI,YAAY;CAChB,IAAI,WAAoC;CAExC,QAAQ,IAAgB,WAAoB;EAC1C,IACE,kBAAkB,qBAClB,kBAAkB,oBAClB,kBAAkB,uBAClB,kBAAkB,mBAClB;GACA,YAAY;GAEZ,MAAM,iBAAiB,eAAsB;IAC3C,YAAY;IAEZ,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;GAEA,OAAO,iBAAiB,YAAY,eAAe,EAAE,MAAM,KAAK,CAAC;GAEjE,WAAW,IAAI,uBAAuB;IACpC,IAAI,aAAc,OAA6B,UAAU;KACvD,YAAY;KACZ,UAAU,WAAW;KACrB,WAAW;KACX,MAAM,gBAAgB,OAAO;KAC7B,MAAM,gBACJ,WAAW,cAAc,gBAAgB,OAAO,cAAc;KAChE,OAAO,cAAc,IAAI,WAAW,QAAQ,EAAE,cAAc,CAAC,CAAC;KAC9D,OAAO,cAAc,IAAI,WAAW,YAAY;MAAE,SAAS;MAAM;KAAc,CAAC,CAAC;IACnF;GACF,CAAC;GAED,SAAS,QAAQ,QAAQ;IAAE,YAAY;IAAM,iBAAiB,CAAC,UAAU;GAAE,CAAC;GAG5E,aAAa;IACX,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;EACF;CAGF;AACF;;;;;;;AAQA,SAAgB,YAAY,QAA0B,CAAC,GAAgB;CACrE,MAAM,EAAE,YAAY,SAAS,aAAa,QAAQ,YAAY,kBAAkB;CAEhF,IAAI;CACJ,MAAM,uBAAuB,2BAA2B;CAGxD,gBAAgB;EACd,IAAI,YACF,WAAW;CAEf,CAAC;CAED,MAAM,UAAqD,MAAM;EAE/D,IAAI,EAAE,WAAW,EAAE,eAAe;GAChC,IAAI,YACF,WAAW,CAAC;GAGd,IAAI,eACF,cAAc,KAAK;GAGrB,aAAa;GACb,aAAa,KAAA;EACf;CACF;CAEA,MAAM,WAAsD,MAAM;EAGhE,MAAM,gBAAgB,iBAAiB,EAAE,MAAM;EAC/C,MAAM,gBAAgB,gBAAgB,iBAAiB,aAAa,IAAI;EAExE,IAAI,EAAE,WAAW,EAAE,iBAAiB,kBAAkB,eAAe,CAAC,GAAG;GACvE,IAAI,aACF,YAAY,CAAC;GAGf,IAAI,eACF,cAAc,IAAI;GAIpB,aAAa,qBAAqB,GAAG,EAAE,MAAM;EAC/C;CACF;CAGA,IAAI,YACF,OAAO,EACL,YAAY,CAAC,EACf;CAKF,OAAO,EACL,YAAY;EACV,SAJgB,eAAe,iBAAiB,aAIzB,UAAU,KAAA;EACjC,QAAQ,cAAc,gBAAgB,SAAS,KAAA;CACjD,EACF;AACF"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { a as getEventTarget, s as getOwnerDocument } from "./focus.jsx";
|
|
2
|
+
import { onCleanup } from "solid-js";
|
|
3
|
+
//#region src/interactions/createFocus.ts
|
|
4
|
+
/**
|
|
5
|
+
* createFocus - Handles focus events for the immediate target.
|
|
6
|
+
*
|
|
7
|
+
* This is a 1-1 port of React-Aria's useFocus hook adapted for SolidJS.
|
|
8
|
+
* Focus events on child elements will be ignored.
|
|
9
|
+
*/
|
|
10
|
+
function getActiveElement(doc) {
|
|
11
|
+
let activeElement = doc.activeElement;
|
|
12
|
+
while (activeElement && activeElement.shadowRoot?.activeElement) activeElement = activeElement.shadowRoot?.activeElement ?? null;
|
|
13
|
+
return activeElement;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Synthetic blur event handler for Firefox bug workaround.
|
|
17
|
+
* React (and we) don't fire onBlur when an element is disabled.
|
|
18
|
+
* Most browsers fire a native focusout event in this case, except for Firefox.
|
|
19
|
+
* We use a MutationObserver to watch for the disabled attribute.
|
|
20
|
+
*/
|
|
21
|
+
function createSyntheticBlurHandler() {
|
|
22
|
+
let isFocused = false;
|
|
23
|
+
let observer = null;
|
|
24
|
+
return (_e, target) => {
|
|
25
|
+
if (target instanceof HTMLButtonElement || target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement) {
|
|
26
|
+
isFocused = true;
|
|
27
|
+
const onBlurHandler = (_blurEvent) => {
|
|
28
|
+
isFocused = false;
|
|
29
|
+
if (observer) {
|
|
30
|
+
observer.disconnect();
|
|
31
|
+
observer = null;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
target.addEventListener("focusout", onBlurHandler, { once: true });
|
|
35
|
+
observer = new MutationObserver(() => {
|
|
36
|
+
if (isFocused && target.disabled) {
|
|
37
|
+
isFocused = false;
|
|
38
|
+
observer?.disconnect();
|
|
39
|
+
observer = null;
|
|
40
|
+
const ownerDocument = target.ownerDocument;
|
|
41
|
+
const relatedTarget = target === ownerDocument.activeElement ? null : ownerDocument.activeElement;
|
|
42
|
+
target.dispatchEvent(new FocusEvent("blur", { relatedTarget }));
|
|
43
|
+
target.dispatchEvent(new FocusEvent("focusout", {
|
|
44
|
+
bubbles: true,
|
|
45
|
+
relatedTarget
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
observer.observe(target, {
|
|
50
|
+
attributes: true,
|
|
51
|
+
attributeFilter: ["disabled"]
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
if (observer) {
|
|
55
|
+
observer.disconnect();
|
|
56
|
+
observer = null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Handles focus events for the immediate target.
|
|
64
|
+
* Focus events on child elements will be ignored.
|
|
65
|
+
*
|
|
66
|
+
* Based on react-aria's useFocus but adapted for SolidJS.
|
|
67
|
+
*/
|
|
68
|
+
function createFocus(props = {}) {
|
|
69
|
+
const { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
|
|
70
|
+
let cleanupRef;
|
|
71
|
+
const syntheticBlurHandler = createSyntheticBlurHandler();
|
|
72
|
+
onCleanup(() => {
|
|
73
|
+
if (cleanupRef) cleanupRef();
|
|
74
|
+
});
|
|
75
|
+
const onBlur = (e) => {
|
|
76
|
+
if (e.target === e.currentTarget) {
|
|
77
|
+
if (onBlurProp) onBlurProp(e);
|
|
78
|
+
if (onFocusChange) onFocusChange(false);
|
|
79
|
+
cleanupRef?.();
|
|
80
|
+
cleanupRef = void 0;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const onFocus = (e) => {
|
|
84
|
+
const ownerDocument = getOwnerDocument(e.target);
|
|
85
|
+
const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;
|
|
86
|
+
if (e.target === e.currentTarget && activeElement === getEventTarget(e)) {
|
|
87
|
+
if (onFocusProp) onFocusProp(e);
|
|
88
|
+
if (onFocusChange) onFocusChange(true);
|
|
89
|
+
cleanupRef = syntheticBlurHandler(e, e.target);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
if (isDisabled) return { focusProps: {} };
|
|
93
|
+
return { focusProps: {
|
|
94
|
+
onFocus: onFocusProp || onFocusChange || onBlurProp ? onFocus : void 0,
|
|
95
|
+
onBlur: onBlurProp || onFocusChange ? onBlur : void 0
|
|
96
|
+
} };
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { createFocus as t };
|
|
100
|
+
|
|
101
|
+
//# sourceMappingURL=createFocus.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocus.jsx","names":[],"sources":["../../src/interactions/createFocus.ts"],"sourcesContent":["/**\n * createFocus - Handles focus events for the immediate target.\n *\n * This is a 1-1 port of React-Aria's useFocus hook adapted for SolidJS.\n * Focus events on child elements will be ignored.\n */\n\nimport { JSX, onCleanup } from \"solid-js\";\nimport { getOwnerDocument, getEventTarget } from \"../utils\";\nfunction getActiveElement(doc: Document): Element | null {\n let activeElement = doc.activeElement;\n while (activeElement && (activeElement as Element).shadowRoot?.activeElement) {\n activeElement = (activeElement as Element).shadowRoot?.activeElement ?? null;\n }\n return activeElement;\n}\n\nexport interface FocusEvents {\n /** Handler that is called when the element receives focus. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler that is called when the element loses focus. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler that is called when the element's focus status changes. */\n onFocusChange?: (isFocused: boolean) => void;\n}\n\nexport interface CreateFocusProps extends FocusEvents {\n /** Whether the focus events should be disabled. */\n isDisabled?: boolean;\n}\n\nexport interface FocusResult {\n /** Props to spread onto the target element. */\n focusProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Synthetic blur event handler for Firefox bug workaround.\n * React (and we) don't fire onBlur when an element is disabled.\n * Most browsers fire a native focusout event in this case, except for Firefox.\n * We use a MutationObserver to watch for the disabled attribute.\n */\nfunction createSyntheticBlurHandler(): (\n _e: FocusEvent,\n target: Element,\n) => (() => void) | undefined {\n let isFocused = false;\n let observer: MutationObserver | null = null;\n\n return (_e: FocusEvent, target: Element) => {\n if (\n target instanceof HTMLButtonElement ||\n target instanceof HTMLInputElement ||\n target instanceof HTMLTextAreaElement ||\n target instanceof HTMLSelectElement\n ) {\n isFocused = true;\n\n const onBlurHandler = (_blurEvent: Event) => {\n isFocused = false;\n\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n\n target.addEventListener(\"focusout\", onBlurHandler, { once: true });\n\n observer = new MutationObserver(() => {\n if (isFocused && (target as HTMLButtonElement).disabled) {\n isFocused = false;\n observer?.disconnect();\n observer = null;\n const ownerDocument = target.ownerDocument;\n const relatedTarget =\n target === ownerDocument.activeElement ? null : ownerDocument.activeElement;\n target.dispatchEvent(new FocusEvent(\"blur\", { relatedTarget }));\n target.dispatchEvent(new FocusEvent(\"focusout\", { bubbles: true, relatedTarget }));\n }\n });\n\n observer.observe(target, { attributes: true, attributeFilter: [\"disabled\"] });\n\n // Return cleanup function\n return () => {\n if (observer) {\n observer.disconnect();\n observer = null;\n }\n };\n }\n\n return undefined;\n };\n}\n\n/**\n * Handles focus events for the immediate target.\n * Focus events on child elements will be ignored.\n *\n * Based on react-aria's useFocus but adapted for SolidJS.\n */\nexport function createFocus(props: CreateFocusProps = {}): FocusResult {\n const { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;\n\n let cleanupRef: (() => void) | undefined;\n const syntheticBlurHandler = createSyntheticBlurHandler();\n\n // Cleanup on unmount\n onCleanup(() => {\n if (cleanupRef) {\n cleanupRef();\n }\n });\n\n const onBlur: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Only handle if target is the currentTarget (not bubbled from children)\n if (e.target === e.currentTarget) {\n if (onBlurProp) {\n onBlurProp(e);\n }\n\n if (onFocusChange) {\n onFocusChange(false);\n }\n\n cleanupRef?.();\n cleanupRef = undefined;\n }\n };\n\n const onFocus: JSX.EventHandler<HTMLElement, FocusEvent> = (e) => {\n // Double check that document.activeElement actually matches e.target\n // in case a previously chained focus handler already moved focus somewhere else.\n const ownerDocument = getOwnerDocument(e.target);\n const activeElement = ownerDocument ? getActiveElement(ownerDocument) : null;\n\n if (e.target === e.currentTarget && activeElement === getEventTarget(e)) {\n if (onFocusProp) {\n onFocusProp(e);\n }\n\n if (onFocusChange) {\n onFocusChange(true);\n }\n\n // Set up synthetic blur handler for Firefox bug\n cleanupRef = syntheticBlurHandler(e, e.target);\n }\n };\n\n // If disabled or no handlers, return empty props\n if (isDisabled) {\n return {\n focusProps: {},\n };\n }\n\n const hasHandlers = onFocusProp || onFocusChange || onBlurProp;\n\n return {\n focusProps: {\n onFocus: hasHandlers ? onFocus : undefined,\n onBlur: onBlurProp || onFocusChange ? onBlur : undefined,\n },\n };\n}\n"],"mappings":";;;;;;;;;AASA,SAAS,iBAAiB,KAA+B;CACvD,IAAI,gBAAgB,IAAI;CACxB,OAAO,iBAAkB,cAA0B,YAAY,eAC7D,gBAAiB,cAA0B,YAAY,iBAAiB;CAE1E,OAAO;AACT;;;;;;;AA2BA,SAAS,6BAGqB;CAC5B,IAAI,YAAY;CAChB,IAAI,WAAoC;CAExC,QAAQ,IAAgB,WAAoB;EAC1C,IACE,kBAAkB,qBAClB,kBAAkB,oBAClB,kBAAkB,uBAClB,kBAAkB,mBAClB;GACA,YAAY;GAEZ,MAAM,iBAAiB,eAAsB;IAC3C,YAAY;IAEZ,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;GAEA,OAAO,iBAAiB,YAAY,eAAe,EAAE,MAAM,KAAK,CAAC;GAEjE,WAAW,IAAI,uBAAuB;IACpC,IAAI,aAAc,OAA6B,UAAU;KACvD,YAAY;KACZ,UAAU,WAAW;KACrB,WAAW;KACX,MAAM,gBAAgB,OAAO;KAC7B,MAAM,gBACJ,WAAW,cAAc,gBAAgB,OAAO,cAAc;KAChE,OAAO,cAAc,IAAI,WAAW,QAAQ,EAAE,cAAc,CAAC,CAAC;KAC9D,OAAO,cAAc,IAAI,WAAW,YAAY;MAAE,SAAS;MAAM;KAAc,CAAC,CAAC;IACnF;GACF,CAAC;GAED,SAAS,QAAQ,QAAQ;IAAE,YAAY;IAAM,iBAAiB,CAAC,UAAU;GAAE,CAAC;GAG5E,aAAa;IACX,IAAI,UAAU;KACZ,SAAS,WAAW;KACpB,WAAW;IACb;GACF;EACF;CAGF;AACF;;;;;;;AAQA,SAAgB,YAAY,QAA0B,CAAC,GAAgB;CACrE,MAAM,EAAE,YAAY,SAAS,aAAa,QAAQ,YAAY,kBAAkB;CAEhF,IAAI;CACJ,MAAM,uBAAuB,2BAA2B;CAGxD,gBAAgB;EACd,IAAI,YACF,WAAW;CAEf,CAAC;CAED,MAAM,UAAqD,MAAM;EAE/D,IAAI,EAAE,WAAW,EAAE,eAAe;GAChC,IAAI,YACF,WAAW,CAAC;GAGd,IAAI,eACF,cAAc,KAAK;GAGrB,aAAa;GACb,aAAa,KAAA;EACf;CACF;CAEA,MAAM,WAAsD,MAAM;EAGhE,MAAM,gBAAgB,iBAAiB,EAAE,MAAM;EAC/C,MAAM,gBAAgB,gBAAgB,iBAAiB,aAAa,IAAI;EAExE,IAAI,EAAE,WAAW,EAAE,iBAAiB,kBAAkB,eAAe,CAAC,GAAG;GACvE,IAAI,aACF,YAAY,CAAC;GAGf,IAAI,eACF,cAAc,IAAI;GAIpB,aAAa,qBAAqB,GAAG,EAAE,MAAM;EAC/C;CACF;CAGA,IAAI,YACF,OAAO,EACL,YAAY,CAAC,EACf;CAKF,OAAO,EACL,YAAY;EACV,SAJgB,eAAe,iBAAiB,aAIzB,UAAU,KAAA;EACjC,QAAQ,cAAc,gBAAgB,SAAS,KAAA;CACjD,EACF;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as createFocus } from "./createFocus.js";
|
|
2
|
+
import { t as createFocusWithin } from "./createFocusWithin.js";
|
|
3
|
+
import { c as isFocusVisible, i as createFocusVisibleListener } from "./createInteractionModality.js";
|
|
4
|
+
import { createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
5
|
+
//#region src/interactions/createFocusRing.ts
|
|
6
|
+
/**
|
|
7
|
+
* createFocusRing hook for Solidaria
|
|
8
|
+
*
|
|
9
|
+
* Determines whether a focus ring should be visible for a given element.
|
|
10
|
+
* Focus rings are visible when the user navigates with keyboard, but hidden
|
|
11
|
+
* when using mouse/touch.
|
|
12
|
+
*
|
|
13
|
+
* Port of @react-aria/focus useFocusRing.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Determines whether a focus ring should be visible for a given element.
|
|
17
|
+
*
|
|
18
|
+
* Focus rings are visible when:
|
|
19
|
+
* - The element is focused AND
|
|
20
|
+
* - The user is navigating with keyboard (not mouse/touch)
|
|
21
|
+
*
|
|
22
|
+
* For text inputs, focus rings are always visible when focused.
|
|
23
|
+
*/
|
|
24
|
+
function createFocusRing(props = {}) {
|
|
25
|
+
const { isTextInput = false, autoFocus = false, within = false } = props;
|
|
26
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
27
|
+
const [focusVisibleFlag, setFocusVisibleFlag] = createSignal(autoFocus || isFocusVisible());
|
|
28
|
+
const isFocusVisible$1 = createMemo(() => isFocused() && focusVisibleFlag());
|
|
29
|
+
createEffect(() => {
|
|
30
|
+
onCleanup(createFocusVisibleListener((visible) => {
|
|
31
|
+
setFocusVisibleFlag(visible);
|
|
32
|
+
}, { isTextInput }));
|
|
33
|
+
});
|
|
34
|
+
const onFocusChange = (focused) => {
|
|
35
|
+
setIsFocused(focused);
|
|
36
|
+
};
|
|
37
|
+
const focusResult = createFocus({
|
|
38
|
+
isDisabled: within,
|
|
39
|
+
onFocusChange
|
|
40
|
+
});
|
|
41
|
+
const focusWithinResult = createFocusWithin({
|
|
42
|
+
isDisabled: !within,
|
|
43
|
+
onFocusWithinChange: onFocusChange
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
isFocused,
|
|
47
|
+
isFocusVisible: isFocusVisible$1,
|
|
48
|
+
focusProps: within ? focusWithinResult.focusWithinProps : focusResult.focusProps
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { createFocusRing as t };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=createFocusRing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusRing.js","names":["isGlobalFocusVisible","isFocusVisible"],"sources":["../../src/interactions/createFocusRing.ts"],"sourcesContent":["/**\n * createFocusRing hook for Solidaria\n *\n * Determines whether a focus ring should be visible for a given element.\n * Focus rings are visible when the user navigates with keyboard, but hidden\n * when using mouse/touch.\n *\n * Port of @react-aria/focus useFocusRing.\n */\n\nimport {\n type JSX,\n type Accessor,\n createSignal,\n createEffect,\n onCleanup,\n createMemo,\n} from \"solid-js\";\nimport { createFocus } from \"./createFocus\";\nimport { createFocusWithin } from \"./createFocusWithin\";\nimport {\n createFocusVisibleListener,\n isFocusVisible as isGlobalFocusVisible,\n} from \"./createInteractionModality\";\n\nexport interface FocusRingProps {\n /** Whether the element is a text input. */\n isTextInput?: boolean;\n /** Whether the element will be auto focused. */\n autoFocus?: boolean;\n /** Whether focus should be tracked within the element. */\n within?: boolean;\n}\n\nexport interface FocusRingResult {\n /** Whether the element is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the focus ring should be visible. */\n isFocusVisible: Accessor<boolean>;\n /** Props to spread on the element to track focus. */\n focusProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Determines whether a focus ring should be visible for a given element.\n *\n * Focus rings are visible when:\n * - The element is focused AND\n * - The user is navigating with keyboard (not mouse/touch)\n *\n * For text inputs, focus rings are always visible when focused.\n */\nexport function createFocusRing(props: FocusRingProps = {}): FocusRingResult {\n const { isTextInput = false, autoFocus = false, within = false } = props;\n\n const [isFocused, setIsFocused] = createSignal(false);\n const [focusVisibleFlag, setFocusVisibleFlag] = createSignal(autoFocus || isGlobalFocusVisible());\n const isFocusVisible = createMemo(() => isFocused() && focusVisibleFlag());\n\n createEffect(() => {\n const cleanup = createFocusVisibleListener(\n (visible) => {\n setFocusVisibleFlag(visible);\n },\n { isTextInput },\n );\n onCleanup(cleanup);\n });\n\n const onFocusChange = (focused: boolean) => {\n setIsFocused(focused);\n };\n\n const focusResult = createFocus({\n isDisabled: within,\n onFocusChange,\n });\n\n const focusWithinResult = createFocusWithin({\n isDisabled: !within,\n onFocusWithinChange: onFocusChange,\n });\n\n return {\n isFocused,\n isFocusVisible,\n focusProps: (within\n ? focusWithinResult.focusWithinProps\n : focusResult.focusProps) as JSX.HTMLAttributes<HTMLElement>,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,gBAAgB,QAAwB,CAAC,GAAoB;CAC3E,MAAM,EAAE,cAAc,OAAO,YAAY,OAAO,SAAS,UAAU;CAEnE,MAAM,CAAC,WAAW,gBAAgB,aAAa,KAAK;CACpD,MAAM,CAAC,kBAAkB,uBAAuB,aAAa,aAAaA,eAAqB,CAAC;CAChG,MAAMC,mBAAiB,iBAAiB,UAAU,KAAK,iBAAiB,CAAC;CAEzE,mBAAmB;EAOjB,UANgB,4BACb,YAAY;GACX,oBAAoB,OAAO;EAC7B,GACA,EAAE,YAAY,CAEA,CAAC;CACnB,CAAC;CAED,MAAM,iBAAiB,YAAqB;EAC1C,aAAa,OAAO;CACtB;CAEA,MAAM,cAAc,YAAY;EAC9B,YAAY;EACZ;CACF,CAAC;CAED,MAAM,oBAAoB,kBAAkB;EAC1C,YAAY,CAAC;EACb,qBAAqB;CACvB,CAAC;CAED,OAAO;EACL;EACA,gBAAA;EACA,YAAa,SACT,kBAAkB,mBAClB,YAAY;CAClB;AACF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { t as createFocus } from "./createFocus.jsx";
|
|
2
|
+
import { t as createFocusWithin } from "./createFocusWithin.jsx";
|
|
3
|
+
import { c as isFocusVisible, i as createFocusVisibleListener } from "./createInteractionModality.jsx";
|
|
4
|
+
import { createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
5
|
+
//#region src/interactions/createFocusRing.ts
|
|
6
|
+
/**
|
|
7
|
+
* createFocusRing hook for Solidaria
|
|
8
|
+
*
|
|
9
|
+
* Determines whether a focus ring should be visible for a given element.
|
|
10
|
+
* Focus rings are visible when the user navigates with keyboard, but hidden
|
|
11
|
+
* when using mouse/touch.
|
|
12
|
+
*
|
|
13
|
+
* Port of @react-aria/focus useFocusRing.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Determines whether a focus ring should be visible for a given element.
|
|
17
|
+
*
|
|
18
|
+
* Focus rings are visible when:
|
|
19
|
+
* - The element is focused AND
|
|
20
|
+
* - The user is navigating with keyboard (not mouse/touch)
|
|
21
|
+
*
|
|
22
|
+
* For text inputs, focus rings are always visible when focused.
|
|
23
|
+
*/
|
|
24
|
+
function createFocusRing(props = {}) {
|
|
25
|
+
const { isTextInput = false, autoFocus = false, within = false } = props;
|
|
26
|
+
const [isFocused, setIsFocused] = createSignal(false);
|
|
27
|
+
const [focusVisibleFlag, setFocusVisibleFlag] = createSignal(autoFocus || isFocusVisible());
|
|
28
|
+
const isFocusVisible$1 = createMemo(() => isFocused() && focusVisibleFlag());
|
|
29
|
+
createEffect(() => {
|
|
30
|
+
onCleanup(createFocusVisibleListener((visible) => {
|
|
31
|
+
setFocusVisibleFlag(visible);
|
|
32
|
+
}, { isTextInput }));
|
|
33
|
+
});
|
|
34
|
+
const onFocusChange = (focused) => {
|
|
35
|
+
setIsFocused(focused);
|
|
36
|
+
};
|
|
37
|
+
const focusResult = createFocus({
|
|
38
|
+
isDisabled: within,
|
|
39
|
+
onFocusChange
|
|
40
|
+
});
|
|
41
|
+
const focusWithinResult = createFocusWithin({
|
|
42
|
+
isDisabled: !within,
|
|
43
|
+
onFocusWithinChange: onFocusChange
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
isFocused,
|
|
47
|
+
isFocusVisible: isFocusVisible$1,
|
|
48
|
+
focusProps: within ? focusWithinResult.focusWithinProps : focusResult.focusProps
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { createFocusRing as t };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=createFocusRing.jsx.map
|