Comparing version 0.3.2 to 0.3.4
"use client" | ||
"use client";var Ke=Object.create;var J=Object.defineProperty;var Je=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var Ze=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var et=(e,t)=>{for(var n in t)J(e,n,{get:t[n],enumerable:!0})},ge=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qe(t))!Xe.call(e,o)&&o!==n&&J(e,o,{get:()=>t[o],enumerable:!(r=Je(t,o))||r.enumerable});return e};var U=(e,t,n)=>(n=e!=null?Ke(Ze(e)):{},ge(t||!e||!e.__esModule?J(n,"default",{value:e,enumerable:!0}):n,e)),tt=e=>ge(J({},"__esModule",{value:!0}),e);var Pt={};et(Pt,{Drawer:()=>At});module.exports=tt(Pt);var D=U(require("@radix-ui/react-dialog"));var A=U(require("react"));function he(e){let t=A.default.useRef(e);return A.default.useEffect(()=>{t.current=e}),A.default.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function nt({defaultProp:e,onChange:t}){let n=A.default.useState(e),[r]=n,o=A.default.useRef(r),i=he(t);return A.default.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function ye({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,o]=nt({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,d=he(n),b=A.default.useCallback(v=>{if(i){let m=typeof v=="function"?v(e):v;m!==e&&d(m)}else o(v)},[i,e,o,d]);return[a,b]}var ie=U(require("react")),ae=ie.default.createContext(void 0),Q=()=>ie.default.useContext(ae);var h=U(require("react"));function se(e,{insertAt:t}={}){if(!e||typeof document=="undefined")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}se(`[vaul-drawer]{will-change:transform;touch-action:none;animation:show-dialog .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer]:after{content:"";position:absolute;top:100%;background:inherit;background-color:inherit;left:0;right:0;height:200%}[vaul-drawer][data-state=closed]{animation:hide-dialog .5s cubic-bezier(.32,.72,0,1) forwards}[vaul-drawer][vaul-closed-by-dragging=true]{animation:fake-animation .5s cubic-bezier(.32,.72,0,1) forwards}[vaul-overlay]{animation:show-overlay .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-theme-transition=true]{animation:show-theme-overlay .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][data-state=closed]{animation:hide-overlay .5s cubic-bezier(.32,.72,0,1) forwards}[vaul-overlay][vaul-theme-transition=true][data-state=closed]{animation:hide-theme-overlay .5s cubic-bezier(.32,.72,0,1) forwards}@keyframes fake-animation{0%{opacity:1}to{opacity:1}}@keyframes show-dialog{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes hide-dialog{0%{transform:translateY(var(--hide-from, 0))}to{transform:translateY(var(--hide-to, 100%))}}@keyframes show-overlay{0%{opacity:0}to{opacity:1}}@keyframes hide-overlay{0%{opacity:var(--opacity-from, 1)}to{opacity:0}}@keyframes show-theme-overlay{0%{background:var(--vaul-overlay-background-start)}to{background:var(--vaul-overlay-background-end)}}@keyframes hide-theme-overlay{0%{background:var(--vaul-overlay-background-end)}to{background:var(--vaul-overlay-background-start)}}@media (hover: hover) and (pointer: fine){[vaul-drawer]{user-select:none}} | ||
`);var ee=require("react"),rt=typeof window!="undefined"?ee.useLayoutEffect:ee.useEffect;function ce(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function ot(){return me(/^Mac/)}function it(){return me(/^iPhone/)}function Ee(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function at(){return me(/^iPad/)||ot()&&navigator.maxTouchPoints>1}function _(){return it()||at()}function me(e){return typeof window!="undefined"&&window.navigator!=null?e.test(window.navigator.platform):void 0}var le=typeof document!="undefined"&&window.visualViewport;function Te(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Re(e){for(Te(e)&&(e=e.parentElement);e&&!Te(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var st=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),Z=0,ue;function Se(e={}){let{isDisabled:t}=e;rt(()=>{if(!t)return Z++,Z===1&&(_()?ue=ut():ue=lt()),()=>{Z--,Z===0&&ue()}},[t])}function lt(){return ce(W(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),W(document.documentElement,"overflow","hidden"))}function ut(){let e,t=0,n=m=>{e=Re(m.target),!(e===document.documentElement&&e===document.body)&&(t=m.changedTouches[0].pageY)},r=m=>{if(!e||e===document.documentElement||e===document.body){m.preventDefault();return}let u=m.changedTouches[0].pageY,M=e.scrollTop,T=e.scrollHeight-e.clientHeight;T!==0&&((M<=0&&u>t||M>=T&&u<t)&&m.preventDefault(),t=u)},o=m=>{let u=m.target;X(u)&&u!==document.activeElement&&(m.preventDefault(),u.style.transform="translateY(-2000px)",u.focus(),requestAnimationFrame(()=>{u.style.transform=""}))},i=m=>{let u=m.target;X(u)&&(u.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{u.style.transform="",le&&(le.height<window.innerHeight?requestAnimationFrame(()=>{we(u)}):le.addEventListener("resize",()=>we(u),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},d=window.pageXOffset,b=window.pageYOffset,v=ce(W(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),W(document.documentElement,"overflow","hidden"),W(document.body,"marginTop",`-${b}px`));window.scrollTo(0,0);let E=ce(j(document,"touchstart",n,{passive:!1,capture:!0}),j(document,"touchmove",r,{passive:!1,capture:!0}),j(document,"touchend",o,{passive:!1,capture:!0}),j(document,"focus",i,!0),j(window,"scroll",a));return()=>{v(),E(),window.scrollTo(d,b)}}function W(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function j(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function we(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Re(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=n.getBoundingClientRect().bottom;o>i&&(n.scrollTop+=o-r)}e=n.parentElement}}function X(e){return e instanceof HTMLInputElement&&!st.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var De=U(require("react"));function ct(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function mt(...e){return t=>e.forEach(n=>ct(n,t))}function fe(...e){return De.useCallback(mt(...e),e)}var C=U(require("react"));var ft=4,dt=.001,pt=1e-7,bt=10,q=11,te=1/(q-1),vt=typeof Float32Array=="function";function Ce(e,t){return 1-3*t+3*e}function Me(e,t){return 3*t-6*e}function xe(e){return 3*e}function ne(e,t,n){return((Ce(t,n)*e+Me(t,n))*e+xe(t))*e}function Ne(e,t,n){return 3*Ce(t,n)*e*e+2*Me(t,n)*e+xe(t)}function gt(e,t,n,r,o){var i,a,d=0;do a=t+(n-t)/2,i=ne(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>pt&&++d<bt);return a}function ht(e,t,n,r){for(var o=0;o<ft;++o){var i=Ne(t,n,r);if(i===0)return t;var a=ne(t,n,r)-e;t-=a/i}return t}function yt(e){return e}function He(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return yt;for(var o=vt?new Float32Array(q):new Array(q),i=0;i<q;++i)o[i]=ne(i*te,e,n);function a(d){for(var b=0,v=1,E=q-1;v!==E&&o[v]<=d;++v)b+=te;--v;var m=(d-o[v])/(o[v+1]-o[v]),u=b+m*te,M=Ne(u,e,n);return M>=dt?ht(d,u,e,n):M===0?u:gt(d,b,b+te,e,n)}return function(b){return b===0||b===1?b:ne(a(b),t,r)}}var Tt=He(.32,.72,0,1);function wt(e){let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+),\s*(\d*(?:\.\d+)?)\)/);if(!t)throw new Error("Invalid color string");return[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]}function Et(e,t){let[n,r,o,i]=wt(e);return[Math.round(i*n+(1-i)*Number(t[0])),Math.round(i*r+(1-i)*Number(t[1])),Math.round(i*o+(1-i)*Number(t[2]))]}function Rt(e){return Tt(e)}function St(e,t,n,r){arguments.length<3&&(n=.5);let o=e.slice();for(let i=0;i<3;i++){let a=t[i]-e[i],d=r?e[i]+n*a:e[i]+Rt(n)*a;o[i]=Math.round(d),o[i]<0&&(o[i]=0),o[i]>255&&(o[i]=255)}return o}function G(e,t,n,r){let o=1/(n-1),i=[];for(let a=0;a<n;a++)i.push(St(e,t,o*a,!!r));return i}function Oe(e,t,n,r){let[o,i]=C.default.useState([255,255,255]),[a,d]=C.default.useState([153,153,153]),[b,v]=C.default.useState(!1),[E,m]=C.default.useState(null),[u,M]=C.default.useState(null),T=C.default.useMemo(()=>_()&&Ee()&&r,[r]),P=C.default.useMemo(()=>o&&a?G(o,a,50):null,[a,o]),I=C.default.useMemo(()=>o&&a?G(a,o,50):null,[a,o]),g=C.default.useMemo(()=>o&&a?G(a,o,50,!0):null,[a,o]);C.default.useEffect(()=>{if(!T)return;let p=getComputedStyle(document.documentElement),R=p.getPropertyValue("--vaul-overlay-background").split(",").map(F=>Number(F)),w=p.getPropertyValue("--vaul-overlay-background-end"),l=Et(w,R);i(R),d(l)},[T]),C.default.useEffect(()=>{if(T&&!E){let p=document.querySelector('meta[name="theme-color"]');p?m(p.getAttribute("content")):(p=document.createElement("meta"),p.name="theme-color",document.getElementsByTagName("head")[0].appendChild(p)),M(p)}},[E,T]);let $=(0,C.useCallback)(p=>{let R,w;function l(F){R||(R=F);let z=F-R,L=Math.floor(z/10);if(t.current&&p&&!b){if(e.current.style.transform==="translateY(0px)"&&e.current.getAttribute("vaul-clicked-outside")!=="true")return;if(L<p.length){let oe=p[L];u==null||u.setAttribute("content",`rgb(${oe.join(",")})`),L===p.length-1&&E&&!n&&(u==null||u.setAttribute("content",E)),w=requestAnimationFrame(l)}}}return w=requestAnimationFrame(l),w},[e,n,u,b,E,t]);C.default.useEffect(()=>{if(!T||!P||!I)return;let p=$(n?P:I);return n&&v(!1),()=>{p&&cancelAnimationFrame(p)}},[n,T,$,P,I]);function K(p){let R=document.querySelector('meta[name="theme-color"]');if(!T||!R||!g)return;let w=Math.floor(p*g.length);w=Math.max(0,Math.min(g.length-1,w));let l=g[w];R.setAttribute("content",`rgb(${l.join(",")})`)}function k(p){let R=document.querySelector('meta[name="theme-color"]');if(!R||!T)return;v(!0);let w=R.getAttribute("content").match(/\d+/g).map(Number),l=G(w,a,50);!p&&o&&(l=G(w,o,50)),$(l)}return{onDrag:K,onRelease:k}}var Ie=require("react");var Y=null;function Dt(){if(Y===null){Y={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};let{scrollY:e,scrollX:t,innerHeight:n}=window;document.body.style.setProperty("position","fixed","important"),document.body.style.top=`${-e}px`,document.body.style.left=`${-t}px`,document.body.style.right="0px",setTimeout(()=>requestAnimationFrame(()=>{let r=n-window.innerHeight;r&&e>=n&&(document.body.style.top=`${-(e+r)}px`)}),300)}}function Ct(){if(Y!==null){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);document.body.style.position=Y.position,document.body.style.top=Y.top,document.body.style.left=Y.left,document.body.style.right="unset",requestAnimationFrame(()=>{window.scrollTo(t,e)}),Y=null}}function Le(e){(0,Ie.useEffect)(()=>{e&&_()?Dt():Ct()},[e])}var Mt=.25,xt=500,S={DURATION:.5,EASE:[.32,.72,0,1]},Nt=501,Ae=8,Ht=.4,B=16,Ot=26,Pe=new WeakMap;function It(e){let t=e.getBoundingClientRect();return window.visualViewport?t.top>=0&&t.left>=0&&t.bottom<=window.visualViewport.height+40&&t.right<=window.visualViewport.width:!1}function y(e,t,n=!1){if(!e||!(e instanceof HTMLElement)||!t)return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Pe.set(e,r)}function de(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Pe.get(e);if(!n){e.style={};return}t?e.style[t]=n[t]:Object.entries(n).forEach(([r,o])=>{e.style[r]=o})}function re(e){let t=window.getComputedStyle(e),n=t.transform||t.webkitTransform||t.mozTransform,r=n.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[13]):(r=n.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[5]):null)}function $e({open:e,defaultOpen:t,onOpenChange:n,children:r,shouldScaleBackground:o,onDrag:i,onRelease:a,experimentalSafariThemeAnimation:d,closeThreshold:b=Mt,scrollLockTimeout:v=xt,dismissible:E=!0}){let[m=!1,u]=ye({prop:e,defaultProp:t,onChange:n}),[M,T]=h.default.useState(!1),[P,I]=h.default.useState(!0),g=h.default.useRef(null),$=h.default.useRef(null),K=h.default.useRef(null),k=h.default.useRef(null),p=h.default.useRef(null),R=h.default.useRef(0),w=h.default.useRef(!1),l=h.default.useRef(null),{onDrag:F,onRelease:z}=Oe(l,g,m,d);Se({isDisabled:!m||M||P}),Le(m);function L(){return(window.innerWidth-Ot)/window.innerWidth}function oe(s){E&&(l.current&&!l.current.contains(s.target)||s.target.tagName==="BUTTON"||(T(!0),$.current=new Date,s.target.setPointerCapture(s.pointerId),R.current=s.clientY))}function pe(s,c){let f=s,x=new Date,N=window.getSelection().toString(),O=l.current?re(l.current):null;if(N.length>0)return!1;if(k.current&&x.getTime()-k.current.getTime()<v&&O===0)return k.current=new Date,!1;for(;f;){if(f.scrollHeight>f.clientHeight){if(f.role==="dialog"||f.getAttribute("vaul-drawer"))return!0;if(f.scrollTop>0)return k.current=new Date,!1;if(c&&f!==document.body&&!O)return k.current=new Date,!1}f=f.parentNode}return!0}function Be(s){var c;if(M){let f=R.current-s.clientY,x=f>0;if(!pe(s.target,x))return;let N=((c=l.current)==null?void 0:c.getBoundingClientRect().height)||0;if(y(l.current,{transition:"none"}),y(g.current,{transition:"none"}),f>0){y(l.current,{transform:`translateY(${Math.max(f*-1,-40)}px)`});return}let O=Math.abs(f),V=document.querySelector("[vaul-drawer-wrapper]"),H=O/N,We=1-H;if(F(H),i==null||i(s,H),y(g.current,{opacity:`${We}`},!0),V&&g.current&&o){let _e=Math.min(L()+H*(1-L()),1),qe=8-H*8,Ge=Math.max(0,14-H*14);y(V,{borderRadius:`${qe}px`,transform:`scale(${_e}) translateY(${Ge}px)`,transition:"none"},!0)}y(l.current,{transform:`translateY(${O}px)`})}}h.default.useEffect(()=>{function s(){var f,x;if(!l.current)return;let c=document.activeElement;if(!It(c)&&X(c)||w.current){let N=window.visualViewport.height,O=window.innerHeight-N,V=((f=l.current)==null?void 0:f.getBoundingClientRect().height)||0,H=(x=l.current)==null?void 0:x.getBoundingClientRect().top;w.current=!w.current,V>N?l.current.style.height=`${N-H}px`:l.current.style.height="initial",l.current.style.bottom=`${Math.max(O,0)}px`}}return window.visualViewport.addEventListener("resize",s),()=>window.visualViewport.removeEventListener("resize",s)},[]);function be(){var s;if(E&&(l.current.setAttribute("vaul-closed-by-dragging","true"),u(!1),l.current)){y(l.current,{transform:"translateY(100%)",transition:`transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`});let c=((s=g.current)==null?void 0:s.style.opacity)||1;y(g.current,{"--opacity-from":`${c}`})}}h.default.useEffect(()=>{if(!m&&o){let s=setTimeout(()=>{de(document.body)},200);return()=>clearTimeout(s)}},[m,o]);function ve(){let s=document.querySelector("[vaul-drawer-wrapper]"),c=re(l.current);y(l.current,{transform:"translateY(0px)",transition:`transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`}),y(g.current,{transition:`opacity ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,opacity:"1"}),o&&c>0&&m&&y(s,{borderRadius:`${Ae}px`,overflow:"hidden",transform:`scale(${L()}) translateY(calc(env(safe-area-inset-top) + 14px))`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${S.DURATION}s`,transitionTimingFunction:`cubic-bezier(${S.EASE.join(",")})`},!0)}function Fe(s){var H;if(s.target.tagName==="BUTTON"||!M)return;T(!1),K.current=new Date;let c=re(l.current);if(!pe(s.target,!1)||!c||Number.isNaN(c)||$.current===null)return;let f=s.clientY,x=K.current.getTime()-$.current.getTime(),N=R.current-f,O=Math.abs(N)/x;if(N>0){ve(),a==null||a(s,!0),z(!0);return}if(O>Ht){be(),a==null||a(s,!1),z(!1);return}let V=Math.min(((H=l.current)==null?void 0:H.getBoundingClientRect().height)||0,window.innerHeight);if(c>=V*b){be(),a==null||a(s,!1),z(!1);return}a==null||a(s,!0),z(!0),ve()}function ze(s){let c=document.querySelector("[vaul-drawer-wrapper]");!c||!o||(s.animationName==="show-dialog"?(y(document.body,{background:"black"},!0),y(c,{borderRadius:`${Ae}px`,overflow:"hidden",transform:`scale(${L()}) translateY(calc(env(safe-area-inset-top) + 14px))`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${S.DURATION}s`,transitionTimingFunction:`cubic-bezier(${S.EASE.join(",")})`})):(s.animationName==="hide-dialog"||s.animationName==="fake-animation")&&(de(c,"transform"),de(c,"borderRadius"),y(c,{transitionProperty:"transform, border-radius",transitionDuration:`${S.DURATION}s`,transitionTimingFunction:`cubic-bezier(${S.EASE.join(",")})`})))}function Ve(s){let c=s?(window.innerWidth-B)/window.innerWidth:1,f=s?-B:0;window.clearTimeout(p.current),y(l.current,{transition:`transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,transform:`scale(${c}) translateY(${f}px)`}),s||(p.current=setTimeout(()=>{y(l.current,{transition:"none",transform:`translateY(${re(l.current)}px)`})},500))}function Ue(s,c){if(c<0)return;let f=(window.innerWidth-B)/window.innerWidth,x=f+c*(1-f),N=-B+c*B;y(l.current,{transform:`scale(${x}) translateY(${N}px)`,transition:"none"})}function je(s,c){let f=c?(window.innerWidth-B)/window.innerWidth:1,x=c?-B:0;c&&y(l.current,{transition:`transform ${S.DURATION}s cubic-bezier(${S.EASE.join(",")})`,transform:`scale(${f}) translateY(${x}px)`})}return h.default.createElement(D.Root,{open:m,onOpenChange:s=>{u(s)}},h.default.createElement(ae.Provider,{value:{drawerRef:l,overlayRef:g,onAnimationStart:ze,onPress:oe,onRelease:Fe,onDrag:Be,dismissible:E,isOpen:m,onNestedDrag:Ue,onNestedOpenChange:Ve,onNestedRelease:je,keyboardIsOpen:w,setIsAnimating:I,experimentalSafariThemeAnimation:d}},r))}var ke=h.default.forwardRef(function({children:e,...t},n){let{overlayRef:r,onRelease:o,experimentalSafariThemeAnimation:i}=Q(),a=fe(n,r);return h.default.createElement(D.Overlay,{onMouseUp:o,ref:a,"vaul-overlay":"","vaul-theme-transition":i?"true":"false",...t})});ke.displayName="Drawer.Overlay";var Ye=h.default.forwardRef(function({children:e,onOpenAutoFocus:t,onPointerDownOutside:n,onAnimationEnd:r,...o},i){let{drawerRef:a,onPress:d,onRelease:b,onAnimationStart:v,onDrag:E,dismissible:m,isOpen:u,keyboardIsOpen:M,setIsAnimating:T}=Q(),P=fe(i,a),I=h.default.useRef(null);return h.default.createElement(D.Content,{onAnimationStart:g=>{window.clearTimeout(I.current),T(!0),I.current=setTimeout(()=>{T(!1),r==null||r(u)},Nt),v(g)},onPointerDown:d,onPointerUp:b,onPointerMove:E,onOpenAutoFocus:g=>{t?t(g):g.preventDefault()},onPointerDownOutside:g=>{M.current&&(M.current=!1,y(a.current,{"--hide-to":"200%"})),m||g.preventDefault(),a.current.setAttribute("vaul-clicked-outside","true"),n==null||n(g)},ref:P,...o,"vaul-drawer":""},e)});Ye.displayName="Drawer.Content";function Lt({children:e,onDrag:t,onOpenChange:n}){let{onNestedDrag:r,onNestedOpenChange:o,onNestedRelease:i}=Q();if(!r)throw new Error("Drawer.NestedRoot must be placed in another drawer");return h.default.createElement($e,{onDrag:(a,d)=>{r(a,d),t==null||t(a,d)},onOpenChange:a=>{o(a),n==null||n(a)},onRelease:i},e)}var At=Object.assign({},{Root:$e,NestedRoot:Lt,Content:Ye,Overlay:ke,Trigger:D.Trigger,Portal:D.Portal,Close:D.Close,Title:D.Title,Description:D.Description});0&&(module.exports={Drawer}); | ||
"use client";var Ze=Object.create;var Q=Object.defineProperty;var Xe=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,nt=Object.prototype.hasOwnProperty;var rt=(e,t)=>{for(var n in t)Q(e,n,{get:t[n],enumerable:!0})},ye=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of et(t))!nt.call(e,r)&&r!==n&&Q(e,r,{get:()=>t[r],enumerable:!(o=Xe(t,r))||o.enumerable});return e};var Y=(e,t,n)=>(n=e!=null?Ze(tt(e)):{},ye(t||!e||!e.__esModule?Q(n,"default",{value:e,enumerable:!0}):n,e)),ot=e=>ye(Q({},"__esModule",{value:!0}),e);var Pt={};rt(Pt,{Drawer:()=>At});module.exports=ot(Pt);var R=Y(require("@radix-ui/react-dialog"));var k=Y(require("react"));function we(e){let t=k.default.useRef(e);return k.default.useEffect(()=>{t.current=e}),k.default.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function it({defaultProp:e,onChange:t}){let n=k.default.useState(e),[o]=n,r=k.default.useRef(o),i=we(t);return k.default.useEffect(()=>{r.current!==o&&(i(o),r.current=o)},[o,r,i]),n}function Te({prop:e,defaultProp:t,onChange:n=()=>{}}){let[o,r]=it({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:o,m=we(n),b=k.default.useCallback(g=>{if(i){let l=typeof g=="function"?g(e):g;l!==e&&m(l)}else r(g)},[i,e,r,m]);return[a,b]}var se=Y(require("react")),le=se.default.createContext(void 0),Z=()=>se.default.useContext(le);var v=Y(require("react"));function ue(e,{insertAt:t}={}){if(!e||typeof document=="undefined")return;let n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",t==="top"&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}ue(`[vaul-drawer]{will-change:transform;touch-action:none;animation:show-dialog .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer]:after{content:"";position:absolute;top:100%;background:inherit;background-color:inherit;left:0;right:0;height:200%}[vaul-drawer][data-state=closed]{animation:hide-dialog .5s cubic-bezier(.32,.72,0,1) forwards}[vaul-drawer][vaul-closed-by-dragging=true]{animation:fake-animation .5s cubic-bezier(.32,.72,0,1) forwards}[vaul-overlay]{animation:show-overlay .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-theme-transition=true]{animation:show-theme-overlay .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][data-state=closed]{animation:hide-overlay .5s cubic-bezier(.32,.72,0,1) forwards}[vaul-overlay][vaul-theme-transition=true][data-state=closed]{animation:hide-theme-overlay .5s cubic-bezier(.32,.72,0,1) forwards}@keyframes fake-animation{0%{opacity:1}to{opacity:1}}@keyframes show-dialog{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes hide-dialog{0%{transform:translateY(var(--hide-from, 0))}to{transform:translateY(var(--hide-to, 100%))}}@keyframes show-overlay{0%{opacity:0}to{opacity:1}}@keyframes hide-overlay{0%{opacity:var(--opacity-from, 1)}to{opacity:0}}@keyframes show-theme-overlay{0%{background:var(--vaul-overlay-background-start)}to{background:var(--vaul-overlay-background-end)}}@keyframes hide-theme-overlay{0%{background:var(--vaul-overlay-background-end)}to{background:var(--vaul-overlay-background-start)}}@media (hover: hover) and (pointer: fine){[vaul-drawer]{user-select:none}} | ||
`);var ne=require("react"),at=typeof window!="undefined"?ne.useLayoutEffect:ne.useEffect;function me(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}function st(){return de(/^Mac/)}function lt(){return de(/^iPhone/)}function Se(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ut(){return de(/^iPad/)||st()&&navigator.maxTouchPoints>1}function q(){return lt()||ut()}function de(e){return typeof window!="undefined"&&window.navigator!=null?e.test(window.navigator.platform):void 0}var ce=typeof document!="undefined"&&window.visualViewport;function Ee(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function De(e){for(Ee(e)&&(e=e.parentElement);e&&!Ee(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var ct=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),X=0,fe;function Ce(e={}){let{isDisabled:t}=e;at(()=>{if(!t)return X++,X===1&&(q()?fe=mt():fe=ft()),()=>{X--,X===0&&fe()}},[t])}function ft(){return me(ee(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),ee(document.documentElement,"overflow","hidden"))}function mt(){let e,t=0,n=l=>{e=De(l.target),!(e===document.documentElement&&e===document.body)&&(t=l.changedTouches[0].pageY)},o=l=>{if(!e||e===document.documentElement||e===document.body){l.preventDefault();return}let u=l.changedTouches[0].pageY,x=e.scrollTop,w=e.scrollHeight-e.clientHeight;w!==0&&((x<=0&&u>t||x>=w&&u<t)&&l.preventDefault(),t=u)},r=l=>{let u=l.target;te(u)&&u!==document.activeElement&&(l.preventDefault(),u.style.transform="translateY(-2000px)",u.focus(),requestAnimationFrame(()=>{u.style.transform=""}))},i=l=>{let u=l.target;te(u)&&(u.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{u.style.transform="",ce&&(ce.height<window.innerHeight?requestAnimationFrame(()=>{Re(u)}):ce.addEventListener("resize",()=>Re(u),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},m=window.pageXOffset,b=window.pageYOffset,g=me(ee(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),ee(document.documentElement,"overflow","hidden"));window.scrollTo(0,0);let T=me(_(document,"touchstart",n,{passive:!1,capture:!0}),_(document,"touchmove",o,{passive:!1,capture:!0}),_(document,"touchend",r,{passive:!1,capture:!0}),_(document,"focus",i,!0),_(window,"scroll",a));return()=>{g(),T(),window.scrollTo(m,b)}}function ee(e,t,n){let o=e.style[t];return e.style[t]=n,()=>{e.style[t]=o}}function _(e,t,n,o){return e.addEventListener(t,n,o),()=>{e.removeEventListener(t,n,o)}}function Re(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=De(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let o=n.getBoundingClientRect().top,r=e.getBoundingClientRect().top,i=n.getBoundingClientRect().bottom;r>i&&(n.scrollTop+=r-o)}e=n.parentElement}}function te(e){return e instanceof HTMLInputElement&&!ct.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var Me=Y(require("react"));function dt(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function pt(...e){return t=>e.forEach(n=>dt(n,t))}function pe(...e){return Me.useCallback(pt(...e),e)}var C=Y(require("react"));var bt=4,vt=.001,gt=1e-7,ht=10,G=11,re=1/(G-1),yt=typeof Float32Array=="function";function xe(e,t){return 1-3*t+3*e}function Ne(e,t){return 3*t-6*e}function Le(e){return 3*e}function oe(e,t,n){return((xe(t,n)*e+Ne(t,n))*e+Le(t))*e}function Oe(e,t,n){return 3*xe(t,n)*e*e+2*Ne(t,n)*e+Le(t)}function wt(e,t,n,o,r){var i,a,m=0;do a=t+(n-t)/2,i=oe(a,o,r)-e,i>0?n=a:t=a;while(Math.abs(i)>gt&&++m<ht);return a}function Tt(e,t,n,o){for(var r=0;r<bt;++r){var i=Oe(t,n,o);if(i===0)return t;var a=oe(t,n,o)-e;t-=a/i}return t}function Et(e){return e}function He(e,t,n,o){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===o)return Et;for(var r=yt?new Float32Array(G):new Array(G),i=0;i<G;++i)r[i]=oe(i*re,e,n);function a(m){for(var b=0,g=1,T=G-1;g!==T&&r[g]<=m;++g)b+=re;--g;var l=(m-r[g])/(r[g+1]-r[g]),u=b+l*re,x=Oe(u,e,n);return x>=vt?Tt(m,u,e,n):x===0?u:wt(m,b,b+re,e,n)}return function(b){return b===0||b===1?b:oe(a(b),t,o)}}var Rt=He(.32,.72,0,1);function St(e){let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+),\s*(\d*(?:\.\d+)?)\)/);if(!t)throw new Error("Invalid color string");return[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]}function Dt(e,t){let[n,o,r,i]=St(e);return[Math.round(i*n+(1-i)*Number(t[0])),Math.round(i*o+(1-i)*Number(t[1])),Math.round(i*r+(1-i)*Number(t[2]))]}function Ct(e){return Rt(e)}function Mt(e,t,n,o){arguments.length<3&&(n=.5);let r=e.slice();for(let i=0;i<3;i++){let a=t[i]-e[i],m=o?e[i]+n*a:e[i]+Ct(n)*a;r[i]=Math.round(m),r[i]<0&&(r[i]=0),r[i]>255&&(r[i]=255)}return r}function K(e,t,n,o){let r=1/(n-1),i=[];for(let a=0;a<n;a++)i.push(Mt(e,t,r*a,!!o));return i}function Ie(e,t,n,o){let[r,i]=C.default.useState([255,255,255]),[a,m]=C.default.useState([153,153,153]),[b,g]=C.default.useState(!1),[T,l]=C.default.useState(null),[u,x]=C.default.useState(null),w=C.default.useMemo(()=>q()&&Se()&&o,[o]),I=C.default.useMemo(()=>r&&a?K(r,a,50):null,[a,r]),A=C.default.useMemo(()=>r&&a?K(a,r,50):null,[a,r]),S=C.default.useMemo(()=>r&&a?K(a,r,50,!0):null,[a,r]);C.default.useEffect(()=>{if(!w)return;let p=getComputedStyle(document.documentElement),y=p.getPropertyValue("--vaul-overlay-background").split(",").map(P=>Number(P)),D=p.getPropertyValue("--vaul-overlay-background-end"),M=Dt(D,y);i(y),m(M)},[w]),C.default.useEffect(()=>{if(w&&!T){let p=document.querySelector('meta[name="theme-color"]');p?l(p.getAttribute("content")):(p=document.createElement("meta"),p.name="theme-color",document.getElementsByTagName("head")[0].appendChild(p)),x(p)}},[T,w]);let U=(0,C.useCallback)(p=>{let y,D;function M(P){y||(y=P);let f=P-y,W=Math.floor(f/10);if(t.current&&p&&!b){if(e.current.style.transform==="translateY(0px)"&&e.current.getAttribute("vaul-clicked-outside")!=="true")return;if(W<p.length){let z=p[W];u==null||u.setAttribute("content",`rgb(${z.join(",")})`),W===p.length-1&&T&&!n&&(u==null||u.setAttribute("content",T)),D=requestAnimationFrame(M)}}}return D=requestAnimationFrame(M),D},[e,n,u,b,T,t]);C.default.useEffect(()=>{if(!w||!I||!A)return;let p=U(n?I:A);return n&&g(!1),()=>{p&&cancelAnimationFrame(p)}},[n,w,U,I,A]);function H(p){let y=document.querySelector('meta[name="theme-color"]');if(!w||!y||!S)return;let D=Math.floor(p*S.length);D=Math.max(0,Math.min(S.length-1,D));let M=S[D];y.setAttribute("content",`rgb(${M.join(",")})`)}function j(p){let y=document.querySelector('meta[name="theme-color"]');if(!y||!w)return;g(!0);let D=y.getAttribute("content").match(/\d+/g).map(Number),M=K(D,a,50);!p&&r&&(M=K(D,r,50)),U(M)}return{onDrag:H,onRelease:j}}var ie=Y(require("react"));var F=null;function Ae({isOpen:e,isFullyClosed:t}){let n=ie.default.useRef(0);function o(){if(F===null){F={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};let{scrollY:i,scrollX:a,innerHeight:m}=window;document.body.style.setProperty("position","fixed","important"),document.body.style.top=`${-n.current}px`,document.body.style.left=`${-a}px`,document.body.style.right="0px",setTimeout(()=>requestAnimationFrame(()=>{let b=m-window.innerHeight;b&&i>=m&&(document.body.style.top=`${-(n.current+b)}px`)}),300)}}function r(){if(F!==null){let i=-parseInt(document.body.style.top,10),a=-parseInt(document.body.style.left,10);document.body.style.position=F.position,document.body.style.top=F.top,document.body.style.left=F.left,document.body.style.right="unset",requestAnimationFrame(()=>{window.scrollTo(a,i)}),F=null}}ie.default.useEffect(()=>{function i(){n.current=window.scrollY}return window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}},[]),ie.default.useEffect(()=>{q()&&(e?o():t&&r())},[e,t])}var xt=.25,Nt=500,E={DURATION:.5,EASE:[.32,.72,0,1]},$e=501,Pe=8,Lt=.4,B=16,Ot=26,ke=new WeakMap;function Ht(e){let t=e.getBoundingClientRect();return window.visualViewport?t.top>=0&&t.left>=0&&t.bottom<=window.visualViewport.height+40&&t.right<=window.visualViewport.width:!1}function h(e,t,n=!1){if(!e||!(e instanceof HTMLElement)||!t)return;let o={};Object.entries(t).forEach(([r,i])=>{if(r.startsWith("--")){e.style.setProperty(r,i);return}o[r]=e.style[r],e.style[r]=i}),!n&&ke.set(e,o)}function be(e,t){if(!e||!(e instanceof HTMLElement))return;let n=ke.get(e);if(!n){e.style={};return}t?e.style[t]=n[t]:Object.entries(n).forEach(([o,r])=>{e.style[o]=r})}function ae(e){let t=window.getComputedStyle(e),n=t.transform||t.webkitTransform||t.mozTransform,o=n.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[13]):(o=n.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[5]):null)}function Ye({open:e,defaultOpen:t,onOpenChange:n,children:o,shouldScaleBackground:r,onDrag:i,onRelease:a,experimentalSafariThemeAnimation:m,closeThreshold:b=xt,scrollLockTimeout:g=Nt,dismissible:T=!0}){let[l=!1,u]=Te({prop:e,defaultProp:t,onChange:n}),[x,w]=v.default.useState(!0),[I,A]=v.default.useState(!1),[S,U]=v.default.useState(!0),H=v.default.useRef(null),j=v.default.useRef(null),p=v.default.useRef(null),y=v.default.useRef(null),D=v.default.useRef(null),M=v.default.useRef(0),P=v.default.useRef(!1),f=v.default.useRef(null),{onDrag:W,onRelease:z}=Ie(f,H,l,m);Ce({isDisabled:!l||I||S}),Ae({isOpen:l,isFullyClosed:x});function J(){return(window.innerWidth-Ot)/window.innerWidth}function ze(s){T&&(f.current&&!f.current.contains(s.target)||s.target.tagName==="BUTTON"||(A(!0),j.current=new Date,s.target.setPointerCapture(s.pointerId),M.current=s.clientY))}function ve(s,c){let d=s,N=new Date,L=window.getSelection().toString(),$=f.current?ae(f.current):null;if(L.length>0)return!1;if(y.current&&N.getTime()-y.current.getTime()<g&&$===0)return y.current=new Date,!1;for(;d;){if(d.scrollHeight>d.clientHeight){if(d.role==="dialog"||d.getAttribute("vaul-drawer"))return!0;if(d.scrollTop>0)return y.current=new Date,!1;if(c&&d!==document.body&&!$)return y.current=new Date,!1}d=d.parentNode}return!0}function Ve(s){var c;if(I){let d=M.current-s.clientY,N=d>0;if(!ve(s.target,N))return;let L=((c=f.current)==null?void 0:c.getBoundingClientRect().height)||0;if(h(f.current,{transition:"none"}),h(H.current,{transition:"none"}),d>0){h(f.current,{transform:`translateY(${Math.max(d*-1,-40)}px)`});return}let $=Math.abs(d),V=document.querySelector("[vaul-drawer-wrapper]"),O=$/L,Ge=1-O;if(W(O),i==null||i(s,O),h(H.current,{opacity:`${Ge}`},!0),V&&H.current&&r){let Ke=Math.min(J()+O*(1-J()),1),Je=8-O*8,Qe=Math.max(0,14-O*14);h(V,{borderRadius:`${Je}px`,transform:`scale(${Ke}) translateY(${Qe}px)`,transition:"none"},!0)}h(f.current,{transform:`translateY(${$}px)`})}}v.default.useEffect(()=>{function s(){var d,N;if(!f.current)return;let c=document.activeElement;if(!Ht(c)&&te(c)||P.current){let L=window.visualViewport.height,$=window.innerHeight-L,V=((d=f.current)==null?void 0:d.getBoundingClientRect().height)||0,O=(N=f.current)==null?void 0:N.getBoundingClientRect().top;P.current=!P.current,V>L?f.current.style.height=`${L-O}px`:f.current.style.height="initial",f.current.style.bottom=`${Math.max($,0)}px`}}return window.visualViewport.addEventListener("resize",s),()=>window.visualViewport.removeEventListener("resize",s)},[]),v.default.useEffect(()=>{if(l&&w(!1),!l){let s=setTimeout(()=>{w(!0)},$e);return()=>clearTimeout(s)}},[l,S]);function ge(){var s;if(T&&(f.current.setAttribute("vaul-closed-by-dragging","true"),u(!1),f.current)){h(f.current,{transform:"translateY(100%)",transition:`transform ${E.DURATION}s cubic-bezier(${E.EASE.join(",")})`});let c=((s=H.current)==null?void 0:s.style.opacity)||1;h(H.current,{"--opacity-from":`${c}`})}}v.default.useEffect(()=>{if(!l&&r){let s=setTimeout(()=>{be(document.body)},200);return()=>clearTimeout(s)}},[l,r]);function he(){let s=document.querySelector("[vaul-drawer-wrapper]"),c=ae(f.current);h(f.current,{transform:"translateY(0px)",transition:`transform ${E.DURATION}s cubic-bezier(${E.EASE.join(",")})`}),h(H.current,{transition:`opacity ${E.DURATION}s cubic-bezier(${E.EASE.join(",")})`,opacity:"1"}),r&&c>0&&l&&h(s,{borderRadius:`${Pe}px`,overflow:"hidden",transform:`scale(${J()}) translateY(calc(env(safe-area-inset-top) + 14px))`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${E.DURATION}s`,transitionTimingFunction:`cubic-bezier(${E.EASE.join(",")})`},!0)}function Ue(s){var O;if(s.target.tagName==="BUTTON"||!I)return;A(!1),p.current=new Date;let c=ae(f.current);if(!ve(s.target,!1)||!c||Number.isNaN(c)||j.current===null)return;let d=s.clientY,N=p.current.getTime()-j.current.getTime(),L=M.current-d,$=Math.abs(L)/N;if(L>0){he(),a==null||a(s,!0),z(!0);return}if($>Lt){ge(),a==null||a(s,!1),z(!1);return}let V=Math.min(((O=f.current)==null?void 0:O.getBoundingClientRect().height)||0,window.innerHeight);if(c>=V*b){ge(),a==null||a(s,!1),z(!1);return}a==null||a(s,!0),z(!0),he()}function je(s){let c=document.querySelector("[vaul-drawer-wrapper]");!c||!r||(s.animationName==="show-dialog"?(h(document.body,{background:"black"},!0),h(c,{borderRadius:`${Pe}px`,overflow:"hidden",transform:`scale(${J()}) translateY(calc(env(safe-area-inset-top) + 14px))`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${E.DURATION}s`,transitionTimingFunction:`cubic-bezier(${E.EASE.join(",")})`})):(s.animationName==="hide-dialog"||s.animationName==="fake-animation")&&(be(c,"transform"),be(c,"borderRadius"),h(c,{transitionProperty:"transform, border-radius",transitionDuration:`${E.DURATION}s`,transitionTimingFunction:`cubic-bezier(${E.EASE.join(",")})`})))}function We(s){let c=s?(window.innerWidth-B)/window.innerWidth:1,d=s?-B:0;window.clearTimeout(D.current),h(f.current,{transition:`transform ${E.DURATION}s cubic-bezier(${E.EASE.join(",")})`,transform:`scale(${c}) translateY(${d}px)`}),s||(D.current=setTimeout(()=>{h(f.current,{transition:"none",transform:`translateY(${ae(f.current)}px)`})},500))}function _e(s,c){if(c<0)return;let d=(window.innerWidth-B)/window.innerWidth,N=d+c*(1-d),L=-B+c*B;h(f.current,{transform:`scale(${N}) translateY(${L}px)`,transition:"none"})}function qe(s,c){let d=c?(window.innerWidth-B)/window.innerWidth:1,N=c?-B:0;c&&h(f.current,{transition:`transform ${E.DURATION}s cubic-bezier(${E.EASE.join(",")})`,transform:`scale(${d}) translateY(${N}px)`})}return v.default.createElement(R.Root,{open:l,onOpenChange:s=>{u(s)}},v.default.createElement(le.Provider,{value:{drawerRef:f,overlayRef:H,onAnimationStart:je,onPress:ze,onRelease:Ue,onDrag:Ve,dismissible:T,isOpen:l,onNestedDrag:_e,onNestedOpenChange:We,onNestedRelease:qe,keyboardIsOpen:P,setIsAnimating:U,experimentalSafariThemeAnimation:m}},o))}var Fe=v.default.forwardRef(function({children:e,...t},n){let{overlayRef:o,onRelease:r,experimentalSafariThemeAnimation:i}=Z(),a=pe(n,o);return v.default.createElement(R.Overlay,{onMouseUp:r,ref:a,"vaul-overlay":"","vaul-theme-transition":i?"true":"false",...t})});Fe.displayName="Drawer.Overlay";var Be=v.default.forwardRef(function({children:e,onOpenAutoFocus:t,onPointerDownOutside:n,onAnimationEnd:o,...r},i){let{drawerRef:a,onPress:m,onRelease:b,onAnimationStart:g,onDrag:T,dismissible:l,isOpen:u,keyboardIsOpen:x,setIsAnimating:w}=Z(),I=pe(i,a),A=v.default.useRef(null);return v.default.createElement(R.Content,{onAnimationStart:S=>{window.clearTimeout(A.current),w(!0),A.current=setTimeout(()=>{w(!1),o==null||o(u)},$e),g(S)},onPointerDown:m,onPointerUp:b,onPointerMove:T,onOpenAutoFocus:S=>{t?t(S):S.preventDefault()},onPointerDownOutside:S=>{x.current&&(x.current=!1,h(a.current,{"--hide-to":"200%"})),l||S.preventDefault(),a.current.setAttribute("vaul-clicked-outside","true"),n==null||n(S)},ref:I,...r,"vaul-drawer":""},e)});Be.displayName="Drawer.Content";function It({children:e,onDrag:t,onOpenChange:n}){let{onNestedDrag:o,onNestedOpenChange:r,onNestedRelease:i}=Z();if(!o)throw new Error("Drawer.NestedRoot must be placed in another drawer");return v.default.createElement(Ye,{onDrag:(a,m)=>{o(a,m),t==null||t(a,m)},onOpenChange:a=>{r(a),n==null||n(a)},onRelease:i},e)}var At=Object.assign({},{Root:Ye,NestedRoot:It,Content:Be,Overlay:Fe,Trigger:R.Trigger,Portal:R.Portal,Close:R.Close,Title:R.Title,Description:R.Description});0&&(module.exports={Drawer}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "vaul", | ||
"version": "0.3.2", | ||
"version": "0.3.4", | ||
"description": "Drawer component for React.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
210502
182