Socket
Socket
Sign inDemoInstall

vaul

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vaul - npm Package Compare versions

Comparing version 0.6.8 to 0.7.0

4

dist/index.js
"use client"
"use client";var ft=Object.create;var ie=Object.defineProperty;var dt=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var pt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var bt=(e,n)=>{for(var t in n)ie(e,t,{get:n[t],enumerable:!0})},Ne=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of mt(n))!gt.call(e,i)&&i!==t&&ie(e,i,{get:()=>n[i],enumerable:!(r=dt(n,i))||r.enumerable});return e};var U=(e,n,t)=>(t=e!=null?ft(pt(e)):{},Ne(n||!e||!e.__esModule?ie(t,"default",{value:e,enumerable:!0}):t,e)),vt=e=>Ne(ie({},"__esModule",{value:!0}),e);var At={};bt(At,{Drawer:()=>Lt});module.exports=vt(At);var S=U(require("@radix-ui/react-dialog")),c=U(require("react"));var ve=U(require("react")),he=ve.default.createContext({drawerRef:{current:null},overlayRef:{current:null},scaleBackground:()=>{},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},dismissible:!1,isOpen:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,modal:!1,shouldFade:!1,activeSnapPoint:null,setActiveSnapPoint:()=>{},visible:!1,closeDrawer:()=>{},setVisible:()=>{}}),ae=()=>ve.default.useContext(he);function we(e,{insertAt:n}={}){if(!e||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}we(`[vaul-drawer]{touch-action:none;transform:translate3d(0,100%,0);transition:transform .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer][vaul-drawer-visible=true]{transform:translate3d(0,var(--snap-point-height, 0),0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]:after{content:"";position:absolute;top:100%;background:inherit;background-color:inherit;left:0;right:0;height:200%}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay="true"]):not([data-state="closed"]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible="false"]){opacity:1}@keyframes fake-animation{}@media (hover: hover) and (pointer: fine){[vaul-drawer]{user-select:none}}
`);var ue=require("react"),ht=typeof window!="undefined"?ue.useLayoutEffect:ue.useEffect;function ye(...e){return(...n)=>{for(let t of e)typeof t=="function"&&t(...n)}}function wt(){return Se(/^Mac/)}function Et(){return Se(/^iPhone/)}function Tt(){return Se(/^iPad/)||wt()&&navigator.maxTouchPoints>1}function De(){return Et()||Tt()}function Se(e){return typeof window!="undefined"&&window.navigator!=null?e.test(window.navigator.platform):void 0}var Ee=typeof document!="undefined"&&window.visualViewport;function Pe(e){let n=window.getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY)}function Ve(e){for(Pe(e)&&(e=e.parentElement);e&&!Pe(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var yt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),le=0,Te;function je(e={}){let{isDisabled:n}=e;ht(()=>{if(!n)return le++,le===1&&(De()?Te=St():Te=Dt()),()=>{le--,le===0&&Te()}},[n])}function Dt(){return ye(se(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),se(document.documentElement,"overflow","hidden"))}function St(){let e,n=0,t=s=>{e=Ve(s.target),!(e===document.documentElement&&e===document.body)&&(n=s.changedTouches[0].pageY)},r=s=>{if(!e||e===document.documentElement||e===document.body){s.preventDefault();return}let o=s.changedTouches[0].pageY,L=e.scrollTop,H=e.scrollHeight-e.clientHeight;H!==0&&((L<=0&&o>n||L>=H&&o<n)&&s.preventDefault(),n=o)},i=s=>{let o=s.target;Z(o)&&o!==document.activeElement&&(s.preventDefault(),o.style.transform="translateY(-2000px)",o.focus(),requestAnimationFrame(()=>{o.style.transform=""}))},a=s=>{let o=s.target;Z(o)&&(o.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{o.style.transform="",Ee&&(Ee.height<window.innerHeight?requestAnimationFrame(()=>{Fe(o)}):Ee.addEventListener("resize",()=>Fe(o),{once:!0}))}))},f=()=>{window.scrollTo(0,0)},m=window.pageXOffset,w=window.pageYOffset,y=ye(se(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),se(document.documentElement,"overflow","hidden"));window.scrollTo(0,0);let M=ye(Q(document,"touchstart",t,{passive:!1,capture:!0}),Q(document,"touchmove",r,{passive:!1,capture:!0}),Q(document,"touchend",i,{passive:!1,capture:!0}),Q(document,"focus",a,!0),Q(window,"scroll",f));return()=>{y(),M(),window.scrollTo(m,w)}}function se(e,n,t){let r=e.style[n];return e.style[n]=t,()=>{e.style[n]=r}}function Q(e,n,t,r){return e.addEventListener(n,t,r),()=>{e.removeEventListener(n,t,r)}}function Fe(e){let n=document.scrollingElement||document.documentElement;for(;e&&e!==n;){let t=Ve(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,i=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom,f=t.getBoundingClientRect().bottom;a>f&&(t.scrollTop+=i-r)}e=t.parentElement}}function Z(e){return e instanceof HTMLInputElement&&!yt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var We=U(require("react"));function Rt(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function xt(...e){return n=>e.forEach(t=>Rt(t,n))}function Re(...e){return We.useCallback(xt(...e),e)}var ce=U(require("react")),F=null;function Ue({isOpen:e,modal:n,nested:t,hasBeenOpened:r}){let i=ce.default.useRef(0);function a(){if(F===null){F={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};let{scrollX:m,innerHeight:w}=window;document.body.style.setProperty("position","fixed","important"),document.body.style.top=`${-i.current}px`,document.body.style.left=`${-m}px`,document.body.style.right="0px",document.body.style.height="auto",setTimeout(()=>requestAnimationFrame(()=>{let y=w-window.innerHeight;y&&i.current>=w&&(document.body.style.top=`${-(i.current+y)}px`)}),300)}}function f(){if(F!==null){let m=-parseInt(document.body.style.top,10),w=-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.height=F.height,document.body.style.right="unset",requestAnimationFrame(()=>{window.scrollTo(w,m)}),F=null}}ce.default.useEffect(()=>{function m(){i.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),ce.default.useEffect(()=>{t||!r||(e?(a(),n||setTimeout(()=>{f()},500)):f())},[e])}var Y=U(require("react"));var Ye=new WeakMap;function h(e,n,t=!1){if(!e||!(e instanceof HTMLElement)||!n)return;let r={};Object.entries(n).forEach(([i,a])=>{if(i.startsWith("--")){e.style.setProperty(i,a);return}r[i]=e.style[i],e.style[i]=a}),!t&&Ye.set(e,r)}function fe(e,n){if(!e||!(e instanceof HTMLElement))return;let t=Ye.get(e);t&&(n?e.style[n]=t[n]:Object.entries(t).forEach(([r,i])=>{e.style[r]=i}))}function ee(e){let n=window.getComputedStyle(e),t=n.transform||n.webkitTransform||n.mozTransform,r=t.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[13]):(r=t.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[5]):null)}function Be(e){return 8*(Math.log(e+1)-2)}var g={DURATION:.5,EASE:[.32,.72,0,1]},de=.4;var V=U(require("react"));function ke(e){let n=V.default.useRef(e);return V.default.useEffect(()=>{n.current=e}),V.default.useMemo(()=>(...t)=>{var r;return(r=n.current)==null?void 0:r.call(n,...t)},[])}function Mt({defaultProp:e,onChange:n}){let t=V.default.useState(e),[r]=t,i=V.default.useRef(r),a=ke(n);return V.default.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),t}function ze({prop:e,defaultProp:n,onChange:t=()=>{}}){let[r,i]=Mt({defaultProp:n,onChange:t}),a=e!==void 0,f=a?e:r,m=ke(t),w=V.default.useCallback(y=>{if(a){let s=typeof y=="function"?y(e):y;s!==e&&m(s)}else i(y)},[a,e,i,m]);return[f,w]}function _e({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:t,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:f}){let[m,w]=ze({prop:e,defaultProp:t==null?void 0:t[0],onChange:n}),y=Y.default.useMemo(()=>m===(t==null?void 0:t[t.length-1]),[t,m]),M=t&&t.length>0&&a&&t[a]===m||!t,s=Y.default.useMemo(()=>{var b;return(b=t==null?void 0:t.findIndex(p=>p===m))!=null?b:null},[t,m]),o=Y.default.useMemo(()=>{var b;return(b=t==null?void 0:t.map(p=>{let T=typeof window!="undefined",A=typeof p=="string",O=0;A&&(O=parseInt(p,10));let P=A?O:T?p*window.innerHeight:0;return T?window.innerHeight-P:P}))!=null?b:[]},[t]),L=Y.default.useMemo(()=>s!==null?o==null?void 0:o[s]:null,[o,s]),H=Y.default.useCallback(b=>{var T;let p=(T=o==null?void 0:o.findIndex(A=>A===b))!=null?T:null;f(p),h(r.current,{transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,transform:`translate3d(0, ${b}px, 0)`}),o&&p!==o.length-1&&p!==a?h(i.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,opacity:"0"}):h(i.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,opacity:"1"}),w(p!==null?t==null?void 0:t[p]:null)},[r,t,o,a,i,w]);Y.default.useEffect(()=>{var b;if(e){let p=(b=t==null?void 0:t.findIndex(T=>T===e))!=null?b:null;o&&p&&typeof o[p]=="number"&&H(o[p])}},[e,t,o,H]);function N({draggedDistance:b,closeDrawer:p,velocity:T}){if(a===void 0)return;let A=L-b,O=s===a-1,P=s===0;if(O&&h(i.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),T>2&&b<0){p();return}if(T>2&&b>0&&o&&t){H(o[t.length-1]);return}let k=o==null?void 0:o.reduce((C,z)=>typeof C!="number"||typeof z!="number"?C:Math.abs(z-A)<Math.abs(C-A)?z:C);if(T>de&&Math.abs(b)<window.innerHeight*.4){let C=b>0?1:-1;if(C>0&&y){H(o[t.length-1]);return}if(P&&C<0&&p(),s===null)return;H(o[s+C]);return}H(k)}function j({draggedDistance:b}){if(L===null)return;let p=L-b;h(r.current,{transform:`translate3d(0, ${p}px, 0)`})}function R(b,p){if(!t||typeof s!="number"||!o||a===void 0)return null;let T=s===a-1;if(s>=a&&p)return 0;if(T&&!p)return 1;if(!M&&!T)return null;let O=T?s+1:s-1,P=T?o[O]-o[O-1]:o[O+1]-o[O],k=b/Math.abs(P);return T?1-k:k}return{isLastSnapPoint:y,activeSnapPoint:m,shouldFade:M,getPercentageDragged:R,setActiveSnapPoint:w,activeSnapPointIndex:s,onRelease:N,onDrag:j,snapPointsOffset:o}}var Ht=.25,Ot=500,qe=8,B=16,Ke=26;function Xe({open:e,onOpenChange:n,children:t,shouldScaleBackground:r,onDrag:i,onRelease:a,snapPoints:f,nested:m,closeThreshold:w=Ht,scrollLockTimeout:y=Ot,dismissible:M=!0,fadeFromIndex:s=f&&f.length-1,activeSnapPoint:o,setActiveSnapPoint:L,fixed:H,modal:N=!0,onClose:j}){var Ie;let[R=!1,b]=c.default.useState(!1),[p,T]=c.default.useState(!1),[A,O]=c.default.useState(!1),[P,k]=c.default.useState(!1),[C,z]=c.default.useState(!1),[Qe,xe]=c.default.useState(!1),W=c.default.useRef(null),te=c.default.useRef(null),me=c.default.useRef(null),Me=c.default.useRef(null),K=c.default.useRef(null),X=c.default.useRef(!1),pe=c.default.useRef(null),ge=c.default.useRef(0),_=c.default.useRef(!1),He=c.default.useRef(0),d=c.default.useRef(null),Oe=c.default.useRef(((Ie=d.current)==null?void 0:Ie.getBoundingClientRect().height)||0),Ze=(0,c.useCallback)(l=>{f&&l===J.length-1&&(te.current=new Date)},[]),{activeSnapPoint:et,activeSnapPointIndex:G,setActiveSnapPoint:Ce,onRelease:tt,snapPointsOffset:J,onDrag:nt,shouldFade:Le,getPercentageDragged:rt}=_e({snapPoints:f,activeSnapPointProp:o,setActiveSnapPointProp:L,drawerRef:d,fadeFromIndex:s,overlayRef:W,onSnapPointChange:Ze});je({isDisabled:!R||C||!N||Qe||!p}),Ue({isOpen:R,modal:N,nested:m,hasBeenOpened:p});function ne(){return(window.innerWidth-Ke)/window.innerWidth}function ot(l){var u;!M&&!f||d.current&&!d.current.contains(l.target)||(Oe.current=((u=d.current)==null?void 0:u.getBoundingClientRect().height)||0,z(!0),me.current=new Date,De()&&window.addEventListener("touchend",()=>X.current=!1,{once:!0}),l.target.setPointerCapture(l.pointerId),ge.current=l.clientY)}function Ae(l,u){var $;let v=l,x=new Date,D=($=window.getSelection())==null?void 0:$.toString(),E=d.current?ee(d.current):null;if(te.current&&x.getTime()-te.current.getTime()<500)return!1;if(E>0)return!0;if(D&&D.length>0)return!1;if(K.current&&x.getTime()-K.current.getTime()<y&&E===0)return K.current=new Date,!1;for(;v;){if(v.scrollHeight>v.clientHeight){if(v.getAttribute("role")==="dialog")return!0;if(u&&v!==document.body&&!E&&E>=0)return K.current=new Date,!1;if(v.scrollTop!==0)return K.current=new Date,!1}v=v.parentNode}return!0}function it(l){if(C){let u=ge.current-l.clientY,v=u>0;if(f&&G===0&&!M||!X.current&&!Ae(l.target,v))return;if(X.current=!0,h(d.current,{transition:"none"}),h(W.current,{transition:"none"}),f&&nt({draggedDistance:u}),u>0&&!f){let I=Be(u);h(d.current,{transform:`translate3d(0, ${Math.min(I*-1,0)}px, 0)`});return}let x=Math.abs(u),D=document.querySelector("[vaul-drawer-wrapper]"),E=x/Oe.current,$=rt(x,v);$!==null&&(E=$);let be=1-E;if((Le||s&&G===s-1)&&(i==null||i(l,E),h(W.current,{opacity:`${be}`,transition:"none"},!0)),D&&W.current&&r){let I=Math.min(ne()+E*(1-ne()),1),oe=8-E*8,ct=Math.max(0,14-E*14);h(D,{borderRadius:`${oe}px`,transform:`scale(${I}) translate3d(0, ${ct}px, 0)`,transition:"none"},!0)}f||h(d.current,{transform:`translate3d(0, ${x}px, 0)`})}}c.default.useEffect(()=>{if(document.querySelector("[vaul-drawer-wrapper]"))return()=>re(!1)},[]),c.default.useEffect(()=>{var u;function l(){var x;if(!d.current)return;let v=document.activeElement;if(Z(v)||_.current){let D=((x=window.visualViewport)==null?void 0:x.height)||0,E=window.innerHeight-D,$=d.current.getBoundingClientRect().height||0,be=d.current.getBoundingClientRect().top;if(Math.abs(He.current-E)>60&&(_.current=!_.current),f&&f.length>0&&J&&G){let I=J[G]||0;E+=I}if(He.current=E,$>D||_.current){let I=d.current.getBoundingClientRect().height,oe=I;I>D&&(oe=D-Ke),H?d.current.style.height=`${I-Math.max(E,0)}px`:d.current.style.height=`${Math.max(oe,D-be)}px`}else d.current.style.height="initial";f&&f.length>0&&!_.current?d.current.style.bottom="0px":d.current.style.bottom=`${Math.max(E,0)}px`}}return(u=window.visualViewport)==null||u.addEventListener("resize",l),()=>{var v;return(v=window.visualViewport)==null?void 0:v.removeEventListener("resize",l)}},[G,f,J]);function q(){d.current&&(j==null||j(),d.current&&(h(d.current,{transform:"translate3d(0, 100%, 0)",transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),h(W.current,{opacity:"0",transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),re(!1)),setTimeout(()=>{O(!1),b(!1)},300),setTimeout(()=>{f&&Ce(f[0])},500))}c.default.useEffect(()=>{if(!R&&r){let l=setTimeout(()=>{fe(document.body)},200);return()=>clearTimeout(l)}},[R,r]),c.default.useEffect(()=>{e?(b(!0),T(!0)):q()},[e]),c.default.useEffect(()=>{P&&(n==null||n(R))},[R]),c.default.useEffect(()=>{k(!0)},[]);function $e(){if(!d.current)return;let l=document.querySelector("[vaul-drawer-wrapper]"),u=ee(d.current);h(d.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),h(W.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,opacity:"1"}),r&&u&&u>0&&R&&h(l,{borderRadius:`${qe}px`,overflow:"hidden",transform:`scale(${ne()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${g.DURATION}s`,transitionTimingFunction:`cubic-bezier(${g.EASE.join(",")})`},!0)}function at(l){if(!C||!d.current)return;X.current&&Z(l.target)&&l.target.blur(),X.current=!1,z(!1),Me.current=new Date;let u=ee(d.current);if(!Ae(l.target,!1)||!u||Number.isNaN(u)||me.current===null)return;let v=l.clientY,x=Me.current.getTime()-me.current.getTime(),D=ge.current-v,E=Math.abs(D)/x;if(E>.05&&(xe(!0),setTimeout(()=>{xe(!1)},200)),f){tt({draggedDistance:D,closeDrawer:q,velocity:E});return}if(D>0){$e(),a==null||a(l,!0);return}if(E>de){q(),a==null||a(l,!1);return}let $=Math.min(d.current.getBoundingClientRect().height||0,window.innerHeight);if(u>=$*w){q(),a==null||a(l,!1);return}a==null||a(l,!0),$e()}c.default.useEffect(()=>{R&&(te.current=new Date,re(!0))},[R]);function re(l){let u=document.querySelector("[vaul-drawer-wrapper]");!u||!r||(l?(h(document.body,{background:"black"},!0),h(u,{borderRadius:`${qe}px`,overflow:"hidden",transform:`scale(${ne()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${g.DURATION}s`,transitionTimingFunction:`cubic-bezier(${g.EASE.join(",")})`})):(fe(u,"transform"),fe(u,"borderRadius"),h(u,{transitionProperty:"transform, border-radius",transitionDuration:`${g.DURATION}s`,transitionTimingFunction:`cubic-bezier(${g.EASE.join(",")})`})))}function lt(l){let u=l?(window.innerWidth-B)/window.innerWidth:1,v=l?-B:0;pe.current&&window.clearTimeout(pe.current),h(d.current,{transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,transform:`scale(${u}) translate3d(0, ${v}px, 0)`}),!l&&d.current&&(pe.current=setTimeout(()=>{h(d.current,{transition:"none",transform:`translate3d(0, ${ee(d.current)}px, 0)`})},500))}function st(l,u){if(u<0)return;let v=(window.innerWidth-B)/window.innerWidth,x=v+u*(1-v),D=-B+u*B;h(d.current,{transform:`scale(${x}) translate3d(0, ${D}px, 0)`,transition:"none"})}function ut(l,u){let v=u?(window.innerWidth-B)/window.innerWidth:1,x=u?-B:0;u&&h(d.current,{transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,transform:`scale(${v}) translate3d(0, ${x}px, 0)`})}return c.default.createElement(S.Root,{modal:N,onOpenChange:l=>{l?(T(!0),b(l)):q()},open:R},c.default.createElement(he.Provider,{value:{visible:A,activeSnapPoint:et,snapPoints:f,setActiveSnapPoint:Ce,drawerRef:d,overlayRef:W,scaleBackground:re,onPress:ot,setVisible:O,onRelease:at,onDrag:it,dismissible:M,isOpen:R,shouldFade:Le,closeDrawer:q,onNestedDrag:st,onNestedOpenChange:lt,onNestedRelease:ut,keyboardIsOpen:_,modal:N,snapPointsOffset:J}},t))}var Ge=c.default.forwardRef(function({children:e,style:n,...t},r){let{overlayRef:i,snapPoints:a,onRelease:f,shouldFade:m,isOpen:w,visible:y}=ae(),M=Re(r,i),s=a&&a.length>0;return c.default.createElement(S.Overlay,{onMouseUp:f,ref:M,"vaul-drawer-visible":y?"true":"false","vaul-overlay":"","vaul-snap-points":w&&s?"true":"false","vaul-snap-points-overlay":w&&m?"true":"false",...t})});Ge.displayName="Drawer.Overlay";var Je=c.default.forwardRef(function({children:e,onOpenAutoFocus:n,onPointerDownOutside:t,onAnimationEnd:r,style:i,...a},f){let{drawerRef:m,onPress:w,onRelease:y,onDrag:M,dismissible:s,keyboardIsOpen:o,snapPointsOffset:L,visible:H,closeDrawer:N,modal:j,setVisible:R}=ae(),b=Re(f,m);return c.default.useEffect(()=>{R(!0)},[]),c.default.createElement(S.Content,{onOpenAutoFocus:p=>{n?n(p):(p.preventDefault(),m.current.focus())},onPointerDown:w,onPointerDownOutside:p=>{if(!j){p.preventDefault();return}o.current&&(o.current=!1),p.preventDefault(),s&&(N(),t==null||t(p))},onPointerMove:M,onPointerUp:y,ref:b,style:L?{"--snap-point-height":`${L[0]}px`,...i}:i,...a,"vaul-drawer":"","vaul-drawer-visible":H?"true":"false"},e)});Je.displayName="Drawer.Content";function Ct({children:e,onDrag:n,onOpenChange:t,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:f}=ae();if(!i)throw new Error("Drawer.NestedRoot must be placed in another drawer");return c.default.createElement(Xe,{nested:!0,onClose:()=>{a(!1)},onDrag:(m,w)=>{i(m,w),n==null||n(m,w)},onOpenChange:m=>{m&&a(m),t==null||t(m)},onRelease:f,...r},e)}var Lt={Root:Xe,NestedRoot:Ct,Content:Je,Overlay:Ge,Trigger:S.Trigger,Portal:S.Portal,Close:S.Close,Title:S.Title,Description:S.Description};0&&(module.exports={Drawer});
"use client";var dt=Object.create;var ie=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,bt=Object.prototype.hasOwnProperty;var vt=(e,n)=>{for(var t in n)ie(e,t,{get:n[t],enumerable:!0})},Pe=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of pt(n))!bt.call(e,i)&&i!==t&&ie(e,i,{get:()=>n[i],enumerable:!(r=mt(n,i))||r.enumerable});return e};var U=(e,n,t)=>(t=e!=null?dt(gt(e)):{},Pe(n||!e||!e.__esModule?ie(t,"default",{value:e,enumerable:!0}):t,e)),ht=e=>Pe(ie({},"__esModule",{value:!0}),e);var $t={};vt($t,{Drawer:()=>At});module.exports=ht($t);var S=U(require("@radix-ui/react-dialog")),c=U(require("react"));var he=U(require("react")),we=he.default.createContext({drawerRef:{current:null},overlayRef:{current:null},scaleBackground:()=>{},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},dismissible:!1,isOpen:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,modal:!1,shouldFade:!1,activeSnapPoint:null,setActiveSnapPoint:()=>{},visible:!1,closeDrawer:()=>{},setVisible:()=>{}}),ae=()=>he.default.useContext(we);function Ee(e,{insertAt:n}={}){if(!e||typeof document=="undefined")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Ee(`[vaul-drawer]{touch-action:none;transform:translate3d(0,100%,0);transition:transform .5s cubic-bezier(.32,.72,0,1)}[vaul-drawer][vaul-drawer-visible=true]{transform:translate3d(0,var(--snap-point-height, 0),0)}[vaul-overlay]{opacity:0;transition:opacity .5s cubic-bezier(.32,.72,0,1)}[vaul-overlay][vaul-drawer-visible=true]{opacity:1}[vaul-drawer]:after{content:"";position:absolute;top:100%;background:inherit;background-color:inherit;left:0;right:0;height:200%}[vaul-overlay][vaul-snap-points=true]:not([vaul-snap-points-overlay="true"]):not([data-state="closed"]){opacity:0}[vaul-overlay][vaul-snap-points-overlay=true]:not([vaul-drawer-visible="false"]){opacity:1}@keyframes fake-animation{}@media (hover: hover) and (pointer: fine){[vaul-drawer]{user-select:none}}
`);var ue=require("react"),wt=typeof window!="undefined"?ue.useLayoutEffect:ue.useEffect;function De(...e){return(...n)=>{for(let t of e)typeof t=="function"&&t(...n)}}function Et(){return Re(/^Mac/)}function Tt(){return Re(/^iPhone/)}function yt(){return Re(/^iPad/)||Et()&&navigator.maxTouchPoints>1}function Se(){return Tt()||yt()}function Re(e){return typeof window!="undefined"&&window.navigator!=null?e.test(window.navigator.platform):void 0}var Te=typeof document!="undefined"&&window.visualViewport;function Fe(e){let n=window.getComputedStyle(e);return/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY)}function je(e){for(Fe(e)&&(e=e.parentElement);e&&!Fe(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var Dt=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),le=0,ye;function We(e={}){let{isDisabled:n}=e;wt(()=>{if(!n)return le++,le===1&&(Se()?ye=Rt():ye=St()),()=>{le--,le===0&&ye()}},[n])}function St(){return De(se(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),se(document.documentElement,"overflow","hidden"))}function Rt(){let e,n=0,t=s=>{e=je(s.target),!(e===document.documentElement&&e===document.body)&&(n=s.changedTouches[0].pageY)},r=s=>{if(!e||e===document.documentElement||e===document.body){s.preventDefault();return}let o=s.changedTouches[0].pageY,O=e.scrollTop,H=e.scrollHeight-e.clientHeight;H!==0&&((O<=0&&o>n||O>=H&&o<n)&&s.preventDefault(),n=o)},i=s=>{let o=s.target;Z(o)&&o!==document.activeElement&&(s.preventDefault(),o.style.transform="translateY(-2000px)",o.focus(),requestAnimationFrame(()=>{o.style.transform=""}))},a=s=>{let o=s.target;Z(o)&&(o.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{o.style.transform="",Te&&(Te.height<window.innerHeight?requestAnimationFrame(()=>{Ve(o)}):Te.addEventListener("resize",()=>Ve(o),{once:!0}))}))},f=()=>{window.scrollTo(0,0)},m=window.pageXOffset,w=window.pageYOffset,y=De(se(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),se(document.documentElement,"overflow","hidden"));window.scrollTo(0,0);let M=De(Q(document,"touchstart",t,{passive:!1,capture:!0}),Q(document,"touchmove",r,{passive:!1,capture:!0}),Q(document,"touchend",i,{passive:!1,capture:!0}),Q(document,"focus",a,!0),Q(window,"scroll",f));return()=>{y(),M(),window.scrollTo(m,w)}}function se(e,n,t){let r=e.style[n];return e.style[n]=t,()=>{e.style[n]=r}}function Q(e,n,t,r){return e.addEventListener(n,t,r),()=>{e.removeEventListener(n,t,r)}}function Ve(e){let n=document.scrollingElement||document.documentElement;for(;e&&e!==n;){let t=je(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let r=t.getBoundingClientRect().top,i=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom,f=t.getBoundingClientRect().bottom;a>f&&(t.scrollTop+=i-r)}e=t.parentElement}}function Z(e){return e instanceof HTMLInputElement&&!Dt.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}var Ue=U(require("react"));function xt(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function Mt(...e){return n=>e.forEach(t=>xt(t,n))}function xe(...e){return Ue.useCallback(Mt(...e),e)}var ce=U(require("react")),F=null;function Ye({isOpen:e,modal:n,nested:t,hasBeenOpened:r}){let i=ce.default.useRef(0);function a(){if(F===null){F={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height};let{scrollX:m,innerHeight:w}=window;document.body.style.setProperty("position","fixed","important"),document.body.style.top=`${-i.current}px`,document.body.style.left=`${-m}px`,document.body.style.right="0px",document.body.style.height="auto",setTimeout(()=>requestAnimationFrame(()=>{let y=w-window.innerHeight;y&&i.current>=w&&(document.body.style.top=`${-(i.current+y)}px`)}),300)}}function f(){if(F!==null){let m=-parseInt(document.body.style.top,10),w=-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.height=F.height,document.body.style.right="unset",requestAnimationFrame(()=>{window.scrollTo(w,m)}),F=null}}ce.default.useEffect(()=>{function m(){i.current=window.scrollY}return m(),window.addEventListener("scroll",m),()=>{window.removeEventListener("scroll",m)}},[]),ce.default.useEffect(()=>{t||!r||(e?(a(),n||setTimeout(()=>{f()},500)):f())},[e])}var Y=U(require("react"));var Be=new WeakMap;function h(e,n,t=!1){if(!e||!(e instanceof HTMLElement)||!n)return;let r={};Object.entries(n).forEach(([i,a])=>{if(i.startsWith("--")){e.style.setProperty(i,a);return}r[i]=e.style[i],e.style[i]=a}),!t&&Be.set(e,r)}function fe(e,n){if(!e||!(e instanceof HTMLElement))return;let t=Be.get(e);t&&(n?e.style[n]=t[n]:Object.entries(t).forEach(([r,i])=>{e.style[r]=i}))}function ee(e){let n=window.getComputedStyle(e),t=n.transform||n.webkitTransform||n.mozTransform,r=t.match(/^matrix3d\((.+)\)$/);return r?parseFloat(r[1].split(", ")[13]):(r=t.match(/^matrix\((.+)\)$/),r?parseFloat(r[1].split(", ")[5]):null)}function ke(e){return 8*(Math.log(e+1)-2)}var g={DURATION:.5,EASE:[.32,.72,0,1]},de=.4;var V=U(require("react"));function ze(e){let n=V.default.useRef(e);return V.default.useEffect(()=>{n.current=e}),V.default.useMemo(()=>(...t)=>{var r;return(r=n.current)==null?void 0:r.call(n,...t)},[])}function Ht({defaultProp:e,onChange:n}){let t=V.default.useState(e),[r]=t,i=V.default.useRef(r),a=ze(n);return V.default.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),t}function _e({prop:e,defaultProp:n,onChange:t=()=>{}}){let[r,i]=Ht({defaultProp:n,onChange:t}),a=e!==void 0,f=a?e:r,m=ze(t),w=V.default.useCallback(y=>{if(a){let s=typeof y=="function"?y(e):y;s!==e&&m(s)}else i(y)},[a,e,i,m]);return[f,w]}function qe({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:t,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:f}){let[m,w]=_e({prop:e,defaultProp:t==null?void 0:t[0],onChange:n}),y=Y.default.useMemo(()=>m===(t==null?void 0:t[t.length-1]),[t,m]),M=t&&t.length>0&&a&&t[a]===m||!t,s=Y.default.useMemo(()=>{var b;return(b=t==null?void 0:t.findIndex(p=>p===m))!=null?b:null},[t,m]),o=Y.default.useMemo(()=>{var b;return(b=t==null?void 0:t.map(p=>{let T=typeof window!="undefined",A=typeof p=="string",C=0;A&&(C=parseInt(p,10));let P=A?C:T?p*window.innerHeight:0;return T?window.innerHeight-P:P}))!=null?b:[]},[t]),O=Y.default.useMemo(()=>s!==null?o==null?void 0:o[s]:null,[o,s]),H=Y.default.useCallback(b=>{var T;let p=(T=o==null?void 0:o.findIndex(A=>A===b))!=null?T:null;f(p),h(r.current,{transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,transform:`translate3d(0, ${b}px, 0)`}),o&&p!==o.length-1&&p!==a?h(i.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,opacity:"0"}):h(i.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,opacity:"1"}),w(p!==null?t==null?void 0:t[p]:null)},[r,t,o,a,i,w]);Y.default.useEffect(()=>{var b;if(e){let p=(b=t==null?void 0:t.findIndex(T=>T===e))!=null?b:null;o&&p&&typeof o[p]=="number"&&H(o[p])}},[e,t,o,H]);function N({draggedDistance:b,closeDrawer:p,velocity:T}){if(a===void 0)return;let A=O-b,C=s===a-1,P=s===0;if(C&&h(i.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),T>2&&b<0){p();return}if(T>2&&b>0&&o&&t){H(o[t.length-1]);return}let k=o==null?void 0:o.reduce((L,z)=>typeof L!="number"||typeof z!="number"?L:Math.abs(z-A)<Math.abs(L-A)?z:L);if(T>de&&Math.abs(b)<window.innerHeight*.4){let L=b>0?1:-1;if(L>0&&y){H(o[t.length-1]);return}if(P&&L<0&&p(),s===null)return;H(o[s+L]);return}H(k)}function j({draggedDistance:b}){if(O===null)return;let p=O-b;h(r.current,{transform:`translate3d(0, ${p}px, 0)`})}function R(b,p){if(!t||typeof s!="number"||!o||a===void 0)return null;let T=s===a-1;if(s>=a&&p)return 0;if(T&&!p)return 1;if(!M&&!T)return null;let C=T?s+1:s-1,P=T?o[C]-o[C-1]:o[C+1]-o[C],k=b/Math.abs(P);return T?1-k:k}return{isLastSnapPoint:y,activeSnapPoint:m,shouldFade:M,getPercentageDragged:R,setActiveSnapPoint:w,activeSnapPointIndex:s,onRelease:N,onDrag:j,snapPointsOffset:o}}var Ot=.25,Ct=500,Ke=8,B=16,Xe=26;function Ge({open:e,onOpenChange:n,children:t,shouldScaleBackground:r,onDrag:i,onRelease:a,snapPoints:f,nested:m,closeThreshold:w=Ot,scrollLockTimeout:y=Ct,dismissible:M=!0,fadeFromIndex:s=f&&f.length-1,activeSnapPoint:o,setActiveSnapPoint:O,fixed:H,modal:N=!0,onClose:j}){var Ne;let[R=!1,b]=c.default.useState(!1),[p,T]=c.default.useState(!1),[A,C]=c.default.useState(!1),[P,k]=c.default.useState(!1),[L,z]=c.default.useState(!1),[Ze,Me]=c.default.useState(!1),W=c.default.useRef(null),te=c.default.useRef(null),me=c.default.useRef(null),He=c.default.useRef(null),K=c.default.useRef(null),X=c.default.useRef(!1),pe=c.default.useRef(null),ge=c.default.useRef(0),_=c.default.useRef(!1),Oe=c.default.useRef(0),d=c.default.useRef(null),Ce=c.default.useRef(((Ne=d.current)==null?void 0:Ne.getBoundingClientRect().height)||0),be=c.default.useRef(0),et=c.default.useCallback(l=>{f&&l===J.length-1&&(te.current=new Date)},[]),{activeSnapPoint:tt,activeSnapPointIndex:G,setActiveSnapPoint:Le,onRelease:nt,snapPointsOffset:J,onDrag:rt,shouldFade:Ae,getPercentageDragged:ot}=qe({snapPoints:f,activeSnapPointProp:o,setActiveSnapPointProp:O,drawerRef:d,fadeFromIndex:s,overlayRef:W,onSnapPointChange:et});We({isDisabled:!R||L||!N||Ze||!p}),Ye({isOpen:R,modal:N,nested:m,hasBeenOpened:p});function ne(){return(window.innerWidth-Xe)/window.innerWidth}function it(l){var u;!M&&!f||d.current&&!d.current.contains(l.target)||(Ce.current=((u=d.current)==null?void 0:u.getBoundingClientRect().height)||0,z(!0),me.current=new Date,Se()&&window.addEventListener("touchend",()=>X.current=!1,{once:!0}),l.target.setPointerCapture(l.pointerId),ge.current=l.clientY)}function $e(l,u){var $;let v=l,x=new Date,D=($=window.getSelection())==null?void 0:$.toString(),E=d.current?ee(d.current):null;if(te.current&&x.getTime()-te.current.getTime()<500)return!1;if(E>0)return!0;if(D&&D.length>0)return!1;if(K.current&&x.getTime()-K.current.getTime()<y&&E===0)return K.current=new Date,!1;for(;v;){if(v.scrollHeight>v.clientHeight){if(v.getAttribute("role")==="dialog")return!0;if(u&&v!==document.body&&!E&&E>=0)return K.current=new Date,!1;if(v.scrollTop!==0)return K.current=new Date,!1}v=v.parentNode}return!0}function at(l){if(L){let u=ge.current-l.clientY,v=u>0;if(f&&G===0&&!M||!X.current&&!$e(l.target,v))return;if(X.current=!0,h(d.current,{transition:"none"}),h(W.current,{transition:"none"}),f&&rt({draggedDistance:u}),u>0&&!f){let I=ke(u);h(d.current,{transform:`translate3d(0, ${Math.min(I*-1,0)}px, 0)`});return}let x=Math.abs(u),D=document.querySelector("[vaul-drawer-wrapper]"),E=x/Ce.current,$=ot(x,v);$!==null&&(E=$);let ve=1-E;if((Ae||s&&G===s-1)&&(i==null||i(l,E),h(W.current,{opacity:`${ve}`,transition:"none"},!0)),D&&W.current&&r){let I=Math.min(ne()+E*(1-ne()),1),oe=8-E*8,ft=Math.max(0,14-E*14);h(D,{borderRadius:`${oe}px`,transform:`scale(${I}) translate3d(0, ${ft}px, 0)`,transition:"none"},!0)}f||h(d.current,{transform:`translate3d(0, ${x}px, 0)`})}}c.default.useEffect(()=>{if(document.querySelector("[vaul-drawer-wrapper]"))return()=>re(!1)},[]),c.default.useEffect(()=>{var u;function l(){var x;if(!d.current)return;let v=document.activeElement;if(Z(v)||_.current){let D=((x=window.visualViewport)==null?void 0:x.height)||0,E=window.innerHeight-D,$=d.current.getBoundingClientRect().height||0;be.current||(be.current=$);let ve=d.current.getBoundingClientRect().top;if(Math.abs(Oe.current-E)>60&&(_.current=!_.current),f&&f.length>0&&J&&G){let I=J[G]||0;E+=I}if(Oe.current=E,$>D||_.current){let I=d.current.getBoundingClientRect().height,oe=I;I>D&&(oe=D-Xe),H?d.current.style.height=`${I-Math.max(E,0)}px`:d.current.style.height=`${Math.max(oe,D-ve)}px`}else d.current.style.height=`${be.current}px`;f&&f.length>0&&!_.current?d.current.style.bottom="0px":d.current.style.bottom=`${Math.max(E,0)}px`}}return(u=window.visualViewport)==null||u.addEventListener("resize",l),()=>{var v;return(v=window.visualViewport)==null?void 0:v.removeEventListener("resize",l)}},[G,f,J]);function q(){d.current&&(j==null||j(),d.current&&(h(d.current,{transform:"translate3d(0, 100%, 0)",transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),h(W.current,{opacity:"0",transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),re(!1)),setTimeout(()=>{C(!1),b(!1)},300),setTimeout(()=>{f&&Le(f[0])},500))}c.default.useEffect(()=>{if(!R&&r){let l=setTimeout(()=>{fe(document.body)},200);return()=>clearTimeout(l)}},[R,r]),c.default.useEffect(()=>{e?(b(!0),T(!0)):q()},[e]),c.default.useEffect(()=>{P&&(n==null||n(R))},[R]),c.default.useEffect(()=>{k(!0)},[]);function Ie(){if(!d.current)return;let l=document.querySelector("[vaul-drawer-wrapper]"),u=ee(d.current);h(d.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`}),h(W.current,{transition:`opacity ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,opacity:"1"}),r&&u&&u>0&&R&&h(l,{borderRadius:`${Ke}px`,overflow:"hidden",transform:`scale(${ne()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${g.DURATION}s`,transitionTimingFunction:`cubic-bezier(${g.EASE.join(",")})`},!0)}function lt(l){if(!L||!d.current)return;X.current&&Z(l.target)&&l.target.blur(),X.current=!1,z(!1),He.current=new Date;let u=ee(d.current);if(!$e(l.target,!1)||!u||Number.isNaN(u)||me.current===null)return;let v=l.clientY,x=He.current.getTime()-me.current.getTime(),D=ge.current-v,E=Math.abs(D)/x;if(E>.05&&(Me(!0),setTimeout(()=>{Me(!1)},200)),f){nt({draggedDistance:D,closeDrawer:q,velocity:E});return}if(D>0){Ie(),a==null||a(l,!0);return}if(E>de){q(),a==null||a(l,!1);return}let $=Math.min(d.current.getBoundingClientRect().height||0,window.innerHeight);if(u>=$*w){q(),a==null||a(l,!1);return}a==null||a(l,!0),Ie()}c.default.useEffect(()=>{R&&(te.current=new Date,re(!0))},[R]);function re(l){let u=document.querySelector("[vaul-drawer-wrapper]");!u||!r||(l?(h(document.body,{background:"black"},!0),h(u,{borderRadius:`${Ke}px`,overflow:"hidden",transform:`scale(${ne()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top",transitionProperty:"transform, border-radius",transitionDuration:`${g.DURATION}s`,transitionTimingFunction:`cubic-bezier(${g.EASE.join(",")})`})):(fe(u,"transform"),fe(u,"borderRadius"),h(u,{transitionProperty:"transform, border-radius",transitionDuration:`${g.DURATION}s`,transitionTimingFunction:`cubic-bezier(${g.EASE.join(",")})`})))}function st(l){let u=l?(window.innerWidth-B)/window.innerWidth:1,v=l?-B:0;pe.current&&window.clearTimeout(pe.current),h(d.current,{transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,transform:`scale(${u}) translate3d(0, ${v}px, 0)`}),!l&&d.current&&(pe.current=setTimeout(()=>{h(d.current,{transition:"none",transform:`translate3d(0, ${ee(d.current)}px, 0)`})},500))}function ut(l,u){if(u<0)return;let v=(window.innerWidth-B)/window.innerWidth,x=v+u*(1-v),D=-B+u*B;h(d.current,{transform:`scale(${x}) translate3d(0, ${D}px, 0)`,transition:"none"})}function ct(l,u){let v=u?(window.innerWidth-B)/window.innerWidth:1,x=u?-B:0;u&&h(d.current,{transition:`transform ${g.DURATION}s cubic-bezier(${g.EASE.join(",")})`,transform:`scale(${v}) translate3d(0, ${x}px, 0)`})}return c.default.createElement(S.Root,{modal:N,onOpenChange:l=>{l?(T(!0),b(l)):q()},open:R},c.default.createElement(we.Provider,{value:{visible:A,activeSnapPoint:tt,snapPoints:f,setActiveSnapPoint:Le,drawerRef:d,overlayRef:W,scaleBackground:re,onPress:it,setVisible:C,onRelease:lt,onDrag:at,dismissible:M,isOpen:R,shouldFade:Ae,closeDrawer:q,onNestedDrag:ut,onNestedOpenChange:st,onNestedRelease:ct,keyboardIsOpen:_,modal:N,snapPointsOffset:J}},t))}var Je=c.default.forwardRef(function({children:e,style:n,...t},r){let{overlayRef:i,snapPoints:a,onRelease:f,shouldFade:m,isOpen:w,visible:y}=ae(),M=xe(r,i),s=a&&a.length>0;return c.default.createElement(S.Overlay,{onMouseUp:f,ref:M,"vaul-drawer-visible":y?"true":"false","vaul-overlay":"","vaul-snap-points":w&&s?"true":"false","vaul-snap-points-overlay":w&&m?"true":"false",...t})});Je.displayName="Drawer.Overlay";var Qe=c.default.forwardRef(function({children:e,onOpenAutoFocus:n,onPointerDownOutside:t,onAnimationEnd:r,style:i,...a},f){let{drawerRef:m,onPress:w,onRelease:y,onDrag:M,dismissible:s,keyboardIsOpen:o,snapPointsOffset:O,visible:H,closeDrawer:N,modal:j,setVisible:R}=ae(),b=xe(f,m);return c.default.useEffect(()=>{R(!0)},[]),c.default.createElement(S.Content,{onOpenAutoFocus:p=>{n?n(p):(p.preventDefault(),m.current.focus())},onPointerDown:w,onPointerDownOutside:p=>{if(!j){p.preventDefault();return}o.current&&(o.current=!1),p.preventDefault(),s&&(N(),t==null||t(p))},onPointerMove:M,onPointerUp:y,ref:b,style:O&&O.length>0?{"--snap-point-height":`${O[0]}px`,...i}:i,...a,"vaul-drawer":"","vaul-drawer-visible":H?"true":"false"},e)});Qe.displayName="Drawer.Content";function Lt({children:e,onDrag:n,onOpenChange:t,...r}){let{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:f}=ae();if(!i)throw new Error("Drawer.NestedRoot must be placed in another drawer");return c.default.createElement(Ge,{nested:!0,onClose:()=>{a(!1)},onDrag:(m,w)=>{i(m,w),n==null||n(m,w)},onOpenChange:m=>{m&&a(m),t==null||t(m)},onRelease:f,...r},e)}var At={Root:Ge,NestedRoot:Lt,Content:Qe,Overlay:Je,Trigger:S.Trigger,Portal:S.Portal,Close:S.Close,Title:S.Title,Description:S.Description};0&&(module.exports={Drawer});
//# sourceMappingURL=index.js.map
{
"name": "vaul",
"version": "0.6.8",
"version": "0.7.0",
"description": "Drawer component for React.",

@@ -40,2 +40,3 @@ "main": "dist/index.js",

"prettier": "^2.5.1",
"typescript": "5.2.2",
"tsup": "^6.4.0",

@@ -42,0 +43,0 @@ "turbo": "1.6"

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc