solid-baseui 0.1.0-alpha.0 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +95 -8
- package/dist/lib/client/DialogHandle-BGyIbcvg.js +521 -0
- package/dist/lib/client/DialogPopup-Df7MC358.js +138 -0
- package/dist/lib/client/FieldControl-C0PATyKV.js +142 -0
- package/dist/lib/client/{FocusManager-grSdNHqW.js → FocusManager-NP1uPXTi.js} +5 -5
- package/dist/lib/client/{FormContext-BB05lWOI.js → FormContext-CwLBtm_d.js} +1 -0
- package/dist/lib/client/{LabelableContext-DKsB0fIx.js → LabelableContext-CmQF-TX2.js} +3 -6
- package/dist/lib/client/MenuSubmenuTrigger-yfncqM-D.js +1584 -0
- package/dist/lib/client/{PopupHandle-CcJG4NMy.js → PopupHandle-CQI6Om1Z.js} +1 -1
- package/dist/lib/client/{PopupStore-DjB-wO88.js → PopupStore-Du0O57fL.js} +118 -98
- package/dist/lib/client/{PopupViewport-DgrIqQea.js → PopupViewport-IS4XU03s.js} +2 -2
- package/dist/lib/client/Separator-D5oJzlA3.js +27 -0
- package/dist/lib/client/TriggerFocusGuards-Cs8LVBj5.js +51 -0
- package/dist/lib/client/accordion/index.js +1 -1
- package/dist/lib/client/accordion-BFeZFpJZ.js +381 -0
- package/dist/lib/client/alert-dialog/index.js +1 -1
- package/dist/lib/client/{alert-dialog-BH_3ndio.js → alert-dialog-BxGUF8_Q.js} +2 -2
- package/dist/lib/client/autocomplete/index.js +1 -1
- package/dist/lib/client/{autocomplete-Cob_FZEP.js → autocomplete-C9QA98XD.js} +30 -25
- package/dist/lib/client/avatar/index.js +1 -1
- package/dist/lib/client/avatar-BQoEzzav.js +191 -0
- package/dist/lib/client/button/index.js +1 -1
- package/dist/lib/client/button-akYS6FyY.js +88 -0
- package/dist/lib/client/checkbox/index.js +1 -1
- package/dist/lib/client/checkbox-DOXtzBhA.js +425 -0
- package/dist/lib/client/checkbox-group/index.js +1 -1
- package/dist/lib/client/checkbox-group-CwMDoSTK.js +135 -0
- package/dist/lib/client/collapsible/index.js +1 -1
- package/dist/lib/client/collapsible-t8YReaIp.js +230 -0
- package/dist/lib/client/combobox/index.js +2 -2
- package/dist/lib/client/combobox-6DhOdzit.js +399 -0
- package/dist/lib/client/{constants-BYjBUIIi.js → constants-cOVxAoxB.js} +5 -1
- package/dist/lib/client/context-menu/index.js +1 -1
- package/dist/lib/client/context-menu-CplDpqmi.js +220 -0
- package/dist/lib/client/{createAnchorPositioning-DcxDXUgB.js → createAnchorPositioning-D96gu-Dz.js} +148 -145
- package/dist/lib/client/{createCollapsiblePanel-DeDu0O2t.js → createCollapsiblePanel-BQ8r4RTi.js} +1 -1
- package/dist/lib/client/createFocusInteraction--s9_qBf3.js +60 -0
- package/dist/lib/client/createLabelableId-DxJRwMUJ.js +14 -0
- package/dist/lib/client/{createPopupAutoResize-CGNiLhGq.js → createPopupAutoResize-Dn-stj-8.js} +1 -1
- package/dist/lib/client/{createTransitionStatus-B1L-whed.js → createTransitionStatus-BL_cPSEA.js} +12 -12
- package/dist/lib/client/dialog/index.js +1 -1
- package/dist/lib/client/{dialog-DkaQwIgP.js → dialog-B9tR9X48.js} +2 -2
- package/dist/lib/client/drawer/index.js +1 -1
- package/dist/lib/client/drawer-dyr3_sKQ.js +1539 -0
- package/dist/lib/client/field/index.js +1 -1
- package/dist/lib/client/field-CjUAjp1m.js +483 -0
- package/dist/lib/client/fieldset/index.js +1 -1
- package/dist/lib/client/fieldset-Byqk3noT.js +70 -0
- package/dist/lib/client/form/index.js +1 -1
- package/dist/lib/client/form-6Ne_bWQX.js +109 -0
- package/dist/lib/client/index.js +44 -42
- package/dist/lib/client/input/index.js +1 -1
- package/dist/lib/client/{input-gb0ejxkm.js → input-_QHvSSqM.js} +1 -1
- package/dist/lib/client/internals/form-context/index.js +1 -1
- package/dist/lib/client/internals/labelable-provider/index.js +1 -1
- package/dist/lib/client/menu/index.js +1 -1
- package/dist/lib/client/menu-DLqUBmMK.js +334 -0
- package/dist/lib/client/menubar/index.js +1 -1
- package/dist/lib/client/menubar-DhPRUQZ6.js +163 -0
- package/dist/lib/client/{mergeStyleValue-C4ITiiIV.js → mergeStyleValue-DhTA9Nwe.js} +7 -3
- package/dist/lib/client/meter/index.js +1 -1
- package/dist/lib/client/meter-BvWdppcx.js +178 -0
- package/dist/lib/client/navigation-menu/index.js +1 -1
- package/dist/lib/client/navigation-menu-mVHV41Ky.js +1070 -0
- package/dist/lib/client/number-field/index.js +1 -1
- package/dist/lib/client/number-field-DusLw_0X.js +1043 -0
- package/dist/lib/client/otp-field/index.js +1 -1
- package/dist/lib/client/otp-field-D-B9tZzF.js +584 -0
- package/dist/lib/client/popover/index.js +1 -1
- package/dist/lib/client/popover-Cv7xn0nW.js +938 -0
- package/dist/lib/client/popupStateMapping-C6jQ_LKo.js +371 -0
- package/dist/lib/client/preview-card/index.js +1 -1
- package/dist/lib/client/preview-card-FTN_aafM.js +632 -0
- package/dist/lib/client/progress/index.js +1 -1
- package/dist/lib/client/progress-AVKxvgpc.js +195 -0
- package/dist/lib/client/radio/index.js +1 -1
- package/dist/lib/client/radio-DA_oZhQT.js +284 -0
- package/dist/lib/client/radio-group/index.js +1 -1
- package/dist/lib/client/radio-group-CWtQxWDl.js +195 -0
- package/dist/lib/client/runOnceAnimationsFinish-CFADb4CN.js +49 -0
- package/dist/lib/client/{safePolygon--bbKn0c8.js → safePolygon-DJG0VIVo.js} +4 -0
- package/dist/lib/client/scroll-area/index.js +1 -1
- package/dist/lib/client/scroll-area-NCr49LkD.js +717 -0
- package/dist/lib/client/select/index.js +1 -1
- package/dist/lib/client/select-DSPJt7Rk.js +1933 -0
- package/dist/lib/client/separator/index.js +1 -1
- package/dist/lib/client/slider/index.js +1 -1
- package/dist/lib/client/slider-CWq9hxFf.js +927 -0
- package/dist/lib/client/switch/index.js +1 -1
- package/dist/lib/client/switch-CPl7QHKI.js +306 -0
- package/dist/lib/client/tabs/index.js +1 -1
- package/dist/lib/client/tabs-Bn4rZDyZ.js +692 -0
- package/dist/lib/client/toast/index.js +1 -1
- package/dist/lib/client/toast-7LdqZWOs.js +1118 -0
- package/dist/lib/client/toggle/index.js +1 -1
- package/dist/lib/client/toggle-CsC37e3e.js +142 -0
- package/dist/lib/client/toggle-group/index.js +1 -1
- package/dist/lib/client/toggle-group-DSWb9HxN.js +134 -0
- package/dist/lib/client/toolbar/index.js +1 -1
- package/dist/lib/client/toolbar-DcCi3HNp.js +504 -0
- package/dist/lib/client/tooltip/index.js +1 -1
- package/dist/lib/client/tooltip-D-PkGco9.js +849 -0
- package/dist/lib/client/use-render/index.js +2 -0
- package/dist/lib/client/useFilteredItems-B7z2CGMV.js +2270 -0
- package/dist/lib/client/useRender-CxZ8PI-g.js +12 -0
- package/dist/lib/server/{DialogHandle-ATZlm9RC.js → DialogHandle-nJSSy_jM.js} +24 -33
- package/dist/lib/server/{DialogPopup-BebI-w5P.js → DialogPopup-Da1aIxVA.js} +10 -13
- package/dist/lib/server/{FieldControl-Y_kI7ARp.js → FieldControl-BDeNR3ug.js} +56 -20
- package/dist/lib/server/{FocusManager-BrbZVWME.js → FocusManager-1LfoCsya.js} +1 -3
- package/dist/lib/server/{FormContext-pvESt85v.js → FormContext-CYwo_ZnB.js} +1 -0
- package/dist/lib/server/{LabelableContext-DZP3rgAY.js → LabelableContext-BTeF0IWb.js} +4 -6
- package/dist/lib/server/{MenuSubmenuTrigger-DA4gsv6z.js → MenuSubmenuTrigger-rR8ZN7YR.js} +133 -166
- package/dist/lib/server/{PopupHandle-DthPgNjy.js → PopupHandle-Ct6wywmP.js} +1 -1
- package/dist/lib/server/{PopupStore-DEs3FAEe.js → PopupStore-kHjFPiQ5.js} +38 -14
- package/dist/lib/server/{PopupViewport-3r_KTFwX.js → PopupViewport-DftN5VUp.js} +2 -2
- package/dist/lib/server/{Separator-vhhYxWGr.js → Separator-DTvtnxzP.js} +4 -6
- package/dist/lib/server/TriggerFocusGuards-CvoGfft9.js +61 -0
- package/dist/lib/server/accordion/index.js +32 -70
- package/dist/lib/server/alert-dialog/index.js +2 -2
- package/dist/lib/server/autocomplete/index.js +14 -5
- package/dist/lib/server/avatar/index.js +90 -51
- package/dist/lib/server/button/index.js +8 -9
- package/dist/lib/server/checkbox/index.js +30 -57
- package/dist/lib/server/checkbox-group/index.js +20 -10
- package/dist/lib/server/collapsible/index.js +36 -43
- package/dist/lib/server/combobox/index.js +64 -35
- package/dist/lib/server/{constants-9H__9xbS.js → constants-D7ciIzsV.js} +8 -3
- package/dist/lib/server/context-menu/index.js +7 -9
- package/dist/lib/server/{createAnchorPositioning-C-cVOPwz.js → createAnchorPositioning-B5Y0WEev.js} +11 -6
- package/dist/lib/server/{createCollapsiblePanel-DTyVJz0G.js → createCollapsiblePanel-B45kTe6v.js} +1 -1
- package/dist/lib/server/{createFocusInteraction-EIS0QOel.js → createFocusInteraction-DMyKsniI.js} +22 -2
- package/dist/lib/server/createLabelableId-WMUKtY6s.js +18 -0
- package/dist/lib/server/{createPopupAutoResize-DO50jjNX.js → createPopupAutoResize-ImBjwdj_.js} +1 -1
- package/dist/lib/server/{createTransitionStatus-BTlrerSS.js → createTransitionStatus-184v7j3-.js} +2 -2
- package/dist/lib/server/dialog/index.js +2 -2
- package/dist/lib/server/drawer/index.js +63 -71
- package/dist/lib/server/field/index.js +105 -93
- package/dist/lib/server/fieldset/index.js +13 -16
- package/dist/lib/server/form/index.js +16 -12
- package/dist/lib/server/index.js +5 -3
- package/dist/lib/server/input/index.js +1 -1
- package/dist/lib/server/internals/form-context/index.js +1 -1
- package/dist/lib/server/internals/labelable-provider/index.js +1 -1
- package/dist/lib/server/menu/index.js +21 -20
- package/dist/lib/server/menubar/index.js +6 -31
- package/dist/lib/server/{mergeStyleValue-Db8bRCM4.js → mergeStyleValue-BwJ10_X2.js} +6 -1
- package/dist/lib/server/meter/index.js +20 -32
- package/dist/lib/server/navigation-menu/index.js +53 -124
- package/dist/lib/server/number-field/index.js +44 -42
- package/dist/lib/server/otp-field/index.js +11 -14
- package/dist/lib/server/popover/index.js +42 -59
- package/dist/lib/server/{popupStateMapping-nKoUwoke.js → popupStateMapping-B2KsiiLb.js} +18 -16
- package/dist/lib/server/preview-card/index.js +30 -41
- package/dist/lib/server/progress/index.js +21 -33
- package/dist/lib/server/radio/index.js +18 -39
- package/dist/lib/server/radio-group/index.js +7 -8
- package/dist/lib/server/{runOnceAnimationsFinish-DCHzXWZU.js → runOnceAnimationsFinish-CYq38H8J.js} +2 -1
- package/dist/lib/server/{safePolygon-CAm5RJGv.js → safePolygon-C1GNJbKR.js} +5 -0
- package/dist/lib/server/scroll-area/index.js +23 -32
- package/dist/lib/server/select/index.js +95 -181
- package/dist/lib/server/separator/index.js +1 -1
- package/dist/lib/server/slider/index.js +25 -38
- package/dist/lib/server/switch/index.js +13 -23
- package/dist/lib/server/tabs/index.js +185 -129
- package/dist/lib/server/toast/index.js +49 -66
- package/dist/lib/server/toggle/index.js +4 -6
- package/dist/lib/server/toggle-group/index.js +9 -7
- package/dist/lib/server/toolbar/index.js +62 -79
- package/dist/lib/server/tooltip/index.js +28 -37
- package/dist/lib/server/use-render/index.js +2 -0
- package/dist/lib/server/{useFilteredItems-DvuctLt3.js → useFilteredItems-DCxq20Is.js} +164 -189
- package/dist/lib/server/useRender-CryVdCjs.js +16 -0
- package/dist/lib/types/accordion/header/AccordionHeader.d.ts +1 -1
- package/dist/lib/types/accordion/item/AccordionItem.d.ts +1 -1
- package/dist/lib/types/accordion/panel/AccordionPanel.d.ts +1 -1
- package/dist/lib/types/accordion/root/AccordionRoot.d.ts +2 -7
- package/dist/lib/types/accordion/trigger/AccordionTrigger.d.ts +1 -1
- package/dist/lib/types/alert-dialog/trigger/AlertDialogTrigger.d.ts +1 -2
- package/dist/lib/types/autocomplete/trigger/AutocompleteTrigger.d.ts +1 -0
- package/dist/lib/types/avatar/fallback/AvatarFallback.d.ts +2 -2
- package/dist/lib/types/avatar/image/AvatarImage.d.ts +9 -3
- package/dist/lib/types/avatar/image/createImageLoadingStatus.d.ts +3 -2
- package/dist/lib/types/avatar/root/AvatarRoot.d.ts +1 -1
- package/dist/lib/types/button/Button.d.ts +1 -1
- package/dist/lib/types/checkbox-group/CheckboxGroupContext.d.ts +4 -1
- package/dist/lib/types/collapsible/panel/CollapsiblePanel.d.ts +1 -1
- package/dist/lib/types/collapsible/root/CollapsibleRoot.d.ts +1 -1
- package/dist/lib/types/collapsible/trigger/CollapsibleTrigger.d.ts +1 -1
- package/dist/lib/types/combobox/index.d.ts +2 -0
- package/dist/lib/types/combobox/index.parts.d.ts +1 -0
- package/dist/lib/types/combobox/items/createItems.d.ts +42 -0
- package/dist/lib/types/combobox/root/AriaCombobox.d.ts +4 -0
- package/dist/lib/types/combobox/root/ComboboxRoot.d.ts +12 -8
- package/dist/lib/types/combobox/root/ComboboxRootContext.d.ts +2 -0
- package/dist/lib/types/combobox/trigger/ComboboxTrigger.d.ts +1 -0
- package/dist/lib/types/dialog/backdrop/DialogBackdrop.d.ts +1 -1
- package/dist/lib/types/dialog/description/DialogDescription.d.ts +1 -1
- package/dist/lib/types/dialog/title/DialogTitle.d.ts +1 -1
- package/dist/lib/types/dialog/viewport/DialogViewport.d.ts +1 -1
- package/dist/lib/types/drawer/backdrop/DrawerBackdrop.d.ts +1 -1
- package/dist/lib/types/drawer/content/DrawerContent.d.ts +1 -1
- package/dist/lib/types/drawer/indent/DrawerIndent.d.ts +1 -1
- package/dist/lib/types/drawer/indent-background/DrawerIndentBackground.d.ts +1 -1
- package/dist/lib/types/field/root/FieldRoot.d.ts +1 -1
- package/dist/lib/types/field/root/createFieldValidation.d.ts +3 -2
- package/dist/lib/types/fieldset/legend/FieldsetLegend.d.ts +1 -1
- package/dist/lib/types/fieldset/root/FieldsetRoot.d.ts +1 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/internals/createTransitionStatus.d.ts +1 -1
- package/dist/lib/types/internals/form-context/FormContext.d.ts +1 -0
- package/dist/lib/types/internals/labelable-provider/LabelableContext.d.ts +1 -0
- package/dist/lib/types/internals/labelable-provider/createLabelableId.d.ts +3 -0
- package/dist/lib/types/internals/overlay/PopupPortal.d.ts +4 -2
- package/dist/lib/types/internals/overlay/createPopupPresence.d.ts +1 -0
- package/dist/lib/types/menu/root/MenuRootContext.d.ts +1 -0
- package/dist/lib/types/meter/indicator/MeterIndicator.d.ts +1 -1
- package/dist/lib/types/meter/label/MeterLabel.d.ts +1 -1
- package/dist/lib/types/meter/root/MeterRoot.d.ts +1 -1
- package/dist/lib/types/meter/track/MeterTrack.d.ts +1 -1
- package/dist/lib/types/meter/value/MeterValue.d.ts +1 -1
- package/dist/lib/types/navigation-menu/trigger/NavigationMenuTrigger.d.ts +1 -0
- package/dist/lib/types/number-field/root/NumberFieldRootContext.d.ts +1 -0
- package/dist/lib/types/popover/arrow/PopoverArrow.d.ts +1 -1
- package/dist/lib/types/popover/backdrop/PopoverBackdrop.d.ts +1 -1
- package/dist/lib/types/popover/description/PopoverDescription.d.ts +1 -1
- package/dist/lib/types/popover/positioner/PopoverPositioner.d.ts +1 -1
- package/dist/lib/types/popover/title/PopoverTitle.d.ts +1 -1
- package/dist/lib/types/preview-card/arrow/PreviewCardArrow.d.ts +1 -1
- package/dist/lib/types/preview-card/backdrop/PreviewCardBackdrop.d.ts +1 -1
- package/dist/lib/types/preview-card/positioner/PreviewCardPositioner.d.ts +1 -1
- package/dist/lib/types/progress/indicator/ProgressIndicator.d.ts +1 -1
- package/dist/lib/types/progress/label/ProgressLabel.d.ts +1 -1
- package/dist/lib/types/progress/root/ProgressRoot.d.ts +1 -1
- package/dist/lib/types/progress/track/ProgressTrack.d.ts +1 -1
- package/dist/lib/types/progress/value/ProgressValue.d.ts +1 -1
- package/dist/lib/types/radio/indicator/RadioIndicator.d.ts +2 -2
- package/dist/lib/types/scroll-area/content/ScrollAreaContent.d.ts +1 -1
- package/dist/lib/types/scroll-area/corner/ScrollAreaCorner.d.ts +1 -1
- package/dist/lib/types/scroll-area/root/ScrollAreaRoot.d.ts +1 -1
- package/dist/lib/types/scroll-area/scrollbar/ScrollAreaScrollbar.d.ts +2 -1
- package/dist/lib/types/scroll-area/thumb/ScrollAreaThumb.d.ts +1 -1
- package/dist/lib/types/scroll-area/viewport/ScrollAreaViewport.d.ts +1 -1
- package/dist/lib/types/separator/Separator.d.ts +1 -1
- package/dist/lib/types/tabs/indicator/prehydrationScript.d.ts +1 -1
- package/dist/lib/types/tabs/list/TabsList.d.ts +1 -1
- package/dist/lib/types/tabs/panel/TabsPanel.d.ts +1 -1
- package/dist/lib/types/tabs/root/TabsRoot.d.ts +1 -1
- package/dist/lib/types/tabs/tab/TabsTab.d.ts +1 -1
- package/dist/lib/types/toast/createToastManager.d.ts +2 -2
- package/dist/lib/types/toast/store/ToastStore.d.ts +1 -1
- package/dist/lib/types/toast/useToastManager.d.ts +1 -1
- package/dist/lib/types/toggle/Toggle.d.ts +1 -1
- package/dist/lib/types/toggle-group/ToggleGroup.d.ts +1 -1
- package/dist/lib/types/toolbar/group/ToolbarGroup.d.ts +1 -1
- package/dist/lib/types/toolbar/link/ToolbarLink.d.ts +1 -1
- package/dist/lib/types/toolbar/root/ToolbarRoot.d.ts +1 -1
- package/dist/lib/types/toolbar/separator/ToolbarSeparator.d.ts +1 -1
- package/dist/lib/types/tooltip/arrow/TooltipArrow.d.ts +1 -1
- package/dist/lib/types/tooltip/positioner/TooltipPositioner.d.ts +1 -1
- package/dist/lib/types/types/index.d.ts +7 -3
- package/dist/lib/types/use-render/index.d.ts +2 -0
- package/dist/lib/types/use-render/useRender.d.ts +10 -0
- package/package.json +24 -11
- package/dist/lib/client/DialogHandle-DrN2YWCv.js +0 -518
- package/dist/lib/client/DialogPopup-ZlqmGfdk.js +0 -136
- package/dist/lib/client/FieldControl-Bc-z2og6.js +0 -116
- package/dist/lib/client/MenuSubmenuTrigger-QZkQ0F2v.js +0 -1570
- package/dist/lib/client/Separator-9DboD_Si.js +0 -25
- package/dist/lib/client/TriggerFocusGuards-CQ-JuASy.js +0 -56
- package/dist/lib/client/accordion-sOXt9AlG.js +0 -399
- package/dist/lib/client/avatar-AF9vyD4q.js +0 -146
- package/dist/lib/client/button-DpUi-2g8.js +0 -82
- package/dist/lib/client/checkbox-BbAwOptH.js +0 -441
- package/dist/lib/client/checkbox-group-CSSp_805.js +0 -128
- package/dist/lib/client/collapsible-BIbje_ub.js +0 -232
- package/dist/lib/client/combobox-8O-vgTLL.js +0 -352
- package/dist/lib/client/context-menu-BTMkXtrs.js +0 -217
- package/dist/lib/client/createFocusInteraction-D4w1-235.js +0 -50
- package/dist/lib/client/drawer-Ce2cChLt.js +0 -1550
- package/dist/lib/client/field-C-o7jzKW.js +0 -469
- package/dist/lib/client/fieldset-BQTAWv2L.js +0 -65
- package/dist/lib/client/form-BINBiW5L.js +0 -106
- package/dist/lib/client/menu-DeMT08oD.js +0 -326
- package/dist/lib/client/menubar-C4aomSYv.js +0 -185
- package/dist/lib/client/meter-xSU37Q0m.js +0 -171
- package/dist/lib/client/navigation-menu-ZILQmdn6.js +0 -1083
- package/dist/lib/client/number-field-B8CsTb_8.js +0 -1035
- package/dist/lib/client/otp-field-DBkMcnog.js +0 -582
- package/dist/lib/client/popover-CQwyp-fs.js +0 -929
- package/dist/lib/client/popupStateMapping-C9eZl19i.js +0 -367
- package/dist/lib/client/preview-card-D_2Q8lpC.js +0 -625
- package/dist/lib/client/progress-D7r0xAC9.js +0 -188
- package/dist/lib/client/radio-CzGQ81z1.js +0 -299
- package/dist/lib/client/radio-group-DpHlBKA6.js +0 -193
- package/dist/lib/client/runOnceAnimationsFinish-15EM-Z4l.js +0 -48
- package/dist/lib/client/scroll-area-CffM4U0R.js +0 -701
- package/dist/lib/client/select-IFhiEg73.js +0 -1940
- package/dist/lib/client/slider-BCagYmGp.js +0 -921
- package/dist/lib/client/switch-RIJeDnvS.js +0 -308
- package/dist/lib/client/tabs-fOAKs7r3.js +0 -696
- package/dist/lib/client/toast-D2P8UqUs.js +0 -1108
- package/dist/lib/client/toggle-group-0Aue0owJ.js +0 -129
- package/dist/lib/client/toggle-momVEIBL.js +0 -138
- package/dist/lib/client/toolbar-Du22aKCv.js +0 -492
- package/dist/lib/client/tooltip-CyK61fl1.js +0 -844
- package/dist/lib/client/useFilteredItems-DTekHz39.js +0 -2223
- package/dist/lib/client/withoutComponentBinding-CcCW7fSc.js +0 -13
- package/dist/lib/server/TriggerFocusGuards-sbGwf45f.js +0 -63
- package/dist/lib/server/withoutComponentBinding-BHaWr5kU.js +0 -20
- package/dist/lib/types/internals/withoutComponentBinding.d.ts +0 -7
|
@@ -0,0 +1,1539 @@
|
|
|
1
|
+
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
+
import { t } from "./useRender-CxZ8PI-g.js";
|
|
3
|
+
import { getStateAttributesProps as n } from "./internals/getStateAttributesProps.js";
|
|
4
|
+
import { A as r, a as i } from "./reasons-Co5CzjKq.js";
|
|
5
|
+
import { n as a, t as o } from "./resolveStyle-XcgAuaKR.js";
|
|
6
|
+
import { createChangeEventDetails as s } from "./internals/createBaseUIEventDetails.js";
|
|
7
|
+
import { TransitionStatusDataAttributes as c } from "./internals/stateAttributesMapping.js";
|
|
8
|
+
import { composeEventHandlers as l } from "./internals/composeEventHandlers.js";
|
|
9
|
+
import { a as u, c as d, l as f, m as p, n as m, p as h, r as g, t as _ } from "./dom-BEAeQ9Eb.js";
|
|
10
|
+
import { n as v } from "./PopupStore-Du0O57fL.js";
|
|
11
|
+
import { r as y, t as b } from "./popupStateMapping-C6jQ_LKo.js";
|
|
12
|
+
import { t as x } from "./FocusManager-NP1uPXTi.js";
|
|
13
|
+
import { a as S, c as C, d as w, f as T, h as E, i as D, l as O, m as k, o as A, r as j, s as M, t as N } from "./DialogHandle-BGyIbcvg.js";
|
|
14
|
+
import { n as P, t as F } from "./scrollable-SRNYlhF7.js";
|
|
15
|
+
import { t as I } from "./platform-Bk5Q32mf.js";
|
|
16
|
+
import { a as ee, i as L, o as R, r as te, s as z, t as ne } from "./constants-cOVxAoxB.js";
|
|
17
|
+
import { createComponent as B, getNextElement as re, mergeProps as ie, runHydrationEvents as V, spread as H, template as U } from "@solidjs/web";
|
|
18
|
+
import { Show as ae, createContext as oe, createEffect as W, createMemo as G, createSignal as K, createUniqueId as se, flush as ce, merge as q, omit as le, onCleanup as ue, onSettled as de, untrack as J, useContext as Y } from "solid-js";
|
|
19
|
+
//#region src/drawer/popup/DrawerPopupCssVars.ts
|
|
20
|
+
var X = /* @__PURE__ */ function(e) {
|
|
21
|
+
return e.nestedDrawers = "--nested-drawers", e.height = "--drawer-height", e.frontmostHeight = "--drawer-frontmost-height", e.swipeMovementX = "--drawer-swipe-movement-x", e.swipeMovementY = "--drawer-swipe-movement-y", e.snapPointOffset = "--drawer-snap-point-offset", e.swipeStrength = "--drawer-swipe-strength", e;
|
|
22
|
+
}({}), Z = /* @__PURE__ */ function(e) {
|
|
23
|
+
return e.swipeProgress = "--drawer-swipe-progress", e;
|
|
24
|
+
}({}), fe = /* @__PURE__ */ U("<div>");
|
|
25
|
+
function pe(e) {
|
|
26
|
+
let r = E(), i = e, s = le(e, "render", "class", "forceRender", "ref", "style"), c = G(() => ({
|
|
27
|
+
open: r.store.open(),
|
|
28
|
+
transitionStatus: r.presence.transitionStatus()
|
|
29
|
+
})), l = t(e, () => c(), (e) => (() => {
|
|
30
|
+
var t = re(fe);
|
|
31
|
+
return H(t, e, !1), V(), t;
|
|
32
|
+
})()), u = G(() => a(e.class, c())), d = G(() => T({
|
|
33
|
+
"pointer-events": r.store.open() ? void 0 : "none",
|
|
34
|
+
"user-select": "none",
|
|
35
|
+
"-webkit-user-select": "none",
|
|
36
|
+
[Z.swipeProgress]: "0",
|
|
37
|
+
[X.swipeStrength]: "1"
|
|
38
|
+
}, o(e.style, c()))), f = G(() => n(c(), w)), p = G(() => !!i.forceRender || !r.nested);
|
|
39
|
+
function m() {
|
|
40
|
+
let e = null;
|
|
41
|
+
return ue(() => {
|
|
42
|
+
r.backdropElement() === e && r.setBackdropElement(null);
|
|
43
|
+
}), B(l, ie({
|
|
44
|
+
ref: [((t) => {
|
|
45
|
+
e = t, r.setBackdropElement(t);
|
|
46
|
+
}), i.ref],
|
|
47
|
+
role: "presentation",
|
|
48
|
+
get hidden() {
|
|
49
|
+
return !r.presence.mounted();
|
|
50
|
+
},
|
|
51
|
+
get class() {
|
|
52
|
+
return u();
|
|
53
|
+
},
|
|
54
|
+
get style() {
|
|
55
|
+
return d();
|
|
56
|
+
}
|
|
57
|
+
}, f, s));
|
|
58
|
+
}
|
|
59
|
+
return B(ae, {
|
|
60
|
+
get when() {
|
|
61
|
+
return p();
|
|
62
|
+
},
|
|
63
|
+
get children() {
|
|
64
|
+
return B(m, {});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/drawer/content/DrawerContentDataAttributes.ts
|
|
70
|
+
var me = "data-drawer-content", he = /* @__PURE__ */ U("<div>");
|
|
71
|
+
function ge(e) {
|
|
72
|
+
E();
|
|
73
|
+
let n = e, r = le(e, "render", "class", "ref", "style"), i = {}, s = t(e, () => i, (e) => (() => {
|
|
74
|
+
var t = re(he);
|
|
75
|
+
return H(t, e, !1), V(), t;
|
|
76
|
+
})()), c = G(() => a(e.class, i)), l = G(() => o(e.style, i));
|
|
77
|
+
return B(s, ie({ ref: [n.ref] }, { [me]: "" }, {
|
|
78
|
+
get class() {
|
|
79
|
+
return c();
|
|
80
|
+
},
|
|
81
|
+
get style() {
|
|
82
|
+
return l();
|
|
83
|
+
}
|
|
84
|
+
}, r));
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/drawer/provider/DrawerProviderContext.ts
|
|
88
|
+
var _e = Symbol("DrawerProviderContext"), Q = oe(_e);
|
|
89
|
+
function ve() {
|
|
90
|
+
let e = Y(Q);
|
|
91
|
+
return e === _e ? void 0 : e;
|
|
92
|
+
}
|
|
93
|
+
function ye() {
|
|
94
|
+
let e = {
|
|
95
|
+
swipeProgress: 0,
|
|
96
|
+
frontmostHeight: 0
|
|
97
|
+
}, t = /* @__PURE__ */ new Set();
|
|
98
|
+
return {
|
|
99
|
+
getSnapshot: () => e,
|
|
100
|
+
set(n) {
|
|
101
|
+
let r = e.swipeProgress;
|
|
102
|
+
n.swipeProgress !== void 0 && (r = Number.isFinite(n.swipeProgress) ? n.swipeProgress : 0);
|
|
103
|
+
let i = e.frontmostHeight;
|
|
104
|
+
n.frontmostHeight !== void 0 && (i = Number.isFinite(n.frontmostHeight) ? n.frontmostHeight : 0), (r !== e.swipeProgress || i !== e.frontmostHeight) && (e = {
|
|
105
|
+
swipeProgress: r,
|
|
106
|
+
frontmostHeight: i
|
|
107
|
+
}, t.forEach((e) => {
|
|
108
|
+
e();
|
|
109
|
+
}));
|
|
110
|
+
},
|
|
111
|
+
subscribe(e) {
|
|
112
|
+
return t.add(e), () => {
|
|
113
|
+
t.delete(e);
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/drawer/indent-background/DrawerIndentBackground.tsx
|
|
120
|
+
var be = /* @__PURE__ */ U("<div>"), xe = { "data-active": "" }, Se = { "data-inactive": "" }, Ce = { active: (e) => e ? xe : Se };
|
|
121
|
+
function we(e) {
|
|
122
|
+
let r = ve(), i = e, s = le(e, "render", "class", "ref", "style"), c = () => ({ active: r?.active() ?? !1 }), l = () => a(e.class, c()), u = () => o(e.style, c()), d = () => n(c(), Ce), f = t(e, c, (e) => (() => {
|
|
123
|
+
var t = re(be);
|
|
124
|
+
return H(t, e, !1), V(), t;
|
|
125
|
+
})());
|
|
126
|
+
return B(f, ie({
|
|
127
|
+
ref: [i.ref],
|
|
128
|
+
get class() {
|
|
129
|
+
return l();
|
|
130
|
+
},
|
|
131
|
+
get style() {
|
|
132
|
+
return u();
|
|
133
|
+
}
|
|
134
|
+
}, d, s));
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/drawer/indent/DrawerIndent.tsx
|
|
138
|
+
var Te = /* @__PURE__ */ U("<div>");
|
|
139
|
+
function Ee(e) {
|
|
140
|
+
let r = ve(), i = e, s = le(e, "render", "class", "ref", "style"), c = () => ({ active: r?.active() ?? !1 }), l = () => a(e.class, c()), u = () => T({ [Z.swipeProgress]: "0" }, o(e.style, c())), d = () => n(c(), Ce), f = null, p = [((e) => {
|
|
141
|
+
f = e;
|
|
142
|
+
}), i.ref], m = t(e, c, (e) => (() => {
|
|
143
|
+
var t = re(Te);
|
|
144
|
+
return H(t, e, !1), V(), t;
|
|
145
|
+
})()), h = B(m, ie({
|
|
146
|
+
ref: p,
|
|
147
|
+
get class() {
|
|
148
|
+
return l();
|
|
149
|
+
},
|
|
150
|
+
get style() {
|
|
151
|
+
return u();
|
|
152
|
+
}
|
|
153
|
+
}, d, s));
|
|
154
|
+
return W(() => r?.visualStateStore, (e) => {
|
|
155
|
+
let t = f;
|
|
156
|
+
if (!t || !e) return;
|
|
157
|
+
function n() {
|
|
158
|
+
let { swipeProgress: n, frontmostHeight: r } = e.getSnapshot();
|
|
159
|
+
t.style.setProperty(Z.swipeProgress, n <= 0 ? "0" : `${n}`), r <= 0 ? t.style.removeProperty(X.height) : t.style.setProperty(X.height, `${r}px`);
|
|
160
|
+
}
|
|
161
|
+
n();
|
|
162
|
+
let r = e.subscribe(n);
|
|
163
|
+
return () => {
|
|
164
|
+
r(), t.style.setProperty(Z.swipeProgress, "0"), t.style.removeProperty(X.height);
|
|
165
|
+
};
|
|
166
|
+
}), h;
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/drawer/root/DrawerRootContext.ts
|
|
170
|
+
var De = Symbol("DrawerRootContext"), Oe = oe(De);
|
|
171
|
+
function ke(e = !1) {
|
|
172
|
+
let t = Y(Oe);
|
|
173
|
+
if (t === De) {
|
|
174
|
+
if (e) return;
|
|
175
|
+
throw Error("Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.");
|
|
176
|
+
}
|
|
177
|
+
return t;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/drawer/root/createDrawerSnapPoints.ts
|
|
181
|
+
function Ae(e, t) {
|
|
182
|
+
let n = e + t;
|
|
183
|
+
return n >= 0 ? t : -Math.sqrt(-n) - e;
|
|
184
|
+
}
|
|
185
|
+
function je(e, t, n) {
|
|
186
|
+
if (!Number.isFinite(t) || t <= 0) return null;
|
|
187
|
+
if (typeof e == "number") return Number.isFinite(e) ? e <= 1 ? z(e, 0, 1) * t : e : null;
|
|
188
|
+
let r = e.trim();
|
|
189
|
+
if (r.endsWith("px")) {
|
|
190
|
+
let e = Number.parseFloat(r);
|
|
191
|
+
return Number.isFinite(e) ? e : null;
|
|
192
|
+
}
|
|
193
|
+
if (r.endsWith("rem")) {
|
|
194
|
+
let e = Number.parseFloat(r);
|
|
195
|
+
return Number.isFinite(e) ? e * n : null;
|
|
196
|
+
}
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
function Me(e, t) {
|
|
200
|
+
let n = -1, r = Infinity;
|
|
201
|
+
for (let i = 0; i < e.length; i += 1) {
|
|
202
|
+
let a = Math.abs(e[i] - t);
|
|
203
|
+
a < r && (r = a, n = i);
|
|
204
|
+
}
|
|
205
|
+
return n;
|
|
206
|
+
}
|
|
207
|
+
function Ne() {
|
|
208
|
+
let e = E(), t = ke(), [n, r] = K(0, { ownedWrite: !0 }), [i, a] = K(16, { ownedWrite: !0 });
|
|
209
|
+
W(() => e.viewportElement(), (e) => {
|
|
210
|
+
function t() {
|
|
211
|
+
let t = h(e).documentElement;
|
|
212
|
+
r(e ? e.offsetHeight : t.clientHeight);
|
|
213
|
+
let n = Number.parseFloat(p(t).getComputedStyle(t).fontSize);
|
|
214
|
+
Number.isFinite(n) && a(n);
|
|
215
|
+
}
|
|
216
|
+
if (t(), !e || typeof ResizeObserver != "function") return;
|
|
217
|
+
let n = new ResizeObserver(t);
|
|
218
|
+
return n.observe(e), () => n.disconnect();
|
|
219
|
+
});
|
|
220
|
+
let o = G(() => {
|
|
221
|
+
let e = t.snapPoints(), r = n(), a = t.popupHeight();
|
|
222
|
+
if (!e || e.length === 0 || r <= 0 || a <= 0) return [];
|
|
223
|
+
let o = i(), s = Math.min(a, r), c = e.map((e) => {
|
|
224
|
+
let t = je(e, r, o);
|
|
225
|
+
if (t === null) return null;
|
|
226
|
+
let n = z(t, 0, s);
|
|
227
|
+
return {
|
|
228
|
+
value: e,
|
|
229
|
+
height: n,
|
|
230
|
+
offset: Math.max(0, a - n)
|
|
231
|
+
};
|
|
232
|
+
}).filter((e) => !!e);
|
|
233
|
+
if (c.length <= 1) return c;
|
|
234
|
+
let l = [], u = [];
|
|
235
|
+
for (let e = c.length - 1; e >= 0; --e) {
|
|
236
|
+
let t = c[e];
|
|
237
|
+
u.some((e) => Math.abs(e - t.height) <= 1) || (u.push(t.height), l.push(t));
|
|
238
|
+
}
|
|
239
|
+
return l.reverse(), l;
|
|
240
|
+
}), s = G(() => {
|
|
241
|
+
let e = t.activeSnapPoint();
|
|
242
|
+
if (e === null) return;
|
|
243
|
+
let r = o(), a = r.find((t) => Object.is(t.value, e));
|
|
244
|
+
if (a) return a;
|
|
245
|
+
let s = n(), c = Math.min(t.popupHeight(), s), l = je(e, s, i());
|
|
246
|
+
if (l === null) return;
|
|
247
|
+
let u = z(l, 0, c);
|
|
248
|
+
return r[Me(r.map((e) => e.height), u)];
|
|
249
|
+
});
|
|
250
|
+
return {
|
|
251
|
+
snapPoints: t.snapPoints,
|
|
252
|
+
activeSnapPoint: t.activeSnapPoint,
|
|
253
|
+
setActiveSnapPoint: t.setActiveSnapPoint,
|
|
254
|
+
popupHeight: t.popupHeight,
|
|
255
|
+
viewportHeight: n,
|
|
256
|
+
resolvedSnapPoints: o,
|
|
257
|
+
activeSnapPointOffset: () => s()?.offset ?? null
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/drawer/viewport/DrawerViewportContext.ts
|
|
262
|
+
var Pe = Symbol("DrawerViewportContext"), Fe = oe(Pe);
|
|
263
|
+
function Ie() {
|
|
264
|
+
let e = Y(Fe);
|
|
265
|
+
return e === Pe ? void 0 : e;
|
|
266
|
+
}
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region src/drawer/popup/DrawerPopupDataAttributes.ts
|
|
269
|
+
var $ = /* @__PURE__ */ function(e) {
|
|
270
|
+
return e[e.open = b.open] = "open", e[e.closed = b.closed] = "closed", e[e.startingStyle = b.startingStyle] = "startingStyle", e[e.endingStyle = b.endingStyle] = "endingStyle", e.expanded = "data-expanded", e.nestedDrawerOpen = "data-nested-drawer-open", e.nestedDrawerSwiping = "data-nested-drawer-swiping", e.swipeDismiss = "data-swipe-dismiss", e.swipeDirection = "data-swipe-direction", e.swiping = "data-swiping", e;
|
|
271
|
+
}({}), Le = /* @__PURE__ */ U("<div>"), Re = /* @__PURE__ */ new Set([
|
|
272
|
+
"ArrowUp",
|
|
273
|
+
"ArrowDown",
|
|
274
|
+
"ArrowLeft",
|
|
275
|
+
"ArrowRight",
|
|
276
|
+
"Home",
|
|
277
|
+
"End"
|
|
278
|
+
]), ze = !1;
|
|
279
|
+
function Be() {
|
|
280
|
+
if (!ze) {
|
|
281
|
+
if (typeof CSS < "u" && "registerProperty" in CSS) {
|
|
282
|
+
for (let e of [
|
|
283
|
+
X.swipeMovementX,
|
|
284
|
+
X.swipeMovementY,
|
|
285
|
+
X.snapPointOffset
|
|
286
|
+
]) try {
|
|
287
|
+
CSS.registerProperty({
|
|
288
|
+
name: e,
|
|
289
|
+
syntax: "<length>",
|
|
290
|
+
inherits: !1,
|
|
291
|
+
initialValue: "0px"
|
|
292
|
+
});
|
|
293
|
+
} catch {}
|
|
294
|
+
for (let { name: e, initialValue: t } of [{
|
|
295
|
+
name: Z.swipeProgress,
|
|
296
|
+
initialValue: "0"
|
|
297
|
+
}, {
|
|
298
|
+
name: X.swipeStrength,
|
|
299
|
+
initialValue: "1"
|
|
300
|
+
}]) try {
|
|
301
|
+
CSS.registerProperty({
|
|
302
|
+
name: e,
|
|
303
|
+
syntax: "<number>",
|
|
304
|
+
inherits: !1,
|
|
305
|
+
initialValue: t
|
|
306
|
+
});
|
|
307
|
+
} catch {}
|
|
308
|
+
}
|
|
309
|
+
ze = !0;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
var Ve = { [$.expanded]: "" }, He = { [$.nestedDrawerOpen]: "" }, Ue = { [$.nestedDrawerSwiping]: "" }, We = { [$.swiping]: "" }, Ge = {
|
|
313
|
+
...y,
|
|
314
|
+
expanded: (e) => e ? Ve : null,
|
|
315
|
+
nestedDrawerOpen: (e) => e ? He : null,
|
|
316
|
+
nestedDrawerSwiping: (e) => e ? Ue : null,
|
|
317
|
+
swipeDirection: (e) => ({ [$.swipeDirection]: e }),
|
|
318
|
+
swiping: (e) => e ? We : null
|
|
319
|
+
};
|
|
320
|
+
function Ke(e) {
|
|
321
|
+
M();
|
|
322
|
+
let r = E(), i = ke(), s = Ie(), c = Ne(), u = e, d = le(e, "render", "class", "finalFocus", "id", "initialFocus", "onKeyDown", "ref", "style"), f = G(() => r.nestedOpenDrawerCount() > 0), p = G(() => s?.swiping() ?? !1), m = null, h = 0;
|
|
323
|
+
function g() {
|
|
324
|
+
if (!m) return;
|
|
325
|
+
let e = m.offsetHeight, t = J(i.frontmostHeight);
|
|
326
|
+
if (!(h > 0 && t > h && e > h)) {
|
|
327
|
+
if (h > 0 && J(i.hasNestedDrawer)) {
|
|
328
|
+
i.onPopupHeightChange(h);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
e !== h && (h = e, i.onPopupHeightChange(e));
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
W(() => ({
|
|
335
|
+
mounted: r.presence.mounted(),
|
|
336
|
+
nestedDrawerOpen: f(),
|
|
337
|
+
element: r.store.track().popupElement
|
|
338
|
+
}), (e) => {
|
|
339
|
+
if (!e.mounted) {
|
|
340
|
+
h = 0, i.onPopupHeightChange(0);
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (!e.element || (Be(), g(), typeof ResizeObserver != "function")) return;
|
|
344
|
+
let t = new ResizeObserver(g);
|
|
345
|
+
return t.observe(e.element), () => t.disconnect();
|
|
346
|
+
}), W(() => r.store.track().popupElement, (e) => {
|
|
347
|
+
function t() {
|
|
348
|
+
if (!e) return;
|
|
349
|
+
let t = i.nestedSwipeProgressStore.getSnapshot();
|
|
350
|
+
e.style.setProperty(Z.swipeProgress, t > 0 ? `${t}` : "0");
|
|
351
|
+
}
|
|
352
|
+
t();
|
|
353
|
+
let n = i.nestedSwipeProgressStore.subscribe(t);
|
|
354
|
+
return () => {
|
|
355
|
+
n(), e?.style.setProperty(Z.swipeProgress, "0");
|
|
356
|
+
};
|
|
357
|
+
}), W(() => ({
|
|
358
|
+
open: r.store.open(),
|
|
359
|
+
frontmostHeight: i.frontmostHeight()
|
|
360
|
+
}), (e) => {
|
|
361
|
+
if (e.open) return i.notifyParentFrontmostHeight?.(e.frontmostHeight), () => i.notifyParentFrontmostHeight?.(0);
|
|
362
|
+
}), W(() => ({
|
|
363
|
+
open: r.store.open(),
|
|
364
|
+
transitionStatus: r.presence.transitionStatus()
|
|
365
|
+
}), (e) => {
|
|
366
|
+
if (i.notifyParentHasNestedDrawer) return i.notifyParentHasNestedDrawer(e.open || e.transitionStatus === "ending"), () => i.notifyParentHasNestedDrawer?.(!1);
|
|
367
|
+
});
|
|
368
|
+
let _ = G(() => ({
|
|
369
|
+
open: r.store.open(),
|
|
370
|
+
transitionStatus: r.presence.transitionStatus(),
|
|
371
|
+
expanded: i.activeSnapPoint() === 1,
|
|
372
|
+
nested: r.nested,
|
|
373
|
+
nestedDrawerOpen: f(),
|
|
374
|
+
nestedDrawerSwiping: i.nestedSwiping(),
|
|
375
|
+
swipeDirection: i.swipeDirection(),
|
|
376
|
+
swiping: p()
|
|
377
|
+
})), v = t(e, () => _(), (e) => (() => {
|
|
378
|
+
var t = re(Le);
|
|
379
|
+
return H(t, e, !1), V(), t;
|
|
380
|
+
})()), y = G(() => a(e.class, _())), b = G(() => n(_(), Ge)), S = G(() => {
|
|
381
|
+
let e = c.snapPoints(), t = i.swipeDirection(), n = e && e.length > 0 && (t === "down" || t === "up"), r = c.activeSnapPointOffset();
|
|
382
|
+
return !n || r === null ? null : t === "up" ? -r : r;
|
|
383
|
+
}), C = G(() => {
|
|
384
|
+
let e = s ? s.getDragStyles() : {}, t = c.snapPoints(), n = i.swipeDirection();
|
|
385
|
+
if (!(t && t.length > 0 && (n === "down" || n === "up")) || n !== "down") return e;
|
|
386
|
+
let r = Number.parseFloat(String(e[X.swipeMovementY]));
|
|
387
|
+
return p() && Number.isFinite(r) ? {
|
|
388
|
+
...e,
|
|
389
|
+
transform: void 0,
|
|
390
|
+
[X.swipeMovementY]: `${Ae(c.activeSnapPointOffset() ?? 0, r)}px`
|
|
391
|
+
} : {
|
|
392
|
+
...e,
|
|
393
|
+
transform: void 0
|
|
394
|
+
};
|
|
395
|
+
}), w = G(() => {
|
|
396
|
+
let t = i.frontmostHeight(), n = !i.hasNestedDrawer() && r.presence.transitionStatus() !== "ending", a = i.popupHeight(), c = s?.swipeStrength() ?? null, l = S();
|
|
397
|
+
return T({
|
|
398
|
+
...C(),
|
|
399
|
+
[Z.swipeProgress]: "0",
|
|
400
|
+
[X.nestedDrawers]: r.nestedOpenDrawerCount(),
|
|
401
|
+
[X.height]: a && !n ? `${a}px` : void 0,
|
|
402
|
+
[X.snapPointOffset]: typeof l == "number" ? `${l}px` : "0px",
|
|
403
|
+
[X.frontmostHeight]: t ? `${t}px` : void 0,
|
|
404
|
+
[X.swipeStrength]: typeof c == "number" && Number.isFinite(c) && c > 0 ? `${c}` : "1"
|
|
405
|
+
}, o(e.style, _()));
|
|
406
|
+
}), D = G(() => u.id ?? r.store.context.floatingId), O = G(() => u.initialFocus ?? (() => r.store.state.popupElement)), k = l(() => u.onKeyDown, () => (e) => {
|
|
407
|
+
Re.has(e.key) && e.stopPropagation();
|
|
408
|
+
});
|
|
409
|
+
W(() => D(), (e) => {
|
|
410
|
+
r.store.setPopupId(e);
|
|
411
|
+
}), ue(() => {
|
|
412
|
+
r.store.state.popupElement === m && r.store.setPopupElement(null);
|
|
413
|
+
});
|
|
414
|
+
let A = B(v, ie({
|
|
415
|
+
ref: [((e) => {
|
|
416
|
+
m = e, r.store.setPopupElement(e);
|
|
417
|
+
}), u.ref],
|
|
418
|
+
get id() {
|
|
419
|
+
return D();
|
|
420
|
+
},
|
|
421
|
+
get role() {
|
|
422
|
+
return r.role;
|
|
423
|
+
},
|
|
424
|
+
tabIndex: -1,
|
|
425
|
+
"data-base-ui-focusable": "",
|
|
426
|
+
get hidden() {
|
|
427
|
+
return !r.presence.mounted();
|
|
428
|
+
},
|
|
429
|
+
get "aria-labelledby"() {
|
|
430
|
+
return r.titleId();
|
|
431
|
+
},
|
|
432
|
+
get "aria-describedby"() {
|
|
433
|
+
return r.descriptionId();
|
|
434
|
+
},
|
|
435
|
+
get class() {
|
|
436
|
+
return y();
|
|
437
|
+
},
|
|
438
|
+
get style() {
|
|
439
|
+
return w();
|
|
440
|
+
},
|
|
441
|
+
onKeyDown: k
|
|
442
|
+
}, b, d));
|
|
443
|
+
return B(x, {
|
|
444
|
+
get context() {
|
|
445
|
+
return r.store.context.floatingRoot;
|
|
446
|
+
},
|
|
447
|
+
get tree() {
|
|
448
|
+
return r.tree;
|
|
449
|
+
},
|
|
450
|
+
get disabled() {
|
|
451
|
+
return !r.presence.mounted();
|
|
452
|
+
},
|
|
453
|
+
get closeOnFocusOut() {
|
|
454
|
+
return !r.disablePointerDismissal();
|
|
455
|
+
},
|
|
456
|
+
get initialFocus() {
|
|
457
|
+
return O();
|
|
458
|
+
},
|
|
459
|
+
get returnFocus() {
|
|
460
|
+
return u.finalFocus;
|
|
461
|
+
},
|
|
462
|
+
get modal() {
|
|
463
|
+
return r.modal() !== !1;
|
|
464
|
+
},
|
|
465
|
+
restoreFocus: "popup",
|
|
466
|
+
get openInteractionType() {
|
|
467
|
+
return r.store.openMethod();
|
|
468
|
+
},
|
|
469
|
+
children: A
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region src/drawer/provider/DrawerProvider.tsx
|
|
474
|
+
function qe(e) {
|
|
475
|
+
let [t, n] = K(0, {
|
|
476
|
+
equals: !1,
|
|
477
|
+
ownedWrite: !0
|
|
478
|
+
}), r = /* @__PURE__ */ new Set(), i = ye(), a = () => (t(), r.size > 0);
|
|
479
|
+
function o(e, t) {
|
|
480
|
+
r.has(e) !== t && (t ? r.add(e) : r.delete(e), n((e) => e + 1));
|
|
481
|
+
}
|
|
482
|
+
return B(Q, {
|
|
483
|
+
value: {
|
|
484
|
+
setDrawerOpen: o,
|
|
485
|
+
removeDrawer: (e) => o(e, !1),
|
|
486
|
+
active: a,
|
|
487
|
+
visualStateStore: i
|
|
488
|
+
},
|
|
489
|
+
get children() {
|
|
490
|
+
return e.children;
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
//#region src/drawer/root/DrawerRoot.tsx
|
|
496
|
+
function Je() {
|
|
497
|
+
let e = 0, t = /* @__PURE__ */ new Set();
|
|
498
|
+
return {
|
|
499
|
+
getSnapshot: () => e,
|
|
500
|
+
set(n) {
|
|
501
|
+
let r = Number.isFinite(n) ? n : 0;
|
|
502
|
+
r !== e && (e = r, t.forEach((e) => {
|
|
503
|
+
e();
|
|
504
|
+
}));
|
|
505
|
+
},
|
|
506
|
+
subscribe(e) {
|
|
507
|
+
return t.add(e), () => {
|
|
508
|
+
t.delete(e);
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function Ye(e) {
|
|
514
|
+
let t = ke(!0), [n, r] = K(0, { ownedWrite: !0 }), [i, a] = K(0, { ownedWrite: !0 }), [o, c] = K(!1, { ownedWrite: !0 }), [l, u] = K(!1, { ownedWrite: !0 }), d = Je(), f = () => e.snapPoints, p = () => e.defaultSnapPoint === void 0 ? f()?.[0] ?? null : e.defaultSnapPoint, m = J(() => e.snapPoint !== void 0), [h, g] = K(J(p), { ownedWrite: !0 }), _ = () => m ? e.snapPoint ?? null : h(), v = !1;
|
|
515
|
+
function y(t, n) {
|
|
516
|
+
let r = n ?? s("none");
|
|
517
|
+
e.onSnapPointChange?.(t, r), !r.isCanceled && g(() => t);
|
|
518
|
+
}
|
|
519
|
+
let b = () => {
|
|
520
|
+
let e = _();
|
|
521
|
+
if (m) return e;
|
|
522
|
+
let t = f();
|
|
523
|
+
return !t || t.length === 0 ? e : e === null || !t.some((t) => Object.is(t, e)) ? p() : e;
|
|
524
|
+
};
|
|
525
|
+
function x(e) {
|
|
526
|
+
r(e), !v && e > 0 && a(e);
|
|
527
|
+
}
|
|
528
|
+
function S(e) {
|
|
529
|
+
if (e > 0) {
|
|
530
|
+
v = !0, a(e);
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
v = !1;
|
|
534
|
+
let t = J(n);
|
|
535
|
+
t > 0 && a(t);
|
|
536
|
+
}
|
|
537
|
+
function C(e) {
|
|
538
|
+
d.set(e), t?.onNestedSwipeProgressChange(e);
|
|
539
|
+
}
|
|
540
|
+
function w(e) {
|
|
541
|
+
u(e), t?.onNestedSwipingChange(e);
|
|
542
|
+
}
|
|
543
|
+
function T(t, n) {
|
|
544
|
+
if (e.onOpenChange?.(t, n), n.isCanceled) return;
|
|
545
|
+
let r = J(f);
|
|
546
|
+
!t && r && r.length > 0 && y(J(p), s(n.reason, n.event, n.trigger));
|
|
547
|
+
}
|
|
548
|
+
let E = {
|
|
549
|
+
swipeDirection: () => e.swipeDirection ?? "down",
|
|
550
|
+
swipeAreaActive: { current: !1 },
|
|
551
|
+
snapToSequentialPoints: () => e.snapToSequentialPoints ?? !1,
|
|
552
|
+
snapPoints: f,
|
|
553
|
+
activeSnapPoint: b,
|
|
554
|
+
setActiveSnapPoint: y,
|
|
555
|
+
frontmostHeight: i,
|
|
556
|
+
popupHeight: n,
|
|
557
|
+
hasNestedDrawer: o,
|
|
558
|
+
onPopupHeightChange: x,
|
|
559
|
+
nestedSwiping: l,
|
|
560
|
+
nestedSwipeProgressStore: d,
|
|
561
|
+
onNestedDrawerPresenceChange: c,
|
|
562
|
+
onNestedFrontmostHeightChange: S,
|
|
563
|
+
onNestedSwipingChange: w,
|
|
564
|
+
onNestedSwipeProgressChange: C,
|
|
565
|
+
notifyParentFrontmostHeight: t ? (e) => t.onNestedFrontmostHeightChange(e) : void 0,
|
|
566
|
+
notifyParentSwipingChange: t ? (e) => t.onNestedSwipingChange(e) : void 0,
|
|
567
|
+
notifyParentSwipeProgressChange: t ? (e) => t.onNestedSwipeProgressChange(e) : void 0,
|
|
568
|
+
notifyParentHasNestedDrawer: t ? (e) => t.onNestedDrawerPresenceChange(e) : void 0
|
|
569
|
+
}, D = q(e, { onOpenChange: T });
|
|
570
|
+
function O() {
|
|
571
|
+
return k("drawer", D, { extraContent: () => B(Xe, {}) });
|
|
572
|
+
}
|
|
573
|
+
return B(Oe, {
|
|
574
|
+
value: E,
|
|
575
|
+
get children() {
|
|
576
|
+
return B(O, {});
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
function Xe() {
|
|
581
|
+
let e = ve(), t = E(), n = t.store, r = {};
|
|
582
|
+
return W(() => n.open(), (t) => {
|
|
583
|
+
e?.setDrawerOpen(r, t);
|
|
584
|
+
}), W(() => e, (e) => () => e?.removeDrawer(r)), W(() => ({
|
|
585
|
+
open: n.open(),
|
|
586
|
+
topmost: t.nestedOpenDialogCount() === 0,
|
|
587
|
+
popupElement: n.track().popupElement
|
|
588
|
+
}), (e) => {
|
|
589
|
+
if (!e.open || !e.topmost || !I()) return;
|
|
590
|
+
let t = p(e.popupElement).CloseWatcher;
|
|
591
|
+
if (!t) return;
|
|
592
|
+
function r(e) {
|
|
593
|
+
n.open() && n.setOpen(!1, s(i, e));
|
|
594
|
+
}
|
|
595
|
+
let a = new t();
|
|
596
|
+
return a.addEventListener("close", r), () => {
|
|
597
|
+
a.removeEventListener("close", r), a.destroy();
|
|
598
|
+
};
|
|
599
|
+
}), null;
|
|
600
|
+
}
|
|
601
|
+
//#endregion
|
|
602
|
+
//#region src/drawer/swipe-area/DrawerSwipeAreaDataAttributes.ts
|
|
603
|
+
var Ze = /* @__PURE__ */ function(e) {
|
|
604
|
+
return e[e.open = b.open] = "open", e[e.closed = b.closed] = "closed", e.disabled = "data-disabled", e.swipeDirection = "data-swipe-direction", e.swiping = "data-swiping", e;
|
|
605
|
+
}({}), Qe = /* @__PURE__ */ U("<div>"), $e = .5, et = 1, tt = .1, nt = 40, rt = { [Ze.open]: "" }, it = { [Ze.closed]: "" }, at = { [Ze.swiping]: "" }, ot = { [Ze.disabled]: "" }, st = {
|
|
606
|
+
open: (e) => e ? rt : it,
|
|
607
|
+
swiping: (e) => e ? at : null,
|
|
608
|
+
swipeDirection: (e) => ({ [Ze.swipeDirection]: e }),
|
|
609
|
+
disabled: (e) => e ? ot : null
|
|
610
|
+
}, ct = {
|
|
611
|
+
up: "down",
|
|
612
|
+
down: "up",
|
|
613
|
+
left: "right",
|
|
614
|
+
right: "left"
|
|
615
|
+
};
|
|
616
|
+
function lt(e) {
|
|
617
|
+
return e === "left" || e === "right" ? "pan-y" : "pan-x";
|
|
618
|
+
}
|
|
619
|
+
function ut(e) {
|
|
620
|
+
return e.mozInputSource === 0 ? e.isTrusted : e.detail === 0 && !e.pointerType;
|
|
621
|
+
}
|
|
622
|
+
function dt(e) {
|
|
623
|
+
let i = E(), c = i.store, u = ke(), d = ve(), f = e, p = le(e, "render", "class", "disabled", "id", "onPointerCancel", "onPointerDown", "onPointerMove", "onPointerUp", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "ref", "style", "swipeDirection"), m = `base-ui-${se()}`, g = G(() => f.id || m), _ = G(() => f.disabled ?? !1), [y, b] = K(null, { ownedWrite: !0 }), [x, S] = K(!1, { ownedWrite: !0 }), C = null, w = !1, D = {
|
|
624
|
+
x: 0,
|
|
625
|
+
y: 0
|
|
626
|
+
}, O = null, k = !1, A = null, j = null, M = null, N = null, P = G(() => f.swipeDirection ?? ct[u.swipeDirection()]), F = G(() => ct[P()]), I = G(() => !_() && (!c.open() || x())), [R, z] = K(!1, { ownedWrite: !0 });
|
|
627
|
+
de(() => {
|
|
628
|
+
let e = !1;
|
|
629
|
+
return queueMicrotask(() => {
|
|
630
|
+
e || z(!0);
|
|
631
|
+
}), () => {
|
|
632
|
+
e = !0;
|
|
633
|
+
};
|
|
634
|
+
}), v(() => c, g, () => R() ? y() : null);
|
|
635
|
+
function ne() {
|
|
636
|
+
D.x = 0, D.y = 0;
|
|
637
|
+
}
|
|
638
|
+
function U() {
|
|
639
|
+
N?.(), i.outsidePressEnabled.current = !1;
|
|
640
|
+
}
|
|
641
|
+
function ae() {
|
|
642
|
+
N?.();
|
|
643
|
+
let e = h(y());
|
|
644
|
+
function t(n) {
|
|
645
|
+
n?.type === "click" && n.detail !== 0 && !ut(n) || (N = null, e.removeEventListener("pointerdown", t, !0), e.removeEventListener("click", t, !0), i.outsidePressEnabled.current = !0);
|
|
646
|
+
}
|
|
647
|
+
N = t, e.addEventListener("pointerdown", t, !0), e.addEventListener("click", t, !0);
|
|
648
|
+
}
|
|
649
|
+
function oe(e) {
|
|
650
|
+
let t = F(), n = t === "left" || t === "right" ? e.offsetWidth : e.offsetHeight;
|
|
651
|
+
return n <= 0 ? null : n;
|
|
652
|
+
}
|
|
653
|
+
function ce() {
|
|
654
|
+
let e = c.state.popupElement;
|
|
655
|
+
return e ? oe(e) : null;
|
|
656
|
+
}
|
|
657
|
+
function q(e) {
|
|
658
|
+
let t = oe(e);
|
|
659
|
+
if (t == null) return null;
|
|
660
|
+
let n = F(), r = n === "left" || n === "right", i = ee(e), a = r ? i.x : i.y;
|
|
661
|
+
return Number.isFinite(a) && Math.abs(a) > .5 ? Math.min(t, Math.abs(a)) : t;
|
|
662
|
+
}
|
|
663
|
+
function Y() {
|
|
664
|
+
let e = ce();
|
|
665
|
+
return e == null ? nt : e * $e;
|
|
666
|
+
}
|
|
667
|
+
function fe() {
|
|
668
|
+
let e = c.state.popupElement;
|
|
669
|
+
if (!e || !c.open() || !i.presence.mounted() || (O ??= q(e), O === null)) return;
|
|
670
|
+
let t = P(), n = F(), r = Math.max(0, L(t, D.x, D.y)), a = r > O ? O + Math.sqrt(r - O) : r, o = (O - a) * (n === "left" || n === "up" ? -1 : 1), s = n === "left" || n === "right", l = s ? o : 0, f = s ? 0 : o, p = Math.max(0, Math.min(1, r / O)), m = Math.max(0, Math.min(1, 1 - p)), h = u.frontmostHeight();
|
|
671
|
+
e.style.setProperty(X.swipeMovementX, `${l}px`), e.style.setProperty(X.swipeMovementY, `${f}px`), e.setAttribute($.swiping, ""), A = e, M ??= e.style.transition, e.style.transition = "none";
|
|
672
|
+
let g = i.backdropElement();
|
|
673
|
+
g && (g.setAttribute($.swiping, ""), j = g, g.style.setProperty(Z.swipeProgress, `${m}`), p > 0 && h > 0 ? g.style.setProperty(X.height, `${h}px`) : g.style.removeProperty(X.height)), d?.visualStateStore.set({
|
|
674
|
+
swipeProgress: p,
|
|
675
|
+
frontmostHeight: p > 0 ? h : 0
|
|
676
|
+
}), k = !0, u.swipeAreaActive.current = !0;
|
|
677
|
+
}
|
|
678
|
+
function pe() {
|
|
679
|
+
A && (A.style.removeProperty(X.swipeMovementX), A.style.removeProperty(X.swipeMovementY), A.removeAttribute($.swiping), M !== null && (A.style.transition = M, M = null)), j && (j.removeAttribute($.swiping), j.style.setProperty(Z.swipeProgress, "0"), j.style.removeProperty(X.height)), d?.visualStateStore.set({
|
|
680
|
+
swipeProgress: 0,
|
|
681
|
+
frontmostHeight: 0
|
|
682
|
+
}), k = !1, A = null, j = null, u.swipeAreaActive.current = !1;
|
|
683
|
+
}
|
|
684
|
+
function me(e) {
|
|
685
|
+
w = !0, c.setOpen(!0, s(r, e, y() ?? void 0));
|
|
686
|
+
}
|
|
687
|
+
function he(e) {
|
|
688
|
+
c.setOpen(!1, s(r, e, y() ?? void 0));
|
|
689
|
+
}
|
|
690
|
+
function ge() {
|
|
691
|
+
C = null, w = !1, O = null, S(!1);
|
|
692
|
+
}
|
|
693
|
+
function _e() {
|
|
694
|
+
ge(), ae(), ne(), pe();
|
|
695
|
+
}
|
|
696
|
+
let Q = te({
|
|
697
|
+
enabled: I,
|
|
698
|
+
directions: () => [P()],
|
|
699
|
+
element: y,
|
|
700
|
+
trackDrag: !1,
|
|
701
|
+
movementCssVars: {
|
|
702
|
+
x: X.swipeMovementX,
|
|
703
|
+
y: X.swipeMovementY
|
|
704
|
+
},
|
|
705
|
+
onSwipeStart(e) {
|
|
706
|
+
U(), C = e, w = !1, S(!0), ne();
|
|
707
|
+
},
|
|
708
|
+
onProgress(e, t) {
|
|
709
|
+
if (!t || !C) return;
|
|
710
|
+
D.x = t.deltaX, D.y = t.deltaY;
|
|
711
|
+
let n = P();
|
|
712
|
+
if (t.direction !== n) return;
|
|
713
|
+
let r = L(n, t.deltaX, t.deltaY);
|
|
714
|
+
!w && r < et || (!w && !c.open() && me(C), fe());
|
|
715
|
+
},
|
|
716
|
+
onRelease({ event: e, direction: t, deltaX: n, deltaY: r, releaseVelocityX: i, releaseVelocityY: a }) {
|
|
717
|
+
let o = P(), s = L(o, n, r), l = L(o, i, a), u = s >= Y();
|
|
718
|
+
return t === o && (u || l >= tt) && !_() ? c.open() || me(e) : w && c.open() && he(e), _e(), !1;
|
|
719
|
+
},
|
|
720
|
+
onCancel: _e
|
|
721
|
+
});
|
|
722
|
+
W(() => ({
|
|
723
|
+
active: x(),
|
|
724
|
+
open: c.open(),
|
|
725
|
+
mounted: i.presence.mounted(),
|
|
726
|
+
popupElement: c.track().popupElement,
|
|
727
|
+
frontmostHeight: u.frontmostHeight()
|
|
728
|
+
}), (e) => {
|
|
729
|
+
e.active && k && J(fe);
|
|
730
|
+
}), W(() => I(), (e) => {
|
|
731
|
+
e || J(() => {
|
|
732
|
+
x() && ae(), Q.reset(), ne(), pe(), ge();
|
|
733
|
+
});
|
|
734
|
+
}), ue(() => {
|
|
735
|
+
N?.(), i.outsidePressEnabled.current = !0;
|
|
736
|
+
});
|
|
737
|
+
let ye = G(() => ({
|
|
738
|
+
open: c.open(),
|
|
739
|
+
swiping: Q.swiping(),
|
|
740
|
+
swipeDirection: P(),
|
|
741
|
+
disabled: _()
|
|
742
|
+
})), be = t(e, () => ye(), (e) => (() => {
|
|
743
|
+
var t = re(Qe);
|
|
744
|
+
return H(t, e, !1), V(), t;
|
|
745
|
+
})()), xe = G(() => a(e.class, ye())), Se = G(() => T({
|
|
746
|
+
"pointer-events": I() ? void 0 : "none",
|
|
747
|
+
"touch-action": lt(P())
|
|
748
|
+
}, o(e.style, ye()))), Ce = G(() => n(ye(), st)), we = l(() => f.onPointerDown, () => (e) => {
|
|
749
|
+
e.pointerType !== "touch" && (Q.pointerHandlers.onPointerDown(e), e.cancelable && e.preventDefault());
|
|
750
|
+
}), Te = l(() => f.onPointerMove, () => (e) => {
|
|
751
|
+
e.pointerType !== "touch" && Q.pointerHandlers.onPointerMove(e);
|
|
752
|
+
}), Ee = l(() => f.onPointerUp, () => (e) => {
|
|
753
|
+
e.pointerType !== "touch" && Q.pointerHandlers.onPointerUp(e);
|
|
754
|
+
}), De = l(() => f.onPointerCancel, () => (e) => {
|
|
755
|
+
e.pointerType !== "touch" && Q.pointerHandlers.onPointerCancel(e);
|
|
756
|
+
}), Oe = l(() => f.onTouchStart, () => (e) => Q.touchHandlers.onTouchStart(e)), Ae = l(() => f.onTouchMove, () => (e) => Q.touchHandlers.onTouchMove(e)), je = l(() => f.onTouchEnd, () => (e) => Q.touchHandlers.onTouchEnd(e)), Me = l(() => f.onTouchCancel, () => (e) => Q.touchHandlers.onTouchCancel(e));
|
|
757
|
+
return B(be, ie({
|
|
758
|
+
ref: [((e) => b(e)), f.ref],
|
|
759
|
+
get id() {
|
|
760
|
+
return g();
|
|
761
|
+
},
|
|
762
|
+
role: "presentation",
|
|
763
|
+
"aria-hidden": "true",
|
|
764
|
+
get class() {
|
|
765
|
+
return xe();
|
|
766
|
+
},
|
|
767
|
+
get style() {
|
|
768
|
+
return Se();
|
|
769
|
+
},
|
|
770
|
+
onPointerDown: we,
|
|
771
|
+
onPointerMove: Te,
|
|
772
|
+
onPointerUp: Ee,
|
|
773
|
+
onPointerCancel: De,
|
|
774
|
+
onTouchStart: Oe,
|
|
775
|
+
onTouchMove: Ae,
|
|
776
|
+
onTouchEnd: je,
|
|
777
|
+
onTouchCancel: Me
|
|
778
|
+
}, Ce, p));
|
|
779
|
+
}
|
|
780
|
+
//#endregion
|
|
781
|
+
//#region src/drawer/virtual-keyboard-provider/DrawerVirtualKeyboardContext.ts
|
|
782
|
+
var ft = Symbol("DrawerVirtualKeyboardContext"), pt = oe(ft);
|
|
783
|
+
function mt() {
|
|
784
|
+
let e = Y(pt);
|
|
785
|
+
return e === ft ? void 0 : e;
|
|
786
|
+
}
|
|
787
|
+
//#endregion
|
|
788
|
+
//#region src/drawer/viewport/DrawerViewport.tsx
|
|
789
|
+
var ht = 10, gt = .5, _t = .5, vt = 300, yt = 4, bt = .2, xt = 4, St = 80, Ct = 360, wt = .1, Tt = 6, Et = 2, Dt = `[${me}]`;
|
|
790
|
+
function Ot(e) {
|
|
791
|
+
let t = E(), n = t.store, i = ke(), a = ve(), o = Ne(), d = mt(), f = e, _ = le(e, "children", "onPointerCancel", "onPointerDown", "onPointerMove", "onPointerUp", "onTouchCancel", "onTouchEnd", "onTouchStart"), v = () => n.open(), y = () => t.presence.mounted(), b = () => t.nestedOpenDrawerCount() > 0, x = () => i.swipeDirection(), S = () => x() === "left" || x() === "right" ? "horizontal" : "vertical", C = () => S() === "vertical" ? "horizontal" : "vertical", [w, T] = K(null, { ownedWrite: !0 }), D, O, k = !1, A = !1, M = "", N = !1, P = !1, I = null, ee = G(() => {
|
|
792
|
+
let e = i.snapPoints(), t = o.resolvedSnapPoints(), n = x();
|
|
793
|
+
if (!e || e.length < 2 || t.length < 2 || n !== "down" && n !== "up") return null;
|
|
794
|
+
let r = t.map((e) => e.offset).sort((e, t) => e - t);
|
|
795
|
+
return {
|
|
796
|
+
minOffset: r[0],
|
|
797
|
+
range: r[1] - r[0]
|
|
798
|
+
};
|
|
799
|
+
}), ne = G(() => {
|
|
800
|
+
let e = ee(), t = o.activeSnapPointOffset();
|
|
801
|
+
return !e || t === null ? null : z((t - e.minOffset) / e.range, 0, 1);
|
|
802
|
+
}), re = G(() => {
|
|
803
|
+
let e = i.snapPoints(), t = x();
|
|
804
|
+
return e && e.length > 0 && (t === "down" || t === "up") ? t === "down" ? ["down", "up"] : ["up", "down"] : [t];
|
|
805
|
+
});
|
|
806
|
+
function V(e) {
|
|
807
|
+
n.state.popupElement?.toggleAttribute($.swipeDismiss, e), t.backdropElement()?.toggleAttribute($.swipeDismiss, e);
|
|
808
|
+
}
|
|
809
|
+
function H() {
|
|
810
|
+
V(!1), n.state.popupElement?.removeAttribute(c.endingStyle), T(null);
|
|
811
|
+
}
|
|
812
|
+
function U() {
|
|
813
|
+
A && (A = !1, i.notifyParentSwipingChange?.(!1));
|
|
814
|
+
}
|
|
815
|
+
function ae(e, n, r) {
|
|
816
|
+
let o = v() && !t.nested && n, s = o ? e : 0, c = v() && n ? e : 0, l = i.frontmostHeight();
|
|
817
|
+
r && i.notifyParentSwipeProgressChange && (i.notifyParentSwipeProgressChange(c), c <= 0 && U()), a?.visualStateStore.set({
|
|
818
|
+
swipeProgress: s,
|
|
819
|
+
frontmostHeight: s > 0 ? l : 0
|
|
820
|
+
});
|
|
821
|
+
let u = t.backdropElement();
|
|
822
|
+
if (!u) return;
|
|
823
|
+
let d = o && s > 0;
|
|
824
|
+
u.style.setProperty(Z.swipeProgress, d ? `${s}` : "0"), d && l > 0 ? u.style.setProperty(X.height, `${l}px`) : u.style.removeProperty(X.height);
|
|
825
|
+
}
|
|
826
|
+
function oe(e, t, n, r, a, s, c, l) {
|
|
827
|
+
let u = Mt(e, t);
|
|
828
|
+
if (u <= 0) return null;
|
|
829
|
+
let d = i.snapPoints(), f = ((t === "down" || t === "up") && d && d.length > 0 ? o.activeSnapPointOffset() ?? 0 : 0) + L(t, n, r), p = Math.max(0, u - f);
|
|
830
|
+
if (p <= 0) return null;
|
|
831
|
+
let m = L(t, c, l), h = Math.abs(m) > 0 ? m : L(t, a, s);
|
|
832
|
+
if (h <= bt) return null;
|
|
833
|
+
let g = z(h, bt, xt);
|
|
834
|
+
return wt + (z(p / g, St, Ct) - St) / 280 * .9;
|
|
835
|
+
}
|
|
836
|
+
function se(e) {
|
|
837
|
+
if (A || !e) return;
|
|
838
|
+
let t = e.direction ?? x();
|
|
839
|
+
Math.abs(L(t, e.deltaX, e.deltaY)) < ht || (A = !0, i.notifyParentSwipingChange?.(!0));
|
|
840
|
+
}
|
|
841
|
+
let q = te({
|
|
842
|
+
enabled: () => y() && !b(),
|
|
843
|
+
directions: re,
|
|
844
|
+
element: () => n.track().popupElement,
|
|
845
|
+
ignoreSelectorWhenTouch: !1,
|
|
846
|
+
ignoreScrollableAncestors: !0,
|
|
847
|
+
movementCssVars: {
|
|
848
|
+
x: X.swipeMovementX,
|
|
849
|
+
y: X.swipeMovementY
|
|
850
|
+
},
|
|
851
|
+
swipeThreshold: ({ element: e, direction: t }) => Nt(e, t),
|
|
852
|
+
onSwipeStart(e) {
|
|
853
|
+
if ("touches" in e || e.pointerType === "touch") return;
|
|
854
|
+
let t = n.state.popupElement, r = h(t).getSelection?.();
|
|
855
|
+
if (!r || r.isCollapsed) return;
|
|
856
|
+
let i = u(r.anchorNode) ? r.anchorNode : r.anchorNode?.parentElement, a = u(r.focusNode) ? r.focusNode : r.focusNode?.parentElement;
|
|
857
|
+
!m(t, i) && !m(t, a) || r.removeAllRanges();
|
|
858
|
+
},
|
|
859
|
+
onSwipingChange(e) {
|
|
860
|
+
k = e, kt(t.backdropElement(), e), !e && !i.notifyParentSwipeProgressChange && U();
|
|
861
|
+
},
|
|
862
|
+
canStart(e, t) {
|
|
863
|
+
let r = n.state.popupElement;
|
|
864
|
+
if (!r) return !1;
|
|
865
|
+
let i = R(r.getRootNode(), e.x, e.y);
|
|
866
|
+
if (!i || !m(r, i)) return !1;
|
|
867
|
+
let a = t.nativeEvent;
|
|
868
|
+
return !(("touches" in a || a.pointerType === "touch") && Lt(r.ownerDocument, r));
|
|
869
|
+
},
|
|
870
|
+
onProgress(e, t) {
|
|
871
|
+
k && se(t);
|
|
872
|
+
let r = i.snapPoints(), a = !!(r && r.length > 0);
|
|
873
|
+
if (k && x() === "down" && a && t) {
|
|
874
|
+
let e = n.state.popupElement;
|
|
875
|
+
e && (e.style.removeProperty("transform"), e.style.setProperty(X.swipeMovementY, `${Ae(o.activeSnapPointOffset() ?? 0, t.deltaY)}px`));
|
|
876
|
+
}
|
|
877
|
+
let s = e, c = ee(), l = o.popupHeight();
|
|
878
|
+
if (c && l > 0) {
|
|
879
|
+
let e = o.activeSnapPointOffset() ?? c.minOffset, n = (e) => z((e - c.minOffset) / c.range, 0, 1);
|
|
880
|
+
if (k && t && Number.isFinite(t.deltaY)) s = n(z(e + t.deltaY, 0, l));
|
|
881
|
+
else {
|
|
882
|
+
let e = ne();
|
|
883
|
+
e !== null && (s = e);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
k || (i.notifyParentSwipeProgressChange?.(0), U()), ae(s, !0, k);
|
|
887
|
+
},
|
|
888
|
+
onRelease({ event: e, deltaX: t, deltaY: a, direction: l, velocityX: u, velocityY: d, releaseVelocityX: f, releaseVelocityY: p }) {
|
|
889
|
+
let m = n.state.popupElement;
|
|
890
|
+
if (!m) {
|
|
891
|
+
H();
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
function h(e) {
|
|
895
|
+
U(), V(!0), m.style.removeProperty("transition"), m.setAttribute(c.endingStyle, ""), T(oe(m, e, t, a, u, d, f, p)), ce();
|
|
896
|
+
}
|
|
897
|
+
let g = i.snapPoints(), _ = x();
|
|
898
|
+
if (!g || g.length === 0) {
|
|
899
|
+
if (!l) {
|
|
900
|
+
H();
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
let e = L(l, t, a);
|
|
904
|
+
if (e <= 0) return H(), !1;
|
|
905
|
+
if (L(l, u, d) >= gt) return h(l), !0;
|
|
906
|
+
let n = e > Nt(m, l);
|
|
907
|
+
return n ? h(l) : H(), n;
|
|
908
|
+
}
|
|
909
|
+
if (_ !== "down" && _ !== "up") {
|
|
910
|
+
H();
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
let v = o.popupHeight();
|
|
914
|
+
if (!v) return H(), !1;
|
|
915
|
+
let y = o.resolvedSnapPoints();
|
|
916
|
+
if (y.length === 0) {
|
|
917
|
+
H();
|
|
918
|
+
return;
|
|
919
|
+
}
|
|
920
|
+
let b = _ === "down" ? a : -a, S = Math.sign(b), C = _ === "down" ? p : -p, w = _ === "down" ? d : -d, E = C;
|
|
921
|
+
if (S !== 0 && Math.abs(b) >= ht) {
|
|
922
|
+
let e = Math.sign(E);
|
|
923
|
+
e !== 0 && e !== S && (E = w);
|
|
924
|
+
}
|
|
925
|
+
let O = o.activeSnapPointOffset() ?? 0, k = z(O + b, 0, v), A = Math.abs(E) >= _t ? z(E, -4, yt) * vt : 0, j = i.snapToSequentialPoints() ? k : z(k + A, 0, v), M = s(r, e), N = () => (ae(0, !0, !0), H(), !1), P = (e) => (i.setActiveSnapPoint(e.value, M), N()), F = (e) => {
|
|
926
|
+
if (!l) return P(e);
|
|
927
|
+
let t = o.activeSnapPoint();
|
|
928
|
+
return i.setActiveSnapPoint(null, M), M.isCanceled ? N() : (D = t, h(_), !0);
|
|
929
|
+
};
|
|
930
|
+
if (i.snapToSequentialPoints()) {
|
|
931
|
+
let e = [...y].sort((e, t) => e.offset - t.offset), t = e.map((e) => e.offset), n = Me(t, O), r = e[Me(t, j)], i = Math.sign(E), a = S !== 0 && i !== 0 && i === S && Math.abs(E) >= _t, o = j;
|
|
932
|
+
if (a) {
|
|
933
|
+
let t = z(n + S, 0, e.length - 1);
|
|
934
|
+
if (t !== n) {
|
|
935
|
+
let n = e[t];
|
|
936
|
+
(S > 0 ? j < n.offset : j > n.offset) && (r = n, o = n.offset);
|
|
937
|
+
} else if (S > 0) return F(r);
|
|
938
|
+
}
|
|
939
|
+
return Math.abs(o - v) < Math.abs(o - r.offset) ? F(r) : P(r);
|
|
940
|
+
}
|
|
941
|
+
let I = y[Me(y.map((e) => e.offset), j)], ee = Math.abs(j - v);
|
|
942
|
+
return E >= gt && b > 0 || ee < Math.abs(j - I.offset) ? F(I) : P(I);
|
|
943
|
+
},
|
|
944
|
+
onDismiss(e) {
|
|
945
|
+
a?.visualStateStore.set({
|
|
946
|
+
swipeProgress: 0,
|
|
947
|
+
frontmostHeight: 0
|
|
948
|
+
});
|
|
949
|
+
let o = t.backdropElement();
|
|
950
|
+
o && (o.style.setProperty(Z.swipeProgress, "0"), o.style.removeProperty(X.height));
|
|
951
|
+
let c = s(r, e);
|
|
952
|
+
if (n.setOpen(!1, c), c.isCanceled) {
|
|
953
|
+
D !== void 0 && i.setActiveSnapPoint(D, s(r, e)), D = void 0, q.reset(), H();
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
if (n.open()) {
|
|
957
|
+
let t = e;
|
|
958
|
+
O = requestAnimationFrame(() => {
|
|
959
|
+
O = void 0, n.open() ? (D !== void 0 && i.setActiveSnapPoint(D, s(r, t)), D = void 0, H(), q.reset()) : D = void 0;
|
|
960
|
+
});
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
D = void 0, V(!0);
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
W(() => ({
|
|
967
|
+
mounted: y(),
|
|
968
|
+
nestedDrawerOpen: b(),
|
|
969
|
+
open: v(),
|
|
970
|
+
rootElement: t.viewportElement() ?? n.track().popupElement,
|
|
971
|
+
axis: S(),
|
|
972
|
+
direction: x()
|
|
973
|
+
}), (e) => {
|
|
974
|
+
let t = e.rootElement;
|
|
975
|
+
if (!t) return;
|
|
976
|
+
let n = e.axis === "vertical", r = h(t);
|
|
977
|
+
function i(i, a, o) {
|
|
978
|
+
let s = n ? o.clientY - a.lastY : o.clientX - a.lastX;
|
|
979
|
+
if (i.touches.length === 2 || Lt(r, t) || !e.open || !e.mounted || e.nestedDrawerOpen || zt(a, i, o, n)) return;
|
|
980
|
+
let c = a.scrollTarget;
|
|
981
|
+
if (!c || c === r.documentElement || c === r.body) {
|
|
982
|
+
i.cancelable && i.preventDefault(), i.stopPropagation(), q.moveNative(i, t);
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
if (!Bt(c, e.axis)) {
|
|
986
|
+
i.cancelable && i.preventDefault(), i.stopPropagation();
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
989
|
+
if (s !== 0) {
|
|
990
|
+
let t = Ut(c, e.axis, e.direction, s);
|
|
991
|
+
a.allowSwipe ? i.cancelable && i.preventDefault() : i.cancelable && t ? (a.allowSwipe = !0, i.preventDefault()) : a.allowSwipe = !1;
|
|
992
|
+
}
|
|
993
|
+
a.allowSwipe === !0 && (i.stopPropagation(), q.moveNative(i, t));
|
|
994
|
+
}
|
|
995
|
+
function a(e) {
|
|
996
|
+
if (d?.onTouchMove(e), P) return;
|
|
997
|
+
let t = e.touches[0];
|
|
998
|
+
!t || !I || (i(e, I, t), I.lastX = t.clientX, I.lastY = t.clientY);
|
|
999
|
+
}
|
|
1000
|
+
return r.addEventListener("touchmove", a, {
|
|
1001
|
+
passive: !1,
|
|
1002
|
+
capture: !0
|
|
1003
|
+
}), () => r.removeEventListener("touchmove", a, { capture: !0 });
|
|
1004
|
+
}), W(() => ({
|
|
1005
|
+
range: ee(),
|
|
1006
|
+
swiping: q.swiping(),
|
|
1007
|
+
open: v(),
|
|
1008
|
+
nested: t.nested,
|
|
1009
|
+
progress: ne(),
|
|
1010
|
+
frontmostHeight: i.frontmostHeight()
|
|
1011
|
+
}), (e) => {
|
|
1012
|
+
!e.range || e.swiping || J(() => ae(!e.open || e.nested ? 0 : e.progress ?? 0, !0, !1));
|
|
1013
|
+
}), W(() => v(), (e) => {
|
|
1014
|
+
if (i.notifyParentSwipeProgressChange) return e || i.notifyParentSwipeProgressChange(0), () => i.notifyParentSwipeProgressChange?.(0);
|
|
1015
|
+
}), W(() => v(), (e) => {
|
|
1016
|
+
e && J(() => {
|
|
1017
|
+
i.swipeAreaActive.current || q.reset(), H();
|
|
1018
|
+
});
|
|
1019
|
+
}), ue(() => {
|
|
1020
|
+
O !== void 0 && cancelAnimationFrame(O), a?.visualStateStore.set({
|
|
1021
|
+
swipeProgress: 0,
|
|
1022
|
+
frontmostHeight: 0
|
|
1023
|
+
}), kt(t.backdropElement(), !1), U();
|
|
1024
|
+
});
|
|
1025
|
+
let de = {
|
|
1026
|
+
swiping: q.swiping,
|
|
1027
|
+
getDragStyles: q.getDragStyles,
|
|
1028
|
+
swipeStrength: w,
|
|
1029
|
+
setSwipeDismissed: V
|
|
1030
|
+
};
|
|
1031
|
+
function Y(e) {
|
|
1032
|
+
P = e, I = null;
|
|
1033
|
+
}
|
|
1034
|
+
function fe() {
|
|
1035
|
+
Y(!1), M = "", N = !1;
|
|
1036
|
+
}
|
|
1037
|
+
function pe(e) {
|
|
1038
|
+
return M = "", e.pointerType !== "touch";
|
|
1039
|
+
}
|
|
1040
|
+
let me = l(() => f.onPointerDown, () => (e) => {
|
|
1041
|
+
if (M = e.pointerType, N = e.pointerType === "pen", !v() || !y() || b()) return;
|
|
1042
|
+
let t = e.currentTarget, n = R(t.getRootNode(), e.clientX, e.clientY);
|
|
1043
|
+
At(n) || jt(n) || e.pointerType !== "touch" && q.pointerHandlers.onPointerDown(e);
|
|
1044
|
+
}), he = l(() => f.onPointerMove, () => (e) => {
|
|
1045
|
+
e.pointerType !== "touch" && q.pointerHandlers.onPointerMove(e);
|
|
1046
|
+
}), ge = l(() => f.onPointerUp, () => (e) => {
|
|
1047
|
+
pe(e) && q.pointerHandlers.onPointerUp(e);
|
|
1048
|
+
}), _e = l(() => f.onPointerCancel, () => (e) => {
|
|
1049
|
+
pe(e) && q.pointerHandlers.onPointerCancel(e);
|
|
1050
|
+
}), Q = l(() => f.onTouchStart, () => (e) => {
|
|
1051
|
+
if (M === "pen" && N) {
|
|
1052
|
+
N = !1, Y(!1);
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
if (!v() || !y() || b()) {
|
|
1056
|
+
Y(!1);
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
let t = e.touches[0];
|
|
1060
|
+
if (!t) return;
|
|
1061
|
+
let n = e.currentTarget;
|
|
1062
|
+
if (Rt(e, p(n))) {
|
|
1063
|
+
Y(!1);
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
let r = R(n.getRootNode(), t.clientX, t.clientY), i = g(e), a = u(i) ? i : n;
|
|
1067
|
+
if (!m(n, a)) {
|
|
1068
|
+
Y(!0);
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
if (d?.onTouchStart(e), At(r)) {
|
|
1072
|
+
Y(!0);
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
P = !1;
|
|
1076
|
+
let o = S(), s = F(a, n, o), c = F(a, n, C()) != null, l = null;
|
|
1077
|
+
s && (l = Ht(s, o, x()) ? null : !1), I = {
|
|
1078
|
+
startX: t.clientX,
|
|
1079
|
+
startY: t.clientY,
|
|
1080
|
+
lastX: t.clientX,
|
|
1081
|
+
lastY: t.clientY,
|
|
1082
|
+
scrollTarget: s,
|
|
1083
|
+
hasCrossAxisScrollableContent: c,
|
|
1084
|
+
allowSwipe: l,
|
|
1085
|
+
preserveNativeCrossAxisScroll: !1,
|
|
1086
|
+
drawerAxisAttributed: !1
|
|
1087
|
+
}, q.touchHandlers.onTouchStart(e);
|
|
1088
|
+
}), ye = l(() => f.onTouchEnd, () => (e) => {
|
|
1089
|
+
d?.onTouchEnd(e), fe(), q.touchHandlers.onTouchEnd(e);
|
|
1090
|
+
}), be = l(() => f.onTouchCancel, () => (e) => {
|
|
1091
|
+
d?.onTouchCancel(), fe(), q.touchHandlers.onTouchCancel(e);
|
|
1092
|
+
});
|
|
1093
|
+
return B(j, ie(_, {
|
|
1094
|
+
onPointerDown: me,
|
|
1095
|
+
onPointerMove: he,
|
|
1096
|
+
onPointerUp: ge,
|
|
1097
|
+
onPointerCancel: _e,
|
|
1098
|
+
onTouchStart: Q,
|
|
1099
|
+
onTouchEnd: ye,
|
|
1100
|
+
onTouchCancel: be,
|
|
1101
|
+
"data-nested-dialog-open": void 0,
|
|
1102
|
+
get children() {
|
|
1103
|
+
return B(Fe, {
|
|
1104
|
+
value: de,
|
|
1105
|
+
get children() {
|
|
1106
|
+
return e.children;
|
|
1107
|
+
}
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
}));
|
|
1111
|
+
}
|
|
1112
|
+
function kt(e, t) {
|
|
1113
|
+
e?.toggleAttribute($.swiping, t);
|
|
1114
|
+
}
|
|
1115
|
+
function At(e) {
|
|
1116
|
+
return !!e?.closest(ne);
|
|
1117
|
+
}
|
|
1118
|
+
function jt(e) {
|
|
1119
|
+
return !!e?.closest(Dt);
|
|
1120
|
+
}
|
|
1121
|
+
function Mt(e, t) {
|
|
1122
|
+
return t === "left" || t === "right" ? e.offsetWidth : e.offsetHeight;
|
|
1123
|
+
}
|
|
1124
|
+
function Nt(e, t) {
|
|
1125
|
+
return Math.max(Mt(e, t) * .5, ht);
|
|
1126
|
+
}
|
|
1127
|
+
function Pt(e, t) {
|
|
1128
|
+
return e instanceof t.HTMLInputElement && e.type === "range";
|
|
1129
|
+
}
|
|
1130
|
+
function Ft(e) {
|
|
1131
|
+
return e.tagName === "INPUT" || e.tagName === "TEXTAREA";
|
|
1132
|
+
}
|
|
1133
|
+
function It(e, t) {
|
|
1134
|
+
let n = u(e.anchorNode) ? e.anchorNode : e.anchorNode?.parentElement, r = u(e.focusNode) ? e.focusNode : e.focusNode?.parentElement;
|
|
1135
|
+
return e.containsNode(t, !0) || m(t, n) || m(t, r);
|
|
1136
|
+
}
|
|
1137
|
+
function Lt(e, t) {
|
|
1138
|
+
let n = _(e);
|
|
1139
|
+
if (n && m(t, n) && Ft(n)) {
|
|
1140
|
+
let { selectionStart: e, selectionEnd: t } = n;
|
|
1141
|
+
if (e != null && t != null && e < t) return !0;
|
|
1142
|
+
}
|
|
1143
|
+
let r = e.getSelection?.();
|
|
1144
|
+
return !r || r.isCollapsed ? !1 : It(r, t);
|
|
1145
|
+
}
|
|
1146
|
+
function Rt(e, t) {
|
|
1147
|
+
return e.composedPath().some((e) => Pt(e, t));
|
|
1148
|
+
}
|
|
1149
|
+
function zt(e, t, n, r) {
|
|
1150
|
+
if (e.preserveNativeCrossAxisScroll) return !0;
|
|
1151
|
+
if (e.drawerAxisAttributed || e.allowSwipe === !0 || !e.hasCrossAxisScrollableContent) return !1;
|
|
1152
|
+
if (!t.cancelable) return e.preserveNativeCrossAxisScroll = !0, !0;
|
|
1153
|
+
let i = r ? n.clientY - e.startY : n.clientX - e.startX, a = r ? n.clientX - e.startX : n.clientY - e.startY, o = Math.abs(i), s = Math.abs(a);
|
|
1154
|
+
return s >= Tt && s > o + Et ? (e.preserveNativeCrossAxisScroll = !0, !0) : o >= Tt ? (e.drawerAxisAttributed = !0, !1) : !0;
|
|
1155
|
+
}
|
|
1156
|
+
function Bt(e, t) {
|
|
1157
|
+
return Vt(e, t).max > 0;
|
|
1158
|
+
}
|
|
1159
|
+
function Vt(e, t) {
|
|
1160
|
+
return t === "vertical" ? {
|
|
1161
|
+
offset: e.scrollTop,
|
|
1162
|
+
max: Math.max(0, e.scrollHeight - e.clientHeight)
|
|
1163
|
+
} : {
|
|
1164
|
+
offset: e.scrollLeft,
|
|
1165
|
+
max: Math.max(0, e.scrollWidth - e.clientWidth)
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
function Ht(e, t, n) {
|
|
1169
|
+
let r = Wt(n, t), { offset: i, max: a } = Vt(e, t);
|
|
1170
|
+
return r ? i <= 0 : i >= a;
|
|
1171
|
+
}
|
|
1172
|
+
function Ut(e, t, n, r) {
|
|
1173
|
+
return (Wt(n, t) ? r > 0 : r < 0) && Ht(e, t, n);
|
|
1174
|
+
}
|
|
1175
|
+
function Wt(e, t) {
|
|
1176
|
+
return t === "vertical" ? e === "down" : e === "right";
|
|
1177
|
+
}
|
|
1178
|
+
//#endregion
|
|
1179
|
+
//#region src/drawer/viewport/DrawerViewportCssVars.ts
|
|
1180
|
+
var Gt = /* @__PURE__ */ function(e) {
|
|
1181
|
+
return e.keyboardInset = "--drawer-keyboard-inset", e;
|
|
1182
|
+
}({}), Kt = 60, qt = 16, Jt = 48, Yt = 150, Xt = 4, Zt = 60, Qt = 10, $t = 16, en = /* @__PURE__ */ new Set([
|
|
1183
|
+
"email",
|
|
1184
|
+
"number",
|
|
1185
|
+
"password",
|
|
1186
|
+
"search",
|
|
1187
|
+
"tel",
|
|
1188
|
+
"text",
|
|
1189
|
+
"url"
|
|
1190
|
+
]), tn = Symbol("KeyboardTapBlocked");
|
|
1191
|
+
function nn(e) {
|
|
1192
|
+
let t = E(), n = t.store, r = !1, i = null, a = null, o = null, s = !1, c, l;
|
|
1193
|
+
function u() {
|
|
1194
|
+
c !== void 0 && (cancelAnimationFrame(c), c = void 0);
|
|
1195
|
+
}
|
|
1196
|
+
function d() {
|
|
1197
|
+
l !== void 0 && (clearTimeout(l), l = void 0);
|
|
1198
|
+
}
|
|
1199
|
+
function f() {
|
|
1200
|
+
let e = o;
|
|
1201
|
+
e && (e.element.style.overflowAnchor = e.overflowAnchor, e.element.style.paddingBottom = e.paddingBottom, e.element.style.scrollPaddingBottom = e.scrollPaddingBottom, o = null);
|
|
1202
|
+
}
|
|
1203
|
+
function v(e, t) {
|
|
1204
|
+
let n = Math.max(0, Math.ceil(t)), r = o;
|
|
1205
|
+
if (r && !r.element.isConnected && (f(), r = null), n === 0) {
|
|
1206
|
+
f();
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1209
|
+
if (r && r.element !== e && (f(), r = null), !r) {
|
|
1210
|
+
let t = p(e).getComputedStyle(e);
|
|
1211
|
+
r = {
|
|
1212
|
+
element: e,
|
|
1213
|
+
overflowAnchor: e.style.overflowAnchor,
|
|
1214
|
+
paddingBottom: e.style.paddingBottom,
|
|
1215
|
+
scrollPaddingBottom: e.style.scrollPaddingBottom,
|
|
1216
|
+
computedPaddingBottom: Number.parseFloat(t.paddingBottom) || 0,
|
|
1217
|
+
computedScrollPaddingBottom: Number.parseFloat(t.scrollPaddingBottom) || 0
|
|
1218
|
+
}, o = r;
|
|
1219
|
+
}
|
|
1220
|
+
e.style.overflowAnchor = "none", e.style.paddingBottom = `${r.computedPaddingBottom + n}px`, e.style.scrollPaddingBottom = `${r.computedScrollPaddingBottom + qt}px`;
|
|
1221
|
+
}
|
|
1222
|
+
function y(e, t) {
|
|
1223
|
+
let n = p(e).matchMedia?.("(prefers-reduced-motion: reduce)")?.matches ? "auto" : "smooth";
|
|
1224
|
+
e.scrollTo({
|
|
1225
|
+
top: t,
|
|
1226
|
+
behavior: n
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
function b() {
|
|
1230
|
+
r = !1, i = null;
|
|
1231
|
+
}
|
|
1232
|
+
W(() => ({
|
|
1233
|
+
mounted: t.presence.mounted(),
|
|
1234
|
+
open: n.open(),
|
|
1235
|
+
modal: t.modal(),
|
|
1236
|
+
nestedDrawerOpen: t.nestedOpenDialogCount() > 0,
|
|
1237
|
+
rootElement: t.viewportElement()
|
|
1238
|
+
}), (e) => {
|
|
1239
|
+
if (!e.mounted || !e.open) {
|
|
1240
|
+
a = null, f(), u();
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
let t = e.rootElement;
|
|
1244
|
+
if (!t) {
|
|
1245
|
+
f();
|
|
1246
|
+
return;
|
|
1247
|
+
}
|
|
1248
|
+
let n = h(t), r = p(t), i = r.visualViewport, o = e.nestedDrawerOpen, b = null, x = 0, S = 0, C = -1;
|
|
1249
|
+
function w(e) {
|
|
1250
|
+
t.style.setProperty(Gt.keyboardInset, `${Math.max(0, Math.ceil(e))}px`);
|
|
1251
|
+
}
|
|
1252
|
+
function T() {
|
|
1253
|
+
a = null, b = null, w(0), f(), u(), d();
|
|
1254
|
+
}
|
|
1255
|
+
let E = r.scrollX, D = r.scrollY;
|
|
1256
|
+
function O() {
|
|
1257
|
+
return e.modal !== !0 || o || !a || pn(r) == null ? !1 : r.scrollX !== E || r.scrollY !== D ? (r.scrollTo({
|
|
1258
|
+
left: E,
|
|
1259
|
+
top: D,
|
|
1260
|
+
behavior: "instant"
|
|
1261
|
+
}), !0) : !1;
|
|
1262
|
+
}
|
|
1263
|
+
let k = null;
|
|
1264
|
+
function A() {
|
|
1265
|
+
k?.(), k = null;
|
|
1266
|
+
}
|
|
1267
|
+
function j(e, t) {
|
|
1268
|
+
A();
|
|
1269
|
+
let n = e.getBoundingClientRect();
|
|
1270
|
+
k = dn(e, (t.top + t.bottom - n.top - n.bottom) / 2);
|
|
1271
|
+
}
|
|
1272
|
+
function M() {
|
|
1273
|
+
c = void 0, A();
|
|
1274
|
+
let e = a;
|
|
1275
|
+
if (o || !e || !m(t, e)) {
|
|
1276
|
+
w(0), f();
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1279
|
+
O();
|
|
1280
|
+
let n = pn(r);
|
|
1281
|
+
if (!n) {
|
|
1282
|
+
w(0), f();
|
|
1283
|
+
return;
|
|
1284
|
+
}
|
|
1285
|
+
w(Math.max(0, r.innerHeight - n.bottom));
|
|
1286
|
+
let i = fn(e, t);
|
|
1287
|
+
if (!i) {
|
|
1288
|
+
f();
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
let s = i.getBoundingClientRect(), l = Math.min(s.bottom, n.bottom), u = Math.max(0, s.bottom - n.bottom);
|
|
1292
|
+
v(i, u > 0 ? u + Jt : 0);
|
|
1293
|
+
let d = Math.max(0, i.scrollHeight - i.clientHeight);
|
|
1294
|
+
if (d <= 0) return;
|
|
1295
|
+
let p = Math.max(s.top, n.top) + qt, h = l - qt;
|
|
1296
|
+
if (h <= p) return;
|
|
1297
|
+
let g = e.getBoundingClientRect(), _ = i.scrollTop + (g.top + g.bottom - p - h) / 2, T = Math.round(z(_, 0, d));
|
|
1298
|
+
if (!(b === i && Math.abs(x - T) <= 1)) {
|
|
1299
|
+
let e = b === i ? S + 1 : 1;
|
|
1300
|
+
if (b = i, x = T, S = e, C = -1, e <= Zt) {
|
|
1301
|
+
N();
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1304
|
+
} else if (C >= 0) {
|
|
1305
|
+
let e = i.scrollTop;
|
|
1306
|
+
if (Math.abs(e - T) <= 1) return;
|
|
1307
|
+
if (e !== C) {
|
|
1308
|
+
C = e;
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
b = i, x = T, S = 0, C = i.scrollTop, y(i, T);
|
|
1313
|
+
}
|
|
1314
|
+
function N() {
|
|
1315
|
+
u(), c = requestAnimationFrame(M);
|
|
1316
|
+
}
|
|
1317
|
+
function P() {
|
|
1318
|
+
let e = Xt, t = () => {
|
|
1319
|
+
l = void 0, M(), --e, e > 0 && (l = setTimeout(t, Yt));
|
|
1320
|
+
};
|
|
1321
|
+
d(), l = setTimeout(t, Yt);
|
|
1322
|
+
}
|
|
1323
|
+
function F(e) {
|
|
1324
|
+
if (o) return !1;
|
|
1325
|
+
let n = an(e);
|
|
1326
|
+
return !n || !m(t, n) ? !1 : (a !== n && (b = null), a = n, !0);
|
|
1327
|
+
}
|
|
1328
|
+
function I(e) {
|
|
1329
|
+
if (s = !1, A(), !F(g(e))) {
|
|
1330
|
+
T();
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1333
|
+
pn(r) != null && P(), N();
|
|
1334
|
+
}
|
|
1335
|
+
function ee(e) {
|
|
1336
|
+
if (!s) {
|
|
1337
|
+
if (F(e.relatedTarget)) {
|
|
1338
|
+
let e = a, t = pn(r);
|
|
1339
|
+
e && t && j(e, t), N();
|
|
1340
|
+
return;
|
|
1341
|
+
}
|
|
1342
|
+
T();
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
function L() {
|
|
1346
|
+
(a || F(_(n))) && N();
|
|
1347
|
+
}
|
|
1348
|
+
function R() {
|
|
1349
|
+
O() && N();
|
|
1350
|
+
}
|
|
1351
|
+
function te() {
|
|
1352
|
+
u(), d(), b = null;
|
|
1353
|
+
}
|
|
1354
|
+
return i?.addEventListener("resize", L), i?.addEventListener("scroll", L), n.addEventListener("focusin", I, !0), n.addEventListener("focusout", ee, !0), r.addEventListener("scroll", R), n.addEventListener("pointerdown", te, !0), F(_(n)) && N(), () => {
|
|
1355
|
+
i?.removeEventListener("resize", L), i?.removeEventListener("scroll", L), n.removeEventListener("focusin", I, !0), n.removeEventListener("focusout", ee, !0), r.removeEventListener("scroll", R), n.removeEventListener("pointerdown", te, !0), A(), T(), t.style.removeProperty(Gt.keyboardInset);
|
|
1356
|
+
};
|
|
1357
|
+
});
|
|
1358
|
+
function x(e) {
|
|
1359
|
+
let t = e.touches[0];
|
|
1360
|
+
r = !1, i = t ? {
|
|
1361
|
+
x: t.clientX,
|
|
1362
|
+
y: t.clientY
|
|
1363
|
+
} : null;
|
|
1364
|
+
}
|
|
1365
|
+
function S(e) {
|
|
1366
|
+
let t = e.touches[0];
|
|
1367
|
+
!t || !i || r || (Math.abs(t.clientX - i.x) > Qt || Math.abs(t.clientY - i.y) > Qt) && (r = !0);
|
|
1368
|
+
}
|
|
1369
|
+
function C(e) {
|
|
1370
|
+
let a = t.viewportElement();
|
|
1371
|
+
if (!n.open() || !t.presence.mounted() || t.nestedOpenDialogCount() > 0 || !a || !i || r) {
|
|
1372
|
+
b();
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
let o = e.changedTouches[0] ?? e.touches[0], c = a.getRootNode(), l = o ? cn(c, o.clientX, o.clientY) : null;
|
|
1376
|
+
if (l === tn) {
|
|
1377
|
+
b();
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1380
|
+
let u = o && (l ?? on(g(e)));
|
|
1381
|
+
if (u && (!m(a, u.focusTarget) || !m(a, u.clickTarget))) {
|
|
1382
|
+
b();
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
if (u) {
|
|
1386
|
+
let { clickTarget: t, focusTarget: n } = u, r = p(n);
|
|
1387
|
+
if (r.visualViewport && r.visualViewport.scale !== 1) {
|
|
1388
|
+
b();
|
|
1389
|
+
return;
|
|
1390
|
+
}
|
|
1391
|
+
if (_(h(n)) === n && (!r.visualViewport || pn(r) != null)) {
|
|
1392
|
+
b();
|
|
1393
|
+
return;
|
|
1394
|
+
}
|
|
1395
|
+
e.preventDefault(), s = !0;
|
|
1396
|
+
try {
|
|
1397
|
+
un(n);
|
|
1398
|
+
} finally {
|
|
1399
|
+
s = !1;
|
|
1400
|
+
}
|
|
1401
|
+
ln(t, o), b();
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
b();
|
|
1405
|
+
}
|
|
1406
|
+
return B(pt, {
|
|
1407
|
+
value: {
|
|
1408
|
+
onTouchStart: x,
|
|
1409
|
+
onTouchMove: S,
|
|
1410
|
+
onTouchEnd: C,
|
|
1411
|
+
onTouchCancel: b
|
|
1412
|
+
},
|
|
1413
|
+
get children() {
|
|
1414
|
+
return e.children;
|
|
1415
|
+
}
|
|
1416
|
+
});
|
|
1417
|
+
}
|
|
1418
|
+
function rn(e) {
|
|
1419
|
+
if (e.isContentEditable) return !0;
|
|
1420
|
+
let t = p(e);
|
|
1421
|
+
return e instanceof t.HTMLTextAreaElement || e instanceof t.HTMLInputElement && en.has(e.type) ? !e.matches(":disabled") : !1;
|
|
1422
|
+
}
|
|
1423
|
+
function an(e) {
|
|
1424
|
+
if (!d(e)) return null;
|
|
1425
|
+
if (rn(e)) return e.isContentEditable ? sn(e) : e;
|
|
1426
|
+
let t = e.closest("label")?.control ?? null;
|
|
1427
|
+
return d(t) && rn(t) ? t : null;
|
|
1428
|
+
}
|
|
1429
|
+
function on(e) {
|
|
1430
|
+
if (!d(e)) return null;
|
|
1431
|
+
let t = an(e);
|
|
1432
|
+
return t ? {
|
|
1433
|
+
focusTarget: t,
|
|
1434
|
+
clickTarget: e
|
|
1435
|
+
} : null;
|
|
1436
|
+
}
|
|
1437
|
+
function sn(e) {
|
|
1438
|
+
let t = e;
|
|
1439
|
+
for (; t.parentElement?.isContentEditable;) t = t.parentElement;
|
|
1440
|
+
return t;
|
|
1441
|
+
}
|
|
1442
|
+
function cn(e, t, n) {
|
|
1443
|
+
let r = R(e, t, n);
|
|
1444
|
+
if (d(r)) {
|
|
1445
|
+
let e = an(r);
|
|
1446
|
+
if (e) return {
|
|
1447
|
+
focusTarget: e,
|
|
1448
|
+
clickTarget: r
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
if (f(r) || r?.closest("label") != null) return tn;
|
|
1452
|
+
for (let [r, i] of [
|
|
1453
|
+
[0, $t],
|
|
1454
|
+
[0, -16],
|
|
1455
|
+
[$t, 0],
|
|
1456
|
+
[-16, 0]
|
|
1457
|
+
]) {
|
|
1458
|
+
let a = an(R(e, t + r, n + i));
|
|
1459
|
+
if (a) return {
|
|
1460
|
+
focusTarget: a,
|
|
1461
|
+
clickTarget: a
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
return null;
|
|
1465
|
+
}
|
|
1466
|
+
function ln(e, t) {
|
|
1467
|
+
let n = p(e), r = n.PointerEvent ?? n.MouseEvent, i = {
|
|
1468
|
+
bubbles: !0,
|
|
1469
|
+
cancelable: !0,
|
|
1470
|
+
clientX: t.clientX,
|
|
1471
|
+
clientY: t.clientY,
|
|
1472
|
+
detail: 1
|
|
1473
|
+
}, a;
|
|
1474
|
+
try {
|
|
1475
|
+
a = new r("click", {
|
|
1476
|
+
...i,
|
|
1477
|
+
view: n
|
|
1478
|
+
});
|
|
1479
|
+
} catch {
|
|
1480
|
+
a = new r("click", i);
|
|
1481
|
+
}
|
|
1482
|
+
e.dispatchEvent(a);
|
|
1483
|
+
}
|
|
1484
|
+
function un(e) {
|
|
1485
|
+
let t = _(h(e)) === e, n = dn(e, -2e3);
|
|
1486
|
+
try {
|
|
1487
|
+
t && e.blur(), e.focus({ preventScroll: !0 });
|
|
1488
|
+
} finally {
|
|
1489
|
+
n();
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
function dn(e, t) {
|
|
1493
|
+
let n = e.style.opacity, r = e.style.transform, i = e.style.transition;
|
|
1494
|
+
return e.style.transition = "none", e.style.opacity = "0", e.style.transform = `translateY(${t}px)`, () => {
|
|
1495
|
+
e.style.opacity = n, e.style.transform = r, e.style.transition = i;
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
function fn(e, t) {
|
|
1499
|
+
let n = P(e);
|
|
1500
|
+
return F(n, t, "vertical") ?? F(n, t, "vertical", !0);
|
|
1501
|
+
}
|
|
1502
|
+
function pn(e) {
|
|
1503
|
+
let t = e.visualViewport;
|
|
1504
|
+
if (!t || t.scale !== 1 || e.innerHeight - t.height <= Kt) return null;
|
|
1505
|
+
let n = Math.max(0, t.offsetTop);
|
|
1506
|
+
return {
|
|
1507
|
+
top: n,
|
|
1508
|
+
bottom: Math.min(e.innerHeight, n + t.height)
|
|
1509
|
+
};
|
|
1510
|
+
}
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region src/drawer/handle.ts
|
|
1513
|
+
var mn = class extends N {};
|
|
1514
|
+
function hn() {
|
|
1515
|
+
return new mn();
|
|
1516
|
+
}
|
|
1517
|
+
//#endregion
|
|
1518
|
+
//#region src/drawer/index.parts.ts
|
|
1519
|
+
var gn = /* @__PURE__ */ e({
|
|
1520
|
+
Backdrop: () => pe,
|
|
1521
|
+
Close: () => O,
|
|
1522
|
+
Content: () => ge,
|
|
1523
|
+
Description: () => C,
|
|
1524
|
+
Handle: () => mn,
|
|
1525
|
+
Indent: () => Ee,
|
|
1526
|
+
IndentBackground: () => we,
|
|
1527
|
+
Popup: () => Ke,
|
|
1528
|
+
Portal: () => A,
|
|
1529
|
+
Provider: () => qe,
|
|
1530
|
+
Root: () => Ye,
|
|
1531
|
+
SwipeArea: () => dt,
|
|
1532
|
+
Title: () => S,
|
|
1533
|
+
Trigger: () => D,
|
|
1534
|
+
Viewport: () => Ot,
|
|
1535
|
+
VirtualKeyboardProvider: () => nn,
|
|
1536
|
+
createHandle: () => hn
|
|
1537
|
+
});
|
|
1538
|
+
//#endregion
|
|
1539
|
+
export { gn as t };
|