zudoku 0.32.0 → 0.32.2
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/app/tailwind.js +6 -0
- package/dist/app/tailwind.js.map +1 -1
- package/dist/config/validators/InputSidebarSchema.d.ts +15 -15
- package/dist/config/validators/InputSidebarSchema.js +10 -1
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +40 -40
- package/dist/config/validators/icon-types.d.ts +1 -1
- package/dist/config/validators/validate.d.ts +19 -19
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +3 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +2 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SidebarBadge.d.ts +2 -0
- package/dist/lib/components/navigation/SidebarBadge.js +3 -1
- package/dist/lib/components/navigation/SidebarBadge.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.js +1 -1
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/oas/graphql/index.js +3 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +2 -2
- package/dist/lib/plugins/api-catalog/Catalog.js +11 -24
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -1
- package/dist/lib/plugins/api-catalog/index.d.ts +1 -0
- package/dist/lib/plugins/api-catalog/index.js +37 -8
- package/dist/lib/plugins/api-catalog/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarExamples.js +2 -2
- package/dist/lib/plugins/openapi/SidecarExamples.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +0 -11
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/ui/SyntaxHighlight.d.ts +14 -0
- package/dist/lib/{components → ui}/SyntaxHighlight.js +9 -6
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -0
- package/dist/lib/ui/util.d.ts +2 -0
- package/dist/lib/ui/util.js +3 -0
- package/dist/lib/ui/util.js.map +1 -0
- package/dist/lib/util/MdxComponents.js +1 -1
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/config.js +4 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -2
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +3 -9
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/lib/{AuthenticationPlugin-_YVa673u.js → AuthenticationPlugin-BlxA4Mbn.js} +4 -4
- package/lib/{AuthenticationPlugin-_YVa673u.js.map → AuthenticationPlugin-BlxA4Mbn.js.map} +1 -1
- package/lib/{CategoryHeading-MYL1u_6K.js → CategoryHeading-DpB47wvk.js} +3 -3
- package/lib/{CategoryHeading-MYL1u_6K.js.map → CategoryHeading-DpB47wvk.js.map} +1 -1
- package/lib/{Markdown-8mv9nhGd.js → Markdown-Cr9sYpR_.js} +4800 -4729
- package/lib/Markdown-Cr9sYpR_.js.map +1 -0
- package/lib/{MdxPage-GM1T5jmO.js → MdxPage-Dt-UEQl8.js} +10 -10
- package/lib/MdxPage-Dt-UEQl8.js.map +1 -0
- package/lib/{OasProvider-IS9wBrb7.js → OasProvider-WVtvHP5H.js} +6 -6
- package/lib/{OasProvider-IS9wBrb7.js.map → OasProvider-WVtvHP5H.js.map} +1 -1
- package/lib/{OperationList-BTmRbbXk.js → OperationList-DhOwupvv.js} +18 -19
- package/lib/{OperationList-BTmRbbXk.js.map → OperationList-DhOwupvv.js.map} +1 -1
- package/lib/Select-D9hI1G-y.js +223 -0
- package/lib/{Select-D9CKL33X.js.map → Select-D9hI1G-y.js.map} +1 -1
- package/lib/{SlotletProvider-D0mFmGJu.js → SlotletProvider-CEfNOA8i.js} +53 -53
- package/lib/{SlotletProvider-D0mFmGJu.js.map → SlotletProvider-CEfNOA8i.js.map} +1 -1
- package/lib/{Spinner-BlzrEEk1.js → Spinner-1KrEmx1V.js} +3 -3
- package/lib/{Spinner-BlzrEEk1.js.map → Spinner-1KrEmx1V.js.map} +1 -1
- package/lib/{SyntaxHighlight-B0L4SC_N.js → SyntaxHighlight-CcnUjERD.js} +445 -445
- package/lib/SyntaxHighlight-CcnUjERD.js.map +1 -0
- package/lib/{chunk-SYFQ2XB5-QijJrSf0.js → chunk-IR6S3I6Y-D_3UmFIn.js} +597 -597
- package/lib/chunk-IR6S3I6Y-D_3UmFIn.js.map +1 -0
- package/lib/{circular-DxaIIlWD.js → circular-v7K6lDDh.js} +1413 -1413
- package/lib/{circular-DxaIIlWD.js.map → circular-v7K6lDDh.js.map} +1 -1
- package/lib/context-DLCwaMXN.js +22 -0
- package/lib/{context-rwLGh-6_.js.map → context-DLCwaMXN.js.map} +1 -1
- package/lib/{createServer-DSQiPwjN.js → createServer-DMf6O2Rz.js} +3669 -3562
- package/lib/createServer-DMf6O2Rz.js.map +1 -0
- package/lib/{hook-C_t2ISLC.js → hook-CWwSAAlH.js} +384 -379
- package/lib/hook-CWwSAAlH.js.map +1 -0
- package/lib/index-Bn6Lc9tq.js +9 -0
- package/lib/index-Bn6Lc9tq.js.map +1 -0
- package/lib/index-CPNSgwSb.js +36 -0
- package/lib/{index-Djenk2Hj.js.map → index-CPNSgwSb.js.map} +1 -1
- package/lib/{index-BANyVRgL.js → index-Do_30Hpk.js} +78 -78
- package/lib/index-Do_30Hpk.js.map +1 -0
- package/lib/{index-B7mqiOei.js → index-Du5aNddU.js} +101 -101
- package/lib/index-Du5aNddU.js.map +1 -0
- package/lib/{index-CjJS0l4l.js → index-LNp6rxyU.js} +2 -2
- package/lib/{index-CjJS0l4l.js.map → index-LNp6rxyU.js.map} +1 -1
- package/lib/{index.esm-CrSoEshU.js → index.esm--gIChbWs.js} +3 -3
- package/lib/{index.esm-CrSoEshU.js.map → index.esm--gIChbWs.js.map} +1 -1
- package/lib/{index.esm-9-TF9KQB.js → index.esm-CQHE3GEU.js} +52 -53
- package/lib/{index.esm-9-TF9KQB.js.map → index.esm-CQHE3GEU.js.map} +1 -1
- package/lib/joinUrl-10po2Jdj.js +20 -0
- package/lib/{joinUrl-nLx9pD-Z.js.map → joinUrl-10po2Jdj.js.map} +1 -1
- package/lib/{jsx-runtime-Bdg6XQ1m.js → jsx-runtime-CYK1ROHF.js} +99 -99
- package/lib/{jsx-runtime-Bdg6XQ1m.js.map → jsx-runtime-CYK1ROHF.js.map} +1 -1
- package/lib/{mutation-Cm3O9f3X.js → mutation-B0wxqzSN.js} +26 -26
- package/lib/{mutation-Cm3O9f3X.js.map → mutation-B0wxqzSN.js.map} +1 -1
- package/lib/post-processors/removeExtensions.js +4 -4
- package/lib/ui/Accordion.js +1 -1
- package/lib/ui/ActionButton.js +2 -2
- package/lib/ui/Alert.js +2 -2
- package/lib/ui/AlertDialog.js +1 -1
- package/lib/ui/Badge.js +2 -2
- package/lib/ui/Breadcrumb.js +4 -4
- package/lib/ui/Button.js +2 -2
- package/lib/ui/Callout.js +4 -4
- package/lib/ui/Card.js +1 -1
- package/lib/ui/Carousel.js +1 -1
- package/lib/ui/Checkbox.js +2 -2
- package/lib/ui/Command.js +2 -2
- package/lib/ui/Dialog.js +1 -1
- package/lib/ui/Drawer.js +521 -543
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/ui/DropdownMenu.js +1 -1
- package/lib/ui/Form.js +5 -5
- package/lib/ui/HoverCard.js +1 -1
- package/lib/ui/Input.js +1 -1
- package/lib/ui/Label.js +2 -2
- package/lib/ui/Pagination.js +10 -10
- package/lib/ui/Popover.js +1 -1
- package/lib/ui/Progress.js +1 -1
- package/lib/ui/RadioGroup.js +1 -1
- package/lib/ui/ScrollArea.js +1 -1
- package/lib/ui/Select.js +1 -1
- package/lib/ui/Skeleton.js +1 -1
- package/lib/ui/Slider.js +1 -1
- package/lib/ui/Switch.js +1 -1
- package/lib/ui/SyntaxHighlight.js +10 -0
- package/lib/ui/SyntaxHighlight.js.map +1 -0
- package/lib/ui/Tabs.js +1 -1
- package/lib/ui/Textarea.js +1 -1
- package/lib/ui/Toggle.js +2 -2
- package/lib/ui/ToggleGroup.js +1 -1
- package/lib/ui/Tooltip.js +1 -1
- package/lib/ui/util.js +6 -0
- package/lib/ui/util.js.map +1 -0
- package/lib/{useExposedProps-Bbf99zic.js → useExposedProps-RIvey2Oy.js} +2 -2
- package/lib/{useExposedProps-Bbf99zic.js.map → useExposedProps-RIvey2Oy.js.map} +1 -1
- package/lib/{useScrollToAnchor-BGEcH3HM.js → useScrollToAnchor-C-sRxs9o.js} +13 -9
- package/lib/useScrollToAnchor-C-sRxs9o.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +18 -18
- package/lib/zudoku.auth-openid.js +255 -295
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +305 -298
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.icons.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +91 -108
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +3 -3
- package/lib/zudoku.plugin-markdown.js +2 -2
- package/lib/zudoku.plugin-openapi.js +6 -6
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-inkeep.js +9 -9
- package/package.json +49 -50
- package/src/app/tailwind.ts +6 -0
- package/src/lib/components/Header.tsx +1 -1
- package/src/lib/components/Layout.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +13 -9
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/navigation/SidebarBadge.tsx +4 -1
- package/src/lib/components/navigation/SidebarItem.tsx +1 -0
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/oas/graphql/index.ts +4 -1
- package/src/lib/plugins/api-catalog/Catalog.tsx +31 -94
- package/src/lib/plugins/api-catalog/index.tsx +54 -9
- package/src/lib/plugins/markdown/MdxPage.tsx +1 -1
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/SidecarExamples.tsx +1 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +9 -1
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +1 -1
- package/src/lib/{components → ui}/SyntaxHighlight.tsx +23 -8
- package/src/lib/ui/util.tsx +3 -0
- package/src/lib/util/MdxComponents.tsx +1 -1
- package/dist/lib/components/SyntaxHighlight.d.ts +0 -12
- package/dist/lib/components/SyntaxHighlight.js.map +0 -1
- package/lib/Markdown-8mv9nhGd.js.map +0 -1
- package/lib/MdxPage-GM1T5jmO.js.map +0 -1
- package/lib/Select-D9CKL33X.js +0 -223
- package/lib/SyntaxHighlight-B0L4SC_N.js.map +0 -1
- package/lib/chunk-SYFQ2XB5-QijJrSf0.js.map +0 -1
- package/lib/context-rwLGh-6_.js +0 -22
- package/lib/createServer-DSQiPwjN.js.map +0 -1
- package/lib/hook-C_t2ISLC.js.map +0 -1
- package/lib/index-B7mqiOei.js.map +0 -1
- package/lib/index-BANyVRgL.js.map +0 -1
- package/lib/index-Djenk2Hj.js +0 -36
- package/lib/joinUrl-nLx9pD-Z.js +0 -20
- package/lib/useScrollToAnchor-BGEcH3HM.js.map +0 -1
package/lib/ui/Drawer.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { j as X } from "../jsx-runtime-
|
|
2
|
-
import * as
|
|
3
|
-
import r, { useMemo as
|
|
1
|
+
import { j as X } from "../jsx-runtime-CYK1ROHF.js";
|
|
2
|
+
import * as mt from "react";
|
|
3
|
+
import r, { useMemo as ye, useLayoutEffect as be, useEffect as Se } from "react";
|
|
4
4
|
import * as Z from "@radix-ui/react-dialog";
|
|
5
|
-
import { c as
|
|
6
|
-
function
|
|
5
|
+
import { c as ot } from "../cn-qaFjX9_3.js";
|
|
6
|
+
function Te(t) {
|
|
7
7
|
if (typeof document > "u") return;
|
|
8
|
-
let n = document.head || document.getElementsByTagName("head")[0],
|
|
9
|
-
|
|
8
|
+
let n = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
|
|
9
|
+
e.type = "text/css", n.appendChild(e), e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const qt = r.createContext({
|
|
12
12
|
drawerRef: {
|
|
13
13
|
current: null
|
|
14
14
|
},
|
|
@@ -55,57 +55,57 @@ const qe = r.createContext({
|
|
|
55
55
|
noBodyStyles: !1,
|
|
56
56
|
container: null,
|
|
57
57
|
autoFocus: !1
|
|
58
|
-
}),
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
58
|
+
}), pt = () => {
|
|
59
|
+
const t = r.useContext(qt);
|
|
60
|
+
if (!t)
|
|
61
61
|
throw new Error("useDrawerContext must be used within a Drawer.Root");
|
|
62
|
-
return
|
|
62
|
+
return t;
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
Te(`[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(
|
|
65
65
|
[data-state=closed]
|
|
66
66
|
){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)}}`);
|
|
67
|
-
function
|
|
68
|
-
const
|
|
69
|
-
return typeof window < "u" && (/Firefox/.test(
|
|
70
|
-
/FxiOS/.test(
|
|
67
|
+
function De() {
|
|
68
|
+
const t = navigator.userAgent;
|
|
69
|
+
return typeof window < "u" && (/Firefox/.test(t) && /Mobile/.test(t) || // Android Firefox
|
|
70
|
+
/FxiOS/.test(t));
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
72
|
+
function Re() {
|
|
73
|
+
return Nt(/^Mac/);
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
75
|
+
function Ee() {
|
|
76
|
+
return Nt(/^iPhone/);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Wt() {
|
|
79
79
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
83
|
-
|
|
81
|
+
function xe() {
|
|
82
|
+
return Nt(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
83
|
+
Re() && navigator.maxTouchPoints > 1;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
return
|
|
85
|
+
function Xt() {
|
|
86
|
+
return Ee() || xe();
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
return typeof window < "u" && window.navigator != null ?
|
|
88
|
+
function Nt(t) {
|
|
89
|
+
return typeof window < "u" && window.navigator != null ? t.test(window.navigator.platform) : void 0;
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
91
|
+
const Oe = 24, Ce = typeof window < "u" ? be : Se;
|
|
92
|
+
function zt(...t) {
|
|
93
93
|
return (...n) => {
|
|
94
|
-
for (let
|
|
95
|
-
typeof
|
|
94
|
+
for (let e of t)
|
|
95
|
+
typeof e == "function" && e(...n);
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
const
|
|
99
|
-
function
|
|
100
|
-
let n = window.getComputedStyle(
|
|
98
|
+
const xt = typeof document < "u" && window.visualViewport;
|
|
99
|
+
function Vt(t) {
|
|
100
|
+
let n = window.getComputedStyle(t);
|
|
101
101
|
return /(auto|scroll)/.test(n.overflow + n.overflowX + n.overflowY);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
for (
|
|
105
|
-
|
|
106
|
-
return
|
|
103
|
+
function Kt(t) {
|
|
104
|
+
for (Vt(t) && (t = t.parentElement); t && !Vt(t); )
|
|
105
|
+
t = t.parentElement;
|
|
106
|
+
return t || document.scrollingElement || document.documentElement;
|
|
107
107
|
}
|
|
108
|
-
const
|
|
108
|
+
const $e = /* @__PURE__ */ new Set([
|
|
109
109
|
"checkbox",
|
|
110
110
|
"radio",
|
|
111
111
|
"range",
|
|
@@ -116,114 +116,114 @@ const Nt = /* @__PURE__ */ new Set([
|
|
|
116
116
|
"submit",
|
|
117
117
|
"reset"
|
|
118
118
|
]);
|
|
119
|
-
let
|
|
120
|
-
function
|
|
121
|
-
let { isDisabled: n } =
|
|
122
|
-
|
|
119
|
+
let vt = 0, Ot;
|
|
120
|
+
function Ae(t = {}) {
|
|
121
|
+
let { isDisabled: n } = t;
|
|
122
|
+
Ce(() => {
|
|
123
123
|
if (!n)
|
|
124
|
-
return
|
|
125
|
-
|
|
124
|
+
return vt++, vt === 1 && Xt() && (Ot = Me()), () => {
|
|
125
|
+
vt--, vt === 0 && (Ot == null || Ot());
|
|
126
126
|
};
|
|
127
127
|
}, [
|
|
128
128
|
n
|
|
129
129
|
]);
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
let
|
|
133
|
-
|
|
134
|
-
}, a = (
|
|
135
|
-
if (!
|
|
136
|
-
|
|
131
|
+
function Me() {
|
|
132
|
+
let t, n = 0, e = (f) => {
|
|
133
|
+
t = Kt(f.target), !(t === document.documentElement && t === document.body) && (n = f.changedTouches[0].pageY);
|
|
134
|
+
}, a = (f) => {
|
|
135
|
+
if (!t || t === document.documentElement || t === document.body) {
|
|
136
|
+
f.preventDefault();
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
let
|
|
140
|
-
k !== 0 && ((B <= 0 &&
|
|
141
|
-
}, i = (
|
|
142
|
-
let
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
let m = f.changedTouches[0].pageY, B = t.scrollTop, k = t.scrollHeight - t.clientHeight;
|
|
140
|
+
k !== 0 && ((B <= 0 && m > n || B >= k && m < n) && f.preventDefault(), n = m);
|
|
141
|
+
}, i = (f) => {
|
|
142
|
+
let m = f.target;
|
|
143
|
+
At(m) && m !== document.activeElement && (f.preventDefault(), m.style.transform = "translateY(-2000px)", m.focus(), requestAnimationFrame(() => {
|
|
144
|
+
m.style.transform = "";
|
|
145
145
|
}));
|
|
146
|
-
}, o = (
|
|
147
|
-
let
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}) :
|
|
146
|
+
}, o = (f) => {
|
|
147
|
+
let m = f.target;
|
|
148
|
+
At(m) && (m.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
|
149
|
+
m.style.transform = "", xt && (xt.height < window.innerHeight ? requestAnimationFrame(() => {
|
|
150
|
+
Yt(m);
|
|
151
|
+
}) : xt.addEventListener("resize", () => Yt(m), {
|
|
152
152
|
once: !0
|
|
153
153
|
}));
|
|
154
154
|
}));
|
|
155
|
-
},
|
|
155
|
+
}, v = () => {
|
|
156
156
|
window.scrollTo(0, 0);
|
|
157
|
-
},
|
|
157
|
+
}, w = window.pageXOffset, T = window.pageYOffset, R = zt(Ne(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
158
158
|
window.scrollTo(0, 0);
|
|
159
|
-
let h =
|
|
159
|
+
let h = zt(dt(document, "touchstart", e, {
|
|
160
160
|
passive: !1,
|
|
161
161
|
capture: !0
|
|
162
|
-
}),
|
|
162
|
+
}), dt(document, "touchmove", a, {
|
|
163
163
|
passive: !1,
|
|
164
164
|
capture: !0
|
|
165
|
-
}),
|
|
165
|
+
}), dt(document, "touchend", i, {
|
|
166
166
|
passive: !1,
|
|
167
167
|
capture: !0
|
|
168
|
-
}),
|
|
168
|
+
}), dt(document, "focus", o, !0), dt(window, "scroll", v));
|
|
169
169
|
return () => {
|
|
170
|
-
|
|
170
|
+
R(), h(), window.scrollTo(w, T);
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
let a =
|
|
175
|
-
return
|
|
176
|
-
|
|
173
|
+
function Ne(t, n, e) {
|
|
174
|
+
let a = t.style[n];
|
|
175
|
+
return t.style[n] = e, () => {
|
|
176
|
+
t.style[n] = a;
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return
|
|
181
|
-
|
|
179
|
+
function dt(t, n, e, a) {
|
|
180
|
+
return t.addEventListener(n, e, a), () => {
|
|
181
|
+
t.removeEventListener(n, e, a);
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function Yt(t) {
|
|
185
185
|
let n = document.scrollingElement || document.documentElement;
|
|
186
|
-
for (;
|
|
187
|
-
let
|
|
188
|
-
if (
|
|
189
|
-
let a =
|
|
190
|
-
const
|
|
191
|
-
o >
|
|
186
|
+
for (; t && t !== n; ) {
|
|
187
|
+
let e = Kt(t);
|
|
188
|
+
if (e !== document.documentElement && e !== document.body && e !== t) {
|
|
189
|
+
let a = e.getBoundingClientRect().top, i = t.getBoundingClientRect().top, o = t.getBoundingClientRect().bottom;
|
|
190
|
+
const v = e.getBoundingClientRect().bottom + Oe;
|
|
191
|
+
o > v && (e.scrollTop += i - a);
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
t = e.parentElement;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
196
|
+
function At(t) {
|
|
197
|
+
return t instanceof HTMLInputElement && !$e.has(t.type) || t instanceof HTMLTextAreaElement || t instanceof HTMLElement && t.isContentEditable;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
typeof
|
|
199
|
+
function Pe(t, n) {
|
|
200
|
+
typeof t == "function" ? t(n) : t != null && (t.current = n);
|
|
201
201
|
}
|
|
202
|
-
function
|
|
203
|
-
return (n) =>
|
|
202
|
+
function Ie(...t) {
|
|
203
|
+
return (n) => t.forEach((e) => Pe(e, n));
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
return
|
|
205
|
+
function Gt(...t) {
|
|
206
|
+
return mt.useCallback(Ie(...t), t);
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
function $(
|
|
210
|
-
if (!
|
|
208
|
+
const Jt = /* @__PURE__ */ new WeakMap();
|
|
209
|
+
function $(t, n, e = !1) {
|
|
210
|
+
if (!t || !(t instanceof HTMLElement)) return;
|
|
211
211
|
let a = {};
|
|
212
212
|
Object.entries(n).forEach(([i, o]) => {
|
|
213
213
|
if (i.startsWith("--")) {
|
|
214
|
-
|
|
214
|
+
t.style.setProperty(i, o);
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
217
|
-
a[i] =
|
|
218
|
-
}), !
|
|
217
|
+
a[i] = t.style[i], t.style[i] = o;
|
|
218
|
+
}), !e && Jt.set(t, a);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
if (!
|
|
222
|
-
let
|
|
223
|
-
|
|
220
|
+
function _e(t, n) {
|
|
221
|
+
if (!t || !(t instanceof HTMLElement)) return;
|
|
222
|
+
let e = Jt.get(t);
|
|
223
|
+
e && (t.style[n] = e[n]);
|
|
224
224
|
}
|
|
225
|
-
const C = (
|
|
226
|
-
switch (
|
|
225
|
+
const C = (t) => {
|
|
226
|
+
switch (t) {
|
|
227
227
|
case "top":
|
|
228
228
|
case "bottom":
|
|
229
229
|
return !0;
|
|
@@ -231,34 +231,34 @@ const C = (e) => {
|
|
|
231
231
|
case "right":
|
|
232
232
|
return !1;
|
|
233
233
|
default:
|
|
234
|
-
return
|
|
234
|
+
return t;
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
|
-
function
|
|
238
|
-
if (!
|
|
237
|
+
function yt(t, n) {
|
|
238
|
+
if (!t)
|
|
239
239
|
return null;
|
|
240
|
-
const
|
|
240
|
+
const e = window.getComputedStyle(t), a = (
|
|
241
241
|
// @ts-ignore
|
|
242
|
-
|
|
242
|
+
e.transform || e.webkitTransform || e.mozTransform
|
|
243
243
|
);
|
|
244
244
|
let i = a.match(/^matrix3d\((.+)\)$/);
|
|
245
245
|
return i ? parseFloat(i[1].split(", ")[C(n) ? 13 : 12]) : (i = a.match(/^matrix\((.+)\)$/), i ? parseFloat(i[1].split(", ")[C(n) ? 5 : 4]) : null);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
return 8 * (Math.log(
|
|
247
|
+
function He(t) {
|
|
248
|
+
return 8 * (Math.log(t + 1) - 2);
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
if (!
|
|
250
|
+
function Ct(t, n) {
|
|
251
|
+
if (!t) return () => {
|
|
252
252
|
};
|
|
253
|
-
const
|
|
254
|
-
return Object.assign(
|
|
255
|
-
|
|
253
|
+
const e = t.style.cssText;
|
|
254
|
+
return Object.assign(t.style, n), () => {
|
|
255
|
+
t.style.cssText = e;
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function ke(...t) {
|
|
259
259
|
return (...n) => {
|
|
260
|
-
for (const
|
|
261
|
-
typeof
|
|
260
|
+
for (const e of t)
|
|
261
|
+
typeof e == "function" && e(...n);
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
const x = {
|
|
@@ -269,76 +269,76 @@ const x = {
|
|
|
269
269
|
0,
|
|
270
270
|
1
|
|
271
271
|
]
|
|
272
|
-
},
|
|
273
|
-
function
|
|
274
|
-
const n = r.useRef(
|
|
272
|
+
}, Qt = 0.4, Le = 0.25, Be = 100, Zt = 8, bt = 16, Mt = 26, $t = "vaul-dragging";
|
|
273
|
+
function te(t) {
|
|
274
|
+
const n = r.useRef(t);
|
|
275
275
|
return r.useEffect(() => {
|
|
276
|
-
n.current =
|
|
277
|
-
}), r.useMemo(() => (...
|
|
276
|
+
n.current = t;
|
|
277
|
+
}), r.useMemo(() => (...e) => n.current == null ? void 0 : n.current.call(n, ...e), []);
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
const
|
|
279
|
+
function Fe({ defaultProp: t, onChange: n }) {
|
|
280
|
+
const e = r.useState(t), [a] = e, i = r.useRef(a), o = te(n);
|
|
281
281
|
return r.useEffect(() => {
|
|
282
282
|
i.current !== a && (o(a), i.current = a);
|
|
283
283
|
}, [
|
|
284
284
|
a,
|
|
285
285
|
i,
|
|
286
286
|
o
|
|
287
|
-
]),
|
|
287
|
+
]), e;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function ee({ prop: t, defaultProp: n, onChange: e = () => {
|
|
290
290
|
} }) {
|
|
291
|
-
const [a, i] =
|
|
291
|
+
const [a, i] = Fe({
|
|
292
292
|
defaultProp: n,
|
|
293
|
-
onChange:
|
|
294
|
-
}), o =
|
|
293
|
+
onChange: e
|
|
294
|
+
}), o = t !== void 0, v = o ? t : a, w = te(e), T = r.useCallback((R) => {
|
|
295
295
|
if (o) {
|
|
296
|
-
const
|
|
297
|
-
|
|
296
|
+
const f = typeof R == "function" ? R(t) : R;
|
|
297
|
+
f !== t && w(f);
|
|
298
298
|
} else
|
|
299
|
-
i(
|
|
299
|
+
i(R);
|
|
300
300
|
}, [
|
|
301
301
|
o,
|
|
302
|
-
|
|
302
|
+
t,
|
|
303
303
|
i,
|
|
304
|
-
|
|
304
|
+
w
|
|
305
305
|
]);
|
|
306
306
|
return [
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
v,
|
|
308
|
+
T
|
|
309
309
|
];
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
const [h,
|
|
313
|
-
prop:
|
|
314
|
-
defaultProp:
|
|
311
|
+
function Ue({ activeSnapPointProp: t, setActiveSnapPointProp: n, snapPoints: e, drawerRef: a, overlayRef: i, fadeFromIndex: o, onSnapPointChange: v, direction: w = "bottom", container: T, snapToSequentialPoint: R }) {
|
|
312
|
+
const [h, f] = ee({
|
|
313
|
+
prop: t,
|
|
314
|
+
defaultProp: e == null ? void 0 : e[0],
|
|
315
315
|
onChange: n
|
|
316
|
-
}), [
|
|
316
|
+
}), [m, B] = r.useState(typeof window < "u" ? {
|
|
317
317
|
innerWidth: window.innerWidth,
|
|
318
318
|
innerHeight: window.innerHeight
|
|
319
319
|
} : void 0);
|
|
320
320
|
r.useEffect(() => {
|
|
321
|
-
function
|
|
321
|
+
function u() {
|
|
322
322
|
B({
|
|
323
323
|
innerWidth: window.innerWidth,
|
|
324
324
|
innerHeight: window.innerHeight
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
return window.addEventListener("resize",
|
|
327
|
+
return window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
|
|
328
328
|
}, []);
|
|
329
|
-
const k = r.useMemo(() => h === (
|
|
330
|
-
|
|
329
|
+
const k = r.useMemo(() => h === (e == null ? void 0 : e[e.length - 1]) || null, [
|
|
330
|
+
e,
|
|
331
331
|
h
|
|
332
332
|
]), E = r.useMemo(() => {
|
|
333
|
-
var
|
|
334
|
-
return (
|
|
333
|
+
var u;
|
|
334
|
+
return (u = e == null ? void 0 : e.findIndex((b) => b === h)) != null ? u : null;
|
|
335
335
|
}, [
|
|
336
|
-
|
|
336
|
+
e,
|
|
337
337
|
h
|
|
338
|
-
]), F =
|
|
339
|
-
const
|
|
340
|
-
width:
|
|
341
|
-
height:
|
|
338
|
+
]), F = e && e.length > 0 && (o || o === 0) && !Number.isNaN(o) && e[o] === h || !e, p = r.useMemo(() => {
|
|
339
|
+
const u = T ? {
|
|
340
|
+
width: T.getBoundingClientRect().width,
|
|
341
|
+
height: T.getBoundingClientRect().height
|
|
342
342
|
} : typeof window < "u" ? {
|
|
343
343
|
width: window.innerWidth,
|
|
344
344
|
height: window.innerHeight
|
|
@@ -346,198 +346,198 @@ function Wt({ activeSnapPointProp: e, setActiveSnapPointProp: n, snapPoints: t,
|
|
|
346
346
|
width: 0,
|
|
347
347
|
height: 0
|
|
348
348
|
};
|
|
349
|
-
var
|
|
350
|
-
return (
|
|
349
|
+
var b;
|
|
350
|
+
return (b = e == null ? void 0 : e.map((y) => {
|
|
351
351
|
const I = typeof y == "string";
|
|
352
|
-
let
|
|
353
|
-
if (I && (
|
|
354
|
-
const l = I ?
|
|
355
|
-
return
|
|
352
|
+
let N = 0;
|
|
353
|
+
if (I && (N = parseInt(y, 10)), C(w)) {
|
|
354
|
+
const l = I ? N : m ? y * u.height : 0;
|
|
355
|
+
return m ? w === "bottom" ? u.height - l : -u.height + l : l;
|
|
356
356
|
}
|
|
357
|
-
const j = I ?
|
|
358
|
-
return
|
|
359
|
-
})) != null ?
|
|
357
|
+
const j = I ? N : m ? y * u.width : 0;
|
|
358
|
+
return m ? w === "right" ? u.width - j : -u.width + j : j;
|
|
359
|
+
})) != null ? b : [];
|
|
360
360
|
}, [
|
|
361
|
-
|
|
361
|
+
e,
|
|
362
|
+
m,
|
|
363
|
+
T
|
|
364
|
+
]), M = r.useMemo(() => E !== null ? p == null ? void 0 : p[E] : null, [
|
|
362
365
|
p,
|
|
363
|
-
b
|
|
364
|
-
]), N = r.useMemo(() => E !== null ? w == null ? void 0 : w[E] : null, [
|
|
365
|
-
w,
|
|
366
366
|
E
|
|
367
|
-
]), A = r.useCallback((
|
|
368
|
-
var
|
|
369
|
-
const y = (
|
|
370
|
-
|
|
367
|
+
]), A = r.useCallback((u) => {
|
|
368
|
+
var b;
|
|
369
|
+
const y = (b = p == null ? void 0 : p.findIndex((I) => I === u)) != null ? b : null;
|
|
370
|
+
v(y), $(a.current, {
|
|
371
371
|
transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
|
|
372
|
-
transform: C(
|
|
373
|
-
}),
|
|
372
|
+
transform: C(w) ? `translate3d(0, ${u}px, 0)` : `translate3d(${u}px, 0, 0)`
|
|
373
|
+
}), p && y !== p.length - 1 && o !== void 0 && y !== o && y < o ? $(i.current, {
|
|
374
374
|
transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
|
|
375
375
|
opacity: "0"
|
|
376
376
|
}) : $(i.current, {
|
|
377
377
|
transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
|
|
378
378
|
opacity: "1"
|
|
379
|
-
}),
|
|
379
|
+
}), f(e == null ? void 0 : e[Math.max(y, 0)]);
|
|
380
380
|
}, [
|
|
381
381
|
a.current,
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
e,
|
|
383
|
+
p,
|
|
384
384
|
o,
|
|
385
385
|
i,
|
|
386
|
-
|
|
386
|
+
f
|
|
387
387
|
]);
|
|
388
388
|
r.useEffect(() => {
|
|
389
|
-
if (h ||
|
|
390
|
-
var
|
|
391
|
-
const
|
|
392
|
-
|
|
389
|
+
if (h || t) {
|
|
390
|
+
var u;
|
|
391
|
+
const b = (u = e == null ? void 0 : e.findIndex((y) => y === t || y === h)) != null ? u : -1;
|
|
392
|
+
p && b !== -1 && typeof p[b] == "number" && A(p[b]);
|
|
393
393
|
}
|
|
394
394
|
}, [
|
|
395
395
|
h,
|
|
396
|
-
e,
|
|
397
396
|
t,
|
|
398
|
-
|
|
397
|
+
e,
|
|
398
|
+
p,
|
|
399
399
|
A
|
|
400
400
|
]);
|
|
401
|
-
function
|
|
401
|
+
function c({ draggedDistance: u, closeDrawer: b, velocity: y, dismissible: I }) {
|
|
402
402
|
if (o === void 0) return;
|
|
403
|
-
const
|
|
403
|
+
const N = w === "bottom" || w === "right" ? (M ?? 0) - u : (M ?? 0) + u, j = E === o - 1, l = E === 0, U = u > 0;
|
|
404
404
|
if (j && $(i.current, {
|
|
405
405
|
transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`
|
|
406
|
-
}), !
|
|
407
|
-
I ?
|
|
406
|
+
}), !R && y > 2 && !U) {
|
|
407
|
+
I ? b() : A(p[0]);
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
|
-
if (!
|
|
411
|
-
A(
|
|
410
|
+
if (!R && y > 2 && U && p && e) {
|
|
411
|
+
A(p[e.length - 1]);
|
|
412
412
|
return;
|
|
413
413
|
}
|
|
414
|
-
const _ =
|
|
415
|
-
if (y >
|
|
414
|
+
const _ = p == null ? void 0 : p.reduce((P, K) => typeof P != "number" || typeof K != "number" ? P : Math.abs(K - N) < Math.abs(P - N) ? K : P), W = C(w) ? window.innerHeight : window.innerWidth;
|
|
415
|
+
if (y > Qt && Math.abs(u) < W * 0.4) {
|
|
416
416
|
const P = U ? 1 : -1;
|
|
417
|
-
if (P > 0 && k &&
|
|
418
|
-
A(
|
|
417
|
+
if (P > 0 && k && e) {
|
|
418
|
+
A(p[e.length - 1]);
|
|
419
419
|
return;
|
|
420
420
|
}
|
|
421
|
-
if (l && P < 0 && I &&
|
|
422
|
-
A(
|
|
421
|
+
if (l && P < 0 && I && b(), E === null) return;
|
|
422
|
+
A(p[E + P]);
|
|
423
423
|
return;
|
|
424
424
|
}
|
|
425
425
|
A(_);
|
|
426
426
|
}
|
|
427
|
-
function Y({ draggedDistance:
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
(
|
|
431
|
-
transform: C(
|
|
427
|
+
function Y({ draggedDistance: u }) {
|
|
428
|
+
if (M === null) return;
|
|
429
|
+
const b = w === "bottom" || w === "right" ? M - u : M + u;
|
|
430
|
+
(w === "bottom" || w === "right") && b < p[p.length - 1] || (w === "top" || w === "left") && b > p[p.length - 1] || $(a.current, {
|
|
431
|
+
transform: C(w) ? `translate3d(0, ${b}px, 0)` : `translate3d(${b}px, 0, 0)`
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
if (!
|
|
434
|
+
function tt(u, b) {
|
|
435
|
+
if (!e || typeof E != "number" || !p || o === void 0) return null;
|
|
436
436
|
const y = E === o - 1;
|
|
437
|
-
if (E >= o &&
|
|
437
|
+
if (E >= o && b)
|
|
438
438
|
return 0;
|
|
439
|
-
if (y && !
|
|
439
|
+
if (y && !b) return 1;
|
|
440
440
|
if (!F && !y) return null;
|
|
441
|
-
const
|
|
441
|
+
const N = y ? E + 1 : E - 1, j = y ? p[N] - p[N - 1] : p[N + 1] - p[N], l = u / Math.abs(j);
|
|
442
442
|
return y ? 1 - l : l;
|
|
443
443
|
}
|
|
444
444
|
return {
|
|
445
445
|
isLastSnapPoint: k,
|
|
446
446
|
activeSnapPoint: h,
|
|
447
447
|
shouldFade: F,
|
|
448
|
-
getPercentageDragged:
|
|
449
|
-
setActiveSnapPoint:
|
|
448
|
+
getPercentageDragged: tt,
|
|
449
|
+
setActiveSnapPoint: f,
|
|
450
450
|
activeSnapPointIndex: E,
|
|
451
|
-
onRelease:
|
|
451
|
+
onRelease: c,
|
|
452
452
|
onDrag: Y,
|
|
453
|
-
snapPointsOffset:
|
|
453
|
+
snapPointsOffset: p
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
|
-
const
|
|
456
|
+
const je = () => () => {
|
|
457
457
|
};
|
|
458
|
-
function
|
|
459
|
-
const { direction:
|
|
460
|
-
function
|
|
461
|
-
return (window.innerWidth -
|
|
458
|
+
function We() {
|
|
459
|
+
const { direction: t, isOpen: n, shouldScaleBackground: e, setBackgroundColorOnScale: a, noBodyStyles: i } = pt(), o = r.useRef(null), v = ye(() => document.body.style.backgroundColor, []);
|
|
460
|
+
function w() {
|
|
461
|
+
return (window.innerWidth - Mt) / window.innerWidth;
|
|
462
462
|
}
|
|
463
463
|
r.useEffect(() => {
|
|
464
|
-
if (n &&
|
|
464
|
+
if (n && e) {
|
|
465
465
|
o.current && clearTimeout(o.current);
|
|
466
|
-
const
|
|
467
|
-
if (!
|
|
468
|
-
|
|
466
|
+
const T = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
467
|
+
if (!T) return;
|
|
468
|
+
ke(a && !i ? Ct(document.body, {
|
|
469
469
|
background: "black"
|
|
470
|
-
}) :
|
|
471
|
-
transformOrigin: C(
|
|
470
|
+
}) : je, Ct(T, {
|
|
471
|
+
transformOrigin: C(t) ? "top" : "left",
|
|
472
472
|
transitionProperty: "transform, border-radius",
|
|
473
473
|
transitionDuration: `${x.DURATION}s`,
|
|
474
474
|
transitionTimingFunction: `cubic-bezier(${x.EASE.join(",")})`
|
|
475
475
|
}));
|
|
476
|
-
const
|
|
477
|
-
borderRadius: `${
|
|
476
|
+
const R = Ct(T, {
|
|
477
|
+
borderRadius: `${Zt}px`,
|
|
478
478
|
overflow: "hidden",
|
|
479
|
-
...C(
|
|
480
|
-
transform: `scale(${
|
|
479
|
+
...C(t) ? {
|
|
480
|
+
transform: `scale(${w()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
|
|
481
481
|
} : {
|
|
482
|
-
transform: `scale(${
|
|
482
|
+
transform: `scale(${w()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
|
|
483
483
|
}
|
|
484
484
|
});
|
|
485
485
|
return () => {
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
R(), o.current = window.setTimeout(() => {
|
|
487
|
+
v ? document.body.style.background = v : document.body.style.removeProperty("background");
|
|
488
488
|
}, x.DURATION * 1e3);
|
|
489
489
|
};
|
|
490
490
|
}
|
|
491
491
|
}, [
|
|
492
492
|
n,
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
e,
|
|
494
|
+
v
|
|
495
495
|
]);
|
|
496
496
|
}
|
|
497
|
-
let
|
|
498
|
-
function
|
|
499
|
-
const [
|
|
500
|
-
if (
|
|
501
|
-
|
|
497
|
+
let ft = null;
|
|
498
|
+
function ze({ isOpen: t, modal: n, nested: e, hasBeenOpened: a, preventScrollRestoration: i, noBodyStyles: o }) {
|
|
499
|
+
const [v, w] = r.useState(() => typeof window < "u" ? window.location.href : ""), T = r.useRef(0), R = r.useCallback(() => {
|
|
500
|
+
if (Wt() && ft === null && t && !o) {
|
|
501
|
+
ft = {
|
|
502
502
|
position: document.body.style.position,
|
|
503
503
|
top: document.body.style.top,
|
|
504
504
|
left: document.body.style.left,
|
|
505
505
|
height: document.body.style.height,
|
|
506
506
|
right: "unset"
|
|
507
507
|
};
|
|
508
|
-
const { scrollX:
|
|
508
|
+
const { scrollX: f, innerHeight: m } = window;
|
|
509
509
|
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
510
|
-
top: `${-
|
|
511
|
-
left: `${-
|
|
510
|
+
top: `${-T.current}px`,
|
|
511
|
+
left: `${-f}px`,
|
|
512
512
|
right: "0px",
|
|
513
513
|
height: "auto"
|
|
514
514
|
}), window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
515
|
-
const B =
|
|
516
|
-
B &&
|
|
515
|
+
const B = m - window.innerHeight;
|
|
516
|
+
B && T.current >= m && (document.body.style.top = `${-(T.current + B)}px`);
|
|
517
517
|
}), 300);
|
|
518
518
|
}
|
|
519
519
|
}, [
|
|
520
|
-
|
|
520
|
+
t
|
|
521
521
|
]), h = r.useCallback(() => {
|
|
522
|
-
if (
|
|
523
|
-
const
|
|
524
|
-
Object.assign(document.body.style,
|
|
525
|
-
if (i &&
|
|
526
|
-
|
|
522
|
+
if (Wt() && ft !== null && !o) {
|
|
523
|
+
const f = -parseInt(document.body.style.top, 10), m = -parseInt(document.body.style.left, 10);
|
|
524
|
+
Object.assign(document.body.style, ft), window.requestAnimationFrame(() => {
|
|
525
|
+
if (i && v !== window.location.href) {
|
|
526
|
+
w(window.location.href);
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
window.scrollTo(
|
|
530
|
-
}),
|
|
529
|
+
window.scrollTo(m, f);
|
|
530
|
+
}), ft = null;
|
|
531
531
|
}
|
|
532
532
|
}, [
|
|
533
|
-
|
|
533
|
+
v
|
|
534
534
|
]);
|
|
535
535
|
return r.useEffect(() => {
|
|
536
|
-
function
|
|
537
|
-
|
|
536
|
+
function f() {
|
|
537
|
+
T.current = window.scrollY;
|
|
538
538
|
}
|
|
539
|
-
return
|
|
540
|
-
window.removeEventListener("scroll",
|
|
539
|
+
return f(), window.addEventListener("scroll", f), () => {
|
|
540
|
+
window.removeEventListener("scroll", f);
|
|
541
541
|
};
|
|
542
542
|
}, []), r.useEffect(() => {
|
|
543
543
|
if (n)
|
|
@@ -548,194 +548,194 @@ function Yt({ isOpen: e, modal: n, nested: t, hasBeenOpened: a, preventScrollRes
|
|
|
548
548
|
n,
|
|
549
549
|
h
|
|
550
550
|
]), r.useEffect(() => {
|
|
551
|
-
|
|
551
|
+
e || !a || (t ? (!window.matchMedia("(display-mode: standalone)").matches && R(), n || window.setTimeout(() => {
|
|
552
552
|
h();
|
|
553
553
|
}, 500)) : h());
|
|
554
554
|
}, [
|
|
555
|
-
|
|
555
|
+
t,
|
|
556
556
|
a,
|
|
557
|
-
|
|
557
|
+
v,
|
|
558
558
|
n,
|
|
559
|
-
|
|
560
|
-
|
|
559
|
+
e,
|
|
560
|
+
R,
|
|
561
561
|
h
|
|
562
562
|
]), {
|
|
563
563
|
restorePositionSetting: h
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Ve({ open: t, onOpenChange: n, children: e, onDrag: a, onRelease: i, snapPoints: o, shouldScaleBackground: v = !1, setBackgroundColorOnScale: w = !0, closeThreshold: T = Le, scrollLockTimeout: R = Be, dismissible: h = !0, handleOnly: f = !1, fadeFromIndex: m = o && o.length - 1, activeSnapPoint: B, setActiveSnapPoint: k, fixed: E, modal: F = !0, onClose: p, nested: M, noBodyStyles: A = !1, direction: c = "bottom", defaultOpen: Y = !1, disablePreventScroll: tt = !0, snapToSequentialPoint: u = !1, preventScrollRestoration: b = !1, repositionInputs: y = !0, onAnimationEnd: I, container: N, autoFocus: j = !1 }) {
|
|
567
567
|
var l, U;
|
|
568
|
-
const [_ = !1, W] =
|
|
568
|
+
const [_ = !1, W] = ee({
|
|
569
569
|
defaultProp: Y,
|
|
570
|
-
prop:
|
|
570
|
+
prop: t,
|
|
571
571
|
onChange: (s) => {
|
|
572
|
-
n == null || n(s), !s && !
|
|
572
|
+
n == null || n(s), !s && !M && de(), setTimeout(() => {
|
|
573
573
|
I == null || I(s);
|
|
574
574
|
}, x.DURATION * 1e3), s && !F && typeof window < "u" && window.requestAnimationFrame(() => {
|
|
575
575
|
document.body.style.pointerEvents = "auto";
|
|
576
576
|
}), s || (document.body.style.pointerEvents = "auto");
|
|
577
577
|
}
|
|
578
|
-
}), [P, K] = r.useState(!1), [G,
|
|
579
|
-
o && s ===
|
|
580
|
-
}, []), { activeSnapPoint:
|
|
578
|
+
}), [P, K] = r.useState(!1), [G, it] = r.useState(!1), [oe, Pt] = r.useState(!1), nt = r.useRef(null), wt = r.useRef(null), St = r.useRef(null), Tt = r.useRef(null), st = r.useRef(null), lt = r.useRef(!1), Dt = r.useRef(null), Rt = r.useRef(0), rt = r.useRef(!1), It = r.useRef(!Y), _t = r.useRef(0), d = r.useRef(null), Ht = r.useRef(((l = d.current) == null ? void 0 : l.getBoundingClientRect().height) || 0), kt = r.useRef(((U = d.current) == null ? void 0 : U.getBoundingClientRect().width) || 0), Et = r.useRef(0), ie = r.useCallback((s) => {
|
|
579
|
+
o && s === ut.length - 1 && (wt.current = /* @__PURE__ */ new Date());
|
|
580
|
+
}, []), { activeSnapPoint: se, activeSnapPointIndex: at, setActiveSnapPoint: Lt, onRelease: le, snapPointsOffset: ut, onDrag: ue, shouldFade: Bt, getPercentageDragged: ce } = Ue({
|
|
581
581
|
snapPoints: o,
|
|
582
582
|
activeSnapPointProp: B,
|
|
583
583
|
setActiveSnapPointProp: k,
|
|
584
|
-
drawerRef:
|
|
585
|
-
fadeFromIndex:
|
|
586
|
-
overlayRef:
|
|
587
|
-
onSnapPointChange:
|
|
588
|
-
direction:
|
|
589
|
-
container:
|
|
590
|
-
snapToSequentialPoint:
|
|
584
|
+
drawerRef: d,
|
|
585
|
+
fadeFromIndex: m,
|
|
586
|
+
overlayRef: nt,
|
|
587
|
+
onSnapPointChange: ie,
|
|
588
|
+
direction: c,
|
|
589
|
+
container: N,
|
|
590
|
+
snapToSequentialPoint: u
|
|
591
591
|
});
|
|
592
|
-
|
|
593
|
-
isDisabled: !_ || G || !F ||
|
|
592
|
+
Ae({
|
|
593
|
+
isDisabled: !_ || G || !F || oe || !P || !y || !tt
|
|
594
594
|
});
|
|
595
|
-
const { restorePositionSetting:
|
|
595
|
+
const { restorePositionSetting: de } = ze({
|
|
596
596
|
isOpen: _,
|
|
597
597
|
modal: F,
|
|
598
|
-
nested:
|
|
598
|
+
nested: M ?? !1,
|
|
599
599
|
hasBeenOpened: P,
|
|
600
|
-
preventScrollRestoration:
|
|
600
|
+
preventScrollRestoration: b,
|
|
601
601
|
noBodyStyles: A
|
|
602
602
|
});
|
|
603
|
-
function
|
|
604
|
-
return (window.innerWidth -
|
|
603
|
+
function ht() {
|
|
604
|
+
return (window.innerWidth - Mt) / window.innerWidth;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
607
|
-
var
|
|
608
|
-
!h && !o ||
|
|
606
|
+
function fe(s) {
|
|
607
|
+
var S, D;
|
|
608
|
+
!h && !o || d.current && !d.current.contains(s.target) || (Ht.current = ((S = d.current) == null ? void 0 : S.getBoundingClientRect().height) || 0, kt.current = ((D = d.current) == null ? void 0 : D.getBoundingClientRect().width) || 0, it(!0), St.current = /* @__PURE__ */ new Date(), Xt() && window.addEventListener("touchend", () => lt.current = !1, {
|
|
609
609
|
once: !0
|
|
610
|
-
}), s.target.setPointerCapture(s.pointerId),
|
|
610
|
+
}), s.target.setPointerCapture(s.pointerId), Rt.current = C(c) ? s.pageY : s.pageX);
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function Ft(s, S) {
|
|
613
613
|
var D;
|
|
614
|
-
let
|
|
615
|
-
const O = (D = window.getSelection()) == null ? void 0 : D.toString(), L =
|
|
616
|
-
if (
|
|
614
|
+
let g = s;
|
|
615
|
+
const O = (D = window.getSelection()) == null ? void 0 : D.toString(), L = d.current ? yt(d.current, c) : null, H = /* @__PURE__ */ new Date();
|
|
616
|
+
if (g.tagName === "SELECT" || g.hasAttribute("data-vaul-no-drag") || g.closest("[data-vaul-no-drag]"))
|
|
617
617
|
return !1;
|
|
618
|
-
if (
|
|
618
|
+
if (c === "right" || c === "left")
|
|
619
619
|
return !0;
|
|
620
|
-
if (
|
|
620
|
+
if (wt.current && H.getTime() - wt.current.getTime() < 500)
|
|
621
621
|
return !1;
|
|
622
|
-
if (L !== null && (
|
|
622
|
+
if (L !== null && (c === "bottom" ? L > 0 : L < 0))
|
|
623
623
|
return !0;
|
|
624
624
|
if (O && O.length > 0)
|
|
625
625
|
return !1;
|
|
626
|
-
if (
|
|
627
|
-
return
|
|
628
|
-
for (;
|
|
629
|
-
if (
|
|
630
|
-
if (
|
|
631
|
-
return
|
|
632
|
-
if (
|
|
626
|
+
if (st.current && H.getTime() - st.current.getTime() < R && L === 0 || S)
|
|
627
|
+
return st.current = H, !1;
|
|
628
|
+
for (; g; ) {
|
|
629
|
+
if (g.scrollHeight > g.clientHeight) {
|
|
630
|
+
if (g.scrollTop !== 0)
|
|
631
|
+
return st.current = /* @__PURE__ */ new Date(), !1;
|
|
632
|
+
if (g.getAttribute("role") === "dialog")
|
|
633
633
|
return !0;
|
|
634
634
|
}
|
|
635
|
-
|
|
635
|
+
g = g.parentNode;
|
|
636
636
|
}
|
|
637
637
|
return !0;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
if (O &&
|
|
643
|
-
const L = Math.abs(D), H = document.querySelector("[data-vaul-drawer-wrapper]"), J =
|
|
639
|
+
function me(s) {
|
|
640
|
+
if (d.current && G) {
|
|
641
|
+
const S = c === "bottom" || c === "right" ? 1 : -1, D = (Rt.current - (C(c) ? s.pageY : s.pageX)) * S, g = D > 0, O = o && !h && !g;
|
|
642
|
+
if (O && at === 0) return;
|
|
643
|
+
const L = Math.abs(D), H = document.querySelector("[data-vaul-drawer-wrapper]"), J = c === "bottom" || c === "top" ? Ht.current : kt.current;
|
|
644
644
|
let z = L / J;
|
|
645
|
-
const
|
|
646
|
-
if (
|
|
647
|
-
if (
|
|
645
|
+
const et = ce(L, g);
|
|
646
|
+
if (et !== null && (z = et), O && z >= 1 || !lt.current && !Ft(s.target, g)) return;
|
|
647
|
+
if (d.current.classList.add($t), lt.current = !0, $(d.current, {
|
|
648
648
|
transition: "none"
|
|
649
|
-
}), $(
|
|
649
|
+
}), $(nt.current, {
|
|
650
650
|
transition: "none"
|
|
651
|
-
}), o &&
|
|
651
|
+
}), o && ue({
|
|
652
652
|
draggedDistance: D
|
|
653
|
-
}),
|
|
654
|
-
const q =
|
|
655
|
-
$(
|
|
656
|
-
transform: C(
|
|
653
|
+
}), g && !o) {
|
|
654
|
+
const q = He(D), gt = Math.min(q * -1, 0) * S;
|
|
655
|
+
$(d.current, {
|
|
656
|
+
transform: C(c) ? `translate3d(0, ${gt}px, 0)` : `translate3d(${gt}px, 0, 0)`
|
|
657
657
|
});
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
const Q = 1 - z;
|
|
661
|
-
if ((
|
|
661
|
+
if ((Bt || m && at === m - 1) && (a == null || a(s, z), $(nt.current, {
|
|
662
662
|
opacity: `${Q}`,
|
|
663
663
|
transition: "none"
|
|
664
|
-
}, !0)), H &&
|
|
665
|
-
const q = Math.min(
|
|
664
|
+
}, !0)), H && nt.current && v) {
|
|
665
|
+
const q = Math.min(ht() + z * (1 - ht()), 1), gt = 8 - z * 8, jt = Math.max(0, 14 - z * 14);
|
|
666
666
|
$(H, {
|
|
667
|
-
borderRadius: `${
|
|
668
|
-
transform: C(
|
|
667
|
+
borderRadius: `${gt}px`,
|
|
668
|
+
transform: C(c) ? `scale(${q}) translate3d(0, ${jt}px, 0)` : `scale(${q}) translate3d(${jt}px, 0, 0)`,
|
|
669
669
|
transition: "none"
|
|
670
670
|
}, !0);
|
|
671
671
|
}
|
|
672
672
|
if (!o) {
|
|
673
|
-
const q = L *
|
|
674
|
-
$(
|
|
675
|
-
transform: C(
|
|
673
|
+
const q = L * S;
|
|
674
|
+
$(d.current, {
|
|
675
|
+
transform: C(c) ? `translate3d(0, ${q}px, 0)` : `translate3d(${q}px, 0, 0)`
|
|
676
676
|
});
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}
|
|
680
680
|
r.useEffect(() => {
|
|
681
681
|
window.requestAnimationFrame(() => {
|
|
682
|
-
|
|
682
|
+
It.current = !0;
|
|
683
683
|
});
|
|
684
684
|
}, []), r.useEffect(() => {
|
|
685
685
|
var s;
|
|
686
|
-
function
|
|
687
|
-
if (!
|
|
686
|
+
function S() {
|
|
687
|
+
if (!d.current || !y) return;
|
|
688
688
|
const D = document.activeElement;
|
|
689
|
-
if (
|
|
690
|
-
var
|
|
691
|
-
const O = ((
|
|
689
|
+
if (At(D) || rt.current) {
|
|
690
|
+
var g;
|
|
691
|
+
const O = ((g = window.visualViewport) == null ? void 0 : g.height) || 0, L = window.innerHeight;
|
|
692
692
|
let H = L - O;
|
|
693
|
-
const J =
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
if (Math.abs(
|
|
697
|
-
const Q =
|
|
693
|
+
const J = d.current.getBoundingClientRect().height || 0, z = J > L * 0.8;
|
|
694
|
+
Et.current || (Et.current = J);
|
|
695
|
+
const et = d.current.getBoundingClientRect().top;
|
|
696
|
+
if (Math.abs(_t.current - H) > 60 && (rt.current = !rt.current), o && o.length > 0 && ut && at) {
|
|
697
|
+
const Q = ut[at] || 0;
|
|
698
698
|
H += Q;
|
|
699
699
|
}
|
|
700
|
-
if (
|
|
701
|
-
const Q =
|
|
700
|
+
if (_t.current = H, J > O || rt.current) {
|
|
701
|
+
const Q = d.current.getBoundingClientRect().height;
|
|
702
702
|
let q = Q;
|
|
703
|
-
Q > O && (q = O - (z ?
|
|
704
|
-
} else
|
|
705
|
-
o && o.length > 0 && !
|
|
703
|
+
Q > O && (q = O - (z ? et : Mt)), E ? d.current.style.height = `${Q - Math.max(H, 0)}px` : d.current.style.height = `${Math.max(q, O - et)}px`;
|
|
704
|
+
} else De() || (d.current.style.height = `${Et.current}px`);
|
|
705
|
+
o && o.length > 0 && !rt.current ? d.current.style.bottom = "0px" : d.current.style.bottom = `${Math.max(H, 0)}px`;
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
return (s = window.visualViewport) == null || s.addEventListener("resize",
|
|
708
|
+
return (s = window.visualViewport) == null || s.addEventListener("resize", S), () => {
|
|
709
709
|
var D;
|
|
710
|
-
return (D = window.visualViewport) == null ? void 0 : D.removeEventListener("resize",
|
|
710
|
+
return (D = window.visualViewport) == null ? void 0 : D.removeEventListener("resize", S);
|
|
711
711
|
};
|
|
712
712
|
}, [
|
|
713
|
-
|
|
713
|
+
at,
|
|
714
714
|
o,
|
|
715
|
-
|
|
715
|
+
ut
|
|
716
716
|
]);
|
|
717
|
-
function
|
|
718
|
-
|
|
719
|
-
o &&
|
|
717
|
+
function ct(s) {
|
|
718
|
+
pe(), p == null || p(), s || W(!1), setTimeout(() => {
|
|
719
|
+
o && Lt(o[0]);
|
|
720
720
|
}, x.DURATION * 1e3);
|
|
721
721
|
}
|
|
722
|
-
function
|
|
723
|
-
if (!
|
|
724
|
-
const s = document.querySelector("[data-vaul-drawer-wrapper]"),
|
|
725
|
-
$(
|
|
722
|
+
function Ut() {
|
|
723
|
+
if (!d.current) return;
|
|
724
|
+
const s = document.querySelector("[data-vaul-drawer-wrapper]"), S = yt(d.current, c);
|
|
725
|
+
$(d.current, {
|
|
726
726
|
transform: "translate3d(0, 0, 0)",
|
|
727
727
|
transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`
|
|
728
|
-
}), $(
|
|
728
|
+
}), $(nt.current, {
|
|
729
729
|
transition: `opacity ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
|
|
730
730
|
opacity: "1"
|
|
731
|
-
}),
|
|
732
|
-
borderRadius: `${
|
|
731
|
+
}), v && S && S > 0 && _ && $(s, {
|
|
732
|
+
borderRadius: `${Zt}px`,
|
|
733
733
|
overflow: "hidden",
|
|
734
|
-
...C(
|
|
735
|
-
transform: `scale(${
|
|
734
|
+
...C(c) ? {
|
|
735
|
+
transform: `scale(${ht()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
736
736
|
transformOrigin: "top"
|
|
737
737
|
} : {
|
|
738
|
-
transform: `scale(${
|
|
738
|
+
transform: `scale(${ht()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
739
739
|
transformOrigin: "left"
|
|
740
740
|
},
|
|
741
741
|
transitionProperty: "transform, border-radius",
|
|
@@ -743,77 +743,77 @@ function nt({ open: e, onOpenChange: n, children: t, onDrag: a, onRelease: i, sn
|
|
|
743
743
|
transitionTimingFunction: `cubic-bezier(${x.EASE.join(",")})`
|
|
744
744
|
}, !0);
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
!G || !
|
|
746
|
+
function pe() {
|
|
747
|
+
!G || !d.current || (d.current.classList.remove($t), lt.current = !1, it(!1), Tt.current = /* @__PURE__ */ new Date());
|
|
748
748
|
}
|
|
749
|
-
function
|
|
750
|
-
if (!G || !
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
if (!s || !
|
|
754
|
-
const D =
|
|
755
|
-
if (O > 0.05 && (
|
|
756
|
-
|
|
749
|
+
function we(s) {
|
|
750
|
+
if (!G || !d.current) return;
|
|
751
|
+
d.current.classList.remove($t), lt.current = !1, it(!1), Tt.current = /* @__PURE__ */ new Date();
|
|
752
|
+
const S = yt(d.current, c);
|
|
753
|
+
if (!s || !Ft(s.target, !1) || !S || Number.isNaN(S) || St.current === null) return;
|
|
754
|
+
const D = Tt.current.getTime() - St.current.getTime(), g = Rt.current - (C(c) ? s.pageY : s.pageX), O = Math.abs(g) / D;
|
|
755
|
+
if (O > 0.05 && (Pt(!0), setTimeout(() => {
|
|
756
|
+
Pt(!1);
|
|
757
757
|
}, 200)), o) {
|
|
758
|
-
|
|
759
|
-
draggedDistance:
|
|
760
|
-
closeDrawer:
|
|
758
|
+
le({
|
|
759
|
+
draggedDistance: g * (c === "bottom" || c === "right" ? 1 : -1),
|
|
760
|
+
closeDrawer: ct,
|
|
761
761
|
velocity: O,
|
|
762
762
|
dismissible: h
|
|
763
763
|
}), i == null || i(s, !0);
|
|
764
764
|
return;
|
|
765
765
|
}
|
|
766
|
-
if (
|
|
767
|
-
|
|
766
|
+
if (c === "bottom" || c === "right" ? g > 0 : g < 0) {
|
|
767
|
+
Ut(), i == null || i(s, !0);
|
|
768
768
|
return;
|
|
769
769
|
}
|
|
770
|
-
if (O >
|
|
771
|
-
|
|
770
|
+
if (O > Qt) {
|
|
771
|
+
ct(), i == null || i(s, !1);
|
|
772
772
|
return;
|
|
773
773
|
}
|
|
774
774
|
var L;
|
|
775
|
-
const H = Math.min((L =
|
|
775
|
+
const H = Math.min((L = d.current.getBoundingClientRect().height) != null ? L : 0, window.innerHeight);
|
|
776
776
|
var J;
|
|
777
|
-
const z = Math.min((J =
|
|
778
|
-
if (Math.abs(
|
|
779
|
-
|
|
777
|
+
const z = Math.min((J = d.current.getBoundingClientRect().width) != null ? J : 0, window.innerWidth), et = c === "left" || c === "right";
|
|
778
|
+
if (Math.abs(S) >= (et ? z : H) * T) {
|
|
779
|
+
ct(), i == null || i(s, !1);
|
|
780
780
|
return;
|
|
781
781
|
}
|
|
782
|
-
i == null || i(s, !0),
|
|
782
|
+
i == null || i(s, !0), Ut();
|
|
783
783
|
}
|
|
784
784
|
r.useEffect(() => (_ && ($(document.documentElement, {
|
|
785
785
|
scrollBehavior: "auto"
|
|
786
|
-
}),
|
|
787
|
-
|
|
786
|
+
}), wt.current = /* @__PURE__ */ new Date()), () => {
|
|
787
|
+
_e(document.documentElement, "scrollBehavior");
|
|
788
788
|
}), [
|
|
789
789
|
_
|
|
790
790
|
]);
|
|
791
|
-
function
|
|
792
|
-
const
|
|
793
|
-
|
|
791
|
+
function he(s) {
|
|
792
|
+
const S = s ? (window.innerWidth - bt) / window.innerWidth : 1, D = s ? -16 : 0;
|
|
793
|
+
Dt.current && window.clearTimeout(Dt.current), $(d.current, {
|
|
794
794
|
transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
|
|
795
|
-
transform: C(
|
|
796
|
-
}), !s &&
|
|
797
|
-
const
|
|
798
|
-
$(
|
|
795
|
+
transform: C(c) ? `scale(${S}) translate3d(0, ${D}px, 0)` : `scale(${S}) translate3d(${D}px, 0, 0)`
|
|
796
|
+
}), !s && d.current && (Dt.current = setTimeout(() => {
|
|
797
|
+
const g = yt(d.current, c);
|
|
798
|
+
$(d.current, {
|
|
799
799
|
transition: "none",
|
|
800
|
-
transform: C(
|
|
800
|
+
transform: C(c) ? `translate3d(0, ${g}px, 0)` : `translate3d(${g}px, 0, 0)`
|
|
801
801
|
});
|
|
802
802
|
}, 500));
|
|
803
803
|
}
|
|
804
|
-
function
|
|
805
|
-
if (
|
|
806
|
-
const D = (window.innerWidth -
|
|
807
|
-
$(
|
|
808
|
-
transform: C(
|
|
804
|
+
function ge(s, S) {
|
|
805
|
+
if (S < 0) return;
|
|
806
|
+
const D = (window.innerWidth - bt) / window.innerWidth, g = D + S * (1 - D), O = -16 + S * bt;
|
|
807
|
+
$(d.current, {
|
|
808
|
+
transform: C(c) ? `scale(${g}) translate3d(0, ${O}px, 0)` : `scale(${g}) translate3d(${O}px, 0, 0)`,
|
|
809
809
|
transition: "none"
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
|
-
function
|
|
813
|
-
const D = C(
|
|
814
|
-
|
|
812
|
+
function ve(s, S) {
|
|
813
|
+
const D = C(c) ? window.innerHeight : window.innerWidth, g = S ? (D - bt) / D : 1, O = S ? -16 : 0;
|
|
814
|
+
S && $(d.current, {
|
|
815
815
|
transition: `transform ${x.DURATION}s cubic-bezier(${x.EASE.join(",")})`,
|
|
816
|
-
transform: C(
|
|
816
|
+
transform: C(c) ? `scale(${g}) translate3d(0, ${O}px, 0)` : `scale(${g}) translate3d(${O}px, 0, 0)`
|
|
817
817
|
});
|
|
818
818
|
}
|
|
819
819
|
return r.useEffect(() => {
|
|
@@ -825,65 +825,65 @@ function nt({ open: e, onOpenChange: n, children: t, onDrag: a, onRelease: i, sn
|
|
|
825
825
|
]), /* @__PURE__ */ r.createElement(Z.Root, {
|
|
826
826
|
defaultOpen: Y,
|
|
827
827
|
onOpenChange: (s) => {
|
|
828
|
-
!h && !s || (s ? K(!0) :
|
|
828
|
+
!h && !s || (s ? K(!0) : ct(!0), W(s));
|
|
829
829
|
},
|
|
830
830
|
open: _
|
|
831
|
-
}, /* @__PURE__ */ r.createElement(
|
|
831
|
+
}, /* @__PURE__ */ r.createElement(qt.Provider, {
|
|
832
832
|
value: {
|
|
833
|
-
activeSnapPoint:
|
|
833
|
+
activeSnapPoint: se,
|
|
834
834
|
snapPoints: o,
|
|
835
|
-
setActiveSnapPoint:
|
|
836
|
-
drawerRef:
|
|
837
|
-
overlayRef:
|
|
835
|
+
setActiveSnapPoint: Lt,
|
|
836
|
+
drawerRef: d,
|
|
837
|
+
overlayRef: nt,
|
|
838
838
|
onOpenChange: n,
|
|
839
|
-
onPress:
|
|
840
|
-
onRelease:
|
|
841
|
-
onDrag:
|
|
839
|
+
onPress: fe,
|
|
840
|
+
onRelease: we,
|
|
841
|
+
onDrag: me,
|
|
842
842
|
dismissible: h,
|
|
843
|
-
shouldAnimate:
|
|
844
|
-
handleOnly:
|
|
843
|
+
shouldAnimate: It,
|
|
844
|
+
handleOnly: f,
|
|
845
845
|
isOpen: _,
|
|
846
846
|
isDragging: G,
|
|
847
|
-
shouldFade:
|
|
848
|
-
closeDrawer:
|
|
849
|
-
onNestedDrag:
|
|
850
|
-
onNestedOpenChange:
|
|
851
|
-
onNestedRelease:
|
|
852
|
-
keyboardIsOpen:
|
|
847
|
+
shouldFade: Bt,
|
|
848
|
+
closeDrawer: ct,
|
|
849
|
+
onNestedDrag: ge,
|
|
850
|
+
onNestedOpenChange: he,
|
|
851
|
+
onNestedRelease: ve,
|
|
852
|
+
keyboardIsOpen: rt,
|
|
853
853
|
modal: F,
|
|
854
|
-
snapPointsOffset:
|
|
855
|
-
activeSnapPointIndex:
|
|
856
|
-
direction:
|
|
857
|
-
shouldScaleBackground:
|
|
858
|
-
setBackgroundColorOnScale:
|
|
854
|
+
snapPointsOffset: ut,
|
|
855
|
+
activeSnapPointIndex: at,
|
|
856
|
+
direction: c,
|
|
857
|
+
shouldScaleBackground: v,
|
|
858
|
+
setBackgroundColorOnScale: w,
|
|
859
859
|
noBodyStyles: A,
|
|
860
|
-
container:
|
|
860
|
+
container: N,
|
|
861
861
|
autoFocus: j
|
|
862
862
|
}
|
|
863
|
-
},
|
|
863
|
+
}, e));
|
|
864
864
|
}
|
|
865
|
-
const
|
|
866
|
-
const { overlayRef:
|
|
867
|
-
if (!
|
|
865
|
+
const ne = /* @__PURE__ */ r.forwardRef(function({ ...t }, n) {
|
|
866
|
+
const { overlayRef: e, snapPoints: a, onRelease: i, shouldFade: o, isOpen: v, modal: w, shouldAnimate: T } = pt(), R = Gt(n, e), h = a && a.length > 0;
|
|
867
|
+
if (!w)
|
|
868
868
|
return null;
|
|
869
|
-
const
|
|
869
|
+
const f = r.useCallback((m) => i(m), [
|
|
870
870
|
i
|
|
871
871
|
]);
|
|
872
872
|
return /* @__PURE__ */ r.createElement(Z.Overlay, {
|
|
873
|
-
onMouseUp:
|
|
874
|
-
ref:
|
|
873
|
+
onMouseUp: f,
|
|
874
|
+
ref: R,
|
|
875
875
|
"data-vaul-overlay": "",
|
|
876
|
-
"data-vaul-snap-points":
|
|
877
|
-
"data-vaul-snap-points-overlay":
|
|
878
|
-
"data-vaul-animate":
|
|
879
|
-
...
|
|
876
|
+
"data-vaul-snap-points": v && h ? "true" : "false",
|
|
877
|
+
"data-vaul-snap-points-overlay": v && o ? "true" : "false",
|
|
878
|
+
"data-vaul-animate": T != null && T.current ? "true" : "false",
|
|
879
|
+
...t
|
|
880
880
|
});
|
|
881
881
|
});
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
const { drawerRef: o, onPress:
|
|
885
|
-
|
|
886
|
-
const
|
|
882
|
+
ne.displayName = "Drawer.Overlay";
|
|
883
|
+
const re = /* @__PURE__ */ r.forwardRef(function({ onPointerDownOutside: t, style: n, onOpenAutoFocus: e, ...a }, i) {
|
|
884
|
+
const { drawerRef: o, onPress: v, onRelease: w, onDrag: T, keyboardIsOpen: R, snapPointsOffset: h, activeSnapPointIndex: f, modal: m, isOpen: B, direction: k, snapPoints: E, container: F, handleOnly: p, shouldAnimate: M, autoFocus: A } = pt(), [c, Y] = r.useState(!1), tt = Gt(i, o), u = r.useRef(null), b = r.useRef(null), y = r.useRef(!1), I = E && E.length > 0;
|
|
885
|
+
We();
|
|
886
|
+
const N = (l, U, _ = 0) => {
|
|
887
887
|
if (y.current) return !0;
|
|
888
888
|
const W = Math.abs(l.y), P = Math.abs(l.x), K = P > W, G = [
|
|
889
889
|
"bottom",
|
|
@@ -902,96 +902,96 @@ const at = /* @__PURE__ */ r.forwardRef(function({ onPointerDownOutside: e, styl
|
|
|
902
902
|
});
|
|
903
903
|
}, []);
|
|
904
904
|
function j(l) {
|
|
905
|
-
|
|
905
|
+
u.current = null, y.current = !1, w(l);
|
|
906
906
|
}
|
|
907
907
|
return /* @__PURE__ */ r.createElement(Z.Content, {
|
|
908
908
|
"data-vaul-drawer-direction": k,
|
|
909
909
|
"data-vaul-drawer": "",
|
|
910
|
-
"data-vaul-delayed-snap-points":
|
|
910
|
+
"data-vaul-delayed-snap-points": c ? "true" : "false",
|
|
911
911
|
"data-vaul-snap-points": B && I ? "true" : "false",
|
|
912
912
|
"data-vaul-custom-container": F ? "true" : "false",
|
|
913
|
-
"data-vaul-animate":
|
|
913
|
+
"data-vaul-animate": M != null && M.current ? "true" : "false",
|
|
914
914
|
...a,
|
|
915
|
-
ref:
|
|
915
|
+
ref: tt,
|
|
916
916
|
style: h && h.length > 0 ? {
|
|
917
|
-
"--snap-point-height": `${h[
|
|
917
|
+
"--snap-point-height": `${h[f ?? 0]}px`,
|
|
918
918
|
...n
|
|
919
919
|
} : n,
|
|
920
920
|
onPointerDown: (l) => {
|
|
921
|
-
|
|
921
|
+
p || (a.onPointerDown == null || a.onPointerDown.call(a, l), u.current = {
|
|
922
922
|
x: l.pageX,
|
|
923
923
|
y: l.pageY
|
|
924
|
-
},
|
|
924
|
+
}, v(l));
|
|
925
925
|
},
|
|
926
926
|
onOpenAutoFocus: (l) => {
|
|
927
|
-
|
|
927
|
+
e == null || e(l), A || l.preventDefault();
|
|
928
928
|
},
|
|
929
929
|
onPointerDownOutside: (l) => {
|
|
930
|
-
if (
|
|
930
|
+
if (t == null || t(l), !m || l.defaultPrevented) {
|
|
931
931
|
l.preventDefault();
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
|
-
|
|
934
|
+
R.current && (R.current = !1);
|
|
935
935
|
},
|
|
936
936
|
onFocusOutside: (l) => {
|
|
937
|
-
if (!
|
|
937
|
+
if (!m) {
|
|
938
938
|
l.preventDefault();
|
|
939
939
|
return;
|
|
940
940
|
}
|
|
941
941
|
},
|
|
942
942
|
onPointerMove: (l) => {
|
|
943
|
-
if (
|
|
944
|
-
const U = l.pageY -
|
|
945
|
-
|
|
943
|
+
if (b.current = l, p || (a.onPointerMove == null || a.onPointerMove.call(a, l), !u.current)) return;
|
|
944
|
+
const U = l.pageY - u.current.y, _ = l.pageX - u.current.x, W = l.pointerType === "touch" ? 10 : 2;
|
|
945
|
+
N({
|
|
946
946
|
x: _,
|
|
947
947
|
y: U
|
|
948
|
-
}, k, W) ?
|
|
948
|
+
}, k, W) ? T(l) : (Math.abs(_) > W || Math.abs(U) > W) && (u.current = null);
|
|
949
949
|
},
|
|
950
950
|
onPointerUp: (l) => {
|
|
951
|
-
a.onPointerUp == null || a.onPointerUp.call(a, l),
|
|
951
|
+
a.onPointerUp == null || a.onPointerUp.call(a, l), u.current = null, y.current = !1, w(l);
|
|
952
952
|
},
|
|
953
953
|
onPointerOut: (l) => {
|
|
954
|
-
a.onPointerOut == null || a.onPointerOut.call(a, l), j(
|
|
954
|
+
a.onPointerOut == null || a.onPointerOut.call(a, l), j(b.current);
|
|
955
955
|
},
|
|
956
956
|
onContextMenu: (l) => {
|
|
957
|
-
a.onContextMenu == null || a.onContextMenu.call(a, l),
|
|
957
|
+
a.onContextMenu == null || a.onContextMenu.call(a, l), b.current && j(b.current);
|
|
958
958
|
}
|
|
959
959
|
});
|
|
960
960
|
});
|
|
961
|
-
|
|
962
|
-
const
|
|
963
|
-
const { closeDrawer: i, isDragging: o, snapPoints:
|
|
961
|
+
re.displayName = "Drawer.Content";
|
|
962
|
+
const Ye = 250, qe = 120, Xe = /* @__PURE__ */ r.forwardRef(function({ preventCycle: t = !1, children: n, ...e }, a) {
|
|
963
|
+
const { closeDrawer: i, isDragging: o, snapPoints: v, activeSnapPoint: w, setActiveSnapPoint: T, dismissible: R, handleOnly: h, isOpen: f, onPress: m, onDrag: B } = pt(), k = r.useRef(null), E = r.useRef(!1);
|
|
964
964
|
function F() {
|
|
965
965
|
if (E.current) {
|
|
966
966
|
A();
|
|
967
967
|
return;
|
|
968
968
|
}
|
|
969
969
|
window.setTimeout(() => {
|
|
970
|
-
|
|
971
|
-
},
|
|
970
|
+
p();
|
|
971
|
+
}, qe);
|
|
972
972
|
}
|
|
973
|
-
function
|
|
974
|
-
if (o ||
|
|
973
|
+
function p() {
|
|
974
|
+
if (o || t || E.current) {
|
|
975
975
|
A();
|
|
976
976
|
return;
|
|
977
977
|
}
|
|
978
|
-
if (A(), !
|
|
979
|
-
|
|
978
|
+
if (A(), !v || v.length === 0) {
|
|
979
|
+
R || i();
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
982
|
-
if (
|
|
982
|
+
if (w === v[v.length - 1] && R) {
|
|
983
983
|
i();
|
|
984
984
|
return;
|
|
985
985
|
}
|
|
986
|
-
const Y =
|
|
986
|
+
const Y = v.findIndex((u) => u === w);
|
|
987
987
|
if (Y === -1) return;
|
|
988
|
-
const
|
|
989
|
-
|
|
988
|
+
const tt = v[Y + 1];
|
|
989
|
+
T(tt);
|
|
990
990
|
}
|
|
991
|
-
function
|
|
991
|
+
function M() {
|
|
992
992
|
k.current = window.setTimeout(() => {
|
|
993
993
|
E.current = !0;
|
|
994
|
-
},
|
|
994
|
+
}, Ye);
|
|
995
995
|
}
|
|
996
996
|
function A() {
|
|
997
997
|
k.current && window.clearTimeout(k.current), E.current = !1;
|
|
@@ -999,156 +999,134 @@ const qt = 250, Xt = 120, ot = /* @__PURE__ */ r.forwardRef(function({ preventCy
|
|
|
999
999
|
return /* @__PURE__ */ r.createElement("div", {
|
|
1000
1000
|
onClick: F,
|
|
1001
1001
|
onPointerCancel: A,
|
|
1002
|
-
onPointerDown: (
|
|
1003
|
-
h &&
|
|
1002
|
+
onPointerDown: (c) => {
|
|
1003
|
+
h && m(c), M();
|
|
1004
1004
|
},
|
|
1005
|
-
onPointerMove: (
|
|
1006
|
-
h && B(
|
|
1005
|
+
onPointerMove: (c) => {
|
|
1006
|
+
h && B(c);
|
|
1007
1007
|
},
|
|
1008
1008
|
// onPointerUp is already handled by the content component
|
|
1009
1009
|
ref: a,
|
|
1010
|
-
"data-vaul-drawer-visible":
|
|
1010
|
+
"data-vaul-drawer-visible": f ? "true" : "false",
|
|
1011
1011
|
"data-vaul-handle": "",
|
|
1012
1012
|
"aria-hidden": "true",
|
|
1013
|
-
...
|
|
1013
|
+
...e
|
|
1014
1014
|
}, /* @__PURE__ */ r.createElement("span", {
|
|
1015
1015
|
"data-vaul-handle-hitarea": "",
|
|
1016
1016
|
"aria-hidden": "true"
|
|
1017
1017
|
}, n));
|
|
1018
1018
|
});
|
|
1019
|
-
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
if (!i)
|
|
1023
|
-
throw new Error("Drawer.NestedRoot must be placed in another drawer");
|
|
1024
|
-
return /* @__PURE__ */ r.createElement(nt, {
|
|
1025
|
-
nested: !0,
|
|
1026
|
-
open: t,
|
|
1027
|
-
onClose: () => {
|
|
1028
|
-
o(!1);
|
|
1029
|
-
},
|
|
1030
|
-
onDrag: (u, b) => {
|
|
1031
|
-
i(u, b), e == null || e(u, b);
|
|
1032
|
-
},
|
|
1033
|
-
onOpenChange: (u) => {
|
|
1034
|
-
u && o(u), n == null || n(u);
|
|
1035
|
-
},
|
|
1036
|
-
onRelease: g,
|
|
1037
|
-
...a
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
function Gt(e) {
|
|
1041
|
-
const n = ie(), { container: t = n.container, ...a } = e;
|
|
1019
|
+
Xe.displayName = "Drawer.Handle";
|
|
1020
|
+
function Ke(t) {
|
|
1021
|
+
const n = pt(), { container: e = n.container, ...a } = t;
|
|
1042
1022
|
return /* @__PURE__ */ r.createElement(Z.Portal, {
|
|
1043
|
-
container:
|
|
1023
|
+
container: e,
|
|
1044
1024
|
...a
|
|
1045
1025
|
});
|
|
1046
1026
|
}
|
|
1047
1027
|
const V = {
|
|
1048
|
-
Root:
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
Overlay: rt,
|
|
1028
|
+
Root: Ve,
|
|
1029
|
+
Content: re,
|
|
1030
|
+
Overlay: ne,
|
|
1052
1031
|
Trigger: Z.Trigger,
|
|
1053
|
-
Portal:
|
|
1054
|
-
Handle: ot,
|
|
1032
|
+
Portal: Ke,
|
|
1055
1033
|
Close: Z.Close,
|
|
1056
1034
|
Title: Z.Title,
|
|
1057
1035
|
Description: Z.Description
|
|
1058
|
-
},
|
|
1059
|
-
shouldScaleBackground:
|
|
1036
|
+
}, Ge = ({
|
|
1037
|
+
shouldScaleBackground: t = !0,
|
|
1060
1038
|
...n
|
|
1061
1039
|
}) => /* @__PURE__ */ X.jsx(
|
|
1062
1040
|
V.Root,
|
|
1063
1041
|
{
|
|
1064
|
-
shouldScaleBackground:
|
|
1042
|
+
shouldScaleBackground: t,
|
|
1065
1043
|
...n
|
|
1066
1044
|
}
|
|
1067
1045
|
);
|
|
1068
|
-
|
|
1069
|
-
const
|
|
1046
|
+
Ge.displayName = "Drawer";
|
|
1047
|
+
const sn = V.Trigger, Je = V.Portal, ln = V.Close, ae = mt.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ X.jsx(
|
|
1070
1048
|
V.Overlay,
|
|
1071
1049
|
{
|
|
1072
|
-
ref:
|
|
1073
|
-
className:
|
|
1050
|
+
ref: e,
|
|
1051
|
+
className: ot("fixed inset-0 z-50 bg-black/80", t),
|
|
1074
1052
|
...n
|
|
1075
1053
|
}
|
|
1076
1054
|
));
|
|
1077
|
-
|
|
1078
|
-
const
|
|
1079
|
-
({ className:
|
|
1080
|
-
/* @__PURE__ */ X.jsx(
|
|
1055
|
+
ae.displayName = V.Overlay.displayName;
|
|
1056
|
+
const Qe = mt.forwardRef(
|
|
1057
|
+
({ className: t, children: n, hideBar: e = !0, ...a }, i) => /* @__PURE__ */ X.jsxs(Je, { children: [
|
|
1058
|
+
/* @__PURE__ */ X.jsx(ae, {}),
|
|
1081
1059
|
/* @__PURE__ */ X.jsxs(
|
|
1082
1060
|
V.Content,
|
|
1083
1061
|
{
|
|
1084
1062
|
ref: i,
|
|
1085
|
-
className:
|
|
1063
|
+
className: ot(
|
|
1086
1064
|
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
|
|
1087
|
-
|
|
1065
|
+
t
|
|
1088
1066
|
),
|
|
1089
1067
|
...a,
|
|
1090
1068
|
children: [
|
|
1091
|
-
!
|
|
1069
|
+
!e && /* @__PURE__ */ X.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
|
|
1092
1070
|
n
|
|
1093
1071
|
]
|
|
1094
1072
|
}
|
|
1095
1073
|
)
|
|
1096
1074
|
] })
|
|
1097
1075
|
);
|
|
1098
|
-
|
|
1099
|
-
const
|
|
1100
|
-
className:
|
|
1076
|
+
Qe.displayName = "DrawerContent";
|
|
1077
|
+
const Ze = ({
|
|
1078
|
+
className: t,
|
|
1101
1079
|
...n
|
|
1102
1080
|
}) => /* @__PURE__ */ X.jsx(
|
|
1103
1081
|
"div",
|
|
1104
1082
|
{
|
|
1105
|
-
className:
|
|
1083
|
+
className: ot("grid gap-1.5 p-4 text-center sm:text-left", t),
|
|
1106
1084
|
...n
|
|
1107
1085
|
}
|
|
1108
1086
|
);
|
|
1109
|
-
|
|
1087
|
+
Ze.displayName = "DrawerHeader";
|
|
1110
1088
|
const tn = ({
|
|
1111
|
-
className:
|
|
1089
|
+
className: t,
|
|
1112
1090
|
...n
|
|
1113
1091
|
}) => /* @__PURE__ */ X.jsx(
|
|
1114
1092
|
"div",
|
|
1115
1093
|
{
|
|
1116
|
-
className:
|
|
1094
|
+
className: ot("mt-auto flex flex-col gap-2 p-4", t),
|
|
1117
1095
|
...n
|
|
1118
1096
|
}
|
|
1119
1097
|
);
|
|
1120
1098
|
tn.displayName = "DrawerFooter";
|
|
1121
|
-
const
|
|
1099
|
+
const en = mt.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ X.jsx(
|
|
1122
1100
|
V.Title,
|
|
1123
1101
|
{
|
|
1124
|
-
ref:
|
|
1125
|
-
className:
|
|
1102
|
+
ref: e,
|
|
1103
|
+
className: ot(
|
|
1126
1104
|
"text-lg font-semibold leading-none tracking-tight",
|
|
1127
|
-
|
|
1105
|
+
t
|
|
1128
1106
|
),
|
|
1129
1107
|
...n
|
|
1130
1108
|
}
|
|
1131
1109
|
));
|
|
1132
|
-
|
|
1133
|
-
const
|
|
1110
|
+
en.displayName = V.Title.displayName;
|
|
1111
|
+
const nn = mt.forwardRef(({ className: t, ...n }, e) => /* @__PURE__ */ X.jsx(
|
|
1134
1112
|
V.Description,
|
|
1135
1113
|
{
|
|
1136
|
-
ref:
|
|
1137
|
-
className:
|
|
1114
|
+
ref: e,
|
|
1115
|
+
className: ot("text-sm text-muted-foreground", t),
|
|
1138
1116
|
...n
|
|
1139
1117
|
}
|
|
1140
1118
|
));
|
|
1141
|
-
|
|
1119
|
+
nn.displayName = V.Description.displayName;
|
|
1142
1120
|
export {
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1121
|
+
Ge as Drawer,
|
|
1122
|
+
ln as DrawerClose,
|
|
1123
|
+
Qe as DrawerContent,
|
|
1124
|
+
nn as DrawerDescription,
|
|
1147
1125
|
tn as DrawerFooter,
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1126
|
+
Ze as DrawerHeader,
|
|
1127
|
+
ae as DrawerOverlay,
|
|
1128
|
+
Je as DrawerPortal,
|
|
1129
|
+
en as DrawerTitle,
|
|
1130
|
+
sn as DrawerTrigger
|
|
1153
1131
|
};
|
|
1154
1132
|
//# sourceMappingURL=Drawer.js.map
|