@proyecto-viviana/solidaria 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunk/actiongroup.js +207 -0
- package/dist/_chunk/actiongroup.js.map +1 -0
- package/dist/_chunk/actiongroup.jsx +207 -0
- package/dist/_chunk/actiongroup.jsx.map +1 -0
- package/dist/_chunk/ariaHideOutside.js +122 -0
- package/dist/_chunk/ariaHideOutside.js.map +1 -0
- package/dist/_chunk/ariaHideOutside.jsx +122 -0
- package/dist/_chunk/ariaHideOutside.jsx.map +1 -0
- package/dist/_chunk/autocomplete.js +196 -0
- package/dist/_chunk/autocomplete.js.map +1 -0
- package/dist/_chunk/autocomplete.jsx +196 -0
- package/dist/_chunk/autocomplete.jsx.map +1 -0
- package/dist/_chunk/breadcrumbs.js +119 -0
- package/dist/_chunk/breadcrumbs.js.map +1 -0
- package/dist/_chunk/breadcrumbs.jsx +119 -0
- package/dist/_chunk/breadcrumbs.jsx.map +1 -0
- package/dist/_chunk/button.js +276 -0
- package/dist/_chunk/button.js.map +1 -0
- package/dist/_chunk/button.jsx +276 -0
- package/dist/_chunk/button.jsx.map +1 -0
- package/dist/_chunk/calendar.js +1036 -0
- package/dist/_chunk/calendar.js.map +1 -0
- package/dist/_chunk/calendar.jsx +1036 -0
- package/dist/_chunk/calendar.jsx.map +1 -0
- package/dist/_chunk/checkbox.js +234 -0
- package/dist/_chunk/checkbox.js.map +1 -0
- package/dist/_chunk/checkbox.jsx +234 -0
- package/dist/_chunk/checkbox.jsx.map +1 -0
- package/dist/_chunk/color.js +1174 -0
- package/dist/_chunk/color.js.map +1 -0
- package/dist/_chunk/color.jsx +1174 -0
- package/dist/_chunk/color.jsx.map +1 -0
- package/dist/_chunk/combobox.js +436 -0
- package/dist/_chunk/combobox.js.map +1 -0
- package/dist/_chunk/combobox.jsx +436 -0
- package/dist/_chunk/combobox.jsx.map +1 -0
- package/dist/_chunk/createCollator.js +229 -0
- package/dist/_chunk/createCollator.js.map +1 -0
- package/dist/_chunk/createCollator.jsx +223 -0
- package/dist/_chunk/createCollator.jsx.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.js +133 -0
- package/dist/_chunk/createCollectionRowInteraction.js.map +1 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx +133 -0
- package/dist/_chunk/createCollectionRowInteraction.jsx.map +1 -0
- package/dist/_chunk/createField.js +54 -0
- package/dist/_chunk/createField.js.map +1 -0
- package/dist/_chunk/createField.jsx +54 -0
- package/dist/_chunk/createField.jsx.map +1 -0
- package/dist/_chunk/createFocus.js +101 -0
- package/dist/_chunk/createFocus.js.map +1 -0
- package/dist/_chunk/createFocus.jsx +101 -0
- package/dist/_chunk/createFocus.jsx.map +1 -0
- package/dist/_chunk/createFocusRing.js +54 -0
- package/dist/_chunk/createFocusRing.js.map +1 -0
- package/dist/_chunk/createFocusRing.jsx +54 -0
- package/dist/_chunk/createFocusRing.jsx.map +1 -0
- package/dist/_chunk/createFocusWithin.js +121 -0
- package/dist/_chunk/createFocusWithin.js.map +1 -0
- package/dist/_chunk/createFocusWithin.jsx +121 -0
- package/dist/_chunk/createFocusWithin.jsx.map +1 -0
- package/dist/_chunk/createFocusable.js +131 -0
- package/dist/_chunk/createFocusable.js.map +1 -0
- package/dist/_chunk/createFocusable.jsx +131 -0
- package/dist/_chunk/createFocusable.jsx.map +1 -0
- package/dist/_chunk/createFormValidation.js +135 -0
- package/dist/_chunk/createFormValidation.js.map +1 -0
- package/dist/_chunk/createFormValidation.jsx +135 -0
- package/dist/_chunk/createFormValidation.jsx.map +1 -0
- package/dist/_chunk/createHover.js +130 -0
- package/dist/_chunk/createHover.js.map +1 -0
- package/dist/_chunk/createHover.jsx +130 -0
- package/dist/_chunk/createHover.jsx.map +1 -0
- package/dist/_chunk/createInteractionModality.js +269 -0
- package/dist/_chunk/createInteractionModality.js.map +1 -0
- package/dist/_chunk/createInteractionModality.jsx +269 -0
- package/dist/_chunk/createInteractionModality.jsx.map +1 -0
- package/dist/_chunk/createLabel.js +46 -0
- package/dist/_chunk/createLabel.js.map +1 -0
- package/dist/_chunk/createLabel.jsx +46 -0
- package/dist/_chunk/createLabel.jsx.map +1 -0
- package/dist/_chunk/createLabels.js +31 -0
- package/dist/_chunk/createLabels.js.map +1 -0
- package/dist/_chunk/createLabels.jsx +31 -0
- package/dist/_chunk/createLabels.jsx.map +1 -0
- package/dist/_chunk/createLandmark.js +198 -0
- package/dist/_chunk/createLandmark.js.map +1 -0
- package/dist/_chunk/createLandmark.jsx +198 -0
- package/dist/_chunk/createLandmark.jsx.map +1 -0
- package/dist/_chunk/createLongPress.js +91 -0
- package/dist/_chunk/createLongPress.js.map +1 -0
- package/dist/_chunk/createLongPress.jsx +91 -0
- package/dist/_chunk/createLongPress.jsx.map +1 -0
- package/dist/_chunk/createOverlay.js +327 -0
- package/dist/_chunk/createOverlay.js.map +1 -0
- package/dist/_chunk/createOverlay.jsx +327 -0
- package/dist/_chunk/createOverlay.jsx.map +1 -0
- package/dist/_chunk/createPress.js +526 -0
- package/dist/_chunk/createPress.js.map +1 -0
- package/dist/_chunk/createPress.jsx +526 -0
- package/dist/_chunk/createPress.jsx.map +1 -0
- package/dist/_chunk/createProgressBar.js +81 -0
- package/dist/_chunk/createProgressBar.js.map +1 -0
- package/dist/_chunk/createProgressBar.jsx +81 -0
- package/dist/_chunk/createProgressBar.jsx.map +1 -0
- package/dist/_chunk/createSelectableItem.js +298 -0
- package/dist/_chunk/createSelectableItem.js.map +1 -0
- package/dist/_chunk/createSelectableItem.jsx +298 -0
- package/dist/_chunk/createSelectableItem.jsx.map +1 -0
- package/dist/_chunk/createToggle.js +158 -0
- package/dist/_chunk/createToggle.js.map +1 -0
- package/dist/_chunk/createToggle.jsx +158 -0
- package/dist/_chunk/createToggle.jsx.map +1 -0
- package/dist/_chunk/createTypeSelect.js +125 -0
- package/dist/_chunk/createTypeSelect.js.map +1 -0
- package/dist/_chunk/createTypeSelect.jsx +125 -0
- package/dist/_chunk/createTypeSelect.jsx.map +1 -0
- package/dist/_chunk/datepicker.js +1393 -0
- package/dist/_chunk/datepicker.js.map +1 -0
- package/dist/_chunk/datepicker.jsx +1393 -0
- package/dist/_chunk/datepicker.jsx.map +1 -0
- package/dist/_chunk/dialog.js +62 -0
- package/dist/_chunk/dialog.js.map +1 -0
- package/dist/_chunk/dialog.jsx +62 -0
- package/dist/_chunk/dialog.jsx.map +1 -0
- package/dist/_chunk/disclosure.js +185 -0
- package/dist/_chunk/disclosure.js.map +1 -0
- package/dist/_chunk/disclosure.jsx +185 -0
- package/dist/_chunk/disclosure.jsx.map +1 -0
- package/dist/_chunk/dnd.js +1304 -0
- package/dist/_chunk/dnd.js.map +1 -0
- package/dist/_chunk/dnd.jsx +1304 -0
- package/dist/_chunk/dnd.jsx.map +1 -0
- package/dist/_chunk/env.js +105 -0
- package/dist/_chunk/env.js.map +1 -0
- package/dist/_chunk/env.jsx +105 -0
- package/dist/_chunk/env.jsx.map +1 -0
- package/dist/_chunk/filterDOMProps.js +82 -0
- package/dist/_chunk/filterDOMProps.js.map +1 -0
- package/dist/_chunk/filterDOMProps.jsx +82 -0
- package/dist/_chunk/filterDOMProps.jsx.map +1 -0
- package/dist/_chunk/focus.js +399 -0
- package/dist/_chunk/focus.js.map +1 -0
- package/dist/_chunk/focus.jsx +399 -0
- package/dist/_chunk/focus.jsx.map +1 -0
- package/dist/_chunk/focus2.js +895 -0
- package/dist/_chunk/focus2.js.map +1 -0
- package/dist/_chunk/focus2.jsx +870 -0
- package/dist/_chunk/focus2.jsx.map +1 -0
- package/dist/_chunk/form.js +39 -0
- package/dist/_chunk/form.js.map +1 -0
- package/dist/_chunk/form.jsx +39 -0
- package/dist/_chunk/form.jsx.map +1 -0
- package/dist/_chunk/grid.js +623 -0
- package/dist/_chunk/grid.js.map +1 -0
- package/dist/_chunk/grid.jsx +623 -0
- package/dist/_chunk/grid.jsx.map +1 -0
- package/dist/_chunk/gridlist.js +364 -0
- package/dist/_chunk/gridlist.js.map +1 -0
- package/dist/_chunk/gridlist.jsx +364 -0
- package/dist/_chunk/gridlist.jsx.map +1 -0
- package/dist/_chunk/i18n.js +254 -0
- package/dist/_chunk/i18n.js.map +1 -0
- package/dist/_chunk/i18n.jsx +254 -0
- package/dist/_chunk/i18n.jsx.map +1 -0
- package/dist/_chunk/interactions.js +241 -0
- package/dist/_chunk/interactions.js.map +1 -0
- package/dist/_chunk/interactions.jsx +237 -0
- package/dist/_chunk/interactions.jsx.map +1 -0
- package/dist/_chunk/link.js +96 -0
- package/dist/_chunk/link.js.map +1 -0
- package/dist/_chunk/link.jsx +96 -0
- package/dist/_chunk/link.jsx.map +1 -0
- package/dist/_chunk/listbox.js +324 -0
- package/dist/_chunk/listbox.js.map +1 -0
- package/dist/_chunk/listbox.jsx +324 -0
- package/dist/_chunk/listbox.jsx.map +1 -0
- package/dist/_chunk/live-announcer.js +207 -0
- package/dist/_chunk/live-announcer.js.map +1 -0
- package/dist/_chunk/live-announcer.jsx +207 -0
- package/dist/_chunk/live-announcer.jsx.map +1 -0
- package/dist/_chunk/menu.js +518 -0
- package/dist/_chunk/menu.js.map +1 -0
- package/dist/_chunk/menu.jsx +518 -0
- package/dist/_chunk/menu.jsx.map +1 -0
- package/dist/_chunk/meter.js +33 -0
- package/dist/_chunk/meter.js.map +1 -0
- package/dist/_chunk/meter.jsx +33 -0
- package/dist/_chunk/meter.jsx.map +1 -0
- package/dist/_chunk/numberfield.js +258 -0
- package/dist/_chunk/numberfield.js.map +1 -0
- package/dist/_chunk/numberfield.jsx +258 -0
- package/dist/_chunk/numberfield.jsx.map +1 -0
- package/dist/_chunk/overlays.js +186 -0
- package/dist/_chunk/overlays.js.map +1 -0
- package/dist/_chunk/overlays.jsx +162 -0
- package/dist/_chunk/overlays.jsx.map +1 -0
- package/dist/_chunk/popover.js +574 -0
- package/dist/_chunk/popover.js.map +1 -0
- package/dist/_chunk/popover.jsx +574 -0
- package/dist/_chunk/popover.jsx.map +1 -0
- package/dist/_chunk/radio.js +319 -0
- package/dist/_chunk/radio.js.map +1 -0
- package/dist/_chunk/radio.jsx +319 -0
- package/dist/_chunk/radio.jsx.map +1 -0
- package/dist/_chunk/searchfield.js +209 -0
- package/dist/_chunk/searchfield.js.map +1 -0
- package/dist/_chunk/searchfield.jsx +209 -0
- package/dist/_chunk/searchfield.jsx.map +1 -0
- package/dist/_chunk/select.js +403 -0
- package/dist/_chunk/select.js.map +1 -0
- package/dist/_chunk/select.jsx +394 -0
- package/dist/_chunk/select.jsx.map +1 -0
- package/dist/_chunk/selection.js +679 -0
- package/dist/_chunk/selection.js.map +1 -0
- package/dist/_chunk/selection.jsx +679 -0
- package/dist/_chunk/selection.jsx.map +1 -0
- package/dist/_chunk/separator.js +29 -0
- package/dist/_chunk/separator.js.map +1 -0
- package/dist/_chunk/separator.jsx +29 -0
- package/dist/_chunk/separator.jsx.map +1 -0
- package/dist/_chunk/slider.js +255 -0
- package/dist/_chunk/slider.js.map +1 -0
- package/dist/_chunk/slider.jsx +255 -0
- package/dist/_chunk/slider.jsx.map +1 -0
- package/dist/_chunk/steplist.js +66 -0
- package/dist/_chunk/steplist.js.map +1 -0
- package/dist/_chunk/steplist.jsx +66 -0
- package/dist/_chunk/steplist.jsx.map +1 -0
- package/dist/_chunk/switch.js +34 -0
- package/dist/_chunk/switch.js.map +1 -0
- package/dist/_chunk/switch.jsx +34 -0
- package/dist/_chunk/switch.jsx.map +1 -0
- package/dist/_chunk/table.js +1051 -0
- package/dist/_chunk/table.js.map +1 -0
- package/dist/_chunk/table.jsx +1051 -0
- package/dist/_chunk/table.jsx.map +1 -0
- package/dist/_chunk/tabs.js +260 -0
- package/dist/_chunk/tabs.js.map +1 -0
- package/dist/_chunk/tabs.jsx +260 -0
- package/dist/_chunk/tabs.jsx.map +1 -0
- package/dist/_chunk/tag.js +286 -0
- package/dist/_chunk/tag.js.map +1 -0
- package/dist/_chunk/tag.jsx +286 -0
- package/dist/_chunk/tag.jsx.map +1 -0
- package/dist/_chunk/textfield.js +109 -0
- package/dist/_chunk/textfield.js.map +1 -0
- package/dist/_chunk/textfield.jsx +109 -0
- package/dist/_chunk/textfield.jsx.map +1 -0
- package/dist/_chunk/toast.js +250 -0
- package/dist/_chunk/toast.js.map +1 -0
- package/dist/_chunk/toast.jsx +250 -0
- package/dist/_chunk/toast.jsx.map +1 -0
- package/dist/_chunk/toolbar.js +258 -0
- package/dist/_chunk/toolbar.js.map +1 -0
- package/dist/_chunk/toolbar.jsx +258 -0
- package/dist/_chunk/toolbar.jsx.map +1 -0
- package/dist/_chunk/tooltip.js +185 -0
- package/dist/_chunk/tooltip.js.map +1 -0
- package/dist/_chunk/tooltip.jsx +185 -0
- package/dist/_chunk/tooltip.jsx.map +1 -0
- package/dist/_chunk/tree.js +424 -0
- package/dist/_chunk/tree.js.map +1 -0
- package/dist/_chunk/tree.jsx +424 -0
- package/dist/_chunk/tree.jsx.map +1 -0
- package/dist/_chunk/utils.js +665 -0
- package/dist/_chunk/utils.js.map +1 -0
- package/dist/_chunk/utils.jsx +665 -0
- package/dist/_chunk/utils.jsx.map +1 -0
- package/dist/_chunk/visually-hidden.js +92 -0
- package/dist/_chunk/visually-hidden.js.map +1 -0
- package/dist/_chunk/visually-hidden.jsx +92 -0
- package/dist/_chunk/visually-hidden.jsx.map +1 -0
- package/dist/actiongroup/index.js +2 -0
- package/dist/actiongroup/index.jsx +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts +2 -0
- package/dist/autocomplete/createAutocomplete.d.ts.map +1 -1
- package/dist/autocomplete/index.js +2 -0
- package/dist/autocomplete/index.jsx +2 -0
- package/dist/breadcrumbs/index.js +2 -0
- package/dist/breadcrumbs/index.jsx +2 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.jsx +2 -0
- package/dist/calendar/createCalendar.d.ts.map +1 -1
- package/dist/calendar/createCalendarCell.d.ts.map +1 -1
- package/dist/calendar/createCalendarGrid.d.ts.map +1 -1
- package/dist/calendar/createCalendarMonthPicker.d.ts +41 -0
- package/dist/calendar/createCalendarMonthPicker.d.ts.map +1 -0
- package/dist/calendar/createCalendarYearPicker.d.ts +49 -0
- package/dist/calendar/createCalendarYearPicker.d.ts.map +1 -0
- package/dist/calendar/createRangeCalendar.d.ts.map +1 -1
- package/dist/calendar/index.d.ts +2 -0
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.js +2 -0
- package/dist/calendar/index.jsx +2 -0
- package/dist/calendar/utils.d.ts +4 -0
- package/dist/calendar/utils.d.ts.map +1 -1
- package/dist/checkbox/createCheckbox.d.ts +4 -0
- package/dist/checkbox/createCheckbox.d.ts.map +1 -1
- package/dist/checkbox/createCheckboxGroupItem.d.ts.map +1 -1
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox/index.jsx +2 -0
- package/dist/collections/index.js +160 -0
- package/dist/collections/index.js.map +1 -0
- package/dist/collections/index.jsx +160 -0
- package/dist/collections/index.jsx.map +1 -0
- package/dist/color/index.js +2 -0
- package/dist/color/index.jsx +2 -0
- package/dist/combobox/index.js +2 -0
- package/dist/combobox/index.jsx +2 -0
- package/dist/datepicker/createDateSegment.d.ts.map +1 -1
- package/dist/datepicker/index.js +2 -0
- package/dist/datepicker/index.jsx +2 -0
- package/dist/dialog/index.js +2 -0
- package/dist/dialog/index.jsx +2 -0
- package/dist/disclosure/index.js +2 -0
- package/dist/disclosure/index.jsx +2 -0
- package/dist/dnd/createDroppableCollection.d.ts.map +1 -1
- package/dist/dnd/index.js +2 -0
- package/dist/dnd/index.jsx +2 -0
- package/dist/dnd/utils.d.ts +2 -2
- package/dist/dnd/utils.d.ts.map +1 -1
- package/dist/focus/FocusScope.d.ts.map +1 -1
- package/dist/focus/index.js +2 -0
- package/dist/focus/index.jsx +2 -0
- package/dist/form/createFormValidation.d.ts.map +1 -1
- package/dist/form/index.js +3 -0
- package/dist/form/index.jsx +3 -0
- package/dist/grid/index.js +2 -0
- package/dist/grid/index.jsx +2 -0
- package/dist/gridlist/createGridList.d.ts +7 -1
- package/dist/gridlist/createGridList.d.ts.map +1 -1
- package/dist/gridlist/createGridListItem.d.ts +1 -1
- package/dist/gridlist/createGridListItem.d.ts.map +1 -1
- package/dist/gridlist/createGridListSection.d.ts +15 -0
- package/dist/gridlist/createGridListSection.d.ts.map +1 -0
- package/dist/gridlist/index.d.ts +2 -1
- package/dist/gridlist/index.d.ts.map +1 -1
- package/dist/gridlist/index.js +2 -0
- package/dist/gridlist/index.jsx +2 -0
- package/dist/gridlist/types.d.ts +50 -0
- package/dist/gridlist/types.d.ts.map +1 -1
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/index.jsx +3 -0
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +71 -18311
- package/dist/index.jsx +71 -18242
- package/dist/interactions/PressEvent.d.ts +11 -0
- package/dist/interactions/PressEvent.d.ts.map +1 -1
- package/dist/interactions/createInteractionModality.d.ts +0 -1
- package/dist/interactions/createInteractionModality.d.ts.map +1 -1
- package/dist/interactions/createKeyboard.d.ts.map +1 -1
- package/dist/interactions/createPress.d.ts.map +1 -1
- package/dist/interactions/index.js +10 -0
- package/dist/interactions/index.jsx +10 -0
- package/dist/label/index.js +4 -0
- package/dist/label/index.jsx +4 -0
- package/dist/landmark/index.js +2 -0
- package/dist/landmark/index.jsx +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.jsx +2 -0
- package/dist/listbox/createListBox.d.ts +37 -0
- package/dist/listbox/createListBox.d.ts.map +1 -1
- package/dist/listbox/createOption.d.ts +6 -0
- package/dist/listbox/createOption.d.ts.map +1 -1
- package/dist/listbox/index.js +2 -0
- package/dist/listbox/index.jsx +2 -0
- package/dist/live-announcer/index.js +2 -0
- package/dist/live-announcer/index.jsx +2 -0
- package/dist/menu/createMenu.d.ts +7 -4
- package/dist/menu/createMenu.d.ts.map +1 -1
- package/dist/menu/createMenuItem.d.ts +9 -1
- package/dist/menu/createMenuItem.d.ts.map +1 -1
- package/dist/menu/index.js +2 -0
- package/dist/menu/index.jsx +2 -0
- package/dist/meter/index.js +2 -0
- package/dist/meter/index.jsx +2 -0
- package/dist/numberfield/createNumberField.d.ts.map +1 -1
- package/dist/numberfield/index.js +2 -0
- package/dist/numberfield/index.jsx +2 -0
- package/dist/overlays/index.js +4 -0
- package/dist/overlays/index.jsx +4 -0
- package/dist/popover/calculatePosition.d.ts +2 -0
- package/dist/popover/calculatePosition.d.ts.map +1 -1
- package/dist/popover/createOverlayPosition.d.ts +8 -0
- package/dist/popover/createOverlayPosition.d.ts.map +1 -1
- package/dist/popover/index.js +2 -0
- package/dist/popover/index.jsx +2 -0
- package/dist/progress/index.js +2 -0
- package/dist/progress/index.jsx +2 -0
- package/dist/radio/createRadio.d.ts +2 -0
- package/dist/radio/createRadio.d.ts.map +1 -1
- package/dist/radio/index.js +2 -0
- package/dist/radio/index.jsx +2 -0
- package/dist/searchfield/index.js +2 -0
- package/dist/searchfield/index.jsx +2 -0
- package/dist/select/createSelect.d.ts.map +1 -1
- package/dist/select/index.js +2 -0
- package/dist/select/index.jsx +2 -0
- package/dist/selection/DOMLayoutDelegate.d.ts +58 -0
- package/dist/selection/DOMLayoutDelegate.d.ts.map +1 -0
- package/dist/selection/ListKeyboardDelegate.d.ts +95 -0
- package/dist/selection/ListKeyboardDelegate.d.ts.map +1 -0
- package/dist/selection/constants.d.ts +15 -0
- package/dist/selection/constants.d.ts.map +1 -0
- package/dist/selection/createCollectionRowInteraction.d.ts +13 -0
- package/dist/selection/createCollectionRowInteraction.d.ts.map +1 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts +31 -0
- package/dist/selection/createScrollIntoViewOnFocus.d.ts.map +1 -0
- package/dist/selection/createSelectableCollection.d.ts +69 -0
- package/dist/selection/createSelectableCollection.d.ts.map +1 -0
- package/dist/selection/createSelectableItem.d.ts +154 -0
- package/dist/selection/createSelectableItem.d.ts.map +1 -0
- package/dist/selection/createSelectableList.d.ts +43 -0
- package/dist/selection/createSelectableList.d.ts.map +1 -0
- package/dist/selection/createTypeSelect.d.ts.map +1 -1
- package/dist/selection/index.d.ts +9 -0
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.js +4 -0
- package/dist/selection/index.jsx +4 -0
- package/dist/selection/selectItem.d.ts +29 -0
- package/dist/selection/selectItem.d.ts.map +1 -0
- package/dist/selection/utils.d.ts +40 -0
- package/dist/selection/utils.d.ts.map +1 -0
- package/dist/separator/index.js +2 -0
- package/dist/separator/index.jsx +2 -0
- package/dist/slider/createSlider.d.ts.map +1 -1
- package/dist/slider/index.js +2 -0
- package/dist/slider/index.jsx +2 -0
- package/dist/ssr/index.d.ts +17 -0
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +299 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/ssr/index.jsx +292 -0
- package/dist/ssr/index.jsx.map +1 -0
- package/dist/steplist/index.js +2 -0
- package/dist/steplist/index.jsx +2 -0
- package/dist/switch/createSwitch.d.ts +4 -0
- package/dist/switch/createSwitch.d.ts.map +1 -1
- package/dist/switch/index.js +2 -0
- package/dist/switch/index.jsx +2 -0
- package/dist/table/createTable.d.ts.map +1 -1
- package/dist/table/createTableRow.d.ts +1 -1
- package/dist/table/createTableRow.d.ts.map +1 -1
- package/dist/table/createTableSelectAllCheckbox.d.ts.map +1 -1
- package/dist/table/index.js +2 -0
- package/dist/table/index.jsx +2 -0
- package/dist/table/types.d.ts +27 -1
- package/dist/table/types.d.ts.map +1 -1
- package/dist/tabs/createTabs.d.ts +4 -3
- package/dist/tabs/createTabs.d.ts.map +1 -1
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/index.jsx +2 -0
- package/dist/tag/createTag.d.ts +2 -0
- package/dist/tag/createTag.d.ts.map +1 -1
- package/dist/tag/index.js +2 -0
- package/dist/tag/index.jsx +2 -0
- package/dist/textfield/index.js +2 -0
- package/dist/textfield/index.jsx +2 -0
- package/dist/toast/createToast.d.ts.map +1 -1
- package/dist/toast/index.js +2 -0
- package/dist/toast/index.jsx +2 -0
- package/dist/toggle/createToggle.d.ts +4 -0
- package/dist/toggle/createToggle.d.ts.map +1 -1
- package/dist/toggle/index.js +3 -0
- package/dist/toggle/index.jsx +3 -0
- package/dist/toolbar/createToolbar.d.ts +1 -1
- package/dist/toolbar/createToolbar.d.ts.map +1 -1
- package/dist/toolbar/index.js +2 -0
- package/dist/toolbar/index.jsx +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/index.jsx +2 -0
- package/dist/tree/createTree.d.ts +5 -1
- package/dist/tree/createTree.d.ts.map +1 -1
- package/dist/tree/createTreeItem.d.ts +1 -1
- package/dist/tree/createTreeItem.d.ts.map +1 -1
- package/dist/tree/index.js +2 -0
- package/dist/tree/index.jsx +2 -0
- package/dist/tree/types.d.ts +10 -0
- package/dist/tree/types.d.ts.map +1 -1
- package/dist/utils/animation.d.ts +60 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +48 -2
- package/dist/utils/dom.d.ts.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.jsx +5 -0
- package/dist/utils/keyboard.d.ts +17 -0
- package/dist/utils/keyboard.d.ts.map +1 -0
- package/dist/utils/mergeProps.d.ts.map +1 -1
- package/dist/utils/scrollIntoView.d.ts +30 -0
- package/dist/utils/scrollIntoView.d.ts.map +1 -0
- package/dist/visually-hidden/index.js +2 -0
- package/dist/visually-hidden/index.jsx +2 -0
- package/package.json +304 -3
- package/src/autocomplete/createAutocomplete.ts +67 -21
- package/src/calendar/createCalendar.ts +2 -0
- package/src/calendar/createCalendarCell.ts +19 -2
- package/src/calendar/createCalendarGrid.ts +43 -9
- package/src/calendar/createCalendarMonthPicker.ts +105 -0
- package/src/calendar/createCalendarYearPicker.ts +144 -0
- package/src/calendar/createRangeCalendar.ts +2 -0
- package/src/calendar/index.ts +17 -0
- package/src/calendar/utils.ts +4 -0
- package/src/checkbox/createCheckbox.ts +10 -0
- package/src/checkbox/createCheckboxGroupItem.ts +12 -16
- package/src/datepicker/createDateSegment.ts +6 -1
- package/src/dnd/createDroppableCollection.ts +4 -1
- package/src/dnd/utils.ts +27 -3
- package/src/focus/FocusScope.tsx +152 -18
- package/src/form/createFormValidation.ts +8 -1
- package/src/gridlist/createGridList.ts +145 -42
- package/src/gridlist/createGridListItem.ts +87 -155
- package/src/gridlist/createGridListSection.ts +54 -0
- package/src/gridlist/index.ts +3 -0
- package/src/gridlist/types.ts +47 -0
- package/src/index.ts +40 -0
- package/src/interactions/PressEvent.ts +14 -0
- package/src/interactions/createInteractionModality.ts +21 -12
- package/src/interactions/createKeyboard.ts +10 -0
- package/src/interactions/createPress.ts +29 -6
- package/src/listbox/createListBox.ts +129 -8
- package/src/listbox/createOption.ts +68 -73
- package/src/menu/createMenu.ts +93 -16
- package/src/menu/createMenuItem.ts +253 -41
- package/src/numberfield/createNumberField.ts +82 -14
- package/src/popover/calculatePosition.ts +19 -7
- package/src/popover/createOverlayPosition.ts +9 -0
- package/src/radio/createRadio.ts +19 -2
- package/src/select/createSelect.ts +18 -2
- package/src/selection/DOMLayoutDelegate.ts +102 -0
- package/src/selection/ListKeyboardDelegate.ts +398 -0
- package/src/selection/constants.ts +16 -0
- package/src/selection/createCollectionRowInteraction.ts +209 -0
- package/src/selection/createScrollIntoViewOnFocus.ts +65 -0
- package/src/selection/createSelectableCollection.ts +645 -0
- package/src/selection/createSelectableItem.ts +498 -0
- package/src/selection/createSelectableList.ts +93 -0
- package/src/selection/createTypeSelect.ts +112 -51
- package/src/selection/index.ts +31 -0
- package/src/selection/selectItem.ts +80 -0
- package/src/selection/utils.ts +82 -0
- package/src/slider/createSlider.ts +48 -1
- package/src/ssr/index.tsx +31 -0
- package/src/switch/createSwitch.ts +10 -0
- package/src/table/createTable.ts +56 -26
- package/src/table/createTableRow.ts +198 -203
- package/src/table/createTableSelectAllCheckbox.ts +3 -4
- package/src/table/types.ts +29 -1
- package/src/tabs/createTabs.ts +50 -20
- package/src/tag/createTag.ts +9 -4
- package/src/toast/createToast.ts +1 -0
- package/src/toggle/createToggle.ts +20 -0
- package/src/toolbar/createToolbar.ts +43 -42
- package/src/tree/createTree.ts +100 -42
- package/src/tree/createTreeItem.ts +105 -120
- package/src/tree/types.ts +10 -0
- package/src/utils/animation.ts +151 -0
- package/src/utils/dom.ts +215 -25
- package/src/utils/index.ts +8 -0
- package/src/utils/keyboard.ts +25 -0
- package/src/utils/mergeProps.ts +8 -1
- package/src/utils/scrollIntoView.ts +181 -0
- package/dist/index.js.map +0 -1
- package/dist/index.jsx.map +0 -1
package/src/menu/createMenu.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { createEffect, onCleanup, type JSX, type Accessor } from "solid-js";
|
|
|
8
8
|
import { createFocusWithin } from "../interactions/createFocusWithin";
|
|
9
9
|
import { createLabel } from "../label/createLabel";
|
|
10
10
|
import { createTypeSelect } from "../selection/createTypeSelect";
|
|
11
|
+
import { selectItem } from "../selection/selectItem";
|
|
11
12
|
import { filterDOMProps } from "../utils/filterDOMProps";
|
|
12
13
|
import { mergeProps } from "../utils/mergeProps";
|
|
13
14
|
import { createId } from "../ssr";
|
|
@@ -57,7 +58,7 @@ function findNextNonDisabledKey<T>(
|
|
|
57
58
|
return nextKey;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
|
-
export interface AriaMenuProps {
|
|
61
|
+
export interface AriaMenuProps<T = unknown> {
|
|
61
62
|
/** An ID for the menu. */
|
|
62
63
|
id?: string;
|
|
63
64
|
/** Whether the menu is disabled. */
|
|
@@ -77,9 +78,11 @@ export interface AriaMenuProps {
|
|
|
77
78
|
/** Handler called when the focus state changes. */
|
|
78
79
|
onFocusChange?: (isFocused: boolean) => void;
|
|
79
80
|
/** Handler called when an item is activated (pressed). */
|
|
80
|
-
onAction?: (key: Key) => void;
|
|
81
|
+
onAction?: (key: Key, value: T) => void;
|
|
81
82
|
/** Handler called when the menu should close. */
|
|
82
83
|
onClose?: () => void;
|
|
84
|
+
/** Whether the menu should close when an item is selected. */
|
|
85
|
+
shouldCloseOnSelect?: boolean;
|
|
83
86
|
/** Whether focus should automatically wrap around. */
|
|
84
87
|
shouldFocusWrap?: boolean;
|
|
85
88
|
/** Whether to auto-focus the first item when the menu opens. */
|
|
@@ -100,9 +103,12 @@ const menuData = new WeakMap<object, MenuData>();
|
|
|
100
103
|
|
|
101
104
|
interface MenuData {
|
|
102
105
|
id: string;
|
|
103
|
-
|
|
106
|
+
// Type-erased like upstream menu/utils.ts MenuData (value: any): the WeakMap
|
|
107
|
+
// is keyed by an untyped state, so the item value flows through as unknown.
|
|
108
|
+
onAction?: (key: Key, value: unknown) => void;
|
|
104
109
|
onClose?: () => void;
|
|
105
110
|
isDisabled?: boolean;
|
|
111
|
+
shouldCloseOnSelect?: boolean;
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
export function getMenuData(state: MenuState): MenuData | undefined {
|
|
@@ -114,7 +120,7 @@ export function getMenuData(state: MenuState): MenuData | undefined {
|
|
|
114
120
|
* A menu displays a list of actions or options that a user can choose.
|
|
115
121
|
*/
|
|
116
122
|
export function createMenu<T>(
|
|
117
|
-
props: MaybeAccessor<AriaMenuProps
|
|
123
|
+
props: MaybeAccessor<AriaMenuProps<T>>,
|
|
118
124
|
state: MenuState<T>,
|
|
119
125
|
ref?: Accessor<HTMLElement | null>,
|
|
120
126
|
): MenuAria {
|
|
@@ -139,9 +145,10 @@ export function createMenu<T>(
|
|
|
139
145
|
const p = getProps();
|
|
140
146
|
menuData.set(state, {
|
|
141
147
|
id,
|
|
142
|
-
onAction: p.onAction,
|
|
148
|
+
onAction: p.onAction as MenuData["onAction"],
|
|
143
149
|
onClose: p.onClose,
|
|
144
150
|
isDisabled: p.isDisabled,
|
|
151
|
+
shouldCloseOnSelect: p.shouldCloseOnSelect,
|
|
145
152
|
});
|
|
146
153
|
};
|
|
147
154
|
|
|
@@ -203,29 +210,39 @@ export function createMenu<T>(
|
|
|
203
210
|
const p = getProps();
|
|
204
211
|
const wrap = p.shouldFocusWrap ?? false;
|
|
205
212
|
|
|
206
|
-
//
|
|
207
|
-
|
|
213
|
+
// Disabled keys only block keyboard navigation under disabledBehavior "all"
|
|
214
|
+
// (the default); under "selection" they stay focusable while their selection
|
|
215
|
+
// remains blocked. Mirrors ListKeyboardDelegate.isDisabled in React Aria,
|
|
216
|
+
// which gates the navigation skip on the resolved disabledBehavior.
|
|
217
|
+
const isDisabled = (key: Key) => state.isDisabled(key) && state.disabledBehavior() === "all";
|
|
208
218
|
|
|
209
219
|
switch (e.key) {
|
|
210
220
|
case "ArrowDown": {
|
|
211
|
-
|
|
221
|
+
// Only consume the key once a target exists, mirroring
|
|
222
|
+
// useSelectableCollection (ArrowDown, 211-225): preventDefault is called
|
|
223
|
+
// inside `if (nextKey != null)`, so at the last item without wrap the
|
|
224
|
+
// arrow bubbles instead of being swallowed.
|
|
212
225
|
const currentKey = state.focusedKey();
|
|
213
226
|
const nextKey = findNextNonDisabledKey(collection, currentKey, "next", isDisabled, wrap);
|
|
214
227
|
if (nextKey != null) {
|
|
228
|
+
e.preventDefault();
|
|
215
229
|
state.setFocusedKey(nextKey);
|
|
216
230
|
}
|
|
217
231
|
break;
|
|
218
232
|
}
|
|
219
233
|
case "ArrowUp": {
|
|
220
|
-
e.preventDefault();
|
|
221
234
|
const currentKey = state.focusedKey();
|
|
222
235
|
const prevKey = findNextNonDisabledKey(collection, currentKey, "prev", isDisabled, wrap);
|
|
223
236
|
if (prevKey != null) {
|
|
237
|
+
e.preventDefault();
|
|
224
238
|
state.setFocusedKey(prevKey);
|
|
225
239
|
}
|
|
226
240
|
break;
|
|
227
241
|
}
|
|
228
242
|
case "Home": {
|
|
243
|
+
// Mirror useSelectableCollection (Home, 283-285): with nothing focused,
|
|
244
|
+
// Shift+Home has no anchor to extend from, so leave the event alone.
|
|
245
|
+
if (state.focusedKey() == null && e.shiftKey) break;
|
|
229
246
|
e.preventDefault();
|
|
230
247
|
// Find first non-disabled key
|
|
231
248
|
let firstKey = collection.getFirstKey();
|
|
@@ -238,6 +255,8 @@ export function createMenu<T>(
|
|
|
238
255
|
break;
|
|
239
256
|
}
|
|
240
257
|
case "End": {
|
|
258
|
+
// Mirror useSelectableCollection (End, 300-302): same anchor guard as Home.
|
|
259
|
+
if (state.focusedKey() == null && e.shiftKey) break;
|
|
241
260
|
e.preventDefault();
|
|
242
261
|
// Find last non-disabled key
|
|
243
262
|
let lastKey = collection.getLastKey();
|
|
@@ -251,13 +270,43 @@ export function createMenu<T>(
|
|
|
251
270
|
}
|
|
252
271
|
case " ":
|
|
253
272
|
case "Enter": {
|
|
273
|
+
if (e.target !== e.currentTarget) break;
|
|
254
274
|
e.preventDefault();
|
|
255
275
|
const focusedKey = state.focusedKey();
|
|
256
|
-
//
|
|
276
|
+
// Activation is gated on the navigation-disabled check, not the raw
|
|
277
|
+
// one: under disabledBehavior "selection" a focusable disabled item
|
|
278
|
+
// still fires onAction (and closes), mirroring useSelectableItem's
|
|
279
|
+
// allowsActions (manager.isDisabled is gated on "all"). Selection stays
|
|
280
|
+
// blocked independently — state.select self-guards on the raw disabled
|
|
281
|
+
// check (SelectionManager.canSelectItem).
|
|
257
282
|
if (focusedKey != null && !isDisabled(focusedKey)) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
283
|
+
// Route through the aria-layer onSelect so the platform-aware modifier
|
|
284
|
+
// resolution (isCtrlKeyPressed / non-contiguous modifier) and the
|
|
285
|
+
// shift-extend path are applied. Keyboard activation carries
|
|
286
|
+
// pointerType "keyboard".
|
|
287
|
+
selectItem(
|
|
288
|
+
state,
|
|
289
|
+
focusedKey,
|
|
290
|
+
{
|
|
291
|
+
pointerType: "keyboard",
|
|
292
|
+
shiftKey: e.shiftKey,
|
|
293
|
+
ctrlKey: e.ctrlKey,
|
|
294
|
+
metaKey: e.metaKey,
|
|
295
|
+
altKey: e.altKey,
|
|
296
|
+
},
|
|
297
|
+
collection,
|
|
298
|
+
);
|
|
299
|
+
// Pass the activated item's value as the second arg, mirroring
|
|
300
|
+
// useMenuItem performAction: onAction(key, item?.value).
|
|
301
|
+
p.onAction?.(focusedKey, collection.getItem(focusedKey)?.value as T);
|
|
302
|
+
const item = collection.getItem(focusedKey);
|
|
303
|
+
const isLink = !!item?.props?.href;
|
|
304
|
+
const shouldClose =
|
|
305
|
+
p.shouldCloseOnSelect ??
|
|
306
|
+
(e.key === "Enter" || state.selectionMode() === "none" || isLink);
|
|
307
|
+
if (shouldClose) {
|
|
308
|
+
p.onClose?.();
|
|
309
|
+
}
|
|
261
310
|
}
|
|
262
311
|
break;
|
|
263
312
|
}
|
|
@@ -267,8 +316,14 @@ export function createMenu<T>(
|
|
|
267
316
|
break;
|
|
268
317
|
}
|
|
269
318
|
case "PageDown": {
|
|
270
|
-
|
|
319
|
+
// Mirror useSelectableCollection (PageDown, 324-332): only consume the
|
|
320
|
+
// key when an item is focused. A non-empty collection always yields a
|
|
321
|
+
// page target via getKeyPageBelow, so a focused key means focus moves
|
|
322
|
+
// and the event is swallowed; with nothing focused, leave it alone to
|
|
323
|
+
// bubble (e.g. to scroll an enclosing region).
|
|
271
324
|
const currentKey = state.focusedKey();
|
|
325
|
+
if (currentKey == null) break;
|
|
326
|
+
e.preventDefault();
|
|
272
327
|
const el = ref?.();
|
|
273
328
|
|
|
274
329
|
if (el) {
|
|
@@ -333,8 +388,14 @@ export function createMenu<T>(
|
|
|
333
388
|
break;
|
|
334
389
|
}
|
|
335
390
|
case "PageUp": {
|
|
336
|
-
|
|
391
|
+
// Mirror useSelectableCollection (PageUp, 333-341): only consume the key
|
|
392
|
+
// when an item is focused. A non-empty collection always yields a page
|
|
393
|
+
// target via getKeyPageAbove, so a focused key means focus moves and the
|
|
394
|
+
// event is swallowed; with nothing focused, leave it alone to bubble
|
|
395
|
+
// (e.g. to scroll an enclosing region).
|
|
337
396
|
const currentKey = state.focusedKey();
|
|
397
|
+
if (currentKey == null) break;
|
|
398
|
+
e.preventDefault();
|
|
338
399
|
const el = ref?.();
|
|
339
400
|
|
|
340
401
|
if (el) {
|
|
@@ -414,7 +475,23 @@ export function createMenu<T>(
|
|
|
414
475
|
fieldProps as Record<string, unknown>,
|
|
415
476
|
{
|
|
416
477
|
role: "menu",
|
|
417
|
-
|
|
478
|
+
// Roving tabindex: the menu container is tab-reachable (0) only while no
|
|
479
|
+
// item holds focus; once `focusedKey` is set the container drops to -1 so
|
|
480
|
+
// Tab/Shift+Tab traverse past it and real focus stays on the item. This
|
|
481
|
+
// mirrors upstream `useMenu`, which spreads `useSelectableList`'s
|
|
482
|
+
// `listProps.tabIndex` (`manager.focusedKey == null ? 0 : -1`, non-virtual
|
|
483
|
+
// focus) onto the menu.
|
|
484
|
+
//
|
|
485
|
+
// This MUST be a getter, not an eagerly-evaluated value. Consumers
|
|
486
|
+
// (solidaria-components `Menu.tsx`) destructure `menuProps` once and
|
|
487
|
+
// spread it through `mergeProps`; a plain `tabIndex: <value>` would be
|
|
488
|
+
// computed at that first read (while `focusedKey` is still null → 0) and
|
|
489
|
+
// frozen. As a getter it survives `mergeProps` (which preserves getters),
|
|
490
|
+
// so the consumer's reactive element-spread re-reads `state.focusedKey()`
|
|
491
|
+
// and the container tabindex tracks focus.
|
|
492
|
+
get tabIndex() {
|
|
493
|
+
return getProps().isDisabled ? undefined : state.focusedKey() == null ? 0 : -1;
|
|
494
|
+
},
|
|
418
495
|
"aria-disabled": p.isDisabled || undefined,
|
|
419
496
|
onKeyDown,
|
|
420
497
|
} as Record<string, unknown>,
|
|
@@ -4,21 +4,33 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { type JSX, type Accessor } from "solid-js";
|
|
7
|
-
import { createPress } from "../interactions/createPress";
|
|
7
|
+
import { createPress, type PressEvent } from "../interactions/createPress";
|
|
8
8
|
import { createHover } from "../interactions/createHover";
|
|
9
9
|
import { createFocusRing } from "../interactions/createFocusRing";
|
|
10
|
+
import { createSelectableItem } from "../selection/createSelectableItem";
|
|
10
11
|
import { mergeProps } from "../utils/mergeProps";
|
|
11
12
|
import { access, type MaybeAccessor } from "../utils/reactivity";
|
|
13
|
+
import { getEventTarget } from "../utils/dom";
|
|
14
|
+
import { isVirtualClick } from "../utils/events";
|
|
15
|
+
import { createSlotId } from "../ssr";
|
|
12
16
|
import { getMenuData } from "./createMenu";
|
|
13
|
-
import type { MenuState, Key, SelectionMode } from "@proyecto-viviana/solid-stately";
|
|
17
|
+
import type { MenuState, Key, Selection, SelectionMode } from "@proyecto-viviana/solid-stately";
|
|
14
18
|
|
|
15
19
|
export interface AriaMenuItemProps {
|
|
16
20
|
/** The unique key for the menu item. */
|
|
17
21
|
key: Key;
|
|
22
|
+
/** Optional DOM id for the menu item. Defaults to the key. */
|
|
23
|
+
id?: string;
|
|
18
24
|
/** Whether the menu item is disabled. */
|
|
19
25
|
isDisabled?: boolean;
|
|
20
26
|
/** An accessible label for the menu item. */
|
|
21
27
|
"aria-label"?: string;
|
|
28
|
+
/** Element controlled by this menu item, for submenu triggers. */
|
|
29
|
+
"aria-controls"?: string;
|
|
30
|
+
/** Whether this menu item opens a submenu or subdialog. */
|
|
31
|
+
"aria-haspopup"?: string | boolean;
|
|
32
|
+
/** Whether the submenu or subdialog is expanded. */
|
|
33
|
+
"aria-expanded"?: boolean | "true" | "false";
|
|
22
34
|
/** Handler called when the menu item is selected. */
|
|
23
35
|
onAction?: () => void;
|
|
24
36
|
/** Whether to close the menu when this item is selected. */
|
|
@@ -62,60 +74,246 @@ export interface MenuItemAria {
|
|
|
62
74
|
export function createMenuItem<T>(
|
|
63
75
|
props: MaybeAccessor<AriaMenuItemProps>,
|
|
64
76
|
state: MenuState<T>,
|
|
65
|
-
|
|
77
|
+
ref?: () => HTMLElement | null,
|
|
66
78
|
): MenuItemAria {
|
|
67
79
|
const getProps = () => access(props);
|
|
68
80
|
|
|
69
81
|
// Get shared data from menu
|
|
70
82
|
const getData = () => getMenuData(state);
|
|
71
83
|
|
|
72
|
-
// Computed states
|
|
84
|
+
// Computed states. `state.isDisabled` is SelectionManager.isDisabled, which
|
|
85
|
+
// already respects disabledBehavior="selection"; these items stay actionable
|
|
86
|
+
// while SelectionManager.canSelectItem keeps selection blocked.
|
|
73
87
|
const isDisabled: Accessor<boolean> = () => {
|
|
74
88
|
return Boolean(
|
|
75
89
|
getData()?.isDisabled || getProps().isDisabled || state.isDisabled(getProps().key),
|
|
76
90
|
);
|
|
77
91
|
};
|
|
78
92
|
|
|
79
|
-
const
|
|
80
|
-
return state.
|
|
93
|
+
const selectionMode: Accessor<SelectionMode> = () => {
|
|
94
|
+
return state.selectionMode();
|
|
81
95
|
};
|
|
82
96
|
|
|
97
|
+
// Whether this is a link item
|
|
98
|
+
const isLink = () => !!getProps().href;
|
|
99
|
+
const isTrigger = () => !!getProps()["aria-haspopup"];
|
|
100
|
+
|
|
101
|
+
const selectableItem = createSelectableItem(
|
|
102
|
+
() => {
|
|
103
|
+
const p = getProps();
|
|
104
|
+
return {
|
|
105
|
+
key: p.key,
|
|
106
|
+
id: p.id ?? String(p.key),
|
|
107
|
+
isDisabled: isDisabled(),
|
|
108
|
+
isLink: isLink(),
|
|
109
|
+
href: p.href,
|
|
110
|
+
shouldSelectOnPressUp: true,
|
|
111
|
+
allowsDifferentPressOrigin: true,
|
|
112
|
+
linkBehavior: "none",
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
state,
|
|
116
|
+
() => ref?.() ?? null,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const isFocused: Accessor<boolean> = () => selectableItem.isFocused();
|
|
120
|
+
|
|
83
121
|
const isSelected: Accessor<boolean> = () => {
|
|
84
|
-
return
|
|
122
|
+
return !isTrigger() && selectableItem.isSelected();
|
|
85
123
|
};
|
|
86
124
|
|
|
87
|
-
|
|
88
|
-
|
|
125
|
+
type MenuInteraction = {
|
|
126
|
+
pointerType: PressEvent["pointerType"];
|
|
127
|
+
key?: string;
|
|
89
128
|
};
|
|
90
129
|
|
|
91
|
-
|
|
92
|
-
|
|
130
|
+
let interaction: MenuInteraction | null = null;
|
|
131
|
+
let isMenuPressActive = false;
|
|
132
|
+
let isDispatchingKeyboardClick = false;
|
|
133
|
+
let isDispatchingMenuSyntheticClick = false;
|
|
134
|
+
let selectionEventBeforeMenuPressUp: Selection | null = null;
|
|
135
|
+
let hasSelectionEventBeforeMenuPressUp = false;
|
|
136
|
+
let pendingSyntheticClickSelectionEvent: Selection | null = null;
|
|
137
|
+
let suppressNextKeyboardClick = false;
|
|
138
|
+
|
|
139
|
+
const getShouldClose = (): boolean => {
|
|
140
|
+
const p = getProps();
|
|
141
|
+
const explicitClose = p.closeOnSelect ?? getData()?.shouldCloseOnSelect;
|
|
142
|
+
if (explicitClose !== undefined) {
|
|
143
|
+
return explicitClose;
|
|
144
|
+
}
|
|
93
145
|
|
|
94
|
-
|
|
146
|
+
if (interaction?.pointerType === "keyboard") {
|
|
147
|
+
return interaction.key === "Enter" || selectionMode() === "none" || isLink();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return selectionMode() !== "multiple" || isLink();
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
const performMenuAction = (event: MouseEvent) => {
|
|
154
|
+
if (isDisabled()) {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (suppressNextKeyboardClick && interaction == null) {
|
|
160
|
+
suppressNextKeyboardClick = false;
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const p = getProps();
|
|
165
|
+
const key = p.key;
|
|
166
|
+
const data = getData();
|
|
167
|
+
|
|
168
|
+
// Submenu triggers open their submenu via the local item action, but do not
|
|
169
|
+
// fire the parent menu onAction or close the menu.
|
|
170
|
+
if (isTrigger()) {
|
|
171
|
+
p.onAction?.();
|
|
172
|
+
interaction = null;
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Call item-specific onAction.
|
|
177
|
+
p.onAction?.();
|
|
178
|
+
|
|
179
|
+
// Call menu-level onAction with the activated item's value, mirroring
|
|
180
|
+
// useMenuItem performAction: onAction(key, item?.value).
|
|
181
|
+
const item = state.collection().getItem(key);
|
|
182
|
+
data?.onAction?.(key, item?.value);
|
|
183
|
+
|
|
184
|
+
if (getShouldClose()) {
|
|
185
|
+
data?.onClose?.();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
interaction = null;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// Menu-specific press handling is separate from selectable-item selection,
|
|
192
|
+
// matching upstream useMenuItem: useSelectableItem owns selection/focus
|
|
193
|
+
// timing; the menu layer owns pressed state, different-origin release, action,
|
|
194
|
+
// links, and close behavior.
|
|
95
195
|
const { pressProps, isPressed } = createPress({
|
|
96
196
|
get isDisabled() {
|
|
97
197
|
return isDisabled();
|
|
98
198
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
199
|
+
onPressChange(isPressed) {
|
|
200
|
+
isMenuPressActive = isPressed;
|
|
201
|
+
},
|
|
202
|
+
onPressUp(e) {
|
|
203
|
+
if (e.pointerType !== "keyboard" && !isDispatchingKeyboardClick) {
|
|
204
|
+
interaction = { pointerType: e.pointerType };
|
|
205
|
+
}
|
|
103
206
|
|
|
104
|
-
|
|
207
|
+
// Native menus allow pressing the trigger, dragging to an item, and
|
|
208
|
+
// releasing to activate it. Upstream useMenuItem synthesizes a click in
|
|
209
|
+
// this different-origin mouse case.
|
|
210
|
+
if (e.pointerType === "mouse" && !isMenuPressActive && e.target instanceof HTMLElement) {
|
|
211
|
+
const selectionEventAfterPressUp = state.selectionManager.lastSelectionEvent;
|
|
212
|
+
pendingSyntheticClickSelectionEvent =
|
|
213
|
+
hasSelectionEventBeforeMenuPressUp &&
|
|
214
|
+
selectionEventAfterPressUp != null &&
|
|
215
|
+
selectionEventAfterPressUp !== selectionEventBeforeMenuPressUp
|
|
216
|
+
? selectionEventAfterPressUp
|
|
217
|
+
: null;
|
|
105
218
|
|
|
106
|
-
|
|
107
|
-
|
|
219
|
+
isDispatchingMenuSyntheticClick = true;
|
|
220
|
+
try {
|
|
221
|
+
e.target.click();
|
|
222
|
+
} finally {
|
|
223
|
+
isDispatchingMenuSyntheticClick = false;
|
|
224
|
+
hasSelectionEventBeforeMenuPressUp = false;
|
|
225
|
+
selectionEventBeforeMenuPressUp = null;
|
|
226
|
+
pendingSyntheticClickSelectionEvent = null;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
const captureSelectionEventBeforeMenuPressUp = () => {
|
|
233
|
+
selectionEventBeforeMenuPressUp = state.selectionManager.lastSelectionEvent;
|
|
234
|
+
hasSelectionEventBeforeMenuPressUp = true;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
const withMenuPressUpSelectionSnapshot = <EventType extends Event>(handler: unknown) => {
|
|
238
|
+
if (typeof handler !== "function") {
|
|
239
|
+
return handler;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return (event: EventType) => {
|
|
243
|
+
captureSelectionEventBeforeMenuPressUp();
|
|
244
|
+
(handler as (event: EventType) => void)(event);
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const selectableItemProps = () => {
|
|
249
|
+
const props = selectableItem.itemProps as Record<string, unknown>;
|
|
250
|
+
const onClick = props.onClick;
|
|
108
251
|
|
|
109
|
-
|
|
110
|
-
|
|
252
|
+
return {
|
|
253
|
+
...props,
|
|
254
|
+
onPointerUp: withMenuPressUpSelectionSnapshot<PointerEvent>(props.onPointerUp),
|
|
255
|
+
onMouseUp: withMenuPressUpSelectionSnapshot<MouseEvent>(props.onMouseUp),
|
|
256
|
+
onClick:
|
|
257
|
+
typeof onClick === "function"
|
|
258
|
+
? (event: MouseEvent) => {
|
|
259
|
+
// The menu layer's upstream-compatible target.click() should activate
|
|
260
|
+
// the menu item, not feed back into selectable-item virtual selection.
|
|
261
|
+
if (isDispatchingMenuSyntheticClick && isVirtualClick(event)) {
|
|
262
|
+
if (pendingSyntheticClickSelectionEvent != null) {
|
|
263
|
+
state.selectionManager.emitDuplicateSelectionEvent(
|
|
264
|
+
pendingSyntheticClickSelectionEvent,
|
|
265
|
+
);
|
|
266
|
+
pendingSyntheticClickSelectionEvent = null;
|
|
267
|
+
}
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
111
270
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
271
|
+
(onClick as (event: MouseEvent) => void)(event);
|
|
272
|
+
}
|
|
273
|
+
: onClick,
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const menuPressProps = () => {
|
|
278
|
+
const {
|
|
279
|
+
onKeyDown: _onKeyDown,
|
|
280
|
+
onKeyUp: _onKeyUp,
|
|
281
|
+
...props
|
|
282
|
+
} = pressProps as Record<string, unknown>;
|
|
283
|
+
return props;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
const keyboardProps = {
|
|
287
|
+
onKeyDown: (event: KeyboardEvent) => {
|
|
288
|
+
if (isDisabled() || event.repeat) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (event.key !== " " && event.key !== "Enter") {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
event.preventDefault();
|
|
297
|
+
event.stopPropagation();
|
|
298
|
+
interaction = { pointerType: "keyboard", key: event.key };
|
|
299
|
+
|
|
300
|
+
const target = getEventTarget<HTMLElement>(event) ?? ref?.();
|
|
301
|
+
if (target instanceof HTMLElement) {
|
|
302
|
+
suppressNextKeyboardClick = true;
|
|
303
|
+
isDispatchingKeyboardClick = true;
|
|
304
|
+
try {
|
|
305
|
+
target.click();
|
|
306
|
+
} finally {
|
|
307
|
+
isDispatchingKeyboardClick = false;
|
|
308
|
+
}
|
|
116
309
|
}
|
|
117
310
|
},
|
|
118
|
-
|
|
311
|
+
onKeyUp: (event: KeyboardEvent) => {
|
|
312
|
+
if (event.key === " " || event.key === "Enter") {
|
|
313
|
+
suppressNextKeyboardClick = false;
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
};
|
|
119
317
|
|
|
120
318
|
// Handle hover
|
|
121
319
|
const { hoverProps } = createHover({
|
|
@@ -130,10 +328,15 @@ export function createMenuItem<T>(
|
|
|
130
328
|
// Handle focus ring
|
|
131
329
|
const { isFocusVisible, focusProps } = createFocusRing();
|
|
132
330
|
|
|
133
|
-
// Generate unique IDs for label and description
|
|
331
|
+
// Generate unique IDs for label and description. The description + keyboard
|
|
332
|
+
// ids use `createSlotId` (a 1:1 port of upstream `useSlotId`): each resolves
|
|
333
|
+
// to `undefined` unless an element carrying that id is actually rendered, so
|
|
334
|
+
// an item with no description/shortcut leaves `aria-describedby` unset instead
|
|
335
|
+
// of pointing at a non-existent element. Mirrors useMenuItem's
|
|
336
|
+
// `[props['aria-describedby'], descriptionId, keyboardId].filter(Boolean)`.
|
|
134
337
|
const labelId = `${getProps().key}-label`;
|
|
135
|
-
const descriptionId =
|
|
136
|
-
const keyboardId =
|
|
338
|
+
const descriptionId = createSlotId();
|
|
339
|
+
const keyboardId = createSlotId();
|
|
137
340
|
|
|
138
341
|
return {
|
|
139
342
|
get menuItemProps() {
|
|
@@ -142,21 +345,25 @@ export function createMenuItem<T>(
|
|
|
142
345
|
const ariaLabel = p["aria-label"];
|
|
143
346
|
const mode = selectionMode();
|
|
144
347
|
const selected = isSelected();
|
|
348
|
+
const trigger = isTrigger();
|
|
145
349
|
|
|
146
350
|
const baseProps: Record<string, unknown> = {
|
|
147
|
-
role:
|
|
148
|
-
|
|
351
|
+
role: trigger
|
|
352
|
+
? "menuitem"
|
|
353
|
+
: mode === "single"
|
|
149
354
|
? "menuitemradio"
|
|
150
355
|
: mode === "multiple"
|
|
151
356
|
? "menuitemcheckbox"
|
|
152
357
|
: "menuitem",
|
|
153
|
-
id: String(key),
|
|
358
|
+
id: p.id ?? String(key),
|
|
154
359
|
"aria-disabled": isDisabled() || undefined,
|
|
155
|
-
"aria-checked": mode !== "none" ? selected : undefined,
|
|
360
|
+
"aria-checked": mode !== "none" && !trigger ? selected : undefined,
|
|
156
361
|
"aria-label": ariaLabel,
|
|
157
362
|
"aria-labelledby": !ariaLabel ? labelId : undefined,
|
|
158
|
-
"aria-describedby": descriptionId,
|
|
159
|
-
|
|
363
|
+
"aria-describedby": [descriptionId(), keyboardId()].filter(Boolean).join(" ") || undefined,
|
|
364
|
+
"aria-controls": p["aria-controls"],
|
|
365
|
+
"aria-haspopup": p["aria-haspopup"],
|
|
366
|
+
"aria-expanded": p["aria-expanded"],
|
|
160
367
|
"data-selected": selected || undefined,
|
|
161
368
|
"data-focused": isFocused() || undefined,
|
|
162
369
|
"data-focus-visible": isFocusVisible() || undefined,
|
|
@@ -175,21 +382,26 @@ export function createMenuItem<T>(
|
|
|
175
382
|
}
|
|
176
383
|
|
|
177
384
|
return mergeProps(
|
|
178
|
-
|
|
385
|
+
selectableItemProps(),
|
|
386
|
+
menuPressProps(),
|
|
179
387
|
hoverProps as Record<string, unknown>,
|
|
180
388
|
focusProps as Record<string, unknown>,
|
|
389
|
+
keyboardProps,
|
|
390
|
+
{ onClick: performMenuAction },
|
|
181
391
|
baseProps,
|
|
182
392
|
) as JSX.HTMLAttributes<HTMLElement>;
|
|
183
393
|
},
|
|
184
394
|
labelProps: {
|
|
185
395
|
id: labelId,
|
|
186
396
|
},
|
|
187
|
-
|
|
188
|
-
|
|
397
|
+
// Getters so the slot id stays reactive: `createSlotId` may clear the id
|
|
398
|
+
// (to `undefined`) after mount if no element registered it, and consumers
|
|
399
|
+
// reading these props re-track that change.
|
|
400
|
+
get descriptionProps() {
|
|
401
|
+
return { id: descriptionId() };
|
|
189
402
|
},
|
|
190
|
-
keyboardShortcutProps
|
|
191
|
-
id: keyboardId,
|
|
192
|
-
"aria-hidden": true,
|
|
403
|
+
get keyboardShortcutProps() {
|
|
404
|
+
return { id: keyboardId(), "aria-hidden": true };
|
|
193
405
|
},
|
|
194
406
|
isFocused,
|
|
195
407
|
isFocusVisible: () => isFocused() && isFocusVisible(),
|