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