@proyecto-viviana/solidaria 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +141 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +141 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/announce.js +207 -0
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/announce.jsx +207 -0
- package/dist/_chunk/announce.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 +244 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +244 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +121 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +121 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +275 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +275 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1037 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1037 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +235 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +235 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1458 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1458 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +1062 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +1062 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +61 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +61 -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 +55 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +55 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +105 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +105 -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 +120 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +120 -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/createFormReset.js +39 -0
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/createFormReset.jsx +39 -0
- package/dist/_chunk/createFormReset.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 +131 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +131 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +268 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +268 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +47 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +47 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +32 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +32 -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/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 +82 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +82 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +302 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +302 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +159 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +159 -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 +1706 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1706 -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 +2395 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +2395 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +87 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +87 -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 +631 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +631 -0
- package/dist/_chunk/focus2.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 +369 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +369 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +199 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +199 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +331 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +325 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +97 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +97 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +356 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +356 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +519 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +519 -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 +259 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +259 -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 +320 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +320 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +210 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +210 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +406 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +397 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +666 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +666 -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 +256 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +256 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/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 +1088 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1088 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +263 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +263 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +322 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +322 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +110 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +110 -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 +226 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +226 -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 +452 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +452 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +705 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +705 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +93 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +93 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +12 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -0
- package/dist/dnd/index.jsx +3 -0
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +7 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -0
- package/dist/focus/index.jsx +3 -0
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +5 -0
- package/dist/i18n/index.jsx +5 -0
- package/dist/index.d.ts +10 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -18311
- package/dist/index.jsx +77 -18242
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +9 -0
- package/dist/interactions/index.jsx +9 -0
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +7 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +5 -0
- package/dist/selection/index.jsx +5 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.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 +35 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +5 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +49 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.jsx +6 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +202 -35
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +5 -4
- package/src/calendar/createCalendarCell.ts +36 -5
- package/src/calendar/createCalendarGrid.ts +47 -12
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +27 -15
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/index.ts +17 -0
- package/src/calendar/intl/index.ts +8 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -384
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +488 -371
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +63 -3
- package/src/focus/FocusScope.tsx +266 -24
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +187 -48
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +51 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +26 -15
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +203 -10
- package/src/listbox/createOption.ts +84 -74
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +41 -4
- 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 +512 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +82 -27
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +208 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +37 -1
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +95 -24
- package/src/tag/createTag.ts +30 -36
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -94
- package/src/tree/createTree.ts +165 -52
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +243 -0
- package/src/utils/dom.ts +216 -25
- package/src/utils/index.ts +10 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { a as createCacheKey, i as useLocale } from "./locale.jsx";
|
|
2
|
+
import { t as createCollator } from "./createCollator.jsx";
|
|
3
|
+
import { createMemo } from "solid-js";
|
|
4
|
+
import { NumberFormatter, NumberFormatter as NumberFormatter$1 } from "@internationalized/number";
|
|
5
|
+
//#region src/i18n/createNumberFormatter.ts
|
|
6
|
+
/**
|
|
7
|
+
* createNumberFormatter hook for solidaria
|
|
8
|
+
*
|
|
9
|
+
* Provides localized number formatting with automatic locale updates.
|
|
10
|
+
*
|
|
11
|
+
* Port of @react-aria/i18n useNumberFormatter.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Provides localized number formatting for the current locale.
|
|
15
|
+
* Automatically updates when the locale changes.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* function PriceDisplay(props: { value: number }) {
|
|
20
|
+
* const formatter = createNumberFormatter({
|
|
21
|
+
* style: 'currency',
|
|
22
|
+
* currency: 'USD',
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* return <span>{formatter().format(props.value)}</span>;
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* // Percent formatting
|
|
32
|
+
* const percentFormatter = createNumberFormatter({
|
|
33
|
+
* style: 'percent',
|
|
34
|
+
* minimumFractionDigits: 1,
|
|
35
|
+
* });
|
|
36
|
+
* percentFormatter().format(0.125); // '12.5%'
|
|
37
|
+
*
|
|
38
|
+
* // Unit formatting
|
|
39
|
+
* const tempFormatter = createNumberFormatter({
|
|
40
|
+
* style: 'unit',
|
|
41
|
+
* unit: 'celsius',
|
|
42
|
+
* });
|
|
43
|
+
* tempFormatter().format(25); // '25°C'
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
function createNumberFormatter(options = {}) {
|
|
47
|
+
const locale = useLocale();
|
|
48
|
+
return createMemo(() => new NumberFormatter(locale().locale, options));
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/i18n/createDateFormatter.ts
|
|
52
|
+
/**
|
|
53
|
+
* createDateFormatter hook for solidaria
|
|
54
|
+
*
|
|
55
|
+
* Provides localized date formatting with caching.
|
|
56
|
+
*
|
|
57
|
+
* Port of @react-aria/i18n useDateFormatter.
|
|
58
|
+
*/
|
|
59
|
+
const dateFormatterCache = /* @__PURE__ */ new Map();
|
|
60
|
+
/**
|
|
61
|
+
* Gets or creates a cached date formatter.
|
|
62
|
+
*/
|
|
63
|
+
function getCachedDateFormatter(locale, options) {
|
|
64
|
+
const cacheKey = createCacheKey(locale, options);
|
|
65
|
+
if (dateFormatterCache.has(cacheKey)) return dateFormatterCache.get(cacheKey);
|
|
66
|
+
const formatter = new Intl.DateTimeFormat(locale, options);
|
|
67
|
+
dateFormatterCache.set(cacheKey, formatter);
|
|
68
|
+
return formatter;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Provides localized date and time formatting for the current locale.
|
|
72
|
+
* Automatically updates when the locale changes.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* function DateDisplay(props: { date: Date }) {
|
|
77
|
+
* const formatter = createDateFormatter({
|
|
78
|
+
* year: 'numeric',
|
|
79
|
+
* month: 'long',
|
|
80
|
+
* day: 'numeric',
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* return <span>{formatter().format(props.date)}</span>;
|
|
84
|
+
* }
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* // Short date
|
|
90
|
+
* const shortDate = createDateFormatter({ dateStyle: 'short' });
|
|
91
|
+
* shortDate().format(new Date()); // '1/19/26' (US) or '19/01/26' (UK)
|
|
92
|
+
*
|
|
93
|
+
* // Full date with time
|
|
94
|
+
* const fullDateTime = createDateFormatter({
|
|
95
|
+
* dateStyle: 'full',
|
|
96
|
+
* timeStyle: 'short',
|
|
97
|
+
* });
|
|
98
|
+
*
|
|
99
|
+
* // Time only
|
|
100
|
+
* const timeFormatter = createDateFormatter({
|
|
101
|
+
* hour: 'numeric',
|
|
102
|
+
* minute: '2-digit',
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
function createDateFormatter(options) {
|
|
107
|
+
const locale = useLocale();
|
|
108
|
+
return createMemo(() => getCachedDateFormatter(locale().locale, options));
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/i18n/createFilter.ts
|
|
112
|
+
/**
|
|
113
|
+
* createFilter hook for solidaria
|
|
114
|
+
*
|
|
115
|
+
* Provides localized string filtering with collation support.
|
|
116
|
+
*
|
|
117
|
+
* Port of @react-aria/i18n useFilter.
|
|
118
|
+
*/
|
|
119
|
+
/**
|
|
120
|
+
* Provides localized string search functionality for filtering or matching items.
|
|
121
|
+
* Respects locale-specific collation rules for case and diacritic sensitivity.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* function SearchableList(props: { items: { name: string }[] }) {
|
|
126
|
+
* const [query, setQuery] = createSignal('');
|
|
127
|
+
* const filter = createFilter({ sensitivity: 'base' });
|
|
128
|
+
*
|
|
129
|
+
* const filteredItems = () =>
|
|
130
|
+
* props.items.filter((item) =>
|
|
131
|
+
* filter().contains(item.name, query())
|
|
132
|
+
* );
|
|
133
|
+
*
|
|
134
|
+
* return (
|
|
135
|
+
* <>
|
|
136
|
+
* <input
|
|
137
|
+
* value={query()}
|
|
138
|
+
* onInput={(e) => setQuery(e.target.value)}
|
|
139
|
+
* placeholder="Search..."
|
|
140
|
+
* />
|
|
141
|
+
* <ul>
|
|
142
|
+
* <For each={filteredItems()}>
|
|
143
|
+
* {(item) => <li>{item.name}</li>}
|
|
144
|
+
* </For>
|
|
145
|
+
* </ul>
|
|
146
|
+
* </>
|
|
147
|
+
* );
|
|
148
|
+
* }
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```tsx
|
|
153
|
+
* // Case-insensitive, diacritic-insensitive filtering
|
|
154
|
+
* const filter = createFilter({ sensitivity: 'base' });
|
|
155
|
+
* filter().contains('Café', 'cafe'); // true
|
|
156
|
+
* filter().startsWith('Hello', 'hello'); // true
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
function createFilter(options) {
|
|
160
|
+
const collator = createCollator({
|
|
161
|
+
usage: "search",
|
|
162
|
+
...options
|
|
163
|
+
});
|
|
164
|
+
return createMemo(() => {
|
|
165
|
+
const coll = collator();
|
|
166
|
+
const startsWith = (str, substring) => {
|
|
167
|
+
if (substring.length === 0) return true;
|
|
168
|
+
const normalizedStr = str.normalize("NFC");
|
|
169
|
+
const normalizedSub = substring.normalize("NFC");
|
|
170
|
+
return coll.compare(normalizedStr.slice(0, normalizedSub.length), normalizedSub) === 0;
|
|
171
|
+
};
|
|
172
|
+
const endsWith = (str, substring) => {
|
|
173
|
+
if (substring.length === 0) return true;
|
|
174
|
+
const normalizedStr = str.normalize("NFC");
|
|
175
|
+
const normalizedSub = substring.normalize("NFC");
|
|
176
|
+
return coll.compare(normalizedStr.slice(-normalizedSub.length), normalizedSub) === 0;
|
|
177
|
+
};
|
|
178
|
+
const contains = (str, substring) => {
|
|
179
|
+
if (substring.length === 0) return true;
|
|
180
|
+
const normalizedStr = str.normalize("NFC");
|
|
181
|
+
const normalizedSub = substring.normalize("NFC");
|
|
182
|
+
const sliceLen = normalizedSub.length;
|
|
183
|
+
for (let scan = 0; scan + sliceLen <= normalizedStr.length; scan++) {
|
|
184
|
+
const slice = normalizedStr.slice(scan, scan + sliceLen);
|
|
185
|
+
if (coll.compare(normalizedSub, slice) === 0) return true;
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
};
|
|
189
|
+
return {
|
|
190
|
+
startsWith,
|
|
191
|
+
endsWith,
|
|
192
|
+
contains
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
//#endregion
|
|
197
|
+
export { createNumberFormatter as i, createFilter as n, createDateFormatter as r, NumberFormatter$1 as t };
|
|
198
|
+
|
|
199
|
+
//# sourceMappingURL=i18n.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.jsx","names":[],"sources":["../../src/i18n/createNumberFormatter.ts","../../src/i18n/createDateFormatter.ts","../../src/i18n/createFilter.ts"],"sourcesContent":["/**\n * createNumberFormatter hook for solidaria\n *\n * Provides localized number formatting with automatic locale updates.\n *\n * Port of @react-aria/i18n useNumberFormatter.\n */\n\nimport { createMemo } from \"solid-js\";\nimport { useLocale } from \"./locale\";\nimport { NumberFormatter, type NumberFormatOptions } from \"@internationalized/number\";\n\n/**\n * Provides localized number formatting for the current locale.\n * Automatically updates when the locale changes.\n *\n * @example\n * ```tsx\n * function PriceDisplay(props: { value: number }) {\n * const formatter = createNumberFormatter({\n * style: 'currency',\n * currency: 'USD',\n * });\n *\n * return <span>{formatter().format(props.value)}</span>;\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Percent formatting\n * const percentFormatter = createNumberFormatter({\n * style: 'percent',\n * minimumFractionDigits: 1,\n * });\n * percentFormatter().format(0.125); // '12.5%'\n *\n * // Unit formatting\n * const tempFormatter = createNumberFormatter({\n * style: 'unit',\n * unit: 'celsius',\n * });\n * tempFormatter().format(25); // '25°C'\n * ```\n */\nexport function createNumberFormatter(options: NumberFormatOptions = {}): () => NumberFormatter {\n const locale = useLocale();\n\n return createMemo(() => new NumberFormatter(locale().locale, options));\n}\n","/**\n * createDateFormatter hook for solidaria\n *\n * Provides localized date formatting with caching.\n *\n * Port of @react-aria/i18n useDateFormatter.\n */\n\nimport { createMemo } from \"solid-js\";\nimport { useLocale } from \"./locale\";\nimport { createCacheKey } from \"./utils\";\n\nconst dateFormatterCache = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Gets or creates a cached date formatter.\n */\nfunction getCachedDateFormatter(\n locale: string,\n options?: Intl.DateTimeFormatOptions,\n): Intl.DateTimeFormat {\n const cacheKey = createCacheKey(locale, options as Record<string, unknown>);\n\n if (dateFormatterCache.has(cacheKey)) {\n return dateFormatterCache.get(cacheKey)!;\n }\n\n const formatter = new Intl.DateTimeFormat(locale, options);\n dateFormatterCache.set(cacheKey, formatter);\n return formatter;\n}\n\n/**\n * Provides localized date and time formatting for the current locale.\n * Automatically updates when the locale changes.\n *\n * @example\n * ```tsx\n * function DateDisplay(props: { date: Date }) {\n * const formatter = createDateFormatter({\n * year: 'numeric',\n * month: 'long',\n * day: 'numeric',\n * });\n *\n * return <span>{formatter().format(props.date)}</span>;\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Short date\n * const shortDate = createDateFormatter({ dateStyle: 'short' });\n * shortDate().format(new Date()); // '1/19/26' (US) or '19/01/26' (UK)\n *\n * // Full date with time\n * const fullDateTime = createDateFormatter({\n * dateStyle: 'full',\n * timeStyle: 'short',\n * });\n *\n * // Time only\n * const timeFormatter = createDateFormatter({\n * hour: 'numeric',\n * minute: '2-digit',\n * });\n * ```\n */\nexport function createDateFormatter(\n options?: Intl.DateTimeFormatOptions,\n): () => Intl.DateTimeFormat {\n const locale = useLocale();\n\n return createMemo(() => getCachedDateFormatter(locale().locale, options));\n}\n","/**\n * createFilter hook for solidaria\n *\n * Provides localized string filtering with collation support.\n *\n * Port of @react-aria/i18n useFilter.\n */\n\nimport { createMemo } from \"solid-js\";\nimport { createCollator } from \"./createCollator\";\n\nexport interface Filter {\n /** Returns whether a string starts with a given substring. */\n startsWith(string: string, substring: string): boolean;\n /** Returns whether a string ends with a given substring. */\n endsWith(string: string, substring: string): boolean;\n /** Returns whether a string contains a given substring. */\n contains(string: string, substring: string): boolean;\n}\n\n/**\n * Provides localized string search functionality for filtering or matching items.\n * Respects locale-specific collation rules for case and diacritic sensitivity.\n *\n * @example\n * ```tsx\n * function SearchableList(props: { items: { name: string }[] }) {\n * const [query, setQuery] = createSignal('');\n * const filter = createFilter({ sensitivity: 'base' });\n *\n * const filteredItems = () =>\n * props.items.filter((item) =>\n * filter().contains(item.name, query())\n * );\n *\n * return (\n * <>\n * <input\n * value={query()}\n * onInput={(e) => setQuery(e.target.value)}\n * placeholder=\"Search...\"\n * />\n * <ul>\n * <For each={filteredItems()}>\n * {(item) => <li>{item.name}</li>}\n * </For>\n * </ul>\n * </>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Case-insensitive, diacritic-insensitive filtering\n * const filter = createFilter({ sensitivity: 'base' });\n * filter().contains('Café', 'cafe'); // true\n * filter().startsWith('Hello', 'hello'); // true\n * ```\n */\nexport function createFilter(options?: Intl.CollatorOptions): () => Filter {\n const collator = createCollator({\n usage: \"search\",\n ...options,\n });\n\n return createMemo(() => {\n const coll = collator();\n\n const startsWith = (str: string, substring: string): boolean => {\n if (substring.length === 0) {\n return true;\n }\n\n // Normalize both strings for safe slicing\n const normalizedStr = str.normalize(\"NFC\");\n const normalizedSub = substring.normalize(\"NFC\");\n\n return coll.compare(normalizedStr.slice(0, normalizedSub.length), normalizedSub) === 0;\n };\n\n const endsWith = (str: string, substring: string): boolean => {\n if (substring.length === 0) {\n return true;\n }\n\n const normalizedStr = str.normalize(\"NFC\");\n const normalizedSub = substring.normalize(\"NFC\");\n\n return coll.compare(normalizedStr.slice(-normalizedSub.length), normalizedSub) === 0;\n };\n\n const contains = (str: string, substring: string): boolean => {\n if (substring.length === 0) {\n return true;\n }\n\n const normalizedStr = str.normalize(\"NFC\");\n const normalizedSub = substring.normalize(\"NFC\");\n const sliceLen = normalizedSub.length;\n\n for (let scan = 0; scan + sliceLen <= normalizedStr.length; scan++) {\n const slice = normalizedStr.slice(scan, scan + sliceLen);\n if (coll.compare(normalizedSub, slice) === 0) {\n return true;\n }\n }\n\n return false;\n };\n\n return {\n startsWith,\n endsWith,\n contains,\n };\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAgB,sBAAsB,UAA+B,CAAC,GAA0B;CAC9F,MAAM,SAAS,UAAU;CAEzB,OAAO,iBAAiB,IAAI,gBAAgB,OAAO,CAAC,CAAC,QAAQ,OAAO,CAAC;AACvE;;;;;;;;;;ACrCA,MAAM,qCAAqB,IAAI,IAAiC;;;;AAKhE,SAAS,uBACP,QACA,SACqB;CACrB,MAA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AAQ,QAAQ;IAClE,MAAM,QAAQ,cAAc,MAAM,MAAM,OAAO,QAAQ;IACvD,IAAI,KAAK,QAAQ,eAAe,KAAK,MAAM,GACzC,OAAO;GAEX;GAEA,OAAO;EACT;EAEA,OAAO;GACL;GACA;GACA;EACF;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { t as createPress } from "./createPress.js";
|
|
2
|
+
import { i as mergeProps$1 } from "./env.js";
|
|
3
|
+
import { i as createDescription, l as disableTextSelection, s as createGlobalListeners, u as restoreTextSelection } from "./utils.js";
|
|
4
|
+
import { n as focusWithoutScrolling } from "./focus.js";
|
|
5
|
+
import { t as FocusableContext } from "./createFocusable.js";
|
|
6
|
+
import { createEffect, createSignal, mergeProps, onCleanup, splitProps } from "solid-js";
|
|
7
|
+
import { createComponent } from "solid-js/web";
|
|
8
|
+
//#region src/interactions/createLongPress.ts
|
|
9
|
+
/**
|
|
10
|
+
* createLongPress - Handles long press interactions across mouse and touch.
|
|
11
|
+
*
|
|
12
|
+
* Port of @react-aria/interactions useLongPress, adapted for SolidJS.
|
|
13
|
+
*/
|
|
14
|
+
const DEFAULT_THRESHOLD = 500;
|
|
15
|
+
function isDisabledValue(isDisabled) {
|
|
16
|
+
return typeof isDisabled === "function" ? isDisabled() : !!isDisabled;
|
|
17
|
+
}
|
|
18
|
+
function createLongPressEvent(type, e) {
|
|
19
|
+
return {
|
|
20
|
+
type,
|
|
21
|
+
pointerType: e.pointerType,
|
|
22
|
+
target: e.target,
|
|
23
|
+
shiftKey: e.shiftKey,
|
|
24
|
+
ctrlKey: e.ctrlKey,
|
|
25
|
+
metaKey: e.metaKey,
|
|
26
|
+
altKey: e.altKey,
|
|
27
|
+
x: e.x,
|
|
28
|
+
y: e.y
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Handles long press interactions across mouse and touch devices.
|
|
33
|
+
*/
|
|
34
|
+
function createLongPress(props = {}) {
|
|
35
|
+
const { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = DEFAULT_THRESHOLD, accessibilityDescription } = props;
|
|
36
|
+
let timeoutId;
|
|
37
|
+
const { addGlobalListener } = createGlobalListeners();
|
|
38
|
+
const { pressProps } = createPress({
|
|
39
|
+
isDisabled,
|
|
40
|
+
onPressStart(e) {
|
|
41
|
+
e.continuePropagation();
|
|
42
|
+
if (e.pointerType === "mouse" || e.pointerType === "touch") {
|
|
43
|
+
onLongPressStart?.(createLongPressEvent("longpressstart", e));
|
|
44
|
+
timeoutId = setTimeout(() => {
|
|
45
|
+
e.target.dispatchEvent(new PointerEvent("pointercancel", { bubbles: true }));
|
|
46
|
+
if (document.activeElement !== e.target) focusWithoutScrolling(e.target);
|
|
47
|
+
onLongPress?.(createLongPressEvent("longpress", e));
|
|
48
|
+
timeoutId = void 0;
|
|
49
|
+
}, threshold);
|
|
50
|
+
if (e.pointerType === "touch") {
|
|
51
|
+
const onContextMenu = (event) => {
|
|
52
|
+
event.preventDefault();
|
|
53
|
+
};
|
|
54
|
+
const target = e.target;
|
|
55
|
+
target.addEventListener("contextmenu", onContextMenu, { once: true });
|
|
56
|
+
addGlobalListener("pointerup", () => {
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
target.removeEventListener("contextmenu", onContextMenu);
|
|
59
|
+
}, 30);
|
|
60
|
+
}, {
|
|
61
|
+
isWindow: true,
|
|
62
|
+
once: true
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
onPressEnd(e) {
|
|
68
|
+
if (timeoutId) {
|
|
69
|
+
clearTimeout(timeoutId);
|
|
70
|
+
timeoutId = void 0;
|
|
71
|
+
}
|
|
72
|
+
if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd(createLongPressEvent("longpressend", e));
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const descriptionProps = createDescription(() => onLongPress && !isDisabledValue(isDisabled) ? accessibilityDescription : void 0);
|
|
76
|
+
onCleanup(() => {
|
|
77
|
+
if (timeoutId) {
|
|
78
|
+
clearTimeout(timeoutId);
|
|
79
|
+
timeoutId = void 0;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const longPressProps = mergeProps$1(pressProps);
|
|
83
|
+
Object.defineProperty(longPressProps, "aria-describedby", {
|
|
84
|
+
get: () => descriptionProps["aria-describedby"],
|
|
85
|
+
enumerable: true,
|
|
86
|
+
configurable: true
|
|
87
|
+
});
|
|
88
|
+
return { longPressProps };
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/interactions/createMove.ts
|
|
92
|
+
/**
|
|
93
|
+
* createMove - Handles move interactions across mouse, touch, pointer, and keyboard.
|
|
94
|
+
*
|
|
95
|
+
* Port of @react-aria/interactions useMove, adapted for SolidJS.
|
|
96
|
+
*/
|
|
97
|
+
function createBaseEvent(originalEvent, pointerType) {
|
|
98
|
+
return {
|
|
99
|
+
pointerType,
|
|
100
|
+
shiftKey: originalEvent.shiftKey,
|
|
101
|
+
ctrlKey: originalEvent.ctrlKey,
|
|
102
|
+
metaKey: originalEvent.metaKey,
|
|
103
|
+
altKey: originalEvent.altKey
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Handles move interactions across mouse, touch, pointer, and keyboard.
|
|
108
|
+
*/
|
|
109
|
+
function createMove(props = {}) {
|
|
110
|
+
const { onMoveStart, onMove, onMoveEnd } = props;
|
|
111
|
+
const state = {
|
|
112
|
+
didMove: false,
|
|
113
|
+
lastPosition: null,
|
|
114
|
+
id: null
|
|
115
|
+
};
|
|
116
|
+
const { addGlobalListener, removeGlobalListener } = createGlobalListeners();
|
|
117
|
+
const [pointerDown, setPointerDown] = createSignal(null);
|
|
118
|
+
const move = (originalEvent, pointerType, deltaX, deltaY) => {
|
|
119
|
+
if (deltaX === 0 && deltaY === 0) return;
|
|
120
|
+
if (!state.didMove) {
|
|
121
|
+
state.didMove = true;
|
|
122
|
+
onMoveStart?.({
|
|
123
|
+
type: "movestart",
|
|
124
|
+
...createBaseEvent(originalEvent, pointerType)
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
onMove?.({
|
|
128
|
+
type: "move",
|
|
129
|
+
deltaX,
|
|
130
|
+
deltaY,
|
|
131
|
+
...createBaseEvent(originalEvent, pointerType)
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
const end = (originalEvent, pointerType) => {
|
|
135
|
+
restoreTextSelection();
|
|
136
|
+
if (state.didMove) onMoveEnd?.({
|
|
137
|
+
type: "moveend",
|
|
138
|
+
...createBaseEvent(originalEvent, pointerType)
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
createEffect(() => {
|
|
142
|
+
const activePointer = pointerDown();
|
|
143
|
+
if (!activePointer) return;
|
|
144
|
+
if (activePointer === "pointer") {
|
|
145
|
+
const onPointerMove = (e) => {
|
|
146
|
+
if (e.pointerId === state.id) {
|
|
147
|
+
move(e, e.pointerType || "mouse", e.pageX - (state.lastPosition?.pageX ?? 0), e.pageY - (state.lastPosition?.pageY ?? 0));
|
|
148
|
+
state.lastPosition = {
|
|
149
|
+
pageX: e.pageX,
|
|
150
|
+
pageY: e.pageY
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const onPointerUp = (e) => {
|
|
155
|
+
if (e.pointerId === state.id) {
|
|
156
|
+
end(e, e.pointerType || "mouse");
|
|
157
|
+
state.id = null;
|
|
158
|
+
removeGlobalListener("pointermove", onPointerMove, { isWindow: true });
|
|
159
|
+
removeGlobalListener("pointerup", onPointerUp, { isWindow: true });
|
|
160
|
+
removeGlobalListener("pointercancel", onPointerUp, { isWindow: true });
|
|
161
|
+
setPointerDown(null);
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
addGlobalListener("pointermove", onPointerMove, { isWindow: true });
|
|
165
|
+
addGlobalListener("pointerup", onPointerUp, { isWindow: true });
|
|
166
|
+
addGlobalListener("pointercancel", onPointerUp, { isWindow: true });
|
|
167
|
+
onCleanup(() => {
|
|
168
|
+
removeGlobalListener("pointermove", onPointerMove, { isWindow: true });
|
|
169
|
+
removeGlobalListener("pointerup", onPointerUp, { isWindow: true });
|
|
170
|
+
removeGlobalListener("pointercancel", onPointerUp, { isWindow: true });
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
const start = () => {
|
|
175
|
+
disableTextSelection();
|
|
176
|
+
state.didMove = false;
|
|
177
|
+
};
|
|
178
|
+
const moveProps = {};
|
|
179
|
+
const hasPointerEvents = typeof window !== "undefined" && typeof window.PointerEvent !== "undefined";
|
|
180
|
+
moveProps.onMouseDown = (e) => {
|
|
181
|
+
if (pointerDown() != null) return;
|
|
182
|
+
if (e.button === 0) {
|
|
183
|
+
start();
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
state.lastPosition = {
|
|
187
|
+
pageX: e.pageX,
|
|
188
|
+
pageY: e.pageY
|
|
189
|
+
};
|
|
190
|
+
setPointerDown("mouse");
|
|
191
|
+
const onMouseMove = (event) => {
|
|
192
|
+
move(event, "mouse", event.pageX - (state.lastPosition?.pageX ?? 0), event.pageY - (state.lastPosition?.pageY ?? 0));
|
|
193
|
+
state.lastPosition = {
|
|
194
|
+
pageX: event.pageX,
|
|
195
|
+
pageY: event.pageY
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
const onMouseUp = (event) => {
|
|
199
|
+
end(event, "mouse");
|
|
200
|
+
removeGlobalListener("mousemove", onMouseMove);
|
|
201
|
+
removeGlobalListener("mouseup", onMouseUp);
|
|
202
|
+
setPointerDown(null);
|
|
203
|
+
};
|
|
204
|
+
addGlobalListener("mousemove", onMouseMove);
|
|
205
|
+
addGlobalListener("mouseup", onMouseUp);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
moveProps.onTouchStart = (e) => {
|
|
209
|
+
if (pointerDown() != null || e.changedTouches.length === 0 || state.id != null) return;
|
|
210
|
+
const { pageX, pageY, identifier } = e.changedTouches[0];
|
|
211
|
+
start();
|
|
212
|
+
e.stopPropagation();
|
|
213
|
+
e.preventDefault();
|
|
214
|
+
state.lastPosition = {
|
|
215
|
+
pageX,
|
|
216
|
+
pageY
|
|
217
|
+
};
|
|
218
|
+
state.id = identifier;
|
|
219
|
+
setPointerDown("touch");
|
|
220
|
+
const onTouchMove = (event) => {
|
|
221
|
+
const touchIndex = [...event.changedTouches].findIndex(({ identifier: touchId }) => touchId === state.id);
|
|
222
|
+
if (touchIndex >= 0) {
|
|
223
|
+
const { pageX: moveX, pageY: moveY } = event.changedTouches[touchIndex];
|
|
224
|
+
move(event, "touch", moveX - (state.lastPosition?.pageX ?? 0), moveY - (state.lastPosition?.pageY ?? 0));
|
|
225
|
+
state.lastPosition = {
|
|
226
|
+
pageX: moveX,
|
|
227
|
+
pageY: moveY
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
const onTouchEnd = (event) => {
|
|
232
|
+
if ([...event.changedTouches].findIndex(({ identifier: touchId }) => touchId === state.id) >= 0) {
|
|
233
|
+
end(event, "touch");
|
|
234
|
+
state.id = null;
|
|
235
|
+
removeGlobalListener("touchmove", onTouchMove);
|
|
236
|
+
removeGlobalListener("touchend", onTouchEnd);
|
|
237
|
+
removeGlobalListener("touchcancel", onTouchEnd);
|
|
238
|
+
setPointerDown(null);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
addGlobalListener("touchmove", onTouchMove);
|
|
242
|
+
addGlobalListener("touchend", onTouchEnd);
|
|
243
|
+
addGlobalListener("touchcancel", onTouchEnd);
|
|
244
|
+
};
|
|
245
|
+
if (hasPointerEvents) moveProps.onPointerDown = (e) => {
|
|
246
|
+
if ((e.button ?? 0) === 0 && state.id == null) {
|
|
247
|
+
start();
|
|
248
|
+
e.stopPropagation();
|
|
249
|
+
e.preventDefault();
|
|
250
|
+
state.lastPosition = {
|
|
251
|
+
pageX: e.pageX,
|
|
252
|
+
pageY: e.pageY
|
|
253
|
+
};
|
|
254
|
+
state.id = e.pointerId;
|
|
255
|
+
setPointerDown("pointer");
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
const triggerKeyboardMove = (e, deltaX, deltaY) => {
|
|
259
|
+
start();
|
|
260
|
+
move(e, "keyboard", deltaX, deltaY);
|
|
261
|
+
end(e, "keyboard");
|
|
262
|
+
};
|
|
263
|
+
moveProps.onKeyDown = (e) => {
|
|
264
|
+
switch (e.key) {
|
|
265
|
+
case "Left":
|
|
266
|
+
case "ArrowLeft":
|
|
267
|
+
e.preventDefault();
|
|
268
|
+
e.stopPropagation();
|
|
269
|
+
triggerKeyboardMove(e, -1, 0);
|
|
270
|
+
break;
|
|
271
|
+
case "Right":
|
|
272
|
+
case "ArrowRight":
|
|
273
|
+
e.preventDefault();
|
|
274
|
+
e.stopPropagation();
|
|
275
|
+
triggerKeyboardMove(e, 1, 0);
|
|
276
|
+
break;
|
|
277
|
+
case "Up":
|
|
278
|
+
case "ArrowUp":
|
|
279
|
+
e.preventDefault();
|
|
280
|
+
e.stopPropagation();
|
|
281
|
+
triggerKeyboardMove(e, 0, -1);
|
|
282
|
+
break;
|
|
283
|
+
case "Down":
|
|
284
|
+
case "ArrowDown":
|
|
285
|
+
e.preventDefault();
|
|
286
|
+
e.stopPropagation();
|
|
287
|
+
triggerKeyboardMove(e, 0, 1);
|
|
288
|
+
break;
|
|
289
|
+
default: break;
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
return { moveProps };
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/interactions/FocusableProvider.tsx
|
|
296
|
+
/**
|
|
297
|
+
* FocusableProvider - Provides DOM props to the nearest focusable child.
|
|
298
|
+
*
|
|
299
|
+
* This is a 1-1 port of React-Aria's FocusableProvider adapted for SolidJS.
|
|
300
|
+
*/
|
|
301
|
+
/**
|
|
302
|
+
* Provides DOM props to the nearest focusable child.
|
|
303
|
+
* Used to pass focus-related props through component boundaries.
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```tsx
|
|
307
|
+
* import { FocusableProvider } from 'solidaria';
|
|
308
|
+
*
|
|
309
|
+
* function MyComponent() {
|
|
310
|
+
* return (
|
|
311
|
+
* <FocusableProvider onFocus={() => console.log('focused!')}>
|
|
312
|
+
* <NestedFocusableComponent />
|
|
313
|
+
* </FocusableProvider>
|
|
314
|
+
* );
|
|
315
|
+
* }
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
const FocusableProvider = (props) => {
|
|
319
|
+
const [, otherProps] = splitProps(props, ["children"]);
|
|
320
|
+
const context = mergeProps(otherProps, { ref: (_el) => {} });
|
|
321
|
+
return createComponent(FocusableContext.Provider, {
|
|
322
|
+
value: context,
|
|
323
|
+
get children() {
|
|
324
|
+
return props.children;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
//#endregion
|
|
329
|
+
export { createMove as n, createLongPress as r, FocusableProvider as t };
|
|
330
|
+
|
|
331
|
+
//# sourceMappingURL=interactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactions.js","names":["mergeProps","JSX","mergeProps","ParentComponent","splitProps","FocusableContext","FocusableContextValue","FocusableProviderProps","FocusableProvider","HTMLAttributes","HTMLElement","props","otherProps","context","ref","_el","_$createComponent","Provider","value","children"],"sources":["../../src/interactions/createLongPress.ts","../../src/interactions/createMove.ts","../../src/interactions/FocusableProvider.tsx"],"sourcesContent":["/**\n * createLongPress - Handles long press interactions across mouse and touch.\n *\n * Port of @react-aria/interactions useLongPress, adapted for SolidJS.\n */\n\nimport { JSX, onCleanup } from \"solid-js\";\nimport { createPress, type PressEvent } from \"./createPress\";\nimport { mergeProps, focusWithoutScrolling, createGlobalListeners } from \"../utils\";\nimport { createDescription } from \"../utils/createDescription\";\nimport { type MaybeAccessor } from \"../utils/reactivity\";\n\nexport interface LongPressEvent {\n /** The type of long press event being fired. */\n type: \"longpressstart\" | \"longpressend\" | \"longpress\";\n /** The pointer type that triggered the long press. */\n pointerType: PressEvent[\"pointerType\"];\n /** The target element of the long press event. */\n target: Element;\n /** Whether the shift keyboard modifier was held during the long press event. */\n shiftKey: boolean;\n /** Whether the ctrl keyboard modifier was held during the long press event. */\n ctrlKey: boolean;\n /** Whether the meta keyboard modifier was held during the long press event. */\n metaKey: boolean;\n /** Whether the alt keyboard modifier was held during the long press event. */\n altKey: boolean;\n /** X position relative to the target. */\n x: number;\n /** Y position relative to the target. */\n y: number;\n}\n\nexport interface LongPressProps {\n /** Whether long press events should be disabled. */\n isDisabled?: MaybeAccessor<boolean>;\n /** Handler that is called when a long press interaction starts. */\n onLongPressStart?: (e: LongPressEvent) => void;\n /**\n * Handler that is called when a long press interaction ends, either\n * over the target or when the pointer leaves the target.\n */\n onLongPressEnd?: (e: LongPressEvent) => void;\n /**\n * Handler that is called when the threshold time is met while\n * the press is over the target.\n */\n onLongPress?: (e: LongPressEvent) => void;\n /**\n * The amount of time in milliseconds to wait before triggering a long press.\n * @default 500ms\n */\n threshold?: number;\n /**\n * A description for assistive technology users indicating that a long press\n * action is available, e.g. \"Long press to open menu\".\n */\n accessibilityDescription?: string;\n}\n\nexport interface LongPressResult {\n /** Props to spread on the target element. */\n longPressProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\nconst DEFAULT_THRESHOLD = 500;\n\nfunction isDisabledValue(isDisabled: MaybeAccessor<boolean> | undefined): boolean {\n return typeof isDisabled === \"function\" ? isDisabled() : !!isDisabled;\n}\n\nfunction createLongPressEvent(type: LongPressEvent[\"type\"], e: PressEvent): LongPressEvent {\n return {\n type,\n pointerType: e.pointerType,\n target: e.target,\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n x: e.x,\n y: e.y,\n };\n}\n\n/**\n * Handles long press interactions across mouse and touch devices.\n */\nexport function createLongPress(props: LongPressProps = {}): LongPressResult {\n const {\n isDisabled,\n onLongPressStart,\n onLongPressEnd,\n onLongPress,\n threshold = DEFAULT_THRESHOLD,\n accessibilityDescription,\n } = props;\n\n let timeoutId: ReturnType<typeof setTimeout> | undefined;\n const { addGlobalListener } = createGlobalListeners();\n\n const { pressProps } = createPress({\n isDisabled,\n onPressStart(e) {\n e.continuePropagation();\n if (e.pointerType === \"mouse\" || e.pointerType === \"touch\") {\n onLongPressStart?.(createLongPressEvent(\"longpressstart\", e));\n\n timeoutId = setTimeout(() => {\n // Prevent other press handlers from also handling this event.\n e.target.dispatchEvent(new PointerEvent(\"pointercancel\", { bubbles: true }));\n\n // Ensure target is focused. On touch devices, browsers typically focus on pointer up.\n if (document.activeElement !== e.target) {\n focusWithoutScrolling(e.target as HTMLElement);\n }\n\n onLongPress?.(createLongPressEvent(\"longpress\", e));\n timeoutId = undefined;\n }, threshold);\n\n if (e.pointerType === \"touch\") {\n const onContextMenu = (event: Event) => {\n event.preventDefault();\n };\n const target = e.target as HTMLElement;\n target.addEventListener(\"contextmenu\", onContextMenu, { once: true });\n\n addGlobalListener(\n \"pointerup\",\n () => {\n setTimeout(() => {\n target.removeEventListener(\"contextmenu\", onContextMenu);\n }, 30);\n },\n { isWindow: true, once: true },\n );\n }\n }\n },\n onPressEnd(e) {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n\n if (onLongPressEnd && (e.pointerType === \"mouse\" || e.pointerType === \"touch\")) {\n onLongPressEnd(createLongPressEvent(\"longpressend\", e));\n }\n },\n });\n\n const descriptionProps = createDescription(() =>\n onLongPress && !isDisabledValue(isDisabled) ? accessibilityDescription : undefined,\n );\n\n onCleanup(() => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n });\n\n const longPressProps = mergeProps(pressProps) as JSX.HTMLAttributes<HTMLElement>;\n Object.defineProperty(longPressProps, \"aria-describedby\", {\n get: () => descriptionProps[\"aria-describedby\"],\n enumerable: true,\n configurable: true,\n });\n\n return {\n longPressProps,\n };\n}\n","/**\n * createMove - Handles move interactions across mouse, touch, pointer, and keyboard.\n *\n * Port of @react-aria/interactions useMove, adapted for SolidJS.\n */\n\nimport { JSX, createSignal, createEffect, onCleanup } from \"solid-js\";\nimport { disableTextSelection, restoreTextSelection, createGlobalListeners } from \"../utils\";\n\nexport type PointerType = \"mouse\" | \"pen\" | \"touch\" | \"keyboard\";\n\ninterface BaseMoveEvent {\n pointerType: PointerType;\n shiftKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n altKey: boolean;\n}\n\nexport interface MoveStartEvent extends BaseMoveEvent {\n type: \"movestart\";\n}\n\nexport interface MoveMoveEvent extends BaseMoveEvent {\n type: \"move\";\n deltaX: number;\n deltaY: number;\n}\n\nexport interface MoveEndEvent extends BaseMoveEvent {\n type: \"moveend\";\n}\n\nexport interface MoveEvents {\n onMoveStart?: (e: MoveStartEvent) => void;\n onMove?: (e: MoveMoveEvent) => void;\n onMoveEnd?: (e: MoveEndEvent) => void;\n}\n\nexport interface MoveResult {\n /** Props to spread on the target element. */\n moveProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\ninterface MoveState {\n didMove: boolean;\n lastPosition: { pageX: number; pageY: number } | null;\n id: number | null;\n}\n\nfunction createBaseEvent(\n originalEvent: { shiftKey: boolean; ctrlKey: boolean; metaKey: boolean; altKey: boolean },\n pointerType: PointerType,\n): BaseMoveEvent {\n return {\n pointerType,\n shiftKey: originalEvent.shiftKey,\n ctrlKey: originalEvent.ctrlKey,\n metaKey: originalEvent.metaKey,\n altKey: originalEvent.altKey,\n };\n}\n\n/**\n * Handles move interactions across mouse, touch, pointer, and keyboard.\n */\nexport function createMove(props: MoveEvents = {}): MoveResult {\n const { onMoveStart, onMove, onMoveEnd } = props;\n\n const state: MoveState = {\n didMove: false,\n lastPosition: null,\n id: null,\n };\n\n const { addGlobalListener, removeGlobalListener } = createGlobalListeners();\n const [pointerDown, setPointerDown] = createSignal<\"pointer\" | \"mouse\" | \"touch\" | null>(null);\n\n const move = (\n originalEvent: { shiftKey: boolean; ctrlKey: boolean; metaKey: boolean; altKey: boolean },\n pointerType: PointerType,\n deltaX: number,\n deltaY: number,\n ) => {\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n\n if (!state.didMove) {\n state.didMove = true;\n onMoveStart?.({\n type: \"movestart\",\n ...createBaseEvent(originalEvent, pointerType),\n });\n }\n\n onMove?.({\n type: \"move\",\n deltaX,\n deltaY,\n ...createBaseEvent(originalEvent, pointerType),\n });\n };\n\n const end = (\n originalEvent: { shiftKey: boolean; ctrlKey: boolean; metaKey: boolean; altKey: boolean },\n pointerType: PointerType,\n ) => {\n restoreTextSelection();\n if (state.didMove) {\n onMoveEnd?.({\n type: \"moveend\",\n ...createBaseEvent(originalEvent, pointerType),\n });\n }\n };\n\n createEffect(() => {\n const activePointer = pointerDown();\n if (!activePointer) return;\n\n if (activePointer === \"pointer\") {\n const onPointerMove = (e: PointerEvent) => {\n if (e.pointerId === state.id) {\n const pointerType = (e.pointerType || \"mouse\") as PointerType;\n move(\n e,\n pointerType,\n e.pageX - (state.lastPosition?.pageX ?? 0),\n e.pageY - (state.lastPosition?.pageY ?? 0),\n );\n state.lastPosition = { pageX: e.pageX, pageY: e.pageY };\n }\n };\n\n const onPointerUp = (e: PointerEvent) => {\n if (e.pointerId === state.id) {\n const pointerType = (e.pointerType || \"mouse\") as PointerType;\n end(e, pointerType);\n state.id = null;\n removeGlobalListener(\"pointermove\", onPointerMove, { isWindow: true });\n removeGlobalListener(\"pointerup\", onPointerUp, { isWindow: true });\n removeGlobalListener(\"pointercancel\", onPointerUp, { isWindow: true });\n setPointerDown(null);\n }\n };\n\n addGlobalListener(\"pointermove\", onPointerMove, { isWindow: true });\n addGlobalListener(\"pointerup\", onPointerUp, { isWindow: true });\n addGlobalListener(\"pointercancel\", onPointerUp, { isWindow: true });\n onCleanup(() => {\n removeGlobalListener(\"pointermove\", onPointerMove, { isWindow: true });\n removeGlobalListener(\"pointerup\", onPointerUp, { isWindow: true });\n removeGlobalListener(\"pointercancel\", onPointerUp, { isWindow: true });\n });\n }\n\n // Mouse/touch listeners are attached directly in their handlers.\n });\n\n const start = () => {\n disableTextSelection();\n state.didMove = false;\n };\n\n const moveProps: JSX.HTMLAttributes<HTMLElement> = {};\n\n const hasPointerEvents =\n typeof window !== \"undefined\" && typeof window.PointerEvent !== \"undefined\";\n\n moveProps.onMouseDown = (e: MouseEvent) => {\n if (pointerDown() != null) {\n return;\n }\n if (e.button === 0) {\n start();\n e.stopPropagation();\n e.preventDefault();\n state.lastPosition = { pageX: e.pageX, pageY: e.pageY };\n setPointerDown(\"mouse\");\n\n const onMouseMove = (event: MouseEvent) => {\n move(\n event,\n \"mouse\",\n event.pageX - (state.lastPosition?.pageX ?? 0),\n event.pageY - (state.lastPosition?.pageY ?? 0),\n );\n state.lastPosition = { pageX: event.pageX, pageY: event.pageY };\n };\n const onMouseUp = (event: MouseEvent) => {\n end(event, \"mouse\");\n removeGlobalListener(\"mousemove\", onMouseMove);\n removeGlobalListener(\"mouseup\", onMouseUp);\n setPointerDown(null);\n };\n addGlobalListener(\"mousemove\", onMouseMove);\n addGlobalListener(\"mouseup\", onMouseUp);\n }\n };\n\n moveProps.onTouchStart = (e: TouchEvent) => {\n if (pointerDown() != null || e.changedTouches.length === 0 || state.id != null) {\n return;\n }\n const { pageX, pageY, identifier } = e.changedTouches[0];\n start();\n e.stopPropagation();\n e.preventDefault();\n state.lastPosition = { pageX, pageY };\n state.id = identifier;\n setPointerDown(\"touch\");\n\n const onTouchMove = (event: TouchEvent) => {\n const touchIndex = [...event.changedTouches].findIndex(\n ({ identifier: touchId }) => touchId === state.id,\n );\n if (touchIndex >= 0) {\n const { pageX: moveX, pageY: moveY } = event.changedTouches[touchIndex];\n move(\n event,\n \"touch\",\n moveX - (state.lastPosition?.pageX ?? 0),\n moveY - (state.lastPosition?.pageY ?? 0),\n );\n state.lastPosition = { pageX: moveX, pageY: moveY };\n }\n };\n const onTouchEnd = (event: TouchEvent) => {\n const touchIndex = [...event.changedTouches].findIndex(\n ({ identifier: touchId }) => touchId === state.id,\n );\n if (touchIndex >= 0) {\n end(event, \"touch\");\n state.id = null;\n removeGlobalListener(\"touchmove\", onTouchMove);\n removeGlobalListener(\"touchend\", onTouchEnd);\n removeGlobalListener(\"touchcancel\", onTouchEnd);\n setPointerDown(null);\n }\n };\n addGlobalListener(\"touchmove\", onTouchMove);\n addGlobalListener(\"touchend\", onTouchEnd);\n addGlobalListener(\"touchcancel\", onTouchEnd);\n };\n\n if (hasPointerEvents) {\n moveProps.onPointerDown = (e: PointerEvent) => {\n const button = e.button ?? 0;\n if (button === 0 && state.id == null) {\n start();\n e.stopPropagation();\n e.preventDefault();\n state.lastPosition = { pageX: e.pageX, pageY: e.pageY };\n state.id = e.pointerId;\n setPointerDown(\"pointer\");\n }\n };\n }\n\n const triggerKeyboardMove = (e: KeyboardEvent, deltaX: number, deltaY: number) => {\n start();\n move(e, \"keyboard\", deltaX, deltaY);\n end(e, \"keyboard\");\n };\n\n moveProps.onKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case \"Left\":\n case \"ArrowLeft\":\n e.preventDefault();\n e.stopPropagation();\n triggerKeyboardMove(e, -1, 0);\n break;\n case \"Right\":\n case \"ArrowRight\":\n e.preventDefault();\n e.stopPropagation();\n triggerKeyboardMove(e, 1, 0);\n break;\n case \"Up\":\n case \"ArrowUp\":\n e.preventDefault();\n e.stopPropagation();\n triggerKeyboardMove(e, 0, -1);\n break;\n case \"Down\":\n case \"ArrowDown\":\n e.preventDefault();\n e.stopPropagation();\n triggerKeyboardMove(e, 0, 1);\n break;\n default:\n break;\n }\n };\n\n return { moveProps };\n}\n","/**\n * FocusableProvider - Provides DOM props to the nearest focusable child.\n *\n * This is a 1-1 port of React-Aria's FocusableProvider adapted for SolidJS.\n */\n\nimport { JSX, mergeProps, ParentComponent, splitProps } from \"solid-js\";\nimport { FocusableContext, FocusableContextValue, FocusableProviderProps } from \"./createFocusable\";\n\n/**\n * Provides DOM props to the nearest focusable child.\n * Used to pass focus-related props through component boundaries.\n *\n * @example\n * ```tsx\n * import { FocusableProvider } from 'solidaria';\n *\n * function MyComponent() {\n * return (\n * <FocusableProvider onFocus={() => console.log('focused!')}>\n * <NestedFocusableComponent />\n * </FocusableProvider>\n * );\n * }\n * ```\n */\nexport const FocusableProvider: ParentComponent<\n FocusableProviderProps & JSX.HTMLAttributes<HTMLElement>\n> = (props) => {\n // Don't destructure: `const { children, ...otherProps } = props` evaluates the\n // `children` getter immediately (2nd statement of the body), instantiating the\n // nested subtree BEFORE this provider mounts — so a child that reads\n // FocusableContext during its own setup would miss us. splitProps keeps\n // otherProps a reactive proxy; children is read lazily inside the JSX, under\n // the mounted provider. Same pattern as solidaria-components' useRenderProps.\n const [, otherProps] = splitProps(props, [\"children\"]);\n\n const context = mergeProps(otherProps, {\n ref: (_el: HTMLElement) => {\n // Store ref if needed by parent\n },\n }) as FocusableContextValue;\n\n return <FocusableContext.Provider value={context}>{props.children}</FocusableContext.Provider>;\n};\n"],"mappings":";;;;;;;;;;;;;AAiEA,MAAM,oBAAoB;AAE1B,SAAS,gBAAgB,YAAyD;CAChF,OAAO,OAAO,eAAe,aAAa,WAAW,IAAI,CAAC,CAAC;AAC7D;AAEA,SAAS,qBAAqB,MAA8B,GAA+B;CACzF,OAAO;EACL;EACA,aAAa,EAAE;EACf,QAAQ,EAAE;EACV,UAAU,EAAE;EACZ,SAAS,EAAE;EACX,SAAS,EAAE;EACX,QAAQ,EAAE;EACV,GAAG,EAAE;EACL,GAAG,EAAE;CACP;AACF;;;;AAKA,SAAgB,gBAAgB,QAAwB,CAAC,GAAoB;CAC3E,MAAM,EACJ,YACA,kBACA,gBACA,aACA,YAAY,mBACZ,6BACE;CAEJ,IAAI;CACJ,MAAM,EAAE,sBAAsB,sBAAsB;CAEpD,MAAM,EAAE,eAAe,YAAY;EACjC;EACA,aAAa,GAAG;GACd,EAAE,oBAAoB;GACtB,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