@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,1174 @@
|
|
|
1
|
+
import { t as filterDOMProps } from "./filterDOMProps.jsx";
|
|
2
|
+
import { n as focusWithoutScrolling } from "./focus.jsx";
|
|
3
|
+
import { a as useLocale } from "./createCollator.jsx";
|
|
4
|
+
import { createId as createId$1 } from "../ssr/index.jsx";
|
|
5
|
+
import { createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
6
|
+
import { normalizeColor, parseColor } from "@proyecto-viviana/solid-stately";
|
|
7
|
+
//#region src/color/createColorSlider.ts
|
|
8
|
+
/**
|
|
9
|
+
* createColorSlider hook.
|
|
10
|
+
*
|
|
11
|
+
* Provides ARIA attributes and keyboard handling for a color slider.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Creates ARIA props for a color slider.
|
|
15
|
+
*/
|
|
16
|
+
function createColorSlider(props, state, trackRef, inputRef) {
|
|
17
|
+
const getProps = () => props();
|
|
18
|
+
const getState = () => state();
|
|
19
|
+
const locale = useLocale();
|
|
20
|
+
const isRTL = () => locale().direction === "rtl";
|
|
21
|
+
const trackId = createId$1();
|
|
22
|
+
const inputId = createId$1();
|
|
23
|
+
const labelId = createId$1();
|
|
24
|
+
let cleanupPointerDrag;
|
|
25
|
+
let cleanupMouseDrag;
|
|
26
|
+
const getInput = () => inputRef?.() ?? trackRef()?.querySelector("input[type=\"range\"]") ?? null;
|
|
27
|
+
const focusInput = () => {
|
|
28
|
+
focusWithoutScrolling(getInput());
|
|
29
|
+
queueMicrotask(() => focusWithoutScrolling(getInput()));
|
|
30
|
+
};
|
|
31
|
+
const channelName = createMemo(() => {
|
|
32
|
+
const p = getProps();
|
|
33
|
+
if (p.channelName) return p.channelName;
|
|
34
|
+
const s = getState();
|
|
35
|
+
return s.value.getChannelName(s.channel, "en-US");
|
|
36
|
+
});
|
|
37
|
+
const orientation = () => getProps().orientation ?? "horizontal";
|
|
38
|
+
const hasVisibleLabel = () => getProps().label != null;
|
|
39
|
+
const trackElementId = () => getProps().id ?? trackId;
|
|
40
|
+
const trackLabelledBy = () => {
|
|
41
|
+
return getProps()["aria-labelledby"] ?? (hasVisibleLabel() ? labelId : void 0);
|
|
42
|
+
};
|
|
43
|
+
const inputLabelledBy = () => hasVisibleLabel() ? labelId : trackElementId();
|
|
44
|
+
const trackAriaLabel = () => {
|
|
45
|
+
const p = getProps();
|
|
46
|
+
if (p["aria-label"]) return p["aria-label"];
|
|
47
|
+
if (p["aria-labelledby"] || hasVisibleLabel()) return void 0;
|
|
48
|
+
return channelName();
|
|
49
|
+
};
|
|
50
|
+
const updateFromPointer = (clientX, clientY) => {
|
|
51
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
52
|
+
const track = trackRef();
|
|
53
|
+
if (!track) return;
|
|
54
|
+
const rect = track.getBoundingClientRect();
|
|
55
|
+
if (rect.width === 0 || rect.height === 0) return;
|
|
56
|
+
let percent;
|
|
57
|
+
if (orientation() === "vertical") percent = 1 - (clientY - rect.top) / rect.height;
|
|
58
|
+
else {
|
|
59
|
+
const physicalPercent = (clientX - rect.left) / rect.width;
|
|
60
|
+
percent = isRTL() ? 1 - physicalPercent : physicalPercent;
|
|
61
|
+
}
|
|
62
|
+
getState().setThumbPercent(Math.max(0, Math.min(1, percent)));
|
|
63
|
+
};
|
|
64
|
+
const endDrag = (target, pointerId) => {
|
|
65
|
+
const s = getState();
|
|
66
|
+
if (!s.isDragging) return;
|
|
67
|
+
s.setDragging(false);
|
|
68
|
+
focusInput();
|
|
69
|
+
if (pointerId == null) return;
|
|
70
|
+
try {
|
|
71
|
+
target?.releasePointerCapture?.(pointerId);
|
|
72
|
+
} catch {}
|
|
73
|
+
};
|
|
74
|
+
const installPointerDragListeners = () => {
|
|
75
|
+
if (typeof window === "undefined") return;
|
|
76
|
+
cleanupPointerDrag?.();
|
|
77
|
+
const onPointerMove = (e) => {
|
|
78
|
+
if (!getState().isDragging) return;
|
|
79
|
+
updateFromPointer(e.clientX, e.clientY);
|
|
80
|
+
};
|
|
81
|
+
const onPointerEnd = (e) => {
|
|
82
|
+
cleanupPointerDrag?.();
|
|
83
|
+
cleanupPointerDrag = void 0;
|
|
84
|
+
endDrag(trackRef(), e.pointerId);
|
|
85
|
+
};
|
|
86
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
87
|
+
window.addEventListener("pointerup", onPointerEnd);
|
|
88
|
+
window.addEventListener("pointercancel", onPointerEnd);
|
|
89
|
+
cleanupPointerDrag = () => {
|
|
90
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
91
|
+
window.removeEventListener("pointerup", onPointerEnd);
|
|
92
|
+
window.removeEventListener("pointercancel", onPointerEnd);
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
const installMouseDragListeners = () => {
|
|
96
|
+
if (typeof window === "undefined") return;
|
|
97
|
+
cleanupMouseDrag?.();
|
|
98
|
+
const onMouseMove = (e) => {
|
|
99
|
+
if (!getState().isDragging) return;
|
|
100
|
+
updateFromPointer(e.clientX, e.clientY);
|
|
101
|
+
};
|
|
102
|
+
const onMouseEnd = () => {
|
|
103
|
+
cleanupMouseDrag?.();
|
|
104
|
+
cleanupMouseDrag = void 0;
|
|
105
|
+
endDrag(trackRef());
|
|
106
|
+
};
|
|
107
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
108
|
+
window.addEventListener("mouseup", onMouseEnd);
|
|
109
|
+
cleanupMouseDrag = () => {
|
|
110
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
111
|
+
window.removeEventListener("mouseup", onMouseEnd);
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
onCleanup(() => {
|
|
115
|
+
cleanupPointerDrag?.();
|
|
116
|
+
cleanupMouseDrag?.();
|
|
117
|
+
});
|
|
118
|
+
const onTrackPointerDown = (e) => {
|
|
119
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
120
|
+
updateFromPointer(e.clientX, e.clientY);
|
|
121
|
+
focusInput();
|
|
122
|
+
getState().setDragging(true);
|
|
123
|
+
try {
|
|
124
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
125
|
+
} catch {}
|
|
126
|
+
installPointerDragListeners();
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
};
|
|
129
|
+
const onTrackPointerMove = (e) => {
|
|
130
|
+
if (!getState().isDragging) return;
|
|
131
|
+
updateFromPointer(e.clientX, e.clientY);
|
|
132
|
+
};
|
|
133
|
+
const onTrackPointerUp = (e) => {
|
|
134
|
+
cleanupPointerDrag?.();
|
|
135
|
+
cleanupPointerDrag = void 0;
|
|
136
|
+
endDrag(e.currentTarget, e.pointerId);
|
|
137
|
+
};
|
|
138
|
+
const onTrackPointerCancel = (e) => {
|
|
139
|
+
cleanupPointerDrag?.();
|
|
140
|
+
cleanupPointerDrag = void 0;
|
|
141
|
+
endDrag(e.currentTarget, e.pointerId);
|
|
142
|
+
};
|
|
143
|
+
const onTrackMouseDown = (e) => {
|
|
144
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
145
|
+
updateFromPointer(e.clientX, e.clientY);
|
|
146
|
+
getState().setDragging(true);
|
|
147
|
+
installMouseDragListeners();
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
};
|
|
150
|
+
const onTrackMouseMove = (e) => {
|
|
151
|
+
if (!getState().isDragging) return;
|
|
152
|
+
updateFromPointer(e.clientX, e.clientY);
|
|
153
|
+
};
|
|
154
|
+
const onTrackMouseUp = (e) => {
|
|
155
|
+
cleanupMouseDrag?.();
|
|
156
|
+
cleanupMouseDrag = void 0;
|
|
157
|
+
endDrag(e.currentTarget);
|
|
158
|
+
};
|
|
159
|
+
const onKeyDown = (e) => {
|
|
160
|
+
if (e.defaultPrevented) return;
|
|
161
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
162
|
+
const s = getState();
|
|
163
|
+
let handled = true;
|
|
164
|
+
switch (e.key) {
|
|
165
|
+
case "ArrowUp":
|
|
166
|
+
s.incrementThumb();
|
|
167
|
+
break;
|
|
168
|
+
case "ArrowDown":
|
|
169
|
+
s.decrementThumb();
|
|
170
|
+
break;
|
|
171
|
+
case "ArrowRight":
|
|
172
|
+
if (orientation() === "horizontal" && isRTL()) s.decrementThumb();
|
|
173
|
+
else s.incrementThumb();
|
|
174
|
+
break;
|
|
175
|
+
case "ArrowLeft":
|
|
176
|
+
if (orientation() === "horizontal" && isRTL()) s.incrementThumb();
|
|
177
|
+
else s.decrementThumb();
|
|
178
|
+
break;
|
|
179
|
+
case "PageUp":
|
|
180
|
+
s.incrementThumb(s.pageSize);
|
|
181
|
+
break;
|
|
182
|
+
case "PageDown":
|
|
183
|
+
s.decrementThumb(s.pageSize);
|
|
184
|
+
break;
|
|
185
|
+
case "Home":
|
|
186
|
+
s.setThumbValue(s.minValue);
|
|
187
|
+
break;
|
|
188
|
+
case "End":
|
|
189
|
+
s.setThumbValue(s.maxValue);
|
|
190
|
+
break;
|
|
191
|
+
default: handled = false;
|
|
192
|
+
}
|
|
193
|
+
if (handled) {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
e.stopPropagation();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
const generateBackground = () => {
|
|
199
|
+
const s = getState();
|
|
200
|
+
const value = s.getDisplayColor();
|
|
201
|
+
const channel = s.channel;
|
|
202
|
+
const to = orientation() === "vertical" ? "top" : isRTL() ? "left" : "right";
|
|
203
|
+
switch (channel) {
|
|
204
|
+
case "hue": return `linear-gradient(to ${to}, ${[
|
|
205
|
+
0,
|
|
206
|
+
60,
|
|
207
|
+
120,
|
|
208
|
+
180,
|
|
209
|
+
240,
|
|
210
|
+
300,
|
|
211
|
+
360
|
|
212
|
+
].map((hue) => value.withChannelValue("hue", hue).toString("css")).join(", ")})`;
|
|
213
|
+
case "lightness": {
|
|
214
|
+
const min = s.minValue;
|
|
215
|
+
const max = s.maxValue;
|
|
216
|
+
return `linear-gradient(to ${to}, ${value.withChannelValue(channel, min).toString("css")}, ${value.withChannelValue(channel, (max - min) / 2).toString("css")}, ${value.withChannelValue(channel, max).toString("css")})`;
|
|
217
|
+
}
|
|
218
|
+
case "saturation":
|
|
219
|
+
case "brightness":
|
|
220
|
+
case "red":
|
|
221
|
+
case "green":
|
|
222
|
+
case "blue":
|
|
223
|
+
case "alpha": return `linear-gradient(to ${to}, ${value.withChannelValue(channel, s.minValue).toString("css")}, ${value.withChannelValue(channel, s.maxValue).toString("css")})`;
|
|
224
|
+
default: return;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
const trackProps = createMemo(() => {
|
|
228
|
+
const s = getState();
|
|
229
|
+
getProps();
|
|
230
|
+
const bg = generateBackground();
|
|
231
|
+
return {
|
|
232
|
+
id: trackElementId(),
|
|
233
|
+
role: "group",
|
|
234
|
+
"aria-label": trackAriaLabel(),
|
|
235
|
+
"aria-labelledby": trackLabelledBy(),
|
|
236
|
+
onPointerDown: onTrackPointerDown,
|
|
237
|
+
onPointerMove: onTrackPointerMove,
|
|
238
|
+
onPointerUp: onTrackPointerUp,
|
|
239
|
+
onPointerCancel: onTrackPointerCancel,
|
|
240
|
+
onMouseDown: onTrackMouseDown,
|
|
241
|
+
onMouseMove: onTrackMouseMove,
|
|
242
|
+
onMouseUp: onTrackMouseUp,
|
|
243
|
+
style: {
|
|
244
|
+
position: "relative",
|
|
245
|
+
"touch-action": "none",
|
|
246
|
+
"forced-color-adjust": "none",
|
|
247
|
+
...bg ? { background: bg } : {}
|
|
248
|
+
},
|
|
249
|
+
"data-disabled": s.isDisabled || void 0
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
const thumbProps = createMemo(() => {
|
|
253
|
+
const s = getState();
|
|
254
|
+
const p = getProps();
|
|
255
|
+
const percent = s.getThumbPercent();
|
|
256
|
+
const x = orientation() === "horizontal" ? isRTL() ? 1 - percent : percent : .5;
|
|
257
|
+
const y = orientation() === "horizontal" ? .5 : 1 - percent;
|
|
258
|
+
return {
|
|
259
|
+
role: "presentation",
|
|
260
|
+
onKeyDown,
|
|
261
|
+
style: {
|
|
262
|
+
position: "absolute",
|
|
263
|
+
left: `${x * 100}%`,
|
|
264
|
+
top: `${y * 100}%`,
|
|
265
|
+
transform: "translate(-50%, -50%)",
|
|
266
|
+
"touch-action": "none",
|
|
267
|
+
"forced-color-adjust": "none"
|
|
268
|
+
},
|
|
269
|
+
"data-dragging": s.isDragging || void 0,
|
|
270
|
+
"data-disabled": s.isDisabled || p.isDisabled || void 0
|
|
271
|
+
};
|
|
272
|
+
});
|
|
273
|
+
const ariaValueText = () => {
|
|
274
|
+
const s = getState();
|
|
275
|
+
const loc = locale().locale;
|
|
276
|
+
const displayColor = s.getDisplayColor();
|
|
277
|
+
let valueText = s.getThumbValueLabel();
|
|
278
|
+
if (s.channel === "hue") valueText += `, ${displayColor.getHueName(loc)}`;
|
|
279
|
+
else if (s.channel !== "alpha") valueText += `, ${displayColor.getColorName(loc)}`;
|
|
280
|
+
return valueText;
|
|
281
|
+
};
|
|
282
|
+
const inputProps = createMemo(() => {
|
|
283
|
+
const s = getState();
|
|
284
|
+
const p = getProps();
|
|
285
|
+
return {
|
|
286
|
+
type: "range",
|
|
287
|
+
id: inputId,
|
|
288
|
+
min: s.minValue,
|
|
289
|
+
max: s.maxValue,
|
|
290
|
+
step: s.step,
|
|
291
|
+
value: s.getThumbValue(),
|
|
292
|
+
name: p.name,
|
|
293
|
+
form: p.form,
|
|
294
|
+
disabled: s.isDisabled || p.isDisabled,
|
|
295
|
+
tabIndex: s.isDisabled || p.isDisabled ? void 0 : 0,
|
|
296
|
+
"aria-orientation": orientation(),
|
|
297
|
+
"aria-labelledby": inputLabelledBy(),
|
|
298
|
+
"aria-describedby": p["aria-describedby"] ?? "",
|
|
299
|
+
"aria-details": p["aria-details"] ?? "",
|
|
300
|
+
"aria-valuetext": ariaValueText(),
|
|
301
|
+
onKeyDown,
|
|
302
|
+
onInput: (e) => {
|
|
303
|
+
const target = e.target;
|
|
304
|
+
s.setThumbValue(parseFloat(target.value));
|
|
305
|
+
},
|
|
306
|
+
onChange: (e) => {
|
|
307
|
+
const target = e.target;
|
|
308
|
+
s.setThumbValue(parseFloat(target.value));
|
|
309
|
+
},
|
|
310
|
+
onFocus: () => {},
|
|
311
|
+
style: {
|
|
312
|
+
position: "absolute",
|
|
313
|
+
opacity: "0.0001",
|
|
314
|
+
width: "100%",
|
|
315
|
+
height: "100%",
|
|
316
|
+
padding: "0",
|
|
317
|
+
margin: "-1px",
|
|
318
|
+
overflow: "hidden",
|
|
319
|
+
clip: "rect(0, 0, 0, 0)",
|
|
320
|
+
"white-space": "nowrap",
|
|
321
|
+
border: "0",
|
|
322
|
+
"pointer-events": "none"
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
});
|
|
326
|
+
const outputProps = createMemo(() => {
|
|
327
|
+
return {
|
|
328
|
+
"aria-live": "off",
|
|
329
|
+
for: inputId
|
|
330
|
+
};
|
|
331
|
+
});
|
|
332
|
+
const labelProps = createMemo(() => {
|
|
333
|
+
return {
|
|
334
|
+
id: labelId,
|
|
335
|
+
onClick: () => {
|
|
336
|
+
if (typeof document !== "undefined") document.getElementById(inputId)?.focus();
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
});
|
|
340
|
+
return {
|
|
341
|
+
get trackProps() {
|
|
342
|
+
return trackProps();
|
|
343
|
+
},
|
|
344
|
+
get thumbProps() {
|
|
345
|
+
return thumbProps();
|
|
346
|
+
},
|
|
347
|
+
get inputProps() {
|
|
348
|
+
return inputProps();
|
|
349
|
+
},
|
|
350
|
+
get outputProps() {
|
|
351
|
+
return outputProps();
|
|
352
|
+
},
|
|
353
|
+
get labelProps() {
|
|
354
|
+
return labelProps();
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/color/createColorArea.ts
|
|
360
|
+
/**
|
|
361
|
+
* createColorArea hook.
|
|
362
|
+
*
|
|
363
|
+
* Provides ARIA attributes and keyboard/pointer handling for a 2D color area.
|
|
364
|
+
*/
|
|
365
|
+
/**
|
|
366
|
+
* Creates ARIA props for a color area.
|
|
367
|
+
*/
|
|
368
|
+
function createColorArea(props, state, areaRef) {
|
|
369
|
+
const getProps = () => props();
|
|
370
|
+
const getState = () => state();
|
|
371
|
+
const locale = useLocale();
|
|
372
|
+
const isRTL = () => locale().direction === "rtl";
|
|
373
|
+
const [focusedInput, setFocusedInput] = createSignal(null);
|
|
374
|
+
const [valueChangedViaKeyboard, setValueChangedViaKeyboard] = createSignal(false);
|
|
375
|
+
const [valueChangedViaInputChangeEvent, setValueChangedViaInputChangeEvent] = createSignal(false);
|
|
376
|
+
const colorAreaId = createId$1();
|
|
377
|
+
const xInputId = createId$1();
|
|
378
|
+
const yInputId = createId$1();
|
|
379
|
+
const colorPickerLabel = () => "Color picker";
|
|
380
|
+
const colorInputLabel = () => {
|
|
381
|
+
const ariaLabel = getProps()["aria-label"];
|
|
382
|
+
return ariaLabel ? `${ariaLabel}, ${colorPickerLabel()}` : colorPickerLabel();
|
|
383
|
+
};
|
|
384
|
+
const colorAreaLabel = () => {
|
|
385
|
+
const ariaLabel = getProps()["aria-label"];
|
|
386
|
+
return ariaLabel ? `${ariaLabel}, ${colorPickerLabel()}` : void 0;
|
|
387
|
+
};
|
|
388
|
+
const formatChannelValueText = (channel) => {
|
|
389
|
+
const value = getState().getDisplayColor();
|
|
390
|
+
const loc = locale().locale;
|
|
391
|
+
return `${value.getChannelName(channel, loc)}: ${value.formatChannelValue(channel, loc)}`;
|
|
392
|
+
};
|
|
393
|
+
const getAriaValueTextForChannel = (channel) => {
|
|
394
|
+
const s = getState();
|
|
395
|
+
const value = s.getDisplayColor();
|
|
396
|
+
const loc = locale().locale;
|
|
397
|
+
if (valueChangedViaInputChangeEvent() || valueChangedViaKeyboard()) return `${formatChannelValueText(channel)}, ${value.getColorName(loc)}`;
|
|
398
|
+
const otherChannel = channel === s.yChannel ? s.xChannel : s.yChannel;
|
|
399
|
+
return [
|
|
400
|
+
formatChannelValueText(channel),
|
|
401
|
+
formatChannelValueText(otherChannel),
|
|
402
|
+
formatChannelValueText(s.zChannel)
|
|
403
|
+
].join(", ") + `, ${value.getColorName(loc)}`;
|
|
404
|
+
};
|
|
405
|
+
const updateFromInput = (e, axis) => {
|
|
406
|
+
const target = e.target;
|
|
407
|
+
const nextValue = parseFloat(target.value);
|
|
408
|
+
setValueChangedViaInputChangeEvent(true);
|
|
409
|
+
if (axis === "x") getState().setXValue(nextValue);
|
|
410
|
+
else getState().setYValue(nextValue);
|
|
411
|
+
};
|
|
412
|
+
const getPositionFromEvent = (e) => {
|
|
413
|
+
const area = areaRef();
|
|
414
|
+
if (!area) return null;
|
|
415
|
+
const rect = area.getBoundingClientRect();
|
|
416
|
+
if (rect.width === 0 || rect.height === 0) return null;
|
|
417
|
+
const physicalX = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
|
418
|
+
return {
|
|
419
|
+
x: isRTL() ? 1 - physicalX : physicalX,
|
|
420
|
+
y: Math.max(0, Math.min(1, (e.clientY - rect.top) / rect.height))
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
const onPointerDown = (e) => {
|
|
424
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
425
|
+
const pos = getPositionFromEvent(e);
|
|
426
|
+
if (!pos) return;
|
|
427
|
+
getState().setColorFromPoint(pos.x, pos.y);
|
|
428
|
+
getState().setDragging(true);
|
|
429
|
+
e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
430
|
+
};
|
|
431
|
+
const onPointerMove = (e) => {
|
|
432
|
+
if (!getState().isDragging) return;
|
|
433
|
+
const pos = getPositionFromEvent(e);
|
|
434
|
+
if (!pos) return;
|
|
435
|
+
getState().setColorFromPoint(pos.x, pos.y);
|
|
436
|
+
};
|
|
437
|
+
const onPointerUp = (e) => {
|
|
438
|
+
if (getState().isDragging) {
|
|
439
|
+
getState().setDragging(false);
|
|
440
|
+
e.currentTarget.releasePointerCapture?.(e.pointerId);
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
const onKeyDown = (e) => {
|
|
444
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
445
|
+
const s = getState();
|
|
446
|
+
const xStep = e.shiftKey && s.xChannelPageStep > s.xChannelStep ? s.xChannelPageStep : s.xChannelStep;
|
|
447
|
+
const yStep = e.shiftKey && s.yChannelPageStep > s.yChannelStep ? s.yChannelPageStep : s.yChannelStep;
|
|
448
|
+
let focusedAxis = "x";
|
|
449
|
+
let handled = true;
|
|
450
|
+
switch (e.key) {
|
|
451
|
+
case "ArrowRight":
|
|
452
|
+
if (isRTL()) s.decrementX(xStep);
|
|
453
|
+
else s.incrementX(xStep);
|
|
454
|
+
break;
|
|
455
|
+
case "ArrowLeft":
|
|
456
|
+
if (isRTL()) s.incrementX(xStep);
|
|
457
|
+
else s.decrementX(xStep);
|
|
458
|
+
break;
|
|
459
|
+
case "ArrowUp":
|
|
460
|
+
s.incrementY(yStep);
|
|
461
|
+
focusedAxis = "y";
|
|
462
|
+
break;
|
|
463
|
+
case "ArrowDown":
|
|
464
|
+
s.decrementY(yStep);
|
|
465
|
+
focusedAxis = "y";
|
|
466
|
+
break;
|
|
467
|
+
case "PageUp":
|
|
468
|
+
s.incrementY(s.yChannelPageStep);
|
|
469
|
+
focusedAxis = "y";
|
|
470
|
+
break;
|
|
471
|
+
case "PageDown":
|
|
472
|
+
s.decrementY(s.yChannelPageStep);
|
|
473
|
+
focusedAxis = "y";
|
|
474
|
+
break;
|
|
475
|
+
case "Home":
|
|
476
|
+
if (isRTL()) s.incrementX(s.xChannelPageStep);
|
|
477
|
+
else s.decrementX(s.xChannelPageStep);
|
|
478
|
+
break;
|
|
479
|
+
case "End":
|
|
480
|
+
if (isRTL()) s.decrementX(s.xChannelPageStep);
|
|
481
|
+
else s.incrementX(s.xChannelPageStep);
|
|
482
|
+
break;
|
|
483
|
+
default: handled = false;
|
|
484
|
+
}
|
|
485
|
+
if (handled) {
|
|
486
|
+
setFocusedInput(focusedAxis);
|
|
487
|
+
setValueChangedViaKeyboard(true);
|
|
488
|
+
s.setDragging(true);
|
|
489
|
+
s.setDragging(false);
|
|
490
|
+
e.preventDefault();
|
|
491
|
+
e.stopPropagation();
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
const onFocusOut = (e) => {
|
|
495
|
+
const currentTarget = e.currentTarget;
|
|
496
|
+
const relatedTarget = e.relatedTarget;
|
|
497
|
+
if (!relatedTarget || !currentTarget.contains(relatedTarget)) {
|
|
498
|
+
setValueChangedViaKeyboard(false);
|
|
499
|
+
setValueChangedViaInputChangeEvent(false);
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
const colorAreaProps = createMemo(() => {
|
|
503
|
+
const s = getState();
|
|
504
|
+
const p = getProps();
|
|
505
|
+
return {
|
|
506
|
+
id: p.id ?? colorAreaId,
|
|
507
|
+
role: "group",
|
|
508
|
+
"aria-label": colorAreaLabel(),
|
|
509
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
510
|
+
onPointerDown,
|
|
511
|
+
onPointerMove,
|
|
512
|
+
onPointerUp,
|
|
513
|
+
style: {
|
|
514
|
+
position: "relative",
|
|
515
|
+
"touch-action": "none",
|
|
516
|
+
"forced-color-adjust": "none",
|
|
517
|
+
...generateGradient()
|
|
518
|
+
},
|
|
519
|
+
"data-disabled": s.isDisabled || p.isDisabled || void 0
|
|
520
|
+
};
|
|
521
|
+
});
|
|
522
|
+
function generateGradient() {
|
|
523
|
+
const s = getState();
|
|
524
|
+
const value = s.value;
|
|
525
|
+
const xCh = s.xChannel;
|
|
526
|
+
const yCh = s.yChannel;
|
|
527
|
+
const zCh = s.zChannel;
|
|
528
|
+
const zValue = value.getChannelValue(zCh);
|
|
529
|
+
const end = isRTL() ? "left" : "right";
|
|
530
|
+
const hue = (color) => [
|
|
531
|
+
0,
|
|
532
|
+
60,
|
|
533
|
+
120,
|
|
534
|
+
180,
|
|
535
|
+
240,
|
|
536
|
+
300,
|
|
537
|
+
360
|
|
538
|
+
].map((h) => color.withChannelValue("hue", h).toString("css")).join(", ");
|
|
539
|
+
const hslChannels = {
|
|
540
|
+
hue,
|
|
541
|
+
saturation: (color) => `${color.withChannelValue("saturation", 0).toString("css")}, transparent`,
|
|
542
|
+
lightness: () => "black, transparent, white"
|
|
543
|
+
};
|
|
544
|
+
const hsbChannels = {
|
|
545
|
+
hue,
|
|
546
|
+
saturation: (color) => `${color.withChannelValue("saturation", 0).toString("css")}, transparent`,
|
|
547
|
+
brightness: () => "black, transparent"
|
|
548
|
+
};
|
|
549
|
+
switch (value.getColorSpace()) {
|
|
550
|
+
case "rgb": {
|
|
551
|
+
const rgb = parseColor("rgb(0, 0, 0)");
|
|
552
|
+
return {
|
|
553
|
+
background: [
|
|
554
|
+
`linear-gradient(to ${end}, ${rgb.withChannelValue(xCh, 0).toString("css")}, ${rgb.withChannelValue(xCh, 255).toString("css")})`,
|
|
555
|
+
`linear-gradient(to top, ${rgb.withChannelValue(yCh, 0).toString("css")}, ${rgb.withChannelValue(yCh, 255).toString("css")})`,
|
|
556
|
+
rgb.withChannelValue(zCh, zValue).toString("css")
|
|
557
|
+
].join(","),
|
|
558
|
+
"background-blend-mode": "screen"
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
case "hsl": {
|
|
562
|
+
const channels = value.getColorChannels();
|
|
563
|
+
const base = parseColor("hsl(0, 100%, 50%)").withChannelValue(zCh, zValue);
|
|
564
|
+
const bg = channels.filter((c) => c !== zCh).map((c) => `linear-gradient(to ${c === xCh ? end : "top"}, ${hslChannels[c]?.(base) ?? ""})`).reverse();
|
|
565
|
+
if (zCh === "hue") bg.push(base.toString("css"));
|
|
566
|
+
return { background: bg.join(", ") };
|
|
567
|
+
}
|
|
568
|
+
case "hsb": {
|
|
569
|
+
const channels = value.getColorChannels();
|
|
570
|
+
const base = parseColor("hsb(0, 100%, 100%)").withChannelValue(zCh, zValue);
|
|
571
|
+
const bg = channels.filter((c) => c !== zCh).map((c) => `linear-gradient(to ${c === xCh ? end : "top"}, ${hsbChannels[c]?.(base) ?? ""})`).reverse();
|
|
572
|
+
if (zCh === "hue") bg.push(base.toString("css"));
|
|
573
|
+
return { background: bg.join(", ") };
|
|
574
|
+
}
|
|
575
|
+
default: return {};
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
const gradientProps = createMemo(() => {
|
|
579
|
+
return {
|
|
580
|
+
role: "presentation",
|
|
581
|
+
style: {
|
|
582
|
+
width: "100%",
|
|
583
|
+
height: "100%",
|
|
584
|
+
"forced-color-adjust": "none",
|
|
585
|
+
...generateGradient()
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
});
|
|
589
|
+
const thumbProps = createMemo(() => {
|
|
590
|
+
const s = getState();
|
|
591
|
+
const p = getProps();
|
|
592
|
+
const pos = s.getThumbPosition();
|
|
593
|
+
return {
|
|
594
|
+
role: "presentation",
|
|
595
|
+
style: {
|
|
596
|
+
position: "absolute",
|
|
597
|
+
left: `${(isRTL() ? 1 - pos.x : pos.x) * 100}%`,
|
|
598
|
+
top: `${pos.y * 100}%`,
|
|
599
|
+
transform: "translate(-50%, -50%)",
|
|
600
|
+
"touch-action": "none",
|
|
601
|
+
"forced-color-adjust": "none"
|
|
602
|
+
},
|
|
603
|
+
onKeyDown,
|
|
604
|
+
onFocusOut,
|
|
605
|
+
"data-dragging": s.isDragging || void 0,
|
|
606
|
+
"data-disabled": s.isDisabled || p.isDisabled || void 0
|
|
607
|
+
};
|
|
608
|
+
});
|
|
609
|
+
const xInputProps = createMemo(() => {
|
|
610
|
+
const s = getState();
|
|
611
|
+
const p = getProps();
|
|
612
|
+
const xRange = s.value.getChannelRange(s.xChannel);
|
|
613
|
+
return {
|
|
614
|
+
type: "range",
|
|
615
|
+
id: p.id ?? xInputId,
|
|
616
|
+
"aria-label": colorInputLabel(),
|
|
617
|
+
"aria-roledescription": "2D slider",
|
|
618
|
+
"aria-valuetext": getAriaValueTextForChannel(s.xChannel),
|
|
619
|
+
"aria-orientation": "horizontal",
|
|
620
|
+
"aria-describedby": p["aria-describedby"],
|
|
621
|
+
"aria-details": p["aria-details"],
|
|
622
|
+
min: xRange.minValue,
|
|
623
|
+
max: xRange.maxValue,
|
|
624
|
+
step: xRange.step,
|
|
625
|
+
value: s.getXValue(),
|
|
626
|
+
name: p.xName,
|
|
627
|
+
form: p.form,
|
|
628
|
+
disabled: s.isDisabled || p.isDisabled,
|
|
629
|
+
"aria-hidden": !focusedInput() || focusedInput() === "x" || valueChangedViaKeyboard() ? void 0 : "true",
|
|
630
|
+
onFocus: () => setFocusedInput("x"),
|
|
631
|
+
onKeyDown,
|
|
632
|
+
onInput: (e) => updateFromInput(e, "x"),
|
|
633
|
+
onChange: (e) => updateFromInput(e, "x"),
|
|
634
|
+
onBlur: () => {
|
|
635
|
+
if (s.isDragging) s.setDragging(false);
|
|
636
|
+
},
|
|
637
|
+
tabIndex: !focusedInput() || focusedInput() === "x" ? void 0 : -1,
|
|
638
|
+
style: {
|
|
639
|
+
position: "absolute",
|
|
640
|
+
width: "1px",
|
|
641
|
+
height: "1px",
|
|
642
|
+
padding: "0",
|
|
643
|
+
margin: "-1px",
|
|
644
|
+
overflow: "hidden",
|
|
645
|
+
clip: "rect(0, 0, 0, 0)",
|
|
646
|
+
"white-space": "nowrap",
|
|
647
|
+
border: "0"
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
});
|
|
651
|
+
const yInputProps = createMemo(() => {
|
|
652
|
+
const s = getState();
|
|
653
|
+
const p = getProps();
|
|
654
|
+
const yRange = s.value.getChannelRange(s.yChannel);
|
|
655
|
+
return {
|
|
656
|
+
type: "range",
|
|
657
|
+
id: p.id ?? yInputId,
|
|
658
|
+
"aria-label": colorInputLabel(),
|
|
659
|
+
"aria-roledescription": "2D slider",
|
|
660
|
+
"aria-valuetext": getAriaValueTextForChannel(s.yChannel),
|
|
661
|
+
"aria-orientation": "vertical",
|
|
662
|
+
"aria-describedby": p["aria-describedby"],
|
|
663
|
+
"aria-details": p["aria-details"],
|
|
664
|
+
min: yRange.minValue,
|
|
665
|
+
max: yRange.maxValue,
|
|
666
|
+
step: yRange.step,
|
|
667
|
+
value: s.getYValue(),
|
|
668
|
+
name: p.yName,
|
|
669
|
+
form: p.form,
|
|
670
|
+
disabled: s.isDisabled || p.isDisabled,
|
|
671
|
+
"aria-hidden": focusedInput() === "y" || valueChangedViaKeyboard() ? void 0 : "true",
|
|
672
|
+
onFocus: () => setFocusedInput("y"),
|
|
673
|
+
onKeyDown,
|
|
674
|
+
onInput: (e) => updateFromInput(e, "y"),
|
|
675
|
+
onChange: (e) => updateFromInput(e, "y"),
|
|
676
|
+
tabIndex: focusedInput() === "y" ? void 0 : -1,
|
|
677
|
+
style: {
|
|
678
|
+
position: "absolute",
|
|
679
|
+
width: "1px",
|
|
680
|
+
height: "1px",
|
|
681
|
+
padding: "0",
|
|
682
|
+
margin: "-1px",
|
|
683
|
+
overflow: "hidden",
|
|
684
|
+
clip: "rect(0, 0, 0, 0)",
|
|
685
|
+
"white-space": "nowrap",
|
|
686
|
+
border: "0"
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
});
|
|
690
|
+
return {
|
|
691
|
+
get colorAreaProps() {
|
|
692
|
+
return colorAreaProps();
|
|
693
|
+
},
|
|
694
|
+
get gradientProps() {
|
|
695
|
+
return gradientProps();
|
|
696
|
+
},
|
|
697
|
+
get thumbProps() {
|
|
698
|
+
return thumbProps();
|
|
699
|
+
},
|
|
700
|
+
get xInputProps() {
|
|
701
|
+
return xInputProps();
|
|
702
|
+
},
|
|
703
|
+
get yInputProps() {
|
|
704
|
+
return yInputProps();
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
//#endregion
|
|
709
|
+
//#region src/color/createColorWheel.ts
|
|
710
|
+
/**
|
|
711
|
+
* createColorWheel hook.
|
|
712
|
+
*
|
|
713
|
+
* Provides ARIA attributes and keyboard/pointer handling for a circular hue selector.
|
|
714
|
+
*/
|
|
715
|
+
/**
|
|
716
|
+
* Creates ARIA props for a color wheel.
|
|
717
|
+
*/
|
|
718
|
+
function createColorWheel(props, state, wheelRef) {
|
|
719
|
+
const getProps = () => props();
|
|
720
|
+
const getState = () => state();
|
|
721
|
+
const locale = useLocale();
|
|
722
|
+
const inputId = createId$1();
|
|
723
|
+
let cleanupPointerDrag;
|
|
724
|
+
let cleanupMouseDrag;
|
|
725
|
+
let dragElement = null;
|
|
726
|
+
const outerRadius = () => getProps().outerRadius ?? 100;
|
|
727
|
+
const innerRadius = () => getProps().innerRadius ?? 74;
|
|
728
|
+
const thumbRadius = () => (innerRadius() + outerRadius()) / 2;
|
|
729
|
+
const getInput = () => wheelRef()?.querySelector("input[type=\"range\"]") ?? null;
|
|
730
|
+
const focusInput = () => {
|
|
731
|
+
focusWithoutScrolling(getInput());
|
|
732
|
+
queueMicrotask(() => focusWithoutScrolling(getInput()));
|
|
733
|
+
};
|
|
734
|
+
const getPointFromEvent = (clientX, clientY, element) => {
|
|
735
|
+
const wheel = element ?? dragElement ?? wheelRef();
|
|
736
|
+
if (!wheel) return null;
|
|
737
|
+
const rect = wheel.getBoundingClientRect();
|
|
738
|
+
const centerX = rect.left + rect.width / 2;
|
|
739
|
+
const centerY = rect.top + rect.height / 2;
|
|
740
|
+
return {
|
|
741
|
+
x: clientX - centerX,
|
|
742
|
+
y: clientY - centerY
|
|
743
|
+
};
|
|
744
|
+
};
|
|
745
|
+
const updateFromPoint = (clientX, clientY, requireTrackHit = false, element) => {
|
|
746
|
+
if (getProps().isDisabled || getState().isDisabled) return false;
|
|
747
|
+
const point = getPointFromEvent(clientX, clientY, element);
|
|
748
|
+
if (!point) return false;
|
|
749
|
+
const distance = Math.sqrt(point.x ** 2 + point.y ** 2);
|
|
750
|
+
if (requireTrackHit && (distance <= innerRadius() || distance >= outerRadius())) return false;
|
|
751
|
+
getState().setHueFromPoint(point.x, point.y, thumbRadius());
|
|
752
|
+
return true;
|
|
753
|
+
};
|
|
754
|
+
const endDrag = () => {
|
|
755
|
+
if (!getState().isDragging) return;
|
|
756
|
+
getState().setDragging(false);
|
|
757
|
+
dragElement = null;
|
|
758
|
+
focusInput();
|
|
759
|
+
};
|
|
760
|
+
const installPointerDragListeners = () => {
|
|
761
|
+
if (typeof window === "undefined") return;
|
|
762
|
+
cleanupPointerDrag?.();
|
|
763
|
+
const onPointerMove = (e) => {
|
|
764
|
+
if (!getState().isDragging) return;
|
|
765
|
+
updateFromPoint(e.clientX, e.clientY);
|
|
766
|
+
};
|
|
767
|
+
const onPointerEnd = () => {
|
|
768
|
+
cleanupPointerDrag?.();
|
|
769
|
+
cleanupPointerDrag = void 0;
|
|
770
|
+
endDrag();
|
|
771
|
+
};
|
|
772
|
+
window.addEventListener("pointermove", onPointerMove);
|
|
773
|
+
window.addEventListener("pointerup", onPointerEnd);
|
|
774
|
+
window.addEventListener("pointercancel", onPointerEnd);
|
|
775
|
+
cleanupPointerDrag = () => {
|
|
776
|
+
window.removeEventListener("pointermove", onPointerMove);
|
|
777
|
+
window.removeEventListener("pointerup", onPointerEnd);
|
|
778
|
+
window.removeEventListener("pointercancel", onPointerEnd);
|
|
779
|
+
};
|
|
780
|
+
};
|
|
781
|
+
const installMouseDragListeners = () => {
|
|
782
|
+
if (typeof window === "undefined") return;
|
|
783
|
+
cleanupMouseDrag?.();
|
|
784
|
+
const onMouseMove = (e) => {
|
|
785
|
+
if (!getState().isDragging) return;
|
|
786
|
+
updateFromPoint(e.clientX, e.clientY);
|
|
787
|
+
};
|
|
788
|
+
const onMouseEnd = () => {
|
|
789
|
+
cleanupMouseDrag?.();
|
|
790
|
+
cleanupMouseDrag = void 0;
|
|
791
|
+
endDrag();
|
|
792
|
+
};
|
|
793
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
794
|
+
window.addEventListener("mouseup", onMouseEnd);
|
|
795
|
+
cleanupMouseDrag = () => {
|
|
796
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
797
|
+
window.removeEventListener("mouseup", onMouseEnd);
|
|
798
|
+
};
|
|
799
|
+
};
|
|
800
|
+
onCleanup(() => {
|
|
801
|
+
cleanupPointerDrag?.();
|
|
802
|
+
cleanupMouseDrag?.();
|
|
803
|
+
});
|
|
804
|
+
const onTrackPointerDown = (e) => {
|
|
805
|
+
dragElement = e.currentTarget;
|
|
806
|
+
if (!updateFromPoint(e.clientX, e.clientY, true, dragElement)) {
|
|
807
|
+
dragElement = null;
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
focusInput();
|
|
811
|
+
getState().setDragging(true);
|
|
812
|
+
installPointerDragListeners();
|
|
813
|
+
e.preventDefault();
|
|
814
|
+
};
|
|
815
|
+
const onTrackMouseDown = (e) => {
|
|
816
|
+
dragElement = e.currentTarget;
|
|
817
|
+
if (!updateFromPoint(e.clientX, e.clientY, true, dragElement)) {
|
|
818
|
+
dragElement = null;
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
focusInput();
|
|
822
|
+
getState().setDragging(true);
|
|
823
|
+
installMouseDragListeners();
|
|
824
|
+
e.preventDefault();
|
|
825
|
+
};
|
|
826
|
+
const onThumbPointerDown = (e) => {
|
|
827
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
828
|
+
focusInput();
|
|
829
|
+
getState().setDragging(true);
|
|
830
|
+
installPointerDragListeners();
|
|
831
|
+
e.preventDefault();
|
|
832
|
+
e.stopPropagation();
|
|
833
|
+
};
|
|
834
|
+
const onThumbMouseDown = (e) => {
|
|
835
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
836
|
+
focusInput();
|
|
837
|
+
getState().setDragging(true);
|
|
838
|
+
installMouseDragListeners();
|
|
839
|
+
e.preventDefault();
|
|
840
|
+
e.stopPropagation();
|
|
841
|
+
};
|
|
842
|
+
const onKeyDown = (e) => {
|
|
843
|
+
if (e.defaultPrevented) return;
|
|
844
|
+
if (getProps().isDisabled || getState().isDisabled) return;
|
|
845
|
+
const s = getState();
|
|
846
|
+
let handled = true;
|
|
847
|
+
switch (e.key) {
|
|
848
|
+
case "ArrowRight":
|
|
849
|
+
case "ArrowUp":
|
|
850
|
+
s.increment();
|
|
851
|
+
break;
|
|
852
|
+
case "ArrowLeft":
|
|
853
|
+
case "ArrowDown":
|
|
854
|
+
s.decrement();
|
|
855
|
+
break;
|
|
856
|
+
case "PageUp":
|
|
857
|
+
s.increment(s.pageStep);
|
|
858
|
+
break;
|
|
859
|
+
case "PageDown":
|
|
860
|
+
s.decrement(s.pageStep);
|
|
861
|
+
break;
|
|
862
|
+
case "Home":
|
|
863
|
+
s.setHue(0);
|
|
864
|
+
break;
|
|
865
|
+
case "End":
|
|
866
|
+
s.setHue(359);
|
|
867
|
+
break;
|
|
868
|
+
default: handled = false;
|
|
869
|
+
}
|
|
870
|
+
if (handled) {
|
|
871
|
+
s.setDragging(true);
|
|
872
|
+
s.setDragging(false);
|
|
873
|
+
e.preventDefault();
|
|
874
|
+
e.stopPropagation();
|
|
875
|
+
}
|
|
876
|
+
};
|
|
877
|
+
const conicGradient = `conic-gradient(from 90deg, hsl(0, 100%, 50%), hsl(30, 100%, 50%), hsl(60, 100%, 50%), hsl(90, 100%, 50%), hsl(120, 100%, 50%), hsl(150, 100%, 50%), hsl(180, 100%, 50%), hsl(210, 100%, 50%), hsl(240, 100%, 50%), hsl(270, 100%, 50%), hsl(300, 100%, 50%), hsl(330, 100%, 50%), hsl(360, 100%, 50%))`;
|
|
878
|
+
const ringPath = () => {
|
|
879
|
+
const outer = outerRadius();
|
|
880
|
+
const inner = innerRadius();
|
|
881
|
+
const circlePath = (radius) => [
|
|
882
|
+
`M ${outer}, ${outer} m ${-radius}, 0`,
|
|
883
|
+
`a ${radius}, ${radius}, 0, 1, 0, ${radius * 2}, 0`,
|
|
884
|
+
`a ${radius}, ${radius}, 0, 1, 0 ${-radius * 2}, 0`
|
|
885
|
+
].join(" ");
|
|
886
|
+
return `path(evenodd, "${circlePath(outer)} ${circlePath(inner)}")`;
|
|
887
|
+
};
|
|
888
|
+
const trackProps = createMemo(() => {
|
|
889
|
+
const s = getState();
|
|
890
|
+
const p = getProps();
|
|
891
|
+
return {
|
|
892
|
+
onPointerDown: onTrackPointerDown,
|
|
893
|
+
onMouseDown: onTrackMouseDown,
|
|
894
|
+
style: {
|
|
895
|
+
position: "relative",
|
|
896
|
+
"touch-action": "none",
|
|
897
|
+
width: `${outerRadius() * 2}px`,
|
|
898
|
+
height: `${outerRadius() * 2}px`,
|
|
899
|
+
background: conicGradient,
|
|
900
|
+
"clip-path": ringPath(),
|
|
901
|
+
"forced-color-adjust": "none"
|
|
902
|
+
},
|
|
903
|
+
"data-disabled": s.isDisabled || p.isDisabled || void 0
|
|
904
|
+
};
|
|
905
|
+
});
|
|
906
|
+
const thumbProps = createMemo(() => {
|
|
907
|
+
const s = getState();
|
|
908
|
+
const p = getProps();
|
|
909
|
+
const position = s.getThumbPosition(thumbRadius());
|
|
910
|
+
return {
|
|
911
|
+
onPointerDown: onThumbPointerDown,
|
|
912
|
+
onMouseDown: onThumbMouseDown,
|
|
913
|
+
onKeyDown,
|
|
914
|
+
style: {
|
|
915
|
+
position: "absolute",
|
|
916
|
+
left: `${outerRadius() + position.x}px`,
|
|
917
|
+
top: `${outerRadius() + position.y}px`,
|
|
918
|
+
transform: "translate(-50%, -50%)",
|
|
919
|
+
"touch-action": "none",
|
|
920
|
+
"forced-color-adjust": "none"
|
|
921
|
+
},
|
|
922
|
+
"data-dragging": s.isDragging || void 0,
|
|
923
|
+
"data-disabled": s.isDisabled || p.isDisabled || void 0
|
|
924
|
+
};
|
|
925
|
+
});
|
|
926
|
+
const inputProps = createMemo(() => {
|
|
927
|
+
const s = getState();
|
|
928
|
+
const p = getProps();
|
|
929
|
+
return {
|
|
930
|
+
type: "range",
|
|
931
|
+
id: p.id ?? inputId,
|
|
932
|
+
min: 0,
|
|
933
|
+
max: 360,
|
|
934
|
+
step: s.step,
|
|
935
|
+
value: s.getHue(),
|
|
936
|
+
name: p.name,
|
|
937
|
+
form: p.form,
|
|
938
|
+
disabled: s.isDisabled || p.isDisabled,
|
|
939
|
+
tabIndex: s.isDisabled || p.isDisabled ? void 0 : 0,
|
|
940
|
+
"aria-label": p["aria-label"] ?? (p["aria-labelledby"] ? void 0 : s.value.getChannelName("hue", locale().locale)),
|
|
941
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
942
|
+
"aria-describedby": p["aria-describedby"],
|
|
943
|
+
"aria-details": p["aria-details"],
|
|
944
|
+
"aria-errormessage": p["aria-errormessage"],
|
|
945
|
+
"aria-valuetext": `${s.value.formatChannelValue("hue", locale().locale)}, ${s.value.getHueName(locale().locale)}`,
|
|
946
|
+
onKeyDown,
|
|
947
|
+
onInput: (e) => {
|
|
948
|
+
const target = e.target;
|
|
949
|
+
s.setHue(parseFloat(target.value));
|
|
950
|
+
},
|
|
951
|
+
onChange: (e) => {
|
|
952
|
+
const target = e.target;
|
|
953
|
+
s.setHue(parseFloat(target.value));
|
|
954
|
+
},
|
|
955
|
+
onBlur: () => {
|
|
956
|
+
if (s.isDragging) s.setDragging(false);
|
|
957
|
+
},
|
|
958
|
+
style: {
|
|
959
|
+
position: "absolute",
|
|
960
|
+
width: "100%",
|
|
961
|
+
height: "100%",
|
|
962
|
+
opacity: "0.0001",
|
|
963
|
+
padding: "0",
|
|
964
|
+
margin: "0",
|
|
965
|
+
overflow: "hidden",
|
|
966
|
+
clip: "rect(0, 0, 0, 0)",
|
|
967
|
+
"white-space": "nowrap",
|
|
968
|
+
border: "0",
|
|
969
|
+
"pointer-events": "none"
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
});
|
|
973
|
+
return {
|
|
974
|
+
get trackProps() {
|
|
975
|
+
return trackProps();
|
|
976
|
+
},
|
|
977
|
+
get thumbProps() {
|
|
978
|
+
return thumbProps();
|
|
979
|
+
},
|
|
980
|
+
get inputProps() {
|
|
981
|
+
return inputProps();
|
|
982
|
+
}
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/color/createColorField.ts
|
|
987
|
+
/**
|
|
988
|
+
* createColorField hook.
|
|
989
|
+
*
|
|
990
|
+
* Provides ARIA attributes and keyboard handling for a color input field.
|
|
991
|
+
*/
|
|
992
|
+
/**
|
|
993
|
+
* Creates ARIA props for a color field.
|
|
994
|
+
*/
|
|
995
|
+
function createColorField(props, state, inputRef) {
|
|
996
|
+
const getProps = () => props();
|
|
997
|
+
const getState = () => state();
|
|
998
|
+
const generatedInputId = createId$1();
|
|
999
|
+
const labelId = createId$1();
|
|
1000
|
+
const descriptionId = createId$1();
|
|
1001
|
+
const errorMessageId = createId$1();
|
|
1002
|
+
let didAutoFocus = false;
|
|
1003
|
+
createEffect(() => {
|
|
1004
|
+
const input = inputRef();
|
|
1005
|
+
if (!didAutoFocus && getProps().autoFocus && input) {
|
|
1006
|
+
didAutoFocus = true;
|
|
1007
|
+
input.focus();
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
const isDisabled = () => getProps().isDisabled || getState().isDisabled;
|
|
1011
|
+
const isReadOnly = () => getProps().isReadOnly || getState().isReadOnly;
|
|
1012
|
+
const isInvalid = () => getProps().isInvalid || getState().isInvalid;
|
|
1013
|
+
const validationBehavior = () => getProps().validationBehavior ?? "native";
|
|
1014
|
+
const onKeyDown = (e) => {
|
|
1015
|
+
const s = getState();
|
|
1016
|
+
if (isDisabled() || isReadOnly()) return;
|
|
1017
|
+
let handled = true;
|
|
1018
|
+
switch (e.key) {
|
|
1019
|
+
case "ArrowUp":
|
|
1020
|
+
s.increment();
|
|
1021
|
+
break;
|
|
1022
|
+
case "ArrowDown":
|
|
1023
|
+
s.decrement();
|
|
1024
|
+
break;
|
|
1025
|
+
case "PageUp":
|
|
1026
|
+
s.incrementToMax();
|
|
1027
|
+
break;
|
|
1028
|
+
case "PageDown":
|
|
1029
|
+
s.decrementToMin();
|
|
1030
|
+
break;
|
|
1031
|
+
case "Home":
|
|
1032
|
+
s.decrementToMin();
|
|
1033
|
+
break;
|
|
1034
|
+
case "End":
|
|
1035
|
+
s.incrementToMax();
|
|
1036
|
+
break;
|
|
1037
|
+
default: handled = false;
|
|
1038
|
+
}
|
|
1039
|
+
if (handled) e.preventDefault();
|
|
1040
|
+
};
|
|
1041
|
+
const onWheel = (e) => {
|
|
1042
|
+
const p = getProps();
|
|
1043
|
+
const s = getState();
|
|
1044
|
+
if (p.isWheelDisabled || isDisabled() || isReadOnly() || document.activeElement !== inputRef()) return;
|
|
1045
|
+
if (e.deltaY < 0) s.increment();
|
|
1046
|
+
else if (e.deltaY > 0) s.decrement();
|
|
1047
|
+
else return;
|
|
1048
|
+
e.preventDefault();
|
|
1049
|
+
};
|
|
1050
|
+
const labelProps = createMemo(() => {
|
|
1051
|
+
return {
|
|
1052
|
+
id: labelId,
|
|
1053
|
+
for: getProps().id ?? generatedInputId
|
|
1054
|
+
};
|
|
1055
|
+
});
|
|
1056
|
+
const descriptionProps = createMemo(() => ({ id: descriptionId }));
|
|
1057
|
+
const errorMessageProps = createMemo(() => ({ id: getProps()["aria-errormessage"] ?? errorMessageId }));
|
|
1058
|
+
const inputProps = createMemo(() => {
|
|
1059
|
+
const s = getState();
|
|
1060
|
+
const p = getProps();
|
|
1061
|
+
const channelLabel = s.channel && s.colorValue ? s.colorValue.getChannelName(s.channel, "en-US") : void 0;
|
|
1062
|
+
const required = p.isRequired || s.isRequired;
|
|
1063
|
+
const invalid = isInvalid();
|
|
1064
|
+
const describedBy = p["aria-describedby"];
|
|
1065
|
+
return {
|
|
1066
|
+
id: p.id ?? generatedInputId,
|
|
1067
|
+
type: "text",
|
|
1068
|
+
value: s.inputValue,
|
|
1069
|
+
name: s.channel ? void 0 : p.name,
|
|
1070
|
+
form: s.channel ? void 0 : p.form,
|
|
1071
|
+
placeholder: p.placeholder,
|
|
1072
|
+
disabled: isDisabled(),
|
|
1073
|
+
readOnly: isReadOnly(),
|
|
1074
|
+
required: validationBehavior() === "native" ? required || void 0 : void 0,
|
|
1075
|
+
tabIndex: p.excludeFromTabOrder ? -1 : void 0,
|
|
1076
|
+
autoComplete: "off",
|
|
1077
|
+
autoCorrect: "off",
|
|
1078
|
+
spellCheck: "false",
|
|
1079
|
+
"aria-label": p["aria-label"] ?? channelLabel,
|
|
1080
|
+
"aria-labelledby": p["aria-labelledby"],
|
|
1081
|
+
"aria-describedby": describedBy,
|
|
1082
|
+
"aria-details": p["aria-details"],
|
|
1083
|
+
"aria-errormessage": invalid ? p["aria-errormessage"] ?? errorMessageId : void 0,
|
|
1084
|
+
"aria-invalid": invalid || void 0,
|
|
1085
|
+
"aria-required": validationBehavior() === "aria" && required ? true : void 0,
|
|
1086
|
+
role: s.channel ? void 0 : "textbox",
|
|
1087
|
+
"aria-valuenow": void 0,
|
|
1088
|
+
"aria-valuemin": void 0,
|
|
1089
|
+
"aria-valuemax": void 0,
|
|
1090
|
+
"aria-valuetext": void 0,
|
|
1091
|
+
onInput: (e) => {
|
|
1092
|
+
const target = e.target;
|
|
1093
|
+
if (s.validate(target.value)) s.setInputValue(target.value);
|
|
1094
|
+
else target.value = s.inputValue;
|
|
1095
|
+
},
|
|
1096
|
+
onChange: () => {
|
|
1097
|
+
s.commit();
|
|
1098
|
+
},
|
|
1099
|
+
onBlur: () => {
|
|
1100
|
+
s.commit();
|
|
1101
|
+
},
|
|
1102
|
+
onKeyDown,
|
|
1103
|
+
onWheel
|
|
1104
|
+
};
|
|
1105
|
+
});
|
|
1106
|
+
return {
|
|
1107
|
+
get labelProps() {
|
|
1108
|
+
return labelProps();
|
|
1109
|
+
},
|
|
1110
|
+
get inputProps() {
|
|
1111
|
+
return inputProps();
|
|
1112
|
+
},
|
|
1113
|
+
get descriptionProps() {
|
|
1114
|
+
return descriptionProps();
|
|
1115
|
+
},
|
|
1116
|
+
get errorMessageProps() {
|
|
1117
|
+
return errorMessageProps();
|
|
1118
|
+
}
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
//#endregion
|
|
1122
|
+
//#region src/color/createColorSwatch.ts
|
|
1123
|
+
/**
|
|
1124
|
+
* createColorSwatch hook.
|
|
1125
|
+
*
|
|
1126
|
+
* Provides ARIA attributes for a color swatch display.
|
|
1127
|
+
*/
|
|
1128
|
+
/**
|
|
1129
|
+
* Creates ARIA props for a color swatch.
|
|
1130
|
+
*/
|
|
1131
|
+
function createColorSwatch(props) {
|
|
1132
|
+
const getProps = () => props();
|
|
1133
|
+
const locale = useLocale();
|
|
1134
|
+
const generatedId = createId$1();
|
|
1135
|
+
const id = () => getProps().id ?? generatedId;
|
|
1136
|
+
const color = createMemo(() => normalizeColor(getProps().color ?? "#fff0"));
|
|
1137
|
+
const colorName = createMemo(() => {
|
|
1138
|
+
const p = getProps();
|
|
1139
|
+
if (p.colorName) return p.colorName;
|
|
1140
|
+
const resolvedColor = color();
|
|
1141
|
+
if (resolvedColor.getChannelValue("alpha") === 0) return "transparent";
|
|
1142
|
+
return resolvedColor.getColorName(locale().locale);
|
|
1143
|
+
});
|
|
1144
|
+
const swatchProps = createMemo(() => {
|
|
1145
|
+
const p = getProps();
|
|
1146
|
+
const domProps = filterDOMProps(p, { labelable: true });
|
|
1147
|
+
const ariaLabel = [colorName(), p["aria-label"] || ""].filter(Boolean).join(", ");
|
|
1148
|
+
return {
|
|
1149
|
+
...domProps,
|
|
1150
|
+
id: id(),
|
|
1151
|
+
slot: p.slot,
|
|
1152
|
+
role: "img",
|
|
1153
|
+
"aria-roledescription": "color swatch",
|
|
1154
|
+
"aria-label": ariaLabel,
|
|
1155
|
+
"aria-labelledby": p["aria-labelledby"] ? `${id()} ${p["aria-labelledby"]}` : void 0,
|
|
1156
|
+
style: {
|
|
1157
|
+
"background-color": color().toString("css"),
|
|
1158
|
+
"forced-color-adjust": "none"
|
|
1159
|
+
}
|
|
1160
|
+
};
|
|
1161
|
+
});
|
|
1162
|
+
return {
|
|
1163
|
+
get swatchProps() {
|
|
1164
|
+
return swatchProps();
|
|
1165
|
+
},
|
|
1166
|
+
get color() {
|
|
1167
|
+
return color();
|
|
1168
|
+
}
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
//#endregion
|
|
1172
|
+
export { createColorSlider as a, createColorArea as i, createColorField as n, createColorWheel as r, createColorSwatch as t };
|
|
1173
|
+
|
|
1174
|
+
//# sourceMappingURL=color.jsx.map
|