@vlrc-fe/components 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Form/FormFileUpload/index.d.ts +1 -1
- package/dist/Form/FormFileUpload/index.d.ts.map +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.d.ts.map +1 -1
- package/dist/MultiSelect/type.d.ts +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -40
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +46 -80
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +22 -60
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1147 -43
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +30 -64
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +31 -147
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +93 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +80 -25
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +9 -50
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +30 -156
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +350 -14
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +11 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +55 -60
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +430 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +36 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +28 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +14 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +156 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +19 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +67 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +118 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +36 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +13 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +44 -121
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +31 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +37 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +123 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +44 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +43 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +14 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +64 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +23 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +34 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +27 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +30 -12
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +26 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +157 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +34 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +46 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +142 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +125 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +26 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +88 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +221 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +166 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +8 -12
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +126 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +15 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +9 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +17 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +22 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +18 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +6 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +7 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +8 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +7 -0
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +12 -112
- package/dist/index150.cjs +1 -0
- package/dist/index150.js +7 -0
- package/dist/index151.cjs +1 -0
- package/dist/index151.js +9 -0
- package/dist/index152.cjs +1 -0
- package/dist/index152.js +69 -0
- package/dist/index153.cjs +1 -0
- package/dist/index153.js +11 -0
- package/dist/index154.cjs +1 -0
- package/dist/index154.js +202 -0
- package/dist/index155.cjs +1 -0
- package/dist/index155.js +124 -0
- package/dist/index156.cjs +1 -0
- package/dist/index156.js +32 -0
- package/dist/index157.cjs +1 -0
- package/dist/index157.js +20 -0
- package/dist/index158.cjs +1 -0
- package/dist/index158.js +69 -0
- package/dist/index159.cjs +1 -0
- package/dist/index159.js +32 -0
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +4 -726
- package/dist/index160.cjs +1 -0
- package/dist/index160.js +11 -0
- package/dist/index161.cjs +1 -0
- package/dist/index161.js +280 -0
- package/dist/index162.cjs +1 -0
- package/dist/index162.js +157 -0
- package/dist/index163.cjs +1 -0
- package/dist/index163.js +20 -0
- package/dist/index164.cjs +1 -0
- package/dist/index164.js +10 -0
- package/dist/index165.cjs +1 -0
- package/dist/index165.js +14 -0
- package/dist/index166.cjs +1 -0
- package/dist/index166.js +8 -0
- package/dist/index167.cjs +1 -0
- package/dist/index167.js +8 -0
- package/dist/index168.cjs +1 -0
- package/dist/index168.js +11 -0
- package/dist/index169.cjs +1 -0
- package/dist/index169.js +10 -0
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +79 -339
- package/dist/index170.cjs +1 -0
- package/dist/index170.js +6 -0
- package/dist/index171.cjs +1 -0
- package/dist/index171.js +8 -0
- package/dist/index172.cjs +1 -0
- package/dist/index172.js +8 -0
- package/dist/index173.cjs +1 -0
- package/dist/index173.js +10 -0
- package/dist/index174.cjs +1 -0
- package/dist/index174.js +11 -0
- package/dist/index175.cjs +1 -0
- package/dist/index175.js +15 -0
- package/dist/index176.cjs +1 -0
- package/dist/index176.js +11 -0
- package/dist/index177.cjs +1 -0
- package/dist/index177.js +11 -0
- package/dist/index178.cjs +1 -0
- package/dist/index178.js +6 -0
- package/dist/index179.cjs +1 -0
- package/dist/index179.js +43 -0
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +19 -66
- package/dist/index180.cjs +1 -0
- package/dist/index180.js +382 -0
- package/dist/index181.cjs +1 -0
- package/dist/index181.js +40 -0
- package/dist/index182.cjs +1 -0
- package/dist/index182.js +23 -0
- package/dist/index183.cjs +1 -0
- package/dist/index183.js +59 -0
- package/dist/index184.cjs +1 -0
- package/dist/index184.js +55 -0
- package/dist/index185.cjs +1 -0
- package/dist/index185.js +54 -0
- package/dist/index186.cjs +1 -0
- package/dist/index186.js +57 -0
- package/dist/index187.cjs +1 -0
- package/dist/index187.js +57 -0
- package/dist/index188.cjs +1 -0
- package/dist/index188.js +88 -0
- package/dist/index189.cjs +1 -0
- package/dist/index189.js +66 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +18 -8
- package/dist/index190.cjs +1 -0
- package/dist/index190.js +594 -0
- package/dist/index191.cjs +9 -0
- package/dist/index191.js +30 -0
- package/dist/index192.cjs +1 -0
- package/dist/index192.js +50 -0
- package/dist/index193.cjs +1 -0
- package/dist/index193.js +65 -0
- package/dist/index194.cjs +1 -0
- package/dist/index194.js +48 -0
- package/dist/index195.cjs +1 -0
- package/dist/index195.js +67 -0
- package/dist/index196.cjs +1 -0
- package/dist/index196.js +151 -0
- package/dist/index197.cjs +1 -0
- package/dist/index197.js +23 -0
- package/dist/index198.cjs +1 -0
- package/dist/index198.js +27 -0
- package/dist/index199.cjs +1 -0
- package/dist/index199.js +53 -0
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +51 -98
- package/dist/index200.cjs +1 -0
- package/dist/index200.js +161 -0
- package/dist/index201.cjs +1 -0
- package/dist/index201.js +16 -0
- package/dist/index202.cjs +1 -0
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +81 -28
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +64 -14
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +25 -22
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1014 -33
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +22 -96
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +108 -25
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +15 -9
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +20 -66
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +81 -11
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +91 -29
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +14 -41
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +93 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +22 -62
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +84 -22
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +85 -33
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +407 -25
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +170 -25
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +28 -154
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +158 -33
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +104 -45
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +337 -140
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +96 -124
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +319 -23
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +205 -81
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +33 -220
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +161 -163
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +20 -125
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +24 -14
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +167 -7
- package/dist/index5.js +26 -14
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +44 -15
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +15 -18
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +3 -17
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +5 -5
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +19 -4
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +24 -6
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +66 -4
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +14 -5
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +4 -8
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +50 -67
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +85 -46
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +6 -10
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -199
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +13 -122
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +9 -30
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +3 -20
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +24 -66
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +68 -30
- package/dist/index67.cjs +38 -1
- package/dist/index67.js +3 -11
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +12 -279
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +50 -155
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +29 -85
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +115 -19
- package/dist/index71.cjs +4 -1
- package/dist/index71.js +6 -9
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +12 -12
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +539 -6
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +197 -6
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +120 -9
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +912 -8
- package/dist/index77.cjs +3 -1
- package/dist/index77.js +76 -4
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +120 -6
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +12 -6
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +35 -62
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +14 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +113 -9
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +725 -13
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +346 -9
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +74 -9
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +148 -4
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +31 -42
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +12 -380
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +345 -37
- package/dist/index89.cjs +20 -1
- package/dist/index89.js +40 -18
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +85 -17
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +113 -56
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +272 -51
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +129 -50
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +13 -54
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +28 -55
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +525 -80
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +75 -61
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +67 -583
- package/dist/index98.cjs +1 -9
- package/dist/index98.js +32 -27
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +17 -49
- package/dist/ui/alert-dialog.d.ts +15 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert.d.ts +10 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/breadcrumb.d.ts +12 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/carousel.d.ts +20 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/context-menu.d.ts +26 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/drawer.d.ts +14 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/index.d.ts +23 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/input-otp.d.ts +12 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/menubar.d.ts +27 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/navigation-menu.d.ts +15 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/pagination.d.ts +14 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/resizable.d.ts +9 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/sheet.d.ts +14 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sidebar.d.ts +70 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/toggle-group.d.ts +8 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle.d.ts +10 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/package.json +23 -5
package/dist/index76.js
CHANGED
|
@@ -1,10 +1,914 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import n from "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import t, { useEffect as n, useLayoutEffect as r, useMemo as i } from "react";
|
|
4
|
+
import * as a from "@radix-ui/react-dialog";
|
|
5
|
+
//#region ../../node_modules/.pnpm/vaul@1.1.2_@types+react-dom@19.2.3_@types+react@19.2.17__@types+react@19.2.17_react-dom_f973e2ed844aea3ab8804372fa6a4bd5/node_modules/vaul/dist/index.mjs
|
|
6
|
+
function o(e) {
|
|
7
|
+
if (!e || typeof document > "u") return;
|
|
8
|
+
let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
|
|
9
|
+
n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
|
|
8
10
|
}
|
|
11
|
+
var s = t.createContext({
|
|
12
|
+
drawerRef: { current: null },
|
|
13
|
+
overlayRef: { current: null },
|
|
14
|
+
onPress: () => {},
|
|
15
|
+
onRelease: () => {},
|
|
16
|
+
onDrag: () => {},
|
|
17
|
+
onNestedDrag: () => {},
|
|
18
|
+
onNestedOpenChange: () => {},
|
|
19
|
+
onNestedRelease: () => {},
|
|
20
|
+
openProp: void 0,
|
|
21
|
+
dismissible: !1,
|
|
22
|
+
isOpen: !1,
|
|
23
|
+
isDragging: !1,
|
|
24
|
+
keyboardIsOpen: { current: !1 },
|
|
25
|
+
snapPointsOffset: null,
|
|
26
|
+
snapPoints: null,
|
|
27
|
+
handleOnly: !1,
|
|
28
|
+
modal: !1,
|
|
29
|
+
shouldFade: !1,
|
|
30
|
+
activeSnapPoint: null,
|
|
31
|
+
onOpenChange: () => {},
|
|
32
|
+
setActiveSnapPoint: () => {},
|
|
33
|
+
closeDrawer: () => {},
|
|
34
|
+
direction: "bottom",
|
|
35
|
+
shouldAnimate: { current: !0 },
|
|
36
|
+
shouldScaleBackground: !1,
|
|
37
|
+
setBackgroundColorOnScale: !0,
|
|
38
|
+
noBodyStyles: !1,
|
|
39
|
+
container: null,
|
|
40
|
+
autoFocus: !1
|
|
41
|
+
}), c = () => {
|
|
42
|
+
let e = t.useContext(s);
|
|
43
|
+
if (!e) throw Error("useDrawerContext must be used within a Drawer.Root");
|
|
44
|
+
return e;
|
|
45
|
+
};
|
|
46
|
+
o("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");
|
|
47
|
+
function l() {
|
|
48
|
+
let e = navigator.userAgent;
|
|
49
|
+
return typeof window < "u" && (/Firefox/.test(e) && /Mobile/.test(e) || /FxiOS/.test(e));
|
|
50
|
+
}
|
|
51
|
+
function u() {
|
|
52
|
+
return h(/^Mac/);
|
|
53
|
+
}
|
|
54
|
+
function d() {
|
|
55
|
+
return h(/^iPhone/);
|
|
56
|
+
}
|
|
57
|
+
function f() {
|
|
58
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
59
|
+
}
|
|
60
|
+
function p() {
|
|
61
|
+
return h(/^iPad/) || u() && navigator.maxTouchPoints > 1;
|
|
62
|
+
}
|
|
63
|
+
function m() {
|
|
64
|
+
return d() || p();
|
|
65
|
+
}
|
|
66
|
+
function h(e) {
|
|
67
|
+
return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
|
|
68
|
+
}
|
|
69
|
+
var g = 24, _ = typeof window < "u" ? r : n;
|
|
70
|
+
function v(...e) {
|
|
71
|
+
return (...t) => {
|
|
72
|
+
for (let n of e) typeof n == "function" && n(...t);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var y = typeof document < "u" && window.visualViewport;
|
|
76
|
+
function b(e) {
|
|
77
|
+
let t = window.getComputedStyle(e);
|
|
78
|
+
return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
|
|
79
|
+
}
|
|
80
|
+
function x(e) {
|
|
81
|
+
for (b(e) && (e = e.parentElement); e && !b(e);) e = e.parentElement;
|
|
82
|
+
return e || document.scrollingElement || document.documentElement;
|
|
83
|
+
}
|
|
84
|
+
var S = new Set([
|
|
85
|
+
"checkbox",
|
|
86
|
+
"radio",
|
|
87
|
+
"range",
|
|
88
|
+
"color",
|
|
89
|
+
"file",
|
|
90
|
+
"image",
|
|
91
|
+
"button",
|
|
92
|
+
"submit",
|
|
93
|
+
"reset"
|
|
94
|
+
]), C = 0, w;
|
|
95
|
+
function ee(e = {}) {
|
|
96
|
+
let { isDisabled: t } = e;
|
|
97
|
+
_(() => {
|
|
98
|
+
if (!t) return C++, C === 1 && m() && (w = T()), () => {
|
|
99
|
+
C--, C === 0 && w?.();
|
|
100
|
+
};
|
|
101
|
+
}, [t]);
|
|
102
|
+
}
|
|
103
|
+
function T() {
|
|
104
|
+
let e, t = 0, n = (n) => {
|
|
105
|
+
e = x(n.target), !(e === document.documentElement && e === document.body) && (t = n.changedTouches[0].pageY);
|
|
106
|
+
}, r = (n) => {
|
|
107
|
+
if (!e || e === document.documentElement || e === document.body) {
|
|
108
|
+
n.preventDefault();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
let r = n.changedTouches[0].pageY, i = e.scrollTop, a = e.scrollHeight - e.clientHeight;
|
|
112
|
+
a !== 0 && ((i <= 0 && r > t || i >= a && r < t) && n.preventDefault(), t = r);
|
|
113
|
+
}, i = (e) => {
|
|
114
|
+
let t = e.target;
|
|
115
|
+
k(t) && t !== document.activeElement && (e.preventDefault(), t.style.transform = "translateY(-2000px)", t.focus(), requestAnimationFrame(() => {
|
|
116
|
+
t.style.transform = "";
|
|
117
|
+
}));
|
|
118
|
+
}, a = (e) => {
|
|
119
|
+
let t = e.target;
|
|
120
|
+
k(t) && (t.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
|
121
|
+
t.style.transform = "", y && (y.height < window.innerHeight ? requestAnimationFrame(() => {
|
|
122
|
+
O(t);
|
|
123
|
+
}) : y.addEventListener("resize", () => O(t), { once: !0 }));
|
|
124
|
+
}));
|
|
125
|
+
}, o = () => {
|
|
126
|
+
window.scrollTo(0, 0);
|
|
127
|
+
}, s = window.pageXOffset, c = window.pageYOffset, l = v(E(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
128
|
+
window.scrollTo(0, 0);
|
|
129
|
+
let u = v(D(document, "touchstart", n, {
|
|
130
|
+
passive: !1,
|
|
131
|
+
capture: !0
|
|
132
|
+
}), D(document, "touchmove", r, {
|
|
133
|
+
passive: !1,
|
|
134
|
+
capture: !0
|
|
135
|
+
}), D(document, "touchend", i, {
|
|
136
|
+
passive: !1,
|
|
137
|
+
capture: !0
|
|
138
|
+
}), D(document, "focus", a, !0), D(window, "scroll", o));
|
|
139
|
+
return () => {
|
|
140
|
+
l(), u(), window.scrollTo(s, c);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function E(e, t, n) {
|
|
144
|
+
let r = e.style[t];
|
|
145
|
+
return e.style[t] = n, () => {
|
|
146
|
+
e.style[t] = r;
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function D(e, t, n, r) {
|
|
150
|
+
return e.addEventListener(t, n, r), () => {
|
|
151
|
+
e.removeEventListener(t, n, r);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function O(e) {
|
|
155
|
+
let t = document.scrollingElement || document.documentElement;
|
|
156
|
+
for (; e && e !== t;) {
|
|
157
|
+
let t = x(e);
|
|
158
|
+
if (t !== document.documentElement && t !== document.body && t !== e) {
|
|
159
|
+
let n = t.getBoundingClientRect().top, r = e.getBoundingClientRect().top;
|
|
160
|
+
e.getBoundingClientRect().bottom > t.getBoundingClientRect().bottom + g && (t.scrollTop += r - n);
|
|
161
|
+
}
|
|
162
|
+
e = t.parentElement;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function k(e) {
|
|
166
|
+
return e instanceof HTMLInputElement && !S.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
|
167
|
+
}
|
|
168
|
+
function A(e, t) {
|
|
169
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
170
|
+
}
|
|
171
|
+
function te(...e) {
|
|
172
|
+
return (t) => e.forEach((e) => A(e, t));
|
|
173
|
+
}
|
|
174
|
+
function ne(...t) {
|
|
175
|
+
return e.useCallback(te(...t), t);
|
|
176
|
+
}
|
|
177
|
+
var j = /* @__PURE__ */ new WeakMap();
|
|
178
|
+
function M(e, t, n = !1) {
|
|
179
|
+
if (!e || !(e instanceof HTMLElement)) return;
|
|
180
|
+
let r = {};
|
|
181
|
+
Object.entries(t).forEach(([t, n]) => {
|
|
182
|
+
if (t.startsWith("--")) {
|
|
183
|
+
e.style.setProperty(t, n);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
r[t] = e.style[t], e.style[t] = n;
|
|
187
|
+
}), !n && j.set(e, r);
|
|
188
|
+
}
|
|
189
|
+
function re(e, t) {
|
|
190
|
+
if (!e || !(e instanceof HTMLElement)) return;
|
|
191
|
+
let n = j.get(e);
|
|
192
|
+
n && (e.style[t] = n[t]);
|
|
193
|
+
}
|
|
194
|
+
var N = (e) => {
|
|
195
|
+
switch (e) {
|
|
196
|
+
case "top":
|
|
197
|
+
case "bottom": return !0;
|
|
198
|
+
case "left":
|
|
199
|
+
case "right": return !1;
|
|
200
|
+
default: return e;
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
function P(e, t) {
|
|
204
|
+
if (!e) return null;
|
|
205
|
+
let n = window.getComputedStyle(e), r = n.transform || n.webkitTransform || n.mozTransform, i = r.match(/^matrix3d\((.+)\)$/);
|
|
206
|
+
return i ? parseFloat(i[1].split(", ")[N(t) ? 13 : 12]) : (i = r.match(/^matrix\((.+)\)$/), i ? parseFloat(i[1].split(", ")[N(t) ? 5 : 4]) : null);
|
|
207
|
+
}
|
|
208
|
+
function ie(e) {
|
|
209
|
+
return 8 * (Math.log(e + 1) - 2);
|
|
210
|
+
}
|
|
211
|
+
function F(e, t) {
|
|
212
|
+
if (!e) return () => {};
|
|
213
|
+
let n = e.style.cssText;
|
|
214
|
+
return Object.assign(e.style, t), () => {
|
|
215
|
+
e.style.cssText = n;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
var I = {
|
|
219
|
+
DURATION: .5,
|
|
220
|
+
EASE: [
|
|
221
|
+
.32,
|
|
222
|
+
.72,
|
|
223
|
+
0,
|
|
224
|
+
1
|
|
225
|
+
]
|
|
226
|
+
}, ae = .4, oe = .25, se = 100, ce = 8, L = 16, le = 26, ue = "vaul-dragging";
|
|
227
|
+
function R(e) {
|
|
228
|
+
let n = t.useRef(e);
|
|
229
|
+
return t.useEffect(() => {
|
|
230
|
+
n.current = e;
|
|
231
|
+
}), t.useMemo(() => (...e) => n.current == null ? void 0 : n.current.call(n, ...e), []);
|
|
232
|
+
}
|
|
233
|
+
function de({ defaultProp: e, onChange: n }) {
|
|
234
|
+
let r = t.useState(e), [i] = r, a = t.useRef(i), o = R(n);
|
|
235
|
+
return t.useEffect(() => {
|
|
236
|
+
a.current !== i && (o(i), a.current = i);
|
|
237
|
+
}, [
|
|
238
|
+
i,
|
|
239
|
+
a,
|
|
240
|
+
o
|
|
241
|
+
]), r;
|
|
242
|
+
}
|
|
243
|
+
function fe({ prop: e, defaultProp: n, onChange: r = () => {} }) {
|
|
244
|
+
let [i, a] = de({
|
|
245
|
+
defaultProp: n,
|
|
246
|
+
onChange: r
|
|
247
|
+
}), o = e !== void 0, s = o ? e : i, c = R(r);
|
|
248
|
+
return [s, t.useCallback((t) => {
|
|
249
|
+
if (o) {
|
|
250
|
+
let n = typeof t == "function" ? t(e) : t;
|
|
251
|
+
n !== e && c(n);
|
|
252
|
+
} else a(t);
|
|
253
|
+
}, [
|
|
254
|
+
o,
|
|
255
|
+
e,
|
|
256
|
+
a,
|
|
257
|
+
c
|
|
258
|
+
])];
|
|
259
|
+
}
|
|
260
|
+
function pe({ activeSnapPointProp: e, setActiveSnapPointProp: n, snapPoints: r, drawerRef: i, overlayRef: a, fadeFromIndex: o, onSnapPointChange: s, direction: c = "bottom", container: l, snapToSequentialPoint: u }) {
|
|
261
|
+
let [d, f] = fe({
|
|
262
|
+
prop: e,
|
|
263
|
+
defaultProp: r?.[0],
|
|
264
|
+
onChange: n
|
|
265
|
+
}), [p, m] = t.useState(typeof window < "u" ? {
|
|
266
|
+
innerWidth: window.innerWidth,
|
|
267
|
+
innerHeight: window.innerHeight
|
|
268
|
+
} : void 0);
|
|
269
|
+
t.useEffect(() => {
|
|
270
|
+
function e() {
|
|
271
|
+
m({
|
|
272
|
+
innerWidth: window.innerWidth,
|
|
273
|
+
innerHeight: window.innerHeight
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
277
|
+
}, []);
|
|
278
|
+
let h = t.useMemo(() => d === r?.[r.length - 1] || null, [r, d]), g = t.useMemo(() => r?.findIndex((e) => e === d) ?? null, [r, d]), _ = r && r.length > 0 && (o || o === 0) && !Number.isNaN(o) && r[o] === d || !r, v = t.useMemo(() => {
|
|
279
|
+
let e = l ? {
|
|
280
|
+
width: l.getBoundingClientRect().width,
|
|
281
|
+
height: l.getBoundingClientRect().height
|
|
282
|
+
} : typeof window < "u" ? {
|
|
283
|
+
width: window.innerWidth,
|
|
284
|
+
height: window.innerHeight
|
|
285
|
+
} : {
|
|
286
|
+
width: 0,
|
|
287
|
+
height: 0
|
|
288
|
+
};
|
|
289
|
+
return r?.map((t) => {
|
|
290
|
+
let n = typeof t == "string", r = 0;
|
|
291
|
+
if (n && (r = parseInt(t, 10)), N(c)) {
|
|
292
|
+
let i = n ? r : p ? t * e.height : 0;
|
|
293
|
+
return p ? c === "bottom" ? e.height - i : -e.height + i : i;
|
|
294
|
+
}
|
|
295
|
+
let i = n ? r : p ? t * e.width : 0;
|
|
296
|
+
return p ? c === "right" ? e.width - i : -e.width + i : i;
|
|
297
|
+
}) ?? [];
|
|
298
|
+
}, [
|
|
299
|
+
r,
|
|
300
|
+
p,
|
|
301
|
+
l
|
|
302
|
+
]), y = t.useMemo(() => g === null ? null : v?.[g], [v, g]), b = t.useCallback((e) => {
|
|
303
|
+
let t = v?.findIndex((t) => t === e) ?? null;
|
|
304
|
+
s(t), M(i.current, {
|
|
305
|
+
transition: `transform ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`,
|
|
306
|
+
transform: N(c) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
|
|
307
|
+
}), v && t !== v.length - 1 && o !== void 0 && t !== o && t < o ? M(a.current, {
|
|
308
|
+
transition: `opacity ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`,
|
|
309
|
+
opacity: "0"
|
|
310
|
+
}) : M(a.current, {
|
|
311
|
+
transition: `opacity ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`,
|
|
312
|
+
opacity: "1"
|
|
313
|
+
}), f(r?.[Math.max(t, 0)]);
|
|
314
|
+
}, [
|
|
315
|
+
i.current,
|
|
316
|
+
r,
|
|
317
|
+
v,
|
|
318
|
+
o,
|
|
319
|
+
a,
|
|
320
|
+
f
|
|
321
|
+
]);
|
|
322
|
+
t.useEffect(() => {
|
|
323
|
+
if (d || e) {
|
|
324
|
+
let t = r?.findIndex((t) => t === e || t === d) ?? -1;
|
|
325
|
+
v && t !== -1 && typeof v[t] == "number" && b(v[t]);
|
|
326
|
+
}
|
|
327
|
+
}, [
|
|
328
|
+
d,
|
|
329
|
+
e,
|
|
330
|
+
r,
|
|
331
|
+
v,
|
|
332
|
+
b
|
|
333
|
+
]);
|
|
334
|
+
function x({ draggedDistance: e, closeDrawer: t, velocity: n, dismissible: i }) {
|
|
335
|
+
if (o === void 0) return;
|
|
336
|
+
let s = c === "bottom" || c === "right" ? (y ?? 0) - e : (y ?? 0) + e, l = g === o - 1, d = g === 0, f = e > 0;
|
|
337
|
+
if (l && M(a.current, { transition: `opacity ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})` }), !u && n > 2 && !f) {
|
|
338
|
+
i ? t() : b(v[0]);
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
if (!u && n > 2 && f && v && r) {
|
|
342
|
+
b(v[r.length - 1]);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
let p = v?.reduce((e, t) => typeof e != "number" || typeof t != "number" ? e : Math.abs(t - s) < Math.abs(e - s) ? t : e), m = N(c) ? window.innerHeight : window.innerWidth;
|
|
346
|
+
if (n > ae && Math.abs(e) < m * .4) {
|
|
347
|
+
let e = f ? 1 : -1;
|
|
348
|
+
if (e > 0 && h && r) {
|
|
349
|
+
b(v[r.length - 1]);
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (d && e < 0 && i && t(), g === null) return;
|
|
353
|
+
b(v[g + e]);
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
b(p);
|
|
357
|
+
}
|
|
358
|
+
function S({ draggedDistance: e }) {
|
|
359
|
+
if (y === null) return;
|
|
360
|
+
let t = c === "bottom" || c === "right" ? y - e : y + e;
|
|
361
|
+
(c === "bottom" || c === "right") && t < v[v.length - 1] || (c === "top" || c === "left") && t > v[v.length - 1] || M(i.current, { transform: N(c) ? `translate3d(0, ${t}px, 0)` : `translate3d(${t}px, 0, 0)` });
|
|
362
|
+
}
|
|
363
|
+
function C(e, t) {
|
|
364
|
+
if (!r || typeof g != "number" || !v || o === void 0) return null;
|
|
365
|
+
let n = g === o - 1;
|
|
366
|
+
if (g >= o && t) return 0;
|
|
367
|
+
if (n && !t) return 1;
|
|
368
|
+
if (!_ && !n) return null;
|
|
369
|
+
let i = n ? g + 1 : g - 1, a = n ? v[i] - v[i - 1] : v[i + 1] - v[i], s = e / Math.abs(a);
|
|
370
|
+
return n ? 1 - s : s;
|
|
371
|
+
}
|
|
372
|
+
return {
|
|
373
|
+
isLastSnapPoint: h,
|
|
374
|
+
activeSnapPoint: d,
|
|
375
|
+
shouldFade: _,
|
|
376
|
+
getPercentageDragged: C,
|
|
377
|
+
setActiveSnapPoint: f,
|
|
378
|
+
activeSnapPointIndex: g,
|
|
379
|
+
onRelease: x,
|
|
380
|
+
onDrag: S,
|
|
381
|
+
snapPointsOffset: v
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function me() {
|
|
385
|
+
let { direction: e, isOpen: n, shouldScaleBackground: r, setBackgroundColorOnScale: a, noBodyStyles: o } = c(), s = t.useRef(null), l = i(() => document.body.style.backgroundColor, []);
|
|
386
|
+
function u() {
|
|
387
|
+
return (window.innerWidth - le) / window.innerWidth;
|
|
388
|
+
}
|
|
389
|
+
t.useEffect(() => {
|
|
390
|
+
if (n && r) {
|
|
391
|
+
s.current && clearTimeout(s.current);
|
|
392
|
+
let t = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
393
|
+
if (!t) return;
|
|
394
|
+
a && !o && F(document.body, { background: "black" }), F(t, {
|
|
395
|
+
transformOrigin: N(e) ? "top" : "left",
|
|
396
|
+
transitionProperty: "transform, border-radius",
|
|
397
|
+
transitionDuration: `${I.DURATION}s`,
|
|
398
|
+
transitionTimingFunction: `cubic-bezier(${I.EASE.join(",")})`
|
|
399
|
+
});
|
|
400
|
+
let n = F(t, {
|
|
401
|
+
borderRadius: `${ce}px`,
|
|
402
|
+
overflow: "hidden",
|
|
403
|
+
...N(e) ? { transform: `scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)` } : { transform: `scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)` }
|
|
404
|
+
});
|
|
405
|
+
return () => {
|
|
406
|
+
n(), s.current = window.setTimeout(() => {
|
|
407
|
+
l ? document.body.style.background = l : document.body.style.removeProperty("background");
|
|
408
|
+
}, I.DURATION * 1e3);
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
}, [
|
|
412
|
+
n,
|
|
413
|
+
r,
|
|
414
|
+
l
|
|
415
|
+
]);
|
|
416
|
+
}
|
|
417
|
+
var z = null;
|
|
418
|
+
function he({ isOpen: e, modal: n, nested: r, hasBeenOpened: i, preventScrollRestoration: a, noBodyStyles: o }) {
|
|
419
|
+
let [s, c] = t.useState(() => typeof window < "u" ? window.location.href : ""), l = t.useRef(0), u = t.useCallback(() => {
|
|
420
|
+
if (f() && z === null && e && !o) {
|
|
421
|
+
z = {
|
|
422
|
+
position: document.body.style.position,
|
|
423
|
+
top: document.body.style.top,
|
|
424
|
+
left: document.body.style.left,
|
|
425
|
+
height: document.body.style.height,
|
|
426
|
+
right: "unset"
|
|
427
|
+
};
|
|
428
|
+
let { scrollX: e, innerHeight: t } = window;
|
|
429
|
+
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
430
|
+
top: `${-l.current}px`,
|
|
431
|
+
left: `${-e}px`,
|
|
432
|
+
right: "0px",
|
|
433
|
+
height: "auto"
|
|
434
|
+
}), window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
435
|
+
let e = t - window.innerHeight;
|
|
436
|
+
e && l.current >= t && (document.body.style.top = `${-(l.current + e)}px`);
|
|
437
|
+
}), 300);
|
|
438
|
+
}
|
|
439
|
+
}, [e]), d = t.useCallback(() => {
|
|
440
|
+
if (f() && z !== null && !o) {
|
|
441
|
+
let e = -parseInt(document.body.style.top, 10), t = -parseInt(document.body.style.left, 10);
|
|
442
|
+
Object.assign(document.body.style, z), window.requestAnimationFrame(() => {
|
|
443
|
+
if (a && s !== window.location.href) {
|
|
444
|
+
c(window.location.href);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
window.scrollTo(t, e);
|
|
448
|
+
}), z = null;
|
|
449
|
+
}
|
|
450
|
+
}, [s]);
|
|
451
|
+
return t.useEffect(() => {
|
|
452
|
+
function e() {
|
|
453
|
+
l.current = window.scrollY;
|
|
454
|
+
}
|
|
455
|
+
return e(), window.addEventListener("scroll", e), () => {
|
|
456
|
+
window.removeEventListener("scroll", e);
|
|
457
|
+
};
|
|
458
|
+
}, []), t.useEffect(() => {
|
|
459
|
+
if (n) return () => {
|
|
460
|
+
typeof document > "u" || document.querySelector("[data-vaul-drawer]") || d();
|
|
461
|
+
};
|
|
462
|
+
}, [n, d]), t.useEffect(() => {
|
|
463
|
+
r || !i || (e ? (!window.matchMedia("(display-mode: standalone)").matches && u(), n || window.setTimeout(() => {
|
|
464
|
+
d();
|
|
465
|
+
}, 500)) : d());
|
|
466
|
+
}, [
|
|
467
|
+
e,
|
|
468
|
+
i,
|
|
469
|
+
s,
|
|
470
|
+
n,
|
|
471
|
+
r,
|
|
472
|
+
u,
|
|
473
|
+
d
|
|
474
|
+
]), { restorePositionSetting: d };
|
|
475
|
+
}
|
|
476
|
+
function B({ open: e, onOpenChange: n, children: r, onDrag: i, onRelease: o, snapPoints: c, shouldScaleBackground: u = !1, setBackgroundColorOnScale: d = !0, closeThreshold: f = oe, scrollLockTimeout: p = se, dismissible: h = !0, handleOnly: g = !1, fadeFromIndex: _ = c && c.length - 1, activeSnapPoint: v, setActiveSnapPoint: y, fixed: b, modal: x = !0, onClose: S, nested: C, noBodyStyles: w = !1, direction: T = "bottom", defaultOpen: E = !1, disablePreventScroll: D = !0, snapToSequentialPoint: O = !1, preventScrollRestoration: A = !1, repositionInputs: te = !0, onAnimationEnd: ne, container: j, autoFocus: F = !1 }) {
|
|
477
|
+
let [R = !1, de] = fe({
|
|
478
|
+
defaultProp: E,
|
|
479
|
+
prop: e,
|
|
480
|
+
onChange: (e) => {
|
|
481
|
+
n?.(e), !e && !C && je(), setTimeout(() => {
|
|
482
|
+
ne?.(e);
|
|
483
|
+
}, I.DURATION * 1e3), e && !x && typeof window < "u" && window.requestAnimationFrame(() => {
|
|
484
|
+
document.body.style.pointerEvents = "auto";
|
|
485
|
+
}), e || (document.body.style.pointerEvents = "auto");
|
|
486
|
+
}
|
|
487
|
+
}), [me, z] = t.useState(!1), [B, V] = t.useState(!1), [ge, _e] = t.useState(!1), H = t.useRef(null), U = t.useRef(null), W = t.useRef(null), G = t.useRef(null), K = t.useRef(null), q = t.useRef(!1), ve = t.useRef(null), ye = t.useRef(0), J = t.useRef(!1), be = t.useRef(!E), xe = t.useRef(0), Y = t.useRef(null), Se = t.useRef(Y.current?.getBoundingClientRect().height || 0), Ce = t.useRef(Y.current?.getBoundingClientRect().width || 0), we = t.useRef(0), { activeSnapPoint: Te, activeSnapPointIndex: X, setActiveSnapPoint: Ee, onRelease: De, snapPointsOffset: Z, onDrag: Oe, shouldFade: ke, getPercentageDragged: Ae } = pe({
|
|
488
|
+
snapPoints: c,
|
|
489
|
+
activeSnapPointProp: v,
|
|
490
|
+
setActiveSnapPointProp: y,
|
|
491
|
+
drawerRef: Y,
|
|
492
|
+
fadeFromIndex: _,
|
|
493
|
+
overlayRef: H,
|
|
494
|
+
onSnapPointChange: t.useCallback((e) => {
|
|
495
|
+
c && e === Z.length - 1 && (U.current = /* @__PURE__ */ new Date());
|
|
496
|
+
}, []),
|
|
497
|
+
direction: T,
|
|
498
|
+
container: j,
|
|
499
|
+
snapToSequentialPoint: O
|
|
500
|
+
});
|
|
501
|
+
ee({ isDisabled: !R || B || !x || ge || !me || !te || !D });
|
|
502
|
+
let { restorePositionSetting: je } = he({
|
|
503
|
+
isOpen: R,
|
|
504
|
+
modal: x,
|
|
505
|
+
nested: C ?? !1,
|
|
506
|
+
hasBeenOpened: me,
|
|
507
|
+
preventScrollRestoration: A,
|
|
508
|
+
noBodyStyles: w
|
|
509
|
+
});
|
|
510
|
+
function Q() {
|
|
511
|
+
return (window.innerWidth - le) / window.innerWidth;
|
|
512
|
+
}
|
|
513
|
+
function Me(e) {
|
|
514
|
+
!h && !c || Y.current && !Y.current.contains(e.target) || (Se.current = Y.current?.getBoundingClientRect().height || 0, Ce.current = Y.current?.getBoundingClientRect().width || 0, V(!0), W.current = /* @__PURE__ */ new Date(), m() && window.addEventListener("touchend", () => q.current = !1, { once: !0 }), e.target.setPointerCapture(e.pointerId), ye.current = N(T) ? e.pageY : e.pageX);
|
|
515
|
+
}
|
|
516
|
+
function Ne(e, t) {
|
|
517
|
+
let n = e, r = window.getSelection()?.toString(), i = Y.current ? P(Y.current, T) : null, a = /* @__PURE__ */ new Date();
|
|
518
|
+
if (n.tagName === "SELECT" || n.hasAttribute("data-vaul-no-drag") || n.closest("[data-vaul-no-drag]")) return !1;
|
|
519
|
+
if (T === "right" || T === "left") return !0;
|
|
520
|
+
if (U.current && a.getTime() - U.current.getTime() < 500) return !1;
|
|
521
|
+
if (i !== null && (T === "bottom" ? i > 0 : i < 0)) return !0;
|
|
522
|
+
if (r && r.length > 0) return !1;
|
|
523
|
+
if (K.current && a.getTime() - K.current.getTime() < p && i === 0 || t) return K.current = a, !1;
|
|
524
|
+
for (; n;) {
|
|
525
|
+
if (n.scrollHeight > n.clientHeight) {
|
|
526
|
+
if (n.scrollTop !== 0) return K.current = /* @__PURE__ */ new Date(), !1;
|
|
527
|
+
if (n.getAttribute("role") === "dialog") return !0;
|
|
528
|
+
}
|
|
529
|
+
n = n.parentNode;
|
|
530
|
+
}
|
|
531
|
+
return !0;
|
|
532
|
+
}
|
|
533
|
+
function Pe(e) {
|
|
534
|
+
if (Y.current && B) {
|
|
535
|
+
let t = T === "bottom" || T === "right" ? 1 : -1, n = (ye.current - (N(T) ? e.pageY : e.pageX)) * t, r = n > 0, a = c && !h && !r;
|
|
536
|
+
if (a && X === 0) return;
|
|
537
|
+
let o = Math.abs(n), s = document.querySelector("[data-vaul-drawer-wrapper]"), l = o / (T === "bottom" || T === "top" ? Se.current : Ce.current), d = Ae(o, r);
|
|
538
|
+
if (d !== null && (l = d), a && l >= 1 || !q.current && !Ne(e.target, r)) return;
|
|
539
|
+
if (Y.current.classList.add(ue), q.current = !0, M(Y.current, { transition: "none" }), M(H.current, { transition: "none" }), c && Oe({ draggedDistance: n }), r && !c) {
|
|
540
|
+
let e = ie(n), r = Math.min(e * -1, 0) * t;
|
|
541
|
+
M(Y.current, { transform: N(T) ? `translate3d(0, ${r}px, 0)` : `translate3d(${r}px, 0, 0)` });
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
let f = 1 - l;
|
|
545
|
+
if ((ke || _ && X === _ - 1) && (i?.(e, l), M(H.current, {
|
|
546
|
+
opacity: `${f}`,
|
|
547
|
+
transition: "none"
|
|
548
|
+
}, !0)), s && H.current && u) {
|
|
549
|
+
let e = Math.min(Q() + l * (1 - Q()), 1), t = 8 - l * 8, n = Math.max(0, 14 - l * 14);
|
|
550
|
+
M(s, {
|
|
551
|
+
borderRadius: `${t}px`,
|
|
552
|
+
transform: N(T) ? `scale(${e}) translate3d(0, ${n}px, 0)` : `scale(${e}) translate3d(${n}px, 0, 0)`,
|
|
553
|
+
transition: "none"
|
|
554
|
+
}, !0);
|
|
555
|
+
}
|
|
556
|
+
if (!c) {
|
|
557
|
+
let e = o * t;
|
|
558
|
+
M(Y.current, { transform: N(T) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)` });
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
t.useEffect(() => {
|
|
563
|
+
window.requestAnimationFrame(() => {
|
|
564
|
+
be.current = !0;
|
|
565
|
+
});
|
|
566
|
+
}, []), t.useEffect(() => {
|
|
567
|
+
var e;
|
|
568
|
+
function t() {
|
|
569
|
+
if (!Y.current || !te) return;
|
|
570
|
+
let e = document.activeElement;
|
|
571
|
+
if (k(e) || J.current) {
|
|
572
|
+
let e = window.visualViewport?.height || 0, t = window.innerHeight, n = t - e, r = Y.current.getBoundingClientRect().height || 0, i = r > t * .8;
|
|
573
|
+
we.current ||= r;
|
|
574
|
+
let a = Y.current.getBoundingClientRect().top;
|
|
575
|
+
if (Math.abs(xe.current - n) > 60 && (J.current = !J.current), c && c.length > 0 && Z && X) {
|
|
576
|
+
let e = Z[X] || 0;
|
|
577
|
+
n += e;
|
|
578
|
+
}
|
|
579
|
+
if (xe.current = n, r > e || J.current) {
|
|
580
|
+
let t = Y.current.getBoundingClientRect().height, r = t;
|
|
581
|
+
t > e && (r = e - (i ? a : le)), b ? Y.current.style.height = `${t - Math.max(n, 0)}px` : Y.current.style.height = `${Math.max(r, e - a)}px`;
|
|
582
|
+
} else l() || (Y.current.style.height = `${we.current}px`);
|
|
583
|
+
c && c.length > 0 && !J.current ? Y.current.style.bottom = "0px" : Y.current.style.bottom = `${Math.max(n, 0)}px`;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
return (e = window.visualViewport) == null || e.addEventListener("resize", t), () => window.visualViewport?.removeEventListener("resize", t);
|
|
587
|
+
}, [
|
|
588
|
+
X,
|
|
589
|
+
c,
|
|
590
|
+
Z
|
|
591
|
+
]);
|
|
592
|
+
function $(e) {
|
|
593
|
+
Ie(), S?.(), e || de(!1), setTimeout(() => {
|
|
594
|
+
c && Ee(c[0]);
|
|
595
|
+
}, I.DURATION * 1e3);
|
|
596
|
+
}
|
|
597
|
+
function Fe() {
|
|
598
|
+
if (!Y.current) return;
|
|
599
|
+
let e = document.querySelector("[data-vaul-drawer-wrapper]"), t = P(Y.current, T);
|
|
600
|
+
M(Y.current, {
|
|
601
|
+
transform: "translate3d(0, 0, 0)",
|
|
602
|
+
transition: `transform ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`
|
|
603
|
+
}), M(H.current, {
|
|
604
|
+
transition: `opacity ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`,
|
|
605
|
+
opacity: "1"
|
|
606
|
+
}), u && t && t > 0 && R && M(e, {
|
|
607
|
+
borderRadius: `${ce}px`,
|
|
608
|
+
overflow: "hidden",
|
|
609
|
+
...N(T) ? {
|
|
610
|
+
transform: `scale(${Q()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
611
|
+
transformOrigin: "top"
|
|
612
|
+
} : {
|
|
613
|
+
transform: `scale(${Q()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
614
|
+
transformOrigin: "left"
|
|
615
|
+
},
|
|
616
|
+
transitionProperty: "transform, border-radius",
|
|
617
|
+
transitionDuration: `${I.DURATION}s`,
|
|
618
|
+
transitionTimingFunction: `cubic-bezier(${I.EASE.join(",")})`
|
|
619
|
+
}, !0);
|
|
620
|
+
}
|
|
621
|
+
function Ie() {
|
|
622
|
+
!B || !Y.current || (Y.current.classList.remove(ue), q.current = !1, V(!1), G.current = /* @__PURE__ */ new Date());
|
|
623
|
+
}
|
|
624
|
+
function Le(e) {
|
|
625
|
+
if (!B || !Y.current) return;
|
|
626
|
+
Y.current.classList.remove(ue), q.current = !1, V(!1), G.current = /* @__PURE__ */ new Date();
|
|
627
|
+
let t = P(Y.current, T);
|
|
628
|
+
if (!e || !Ne(e.target, !1) || !t || Number.isNaN(t) || W.current === null) return;
|
|
629
|
+
let n = G.current.getTime() - W.current.getTime(), r = ye.current - (N(T) ? e.pageY : e.pageX), i = Math.abs(r) / n;
|
|
630
|
+
if (i > .05 && (_e(!0), setTimeout(() => {
|
|
631
|
+
_e(!1);
|
|
632
|
+
}, 200)), c) {
|
|
633
|
+
De({
|
|
634
|
+
draggedDistance: r * (T === "bottom" || T === "right" ? 1 : -1),
|
|
635
|
+
closeDrawer: $,
|
|
636
|
+
velocity: i,
|
|
637
|
+
dismissible: h
|
|
638
|
+
}), o?.(e, !0);
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
if (T === "bottom" || T === "right" ? r > 0 : r < 0) {
|
|
642
|
+
Fe(), o?.(e, !0);
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
if (i > ae) {
|
|
646
|
+
$(), o?.(e, !1);
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
649
|
+
let a = Math.min(Y.current.getBoundingClientRect().height ?? 0, window.innerHeight), s = Math.min(Y.current.getBoundingClientRect().width ?? 0, window.innerWidth);
|
|
650
|
+
if (Math.abs(t) >= (T === "left" || T === "right" ? s : a) * f) {
|
|
651
|
+
$(), o?.(e, !1);
|
|
652
|
+
return;
|
|
653
|
+
}
|
|
654
|
+
o?.(e, !0), Fe();
|
|
655
|
+
}
|
|
656
|
+
t.useEffect(() => (R && (M(document.documentElement, { scrollBehavior: "auto" }), U.current = /* @__PURE__ */ new Date()), () => {
|
|
657
|
+
re(document.documentElement, "scrollBehavior");
|
|
658
|
+
}), [R]);
|
|
659
|
+
function Re(e) {
|
|
660
|
+
let t = e ? (window.innerWidth - L) / window.innerWidth : 1, n = e ? -16 : 0;
|
|
661
|
+
ve.current && window.clearTimeout(ve.current), M(Y.current, {
|
|
662
|
+
transition: `transform ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`,
|
|
663
|
+
transform: N(T) ? `scale(${t}) translate3d(0, ${n}px, 0)` : `scale(${t}) translate3d(${n}px, 0, 0)`
|
|
664
|
+
}), !e && Y.current && (ve.current = setTimeout(() => {
|
|
665
|
+
let e = P(Y.current, T);
|
|
666
|
+
M(Y.current, {
|
|
667
|
+
transition: "none",
|
|
668
|
+
transform: N(T) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
|
|
669
|
+
});
|
|
670
|
+
}, 500));
|
|
671
|
+
}
|
|
672
|
+
function ze(e, t) {
|
|
673
|
+
if (t < 0) return;
|
|
674
|
+
let n = (window.innerWidth - L) / window.innerWidth, r = n + t * (1 - n), i = -16 + t * L;
|
|
675
|
+
M(Y.current, {
|
|
676
|
+
transform: N(T) ? `scale(${r}) translate3d(0, ${i}px, 0)` : `scale(${r}) translate3d(${i}px, 0, 0)`,
|
|
677
|
+
transition: "none"
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
function Be(e, t) {
|
|
681
|
+
let n = N(T) ? window.innerHeight : window.innerWidth, r = t ? (n - L) / n : 1, i = t ? -16 : 0;
|
|
682
|
+
t && M(Y.current, {
|
|
683
|
+
transition: `transform ${I.DURATION}s cubic-bezier(${I.EASE.join(",")})`,
|
|
684
|
+
transform: N(T) ? `scale(${r}) translate3d(0, ${i}px, 0)` : `scale(${r}) translate3d(${i}px, 0, 0)`
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
return t.useEffect(() => {
|
|
688
|
+
x || window.requestAnimationFrame(() => {
|
|
689
|
+
document.body.style.pointerEvents = "auto";
|
|
690
|
+
});
|
|
691
|
+
}, [x]), /* @__PURE__ */ t.createElement(a.Root, {
|
|
692
|
+
defaultOpen: E,
|
|
693
|
+
onOpenChange: (e) => {
|
|
694
|
+
!h && !e || (e ? z(!0) : $(!0), de(e));
|
|
695
|
+
},
|
|
696
|
+
open: R
|
|
697
|
+
}, /* @__PURE__ */ t.createElement(s.Provider, { value: {
|
|
698
|
+
activeSnapPoint: Te,
|
|
699
|
+
snapPoints: c,
|
|
700
|
+
setActiveSnapPoint: Ee,
|
|
701
|
+
drawerRef: Y,
|
|
702
|
+
overlayRef: H,
|
|
703
|
+
onOpenChange: n,
|
|
704
|
+
onPress: Me,
|
|
705
|
+
onRelease: Le,
|
|
706
|
+
onDrag: Pe,
|
|
707
|
+
dismissible: h,
|
|
708
|
+
shouldAnimate: be,
|
|
709
|
+
handleOnly: g,
|
|
710
|
+
isOpen: R,
|
|
711
|
+
isDragging: B,
|
|
712
|
+
shouldFade: ke,
|
|
713
|
+
closeDrawer: $,
|
|
714
|
+
onNestedDrag: ze,
|
|
715
|
+
onNestedOpenChange: Re,
|
|
716
|
+
onNestedRelease: Be,
|
|
717
|
+
keyboardIsOpen: J,
|
|
718
|
+
modal: x,
|
|
719
|
+
snapPointsOffset: Z,
|
|
720
|
+
activeSnapPointIndex: X,
|
|
721
|
+
direction: T,
|
|
722
|
+
shouldScaleBackground: u,
|
|
723
|
+
setBackgroundColorOnScale: d,
|
|
724
|
+
noBodyStyles: w,
|
|
725
|
+
container: j,
|
|
726
|
+
autoFocus: F
|
|
727
|
+
} }, r));
|
|
728
|
+
}
|
|
729
|
+
var V = /* @__PURE__ */ t.forwardRef(function({ ...e }, n) {
|
|
730
|
+
let { overlayRef: r, snapPoints: i, onRelease: o, shouldFade: s, isOpen: l, modal: u, shouldAnimate: d } = c(), f = ne(n, r), p = i && i.length > 0;
|
|
731
|
+
if (!u) return null;
|
|
732
|
+
let m = t.useCallback((e) => o(e), [o]);
|
|
733
|
+
return /* @__PURE__ */ t.createElement(a.Overlay, {
|
|
734
|
+
onMouseUp: m,
|
|
735
|
+
ref: f,
|
|
736
|
+
"data-vaul-overlay": "",
|
|
737
|
+
"data-vaul-snap-points": l && p ? "true" : "false",
|
|
738
|
+
"data-vaul-snap-points-overlay": l && s ? "true" : "false",
|
|
739
|
+
"data-vaul-animate": d?.current ? "true" : "false",
|
|
740
|
+
...e
|
|
741
|
+
});
|
|
742
|
+
});
|
|
743
|
+
V.displayName = "Drawer.Overlay";
|
|
744
|
+
var ge = /* @__PURE__ */ t.forwardRef(function({ onPointerDownOutside: e, style: n, onOpenAutoFocus: r, ...i }, o) {
|
|
745
|
+
let { drawerRef: s, onPress: l, onRelease: u, onDrag: d, keyboardIsOpen: f, snapPointsOffset: p, activeSnapPointIndex: m, modal: h, isOpen: g, direction: _, snapPoints: v, container: y, handleOnly: b, shouldAnimate: x, autoFocus: S } = c(), [C, w] = t.useState(!1), ee = ne(o, s), T = t.useRef(null), E = t.useRef(null), D = t.useRef(!1), O = v && v.length > 0;
|
|
746
|
+
me();
|
|
747
|
+
let k = (e, t, n = 0) => {
|
|
748
|
+
if (D.current) return !0;
|
|
749
|
+
let r = Math.abs(e.y), i = Math.abs(e.x), a = i > r, o = ["bottom", "right"].includes(t) ? 1 : -1;
|
|
750
|
+
if (t === "left" || t === "right") {
|
|
751
|
+
if (!(e.x * o < 0) && i >= 0 && i <= n) return a;
|
|
752
|
+
} else if (!(e.y * o < 0) && r >= 0 && r <= n) return !a;
|
|
753
|
+
return D.current = !0, !0;
|
|
754
|
+
};
|
|
755
|
+
t.useEffect(() => {
|
|
756
|
+
O && window.requestAnimationFrame(() => {
|
|
757
|
+
w(!0);
|
|
758
|
+
});
|
|
759
|
+
}, []);
|
|
760
|
+
function A(e) {
|
|
761
|
+
T.current = null, D.current = !1, u(e);
|
|
762
|
+
}
|
|
763
|
+
return /* @__PURE__ */ t.createElement(a.Content, {
|
|
764
|
+
"data-vaul-drawer-direction": _,
|
|
765
|
+
"data-vaul-drawer": "",
|
|
766
|
+
"data-vaul-delayed-snap-points": C ? "true" : "false",
|
|
767
|
+
"data-vaul-snap-points": g && O ? "true" : "false",
|
|
768
|
+
"data-vaul-custom-container": y ? "true" : "false",
|
|
769
|
+
"data-vaul-animate": x?.current ? "true" : "false",
|
|
770
|
+
...i,
|
|
771
|
+
ref: ee,
|
|
772
|
+
style: p && p.length > 0 ? {
|
|
773
|
+
"--snap-point-height": `${p[m ?? 0]}px`,
|
|
774
|
+
...n
|
|
775
|
+
} : n,
|
|
776
|
+
onPointerDown: (e) => {
|
|
777
|
+
b || (i.onPointerDown == null || i.onPointerDown.call(i, e), T.current = {
|
|
778
|
+
x: e.pageX,
|
|
779
|
+
y: e.pageY
|
|
780
|
+
}, l(e));
|
|
781
|
+
},
|
|
782
|
+
onOpenAutoFocus: (e) => {
|
|
783
|
+
r?.(e), S || e.preventDefault();
|
|
784
|
+
},
|
|
785
|
+
onPointerDownOutside: (t) => {
|
|
786
|
+
if (e?.(t), !h || t.defaultPrevented) {
|
|
787
|
+
t.preventDefault();
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
f.current &&= !1;
|
|
791
|
+
},
|
|
792
|
+
onFocusOutside: (e) => {
|
|
793
|
+
if (!h) {
|
|
794
|
+
e.preventDefault();
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
onPointerMove: (e) => {
|
|
799
|
+
if (E.current = e, b || (i.onPointerMove == null || i.onPointerMove.call(i, e), !T.current)) return;
|
|
800
|
+
let t = e.pageY - T.current.y, n = e.pageX - T.current.x, r = e.pointerType === "touch" ? 10 : 2;
|
|
801
|
+
k({
|
|
802
|
+
x: n,
|
|
803
|
+
y: t
|
|
804
|
+
}, _, r) ? d(e) : (Math.abs(n) > r || Math.abs(t) > r) && (T.current = null);
|
|
805
|
+
},
|
|
806
|
+
onPointerUp: (e) => {
|
|
807
|
+
i.onPointerUp == null || i.onPointerUp.call(i, e), T.current = null, D.current = !1, u(e);
|
|
808
|
+
},
|
|
809
|
+
onPointerOut: (e) => {
|
|
810
|
+
i.onPointerOut == null || i.onPointerOut.call(i, e), A(E.current);
|
|
811
|
+
},
|
|
812
|
+
onContextMenu: (e) => {
|
|
813
|
+
i.onContextMenu == null || i.onContextMenu.call(i, e), E.current && A(E.current);
|
|
814
|
+
}
|
|
815
|
+
});
|
|
816
|
+
});
|
|
817
|
+
ge.displayName = "Drawer.Content";
|
|
818
|
+
var _e = 250, H = 120, U = /* @__PURE__ */ t.forwardRef(function({ preventCycle: e = !1, children: n, ...r }, i) {
|
|
819
|
+
let { closeDrawer: a, isDragging: o, snapPoints: s, activeSnapPoint: l, setActiveSnapPoint: u, dismissible: d, handleOnly: f, isOpen: p, onPress: m, onDrag: h } = c(), g = t.useRef(null), _ = t.useRef(!1);
|
|
820
|
+
function v() {
|
|
821
|
+
if (_.current) {
|
|
822
|
+
x();
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
window.setTimeout(() => {
|
|
826
|
+
y();
|
|
827
|
+
}, H);
|
|
828
|
+
}
|
|
829
|
+
function y() {
|
|
830
|
+
if (o || e || _.current) {
|
|
831
|
+
x();
|
|
832
|
+
return;
|
|
833
|
+
}
|
|
834
|
+
if (x(), !s || s.length === 0) {
|
|
835
|
+
d || a();
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
if (l === s[s.length - 1] && d) {
|
|
839
|
+
a();
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
let t = s.findIndex((e) => e === l);
|
|
843
|
+
if (t === -1) return;
|
|
844
|
+
let n = s[t + 1];
|
|
845
|
+
u(n);
|
|
846
|
+
}
|
|
847
|
+
function b() {
|
|
848
|
+
g.current = window.setTimeout(() => {
|
|
849
|
+
_.current = !0;
|
|
850
|
+
}, _e);
|
|
851
|
+
}
|
|
852
|
+
function x() {
|
|
853
|
+
g.current && window.clearTimeout(g.current), _.current = !1;
|
|
854
|
+
}
|
|
855
|
+
return /* @__PURE__ */ t.createElement("div", {
|
|
856
|
+
onClick: v,
|
|
857
|
+
onPointerCancel: x,
|
|
858
|
+
onPointerDown: (e) => {
|
|
859
|
+
f && m(e), b();
|
|
860
|
+
},
|
|
861
|
+
onPointerMove: (e) => {
|
|
862
|
+
f && h(e);
|
|
863
|
+
},
|
|
864
|
+
ref: i,
|
|
865
|
+
"data-vaul-drawer-visible": p ? "true" : "false",
|
|
866
|
+
"data-vaul-handle": "",
|
|
867
|
+
"aria-hidden": "true",
|
|
868
|
+
...r
|
|
869
|
+
}, /* @__PURE__ */ t.createElement("span", {
|
|
870
|
+
"data-vaul-handle-hitarea": "",
|
|
871
|
+
"aria-hidden": "true"
|
|
872
|
+
}, n));
|
|
873
|
+
});
|
|
874
|
+
U.displayName = "Drawer.Handle";
|
|
875
|
+
function W({ onDrag: e, onOpenChange: n, open: r, ...i }) {
|
|
876
|
+
let { onNestedDrag: a, onNestedOpenChange: o, onNestedRelease: s } = c();
|
|
877
|
+
if (!a) throw Error("Drawer.NestedRoot must be placed in another drawer");
|
|
878
|
+
return /* @__PURE__ */ t.createElement(B, {
|
|
879
|
+
nested: !0,
|
|
880
|
+
open: r,
|
|
881
|
+
onClose: () => {
|
|
882
|
+
o(!1);
|
|
883
|
+
},
|
|
884
|
+
onDrag: (t, n) => {
|
|
885
|
+
a(t, n), e?.(t, n);
|
|
886
|
+
},
|
|
887
|
+
onOpenChange: (e) => {
|
|
888
|
+
e && o(e), n?.(e);
|
|
889
|
+
},
|
|
890
|
+
onRelease: s,
|
|
891
|
+
...i
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
function G(e) {
|
|
895
|
+
let n = c(), { container: r = n.container, ...i } = e;
|
|
896
|
+
return /* @__PURE__ */ t.createElement(a.Portal, {
|
|
897
|
+
container: r,
|
|
898
|
+
...i
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
var K = {
|
|
902
|
+
Root: B,
|
|
903
|
+
NestedRoot: W,
|
|
904
|
+
Content: ge,
|
|
905
|
+
Overlay: V,
|
|
906
|
+
Trigger: a.Trigger,
|
|
907
|
+
Portal: G,
|
|
908
|
+
Handle: U,
|
|
909
|
+
Close: a.Close,
|
|
910
|
+
Title: a.Title,
|
|
911
|
+
Description: a.Description
|
|
912
|
+
};
|
|
9
913
|
//#endregion
|
|
10
|
-
export {
|
|
914
|
+
export { K as Drawer };
|