@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
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import { o as mergeProps } from "./env.js";
|
|
2
|
+
import { a as useLocale } from "./createCollator.js";
|
|
3
|
+
import { r as createPreventScroll, t as createOverlay } from "./createOverlay.js";
|
|
4
|
+
import { n as keepVisible, t as ariaHideOutside } from "./ariaHideOutside.js";
|
|
5
|
+
import { createEffect, createSignal, onCleanup } from "solid-js";
|
|
6
|
+
//#region src/popover/calculatePosition.ts
|
|
7
|
+
const AXIS = {
|
|
8
|
+
top: "top",
|
|
9
|
+
bottom: "top",
|
|
10
|
+
left: "left",
|
|
11
|
+
right: "left"
|
|
12
|
+
};
|
|
13
|
+
const FLIPPED_DIRECTION = {
|
|
14
|
+
top: "bottom",
|
|
15
|
+
bottom: "top",
|
|
16
|
+
left: "right",
|
|
17
|
+
right: "left"
|
|
18
|
+
};
|
|
19
|
+
const CROSS_AXIS = {
|
|
20
|
+
top: "left",
|
|
21
|
+
left: "top"
|
|
22
|
+
};
|
|
23
|
+
const AXIS_SIZE = {
|
|
24
|
+
top: "height",
|
|
25
|
+
left: "width"
|
|
26
|
+
};
|
|
27
|
+
const TOTAL_SIZE = {
|
|
28
|
+
width: "totalWidth",
|
|
29
|
+
height: "totalHeight"
|
|
30
|
+
};
|
|
31
|
+
const PARSED_PLACEMENT_CACHE = {};
|
|
32
|
+
function clamp(value, min, max) {
|
|
33
|
+
return Math.min(Math.max(value, min), max);
|
|
34
|
+
}
|
|
35
|
+
function isWebKit() {
|
|
36
|
+
return typeof window !== "undefined" && "WebkitAppearance" in document.documentElement.style;
|
|
37
|
+
}
|
|
38
|
+
const getVisualViewport = () => typeof document !== "undefined" ? window.visualViewport : null;
|
|
39
|
+
function getContainerDimensions(containerNode, visualViewport) {
|
|
40
|
+
let width = 0, height = 0, totalWidth = 0, totalHeight = 0, top = 0, left = 0;
|
|
41
|
+
const scroll = {};
|
|
42
|
+
const isPinchZoomedIn = (visualViewport?.scale ?? 1) > 1;
|
|
43
|
+
if (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") {
|
|
44
|
+
const documentElement = document.documentElement;
|
|
45
|
+
totalWidth = documentElement.clientWidth;
|
|
46
|
+
totalHeight = documentElement.clientHeight;
|
|
47
|
+
width = visualViewport?.width ?? totalWidth;
|
|
48
|
+
height = visualViewport?.height ?? totalHeight;
|
|
49
|
+
scroll.top = documentElement.scrollTop || containerNode.scrollTop;
|
|
50
|
+
scroll.left = documentElement.scrollLeft || containerNode.scrollLeft;
|
|
51
|
+
if (visualViewport) {
|
|
52
|
+
top = visualViewport.offsetTop;
|
|
53
|
+
left = visualViewport.offsetLeft;
|
|
54
|
+
}
|
|
55
|
+
} else {
|
|
56
|
+
({width, height, top, left} = getElementOffset(containerNode, false));
|
|
57
|
+
scroll.top = containerNode.scrollTop;
|
|
58
|
+
scroll.left = containerNode.scrollLeft;
|
|
59
|
+
totalWidth = width;
|
|
60
|
+
totalHeight = height;
|
|
61
|
+
}
|
|
62
|
+
if (isWebKit() && (containerNode.tagName === "BODY" || containerNode.tagName === "HTML") && isPinchZoomedIn) {
|
|
63
|
+
scroll.top = 0;
|
|
64
|
+
scroll.left = 0;
|
|
65
|
+
top = visualViewport?.pageTop ?? 0;
|
|
66
|
+
left = visualViewport?.pageLeft ?? 0;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
width,
|
|
70
|
+
height,
|
|
71
|
+
totalWidth,
|
|
72
|
+
totalHeight,
|
|
73
|
+
scroll,
|
|
74
|
+
top,
|
|
75
|
+
left
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function getScroll(node) {
|
|
79
|
+
return {
|
|
80
|
+
top: node.scrollTop,
|
|
81
|
+
left: node.scrollLeft,
|
|
82
|
+
width: node.scrollWidth,
|
|
83
|
+
height: node.scrollHeight
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function getDelta(axis, offset, size, boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary) {
|
|
87
|
+
const containerScroll = containerDimensions.scroll[axis] ?? 0;
|
|
88
|
+
const boundarySize = boundaryDimensions[AXIS_SIZE[axis]];
|
|
89
|
+
const boundaryStartEdge = containerOffsetWithBoundary[axis] + (boundaryDimensions.scroll[AXIS[axis]] ?? 0) + padding;
|
|
90
|
+
const boundaryEndEdge = containerOffsetWithBoundary[axis] + (boundaryDimensions.scroll[AXIS[axis]] ?? 0) + boundarySize - padding;
|
|
91
|
+
const startEdgeOffset = offset - containerScroll + (boundaryDimensions.scroll[AXIS[axis]] ?? 0) + containerOffsetWithBoundary[axis] - boundaryDimensions[AXIS[axis]];
|
|
92
|
+
const endEdgeOffset = offset - containerScroll + size + (boundaryDimensions.scroll[AXIS[axis]] ?? 0) + containerOffsetWithBoundary[axis] - boundaryDimensions[AXIS[axis]];
|
|
93
|
+
if (startEdgeOffset < boundaryStartEdge) return boundaryStartEdge - startEdgeOffset;
|
|
94
|
+
else if (endEdgeOffset > boundaryEndEdge) return Math.max(boundaryEndEdge - endEdgeOffset, boundaryStartEdge - startEdgeOffset);
|
|
95
|
+
else return 0;
|
|
96
|
+
}
|
|
97
|
+
function getMargins(node) {
|
|
98
|
+
const style = window.getComputedStyle(node);
|
|
99
|
+
return {
|
|
100
|
+
top: parseInt(style.marginTop, 10) || 0,
|
|
101
|
+
bottom: parseInt(style.marginBottom, 10) || 0,
|
|
102
|
+
left: parseInt(style.marginLeft, 10) || 0,
|
|
103
|
+
right: parseInt(style.marginRight, 10) || 0
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function parsePlacement(input) {
|
|
107
|
+
if (PARSED_PLACEMENT_CACHE[input]) return PARSED_PLACEMENT_CACHE[input];
|
|
108
|
+
const [placement, crossPlacement] = input.split(" ");
|
|
109
|
+
const resolvedCrossPlacementInput = crossPlacement ?? "center";
|
|
110
|
+
const axis = AXIS[placement] || "right";
|
|
111
|
+
const crossAxis = CROSS_AXIS[axis];
|
|
112
|
+
let resolvedCrossPlacement = "center";
|
|
113
|
+
if (AXIS[resolvedCrossPlacementInput]) resolvedCrossPlacement = resolvedCrossPlacementInput;
|
|
114
|
+
const size = AXIS_SIZE[axis];
|
|
115
|
+
const crossSize = AXIS_SIZE[crossAxis];
|
|
116
|
+
PARSED_PLACEMENT_CACHE[input] = {
|
|
117
|
+
placement,
|
|
118
|
+
crossPlacement: resolvedCrossPlacement,
|
|
119
|
+
axis,
|
|
120
|
+
crossAxis,
|
|
121
|
+
size,
|
|
122
|
+
crossSize
|
|
123
|
+
};
|
|
124
|
+
return PARSED_PLACEMENT_CACHE[input];
|
|
125
|
+
}
|
|
126
|
+
function computePosition(childOffset, _boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, _containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions) {
|
|
127
|
+
const { placement, crossPlacement, axis, crossAxis, size, crossSize } = placementInfo;
|
|
128
|
+
const position = {};
|
|
129
|
+
position[crossAxis] = childOffset[crossAxis] ?? 0;
|
|
130
|
+
if (crossPlacement === "center") position[crossAxis] += ((childOffset[crossSize] ?? 0) - (overlaySize[crossSize] ?? 0)) / 2;
|
|
131
|
+
else if (crossPlacement !== crossAxis) position[crossAxis] += (childOffset[crossSize] ?? 0) - (overlaySize[crossSize] ?? 0);
|
|
132
|
+
position[crossAxis] += crossOffset;
|
|
133
|
+
const minPosition = childOffset[crossAxis] - overlaySize[crossSize] + arrowSize + arrowBoundaryOffset;
|
|
134
|
+
const maxPosition = childOffset[crossAxis] + childOffset[crossSize] - arrowSize - arrowBoundaryOffset;
|
|
135
|
+
position[crossAxis] = clamp(position[crossAxis], minPosition, maxPosition);
|
|
136
|
+
if (placement === axis) {
|
|
137
|
+
const containerHeight = isContainerPositioned ? containerDimensions[size] : containerDimensions[TOTAL_SIZE[size]];
|
|
138
|
+
position[FLIPPED_DIRECTION[axis]] = Math.floor(containerHeight - childOffset[axis] + offset);
|
|
139
|
+
} else position[axis] = Math.floor(childOffset[axis] + childOffset[size] + offset);
|
|
140
|
+
return position;
|
|
141
|
+
}
|
|
142
|
+
function getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, _isContainerPositioned, margins, padding, overlayHeight, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport) {
|
|
143
|
+
const overlayTop = (position.top != null ? position.top : containerDimensions[TOTAL_SIZE.height] - (position.bottom ?? 0) - overlayHeight) - (containerDimensions.scroll.top ?? 0);
|
|
144
|
+
const boundaryToContainerTransformOffset = isContainerDescendentOfBoundary ? containerOffsetWithBoundary.top : 0;
|
|
145
|
+
const boundingRect = {
|
|
146
|
+
top: Math.max(boundaryDimensions.top + boundaryToContainerTransformOffset, (visualViewport?.offsetTop ?? boundaryDimensions.top) + boundaryToContainerTransformOffset),
|
|
147
|
+
bottom: Math.min(boundaryDimensions.top + boundaryDimensions.height + boundaryToContainerTransformOffset, (visualViewport?.offsetTop ?? 0) + (visualViewport?.height ?? 0))
|
|
148
|
+
};
|
|
149
|
+
return heightGrowthDirection !== "top" ? Math.max(0, boundingRect.bottom - overlayTop - ((margins.top ?? 0) + (margins.bottom ?? 0) + padding)) : Math.max(0, overlayTop + overlayHeight - boundingRect.top - ((margins.top ?? 0) + (margins.bottom ?? 0) + padding));
|
|
150
|
+
}
|
|
151
|
+
function getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding, placementInfo, containerDimensions, isContainerDescendentOfBoundary) {
|
|
152
|
+
const { placement, axis, size } = placementInfo;
|
|
153
|
+
if (placement === axis) return Math.max(0, childOffset[axis] - (containerDimensions.scroll[axis] ?? 0) - (boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0)) - (margins[axis] ?? 0) - (margins[FLIPPED_DIRECTION[axis]] ?? 0) - padding);
|
|
154
|
+
return Math.max(0, boundaryDimensions[size] + boundaryDimensions[axis] + (isContainerDescendentOfBoundary ? containerOffsetWithBoundary[axis] : 0) - childOffset[axis] - childOffset[size] + (containerDimensions.scroll[axis] ?? 0) - (margins[axis] ?? 0) - (margins[FLIPPED_DIRECTION[axis]] ?? 0) - padding);
|
|
155
|
+
}
|
|
156
|
+
function calculatePositionInternal(placementInput, childOffset, overlaySize, _scrollSize, margins, padding, flip, boundaryDimensions, containerDimensions, containerOffsetWithBoundary, offset, crossOffset, isContainerPositioned, userSetMaxHeight, arrowSize, arrowBoundaryOffset, isContainerDescendentOfBoundary, visualViewport) {
|
|
157
|
+
let placementInfo = parsePlacement(placementInput);
|
|
158
|
+
let { size, crossAxis, crossSize, placement, crossPlacement } = placementInfo;
|
|
159
|
+
let position = computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
160
|
+
let normalizedOffset = offset;
|
|
161
|
+
const space = getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, placementInfo, containerDimensions, isContainerDescendentOfBoundary);
|
|
162
|
+
if (flip && overlaySize[size] > space) {
|
|
163
|
+
const flippedPlacementInfo = parsePlacement(`${FLIPPED_DIRECTION[placement]} ${crossPlacement}`);
|
|
164
|
+
const flippedPosition = computePosition(childOffset, boundaryDimensions, overlaySize, flippedPlacementInfo, offset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
165
|
+
if (getAvailableSpace(boundaryDimensions, containerOffsetWithBoundary, childOffset, margins, padding + offset, flippedPlacementInfo, containerDimensions, isContainerDescendentOfBoundary) > space) {
|
|
166
|
+
placementInfo = flippedPlacementInfo;
|
|
167
|
+
position = flippedPosition;
|
|
168
|
+
normalizedOffset = offset;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
let heightGrowthDirection = "bottom";
|
|
172
|
+
if (placementInfo.axis === "top") {
|
|
173
|
+
if (placementInfo.placement === "top") heightGrowthDirection = "top";
|
|
174
|
+
else if (placementInfo.placement === "bottom") heightGrowthDirection = "bottom";
|
|
175
|
+
} else if (placementInfo.crossAxis === "top") {
|
|
176
|
+
if (placementInfo.crossPlacement === "top") heightGrowthDirection = "bottom";
|
|
177
|
+
else if (placementInfo.crossPlacement === "bottom") heightGrowthDirection = "top";
|
|
178
|
+
}
|
|
179
|
+
let delta = getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
180
|
+
position[crossAxis] += delta;
|
|
181
|
+
let maxHeight = getMaxHeight(position, boundaryDimensions, containerOffsetWithBoundary, isContainerPositioned, margins, padding, overlaySize.height, heightGrowthDirection, containerDimensions, isContainerDescendentOfBoundary, visualViewport);
|
|
182
|
+
if (userSetMaxHeight && userSetMaxHeight < maxHeight) maxHeight = userSetMaxHeight;
|
|
183
|
+
overlaySize.height = Math.min(overlaySize.height, maxHeight);
|
|
184
|
+
position = computePosition(childOffset, boundaryDimensions, overlaySize, placementInfo, normalizedOffset, crossOffset, containerOffsetWithBoundary, isContainerPositioned, arrowSize, arrowBoundaryOffset, containerDimensions);
|
|
185
|
+
delta = getDelta(crossAxis, position[crossAxis], overlaySize[crossSize], boundaryDimensions, containerDimensions, padding, containerOffsetWithBoundary);
|
|
186
|
+
position[crossAxis] += delta;
|
|
187
|
+
const arrowPosition = {};
|
|
188
|
+
({placement, crossPlacement} = placementInfo);
|
|
189
|
+
let origin = childOffset[crossAxis] - position[crossAxis] - (margins[AXIS[crossAxis]] ?? 0);
|
|
190
|
+
let preferredArrowPosition = origin + .5 * childOffset[crossSize];
|
|
191
|
+
const arrowMinPosition = arrowSize / 2 + arrowBoundaryOffset;
|
|
192
|
+
const overlayMargin = AXIS[crossAxis] === "left" ? (margins.left ?? 0) + (margins.right ?? 0) : (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
193
|
+
const arrowMaxPosition = overlaySize[crossSize] - overlayMargin - arrowSize / 2 - arrowBoundaryOffset;
|
|
194
|
+
arrowPosition[crossAxis] = clamp(clamp(preferredArrowPosition, childOffset[crossAxis] + arrowSize / 2 - (position[crossAxis] + (margins[AXIS[crossAxis]] ?? 0)), childOffset[crossAxis] + childOffset[crossSize] - arrowSize / 2 - (position[crossAxis] + (margins[AXIS[crossAxis]] ?? 0))), arrowMinPosition, arrowMaxPosition);
|
|
195
|
+
if (arrowSize) origin = arrowPosition[crossAxis];
|
|
196
|
+
else if (crossPlacement === "right" || crossPlacement === "bottom") origin += childOffset[crossSize];
|
|
197
|
+
else if (crossPlacement === "center") origin += childOffset[crossSize] / 2;
|
|
198
|
+
const crossOrigin = placement === "left" || placement === "top" ? overlaySize[size] : 0;
|
|
199
|
+
const triggerAnchorPoint = {
|
|
200
|
+
x: placement === "top" || placement === "bottom" ? origin : crossOrigin,
|
|
201
|
+
y: placement === "left" || placement === "right" ? origin : crossOrigin
|
|
202
|
+
};
|
|
203
|
+
return {
|
|
204
|
+
position,
|
|
205
|
+
maxHeight,
|
|
206
|
+
arrowOffsetLeft: arrowPosition.left,
|
|
207
|
+
arrowOffsetTop: arrowPosition.top,
|
|
208
|
+
placement,
|
|
209
|
+
triggerAnchorPoint
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function getRect(node, ignoreScale) {
|
|
213
|
+
const { top, left, width: bWidth, height: bHeight } = node.getBoundingClientRect();
|
|
214
|
+
let width = bWidth;
|
|
215
|
+
let height = bHeight;
|
|
216
|
+
if (ignoreScale && node instanceof (node.ownerDocument.defaultView?.HTMLElement ?? HTMLElement)) {
|
|
217
|
+
width = node.offsetWidth;
|
|
218
|
+
height = node.offsetHeight;
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
top,
|
|
222
|
+
left,
|
|
223
|
+
width,
|
|
224
|
+
height
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function getElementOffset(node, ignoreScale, overrideRect) {
|
|
228
|
+
const { top, left, width, height } = overrideRect || getRect(node, ignoreScale);
|
|
229
|
+
const { scrollTop, scrollLeft, clientTop, clientLeft } = document.documentElement;
|
|
230
|
+
return {
|
|
231
|
+
top: top + scrollTop - clientTop,
|
|
232
|
+
left: left + scrollLeft - clientLeft,
|
|
233
|
+
width,
|
|
234
|
+
height
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function getPosition(node, parent, ignoreScale, overrideRect) {
|
|
238
|
+
const style = window.getComputedStyle(node);
|
|
239
|
+
let offset;
|
|
240
|
+
if (style.position === "fixed") offset = overrideRect || getRect(node, ignoreScale);
|
|
241
|
+
else {
|
|
242
|
+
offset = getElementOffset(node, ignoreScale, overrideRect);
|
|
243
|
+
const parentOffset = getElementOffset(parent, ignoreScale);
|
|
244
|
+
const parentStyle = window.getComputedStyle(parent);
|
|
245
|
+
parentOffset.top += (parseInt(parentStyle.borderTopWidth, 10) || 0) - parent.scrollTop;
|
|
246
|
+
parentOffset.left += (parseInt(parentStyle.borderLeftWidth, 10) || 0) - parent.scrollLeft;
|
|
247
|
+
offset.top -= parentOffset.top;
|
|
248
|
+
offset.left -= parentOffset.left;
|
|
249
|
+
}
|
|
250
|
+
offset.top -= parseInt(style.marginTop, 10) || 0;
|
|
251
|
+
offset.left -= parseInt(style.marginLeft, 10) || 0;
|
|
252
|
+
return offset;
|
|
253
|
+
}
|
|
254
|
+
function getContainingBlock(node) {
|
|
255
|
+
let offsetParent = node.offsetParent;
|
|
256
|
+
if (offsetParent && offsetParent === document.body && window.getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent)) offsetParent = document.documentElement;
|
|
257
|
+
if (offsetParent == null) {
|
|
258
|
+
offsetParent = node.parentElement;
|
|
259
|
+
while (offsetParent && !isContainingBlock(offsetParent)) offsetParent = offsetParent.parentElement;
|
|
260
|
+
}
|
|
261
|
+
return offsetParent || document.documentElement;
|
|
262
|
+
}
|
|
263
|
+
function isContainingBlock(node) {
|
|
264
|
+
const style = window.getComputedStyle(node);
|
|
265
|
+
return style.transform !== "none" || /transform|perspective/.test(style.willChange) || style.filter !== "none" || style.contain === "paint" || "backdropFilter" in style && style.getPropertyValue("backdrop-filter") !== "none" || "WebkitBackdropFilter" in style && style.getPropertyValue("-webkit-backdrop-filter") !== "none";
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Determines where to place the overlay with regards to the target and the position of an optional indicator.
|
|
269
|
+
*/
|
|
270
|
+
function calculatePosition(opts) {
|
|
271
|
+
const { placement, targetNode, overlayNode, scrollNode, padding, shouldFlip, boundaryElement, offset, crossOffset, maxHeight, arrowSize, arrowBoundaryOffset = 0, targetRect } = opts;
|
|
272
|
+
const visualViewport = getVisualViewport();
|
|
273
|
+
const container = overlayNode instanceof HTMLElement ? getContainingBlock(overlayNode) : document.documentElement;
|
|
274
|
+
const isViewportContainer = container === document.documentElement;
|
|
275
|
+
const containerPositionStyle = window.getComputedStyle(container).position;
|
|
276
|
+
const isContainerPositioned = !!containerPositionStyle && containerPositionStyle !== "static";
|
|
277
|
+
const childOffset = isViewportContainer ? getElementOffset(targetNode, false, targetRect) : getPosition(targetNode, container, false, targetRect);
|
|
278
|
+
if (!isViewportContainer) {
|
|
279
|
+
const { marginTop, marginLeft } = window.getComputedStyle(targetNode);
|
|
280
|
+
childOffset.top += parseInt(marginTop, 10) || 0;
|
|
281
|
+
childOffset.left += parseInt(marginLeft, 10) || 0;
|
|
282
|
+
}
|
|
283
|
+
const overlaySize = getElementOffset(overlayNode, true);
|
|
284
|
+
const margins = getMargins(overlayNode);
|
|
285
|
+
overlaySize.width += (margins.left ?? 0) + (margins.right ?? 0);
|
|
286
|
+
overlaySize.height += (margins.top ?? 0) + (margins.bottom ?? 0);
|
|
287
|
+
return calculatePositionInternal(placement, childOffset, overlaySize, getScroll(scrollNode), margins, padding, shouldFlip, getContainerDimensions(boundaryElement, visualViewport), getContainerDimensions(container, visualViewport), getPosition(boundaryElement, container, false), offset, crossOffset, isContainerPositioned, maxHeight, arrowSize, arrowBoundaryOffset, boundaryElement.contains(container), visualViewport);
|
|
288
|
+
}
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region src/popover/createOverlayPosition.ts
|
|
291
|
+
/**
|
|
292
|
+
* Handles positioning overlays like popovers and menus relative to a trigger
|
|
293
|
+
* element, and updating the position when the window resizes.
|
|
294
|
+
*
|
|
295
|
+
* Ported from @react-aria/overlays useOverlayPosition.
|
|
296
|
+
*/
|
|
297
|
+
const visualViewport = typeof document !== "undefined" ? window.visualViewport : null;
|
|
298
|
+
function translateRTL(position, direction) {
|
|
299
|
+
if (direction === "rtl") return position.replace("start", "right").replace("end", "left");
|
|
300
|
+
return position.replace("start", "left").replace("end", "right");
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Handles positioning overlays like popovers and menus relative to a trigger
|
|
304
|
+
* element, and updating the position when the window resizes.
|
|
305
|
+
*/
|
|
306
|
+
function createOverlayPosition(props) {
|
|
307
|
+
const locale = useLocale();
|
|
308
|
+
const direction = () => locale().direction;
|
|
309
|
+
const arrowSize = () => props.arrowSize ?? 0;
|
|
310
|
+
const targetRef = () => props.targetRef();
|
|
311
|
+
const overlayRef = () => props.overlayRef();
|
|
312
|
+
const arrowRef = () => props.arrowRef?.() ?? null;
|
|
313
|
+
const scrollRef = () => props.scrollRef?.() ?? overlayRef();
|
|
314
|
+
const placement = () => props.placement ?? "bottom";
|
|
315
|
+
const containerPadding = () => props.containerPadding ?? 12;
|
|
316
|
+
const shouldFlip = () => props.shouldFlip ?? true;
|
|
317
|
+
const boundaryElement = () => props.boundaryElement ?? (typeof document !== "undefined" ? document.body : null);
|
|
318
|
+
const offset = () => props.offset ?? 0;
|
|
319
|
+
const crossOffset = () => props.crossOffset ?? 0;
|
|
320
|
+
const shouldUpdatePosition = () => props.shouldUpdatePosition ?? true;
|
|
321
|
+
const isOpen = () => props.isOpen ?? true;
|
|
322
|
+
const onClose = () => props.onClose;
|
|
323
|
+
const maxHeight = () => props.maxHeight;
|
|
324
|
+
const arrowBoundaryOffset = () => props.arrowBoundaryOffset ?? 0;
|
|
325
|
+
const [position, setPosition] = createSignal(null);
|
|
326
|
+
let lastScale = visualViewport?.scale;
|
|
327
|
+
createEffect(() => {
|
|
328
|
+
if (isOpen()) lastScale = visualViewport?.scale;
|
|
329
|
+
});
|
|
330
|
+
const updatePosition = () => {
|
|
331
|
+
const overlayNode = overlayRef();
|
|
332
|
+
const targetNode = targetRef();
|
|
333
|
+
const boundary = boundaryElement();
|
|
334
|
+
if (!shouldUpdatePosition() || !isOpen() || !overlayNode || !targetNode || !boundary) return;
|
|
335
|
+
if (visualViewport?.scale !== lastScale) return;
|
|
336
|
+
const scrollNode = scrollRef();
|
|
337
|
+
const arrowNode = arrowRef();
|
|
338
|
+
const overlay = overlayNode;
|
|
339
|
+
if (!maxHeight() && overlayNode) {
|
|
340
|
+
overlay.style.top = "0px";
|
|
341
|
+
overlay.style.bottom = "";
|
|
342
|
+
overlay.style.maxHeight = (window.visualViewport?.height ?? window.innerHeight) + "px";
|
|
343
|
+
}
|
|
344
|
+
const result = calculatePosition({
|
|
345
|
+
placement: translateRTL(placement(), direction()),
|
|
346
|
+
overlayNode,
|
|
347
|
+
targetNode,
|
|
348
|
+
scrollNode: scrollNode || overlayNode,
|
|
349
|
+
padding: containerPadding(),
|
|
350
|
+
shouldFlip: shouldFlip(),
|
|
351
|
+
boundaryElement: boundary,
|
|
352
|
+
offset: offset(),
|
|
353
|
+
crossOffset: crossOffset(),
|
|
354
|
+
maxHeight: maxHeight(),
|
|
355
|
+
arrowSize: arrowSize() ?? (arrowNode ? getRect(arrowNode, true).width : 0),
|
|
356
|
+
arrowBoundaryOffset: arrowBoundaryOffset(),
|
|
357
|
+
targetRect: props.getTargetRect?.(targetNode)
|
|
358
|
+
});
|
|
359
|
+
if (!result.position) return;
|
|
360
|
+
overlay.style.top = "";
|
|
361
|
+
overlay.style.bottom = "";
|
|
362
|
+
overlay.style.left = "";
|
|
363
|
+
overlay.style.right = "";
|
|
364
|
+
const pos = result.position;
|
|
365
|
+
Object.keys(pos).forEach((key) => {
|
|
366
|
+
overlay.style.setProperty(key, pos[key] + "px");
|
|
367
|
+
});
|
|
368
|
+
overlay.style.maxHeight = result.maxHeight != null ? result.maxHeight + "px" : "";
|
|
369
|
+
setPosition(result);
|
|
370
|
+
};
|
|
371
|
+
createEffect(() => {
|
|
372
|
+
shouldUpdatePosition();
|
|
373
|
+
placement();
|
|
374
|
+
overlayRef();
|
|
375
|
+
targetRef();
|
|
376
|
+
arrowRef();
|
|
377
|
+
scrollRef();
|
|
378
|
+
containerPadding();
|
|
379
|
+
shouldFlip();
|
|
380
|
+
boundaryElement();
|
|
381
|
+
offset();
|
|
382
|
+
crossOffset();
|
|
383
|
+
isOpen();
|
|
384
|
+
maxHeight();
|
|
385
|
+
arrowBoundaryOffset();
|
|
386
|
+
arrowSize();
|
|
387
|
+
updatePosition();
|
|
388
|
+
});
|
|
389
|
+
createEffect(() => {
|
|
390
|
+
if (!isOpen()) return;
|
|
391
|
+
const handleResize = () => updatePosition();
|
|
392
|
+
window.addEventListener("resize", handleResize, false);
|
|
393
|
+
onCleanup(() => {
|
|
394
|
+
window.removeEventListener("resize", handleResize, false);
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
createEffect(() => {
|
|
398
|
+
const overlayNode = overlayRef();
|
|
399
|
+
if (!overlayNode || !isOpen()) return;
|
|
400
|
+
const resizeObserver = new ResizeObserver(() => updatePosition());
|
|
401
|
+
resizeObserver.observe(overlayNode);
|
|
402
|
+
onCleanup(() => {
|
|
403
|
+
resizeObserver.disconnect();
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
createEffect(() => {
|
|
407
|
+
const targetNode = targetRef();
|
|
408
|
+
if (!targetNode || !isOpen()) return;
|
|
409
|
+
const resizeObserver = new ResizeObserver(() => updatePosition());
|
|
410
|
+
resizeObserver.observe(targetNode);
|
|
411
|
+
onCleanup(() => {
|
|
412
|
+
resizeObserver.disconnect();
|
|
413
|
+
});
|
|
414
|
+
});
|
|
415
|
+
createEffect(() => {
|
|
416
|
+
if (!isOpen()) return;
|
|
417
|
+
let timeout;
|
|
418
|
+
let isResizing = false;
|
|
419
|
+
const onResize = () => {
|
|
420
|
+
isResizing = true;
|
|
421
|
+
clearTimeout(timeout);
|
|
422
|
+
timeout = setTimeout(() => {
|
|
423
|
+
isResizing = false;
|
|
424
|
+
}, 500);
|
|
425
|
+
updatePosition();
|
|
426
|
+
};
|
|
427
|
+
const onScroll = () => {
|
|
428
|
+
if (isResizing) onResize();
|
|
429
|
+
};
|
|
430
|
+
visualViewport?.addEventListener("resize", onResize);
|
|
431
|
+
visualViewport?.addEventListener("scroll", onScroll);
|
|
432
|
+
onCleanup(() => {
|
|
433
|
+
visualViewport?.removeEventListener("resize", onResize);
|
|
434
|
+
visualViewport?.removeEventListener("scroll", onScroll);
|
|
435
|
+
clearTimeout(timeout);
|
|
436
|
+
});
|
|
437
|
+
});
|
|
438
|
+
createEffect(() => {
|
|
439
|
+
const targetNode = targetRef();
|
|
440
|
+
const closeHandler = onClose();
|
|
441
|
+
if (!targetNode || !isOpen() || !closeHandler) return;
|
|
442
|
+
const handleScroll = (e) => {
|
|
443
|
+
const target = e.target;
|
|
444
|
+
if (overlayRef()?.contains(target)) return;
|
|
445
|
+
if (target !== document.body && target !== document.documentElement && target.contains(targetNode)) closeHandler();
|
|
446
|
+
};
|
|
447
|
+
document.addEventListener("scroll", handleScroll, true);
|
|
448
|
+
onCleanup(() => {
|
|
449
|
+
document.removeEventListener("scroll", handleScroll, true);
|
|
450
|
+
});
|
|
451
|
+
});
|
|
452
|
+
return {
|
|
453
|
+
overlayProps: { get style() {
|
|
454
|
+
const current = position();
|
|
455
|
+
return {
|
|
456
|
+
position: current ? "absolute" : "fixed",
|
|
457
|
+
top: !current ? 0 : void 0,
|
|
458
|
+
left: !current ? 0 : void 0,
|
|
459
|
+
"z-index": 1e5,
|
|
460
|
+
"max-height": current?.maxHeight ?? "100vh"
|
|
461
|
+
};
|
|
462
|
+
} },
|
|
463
|
+
placement: () => position()?.placement ?? null,
|
|
464
|
+
triggerAnchorPoint: () => position()?.triggerAnchorPoint ?? null,
|
|
465
|
+
arrowProps: {
|
|
466
|
+
"aria-hidden": "true",
|
|
467
|
+
role: "presentation",
|
|
468
|
+
get style() {
|
|
469
|
+
const current = position();
|
|
470
|
+
return {
|
|
471
|
+
left: current?.arrowOffsetLeft != null ? `${current.arrowOffsetLeft}px` : void 0,
|
|
472
|
+
top: current?.arrowOffsetTop != null ? `${current.arrowOffsetTop}px` : void 0
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
updatePosition
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
//#endregion
|
|
480
|
+
//#region src/popover/createPopover.ts
|
|
481
|
+
/**
|
|
482
|
+
* Provides the behavior and accessibility implementation for a popover component.
|
|
483
|
+
* A popover is an overlay element positioned relative to a trigger.
|
|
484
|
+
*
|
|
485
|
+
* Ported from @react-aria/overlays usePopover.
|
|
486
|
+
*/
|
|
487
|
+
/**
|
|
488
|
+
* Provides the behavior and accessibility implementation for a popover component.
|
|
489
|
+
* A popover is an overlay element positioned relative to a trigger.
|
|
490
|
+
*/
|
|
491
|
+
function createPopover(props, state) {
|
|
492
|
+
const triggerRef = () => props.triggerRef();
|
|
493
|
+
const popoverRef = () => props.popoverRef();
|
|
494
|
+
const groupRef = () => props.groupRef?.() ?? null;
|
|
495
|
+
const isNonModal = () => props.isNonModal ?? false;
|
|
496
|
+
const isKeyboardDismissDisabled = () => props.isKeyboardDismissDisabled ?? false;
|
|
497
|
+
const shouldCloseOnInteractOutside = props.shouldCloseOnInteractOutside;
|
|
498
|
+
const isSubmenu = () => props.trigger === "SubmenuTrigger";
|
|
499
|
+
const { overlayProps, underlayProps } = createOverlay({
|
|
500
|
+
get isOpen() {
|
|
501
|
+
return state.isOpen();
|
|
502
|
+
},
|
|
503
|
+
onClose: state.close,
|
|
504
|
+
get shouldCloseOnBlur() {
|
|
505
|
+
return !isSubmenu();
|
|
506
|
+
},
|
|
507
|
+
get isDismissable() {
|
|
508
|
+
return !isNonModal() || isSubmenu();
|
|
509
|
+
},
|
|
510
|
+
get isKeyboardDismissDisabled() {
|
|
511
|
+
return isKeyboardDismissDisabled();
|
|
512
|
+
},
|
|
513
|
+
get shouldCloseOnInteractOutside() {
|
|
514
|
+
return shouldCloseOnInteractOutside;
|
|
515
|
+
}
|
|
516
|
+
}, () => groupRef() ?? popoverRef());
|
|
517
|
+
const { overlayProps: positionProps, arrowProps, placement, triggerAnchorPoint } = createOverlayPosition({
|
|
518
|
+
...props,
|
|
519
|
+
targetRef: triggerRef,
|
|
520
|
+
overlayRef: popoverRef,
|
|
521
|
+
get isOpen() {
|
|
522
|
+
return state.isOpen();
|
|
523
|
+
},
|
|
524
|
+
get onClose() {
|
|
525
|
+
return isNonModal() && !isSubmenu() ? state.close : null;
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
createPreventScroll({ get isDisabled() {
|
|
529
|
+
return isNonModal() || !state.isOpen();
|
|
530
|
+
} });
|
|
531
|
+
createEffect(() => {
|
|
532
|
+
if (state.isOpen() && popoverRef()) {
|
|
533
|
+
const element = groupRef() ?? popoverRef();
|
|
534
|
+
if (!element) return;
|
|
535
|
+
let cleanup;
|
|
536
|
+
if (isNonModal()) cleanup = keepVisible(element);
|
|
537
|
+
else cleanup = ariaHideOutside([element], { shouldUseInert: true });
|
|
538
|
+
onCleanup(() => {
|
|
539
|
+
cleanup?.();
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
const merged = mergeProps(overlayProps, positionProps);
|
|
544
|
+
return {
|
|
545
|
+
popoverProps: new Proxy(merged, {
|
|
546
|
+
get(target, key) {
|
|
547
|
+
if (key === "style") return positionProps.style;
|
|
548
|
+
return target[key];
|
|
549
|
+
},
|
|
550
|
+
has(target, key) {
|
|
551
|
+
return key in target;
|
|
552
|
+
},
|
|
553
|
+
ownKeys(target) {
|
|
554
|
+
return Reflect.ownKeys(target);
|
|
555
|
+
},
|
|
556
|
+
getOwnPropertyDescriptor(target, key) {
|
|
557
|
+
if (key === "style") return {
|
|
558
|
+
configurable: true,
|
|
559
|
+
enumerable: true,
|
|
560
|
+
get: () => positionProps.style
|
|
561
|
+
};
|
|
562
|
+
return Reflect.getOwnPropertyDescriptor(target, key);
|
|
563
|
+
}
|
|
564
|
+
}),
|
|
565
|
+
arrowProps,
|
|
566
|
+
underlayProps,
|
|
567
|
+
placement,
|
|
568
|
+
triggerAnchorPoint
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
//#endregion
|
|
572
|
+
export { createOverlayPosition as n, calculatePosition as r, createPopover as t };
|
|
573
|
+
|
|
574
|
+
//# sourceMappingURL=popover.js.map
|