@proyecto-viviana/solidaria 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/DragManager.js +627 -0
- package/dist/_chunk/DragManager.js.map +1 -0
- package/dist/_chunk/DragManager.jsx +627 -0
- package/dist/_chunk/DragManager.jsx.map +1 -0
- package/dist/_chunk/FocusScope.js +400 -0
- package/dist/_chunk/FocusScope.js.map +1 -0
- package/dist/_chunk/FocusScope.jsx +375 -0
- package/dist/_chunk/FocusScope.jsx.map +1 -0
- package/dist/_chunk/actiongroup.js +13 -79
- package/dist/_chunk/actiongroup.js.map +1 -1
- package/dist/_chunk/actiongroup.jsx +13 -79
- package/dist/_chunk/actiongroup.jsx.map +1 -1
- package/dist/_chunk/{live-announcer.js → announce.js} +1 -1
- package/dist/_chunk/announce.js.map +1 -0
- package/dist/_chunk/{live-announcer.jsx → announce.jsx} +1 -1
- package/dist/_chunk/announce.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +56 -8
- package/dist/_chunk/autocomplete.js.map +1 -1
- package/dist/_chunk/autocomplete.jsx +56 -8
- package/dist/_chunk/autocomplete.jsx.map +1 -1
- package/dist/_chunk/breadcrumbs.js +6 -4
- package/dist/_chunk/breadcrumbs.js.map +1 -1
- package/dist/_chunk/breadcrumbs.jsx +6 -4
- package/dist/_chunk/breadcrumbs.jsx.map +1 -1
- package/dist/_chunk/button.js +8 -9
- package/dist/_chunk/button.js.map +1 -1
- package/dist/_chunk/button.jsx +8 -9
- package/dist/_chunk/button.jsx.map +1 -1
- package/dist/_chunk/calendar.js +27 -26
- package/dist/_chunk/calendar.js.map +1 -1
- package/dist/_chunk/calendar.jsx +27 -26
- package/dist/_chunk/calendar.jsx.map +1 -1
- package/dist/_chunk/checkbox.js +5 -4
- package/dist/_chunk/checkbox.js.map +1 -1
- package/dist/_chunk/checkbox.jsx +5 -4
- package/dist/_chunk/checkbox.jsx.map +1 -1
- package/dist/_chunk/color.js +302 -18
- package/dist/_chunk/color.js.map +1 -1
- package/dist/_chunk/color.jsx +302 -18
- package/dist/_chunk/color.jsx.map +1 -1
- package/dist/_chunk/combobox.js +638 -12
- package/dist/_chunk/combobox.js.map +1 -1
- package/dist/_chunk/combobox.jsx +638 -12
- package/dist/_chunk/combobox.jsx.map +1 -1
- package/dist/_chunk/constants.js +19 -0
- package/dist/_chunk/constants.js.map +1 -0
- package/dist/_chunk/constants.jsx +19 -0
- package/dist/_chunk/constants.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +3 -171
- package/dist/_chunk/createCollator.js.map +1 -1
- package/dist/_chunk/createCollator.jsx +3 -165
- package/dist/_chunk/createCollator.jsx.map +1 -1
- package/dist/_chunk/createField.js +2 -1
- package/dist/_chunk/createField.js.map +1 -1
- package/dist/_chunk/createField.jsx +2 -1
- package/dist/_chunk/createField.jsx.map +1 -1
- package/dist/_chunk/createFocus.js +12 -8
- package/dist/_chunk/createFocus.js.map +1 -1
- package/dist/_chunk/createFocus.jsx +12 -8
- package/dist/_chunk/createFocus.jsx.map +1 -1
- package/dist/_chunk/createFocusWithin.js +12 -13
- package/dist/_chunk/createFocusWithin.js.map +1 -1
- package/dist/_chunk/createFocusWithin.jsx +12 -13
- package/dist/_chunk/createFocusWithin.jsx.map +1 -1
- package/dist/_chunk/createFocusable.js +3 -3
- package/dist/_chunk/createFocusable.js.map +1 -1
- package/dist/_chunk/createFocusable.jsx +3 -3
- package/dist/_chunk/createFocusable.jsx.map +1 -1
- package/dist/_chunk/{form.js → createFormReset.js} +1 -1
- package/dist/_chunk/createFormReset.js.map +1 -0
- package/dist/_chunk/{form.jsx → createFormReset.jsx} +1 -1
- package/dist/_chunk/createFormReset.jsx.map +1 -0
- package/dist/_chunk/createHover.js +2 -1
- package/dist/_chunk/createHover.js.map +1 -1
- package/dist/_chunk/createHover.jsx +2 -1
- package/dist/_chunk/createHover.jsx.map +1 -1
- package/dist/_chunk/createInteractionModality.js +2 -3
- package/dist/_chunk/createInteractionModality.js.map +1 -1
- package/dist/_chunk/createInteractionModality.jsx +2 -3
- package/dist/_chunk/createInteractionModality.jsx.map +1 -1
- package/dist/_chunk/createLabel.js +2 -1
- package/dist/_chunk/createLabel.js.map +1 -1
- package/dist/_chunk/createLabel.jsx +2 -1
- package/dist/_chunk/createLabel.jsx.map +1 -1
- package/dist/_chunk/createLabels.js +3 -2
- package/dist/_chunk/createLabels.js.map +1 -1
- package/dist/_chunk/createLabels.jsx +3 -2
- package/dist/_chunk/createLabels.jsx.map +1 -1
- package/dist/_chunk/createLandmark.js +1 -1
- package/dist/_chunk/createLandmark.jsx +1 -1
- package/dist/_chunk/createProgressBar.js +2 -1
- package/dist/_chunk/createProgressBar.js.map +1 -1
- package/dist/_chunk/createProgressBar.jsx +2 -1
- package/dist/_chunk/createProgressBar.jsx.map +1 -1
- package/dist/_chunk/createSelectableItem.js +7 -3
- package/dist/_chunk/createSelectableItem.js.map +1 -1
- package/dist/_chunk/createSelectableItem.jsx +7 -3
- package/dist/_chunk/createSelectableItem.jsx.map +1 -1
- package/dist/_chunk/createStringFormatter.js +61 -0
- package/dist/_chunk/createStringFormatter.js.map +1 -0
- package/dist/_chunk/createStringFormatter.jsx +61 -0
- package/dist/_chunk/createStringFormatter.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +5 -4
- package/dist/_chunk/createToggle.js.map +1 -1
- package/dist/_chunk/createToggle.jsx +5 -4
- package/dist/_chunk/createToggle.jsx.map +1 -1
- package/dist/_chunk/datepicker.js +1413 -1100
- package/dist/_chunk/datepicker.js.map +1 -1
- package/dist/_chunk/datepicker.jsx +1413 -1100
- package/dist/_chunk/datepicker.jsx.map +1 -1
- package/dist/_chunk/disclosure.js +2 -2
- package/dist/_chunk/disclosure.js.map +1 -1
- package/dist/_chunk/disclosure.jsx +2 -2
- package/dist/_chunk/disclosure.jsx.map +1 -1
- package/dist/_chunk/dnd.js +1586 -495
- package/dist/_chunk/dnd.js.map +1 -1
- package/dist/_chunk/dnd.jsx +1586 -495
- package/dist/_chunk/dnd.jsx.map +1 -1
- package/dist/_chunk/env.js +1 -19
- package/dist/_chunk/env.js.map +1 -1
- package/dist/_chunk/env.jsx +1 -19
- package/dist/_chunk/env.jsx.map +1 -1
- package/dist/_chunk/focus.js +1 -1
- package/dist/_chunk/focus.js.map +1 -1
- package/dist/_chunk/focus.jsx +1 -1
- package/dist/_chunk/focus.jsx.map +1 -1
- package/dist/_chunk/focus2.js +54 -318
- package/dist/_chunk/focus2.js.map +1 -1
- package/dist/_chunk/focus2.jsx +53 -292
- package/dist/_chunk/focus2.jsx.map +1 -1
- package/dist/_chunk/grid.js +1 -1
- package/dist/_chunk/grid.jsx +1 -1
- package/dist/_chunk/gridlist.js +14 -9
- package/dist/_chunk/gridlist.js.map +1 -1
- package/dist/_chunk/gridlist.jsx +14 -9
- package/dist/_chunk/gridlist.jsx.map +1 -1
- package/dist/_chunk/i18n.js +3 -58
- package/dist/_chunk/i18n.js.map +1 -1
- package/dist/_chunk/i18n.jsx +3 -58
- package/dist/_chunk/i18n.jsx.map +1 -1
- package/dist/_chunk/interactions.js +99 -9
- package/dist/_chunk/interactions.js.map +1 -1
- package/dist/_chunk/interactions.jsx +97 -9
- package/dist/_chunk/interactions.jsx.map +1 -1
- package/dist/_chunk/link.js +2 -1
- package/dist/_chunk/link.js.map +1 -1
- package/dist/_chunk/link.jsx +2 -1
- package/dist/_chunk/link.jsx.map +1 -1
- package/dist/_chunk/listbox.js +42 -10
- package/dist/_chunk/listbox.js.map +1 -1
- package/dist/_chunk/listbox.jsx +42 -10
- package/dist/_chunk/listbox.jsx.map +1 -1
- package/dist/_chunk/locale.js +173 -0
- package/dist/_chunk/locale.js.map +1 -0
- package/dist/_chunk/locale.jsx +167 -0
- package/dist/_chunk/locale.jsx.map +1 -0
- package/dist/_chunk/menu.js +5 -4
- package/dist/_chunk/menu.js.map +1 -1
- package/dist/_chunk/menu.jsx +5 -4
- package/dist/_chunk/menu.jsx.map +1 -1
- package/dist/_chunk/numberfield.js +3 -2
- package/dist/_chunk/numberfield.js.map +1 -1
- package/dist/_chunk/numberfield.jsx +3 -2
- package/dist/_chunk/numberfield.jsx.map +1 -1
- package/dist/_chunk/overlays.js +1 -1
- package/dist/_chunk/overlays.jsx +1 -1
- package/dist/_chunk/popover.js +3 -3
- package/dist/_chunk/popover.js.map +1 -1
- package/dist/_chunk/popover.jsx +3 -3
- package/dist/_chunk/popover.jsx.map +1 -1
- package/dist/_chunk/radio.js +7 -6
- package/dist/_chunk/radio.js.map +1 -1
- package/dist/_chunk/radio.jsx +7 -6
- package/dist/_chunk/radio.jsx.map +1 -1
- package/dist/_chunk/reactivity.js +21 -0
- package/dist/_chunk/reactivity.js.map +1 -0
- package/dist/_chunk/reactivity.jsx +21 -0
- package/dist/_chunk/reactivity.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +2 -1
- package/dist/_chunk/searchfield.js.map +1 -1
- package/dist/_chunk/searchfield.jsx +2 -1
- package/dist/_chunk/searchfield.jsx.map +1 -1
- package/dist/_chunk/select.js +8 -5
- package/dist/_chunk/select.js.map +1 -1
- package/dist/_chunk/select.jsx +8 -5
- package/dist/_chunk/select.jsx.map +1 -1
- package/dist/_chunk/selection.js +8 -21
- package/dist/_chunk/selection.js.map +1 -1
- package/dist/_chunk/selection.jsx +8 -21
- package/dist/_chunk/selection.jsx.map +1 -1
- package/dist/_chunk/separator.js +1 -1
- package/dist/_chunk/separator.jsx +1 -1
- package/dist/_chunk/slider.js +5 -4
- package/dist/_chunk/slider.js.map +1 -1
- package/dist/_chunk/slider.jsx +5 -4
- package/dist/_chunk/slider.jsx.map +1 -1
- package/dist/_chunk/spinbutton.js +153 -0
- package/dist/_chunk/spinbutton.js.map +1 -0
- package/dist/_chunk/spinbutton.jsx +153 -0
- package/dist/_chunk/spinbutton.jsx.map +1 -0
- package/dist/_chunk/table.js +45 -8
- package/dist/_chunk/table.js.map +1 -1
- package/dist/_chunk/table.jsx +45 -8
- package/dist/_chunk/table.jsx.map +1 -1
- package/dist/_chunk/tabs.js +11 -8
- package/dist/_chunk/tabs.js.map +1 -1
- package/dist/_chunk/tabs.jsx +11 -8
- package/dist/_chunk/tabs.jsx.map +1 -1
- package/dist/_chunk/tag.js +54 -18
- package/dist/_chunk/tag.js.map +1 -1
- package/dist/_chunk/tag.jsx +54 -18
- package/dist/_chunk/tag.jsx.map +1 -1
- package/dist/_chunk/textfield.js +2 -1
- package/dist/_chunk/textfield.js.map +1 -1
- package/dist/_chunk/textfield.jsx +2 -1
- package/dist/_chunk/textfield.jsx.map +1 -1
- package/dist/_chunk/toolbar.js +4 -36
- package/dist/_chunk/toolbar.js.map +1 -1
- package/dist/_chunk/toolbar.jsx +4 -36
- package/dist/_chunk/toolbar.jsx.map +1 -1
- package/dist/_chunk/tooltip.js +2 -2
- package/dist/_chunk/tooltip.js.map +1 -1
- package/dist/_chunk/tooltip.jsx +2 -2
- package/dist/_chunk/tooltip.jsx.map +1 -1
- package/dist/_chunk/tree.js +42 -14
- package/dist/_chunk/tree.js.map +1 -1
- package/dist/_chunk/tree.jsx +42 -14
- package/dist/_chunk/tree.jsx.map +1 -1
- package/dist/_chunk/utils.js +59 -19
- package/dist/_chunk/utils.js.map +1 -1
- package/dist/_chunk/utils.jsx +59 -19
- package/dist/_chunk/utils.jsx.map +1 -1
- package/dist/_chunk/visually-hidden.js +3 -2
- package/dist/_chunk/visually-hidden.js.map +1 -1
- package/dist/_chunk/visually-hidden.jsx +3 -2
- package/dist/_chunk/visually-hidden.jsx.map +1 -1
- package/dist/actiongroup/createActionGroup.d.ts.map +1 -1
- package/dist/autocomplete/createAutocomplete.d.ts +10 -7
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/breadcrumbs/createBreadcrumbs.d.ts.map +1 -1
- package/dist/button/createToggleButtonGroup.d.ts.map +1 -1
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/createRangeCalendarCell.d.ts.map +1 -1
- package/dist/calendar/intl/index.d.ts +1 -1
- package/dist/calendar/intl/index.d.ts.map +1 -1
- package/dist/collections/index.js +1 -1
- package/dist/collections/index.jsx +1 -1
- package/dist/color/createColorArea.d.ts.map +1 -1
- package/dist/color/createColorField.d.ts.map +1 -1
- package/dist/color/createColorSlider.d.ts.map +1 -1
- package/dist/color/createColorSwatch.d.ts.map +1 -1
- package/dist/color/createColorWheel.d.ts.map +1 -1
- package/dist/color/intl/index.d.ts +30 -0
- package/dist/color/intl/index.d.ts.map +1 -0
- package/dist/combobox/createComboBox.d.ts.map +1 -1
- package/dist/combobox/intl/generated-locales.d.ts +16 -0
- package/dist/combobox/intl/generated-locales.d.ts.map +1 -0
- package/dist/combobox/intl/index.d.ts +2 -2
- package/dist/combobox/intl/index.d.ts.map +1 -1
- package/dist/datepicker/createDateField.d.ts +45 -23
- package/dist/datepicker/createDateField.d.ts.map +1 -1
- package/dist/datepicker/createDatePicker.d.ts +34 -6
- package/dist/datepicker/createDatePicker.d.ts.map +1 -1
- package/dist/datepicker/createDatePickerGroup.d.ts +13 -13
- package/dist/datepicker/createDatePickerGroup.d.ts.map +1 -1
- package/dist/datepicker/createDateRangePicker.d.ts +55 -7
- package/dist/datepicker/createDateRangePicker.d.ts.map +1 -1
- package/dist/datepicker/createDateSegment.d.ts +6 -15
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/createDisplayNames.d.ts +17 -0
- package/dist/datepicker/createDisplayNames.d.ts.map +1 -0
- package/dist/datepicker/createTimeField.d.ts +12 -49
- package/dist/datepicker/createTimeField.d.ts.map +1 -1
- package/dist/datepicker/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -2
- package/dist/datepicker/index.jsx +2 -2
- package/dist/datepicker/intl.d.ts +12 -0
- package/dist/datepicker/intl.d.ts.map +1 -0
- package/dist/dnd/DragManager.d.ts +86 -0
- package/dist/dnd/DragManager.d.ts.map +1 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts +42 -0
- package/dist/dnd/DropTargetKeyboardNavigation.d.ts.map +1 -0
- package/dist/dnd/createDrag.d.ts.map +1 -1
- package/dist/dnd/createDraggableCollection.d.ts.map +1 -1
- package/dist/dnd/createDraggableItem.d.ts +12 -7
- package/dist/dnd/createDraggableItem.d.ts.map +1 -1
- package/dist/dnd/createDroppableCollection.d.ts +7 -15
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.d.ts +5 -1
- package/dist/dnd/index.d.ts.map +1 -1
- package/dist/dnd/index.js +3 -2
- package/dist/dnd/index.jsx +3 -2
- package/dist/dnd/intl/index.d.ts +39 -0
- package/dist/dnd/intl/index.d.ts.map +1 -0
- package/dist/dnd/utils.d.ts +5 -0
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts +7 -0
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.d.ts +2 -1
- package/dist/focus/index.d.ts.map +1 -1
- package/dist/focus/index.js +3 -2
- package/dist/focus/index.jsx +3 -2
- package/dist/focus/virtualFocus.d.ts +26 -0
- package/dist/focus/virtualFocus.d.ts.map +1 -0
- package/dist/form/index.js +1 -1
- package/dist/form/index.jsx +1 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/i18n/index.js +4 -2
- package/dist/i18n/index.jsx +4 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.jsx +18 -12
- package/dist/interactions/FocusableProvider.d.ts.map +1 -1
- package/dist/interactions/createFocus.d.ts.map +1 -1
- package/dist/interactions/createFocusWithin.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/index.js +1 -2
- package/dist/interactions/index.jsx +1 -2
- package/dist/label/createLabels.d.ts.map +1 -1
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +1 -1
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/live-announcer/index.js +1 -1
- package/dist/live-announcer/index.jsx +1 -1
- package/dist/select/createSelect.d.ts +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/selection/createSelectableItem.d.ts.map +1 -1
- package/dist/selection/index.js +2 -1
- package/dist/selection/index.jsx +2 -1
- package/dist/spinbutton/createSpinButton.d.ts +41 -0
- package/dist/spinbutton/createSpinButton.d.ts.map +1 -0
- package/dist/spinbutton/index.d.ts +3 -0
- package/dist/spinbutton/index.d.ts.map +1 -0
- package/dist/spinbutton/index.js +2 -0
- package/dist/spinbutton/index.jsx +2 -0
- package/dist/spinbutton/intl.d.ts +5 -0
- package/dist/spinbutton/intl.d.ts.map +1 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableColumnHeader.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectionCheckbox.d.ts.map +1 -1
- package/dist/table/types.d.ts +8 -0
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/utils.d.ts +15 -0
- package/dist/table/utils.d.ts.map +1 -0
- package/dist/tabs/createTabs.d.ts +1 -0
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/createTagGroup.d.ts +7 -0
- package/dist/tag/createTagGroup.d.ts.map +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeSelectionCheckbox.d.ts.map +1 -1
- package/dist/utils/animation.d.ts.map +1 -1
- package/dist/utils/dom.d.ts +1 -0
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -3
- package/dist/utils/index.jsx +4 -3
- package/package.json +2 -2
- package/src/actiongroup/createActionGroup.ts +26 -109
- package/src/autocomplete/createAutocomplete.ts +136 -15
- package/src/breadcrumbs/createBreadcrumbs.ts +12 -4
- package/src/button/createToggleButtonGroup.ts +19 -14
- package/src/calendar/createCalendar.ts +3 -4
- package/src/calendar/createCalendarCell.ts +17 -3
- package/src/calendar/createCalendarGrid.ts +5 -4
- package/src/calendar/createRangeCalendar.ts +27 -17
- package/src/calendar/createRangeCalendarCell.ts +17 -3
- package/src/calendar/intl/index.ts +8 -0
- package/src/color/createColorArea.ts +17 -10
- package/src/color/createColorField.ts +8 -1
- package/src/color/createColorSlider.ts +1 -2
- package/src/color/createColorSwatch.ts +4 -2
- package/src/color/createColorWheel.ts +0 -6
- package/src/color/intl/index.ts +316 -0
- package/src/combobox/createComboBox.ts +35 -4
- package/src/combobox/intl/generated-locales.ts +635 -0
- package/src/combobox/intl/index.ts +8 -2
- package/src/datepicker/createDateField.ts +228 -213
- package/src/datepicker/createDatePicker.ts +157 -146
- package/src/datepicker/createDatePickerGroup.ts +88 -82
- package/src/datepicker/createDateRangePicker.ts +230 -179
- package/src/datepicker/createDateSegment.ts +386 -389
- package/src/datepicker/createDisplayNames.ts +45 -0
- package/src/datepicker/createTimeField.ts +36 -129
- package/src/datepicker/index.ts +13 -14
- package/src/datepicker/intl.ts +633 -0
- package/src/dnd/DragManager.ts +693 -0
- package/src/dnd/DropTargetKeyboardNavigation.ts +337 -0
- package/src/dnd/createDrag.ts +31 -5
- package/src/dnd/createDraggableCollection.ts +33 -15
- package/src/dnd/createDraggableItem.ts +92 -5
- package/src/dnd/createDroppableCollection.ts +487 -373
- package/src/dnd/index.ts +11 -0
- package/src/dnd/intl/ar-AE.json +29 -0
- package/src/dnd/intl/bg-BG.json +29 -0
- package/src/dnd/intl/cs-CZ.json +29 -0
- package/src/dnd/intl/da-DK.json +29 -0
- package/src/dnd/intl/de-DE.json +29 -0
- package/src/dnd/intl/el-GR.json +29 -0
- package/src/dnd/intl/en-US.json +29 -0
- package/src/dnd/intl/es-ES.json +29 -0
- package/src/dnd/intl/et-EE.json +29 -0
- package/src/dnd/intl/fi-FI.json +29 -0
- package/src/dnd/intl/fr-FR.json +29 -0
- package/src/dnd/intl/he-IL.json +29 -0
- package/src/dnd/intl/hr-HR.json +29 -0
- package/src/dnd/intl/hu-HU.json +29 -0
- package/src/dnd/intl/index.ts +139 -0
- package/src/dnd/intl/it-IT.json +29 -0
- package/src/dnd/intl/ja-JP.json +29 -0
- package/src/dnd/intl/ko-KR.json +29 -0
- package/src/dnd/intl/lt-LT.json +29 -0
- package/src/dnd/intl/lv-LV.json +29 -0
- package/src/dnd/intl/nb-NO.json +29 -0
- package/src/dnd/intl/nl-NL.json +29 -0
- package/src/dnd/intl/pl-PL.json +29 -0
- package/src/dnd/intl/pt-BR.json +29 -0
- package/src/dnd/intl/pt-PT.json +29 -0
- package/src/dnd/intl/ro-RO.json +29 -0
- package/src/dnd/intl/ru-RU.json +29 -0
- package/src/dnd/intl/sk-SK.json +29 -0
- package/src/dnd/intl/sl-SI.json +29 -0
- package/src/dnd/intl/sr-SP.json +29 -0
- package/src/dnd/intl/sv-SE.json +29 -0
- package/src/dnd/intl/tr-TR.json +29 -0
- package/src/dnd/intl/uk-UA.json +29 -0
- package/src/dnd/intl/zh-CN.json +29 -0
- package/src/dnd/intl/zh-TW.json +29 -0
- package/src/dnd/utils.ts +36 -0
- package/src/focus/FocusScope.tsx +120 -12
- package/src/focus/index.ts +8 -0
- package/src/focus/virtualFocus.ts +55 -0
- package/src/gridlist/createGridList.ts +52 -16
- package/src/index.ts +11 -3
- package/src/interactions/FocusableProvider.tsx +11 -6
- package/src/interactions/createFocus.ts +26 -21
- package/src/interactions/createFocusWithin.ts +23 -24
- package/src/interactions/createInteractionModality.ts +5 -3
- package/src/label/createLabels.ts +7 -4
- package/src/listbox/createListBox.ts +74 -2
- package/src/listbox/createOption.ts +16 -1
- package/src/select/createSelect.ts +23 -2
- package/src/selection/createSelectableItem.ts +14 -0
- package/src/spinbutton/createSpinButton.ts +163 -0
- package/src/spinbutton/index.ts +10 -0
- package/src/spinbutton/intl.ts +115 -0
- package/src/table/createTable.ts +26 -1
- package/src/table/createTableColumnHeader.ts +10 -0
- package/src/table/createTableRow.ts +10 -0
- package/src/table/createTableSelectionCheckbox.ts +24 -1
- package/src/table/types.ts +8 -0
- package/src/table/utils.ts +41 -0
- package/src/tabs/createTabs.ts +53 -12
- package/src/tag/createTag.ts +21 -32
- package/src/tag/createTagGroup.ts +92 -0
- package/src/toolbar/createToolbar.ts +6 -58
- package/src/tree/createTree.ts +69 -14
- package/src/tree/createTreeSelectionCheckbox.ts +14 -1
- package/src/utils/animation.ts +119 -27
- package/src/utils/dom.ts +3 -2
- package/src/utils/index.ts +2 -0
- package/dist/_chunk/createLongPress.js +0 -91
- package/dist/_chunk/createLongPress.js.map +0 -1
- package/dist/_chunk/createLongPress.jsx +0 -91
- package/dist/_chunk/createLongPress.jsx.map +0 -1
- package/dist/_chunk/form.js.map +0 -1
- package/dist/_chunk/form.jsx.map +0 -1
- package/dist/_chunk/live-announcer.js.map +0 -1
- package/dist/_chunk/live-announcer.jsx.map +0 -1
- package/dist/datepicker/createTimeSegment.d.ts +0 -29
- package/dist/datepicker/createTimeSegment.d.ts.map +0 -1
- package/src/datepicker/createTimeSegment.ts +0 -352
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { createContext, createEffect, createMemo, createSignal, onCleanup, useContext } from "solid-js";
|
|
2
|
+
import { createComponent } from "solid-js/web";
|
|
3
|
+
//#region src/i18n/utils.ts
|
|
4
|
+
/**
|
|
5
|
+
* i18n utilities for solidaria
|
|
6
|
+
*
|
|
7
|
+
* RTL detection and locale utilities.
|
|
8
|
+
*
|
|
9
|
+
* Port of @react-aria/i18n utils.
|
|
10
|
+
*/
|
|
11
|
+
const RTL_SCRIPTS = new Set([
|
|
12
|
+
"Arab",
|
|
13
|
+
"Syrc",
|
|
14
|
+
"Samr",
|
|
15
|
+
"Mand",
|
|
16
|
+
"Thaa",
|
|
17
|
+
"Mend",
|
|
18
|
+
"Nkoo",
|
|
19
|
+
"Adlm",
|
|
20
|
+
"Rohg",
|
|
21
|
+
"Hebr"
|
|
22
|
+
]);
|
|
23
|
+
const RTL_LANGS = new Set([
|
|
24
|
+
"ae",
|
|
25
|
+
"ar",
|
|
26
|
+
"arc",
|
|
27
|
+
"bcc",
|
|
28
|
+
"bqi",
|
|
29
|
+
"ckb",
|
|
30
|
+
"dv",
|
|
31
|
+
"fa",
|
|
32
|
+
"glk",
|
|
33
|
+
"he",
|
|
34
|
+
"ku",
|
|
35
|
+
"mzn",
|
|
36
|
+
"nqo",
|
|
37
|
+
"pnb",
|
|
38
|
+
"ps",
|
|
39
|
+
"sd",
|
|
40
|
+
"ug",
|
|
41
|
+
"ur",
|
|
42
|
+
"yi"
|
|
43
|
+
]);
|
|
44
|
+
/**
|
|
45
|
+
* Determines if a locale is read right to left.
|
|
46
|
+
* Uses Intl.Locale API when available for accurate detection.
|
|
47
|
+
*/
|
|
48
|
+
function isRTL(localeString) {
|
|
49
|
+
if (typeof Intl !== "undefined" && Intl.Locale) try {
|
|
50
|
+
const locale = new Intl.Locale(localeString).maximize();
|
|
51
|
+
const localeAny = locale;
|
|
52
|
+
const textInfo = typeof localeAny.getTextInfo === "function" ? localeAny.getTextInfo() : localeAny.textInfo;
|
|
53
|
+
if (textInfo) return textInfo.direction === "rtl";
|
|
54
|
+
if (locale.script) return RTL_SCRIPTS.has(locale.script);
|
|
55
|
+
} catch {}
|
|
56
|
+
const lang = localeString.split("-")[0];
|
|
57
|
+
return RTL_LANGS.has(lang);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a cache key for formatter options.
|
|
61
|
+
*/
|
|
62
|
+
function createCacheKey(locale, options) {
|
|
63
|
+
if (!options) return locale;
|
|
64
|
+
return locale + Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join();
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/i18n/locale.tsx
|
|
68
|
+
/**
|
|
69
|
+
* Locale context and provider for solidaria
|
|
70
|
+
*
|
|
71
|
+
* Provides locale and text direction to the component tree.
|
|
72
|
+
*
|
|
73
|
+
* Port of @react-aria/i18n context and useDefaultLocale.
|
|
74
|
+
*/
|
|
75
|
+
const localeSymbol = Symbol.for("solidaria.i18n.locale");
|
|
76
|
+
let currentLocale = null;
|
|
77
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
78
|
+
/**
|
|
79
|
+
* Gets the default locale from the browser/system.
|
|
80
|
+
*/
|
|
81
|
+
function getDefaultLocale() {
|
|
82
|
+
let locale = typeof window !== "undefined" && window[localeSymbol] || typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US";
|
|
83
|
+
try {
|
|
84
|
+
Intl.DateTimeFormat.supportedLocalesOf([locale]);
|
|
85
|
+
} catch {
|
|
86
|
+
locale = "en-US";
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
locale,
|
|
90
|
+
direction: isRTL(locale) ? "rtl" : "ltr"
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function updateLocale() {
|
|
94
|
+
currentLocale = getDefaultLocale();
|
|
95
|
+
for (const listener of listeners) listener(currentLocale);
|
|
96
|
+
}
|
|
97
|
+
const I18nContext = createContext(null);
|
|
98
|
+
/**
|
|
99
|
+
* Returns the current browser/system locale, and updates when it changes.
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```tsx
|
|
103
|
+
* const locale = createDefaultLocale();
|
|
104
|
+
* console.log(locale().locale); // 'en-US'
|
|
105
|
+
* console.log(locale().direction); // 'ltr'
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
function createDefaultLocale() {
|
|
109
|
+
if (!currentLocale) currentLocale = getDefaultLocale();
|
|
110
|
+
const [locale, setLocale] = createSignal(currentLocale);
|
|
111
|
+
createEffect(() => {
|
|
112
|
+
if (typeof window === "undefined") return;
|
|
113
|
+
if (listeners.size === 0) window.addEventListener("languagechange", updateLocale);
|
|
114
|
+
listeners.add(setLocale);
|
|
115
|
+
onCleanup(() => {
|
|
116
|
+
listeners.delete(setLocale);
|
|
117
|
+
if (listeners.size === 0) window.removeEventListener("languagechange", updateLocale);
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
return locale;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns the current locale and layout direction from context or browser default.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```tsx
|
|
127
|
+
* function MyComponent() {
|
|
128
|
+
* const locale = useLocale();
|
|
129
|
+
* return <div dir={locale().direction}>{locale().locale}</div>;
|
|
130
|
+
* }
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
function useLocale() {
|
|
134
|
+
const context = useContext(I18nContext);
|
|
135
|
+
const defaultLocale = createDefaultLocale();
|
|
136
|
+
return context || defaultLocale;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Provides the locale for the application to all child components.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```tsx
|
|
143
|
+
* // Use browser default locale
|
|
144
|
+
* <I18nProvider>
|
|
145
|
+
* <App />
|
|
146
|
+
* </I18nProvider>
|
|
147
|
+
*
|
|
148
|
+
* // Override with specific locale
|
|
149
|
+
* <I18nProvider locale="ar-SA">
|
|
150
|
+
* <App /> // Will have RTL direction
|
|
151
|
+
* </I18nProvider>
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
function I18nProvider(props) {
|
|
155
|
+
const defaultLocale = createDefaultLocale();
|
|
156
|
+
const locale = createMemo(() => {
|
|
157
|
+
if (props.locale) return {
|
|
158
|
+
locale: props.locale,
|
|
159
|
+
direction: isRTL(props.locale) ? "rtl" : "ltr"
|
|
160
|
+
};
|
|
161
|
+
return defaultLocale();
|
|
162
|
+
});
|
|
163
|
+
return createComponent(I18nContext.Provider, {
|
|
164
|
+
value: locale,
|
|
165
|
+
get children() {
|
|
166
|
+
return props.children;
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
171
|
+
export { createCacheKey as a, useLocale as i, createDefaultLocale as n, isRTL as o, getDefaultLocale as r, I18nProvider as t };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.js","names":["Accessor","JSX","ParentProps","createContext","createEffect","createMemo","createSignal","onCleanup","useContext","isRTL","Direction","Locale","locale","direction","I18nProviderProps","localeSymbol","Symbol","for","currentLocale","listeners","Set","getDefaultLocale","window","Record","navigator","language","userLanguage","Intl","DateTimeFormat","supportedLocalesOf","updateLocale","listener","I18nContext","createDefaultLocale","setLocale","size","addEventListener","add","delete","removeEventListener","useLocale","context","defaultLocale","I18nProvider","props","Element","_$createComponent","Provider","value","children"],"sources":["../../src/i18n/utils.ts","../../src/i18n/locale.tsx"],"sourcesContent":["/**\n * i18n utilities for solidaria\n *\n * RTL detection and locale utilities.\n *\n * Port of @react-aria/i18n utils.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set([\n \"Arab\",\n \"Syrc\",\n \"Samr\",\n \"Mand\",\n \"Thaa\",\n \"Mend\",\n \"Nkoo\",\n \"Adlm\",\n \"Rohg\",\n \"Hebr\",\n]);\n\nconst RTL_LANGS = new Set([\n \"ae\",\n \"ar\",\n \"arc\",\n \"bcc\",\n \"bqi\",\n \"ckb\",\n \"dv\",\n \"fa\",\n \"glk\",\n \"he\",\n \"ku\",\n \"mzn\",\n \"nqo\",\n \"pnb\",\n \"ps\",\n \"sd\",\n \"ug\",\n \"ur\",\n \"yi\",\n]);\n\n/**\n * Determines if a locale is read right to left.\n * Uses Intl.Locale API when available for accurate detection.\n */\nexport function isRTL(localeString: string): boolean {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (typeof Intl !== \"undefined\" && Intl.Locale) {\n try {\n const locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // getTextInfo() was implemented as a property by some browsers before it was standardized as a function.\n const localeAny = locale as unknown as {\n getTextInfo?: () => { direction: string };\n textInfo?: { direction: string };\n };\n const textInfo =\n typeof localeAny.getTextInfo === \"function\" ? localeAny.getTextInfo() : localeAny.textInfo;\n\n if (textInfo) {\n return textInfo.direction === \"rtl\";\n }\n\n // Fallback: guess using the script.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n } catch {\n // Fall through to language-based detection\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n const lang = localeString.split(\"-\")[0];\n return RTL_LANGS.has(lang);\n}\n\n/**\n * Creates a cache key for formatter options.\n */\nexport function createCacheKey(locale: string, options?: Record<string, unknown>): string {\n if (!options) {\n return locale;\n }\n return (\n locale +\n Object.entries(options)\n .sort((a, b) => (a[0] < b[0] ? -1 : 1))\n .join()\n );\n}\n","/**\n * Locale context and provider for solidaria\n *\n * Provides locale and text direction to the component tree.\n *\n * Port of @react-aria/i18n context and useDefaultLocale.\n */\n\nimport {\n type Accessor,\n type JSX,\n type ParentProps,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n useContext,\n} from \"solid-js\";\nimport { isRTL } from \"./utils\";\n\n/** Text direction: left-to-right or right-to-left. */\nexport type Direction = \"ltr\" | \"rtl\";\n\n/** Locale information including language code and text direction. */\nexport interface Locale {\n /** The BCP47 language code for the locale (e.g., 'en-US', 'ar-SA'). */\n locale: string;\n /** The writing direction for the locale. */\n direction: Direction;\n}\n\nexport interface I18nProviderProps extends ParentProps {\n /** The locale to apply to the children. If not provided, uses browser default. */\n locale?: string;\n}\n\n// Symbol for server-provided locale\nconst localeSymbol = Symbol.for(\"solidaria.i18n.locale\");\n\nlet currentLocale: Locale | null = null;\nconst listeners = new Set<(locale: Locale) => void>();\n\n/**\n * Gets the default locale from the browser/system.\n */\nexport function getDefaultLocale(): Locale {\n let locale =\n (typeof window !== \"undefined\" &&\n (window as unknown as Record<symbol, string>)[localeSymbol]) ||\n (typeof navigator !== \"undefined\" &&\n (navigator.language || (navigator as unknown as { userLanguage?: string }).userLanguage)) ||\n \"en-US\";\n\n // Validate the locale is supported\n try {\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch {\n locale = \"en-US\";\n }\n\n return {\n locale,\n direction: isRTL(locale) ? \"rtl\" : \"ltr\",\n };\n}\n\nfunction updateLocale(): void {\n currentLocale = getDefaultLocale();\n for (const listener of listeners) {\n listener(currentLocale);\n }\n}\n\nconst I18nContext = createContext<Accessor<Locale> | null>(null);\n\n/**\n * Returns the current browser/system locale, and updates when it changes.\n *\n * @example\n * ```tsx\n * const locale = createDefaultLocale();\n * console.log(locale().locale); // 'en-US'\n * console.log(locale().direction); // 'ltr'\n * ```\n */\nexport function createDefaultLocale(): Accessor<Locale> {\n if (!currentLocale) {\n currentLocale = getDefaultLocale();\n }\n\n const [locale, setLocale] = createSignal<Locale>(currentLocale);\n\n createEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n if (listeners.size === 0) {\n window.addEventListener(\"languagechange\", updateLocale);\n }\n\n listeners.add(setLocale);\n\n onCleanup(() => {\n listeners.delete(setLocale);\n if (listeners.size === 0) {\n window.removeEventListener(\"languagechange\", updateLocale);\n }\n });\n });\n\n return locale;\n}\n\n/**\n * Returns the current locale and layout direction from context or browser default.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const locale = useLocale();\n * return <div dir={locale().direction}>{locale().locale}</div>;\n * }\n * ```\n */\nexport function useLocale(): Accessor<Locale> {\n const context = useContext(I18nContext);\n const defaultLocale = createDefaultLocale();\n return context || defaultLocale;\n}\n\n/**\n * Provides the locale for the application to all child components.\n *\n * @example\n * ```tsx\n * // Use browser default locale\n * <I18nProvider>\n * <App />\n * </I18nProvider>\n *\n * // Override with specific locale\n * <I18nProvider locale=\"ar-SA\">\n * <App /> // Will have RTL direction\n * </I18nProvider>\n * ```\n */\nexport function I18nProvider(props: I18nProviderProps): JSX.Element {\n const defaultLocale = createDefaultLocale();\n\n const locale = createMemo<Locale>(() => {\n if (props.locale) {\n return {\n locale: props.locale,\n direction: isRTL(props.locale) ? \"rtl\" : \"ltr\",\n };\n }\n return defaultLocale();\n });\n\n return <I18nContext.Provider value={locale}>{props.children}</I18nContext.Provider>;\n}\n"],"mappings":";;;;;;;;;;AASA,MAAM,cAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,YAAY,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AAMD,SAAgB,MAAM,cAA+B;CAEnD,IAAI,OAAO,SAAS,eAAe,KAAK,QACtC,IAAI;EACF,MAAM,SAAS,IAAI,KAAK,OAAO,YAAY,CAAC,CAAC,SAAS;EAItD,MAAM,YAAY;EAIlB,MAAM,WACJ,OAAO,UAAU,gBAAgB,aAAa,UAAU,YAAY,IAAI,UAAU;EAEpF,IAAI,UACF,OAAO,SAAS,cAAc;EAIhC,IAAI,OAAO,QACT,OAAO,YAAY,IAAI,OAAO,MAAM;CAExC,QAAQ,CAER;CAIF,MAAM,OAAO,aAAa,MAAM,GAAG,CAAC,CAAC;CACrC,OAAO,UAAU,IAAI,IAAI;AAC3B;;;;AAKA,SAAgB,eAAe,QAAgB,SAA2C;CACxF,IAAI,CAAC,SACH,OAAO;CAET,OACE,SACA,OAAO,QAAQ,OAAO,CAAC,CACpB,MAAM,GAAG,MAAO,EAAE,KAAK,EAAE,KAAK,KAAK,CAAE,CAAC,CACtC,KAAK;AAEZ;;;;;;;;;;ACxDA,MAAMe,eAAeC,OAAOC,IAAI,uBAAuB;AAEvD,IAAIC,gBAA+B;AACnC,MAAMC,4BAAY,IAAIC,IAA8B;;;;AAKpD,SAA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CACvB,CAAC;CAED,OAAAI,gBAAQd,YAAYe,UAAQ;EAACC,OAAOpC;EAAM,IAAAqC,WAAA;GAAA,OAAGL,MAAMK;EAAQ;CAAA,CAAA;AAC7D"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { createContext, createEffect, createMemo, createSignal, onCleanup, useContext } from "solid-js";
|
|
2
|
+
//#region src/i18n/utils.ts
|
|
3
|
+
/**
|
|
4
|
+
* i18n utilities for solidaria
|
|
5
|
+
*
|
|
6
|
+
* RTL detection and locale utilities.
|
|
7
|
+
*
|
|
8
|
+
* Port of @react-aria/i18n utils.
|
|
9
|
+
*/
|
|
10
|
+
const RTL_SCRIPTS = new Set([
|
|
11
|
+
"Arab",
|
|
12
|
+
"Syrc",
|
|
13
|
+
"Samr",
|
|
14
|
+
"Mand",
|
|
15
|
+
"Thaa",
|
|
16
|
+
"Mend",
|
|
17
|
+
"Nkoo",
|
|
18
|
+
"Adlm",
|
|
19
|
+
"Rohg",
|
|
20
|
+
"Hebr"
|
|
21
|
+
]);
|
|
22
|
+
const RTL_LANGS = new Set([
|
|
23
|
+
"ae",
|
|
24
|
+
"ar",
|
|
25
|
+
"arc",
|
|
26
|
+
"bcc",
|
|
27
|
+
"bqi",
|
|
28
|
+
"ckb",
|
|
29
|
+
"dv",
|
|
30
|
+
"fa",
|
|
31
|
+
"glk",
|
|
32
|
+
"he",
|
|
33
|
+
"ku",
|
|
34
|
+
"mzn",
|
|
35
|
+
"nqo",
|
|
36
|
+
"pnb",
|
|
37
|
+
"ps",
|
|
38
|
+
"sd",
|
|
39
|
+
"ug",
|
|
40
|
+
"ur",
|
|
41
|
+
"yi"
|
|
42
|
+
]);
|
|
43
|
+
/**
|
|
44
|
+
* Determines if a locale is read right to left.
|
|
45
|
+
* Uses Intl.Locale API when available for accurate detection.
|
|
46
|
+
*/
|
|
47
|
+
function isRTL(localeString) {
|
|
48
|
+
if (typeof Intl !== "undefined" && Intl.Locale) try {
|
|
49
|
+
const locale = new Intl.Locale(localeString).maximize();
|
|
50
|
+
const localeAny = locale;
|
|
51
|
+
const textInfo = typeof localeAny.getTextInfo === "function" ? localeAny.getTextInfo() : localeAny.textInfo;
|
|
52
|
+
if (textInfo) return textInfo.direction === "rtl";
|
|
53
|
+
if (locale.script) return RTL_SCRIPTS.has(locale.script);
|
|
54
|
+
} catch {}
|
|
55
|
+
const lang = localeString.split("-")[0];
|
|
56
|
+
return RTL_LANGS.has(lang);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates a cache key for formatter options.
|
|
60
|
+
*/
|
|
61
|
+
function createCacheKey(locale, options) {
|
|
62
|
+
if (!options) return locale;
|
|
63
|
+
return locale + Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join();
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/i18n/locale.tsx
|
|
67
|
+
/**
|
|
68
|
+
* Locale context and provider for solidaria
|
|
69
|
+
*
|
|
70
|
+
* Provides locale and text direction to the component tree.
|
|
71
|
+
*
|
|
72
|
+
* Port of @react-aria/i18n context and useDefaultLocale.
|
|
73
|
+
*/
|
|
74
|
+
const localeSymbol = Symbol.for("solidaria.i18n.locale");
|
|
75
|
+
let currentLocale = null;
|
|
76
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
77
|
+
/**
|
|
78
|
+
* Gets the default locale from the browser/system.
|
|
79
|
+
*/
|
|
80
|
+
function getDefaultLocale() {
|
|
81
|
+
let locale = typeof window !== "undefined" && window[localeSymbol] || typeof navigator !== "undefined" && (navigator.language || navigator.userLanguage) || "en-US";
|
|
82
|
+
try {
|
|
83
|
+
Intl.DateTimeFormat.supportedLocalesOf([locale]);
|
|
84
|
+
} catch {
|
|
85
|
+
locale = "en-US";
|
|
86
|
+
}
|
|
87
|
+
return {
|
|
88
|
+
locale,
|
|
89
|
+
direction: isRTL(locale) ? "rtl" : "ltr"
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function updateLocale() {
|
|
93
|
+
currentLocale = getDefaultLocale();
|
|
94
|
+
for (const listener of listeners) listener(currentLocale);
|
|
95
|
+
}
|
|
96
|
+
const I18nContext = createContext(null);
|
|
97
|
+
/**
|
|
98
|
+
* Returns the current browser/system locale, and updates when it changes.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```tsx
|
|
102
|
+
* const locale = createDefaultLocale();
|
|
103
|
+
* console.log(locale().locale); // 'en-US'
|
|
104
|
+
* console.log(locale().direction); // 'ltr'
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
function createDefaultLocale() {
|
|
108
|
+
if (!currentLocale) currentLocale = getDefaultLocale();
|
|
109
|
+
const [locale, setLocale] = createSignal(currentLocale);
|
|
110
|
+
createEffect(() => {
|
|
111
|
+
if (typeof window === "undefined") return;
|
|
112
|
+
if (listeners.size === 0) window.addEventListener("languagechange", updateLocale);
|
|
113
|
+
listeners.add(setLocale);
|
|
114
|
+
onCleanup(() => {
|
|
115
|
+
listeners.delete(setLocale);
|
|
116
|
+
if (listeners.size === 0) window.removeEventListener("languagechange", updateLocale);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
return locale;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Returns the current locale and layout direction from context or browser default.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```tsx
|
|
126
|
+
* function MyComponent() {
|
|
127
|
+
* const locale = useLocale();
|
|
128
|
+
* return <div dir={locale().direction}>{locale().locale}</div>;
|
|
129
|
+
* }
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
function useLocale() {
|
|
133
|
+
const context = useContext(I18nContext);
|
|
134
|
+
const defaultLocale = createDefaultLocale();
|
|
135
|
+
return context || defaultLocale;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Provides the locale for the application to all child components.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```tsx
|
|
142
|
+
* // Use browser default locale
|
|
143
|
+
* <I18nProvider>
|
|
144
|
+
* <App />
|
|
145
|
+
* </I18nProvider>
|
|
146
|
+
*
|
|
147
|
+
* // Override with specific locale
|
|
148
|
+
* <I18nProvider locale="ar-SA">
|
|
149
|
+
* <App /> // Will have RTL direction
|
|
150
|
+
* </I18nProvider>
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
function I18nProvider(props) {
|
|
154
|
+
const defaultLocale = createDefaultLocale();
|
|
155
|
+
const locale = createMemo(() => {
|
|
156
|
+
if (props.locale) return {
|
|
157
|
+
locale: props.locale,
|
|
158
|
+
direction: isRTL(props.locale) ? "rtl" : "ltr"
|
|
159
|
+
};
|
|
160
|
+
return defaultLocale();
|
|
161
|
+
});
|
|
162
|
+
return <I18nContext.Provider value={locale}>{props.children}</I18nContext.Provider>;
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { createCacheKey as a, useLocale as i, createDefaultLocale as n, isRTL as o, getDefaultLocale as r, I18nProvider as t };
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=locale.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.jsx","names":[],"sources":["../../src/i18n/utils.ts","../../src/i18n/locale.tsx"],"sourcesContent":["/**\n * i18n utilities for solidaria\n *\n * RTL detection and locale utilities.\n *\n * Port of @react-aria/i18n utils.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set([\n \"Arab\",\n \"Syrc\",\n \"Samr\",\n \"Mand\",\n \"Thaa\",\n \"Mend\",\n \"Nkoo\",\n \"Adlm\",\n \"Rohg\",\n \"Hebr\",\n]);\n\nconst RTL_LANGS = new Set([\n \"ae\",\n \"ar\",\n \"arc\",\n \"bcc\",\n \"bqi\",\n \"ckb\",\n \"dv\",\n \"fa\",\n \"glk\",\n \"he\",\n \"ku\",\n \"mzn\",\n \"nqo\",\n \"pnb\",\n \"ps\",\n \"sd\",\n \"ug\",\n \"ur\",\n \"yi\",\n]);\n\n/**\n * Determines if a locale is read right to left.\n * Uses Intl.Locale API when available for accurate detection.\n */\nexport function isRTL(localeString: string): boolean {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n if (typeof Intl !== \"undefined\" && Intl.Locale) {\n try {\n const locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // getTextInfo() was implemented as a property by some browsers before it was standardized as a function.\n const localeAny = locale as unknown as {\n getTextInfo?: () => { direction: string };\n textInfo?: { direction: string };\n };\n const textInfo =\n typeof localeAny.getTextInfo === \"function\" ? localeAny.getTextInfo() : localeAny.textInfo;\n\n if (textInfo) {\n return textInfo.direction === \"rtl\";\n }\n\n // Fallback: guess using the script.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n } catch {\n // Fall through to language-based detection\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n const lang = localeString.split(\"-\")[0];\n return RTL_LANGS.has(lang);\n}\n\n/**\n * Creates a cache key for formatter options.\n */\nexport function createCacheKey(locale: string, options?: Record<string, unknown>): string {\n if (!options) {\n return locale;\n }\n return (\n locale +\n Object.entries(options)\n .sort((a, b) => (a[0] < b[0] ? -1 : 1))\n .join()\n );\n}\n","/**\n * Locale context and provider for solidaria\n *\n * Provides locale and text direction to the component tree.\n *\n * Port of @react-aria/i18n context and useDefaultLocale.\n */\n\nimport {\n type Accessor,\n type JSX,\n type ParentProps,\n createContext,\n createEffect,\n createMemo,\n createSignal,\n onCleanup,\n useContext,\n} from \"solid-js\";\nimport { isRTL } from \"./utils\";\n\n/** Text direction: left-to-right or right-to-left. */\nexport type Direction = \"ltr\" | \"rtl\";\n\n/** Locale information including language code and text direction. */\nexport interface Locale {\n /** The BCP47 language code for the locale (e.g., 'en-US', 'ar-SA'). */\n locale: string;\n /** The writing direction for the locale. */\n direction: Direction;\n}\n\nexport interface I18nProviderProps extends ParentProps {\n /** The locale to apply to the children. If not provided, uses browser default. */\n locale?: string;\n}\n\n// Symbol for server-provided locale\nconst localeSymbol = Symbol.for(\"solidaria.i18n.locale\");\n\nlet currentLocale: Locale | null = null;\nconst listeners = new Set<(locale: Locale) => void>();\n\n/**\n * Gets the default locale from the browser/system.\n */\nexport function getDefaultLocale(): Locale {\n let locale =\n (typeof window !== \"undefined\" &&\n (window as unknown as Record<symbol, string>)[localeSymbol]) ||\n (typeof navigator !== \"undefined\" &&\n (navigator.language || (navigator as unknown as { userLanguage?: string }).userLanguage)) ||\n \"en-US\";\n\n // Validate the locale is supported\n try {\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch {\n locale = \"en-US\";\n }\n\n return {\n locale,\n direction: isRTL(locale) ? \"rtl\" : \"ltr\",\n };\n}\n\nfunction updateLocale(): void {\n currentLocale = getDefaultLocale();\n for (const listener of listeners) {\n listener(currentLocale);\n }\n}\n\nconst I18nContext = createContext<Accessor<Locale> | null>(null);\n\n/**\n * Returns the current browser/system locale, and updates when it changes.\n *\n * @example\n * ```tsx\n * const locale = createDefaultLocale();\n * console.log(locale().locale); // 'en-US'\n * console.log(locale().direction); // 'ltr'\n * ```\n */\nexport function createDefaultLocale(): Accessor<Locale> {\n if (!currentLocale) {\n currentLocale = getDefaultLocale();\n }\n\n const [locale, setLocale] = createSignal<Locale>(currentLocale);\n\n createEffect(() => {\n if (typeof window === \"undefined\") {\n return;\n }\n\n if (listeners.size === 0) {\n window.addEventListener(\"languagechange\", updateLocale);\n }\n\n listeners.add(setLocale);\n\n onCleanup(() => {\n listeners.delete(setLocale);\n if (listeners.size === 0) {\n window.removeEventListener(\"languagechange\", updateLocale);\n }\n });\n });\n\n return locale;\n}\n\n/**\n * Returns the current locale and layout direction from context or browser default.\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const locale = useLocale();\n * return <div dir={locale().direction}>{locale().locale}</div>;\n * }\n * ```\n */\nexport function useLocale(): Accessor<Locale> {\n const context = useContext(I18nContext);\n const defaultLocale = createDefaultLocale();\n return context || defaultLocale;\n}\n\n/**\n * Provides the locale for the application to all child components.\n *\n * @example\n * ```tsx\n * // Use browser default locale\n * <I18nProvider>\n * <App />\n * </I18nProvider>\n *\n * // Override with specific locale\n * <I18nProvider locale=\"ar-SA\">\n * <App /> // Will have RTL direction\n * </I18nProvider>\n * ```\n */\nexport function I18nProvider(props: I18nProviderProps): JSX.Element {\n const defaultLocale = createDefaultLocale();\n\n const locale = createMemo<Locale>(() => {\n if (props.locale) {\n return {\n locale: props.locale,\n direction: isRTL(props.locale) ? \"rtl\" : \"ltr\",\n };\n }\n return defaultLocale();\n });\n\n return <I18nContext.Provider value={locale}>{props.children}</I18nContext.Provider>;\n}\n"],"mappings":";;;;;;;;;AASA,MAAM,cAAc,IAAI,IAAI;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,YAAY,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;AAMD,SAAgB,MAAM,cAA+B;CAEnD,IAAI,OAAO,SAAS,eAAe,KAAK,QACtC,IAAI;EACF,MAAM,SAAS,IAAI,KAAK,OAAO,YAAY,CAAC,CAAC,SAAS;EAItD,MAAM,YAAY;EAIlB,MAAM,WACJ,OAAO,UAAU,gBAAgB,aAAa,UAAU,YAAY,IAAI,UAAU;EAEpF,IAAI,UACF,OAAO,SAAS,cAAc;EAIhC,IAAI,OAAO,QACT,OAAO,YAAY,IAAI,OAAO,MAAM;CAExC,QAAQ,CAER;CAIF,MAAM,OAAO,aAAa,MAAM,GAAG,CAAC,CAAC;CACrC,OAAO,UAAU,IAAI,IAAI;AAC3B;;;;AAKA,SAAgB,eAAe,QAAgB,SAA2C;CACxF,IAAI,CAAC,SACH,OAAO;CAET,OACE,SACA,OAAO,QAAQ,OAAO,CAAC,CACpB,MAAM,GAAG,MAAO,EAAE,KAAK,EAAE,KAAK,KAAK,CAAE,CAAC,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,OAAO,cAAc;CACvB,CAAC;CAED,OAAO,CAAC,YAAY,SAAS,OAAO,SAAS,MAAM,SAAS,EAAE,YAAY;AAC5E"}
|
package/dist/_chunk/menu.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as createPress } from "./createPress.js";
|
|
2
|
-
import { i as
|
|
2
|
+
import { i as mergeProps$1, t as isDevEnv } from "./env.js";
|
|
3
3
|
import { t as filterDOMProps } from "./filterDOMProps.js";
|
|
4
|
+
import { t as access } from "./reactivity.js";
|
|
4
5
|
import { p as isVirtualClick } from "./utils.js";
|
|
5
6
|
import { a as getEventTarget } from "./focus.js";
|
|
6
7
|
import { t as createFocusWithin } from "./createFocusWithin.js";
|
|
@@ -240,7 +241,7 @@ function createMenu(props, state, ref) {
|
|
|
240
241
|
},
|
|
241
242
|
get menuProps() {
|
|
242
243
|
const p = getProps();
|
|
243
|
-
const baseProps = mergeProps(domProps(), focusWithinProps, fieldProps, {
|
|
244
|
+
const baseProps = mergeProps$1(domProps(), focusWithinProps, fieldProps, {
|
|
244
245
|
role: "menu",
|
|
245
246
|
get tabIndex() {
|
|
246
247
|
return getProps().isDisabled ? void 0 : state.focusedKey() == null ? 0 : -1;
|
|
@@ -248,7 +249,7 @@ function createMenu(props, state, ref) {
|
|
|
248
249
|
"aria-disabled": p.isDisabled || void 0,
|
|
249
250
|
onKeyDown
|
|
250
251
|
});
|
|
251
|
-
if (!p.disallowTypeAhead) return mergeProps(baseProps, typeSelectProps);
|
|
252
|
+
if (!p.disallowTypeAhead) return mergeProps$1(baseProps, typeSelectProps);
|
|
252
253
|
return baseProps;
|
|
253
254
|
}
|
|
254
255
|
};
|
|
@@ -449,7 +450,7 @@ function createMenuItem(props, state, ref) {
|
|
|
449
450
|
if (p.rel) baseProps.rel = p.rel;
|
|
450
451
|
if (p.download != null && p.download !== false) baseProps.download = p.download === true ? "" : p.download;
|
|
451
452
|
}
|
|
452
|
-
return mergeProps(selectableItemProps(), menuPressProps(), hoverProps, focusProps, keyboardProps, { onClick: performMenuAction }, baseProps);
|
|
453
|
+
return mergeProps$1(selectableItemProps(), menuPressProps(), hoverProps, focusProps, keyboardProps, { onClick: performMenuAction }, baseProps);
|
|
453
454
|
},
|
|
454
455
|
labelProps: { id: labelId },
|
|
455
456
|
get descriptionProps() {
|
package/dist/_chunk/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","names":[],"sources":["../../src/menu/createMenu.ts","../../src/menu/createMenuItem.ts","../../src/menu/createMenuTrigger.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * Based on @react-aria/menu useMenu.\n */\n\nimport { createEffect, onCleanup, type JSX, type Accessor } from \"solid-js\";\nimport { createFocusWithin } from \"../interactions/createFocusWithin\";\nimport { createLabel } from \"../label/createLabel\";\nimport { createTypeSelect } from \"../selection/createTypeSelect\";\nimport { selectItem } from \"../selection/selectItem\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { isDevEnv } from \"../utils/env\";\nimport type { MenuState, Key, Collection } from \"@proyecto-viviana/solid-stately\";\n\n/**\n * Default number of items to skip for page up/down when DOM measurement is not available.\n */\nconst DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Find the next non-disabled key in a collection.\n */\nfunction findNextNonDisabledKey<T>(\n collection: Collection<T>,\n currentKey: Key | null,\n direction: \"next\" | \"prev\",\n isDisabled: (key: Key) => boolean,\n wrap: boolean,\n): Key | null {\n const getNextKey =\n direction === \"next\"\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n\n const getFirstKey =\n direction === \"next\" ? () => collection.getFirstKey() : () => collection.getLastKey();\n\n let nextKey = currentKey != null ? getNextKey(currentKey) : getFirstKey();\n\n // Skip disabled keys\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n\n // If we've reached the end and wrapping is enabled\n if (nextKey == null && wrap) {\n nextKey = getFirstKey();\n // Skip disabled keys from the start\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n }\n\n return nextKey;\n}\n\nexport interface AriaMenuProps<T = unknown> {\n /** An ID for the menu. */\n id?: string;\n /** Whether the menu is disabled. */\n isDisabled?: boolean;\n /** The label for the menu. */\n label?: JSX.Element;\n /** An accessible label for the menu when no visible label is provided. */\n \"aria-label\"?: string;\n /** The ID of an element that labels the menu. */\n \"aria-labelledby\"?: string;\n /** The ID of an element that describes the menu. */\n \"aria-describedby\"?: string;\n /** Handler called when focus moves into the menu. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler called when focus moves out of the menu. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler called when the focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler called when an item is activated (pressed). */\n onAction?: (key: Key, value: T) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Whether focus should automatically wrap around. */\n shouldFocusWrap?: boolean;\n /** Whether to auto-focus the first item when the menu opens. */\n autoFocus?: boolean | \"first\" | \"last\";\n /** Whether type-to-select is disabled. @default false */\n disallowTypeAhead?: boolean;\n}\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the menu's label element (if any). */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// Shared data between menu and menu items\nconst menuData = new WeakMap<object, MenuData>();\n\ninterface MenuData {\n id: string;\n // Type-erased like upstream menu/utils.ts MenuData (value: any): the WeakMap\n // is keyed by an untyped state, so the item value flows through as unknown.\n onAction?: (key: Key, value: unknown) => void;\n onClose?: () => void;\n isDisabled?: boolean;\n shouldCloseOnSelect?: boolean;\n}\n\nexport function getMenuData(state: MenuState): MenuData | undefined {\n return menuData.get(state);\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n */\nexport function createMenu<T>(\n props: MaybeAccessor<AriaMenuProps<T>>,\n state: MenuState<T>,\n ref?: Accessor<HTMLElement | null>,\n): MenuAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Development-time warning for missing accessibility labels\n if (isDevEnv()) {\n const p = getProps();\n if (!p.label && !p[\"aria-label\"] && !p[\"aria-labelledby\"]) {\n console.warn(\n \"[solidaria] A Menu requires an aria-label or aria-labelledby attribute for accessibility.\",\n );\n }\n }\n\n // Filter DOM props\n const domProps = () =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n const updateSharedData = () => {\n const p = getProps();\n menuData.set(state, {\n id,\n onAction: p.onAction as MenuData[\"onAction\"],\n onClose: p.onClose,\n isDisabled: p.isDisabled,\n shouldCloseOnSelect: p.shouldCloseOnSelect,\n });\n };\n\n // Ensure menu items created in the same render pass can read parent metadata.\n updateSharedData();\n\n // Share data with child menu items\n createEffect(() => {\n updateSharedData();\n\n onCleanup(() => {\n menuData.delete(state);\n });\n });\n\n // Handle focus within\n const { focusWithinProps } = createFocusWithin({\n onFocusWithin: (e) => getProps().onFocus?.(e),\n onBlurWithin: (e) => getProps().onBlur?.(e),\n onFocusWithinChange: (isFocused) => {\n getProps().onFocusChange?.(isFocused);\n state.setFocused(isFocused);\n },\n });\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return id;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n labelElementType: \"span\",\n });\n\n // Type-to-select\n const { typeSelectProps } = createTypeSelect({\n collection: () => state.collection(),\n focusedKey: () => state.focusedKey(),\n onFocusedKeyChange: (key) => state.setFocusedKey(key),\n isKeyDisabled: (key) => state.isDisabled(key),\n get isDisabled() {\n return getProps().disallowTypeAhead ?? false;\n },\n });\n\n // Keyboard navigation\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {\n if (getProps().isDisabled) return;\n\n const collection = state.collection();\n const p = getProps();\n const wrap = p.shouldFocusWrap ?? false;\n\n // Disabled keys only block keyboard navigation under disabledBehavior \"all\"\n // (the default); under \"selection\" they stay focusable while their selection\n // remains blocked. Mirrors ListKeyboardDelegate.isDisabled in React Aria,\n // which gates the navigation skip on the resolved disabledBehavior.\n const isDisabled = (key: Key) => state.isDisabled(key) && state.disabledBehavior() === \"all\";\n\n switch (e.key) {\n case \"ArrowDown\": {\n // Only consume the key once a target exists, mirroring\n // useSelectableCollection (ArrowDown, 211-225): preventDefault is called\n // inside `if (nextKey != null)`, so at the last item without wrap the\n // arrow bubbles instead of being swallowed.\n const currentKey = state.focusedKey();\n const nextKey = findNextNonDisabledKey(collection, currentKey, \"next\", isDisabled, wrap);\n if (nextKey != null) {\n e.preventDefault();\n state.setFocusedKey(nextKey);\n }\n break;\n }\n case \"ArrowUp\": {\n const currentKey = state.focusedKey();\n const prevKey = findNextNonDisabledKey(collection, currentKey, \"prev\", isDisabled, wrap);\n if (prevKey != null) {\n e.preventDefault();\n state.setFocusedKey(prevKey);\n }\n break;\n }\n case \"Home\": {\n // Mirror useSelectableCollection (Home, 283-285): with nothing focused,\n // Shift+Home has no anchor to extend from, so leave the event alone.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find first non-disabled key\n let firstKey = collection.getFirstKey();\n while (firstKey != null && isDisabled(firstKey)) {\n firstKey = collection.getKeyAfter(firstKey);\n }\n if (firstKey != null) {\n state.setFocusedKey(firstKey);\n }\n break;\n }\n case \"End\": {\n // Mirror useSelectableCollection (End, 300-302): same anchor guard as Home.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find last non-disabled key\n let lastKey = collection.getLastKey();\n while (lastKey != null && isDisabled(lastKey)) {\n lastKey = collection.getKeyBefore(lastKey);\n }\n if (lastKey != null) {\n state.setFocusedKey(lastKey);\n }\n break;\n }\n case \" \":\n case \"Enter\": {\n if (e.target !== e.currentTarget) break;\n e.preventDefault();\n const focusedKey = state.focusedKey();\n // Activation is gated on the navigation-disabled check, not the raw\n // one: under disabledBehavior \"selection\" a focusable disabled item\n // still fires onAction (and closes), mirroring useSelectableItem's\n // allowsActions (manager.isDisabled is gated on \"all\"). Selection stays\n // blocked independently — state.select self-guards on the raw disabled\n // check (SelectionManager.canSelectItem).\n if (focusedKey != null && !isDisabled(focusedKey)) {\n // Route through the aria-layer onSelect so the platform-aware modifier\n // resolution (isCtrlKeyPressed / non-contiguous modifier) and the\n // shift-extend path are applied. Keyboard activation carries\n // pointerType \"keyboard\".\n selectItem(\n state,\n focusedKey,\n {\n pointerType: \"keyboard\",\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n },\n collection,\n );\n // Pass the activated item's value as the second arg, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n p.onAction?.(focusedKey, collection.getItem(focusedKey)?.value as T);\n const item = collection.getItem(focusedKey);\n const isLink = !!item?.props?.href;\n const shouldClose =\n p.shouldCloseOnSelect ??\n (e.key === \"Enter\" || state.selectionMode() === \"none\" || isLink);\n if (shouldClose) {\n p.onClose?.();\n }\n }\n break;\n }\n case \"Escape\": {\n e.preventDefault();\n p.onClose?.();\n break;\n }\n case \"PageDown\": {\n // Mirror useSelectableCollection (PageDown, 324-332): only consume the\n // key when an item is focused. A non-empty collection always yields a\n // page target via getKeyPageBelow, so a focused key means focus moves\n // and the event is swallowed; with nothing focused, leave it alone to\n // bubble (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const nextKey = collection.getKeyAfter(targetKey);\n if (nextKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(nextKey)) {\n targetKey = nextKey;\n } else {\n // Skip over disabled items without counting them\n const afterDisabled = findNextNonDisabledKey(\n collection,\n nextKey,\n \"next\",\n isDisabled,\n false,\n );\n if (afterDisabled != null) {\n targetKey = afterDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const nextKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"next\",\n isDisabled,\n false,\n );\n if (nextKey == null) break;\n targetKey = nextKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n case \"PageUp\": {\n // Mirror useSelectableCollection (PageUp, 333-341): only consume the key\n // when an item is focused. A non-empty collection always yields a page\n // target via getKeyPageAbove, so a focused key means focus moves and the\n // event is swallowed; with nothing focused, leave it alone to bubble\n // (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const prevKey = collection.getKeyBefore(targetKey);\n if (prevKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(prevKey)) {\n targetKey = prevKey;\n } else {\n // Skip over disabled items without counting them\n const beforeDisabled = findNextNonDisabledKey(\n collection,\n prevKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (beforeDisabled != null) {\n targetKey = beforeDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const prevKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (prevKey == null) break;\n targetKey = prevKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n }\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get menuProps() {\n const p = getProps();\n\n const baseProps = mergeProps(\n domProps(),\n focusWithinProps as Record<string, unknown>,\n fieldProps as Record<string, unknown>,\n {\n role: \"menu\",\n // Roving tabindex: the menu container is tab-reachable (0) only while no\n // item holds focus; once `focusedKey` is set the container drops to -1 so\n // Tab/Shift+Tab traverse past it and real focus stays on the item. This\n // mirrors upstream `useMenu`, which spreads `useSelectableList`'s\n // `listProps.tabIndex` (`manager.focusedKey == null ? 0 : -1`, non-virtual\n // focus) onto the menu.\n //\n // This MUST be a getter, not an eagerly-evaluated value. Consumers\n // (solidaria-components `Menu.tsx`) destructure `menuProps` once and\n // spread it through `mergeProps`; a plain `tabIndex: <value>` would be\n // computed at that first read (while `focusedKey` is still null → 0) and\n // frozen. As a getter it survives `mergeProps` (which preserves getters),\n // so the consumer's reactive element-spread re-reads `state.focusedKey()`\n // and the container tabindex tracks focus.\n get tabIndex() {\n return getProps().isDisabled ? undefined : state.focusedKey() == null ? 0 : -1;\n },\n \"aria-disabled\": p.isDisabled || undefined,\n onKeyDown,\n } as Record<string, unknown>,\n );\n\n // Add type-select props if enabled\n if (!p.disallowTypeAhead) {\n return mergeProps(\n baseProps,\n typeSelectProps as Record<string, unknown>,\n ) as JSX.HTMLAttributes<HTMLElement>;\n }\n\n return baseProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu item.\n * Based on @react-aria/menu useMenuItem.\n */\n\nimport { type JSX, type Accessor } from \"solid-js\";\nimport { createPress, type PressEvent } from \"../interactions/createPress\";\nimport { createHover } from \"../interactions/createHover\";\nimport { createFocusRing } from \"../interactions/createFocusRing\";\nimport { createSelectableItem } from \"../selection/createSelectableItem\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { getEventTarget } from \"../utils/dom\";\nimport { isVirtualClick } from \"../utils/events\";\nimport { createSlotId } from \"../ssr\";\nimport { getMenuData } from \"./createMenu\";\nimport type { MenuState, Key, Selection, SelectionMode } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuItemProps {\n /** The unique key for the menu item. */\n key: Key;\n /** Optional DOM id for the menu item. Defaults to the key. */\n id?: string;\n /** Whether the menu item is disabled. */\n isDisabled?: boolean;\n /** An accessible label for the menu item. */\n \"aria-label\"?: string;\n /** Element controlled by this menu item, for submenu triggers. */\n \"aria-controls\"?: string;\n /** Whether this menu item opens a submenu or subdialog. */\n \"aria-haspopup\"?: string | boolean;\n /** Whether the submenu or subdialog is expanded. */\n \"aria-expanded\"?: boolean | \"true\" | \"false\";\n /** Handler called when the menu item is selected. */\n onAction?: () => void;\n /** Whether to close the menu when this item is selected. */\n closeOnSelect?: boolean;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. A string may be provided to suggest a file name. */\n download?: boolean | string;\n}\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the label text inside the menu item. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the description text inside the menu item. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the keyboard shortcut inside the menu item. */\n keyboardShortcutProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the menu item is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the menu item is keyboard focused. */\n isFocusVisible: Accessor<boolean>;\n /** Whether the menu item is currently pressed. */\n isPressed: Accessor<boolean>;\n /** Whether the menu item is disabled. */\n isDisabled: Accessor<boolean>;\n /** Whether the menu item is selected. */\n isSelected: Accessor<boolean>;\n /** The parent menu selection mode. */\n selectionMode: Accessor<SelectionMode>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu item.\n */\nexport function createMenuItem<T>(\n props: MaybeAccessor<AriaMenuItemProps>,\n state: MenuState<T>,\n ref?: () => HTMLElement | null,\n): MenuItemAria {\n const getProps = () => access(props);\n\n // Get shared data from menu\n const getData = () => getMenuData(state);\n\n // Computed states. `state.isDisabled` is SelectionManager.isDisabled, which\n // already respects disabledBehavior=\"selection\"; these items stay actionable\n // while SelectionManager.canSelectItem keeps selection blocked.\n const isDisabled: Accessor<boolean> = () => {\n return Boolean(\n getData()?.isDisabled || getProps().isDisabled || state.isDisabled(getProps().key),\n );\n };\n\n const selectionMode: Accessor<SelectionMode> = () => {\n return state.selectionMode();\n };\n\n // Whether this is a link item\n const isLink = () => !!getProps().href;\n const isTrigger = () => !!getProps()[\"aria-haspopup\"];\n\n const selectableItem = createSelectableItem(\n () => {\n const p = getProps();\n return {\n key: p.key,\n id: p.id ?? String(p.key),\n isDisabled: isDisabled(),\n isLink: isLink(),\n href: p.href,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true,\n linkBehavior: \"none\",\n };\n },\n state,\n () => ref?.() ?? null,\n );\n\n const isFocused: Accessor<boolean> = () => selectableItem.isFocused();\n\n const isSelected: Accessor<boolean> = () => {\n return !isTrigger() && selectableItem.isSelected();\n };\n\n type MenuInteraction = {\n pointerType: PressEvent[\"pointerType\"];\n key?: string;\n };\n\n let interaction: MenuInteraction | null = null;\n let isMenuPressActive = false;\n let isDispatchingKeyboardClick = false;\n let isDispatchingMenuSyntheticClick = false;\n let selectionEventBeforeMenuPressUp: Selection | null = null;\n let hasSelectionEventBeforeMenuPressUp = false;\n let pendingSyntheticClickSelectionEvent: Selection | null = null;\n let suppressNextKeyboardClick = false;\n\n const getShouldClose = (): boolean => {\n const p = getProps();\n const explicitClose = p.closeOnSelect ?? getData()?.shouldCloseOnSelect;\n if (explicitClose !== undefined) {\n return explicitClose;\n }\n\n if (interaction?.pointerType === \"keyboard\") {\n return interaction.key === \"Enter\" || selectionMode() === \"none\" || isLink();\n }\n\n return selectionMode() !== \"multiple\" || isLink();\n };\n\n const performMenuAction = (event: MouseEvent) => {\n if (isDisabled()) {\n event.preventDefault();\n return;\n }\n\n if (suppressNextKeyboardClick && interaction == null) {\n suppressNextKeyboardClick = false;\n return;\n }\n\n const p = getProps();\n const key = p.key;\n const data = getData();\n\n // Submenu triggers open their submenu via the local item action, but do not\n // fire the parent menu onAction or close the menu.\n if (isTrigger()) {\n p.onAction?.();\n interaction = null;\n return;\n }\n\n // Call item-specific onAction.\n p.onAction?.();\n\n // Call menu-level onAction with the activated item's value, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n const item = state.collection().getItem(key);\n data?.onAction?.(key, item?.value);\n\n if (getShouldClose()) {\n data?.onClose?.();\n }\n\n interaction = null;\n };\n\n // Menu-specific press handling is separate from selectable-item selection,\n // matching upstream useMenuItem: useSelectableItem owns selection/focus\n // timing; the menu layer owns pressed state, different-origin release, action,\n // links, and close behavior.\n const { pressProps, isPressed } = createPress({\n get isDisabled() {\n return isDisabled();\n },\n onPressChange(isPressed) {\n isMenuPressActive = isPressed;\n },\n onPressUp(e) {\n if (e.pointerType !== \"keyboard\" && !isDispatchingKeyboardClick) {\n interaction = { pointerType: e.pointerType };\n }\n\n // Native menus allow pressing the trigger, dragging to an item, and\n // releasing to activate it. Upstream useMenuItem synthesizes a click in\n // this different-origin mouse case.\n if (e.pointerType === \"mouse\" && !isMenuPressActive && e.target instanceof HTMLElement) {\n const selectionEventAfterPressUp = state.selectionManager.lastSelectionEvent;\n pendingSyntheticClickSelectionEvent =\n hasSelectionEventBeforeMenuPressUp &&\n selectionEventAfterPressUp != null &&\n selectionEventAfterPressUp !== selectionEventBeforeMenuPressUp\n ? selectionEventAfterPressUp\n : null;\n\n isDispatchingMenuSyntheticClick = true;\n try {\n e.target.click();\n } finally {\n isDispatchingMenuSyntheticClick = false;\n hasSelectionEventBeforeMenuPressUp = false;\n selectionEventBeforeMenuPressUp = null;\n pendingSyntheticClickSelectionEvent = null;\n }\n }\n },\n });\n\n const captureSelectionEventBeforeMenuPressUp = () => {\n selectionEventBeforeMenuPressUp = state.selectionManager.lastSelectionEvent;\n hasSelectionEventBeforeMenuPressUp = true;\n };\n\n const withMenuPressUpSelectionSnapshot = <EventType extends Event>(handler: unknown) => {\n if (typeof handler !== \"function\") {\n return handler;\n }\n\n return (event: EventType) => {\n captureSelectionEventBeforeMenuPressUp();\n (handler as (event: EventType) => void)(event);\n };\n };\n\n const selectableItemProps = () => {\n const props = selectableItem.itemProps as Record<string, unknown>;\n const onClick = props.onClick;\n\n return {\n ...props,\n onPointerUp: withMenuPressUpSelectionSnapshot<PointerEvent>(props.onPointerUp),\n onMouseUp: withMenuPressUpSelectionSnapshot<MouseEvent>(props.onMouseUp),\n onClick:\n typeof onClick === \"function\"\n ? (event: MouseEvent) => {\n // The menu layer's upstream-compatible target.click() should activate\n // the menu item, not feed back into selectable-item virtual selection.\n if (isDispatchingMenuSyntheticClick && isVirtualClick(event)) {\n if (pendingSyntheticClickSelectionEvent != null) {\n state.selectionManager.emitDuplicateSelectionEvent(\n pendingSyntheticClickSelectionEvent,\n );\n pendingSyntheticClickSelectionEvent = null;\n }\n return;\n }\n\n (onClick as (event: MouseEvent) => void)(event);\n }\n : onClick,\n };\n };\n\n const menuPressProps = () => {\n const {\n onKeyDown: _onKeyDown,\n onKeyUp: _onKeyUp,\n ...props\n } = pressProps as Record<string, unknown>;\n return props;\n };\n\n const keyboardProps = {\n onKeyDown: (event: KeyboardEvent) => {\n if (isDisabled() || event.repeat) {\n return;\n }\n\n if (event.key !== \" \" && event.key !== \"Enter\") {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n interaction = { pointerType: \"keyboard\", key: event.key };\n\n const target = getEventTarget<HTMLElement>(event) ?? ref?.();\n if (target instanceof HTMLElement) {\n suppressNextKeyboardClick = true;\n isDispatchingKeyboardClick = true;\n try {\n target.click();\n } finally {\n isDispatchingKeyboardClick = false;\n }\n }\n },\n onKeyUp: (event: KeyboardEvent) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n suppressNextKeyboardClick = false;\n }\n },\n };\n\n // Handle hover\n const { hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n onHoverStart() {\n state.setFocusedKey(getProps().key);\n },\n });\n\n // Handle focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Generate unique IDs for label and description. The description + keyboard\n // ids use `createSlotId` (a 1:1 port of upstream `useSlotId`): each resolves\n // to `undefined` unless an element carrying that id is actually rendered, so\n // an item with no description/shortcut leaves `aria-describedby` unset instead\n // of pointing at a non-existent element. Mirrors useMenuItem's\n // `[props['aria-describedby'], descriptionId, keyboardId].filter(Boolean)`.\n const labelId = `${getProps().key}-label`;\n const descriptionId = createSlotId();\n const keyboardId = createSlotId();\n\n return {\n get menuItemProps() {\n const p = getProps();\n const key = p.key;\n const ariaLabel = p[\"aria-label\"];\n const mode = selectionMode();\n const selected = isSelected();\n const trigger = isTrigger();\n\n const baseProps: Record<string, unknown> = {\n role: trigger\n ? \"menuitem\"\n : mode === \"single\"\n ? \"menuitemradio\"\n : mode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\",\n id: p.id ?? String(key),\n \"aria-disabled\": isDisabled() || undefined,\n \"aria-checked\": mode !== \"none\" && !trigger ? selected : undefined,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": !ariaLabel ? labelId : undefined,\n \"aria-describedby\": [descriptionId(), keyboardId()].filter(Boolean).join(\" \") || undefined,\n \"aria-controls\": p[\"aria-controls\"],\n \"aria-haspopup\": p[\"aria-haspopup\"],\n \"aria-expanded\": p[\"aria-expanded\"],\n \"data-selected\": selected || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-pressed\": isPressed() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n };\n\n // Add link props when href is present\n if (isLink()) {\n baseProps.href = isDisabled() ? undefined : p.href;\n if (p.target) baseProps.target = p.target;\n if (p.rel) baseProps.rel = p.rel;\n if (p.download != null && p.download !== false) {\n baseProps.download = p.download === true ? \"\" : p.download;\n }\n }\n\n return mergeProps(\n selectableItemProps(),\n menuPressProps(),\n hoverProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n keyboardProps,\n { onClick: performMenuAction },\n baseProps,\n ) as JSX.HTMLAttributes<HTMLElement>;\n },\n labelProps: {\n id: labelId,\n },\n // Getters so the slot id stays reactive: `createSlotId` may clear the id\n // (to `undefined`) after mount if no element registered it, and consumers\n // reading these props re-track that change.\n get descriptionProps() {\n return { id: descriptionId() };\n },\n get keyboardShortcutProps() {\n return { id: keyboardId(), \"aria-hidden\": true };\n },\n isFocused,\n isFocusVisible: () => isFocused() && isFocusVisible(),\n isPressed,\n isDisabled,\n isSelected,\n selectionMode,\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * Based on @react-aria/menu useMenuTrigger.\n */\n\nimport { type JSX } from \"solid-js\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { OverlayTriggerState } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: \"menu\" | \"listbox\";\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** An ID for the menu. */\n id?: string;\n}\n\nexport interface MenuTriggerAria {\n /** Props for the menu trigger button. */\n menuTriggerProps: JSX.HTMLAttributes<HTMLElement> & {\n onPress: () => void;\n onKeyDown: (e: KeyboardEvent) => void;\n };\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n */\nexport function createMenuTrigger(\n props: MaybeAccessor<AriaMenuTriggerProps>,\n state: OverlayTriggerState,\n): MenuTriggerAria {\n const getProps = () => access(props);\n const menuId = createId(getProps().id);\n\n const onPress = () => {\n if (!getProps().isDisabled) {\n state.toggle();\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (getProps().isDisabled) return;\n\n switch (e.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n case \"ArrowUp\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n }\n };\n\n return {\n get menuTriggerProps() {\n const p = getProps();\n const type = p.type ?? \"menu\";\n const isOpen = state.isOpen();\n\n return {\n \"aria-haspopup\": type,\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? menuId : undefined,\n \"aria-disabled\": p.isDisabled || undefined,\n onPress,\n onKeyDown,\n };\n },\n menuProps: {\n id: menuId,\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,oBAAoB;;;;AAK1B,SAAS,uBACP,YACA,YACA,WACA,YACA,MACY;CACZ,MAAM,aACJ,cAAc,UACT,QAAa,WAAW,YAAY,GAAG,KACvC,QAAa,WAAW,aAAa,GAAG;CAE/C,MAAM,cACJ,cAAc,eAAe,WAAW,YAAY,UAAU,WAAW,WAAW;CAEtF,IAAI,UAAU,cAAc,OAAO,WAAW,UAAU,IAAI,YAAY;CAGxE,OAAO,WAAW,QAAQ,WAAW,OAAO,GAC1C,UAAU,WAAW,OAAO;CAI9B,IAAI,WAAW,QAAQ,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AI,mBAAmB;GACrB,OAAO,EAAE,IAAI,cAAc,EAAE;EAC/B;EACA,IAAI,wBAAwB;GAC1B,OAAO;IAAE,IAAI,WAAW;IAAG,eAAe;GAAK;EACjD;EACA;EACA,sBAAsB,UAAU,KAAK,eAAe;EACpD;EACA;EACA;EACA;CACF;AACF;;;;;;AC5XA,SAAgB,kBACd,OACA,OACiB;CACjB,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,SAAS,SAAS,SAAS,CAAC,CAAC,EAAE;CAErC,MAAM,gBAAgB;EACpB,IAAI,CAAC,SAAS,CAAC,CAAC,YACd,MAAM,OAAO;CAEjB;CAEA,MAAM,aAAa,MAAqB;EACtC,IAAI,SAAS,CAAC,CAAC,YAAY;EAE3B,QAAQ,EAAE,KAAV;GACE,KAAK;GACL,KAAK;GACL,KAAK;IACH,EAAE,eAAe;IACjB,IAAI,CAAC,MAAM,OAAO,GAChB,MAAM,KAAK;IAEb;GAEF,KAAK;IACH,EAAE,eAAe;IACjB,IAAI,CAAC,MAAM,OAAO,GAChB,MAAM,KAAK;IAEb;EAEJ;CACF;CAEA,OAAO;EACL,IAAI,mBAAmB;GACrB,MAAM,IAAI,SAAS;GACnB,MAAM,OAAO,EAAE,QAAQ;GACvB,MAAM,SAAS,MAAM,OAAO;GAE5B,OAAO;IACL,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB,SAAS,SAAS,KAAA;IACnC,iBAAiB,EAAE,cAAc,KAAA;IACjC;IACA;GACF;EACF;EACA,WAAW,EACT,IAAI,OACN;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"menu.js","names":["mergeProps","mergeProps"],"sources":["../../src/menu/createMenu.ts","../../src/menu/createMenuItem.ts","../../src/menu/createMenuTrigger.ts"],"sourcesContent":["/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n * Based on @react-aria/menu useMenu.\n */\n\nimport { createEffect, onCleanup, type JSX, type Accessor } from \"solid-js\";\nimport { createFocusWithin } from \"../interactions/createFocusWithin\";\nimport { createLabel } from \"../label/createLabel\";\nimport { createTypeSelect } from \"../selection/createTypeSelect\";\nimport { selectItem } from \"../selection/selectItem\";\nimport { filterDOMProps } from \"../utils/filterDOMProps\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { isDevEnv } from \"../utils/env\";\nimport type { MenuState, Key, Collection } from \"@proyecto-viviana/solid-stately\";\n\n/**\n * Default number of items to skip for page up/down when DOM measurement is not available.\n */\nconst DEFAULT_PAGE_SIZE = 10;\n\n/**\n * Find the next non-disabled key in a collection.\n */\nfunction findNextNonDisabledKey<T>(\n collection: Collection<T>,\n currentKey: Key | null,\n direction: \"next\" | \"prev\",\n isDisabled: (key: Key) => boolean,\n wrap: boolean,\n): Key | null {\n const getNextKey =\n direction === \"next\"\n ? (key: Key) => collection.getKeyAfter(key)\n : (key: Key) => collection.getKeyBefore(key);\n\n const getFirstKey =\n direction === \"next\" ? () => collection.getFirstKey() : () => collection.getLastKey();\n\n let nextKey = currentKey != null ? getNextKey(currentKey) : getFirstKey();\n\n // Skip disabled keys\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n\n // If we've reached the end and wrapping is enabled\n if (nextKey == null && wrap) {\n nextKey = getFirstKey();\n // Skip disabled keys from the start\n while (nextKey != null && isDisabled(nextKey)) {\n nextKey = getNextKey(nextKey);\n }\n }\n\n return nextKey;\n}\n\nexport interface AriaMenuProps<T = unknown> {\n /** An ID for the menu. */\n id?: string;\n /** Whether the menu is disabled. */\n isDisabled?: boolean;\n /** The label for the menu. */\n label?: JSX.Element;\n /** An accessible label for the menu when no visible label is provided. */\n \"aria-label\"?: string;\n /** The ID of an element that labels the menu. */\n \"aria-labelledby\"?: string;\n /** The ID of an element that describes the menu. */\n \"aria-describedby\"?: string;\n /** Handler called when focus moves into the menu. */\n onFocus?: (e: FocusEvent) => void;\n /** Handler called when focus moves out of the menu. */\n onBlur?: (e: FocusEvent) => void;\n /** Handler called when the focus state changes. */\n onFocusChange?: (isFocused: boolean) => void;\n /** Handler called when an item is activated (pressed). */\n onAction?: (key: Key, value: T) => void;\n /** Handler called when the menu should close. */\n onClose?: () => void;\n /** Whether the menu should close when an item is selected. */\n shouldCloseOnSelect?: boolean;\n /** Whether focus should automatically wrap around. */\n shouldFocusWrap?: boolean;\n /** Whether to auto-focus the first item when the menu opens. */\n autoFocus?: boolean | \"first\" | \"last\";\n /** Whether type-to-select is disabled. @default false */\n disallowTypeAhead?: boolean;\n}\n\nexport interface MenuAria {\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the menu's label element (if any). */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n// Shared data between menu and menu items\nconst menuData = new WeakMap<object, MenuData>();\n\ninterface MenuData {\n id: string;\n // Type-erased like upstream menu/utils.ts MenuData (value: any): the WeakMap\n // is keyed by an untyped state, so the item value flows through as unknown.\n onAction?: (key: Key, value: unknown) => void;\n onClose?: () => void;\n isDisabled?: boolean;\n shouldCloseOnSelect?: boolean;\n}\n\nexport function getMenuData(state: MenuState): MenuData | undefined {\n return menuData.get(state);\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu component.\n * A menu displays a list of actions or options that a user can choose.\n */\nexport function createMenu<T>(\n props: MaybeAccessor<AriaMenuProps<T>>,\n state: MenuState<T>,\n ref?: Accessor<HTMLElement | null>,\n): MenuAria {\n const getProps = () => access(props);\n const id = createId(getProps().id);\n\n // Development-time warning for missing accessibility labels\n if (isDevEnv()) {\n const p = getProps();\n if (!p.label && !p[\"aria-label\"] && !p[\"aria-labelledby\"]) {\n console.warn(\n \"[solidaria] A Menu requires an aria-label or aria-labelledby attribute for accessibility.\",\n );\n }\n }\n\n // Filter DOM props\n const domProps = () =>\n filterDOMProps(getProps() as unknown as Record<string, unknown>, { labelable: true });\n\n const updateSharedData = () => {\n const p = getProps();\n menuData.set(state, {\n id,\n onAction: p.onAction as MenuData[\"onAction\"],\n onClose: p.onClose,\n isDisabled: p.isDisabled,\n shouldCloseOnSelect: p.shouldCloseOnSelect,\n });\n };\n\n // Ensure menu items created in the same render pass can read parent metadata.\n updateSharedData();\n\n // Share data with child menu items\n createEffect(() => {\n updateSharedData();\n\n onCleanup(() => {\n menuData.delete(state);\n });\n });\n\n // Handle focus within\n const { focusWithinProps } = createFocusWithin({\n onFocusWithin: (e) => getProps().onFocus?.(e),\n onBlurWithin: (e) => getProps().onBlur?.(e),\n onFocusWithinChange: (isFocused) => {\n getProps().onFocusChange?.(isFocused);\n state.setFocused(isFocused);\n },\n });\n\n // Label handling\n const { labelProps, fieldProps } = createLabel({\n get id() {\n return id;\n },\n get label() {\n return getProps().label;\n },\n get \"aria-label\"() {\n return getProps()[\"aria-label\"];\n },\n get \"aria-labelledby\"() {\n return getProps()[\"aria-labelledby\"];\n },\n labelElementType: \"span\",\n });\n\n // Type-to-select\n const { typeSelectProps } = createTypeSelect({\n collection: () => state.collection(),\n focusedKey: () => state.focusedKey(),\n onFocusedKeyChange: (key) => state.setFocusedKey(key),\n isKeyDisabled: (key) => state.isDisabled(key),\n get isDisabled() {\n return getProps().disallowTypeAhead ?? false;\n },\n });\n\n // Keyboard navigation\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (e) => {\n if (getProps().isDisabled) return;\n\n const collection = state.collection();\n const p = getProps();\n const wrap = p.shouldFocusWrap ?? false;\n\n // Disabled keys only block keyboard navigation under disabledBehavior \"all\"\n // (the default); under \"selection\" they stay focusable while their selection\n // remains blocked. Mirrors ListKeyboardDelegate.isDisabled in React Aria,\n // which gates the navigation skip on the resolved disabledBehavior.\n const isDisabled = (key: Key) => state.isDisabled(key) && state.disabledBehavior() === \"all\";\n\n switch (e.key) {\n case \"ArrowDown\": {\n // Only consume the key once a target exists, mirroring\n // useSelectableCollection (ArrowDown, 211-225): preventDefault is called\n // inside `if (nextKey != null)`, so at the last item without wrap the\n // arrow bubbles instead of being swallowed.\n const currentKey = state.focusedKey();\n const nextKey = findNextNonDisabledKey(collection, currentKey, \"next\", isDisabled, wrap);\n if (nextKey != null) {\n e.preventDefault();\n state.setFocusedKey(nextKey);\n }\n break;\n }\n case \"ArrowUp\": {\n const currentKey = state.focusedKey();\n const prevKey = findNextNonDisabledKey(collection, currentKey, \"prev\", isDisabled, wrap);\n if (prevKey != null) {\n e.preventDefault();\n state.setFocusedKey(prevKey);\n }\n break;\n }\n case \"Home\": {\n // Mirror useSelectableCollection (Home, 283-285): with nothing focused,\n // Shift+Home has no anchor to extend from, so leave the event alone.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find first non-disabled key\n let firstKey = collection.getFirstKey();\n while (firstKey != null && isDisabled(firstKey)) {\n firstKey = collection.getKeyAfter(firstKey);\n }\n if (firstKey != null) {\n state.setFocusedKey(firstKey);\n }\n break;\n }\n case \"End\": {\n // Mirror useSelectableCollection (End, 300-302): same anchor guard as Home.\n if (state.focusedKey() == null && e.shiftKey) break;\n e.preventDefault();\n // Find last non-disabled key\n let lastKey = collection.getLastKey();\n while (lastKey != null && isDisabled(lastKey)) {\n lastKey = collection.getKeyBefore(lastKey);\n }\n if (lastKey != null) {\n state.setFocusedKey(lastKey);\n }\n break;\n }\n case \" \":\n case \"Enter\": {\n if (e.target !== e.currentTarget) break;\n e.preventDefault();\n const focusedKey = state.focusedKey();\n // Activation is gated on the navigation-disabled check, not the raw\n // one: under disabledBehavior \"selection\" a focusable disabled item\n // still fires onAction (and closes), mirroring useSelectableItem's\n // allowsActions (manager.isDisabled is gated on \"all\"). Selection stays\n // blocked independently — state.select self-guards on the raw disabled\n // check (SelectionManager.canSelectItem).\n if (focusedKey != null && !isDisabled(focusedKey)) {\n // Route through the aria-layer onSelect so the platform-aware modifier\n // resolution (isCtrlKeyPressed / non-contiguous modifier) and the\n // shift-extend path are applied. Keyboard activation carries\n // pointerType \"keyboard\".\n selectItem(\n state,\n focusedKey,\n {\n pointerType: \"keyboard\",\n shiftKey: e.shiftKey,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n altKey: e.altKey,\n },\n collection,\n );\n // Pass the activated item's value as the second arg, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n p.onAction?.(focusedKey, collection.getItem(focusedKey)?.value as T);\n const item = collection.getItem(focusedKey);\n const isLink = !!item?.props?.href;\n const shouldClose =\n p.shouldCloseOnSelect ??\n (e.key === \"Enter\" || state.selectionMode() === \"none\" || isLink);\n if (shouldClose) {\n p.onClose?.();\n }\n }\n break;\n }\n case \"Escape\": {\n e.preventDefault();\n p.onClose?.();\n break;\n }\n case \"PageDown\": {\n // Mirror useSelectableCollection (PageDown, 324-332): only consume the\n // key when an item is focused. A non-empty collection always yields a\n // page target via getKeyPageBelow, so a focused key means focus moves\n // and the event is swallowed; with nothing focused, leave it alone to\n // bubble (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const nextKey = collection.getKeyAfter(targetKey);\n if (nextKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(nextKey)) {\n targetKey = nextKey;\n } else {\n // Skip over disabled items without counting them\n const afterDisabled = findNextNonDisabledKey(\n collection,\n nextKey,\n \"next\",\n isDisabled,\n false,\n );\n if (afterDisabled != null) {\n targetKey = afterDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const nextKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"next\",\n isDisabled,\n false,\n );\n if (nextKey == null) break;\n targetKey = nextKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n case \"PageUp\": {\n // Mirror useSelectableCollection (PageUp, 333-341): only consume the key\n // when an item is focused. A non-empty collection always yields a page\n // target via getKeyPageAbove, so a focused key means focus moves and the\n // event is swallowed; with nothing focused, leave it alone to bubble\n // (e.g. to scroll an enclosing region).\n const currentKey = state.focusedKey();\n if (currentKey == null) break;\n e.preventDefault();\n const el = ref?.();\n\n if (el) {\n // Use DOM measurements to calculate how many items fit in a page\n const visibleHeight = el.clientHeight;\n let traveled = 0;\n let targetKey = currentKey;\n\n while (targetKey != null && traveled < visibleHeight) {\n const prevKey = collection.getKeyBefore(targetKey);\n if (prevKey == null) break;\n\n // Try to measure the item height\n const itemElement = el.querySelector(`[data-key=\"${targetKey}\"]`);\n traveled += itemElement?.clientHeight ?? 32;\n\n // Skip disabled items\n if (!isDisabled(prevKey)) {\n targetKey = prevKey;\n } else {\n // Skip over disabled items without counting them\n const beforeDisabled = findNextNonDisabledKey(\n collection,\n prevKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (beforeDisabled != null) {\n targetKey = beforeDisabled;\n } else {\n break;\n }\n }\n }\n\n if (targetKey != null && targetKey !== currentKey) {\n state.setFocusedKey(targetKey);\n }\n } else {\n // Fallback: move by DEFAULT_PAGE_SIZE items\n let count = DEFAULT_PAGE_SIZE;\n let targetKey = currentKey;\n\n while (count > 0 && targetKey != null) {\n const prevKey = findNextNonDisabledKey(\n collection,\n targetKey,\n \"prev\",\n isDisabled,\n false,\n );\n if (prevKey == null) break;\n targetKey = prevKey;\n count--;\n }\n\n if (targetKey != null) {\n state.setFocusedKey(targetKey);\n }\n }\n break;\n }\n }\n };\n\n return {\n get labelProps() {\n return labelProps as JSX.HTMLAttributes<HTMLElement>;\n },\n get menuProps() {\n const p = getProps();\n\n const baseProps = mergeProps(\n domProps(),\n focusWithinProps as Record<string, unknown>,\n fieldProps as Record<string, unknown>,\n {\n role: \"menu\",\n // Roving tabindex: the menu container is tab-reachable (0) only while no\n // item holds focus; once `focusedKey` is set the container drops to -1 so\n // Tab/Shift+Tab traverse past it and real focus stays on the item. This\n // mirrors upstream `useMenu`, which spreads `useSelectableList`'s\n // `listProps.tabIndex` (`manager.focusedKey == null ? 0 : -1`, non-virtual\n // focus) onto the menu.\n //\n // This MUST be a getter, not an eagerly-evaluated value. Consumers\n // (solidaria-components `Menu.tsx`) destructure `menuProps` once and\n // spread it through `mergeProps`; a plain `tabIndex: <value>` would be\n // computed at that first read (while `focusedKey` is still null → 0) and\n // frozen. As a getter it survives `mergeProps` (which preserves getters),\n // so the consumer's reactive element-spread re-reads `state.focusedKey()`\n // and the container tabindex tracks focus.\n get tabIndex() {\n return getProps().isDisabled ? undefined : state.focusedKey() == null ? 0 : -1;\n },\n \"aria-disabled\": p.isDisabled || undefined,\n onKeyDown,\n } as Record<string, unknown>,\n );\n\n // Add type-select props if enabled\n if (!p.disallowTypeAhead) {\n return mergeProps(\n baseProps,\n typeSelectProps as Record<string, unknown>,\n ) as JSX.HTMLAttributes<HTMLElement>;\n }\n\n return baseProps as JSX.HTMLAttributes<HTMLElement>;\n },\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu item.\n * Based on @react-aria/menu useMenuItem.\n */\n\nimport { type JSX, type Accessor } from \"solid-js\";\nimport { createPress, type PressEvent } from \"../interactions/createPress\";\nimport { createHover } from \"../interactions/createHover\";\nimport { createFocusRing } from \"../interactions/createFocusRing\";\nimport { createSelectableItem } from \"../selection/createSelectableItem\";\nimport { mergeProps } from \"../utils/mergeProps\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport { getEventTarget } from \"../utils/dom\";\nimport { isVirtualClick } from \"../utils/events\";\nimport { createSlotId } from \"../ssr\";\nimport { getMenuData } from \"./createMenu\";\nimport type { MenuState, Key, Selection, SelectionMode } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuItemProps {\n /** The unique key for the menu item. */\n key: Key;\n /** Optional DOM id for the menu item. Defaults to the key. */\n id?: string;\n /** Whether the menu item is disabled. */\n isDisabled?: boolean;\n /** An accessible label for the menu item. */\n \"aria-label\"?: string;\n /** Element controlled by this menu item, for submenu triggers. */\n \"aria-controls\"?: string;\n /** Whether this menu item opens a submenu or subdialog. */\n \"aria-haspopup\"?: string | boolean;\n /** Whether the submenu or subdialog is expanded. */\n \"aria-expanded\"?: boolean | \"true\" | \"false\";\n /** Handler called when the menu item is selected. */\n onAction?: () => void;\n /** Whether to close the menu when this item is selected. */\n closeOnSelect?: boolean;\n /** A URL to link to. Turns the menu item into a link. */\n href?: string;\n /** The target window for the link. */\n target?: string;\n /** The relationship between the linked resource and the current page. */\n rel?: string;\n /** Causes the browser to download the linked URL. A string may be provided to suggest a file name. */\n download?: boolean | string;\n}\n\nexport interface MenuItemAria {\n /** Props for the menu item element. */\n menuItemProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the label text inside the menu item. */\n labelProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the description text inside the menu item. */\n descriptionProps: JSX.HTMLAttributes<HTMLElement>;\n /** Props for the keyboard shortcut inside the menu item. */\n keyboardShortcutProps: JSX.HTMLAttributes<HTMLElement>;\n /** Whether the menu item is currently focused. */\n isFocused: Accessor<boolean>;\n /** Whether the menu item is keyboard focused. */\n isFocusVisible: Accessor<boolean>;\n /** Whether the menu item is currently pressed. */\n isPressed: Accessor<boolean>;\n /** Whether the menu item is disabled. */\n isDisabled: Accessor<boolean>;\n /** Whether the menu item is selected. */\n isSelected: Accessor<boolean>;\n /** The parent menu selection mode. */\n selectionMode: Accessor<SelectionMode>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu item.\n */\nexport function createMenuItem<T>(\n props: MaybeAccessor<AriaMenuItemProps>,\n state: MenuState<T>,\n ref?: () => HTMLElement | null,\n): MenuItemAria {\n const getProps = () => access(props);\n\n // Get shared data from menu\n const getData = () => getMenuData(state);\n\n // Computed states. `state.isDisabled` is SelectionManager.isDisabled, which\n // already respects disabledBehavior=\"selection\"; these items stay actionable\n // while SelectionManager.canSelectItem keeps selection blocked.\n const isDisabled: Accessor<boolean> = () => {\n return Boolean(\n getData()?.isDisabled || getProps().isDisabled || state.isDisabled(getProps().key),\n );\n };\n\n const selectionMode: Accessor<SelectionMode> = () => {\n return state.selectionMode();\n };\n\n // Whether this is a link item\n const isLink = () => !!getProps().href;\n const isTrigger = () => !!getProps()[\"aria-haspopup\"];\n\n const selectableItem = createSelectableItem(\n () => {\n const p = getProps();\n return {\n key: p.key,\n id: p.id ?? String(p.key),\n isDisabled: isDisabled(),\n isLink: isLink(),\n href: p.href,\n shouldSelectOnPressUp: true,\n allowsDifferentPressOrigin: true,\n linkBehavior: \"none\",\n };\n },\n state,\n () => ref?.() ?? null,\n );\n\n const isFocused: Accessor<boolean> = () => selectableItem.isFocused();\n\n const isSelected: Accessor<boolean> = () => {\n return !isTrigger() && selectableItem.isSelected();\n };\n\n type MenuInteraction = {\n pointerType: PressEvent[\"pointerType\"];\n key?: string;\n };\n\n let interaction: MenuInteraction | null = null;\n let isMenuPressActive = false;\n let isDispatchingKeyboardClick = false;\n let isDispatchingMenuSyntheticClick = false;\n let selectionEventBeforeMenuPressUp: Selection | null = null;\n let hasSelectionEventBeforeMenuPressUp = false;\n let pendingSyntheticClickSelectionEvent: Selection | null = null;\n let suppressNextKeyboardClick = false;\n\n const getShouldClose = (): boolean => {\n const p = getProps();\n const explicitClose = p.closeOnSelect ?? getData()?.shouldCloseOnSelect;\n if (explicitClose !== undefined) {\n return explicitClose;\n }\n\n if (interaction?.pointerType === \"keyboard\") {\n return interaction.key === \"Enter\" || selectionMode() === \"none\" || isLink();\n }\n\n return selectionMode() !== \"multiple\" || isLink();\n };\n\n const performMenuAction = (event: MouseEvent) => {\n if (isDisabled()) {\n event.preventDefault();\n return;\n }\n\n if (suppressNextKeyboardClick && interaction == null) {\n suppressNextKeyboardClick = false;\n return;\n }\n\n const p = getProps();\n const key = p.key;\n const data = getData();\n\n // Submenu triggers open their submenu via the local item action, but do not\n // fire the parent menu onAction or close the menu.\n if (isTrigger()) {\n p.onAction?.();\n interaction = null;\n return;\n }\n\n // Call item-specific onAction.\n p.onAction?.();\n\n // Call menu-level onAction with the activated item's value, mirroring\n // useMenuItem performAction: onAction(key, item?.value).\n const item = state.collection().getItem(key);\n data?.onAction?.(key, item?.value);\n\n if (getShouldClose()) {\n data?.onClose?.();\n }\n\n interaction = null;\n };\n\n // Menu-specific press handling is separate from selectable-item selection,\n // matching upstream useMenuItem: useSelectableItem owns selection/focus\n // timing; the menu layer owns pressed state, different-origin release, action,\n // links, and close behavior.\n const { pressProps, isPressed } = createPress({\n get isDisabled() {\n return isDisabled();\n },\n onPressChange(isPressed) {\n isMenuPressActive = isPressed;\n },\n onPressUp(e) {\n if (e.pointerType !== \"keyboard\" && !isDispatchingKeyboardClick) {\n interaction = { pointerType: e.pointerType };\n }\n\n // Native menus allow pressing the trigger, dragging to an item, and\n // releasing to activate it. Upstream useMenuItem synthesizes a click in\n // this different-origin mouse case.\n if (e.pointerType === \"mouse\" && !isMenuPressActive && e.target instanceof HTMLElement) {\n const selectionEventAfterPressUp = state.selectionManager.lastSelectionEvent;\n pendingSyntheticClickSelectionEvent =\n hasSelectionEventBeforeMenuPressUp &&\n selectionEventAfterPressUp != null &&\n selectionEventAfterPressUp !== selectionEventBeforeMenuPressUp\n ? selectionEventAfterPressUp\n : null;\n\n isDispatchingMenuSyntheticClick = true;\n try {\n e.target.click();\n } finally {\n isDispatchingMenuSyntheticClick = false;\n hasSelectionEventBeforeMenuPressUp = false;\n selectionEventBeforeMenuPressUp = null;\n pendingSyntheticClickSelectionEvent = null;\n }\n }\n },\n });\n\n const captureSelectionEventBeforeMenuPressUp = () => {\n selectionEventBeforeMenuPressUp = state.selectionManager.lastSelectionEvent;\n hasSelectionEventBeforeMenuPressUp = true;\n };\n\n const withMenuPressUpSelectionSnapshot = <EventType extends Event>(handler: unknown) => {\n if (typeof handler !== \"function\") {\n return handler;\n }\n\n return (event: EventType) => {\n captureSelectionEventBeforeMenuPressUp();\n (handler as (event: EventType) => void)(event);\n };\n };\n\n const selectableItemProps = () => {\n const props = selectableItem.itemProps as Record<string, unknown>;\n const onClick = props.onClick;\n\n return {\n ...props,\n onPointerUp: withMenuPressUpSelectionSnapshot<PointerEvent>(props.onPointerUp),\n onMouseUp: withMenuPressUpSelectionSnapshot<MouseEvent>(props.onMouseUp),\n onClick:\n typeof onClick === \"function\"\n ? (event: MouseEvent) => {\n // The menu layer's upstream-compatible target.click() should activate\n // the menu item, not feed back into selectable-item virtual selection.\n if (isDispatchingMenuSyntheticClick && isVirtualClick(event)) {\n if (pendingSyntheticClickSelectionEvent != null) {\n state.selectionManager.emitDuplicateSelectionEvent(\n pendingSyntheticClickSelectionEvent,\n );\n pendingSyntheticClickSelectionEvent = null;\n }\n return;\n }\n\n (onClick as (event: MouseEvent) => void)(event);\n }\n : onClick,\n };\n };\n\n const menuPressProps = () => {\n const {\n onKeyDown: _onKeyDown,\n onKeyUp: _onKeyUp,\n ...props\n } = pressProps as Record<string, unknown>;\n return props;\n };\n\n const keyboardProps = {\n onKeyDown: (event: KeyboardEvent) => {\n if (isDisabled() || event.repeat) {\n return;\n }\n\n if (event.key !== \" \" && event.key !== \"Enter\") {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n interaction = { pointerType: \"keyboard\", key: event.key };\n\n const target = getEventTarget<HTMLElement>(event) ?? ref?.();\n if (target instanceof HTMLElement) {\n suppressNextKeyboardClick = true;\n isDispatchingKeyboardClick = true;\n try {\n target.click();\n } finally {\n isDispatchingKeyboardClick = false;\n }\n }\n },\n onKeyUp: (event: KeyboardEvent) => {\n if (event.key === \" \" || event.key === \"Enter\") {\n suppressNextKeyboardClick = false;\n }\n },\n };\n\n // Handle hover\n const { hoverProps } = createHover({\n get isDisabled() {\n return isDisabled();\n },\n onHoverStart() {\n state.setFocusedKey(getProps().key);\n },\n });\n\n // Handle focus ring\n const { isFocusVisible, focusProps } = createFocusRing();\n\n // Generate unique IDs for label and description. The description + keyboard\n // ids use `createSlotId` (a 1:1 port of upstream `useSlotId`): each resolves\n // to `undefined` unless an element carrying that id is actually rendered, so\n // an item with no description/shortcut leaves `aria-describedby` unset instead\n // of pointing at a non-existent element. Mirrors useMenuItem's\n // `[props['aria-describedby'], descriptionId, keyboardId].filter(Boolean)`.\n const labelId = `${getProps().key}-label`;\n const descriptionId = createSlotId();\n const keyboardId = createSlotId();\n\n return {\n get menuItemProps() {\n const p = getProps();\n const key = p.key;\n const ariaLabel = p[\"aria-label\"];\n const mode = selectionMode();\n const selected = isSelected();\n const trigger = isTrigger();\n\n const baseProps: Record<string, unknown> = {\n role: trigger\n ? \"menuitem\"\n : mode === \"single\"\n ? \"menuitemradio\"\n : mode === \"multiple\"\n ? \"menuitemcheckbox\"\n : \"menuitem\",\n id: p.id ?? String(key),\n \"aria-disabled\": isDisabled() || undefined,\n \"aria-checked\": mode !== \"none\" && !trigger ? selected : undefined,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": !ariaLabel ? labelId : undefined,\n \"aria-describedby\": [descriptionId(), keyboardId()].filter(Boolean).join(\" \") || undefined,\n \"aria-controls\": p[\"aria-controls\"],\n \"aria-haspopup\": p[\"aria-haspopup\"],\n \"aria-expanded\": p[\"aria-expanded\"],\n \"data-selected\": selected || undefined,\n \"data-focused\": isFocused() || undefined,\n \"data-focus-visible\": isFocusVisible() || undefined,\n \"data-pressed\": isPressed() || undefined,\n \"data-disabled\": isDisabled() || undefined,\n };\n\n // Add link props when href is present\n if (isLink()) {\n baseProps.href = isDisabled() ? undefined : p.href;\n if (p.target) baseProps.target = p.target;\n if (p.rel) baseProps.rel = p.rel;\n if (p.download != null && p.download !== false) {\n baseProps.download = p.download === true ? \"\" : p.download;\n }\n }\n\n return mergeProps(\n selectableItemProps(),\n menuPressProps(),\n hoverProps as Record<string, unknown>,\n focusProps as Record<string, unknown>,\n keyboardProps,\n { onClick: performMenuAction },\n baseProps,\n ) as JSX.HTMLAttributes<HTMLElement>;\n },\n labelProps: {\n id: labelId,\n },\n // Getters so the slot id stays reactive: `createSlotId` may clear the id\n // (to `undefined`) after mount if no element registered it, and consumers\n // reading these props re-track that change.\n get descriptionProps() {\n return { id: descriptionId() };\n },\n get keyboardShortcutProps() {\n return { id: keyboardId(), \"aria-hidden\": true };\n },\n isFocused,\n isFocusVisible: () => isFocused() && isFocusVisible(),\n isPressed,\n isDisabled,\n isSelected,\n selectionMode,\n };\n}\n","/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n * Based on @react-aria/menu useMenuTrigger.\n */\n\nimport { type JSX } from \"solid-js\";\nimport { createId } from \"../ssr\";\nimport { access, type MaybeAccessor } from \"../utils/reactivity\";\nimport type { OverlayTriggerState } from \"@proyecto-viviana/solid-stately\";\n\nexport interface AriaMenuTriggerProps {\n /** The type of menu that the menu trigger opens. */\n type?: \"menu\" | \"listbox\";\n /** Whether the menu trigger is disabled. */\n isDisabled?: boolean;\n /** An ID for the menu. */\n id?: string;\n}\n\nexport interface MenuTriggerAria {\n /** Props for the menu trigger button. */\n menuTriggerProps: JSX.HTMLAttributes<HTMLElement> & {\n onPress: () => void;\n onKeyDown: (e: KeyboardEvent) => void;\n };\n /** Props for the menu element. */\n menuProps: JSX.HTMLAttributes<HTMLElement>;\n}\n\n/**\n * Provides the behavior and accessibility implementation for a menu trigger.\n */\nexport function createMenuTrigger(\n props: MaybeAccessor<AriaMenuTriggerProps>,\n state: OverlayTriggerState,\n): MenuTriggerAria {\n const getProps = () => access(props);\n const menuId = createId(getProps().id);\n\n const onPress = () => {\n if (!getProps().isDisabled) {\n state.toggle();\n }\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n if (getProps().isDisabled) return;\n\n switch (e.key) {\n case \"Enter\":\n case \" \":\n case \"ArrowDown\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n case \"ArrowUp\": {\n e.preventDefault();\n if (!state.isOpen()) {\n state.open();\n }\n break;\n }\n }\n };\n\n return {\n get menuTriggerProps() {\n const p = getProps();\n const type = p.type ?? \"menu\";\n const isOpen = state.isOpen();\n\n return {\n \"aria-haspopup\": type,\n \"aria-expanded\": isOpen,\n \"aria-controls\": isOpen ? menuId : undefined,\n \"aria-disabled\": p.isDisabled || undefined,\n onPress,\n onKeyDown,\n };\n },\n menuProps: {\n id: menuId,\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,oBAAoB;;;;AAK1B,SAAS,uBACP,YACA,YACA,WACA,YACA,MACY;CACZ,MAAM,aACJ,cAAc,UACT,QAAa,WAAW,YAAY,GAAG,KACvC,QAAa,WAAW,aAAa,GAAG;CAE/C,MAAM,cACJ,cAAc,eAAe,WAAW,YAAY,UAAU,WAAW,WAAW;CAEtF,IAAI,UAAU,cAAc,OAAO,WAAW,UAAU,IAAI,YAAY;CAGxE,OAAO,WAAW,QAAQ,WAAW,OAAO,GAC1C,UAAU,WAAW,OAAO;CAI9B,IAAI,WAAW,QAAQ,MAAM;EAC3B,UAAU,YAAY;EAEtB,OAAO,WAAW,QAAQ,WAAW,OAAO,GAC1C,UAAU,WAAW,OAAO;CAEhC;CAEA,OAAO;AACT;AA2CA,MAAM,2BAAW,IAAI,QAA0B;AAY/C,SAAgB,YAAY,OAAwC;CAClE,OAAO,SAAS,IAAI,KAAK;AAC3B;;;;;AAMA,SAAgB,WACd,OACA,OACA,KACU;CACV,MAAM,iBAAiB,OAAO,KAAK;CACnC,MAAM,KAAK,SAAS,SAAS,CAAC,CAAC,EAAE;CAGjC,IAAI,SAAS,GAAG;EACd,MAAM,IAAI,SAAS;EACnB,IAAI,CAAC,EAAE,SAAS,CAAC,EAAE,iBAAiB,CAAC,EAAE,oBACrC,QAAQ,KACN,2FACF;CAEJ;CAGA,MAAM,iBACJ,eAAe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