@stackflow/plugin-basic-ui 0.19.2 → 0.20.0

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/index.js CHANGED
@@ -1,2 +1,992 @@
1
- "use strict";var tt=Object.create;var D=Object.defineProperty,rt=Object.defineProperties,ot=Object.getOwnPropertyDescriptor,nt=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols,st=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable;var de=(e,o,t)=>o in e?D(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,me=(e,o)=>{for(var t in o||(o={}))pe.call(o,t)&&de(e,t,o[t]);if(le)for(var t of le(o))it.call(o,t)&&de(e,t,o[t]);return e},ue=(e,o)=>rt(e,nt(o));var fe=(e,o)=>{for(var t in o)D(e,t,{get:o[t],enumerable:!0})},he=(e,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of at(o))!pe.call(e,a)&&a!==t&&D(e,a,{get:()=>o[a],enumerable:!(r=ot(o,a))||r.enumerable});return e};var P=(e,o,t)=>(t=e!=null?tt(st(e)):{},he(o||!e||!e.__esModule?D(t,"default",{value:e,enumerable:!0}):t,e)),ct=e=>he(D({},"__esModule",{value:!0}),e);var qt={};fe(qt,{AppScreen:()=>$e,BottomSheet:()=>Ue,Modal:()=>et,basicUIPlugin:()=>ge,cssVars:()=>c});module.exports=ct(qt);var ye=require("@vanilla-extract/dynamic"),A=P(require("react"));var re={};fe(re,{android:()=>lt,cupertino:()=>dt,globalVars:()=>c,rootAndroid:()=>pt,rootCupertino:()=>mt});var lt="_1coppmz0",dt="_1coppmz1",c={backgroundColor:"var(--stackflow-plugin-basic-ui-background-color)",dimBackgroundColor:"var(--stackflow-plugin-basic-ui-dim-background-color)",appBar:{borderColor:"var(--stackflow-plugin-basic-ui-app-bar-border-color)",borderSize:"var(--stackflow-plugin-basic-ui-app-bar-border-size)",height:"var(--stackflow-plugin-basic-ui-app-bar-height)",iconColor:"var(--stackflow-plugin-basic-ui-app-bar-icon-color)",textColor:"var(--stackflow-plugin-basic-ui-app-bar-text-color)",backgroundColor:"var(--stackflow-plugin-basic-ui-app-bar-background-color)",showTransitionDuration:"var(--stackflow-plugin-basic-ui-app-bar-show-transition-duration)"},bottomSheet:{borderRadius:"var(--stackflow-plugin-basic-ui-bottom-sheet-border-radius)"},modal:{borderRadius:"var(--stackflow-plugin-basic-ui-bottom-sheet-border-radius)"}},pt=":root[data-stackflow-plugin-basic-ui-theme=android]",mt=":root[data-stackflow-plugin-basic-ui-theme=cupertino]";function _(e){return Object.entries(e).reduce((o,[t,r])=>(r!=null&&(o[t]=r),o),{})}function $(e,o,t){let r=()=>{e.removeEventListener(o,r),t()};e.addEventListener(o,r)}var ve=e=>(e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)});var xe=()=>{};function H(e){requestAnimationFrame(()=>{requestAnimationFrame(()=>{e()})})}var be=(0,A.createContext)({theme:"android"}),ut=be.Provider;function F(){return(0,A.useContext)(be)}var ge=e=>()=>({key:"basic-ui",wrapStack({stack:o}){var t,r,a,s,l,i,n;return A.default.createElement(ut,{value:e},A.default.createElement("div",{className:typeof window!="undefined"?re[e.theme]:void 0,style:(0,ye.assignInlineVars)(_({[c.backgroundColor]:e.backgroundColor,[c.dimBackgroundColor]:e.dimBackgroundColor,[c.appBar.borderColor]:(t=e.appBar)==null?void 0:t.borderColor,[c.appBar.borderSize]:(r=e.appBar)==null?void 0:r.borderSize,[c.appBar.height]:(a=e.appBar)==null?void 0:a.height,[c.appBar.iconColor]:(s=e.appBar)==null?void 0:s.iconColor,[c.appBar.textColor]:(l=e.appBar)==null?void 0:l.textColor,[c.bottomSheet.borderRadius]:(i=e.bottomSheet)==null?void 0:i.borderRadius,[c.modal.borderRadius]:(n=e.modal)==null?void 0:n.borderRadius}))},o.render()))}});var J=require("@stackflow/react"),Oe=require("@vanilla-extract/dynamic"),q=P(require("react"));var G=require("react");function B(e){let[o,t]=(0,G.useState)(void 0);return(0,G.useEffect)(()=>{H(()=>{t(e)})},[e]),o}var W=require("react");function Ce({outerRef:e,innerRef:o,enable:t}){let[r,a]=(0,W.useState)(void 0);return(0,W.useEffect)(()=>{let s=e&&"current"in e&&e.current,l=o.current;return!t||!s||!l?xe:ve(()=>{let n=s.clientWidth,p=l.offsetLeft,v=l.clientWidth,b=n-p-v,m=Math.max(p,b);a(n-2*m)})},[]),{maxWidth:r}}var ke=require("@stackflow/react"),oe=require("react"),O={};function C({styleName:e,refs:o,effect:t}){let r=(0,ke.useActivity)();(0,oe.useEffect)(()=>(O[e]||(O[e]=new Map),O[e].set(r.zIndex,{refs:o,hasEffect:!!t}),()=>{O[e].delete(r.zIndex)}),[r.id,o,t]),(0,oe.useEffect)(()=>{if(!t)return()=>{};let a=(()=>{let l=[];for(let i=1;i<=r.zIndex;i+=1){let n=O[e].get(r.zIndex-i);if(n!=null&&n.refs&&(l=[...l,...n.refs]),n!=null&&n.hasEffect)break}return l})(),s=t({activityTransitionState:r.transitionState,refs:a});return()=>{s==null||s()}},[r.transitionState])}function Ee({refs:e,hasEffect:o}){C({styleName:"hide",refs:e,effect:o?({activityTransitionState:t,refs:r})=>{let a=()=>{r.forEach(s=>{if(!s.current)return;let l=s.current;l.style.display=""})};switch(t){case"enter-done":return r.forEach(s=>{if(!s.current)return;let l=s.current;l.style.display="none"}),()=>{a()};default:return a(),()=>{}}}:void 0})}var ft=32,j=80;function qe({refs:e,theme:o,hasEffect:t}){C({styleName:"offset",refs:e,effect:t?({activityTransitionState:r,refs:a})=>{let s=o==="cupertino"?`translateX(-${j/16}rem)`:`translateY(-${ft/16}rem)`,l=()=>{H(()=>{a.forEach(i=>{if(!i.current)return;let n=i.current;n.style.transform="",$(n,"transitionend",()=>{n.style.transition=""})})})};switch(r){case"enter-active":case"enter-done":switch(a.forEach(i=>{!i.current||(i.current.style.transition="var(--stackflow-transition-duration)",i.current.style.transform=s)}),r){case"enter-done":return()=>{l()};case"enter-active":default:return()=>{}}case"exit-active":case"exit-done":return H(()=>{l()}),()=>{};default:return()=>{}}}:void 0})}function Re({theme:e,dimRef:o,edgeRef:t,paperRef:r,hasEffect:a,onSwiped:s}){C({styleName:"swipe-back",refs:[r],effect:a?({refs:l})=>{if(e!=="cupertino")return()=>{};if(!o.current||!t.current||!r.current)return()=>{};let i=o.current,n=t.current,p=r.current,v=null,b=null,m=null,k=[],f=()=>{v=null,b=null,m=null,k=[]},S=!1;function N(u){S||(S=!0,requestAnimationFrame(()=>{let g=u/p.clientWidth;i.style.opacity=`${1-g}`,i.style.transition="0s",p.style.overflowY="hidden",p.style.transform=`translateX(${u}px)`,p.style.transition="0s",l.forEach(x=>{var d;!x.current||(x.current.style.transform=`translateX(${-1*(1-g)*j}px)`,x.current.style.transition="0s",((d=x.current.parentElement)==null?void 0:d.style.display)==="none"&&(x.current.parentElement.style.display="block"))}),S=!1}))}function L({swiped:u}){return new Promise(g=>{requestAnimationFrame(()=>{i.style.opacity=`${u?0:1}`,i.style.transition="var(--stackflow-transition-duration)",p.style.overflowY="hidden",p.style.transform=`translateX(${u?"100%":"0"})`,p.style.transition="var(--stackflow-transition-duration)",l.forEach(d=>{!d.current||(d.current.style.transition="var(--stackflow-transition-duration)",d.current.style.transform=`translateX(${u?"0":`-${j/16}rem`})`)});let x=[...k];g(),$(p,"transitionend",()=>{i.style.opacity="",p.style.overflowY="",p.style.transform="",l.forEach((d,V)=>{if(!d.current)return;let R=x[V];u?(d.current.style.transition="",d.current.style.transform="",d.current.parentElement&&(d.current.parentElement.style.display="")):R&&(d.current.style.transition=R.style.transition,d.current.style.transform=R.style.transform,d.current.parentElement&&R.parentElement&&(d.current.parentElement.style.display=R.parentElement.style.display))})})})})}let h=u=>{var x;let{activeElement:g}=document;(x=g==null?void 0:g.blur)==null||x.call(g),v=m=u.touches[0].clientX,b=Date.now(),k=l.map(d=>d.current?{style:{transform:d.current.style.transform,transition:d.current.style.transition},parentElement:d.current.parentElement?{style:{display:d.current.parentElement.style.display}}:void 0}:{style:{transform:"",transition:""}})},T=u=>{if(!v){f();return}m=u.touches[0].clientX,N(m-v)},w=()=>{if(!v||!b||!m){f();return}let u=Date.now(),x=(m-v)/(u-b)>1||m/p.clientWidth>.4;x&&(s==null||s()),Promise.resolve().then(()=>L({swiped:x})).then(()=>f())};return n.addEventListener("touchstart",h,{passive:!0}),n.addEventListener("touchmove",T,{passive:!0}),n.addEventListener("touchend",w,{passive:!0}),n.addEventListener("touchcancel",w,{passive:!0}),()=>{n.removeEventListener("touchstart",h),n.removeEventListener("touchmove",T),n.removeEventListener("touchend",w),n.removeEventListener("touchcancel",w)}}:void 0})}var Z=require("@stackflow/react"),De=require("@vanilla-extract/dynamic"),y=P(require("react"));var ne=P(require("react")),ht=e=>ne.default.createElement("svg",{className:e.className,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ne.default.createElement("path",{d:"M11.5659 5.56564C11.8783 5.25322 11.8783 4.74669 11.5659 4.43427C11.2535 4.12185 10.7469 4.12185 10.4345 4.43427L3.43451 11.4343C3.12209 11.7467 3.12209 12.2532 3.43451 12.5656L10.4345 19.5656C10.7469 19.8781 11.2535 19.8781 11.5659 19.5656C11.8783 19.2532 11.8783 18.7467 11.5659 18.4343L5.93157 12.8H20.0002C20.442 12.8 20.8002 12.4418 20.8002 12C20.8002 11.5581 20.442 11.2 20.0002 11.2H5.93157L11.5659 5.56564Z",fill:"currentColor"})),X=ht;var U=P(require("react")),vt=e=>U.default.createElement("svg",{className:e.className,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U.default.createElement("path",{d:"M6.56588 5.43433C6.25346 5.12191 5.74693 5.12191 5.43451 5.43433C5.12209 5.74675 5.12209 6.25328 5.43451 6.5657L10.8688 12L5.43451 17.4343C5.12209 17.7467 5.12209 18.2533 5.43451 18.5657C5.74693 18.8781 6.25346 18.8781 6.56588 18.5657L12.0002 13.1314L17.4345 18.5657C17.7469 18.8781 18.2535 18.8781 18.5659 18.5657C18.8783 18.2533 18.8783 17.7467 18.5659 17.4343L13.1316 12L18.5659 6.5657C18.8783 6.25328 18.8783 5.74675 18.5659 5.43433C18.2535 5.12191 17.7469 5.12191 17.4345 5.43433L12.0002 10.8686L6.56588 5.43433Z",fill:"currentColor"}),U.default.createElement("path",{d:"M6.56588 5.43433C6.25346 5.12191 5.74693 5.12191 5.43451 5.43433C5.12209 5.74675 5.12209 6.25328 5.43451 6.5657L10.8688 12L5.43451 17.4343C5.12209 17.7467 5.12209 18.2533 5.43451 18.5657C5.74693 18.8781 6.25346 18.8781 6.56588 18.5657L12.0002 13.1314L17.4345 18.5657C17.7469 18.8781 18.2535 18.8781 18.5659 18.5657C18.8783 18.2533 18.8783 17.7467 18.5659 17.4343L13.1316 12L18.5659 6.5657C18.8783 6.25328 18.8783 5.74675 18.5659 5.43433C18.2535 5.12191 17.7469 5.12191 17.4345 5.43433L12.0002 10.8686L6.56588 5.43433Z",fill:"currentColor"})),ae=vt;var se=require("@vanilla-extract/recipes/createRuntimeFn"),_e=(0,se.createRuntimeFn)({defaultClassName:"_1yk3a450 dhthxq4 dhthxq8 dhthxq7 dhthxq0 dhthxqg _1dlf4347",variantClassNames:{border:{true:"_1yk3a451"}},defaultVariants:{},compoundVariants:[]}),ie="_1yk3a453 dhthxq8 dhthxq7 dhthxqa dhthxqe dhthxqh",Se="_1yk3a455 dhthxq8 dhthxq7",Ne=(0,se.createRuntimeFn)({defaultClassName:"_1yk3a456",variantClassNames:{hasLeft:{true:"_1yk3a457"}},defaultVariants:{},compoundVariants:[]}),we="_1yk3a458 dhthxqh dhthxq4 dhthxq2 dhthxqe",ze="_1yk3a459 dhthxqb dhthxqc dhthxq0",Me="_1yk3a453 dhthxq8 dhthxq7 dhthxqa dhthxqe dhthxqh",Ie="_1yk3a452 dhthxq8 dhthxq7 dhthxq1",Le="_1yk3a45a dhthxq8 dhthxq7 dhthxq1 dhthxq5";var Y=require("@vanilla-extract/recipes/createRuntimeFn");var Te=(0,Y.createRuntimeFn)({defaultClassName:"dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 dhthxqb",variantClassNames:{transitionState:{"enter-active":"_1dlf4349","enter-done":"_1dlf434a","exit-active":"_1dlf434b","exit-done":"_1dlf434c"}},defaultVariants:{},compoundVariants:[]});var Pe="_1dlf434i dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 _1dlf4346 _1dlf4348",Ae=(0,Y.createRuntimeFn)({defaultClassName:"_1dlf434l dhthxq4 dhthxq2 dhthxq3 dhthxq1",variantClassNames:{hasAppBar:{true:"_1dlf434m"}},defaultVariants:{},compoundVariants:[]});var Ve=(0,Y.createRuntimeFn)({defaultClassName:"_1dlf434j dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 _1dlf4347 _1dlf4348",variantClassNames:{hasAppBar:{true:"_1dlf434k dhthxqf"}},defaultVariants:{},compoundVariants:[]}),z={transitionDuration:"var(--_1dlf4340)",zIndexes:{dim:"var(--_1dlf4341)",paper:"var(--_1dlf4342)",edge:"var(--_1dlf4343)",appBar:"var(--_1dlf4344)"},appBar:{center:{mainWidth:"var(--_1dlf4345)"}}};var yt=y.default.forwardRef(({title:e,appendLeft:o,appendRight:t,backButton:r,closeButton:a,closeButtonLocation:s="left",border:l=!0,iconColor:i,textColor:n,borderColor:p,borderSize:v,height:b,backgroundColor:m,onTopClick:k},f)=>{var R;let S=(0,Z.useActions)(),N=(0,Z.useActivity)(),L=F(),h=(R=L.appBar)==null?void 0:R.closeButton,T=(0,y.useRef)(null),{maxWidth:w}=Ce({outerRef:f,innerRef:T,enable:L.theme==="cupertino"}),u=E=>{r&&"onClick"in r&&r.onClick&&r.onClick(E),E.defaultPrevented||S.pop()},g=()=>{var E;return N.isRoot?null:r?"render"in r&&r.render?(E=r.render)==null?void 0:E.call(r):y.default.createElement("button",{type:"button",className:ie,onClick:u},"renderIcon"in r&&r.renderIcon?r.renderIcon():y.default.createElement(X,null)):y.default.createElement("button",{type:"button",className:ie,onClick:u},y.default.createElement(X,null))},x=E=>{var ce;a&&"onClick"in a&&a.onClick&&a.onClick(E),!E.defaultPrevented&&h&&"onClick"in h&&((ce=h.onClick)==null||ce.call(h,E))},d=()=>{var E;return!a&&!((E=L.appBar)!=null&&E.closeButton)||!N.isRoot?null:a&&"render"in a&&a.render?a.render():h&&"render"in h&&h.render?h.render():y.default.createElement("button",{type:"button",className:Me,onClick:x},(()=>a&&"renderIcon"in a&&a.renderIcon?a.renderIcon():h&&"renderIcon"in h&&h.renderIcon?h.renderIcon():y.default.createElement(ae,null))())},V=!!(s==="left"&&a||r||o);return y.default.createElement("div",{ref:f,className:_e({border:l}),style:(0,De.assignInlineVars)(_({[c.appBar.iconColor]:i,[c.appBar.textColor]:n,[c.appBar.borderColor]:p,[c.appBar.borderSize]:v,[c.appBar.height]:b,[c.appBar.backgroundColor]:m||c.backgroundColor,[z.appBar.center.mainWidth]:`${w}px`}))},y.default.createElement("div",{className:Ie},s==="left"&&d(),g(),o==null?void 0:o()),y.default.createElement("div",{ref:T,className:Se},y.default.createElement("div",{className:Ne({hasLeft:V})},typeof e=="string"?y.default.createElement("div",{className:ze},e):e,y.default.createElement("button",{className:we,type:"button","aria-hidden":"true",onClick:k}))),y.default.createElement("div",{className:Le},t==null?void 0:t(),s==="right"&&d()))}),He=yt;var bt=({backgroundColor:e,dimBackgroundColor:o,appBar:t,showAppBar:r=!!t,showAppBarTransitionDuration:a,preventSwipeBack:s,children:l})=>{let i=F(),n=(0,J.useActivity)(),{pop:p}=(0,J.useActions)(),v=(0,q.useRef)(null),b=(0,q.useRef)(null),m=(0,q.useRef)(null),k=(0,q.useRef)(null),f=(0,q.useRef)(null);Ee({refs:[v],hasEffect:!0}),qe({theme:i.theme,refs:i.theme==="cupertino"?[m]:[m,f],hasEffect:!0}),Re({theme:i.theme,dimRef:b,edgeRef:k,paperRef:m,hasEffect:!0,onSwiped(){p()}});let S=!!t&&r,N=n.zIndex*5,L=N,h=N+(i.theme==="cupertino"&&S?1:3),T=N+4,w=N+7,{transitionState:u}=n,g=B(u),x=d=>{var V,R;(V=t==null?void 0:t.onTopClick)==null||V.call(t,d),d.defaultPrevented||(R=m.current)==null||R.scroll({top:0,behavior:"smooth"})};return q.default.createElement("div",{ref:v,className:Te({transitionState:u==="enter-done"||u==="exit-done"?u:g}),style:(0,Oe.assignInlineVars)(_({[c.backgroundColor]:e,[c.dimBackgroundColor]:o,[c.appBar.height]:r?t==null?void 0:t.height:"0",[c.appBar.showTransitionDuration]:a,[z.zIndexes.dim]:`${L}`,[z.zIndexes.paper]:`${h}`,[z.zIndexes.edge]:`${T}`,[z.zIndexes.appBar]:`${w}`,[z.transitionDuration]:n.transitionState==="enter-active"||n.transitionState==="exit-active"?"var(--stackflow-transition-duration)":"0ms"}))},q.default.createElement("div",{className:Pe,ref:b}),q.default.createElement("div",{key:n.id,className:Ve({hasAppBar:S}),ref:m},l),!n.isRoot&&i.theme==="cupertino"&&!s&&q.default.createElement("div",{className:Ae({hasAppBar:S}),ref:k}),t&&q.default.createElement(He,ue(me({},t),{ref:f,onTopClick:x})))},$e=bt;var Q=require("@stackflow/react"),Xe=require("@vanilla-extract/dynamic"),M=P(require("react"));var Fe=require("@vanilla-extract/recipes/createRuntimeFn"),Ge=(0,Fe.createRuntimeFn)({defaultClassName:"dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 dhthxqb",variantClassNames:{transitionState:{"enter-active":"_1ht38h04","enter-done":"_1ht38h05","exit-active":"_1ht38h06","exit-done":"_1ht38h07"}},defaultVariants:{},compoundVariants:[]}),We="_1ht38h0d dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 dhthxqb dhthxq9 dhthxq7 _1ht38h03";var je="_1ht38h0e dhthxqb _1ht38h03",K={transitionDuration:"var(--_1ht38h00)",zIndexes:{dim:"var(--_1ht38h01)",paper:"var(--_1ht38h02)"}};var Ct=({borderRadius:e="1rem",backgroundColor:o,dimBackgroundColor:t,onOutsideClick:r,children:a})=>{let s=(0,Q.useActivity)(),{pop:l}=(0,Q.useActions)(),i=(0,M.useRef)(null),n=(0,M.useRef)(null);C({styleName:"hide",refs:[i]}),C({styleName:"offset",refs:[n]}),C({styleName:"swipe-back",refs:[n]});let p=(0,M.useRef)(!1),v=f=>{r==null||r(f),!f.defaultPrevented&&(p.current||(p.current=!0,l()))},b=f=>{f.stopPropagation()},m=s.zIndex*5+3,k=s.zIndex*5+4;return M.default.createElement("div",{className:Ge({transitionState:B(s.transitionState)}),ref:i,style:(0,Xe.assignInlineVars)(_({[c.bottomSheet.borderRadius]:e,[c.backgroundColor]:o,[c.dimBackgroundColor]:t,[K.zIndexes.dim]:`${m}`,[K.zIndexes.paper]:`${k}`,[K.transitionDuration]:s.transitionState==="enter-active"||s.transitionState==="exit-active"?"var(--stackflow-transition-duration)":"0ms"}))},M.default.createElement("div",{className:We,ref:n,onClick:v},M.default.createElement("div",{className:je,onClick:b},a)))},Ue=Ct;var te=require("@stackflow/react"),Qe=require("@vanilla-extract/dynamic"),I=P(require("react"));var Ye=require("@vanilla-extract/recipes/createRuntimeFn"),Ze=(0,Ye.createRuntimeFn)({defaultClassName:"dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 dhthxqb",variantClassNames:{transitionState:{"enter-active":"_5ozg8c4","enter-done":"_5ozg8c5","exit-active":"_5ozg8c6","exit-done":"_5ozg8c7"}},defaultVariants:{},compoundVariants:[]}),Je="_5ozg8cd dhthxq4 dhthxq0 dhthxq1 dhthxq2 dhthxq3 dhthxqb dhthxq8 dhthxq7 dhthxqa _5ozg8c3";var Ke="_5ozg8ce dhthxqb _5ozg8c3",ee={transitionDuration:"var(--_5ozg8c0)",zIndexes:{dim:"var(--_5ozg8c1)",paper:"var(--_5ozg8c2)"}};var Et=({backgroundColor:e,dimBackgroundColor:o,borderRadius:t="1rem",onOutsideClick:r,children:a})=>{let s=(0,te.useActivity)(),{pop:l}=(0,te.useActions)(),i=(0,I.useRef)(null),n=(0,I.useRef)(null);C({styleName:"hide",refs:[i]}),C({styleName:"offset",refs:[n]}),C({styleName:"swipe-back",refs:[n]});let p=(0,I.useRef)(!1),v=f=>{r==null||r(f),!f.defaultPrevented&&(p.current||(p.current=!0,l()))},b=f=>{f.stopPropagation()},m=s.zIndex*5+3,k=s.zIndex*5+4;return I.default.createElement("div",{className:Ze({transitionState:B(s.transitionState)}),ref:i,style:(0,Qe.assignInlineVars)(_({[c.bottomSheet.borderRadius]:t,[c.backgroundColor]:e,[c.dimBackgroundColor]:o,[ee.zIndexes.dim]:`${m}`,[ee.zIndexes.paper]:`${k}`,[ee.transitionDuration]:s.transitionState==="enter-active"||s.transitionState==="exit-active"?"var(--stackflow-transition-duration)":"0ms"}))},I.default.createElement("div",{className:Je,ref:n,onClick:v},I.default.createElement("div",{className:Ke,onClick:b},a)))},et=Et;
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
39
+ mod
40
+ ));
41
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
42
+
43
+ // src/index.ts
44
+ var src_exports = {};
45
+ __export(src_exports, {
46
+ AppScreen: () => AppScreen_default,
47
+ BottomSheet: () => BottomSheet_default,
48
+ Modal: () => Modal_default,
49
+ basicUIPlugin: () => basicUIPlugin,
50
+ cssVars: () => globalVars
51
+ });
52
+ module.exports = __toCommonJS(src_exports);
53
+
54
+ // src/basicUIPlugin.tsx
55
+ var import_dynamic = require("@vanilla-extract/dynamic");
56
+ var import_react = __toESM(require("react"));
57
+
58
+ // src/theme.css.ts
59
+ var theme_css_exports = {};
60
+ __export(theme_css_exports, {
61
+ android: () => android,
62
+ cupertino: () => cupertino,
63
+ globalVars: () => globalVars,
64
+ rootAndroid: () => rootAndroid,
65
+ rootCupertino: () => rootCupertino
66
+ });
67
+ var android = "theme__1coppmz0";
68
+ var cupertino = "theme__1coppmz1";
69
+ var globalVars = { backgroundColor: "var(--stackflow-plugin-basic-ui-background-color)", dimBackgroundColor: "var(--stackflow-plugin-basic-ui-dim-background-color)", appBar: { borderColor: "var(--stackflow-plugin-basic-ui-app-bar-border-color)", borderSize: "var(--stackflow-plugin-basic-ui-app-bar-border-size)", height: "var(--stackflow-plugin-basic-ui-app-bar-height)", heightTransitionDuration: "var(--stackflow-plugin-basic-ui-app-bar-height-transition-duration)", minHeight: "var(--stackflow-plugin-basic-ui-app-bar-min-height)", iconColor: "var(--stackflow-plugin-basic-ui-app-bar-icon-color)", textColor: "var(--stackflow-plugin-basic-ui-app-bar-text-color)", backgroundColor: "var(--stackflow-plugin-basic-ui-app-bar-background-color)" }, bottomSheet: { borderRadius: "var(--stackflow-plugin-basic-ui-bottom-sheet-border-radius)" }, modal: { borderRadius: "var(--stackflow-plugin-basic-ui-bottom-sheet-border-radius)" } };
70
+ var rootAndroid = ":root[data-stackflow-plugin-basic-ui-theme=android]";
71
+ var rootCupertino = ":root[data-stackflow-plugin-basic-ui-theme=cupertino]";
72
+
73
+ // src/utils/compact.ts
74
+ function compact(arr) {
75
+ return arr.filter(
76
+ (item) => item !== void 0 && item !== null
77
+ );
78
+ }
79
+
80
+ // src/utils/compactMap.ts
81
+ function compactMap(obj) {
82
+ return Object.entries(obj).reduce((acc, [key, value]) => {
83
+ if (value !== null && value !== void 0) {
84
+ acc[key] = value;
85
+ }
86
+ return acc;
87
+ }, {});
88
+ }
89
+
90
+ // src/utils/listenOnce.ts
91
+ function listenOnce(el, type, cb) {
92
+ const listener = () => {
93
+ el.removeEventListener(type, listener);
94
+ cb();
95
+ };
96
+ el.addEventListener(type, listener);
97
+ }
98
+
99
+ // src/utils/listenResize.ts
100
+ var listenResize = (cb) => {
101
+ cb();
102
+ window.addEventListener("resize", cb);
103
+ return () => {
104
+ window.removeEventListener("resize", cb);
105
+ };
106
+ };
107
+
108
+ // src/utils/noop.ts
109
+ var noop = () => {
110
+ };
111
+
112
+ // src/utils/requestNextFrame.tsx
113
+ function requestNextFrame(cb) {
114
+ requestAnimationFrame(() => {
115
+ requestAnimationFrame(() => {
116
+ cb();
117
+ });
118
+ });
119
+ }
120
+
121
+ // src/basicUIPlugin.tsx
122
+ var GlobalOptionsContext = (0, import_react.createContext)({
123
+ theme: "android"
124
+ });
125
+ var GlobalOptionsProvider = GlobalOptionsContext.Provider;
126
+ function useGlobalOptions() {
127
+ return (0, import_react.useContext)(GlobalOptionsContext);
128
+ }
129
+ var basicUIPlugin = (options) => () => ({
130
+ key: "basic-ui",
131
+ wrapStack({ stack }) {
132
+ var _a, _b, _c, _d, _e, _f, _g;
133
+ return /* @__PURE__ */ import_react.default.createElement(GlobalOptionsProvider, {
134
+ value: options
135
+ }, /* @__PURE__ */ import_react.default.createElement("div", {
136
+ className: typeof window !== "undefined" ? compact([theme_css_exports[options.theme], options.rootClassName]).join(" ") : options.rootClassName,
137
+ style: (0, import_dynamic.assignInlineVars)(
138
+ compactMap({
139
+ [globalVars.backgroundColor]: options.backgroundColor,
140
+ [globalVars.dimBackgroundColor]: options.dimBackgroundColor,
141
+ [globalVars.appBar.borderColor]: (_a = options.appBar) == null ? void 0 : _a.borderColor,
142
+ [globalVars.appBar.borderSize]: (_b = options.appBar) == null ? void 0 : _b.borderSize,
143
+ [globalVars.appBar.height]: (_c = options.appBar) == null ? void 0 : _c.height,
144
+ [globalVars.appBar.iconColor]: (_d = options.appBar) == null ? void 0 : _d.iconColor,
145
+ [globalVars.appBar.textColor]: (_e = options.appBar) == null ? void 0 : _e.textColor,
146
+ [globalVars.bottomSheet.borderRadius]: (_f = options.bottomSheet) == null ? void 0 : _f.borderRadius,
147
+ [globalVars.modal.borderRadius]: (_g = options.modal) == null ? void 0 : _g.borderRadius
148
+ })
149
+ )
150
+ }, stack.render()));
151
+ }
152
+ });
153
+
154
+ // src/components/AppScreen.tsx
155
+ var import_react10 = require("@stackflow/react");
156
+ var import_dynamic3 = require("@vanilla-extract/dynamic");
157
+ var import_react11 = __toESM(require("react"));
158
+
159
+ // src/hooks/useLazy.tsx
160
+ var import_react2 = require("react");
161
+ function useLazy(value) {
162
+ const [state, setState] = (0, import_react2.useState)(void 0);
163
+ (0, import_react2.useEffect)(() => {
164
+ requestNextFrame(() => {
165
+ setState(value);
166
+ });
167
+ }, [value]);
168
+ return state;
169
+ }
170
+
171
+ // src/hooks/useMaxWidth.ts
172
+ var import_react3 = require("react");
173
+ function useMaxWidth({
174
+ outerRef,
175
+ innerRef,
176
+ enable
177
+ }) {
178
+ const [maxWidth, setMaxWidth] = (0, import_react3.useState)(void 0);
179
+ (0, import_react3.useEffect)(() => {
180
+ const $outer = outerRef && "current" in outerRef && outerRef.current;
181
+ const $inner = innerRef.current;
182
+ if (!enable || !$outer || !$inner) {
183
+ return noop;
184
+ }
185
+ const dispose = listenResize(() => {
186
+ const screenWidth = $outer.clientWidth;
187
+ const leftWidth = $inner.offsetLeft;
188
+ const centerWidth = $inner.clientWidth;
189
+ const rightWidth = screenWidth - leftWidth - centerWidth;
190
+ const sideMargin = Math.max(leftWidth, rightWidth);
191
+ setMaxWidth(screenWidth - 2 * sideMargin);
192
+ });
193
+ return dispose;
194
+ }, []);
195
+ return {
196
+ maxWidth
197
+ };
198
+ }
199
+
200
+ // src/hooks/useNullableActivity.ts
201
+ var import_react4 = require("@stackflow/react");
202
+ function useNullableActivity() {
203
+ return (0, import_react4.useActivity)();
204
+ }
205
+
206
+ // src/hooks/useStyleEffect.ts
207
+ var import_react5 = require("react");
208
+ var connections = {};
209
+ function useStyleEffect({
210
+ styleName,
211
+ refs,
212
+ effect
213
+ }) {
214
+ const activity = useNullableActivity();
215
+ (0, import_react5.useEffect)(() => {
216
+ if (!activity) {
217
+ return () => {
218
+ };
219
+ }
220
+ if (!connections[styleName]) {
221
+ connections[styleName] = /* @__PURE__ */ new Map();
222
+ }
223
+ connections[styleName].set(activity.zIndex, {
224
+ refs,
225
+ hasEffect: !!effect
226
+ });
227
+ return () => {
228
+ connections[styleName].delete(activity.zIndex);
229
+ };
230
+ }, [activity == null ? void 0 : activity.id, refs, effect]);
231
+ (0, import_react5.useEffect)(() => {
232
+ if (!activity) {
233
+ return () => {
234
+ };
235
+ }
236
+ if (!effect) {
237
+ return () => {
238
+ };
239
+ }
240
+ const refs2 = (() => {
241
+ let arr = [];
242
+ for (let i = 1; i <= activity.zIndex; i += 1) {
243
+ const connection = connections[styleName].get(activity.zIndex - i);
244
+ if (connection == null ? void 0 : connection.refs) {
245
+ arr = [...arr, ...connection.refs];
246
+ }
247
+ if (connection == null ? void 0 : connection.hasEffect) {
248
+ break;
249
+ }
250
+ }
251
+ return arr;
252
+ })();
253
+ const cleanup = effect({
254
+ activityTransitionState: activity.transitionState,
255
+ refs: refs2
256
+ });
257
+ return () => {
258
+ cleanup == null ? void 0 : cleanup();
259
+ };
260
+ }, [activity == null ? void 0 : activity.transitionState]);
261
+ }
262
+
263
+ // src/hooks/useStyleEffectHide.ts
264
+ function useStyleEffectHide({
265
+ refs,
266
+ hasEffect
267
+ }) {
268
+ useStyleEffect({
269
+ styleName: "hide",
270
+ refs,
271
+ effect: hasEffect ? ({ activityTransitionState, refs: refs2 }) => {
272
+ const cleanup = () => {
273
+ refs2.forEach((ref) => {
274
+ if (!ref.current) {
275
+ return;
276
+ }
277
+ const $ref = ref.current;
278
+ $ref.style.display = "";
279
+ });
280
+ };
281
+ switch (activityTransitionState) {
282
+ case "enter-done": {
283
+ refs2.forEach((ref) => {
284
+ if (!ref.current) {
285
+ return;
286
+ }
287
+ const $ref = ref.current;
288
+ $ref.style.display = "none";
289
+ });
290
+ return () => {
291
+ cleanup();
292
+ };
293
+ }
294
+ default: {
295
+ cleanup();
296
+ return () => {
297
+ };
298
+ }
299
+ }
300
+ } : void 0
301
+ });
302
+ }
303
+
304
+ // src/hooks/useStyleEffectOffset.ts
305
+ var OFFSET_PX_ANDROID = 32;
306
+ var OFFSET_PX_CUPERTINO = 80;
307
+ function useStyleEffectOffset({
308
+ refs,
309
+ theme,
310
+ hasEffect
311
+ }) {
312
+ useStyleEffect({
313
+ styleName: "offset",
314
+ refs,
315
+ effect: hasEffect ? ({ activityTransitionState, refs: refs2 }) => {
316
+ const transform = theme === "cupertino" ? `translateX(-${OFFSET_PX_CUPERTINO / 16}rem)` : `translateY(-${OFFSET_PX_ANDROID / 16}rem)`;
317
+ const cleanup = () => {
318
+ requestNextFrame(() => {
319
+ refs2.forEach((ref) => {
320
+ if (!ref.current) {
321
+ return;
322
+ }
323
+ const $el = ref.current;
324
+ $el.style.transform = "";
325
+ listenOnce($el, "transitionend", () => {
326
+ $el.style.transition = "";
327
+ });
328
+ });
329
+ });
330
+ };
331
+ switch (activityTransitionState) {
332
+ case "enter-active":
333
+ case "enter-done": {
334
+ refs2.forEach((ref) => {
335
+ if (!ref.current) {
336
+ return;
337
+ }
338
+ ref.current.style.transition = `var(--stackflow-transition-duration)`;
339
+ ref.current.style.transform = transform;
340
+ });
341
+ switch (activityTransitionState) {
342
+ case "enter-done":
343
+ return () => {
344
+ cleanup();
345
+ };
346
+ case "enter-active":
347
+ default:
348
+ return () => {
349
+ };
350
+ }
351
+ }
352
+ case "exit-active":
353
+ case "exit-done": {
354
+ requestNextFrame(() => {
355
+ cleanup();
356
+ });
357
+ return () => {
358
+ };
359
+ }
360
+ default: {
361
+ return () => {
362
+ };
363
+ }
364
+ }
365
+ } : void 0
366
+ });
367
+ }
368
+
369
+ // src/hooks/useStyleEffectSwipeBack.ts
370
+ function useStyleEffectSwipeBack({
371
+ theme,
372
+ dimRef,
373
+ edgeRef,
374
+ paperRef,
375
+ hasEffect,
376
+ onSwiped
377
+ }) {
378
+ useStyleEffect({
379
+ styleName: "swipe-back",
380
+ refs: [paperRef],
381
+ effect: hasEffect ? ({ refs }) => {
382
+ if (theme !== "cupertino") {
383
+ return () => {
384
+ };
385
+ }
386
+ if (!dimRef.current || !edgeRef.current || !paperRef.current) {
387
+ return () => {
388
+ };
389
+ }
390
+ const $dim = dimRef.current;
391
+ const $edge = edgeRef.current;
392
+ const $paper = paperRef.current;
393
+ let x0 = null;
394
+ let t0 = null;
395
+ let x = null;
396
+ let cachedRefs = [];
397
+ const resetState = () => {
398
+ x0 = null;
399
+ t0 = null;
400
+ x = null;
401
+ cachedRefs = [];
402
+ };
403
+ let _rAFLock = false;
404
+ function movePaper(dx) {
405
+ if (!_rAFLock) {
406
+ _rAFLock = true;
407
+ requestAnimationFrame(() => {
408
+ const p = dx / $paper.clientWidth;
409
+ $dim.style.opacity = `${1 - p}`;
410
+ $dim.style.transition = "0s";
411
+ $paper.style.overflowY = "hidden";
412
+ $paper.style.transform = `translateX(${dx}px)`;
413
+ $paper.style.transition = "0s";
414
+ refs.forEach((ref) => {
415
+ var _a;
416
+ if (!ref.current) {
417
+ return;
418
+ }
419
+ ref.current.style.transform = `translateX(${-1 * (1 - p) * OFFSET_PX_CUPERTINO}px)`;
420
+ ref.current.style.transition = "0s";
421
+ if (((_a = ref.current.parentElement) == null ? void 0 : _a.style.display) === "none") {
422
+ ref.current.parentElement.style.display = "block";
423
+ }
424
+ });
425
+ _rAFLock = false;
426
+ });
427
+ }
428
+ }
429
+ function resetPaper({ swiped }) {
430
+ return new Promise((resolve) => {
431
+ requestAnimationFrame(() => {
432
+ $dim.style.opacity = `${swiped ? 0 : 1}`;
433
+ $dim.style.transition = "var(--stackflow-transition-duration)";
434
+ $paper.style.overflowY = "hidden";
435
+ $paper.style.transform = `translateX(${swiped ? "100%" : "0"})`;
436
+ $paper.style.transition = "var(--stackflow-transition-duration)";
437
+ refs.forEach((ref) => {
438
+ if (!ref.current) {
439
+ return;
440
+ }
441
+ ref.current.style.transition = `var(--stackflow-transition-duration)`;
442
+ ref.current.style.transform = `translateX(${swiped ? "0" : `-${OFFSET_PX_CUPERTINO / 16}rem`})`;
443
+ });
444
+ const _cachedRefs = [...cachedRefs];
445
+ resolve();
446
+ listenOnce($paper, "transitionend", () => {
447
+ $dim.style.opacity = "";
448
+ $paper.style.overflowY = "";
449
+ $paper.style.transform = "";
450
+ refs.forEach((ref, i) => {
451
+ if (!ref.current) {
452
+ return;
453
+ }
454
+ const _cachedRef = _cachedRefs[i];
455
+ if (swiped) {
456
+ ref.current.style.transition = "";
457
+ ref.current.style.transform = "";
458
+ if (ref.current.parentElement) {
459
+ ref.current.parentElement.style.display = "";
460
+ }
461
+ } else if (_cachedRef) {
462
+ ref.current.style.transition = _cachedRef.style.transition;
463
+ ref.current.style.transform = _cachedRef.style.transform;
464
+ if (ref.current.parentElement && _cachedRef.parentElement) {
465
+ ref.current.parentElement.style.display = _cachedRef.parentElement.style.display;
466
+ }
467
+ }
468
+ });
469
+ });
470
+ });
471
+ });
472
+ }
473
+ const onTouchStart = (e) => {
474
+ var _a;
475
+ const { activeElement } = document;
476
+ (_a = activeElement == null ? void 0 : activeElement.blur) == null ? void 0 : _a.call(activeElement);
477
+ x0 = x = e.touches[0].clientX;
478
+ t0 = Date.now();
479
+ cachedRefs = refs.map((ref) => {
480
+ if (!ref.current) {
481
+ return {
482
+ style: {
483
+ transform: "",
484
+ transition: ""
485
+ }
486
+ };
487
+ }
488
+ return {
489
+ style: {
490
+ transform: ref.current.style.transform,
491
+ transition: ref.current.style.transition
492
+ },
493
+ parentElement: ref.current.parentElement ? {
494
+ style: {
495
+ display: ref.current.parentElement.style.display
496
+ }
497
+ } : void 0
498
+ };
499
+ });
500
+ };
501
+ const onTouchMove = (e) => {
502
+ if (!x0) {
503
+ resetState();
504
+ return;
505
+ }
506
+ x = e.touches[0].clientX;
507
+ movePaper(x - x0);
508
+ };
509
+ const onTouchEnd = () => {
510
+ if (!x0 || !t0 || !x) {
511
+ resetState();
512
+ return;
513
+ }
514
+ const t = Date.now();
515
+ const v = (x - x0) / (t - t0);
516
+ const swiped = v > 1 || x / $paper.clientWidth > 0.4;
517
+ if (swiped) {
518
+ onSwiped == null ? void 0 : onSwiped();
519
+ }
520
+ Promise.resolve().then(() => resetPaper({ swiped })).then(() => resetState());
521
+ };
522
+ $edge.addEventListener("touchstart", onTouchStart, { passive: true });
523
+ $edge.addEventListener("touchmove", onTouchMove, { passive: true });
524
+ $edge.addEventListener("touchend", onTouchEnd, { passive: true });
525
+ $edge.addEventListener("touchcancel", onTouchEnd, { passive: true });
526
+ return () => {
527
+ $edge.removeEventListener("touchstart", onTouchStart);
528
+ $edge.removeEventListener("touchmove", onTouchMove);
529
+ $edge.removeEventListener("touchend", onTouchEnd);
530
+ $edge.removeEventListener("touchcancel", onTouchEnd);
531
+ };
532
+ } : void 0
533
+ });
534
+ }
535
+
536
+ // src/components/AppBar.tsx
537
+ var import_react8 = require("@stackflow/react");
538
+ var import_dynamic2 = require("@vanilla-extract/dynamic");
539
+ var import_react9 = __toESM(require("react"));
540
+
541
+ // src/assets/IconBack.tsx
542
+ var import_react6 = __toESM(require("react"));
543
+ var IconBack = (props) => /* @__PURE__ */ import_react6.default.createElement("svg", {
544
+ className: props.className,
545
+ width: "24",
546
+ height: "24",
547
+ viewBox: "0 0 24 24",
548
+ fill: "none",
549
+ xmlns: "http://www.w3.org/2000/svg"
550
+ }, /* @__PURE__ */ import_react6.default.createElement("path", {
551
+ d: "M11.5659 5.56564C11.8783 5.25322 11.8783 4.74669 11.5659 4.43427C11.2535 4.12185 10.7469 4.12185 10.4345 4.43427L3.43451 11.4343C3.12209 11.7467 3.12209 12.2532 3.43451 12.5656L10.4345 19.5656C10.7469 19.8781 11.2535 19.8781 11.5659 19.5656C11.8783 19.2532 11.8783 18.7467 11.5659 18.4343L5.93157 12.8H20.0002C20.442 12.8 20.8002 12.4418 20.8002 12C20.8002 11.5581 20.442 11.2 20.0002 11.2H5.93157L11.5659 5.56564Z",
552
+ fill: "currentColor"
553
+ }));
554
+ var IconBack_default = IconBack;
555
+
556
+ // src/assets/IconClose.tsx
557
+ var import_react7 = __toESM(require("react"));
558
+ var IconClose = (props) => /* @__PURE__ */ import_react7.default.createElement("svg", {
559
+ className: props.className,
560
+ width: "24",
561
+ height: "24",
562
+ viewBox: "0 0 24 24",
563
+ fill: "none",
564
+ xmlns: "http://www.w3.org/2000/svg"
565
+ }, /* @__PURE__ */ import_react7.default.createElement("path", {
566
+ d: "M6.56588 5.43433C6.25346 5.12191 5.74693 5.12191 5.43451 5.43433C5.12209 5.74675 5.12209 6.25328 5.43451 6.5657L10.8688 12L5.43451 17.4343C5.12209 17.7467 5.12209 18.2533 5.43451 18.5657C5.74693 18.8781 6.25346 18.8781 6.56588 18.5657L12.0002 13.1314L17.4345 18.5657C17.7469 18.8781 18.2535 18.8781 18.5659 18.5657C18.8783 18.2533 18.8783 17.7467 18.5659 17.4343L13.1316 12L18.5659 6.5657C18.8783 6.25328 18.8783 5.74675 18.5659 5.43433C18.2535 5.12191 17.7469 5.12191 17.4345 5.43433L12.0002 10.8686L6.56588 5.43433Z",
567
+ fill: "currentColor"
568
+ }), /* @__PURE__ */ import_react7.default.createElement("path", {
569
+ d: "M6.56588 5.43433C6.25346 5.12191 5.74693 5.12191 5.43451 5.43433C5.12209 5.74675 5.12209 6.25328 5.43451 6.5657L10.8688 12L5.43451 17.4343C5.12209 17.7467 5.12209 18.2533 5.43451 18.5657C5.74693 18.8781 6.25346 18.8781 6.56588 18.5657L12.0002 13.1314L17.4345 18.5657C17.7469 18.8781 18.2535 18.8781 18.5659 18.5657C18.8783 18.2533 18.8783 17.7467 18.5659 17.4343L13.1316 12L18.5659 6.5657C18.8783 6.25328 18.8783 5.74675 18.5659 5.43433C18.2535 5.12191 17.7469 5.12191 17.4345 5.43433L12.0002 10.8686L6.56588 5.43433Z",
570
+ fill: "currentColor"
571
+ }));
572
+ var IconClose_default = IconClose;
573
+
574
+ // src/components/AppBar.css.ts
575
+ var import_createRuntimeFn = require("@vanilla-extract/recipes/createRuntimeFn");
576
+ var appBar = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "AppBar__1yk3a451 f__dhthxq4 f__dhthxq0 f__dhthxqh f__dhthxqc AppScreen__1dlf4347", variantClassNames: { border: { true: "AppBar_border_true__1yk3a452" } }, defaultVariants: {}, compoundVariants: [] });
577
+ var backButton = "AppBar__1yk3a456 f__dhthxq9 f__dhthxq7 f__dhthxqb f__dhthxqf f__dhthxqi";
578
+ var center = "f__dhthxq9 f__dhthxq7 f__dhthxq8 AppBar__1yk3a450";
579
+ var centerMain = (0, import_createRuntimeFn.createRuntimeFn)({ defaultClassName: "AppBar__1yk3a459", variantClassNames: { hasLeft: { true: "AppBar_hasLeft_true__1yk3a45a" } }, defaultVariants: {}, compoundVariants: [] });
580
+ var centerMainEdge = "AppBar__1yk3a45b f__dhthxqi f__dhthxq4 f__dhthxq2 f__dhthxqf";
581
+ var centerText = "AppBar__1yk3a45c f__dhthxqc f__dhthxqd f__dhthxq0";
582
+ var closeButton = "AppBar__1yk3a456 f__dhthxq9 f__dhthxq7 f__dhthxqb f__dhthxqf f__dhthxqi";
583
+ var container = "AppBar__1yk3a454 f__dhthxqa f__dhthxq7 f__dhthxqc";
584
+ var left = "AppBar__1yk3a455 f__dhthxq9 f__dhthxq7 f__dhthxq1 AppBar__1yk3a450";
585
+ var right = "AppBar__1yk3a45d f__dhthxq9 f__dhthxq7 f__dhthxq1 f__dhthxq5 AppBar__1yk3a450";
586
+ var safeArea = "AppBar__1yk3a453";
587
+
588
+ // src/components/AppScreen.css.ts
589
+ var import_createRuntimeFn2 = require("@vanilla-extract/recipes/createRuntimeFn");
590
+ var appScreen = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 f__dhthxqc", variantClassNames: { transitionState: { "enter-active": "AppScreen__1dlf4349", "enter-done": "AppScreen__1dlf434a", "exit-active": "AppScreen__1dlf434b", "exit-done": "AppScreen__1dlf434c" } }, defaultVariants: {}, compoundVariants: [] });
591
+ var dim = "AppScreen__1dlf434i f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 AppScreen__1dlf4346 AppScreen__1dlf4348";
592
+ var edge = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "AppScreen__1dlf434l f__dhthxq4 f__dhthxq2 f__dhthxq3 f__dhthxq1", variantClassNames: { hasAppBar: { true: "AppScreen_hasAppBar_true__1dlf434m" } }, defaultVariants: {}, compoundVariants: [] });
593
+ var paper = (0, import_createRuntimeFn2.createRuntimeFn)({ defaultClassName: "AppScreen__1dlf434j f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 AppScreen__1dlf4347 AppScreen__1dlf4348", variantClassNames: { hasAppBar: { true: "AppScreen_hasAppBar_true__1dlf434k f__dhthxqg" } }, defaultVariants: {}, compoundVariants: [] });
594
+ var vars = { transitionDuration: "var(--transitionDuration__1dlf4340)", zIndexes: { dim: "var(--zIndexes-dim__1dlf4341)", paper: "var(--zIndexes-paper__1dlf4342)", edge: "var(--zIndexes-edge__1dlf4343)", appBar: "var(--zIndexes-appBar__1dlf4344)" }, appBar: { center: { mainWidth: "var(--appBar-center-mainWidth__1dlf4345)" } } };
595
+
596
+ // src/components/AppBar.tsx
597
+ var AppBar = import_react9.default.forwardRef(
598
+ ({
599
+ title,
600
+ appendLeft,
601
+ appendRight,
602
+ backButton: backButton2,
603
+ closeButton: closeButton2,
604
+ closeButtonLocation = "left",
605
+ border = true,
606
+ iconColor,
607
+ textColor,
608
+ borderColor,
609
+ borderSize,
610
+ height,
611
+ backgroundColor,
612
+ onTopClick
613
+ }, ref) => {
614
+ var _a;
615
+ const actions = (0, import_react8.useActions)();
616
+ const activity = useNullableActivity();
617
+ const globalOptions = useGlobalOptions();
618
+ const globalCloseButton = (_a = globalOptions.appBar) == null ? void 0 : _a.closeButton;
619
+ const centerRef = (0, import_react9.useRef)(null);
620
+ const { maxWidth } = useMaxWidth({
621
+ outerRef: ref,
622
+ innerRef: centerRef,
623
+ enable: globalOptions.theme === "cupertino"
624
+ });
625
+ const onBackClick = (e) => {
626
+ if (backButton2 && "onClick" in backButton2 && backButton2.onClick) {
627
+ backButton2.onClick(e);
628
+ }
629
+ if (!e.defaultPrevented) {
630
+ actions.pop();
631
+ }
632
+ };
633
+ const renderBackButton = () => {
634
+ var _a2;
635
+ if (!activity) {
636
+ return null;
637
+ }
638
+ if (activity.isRoot) {
639
+ return null;
640
+ }
641
+ if (!backButton2) {
642
+ return /* @__PURE__ */ import_react9.default.createElement("button", {
643
+ type: "button",
644
+ className: backButton,
645
+ onClick: onBackClick
646
+ }, /* @__PURE__ */ import_react9.default.createElement(IconBack_default, null));
647
+ }
648
+ if ("render" in backButton2 && backButton2.render) {
649
+ return (_a2 = backButton2.render) == null ? void 0 : _a2.call(backButton2);
650
+ }
651
+ return /* @__PURE__ */ import_react9.default.createElement("button", {
652
+ type: "button",
653
+ className: backButton,
654
+ onClick: onBackClick
655
+ }, "renderIcon" in backButton2 && backButton2.renderIcon ? backButton2.renderIcon() : /* @__PURE__ */ import_react9.default.createElement(IconBack_default, null));
656
+ };
657
+ const onCloseClick = (e) => {
658
+ var _a2;
659
+ if (closeButton2 && "onClick" in closeButton2 && closeButton2.onClick) {
660
+ closeButton2.onClick(e);
661
+ }
662
+ if (!e.defaultPrevented && globalCloseButton && "onClick" in globalCloseButton) {
663
+ (_a2 = globalCloseButton.onClick) == null ? void 0 : _a2.call(globalCloseButton, e);
664
+ }
665
+ };
666
+ const renderCloseButton = () => {
667
+ var _a2;
668
+ const isRoot = !activity || activity.isRoot;
669
+ if (!closeButton2 && !((_a2 = globalOptions.appBar) == null ? void 0 : _a2.closeButton) || !isRoot) {
670
+ return null;
671
+ }
672
+ if (closeButton2 && "render" in closeButton2 && closeButton2.render) {
673
+ return closeButton2.render();
674
+ }
675
+ if (globalCloseButton && "render" in globalCloseButton && globalCloseButton.render) {
676
+ return globalCloseButton.render();
677
+ }
678
+ return /* @__PURE__ */ import_react9.default.createElement("button", {
679
+ type: "button",
680
+ className: closeButton,
681
+ onClick: onCloseClick
682
+ }, (() => {
683
+ if (closeButton2 && "renderIcon" in closeButton2 && closeButton2.renderIcon) {
684
+ return closeButton2.renderIcon();
685
+ }
686
+ if (globalCloseButton && "renderIcon" in globalCloseButton && globalCloseButton.renderIcon) {
687
+ return globalCloseButton.renderIcon();
688
+ }
689
+ return /* @__PURE__ */ import_react9.default.createElement(IconClose_default, null);
690
+ })());
691
+ };
692
+ const hasLeft = !!(closeButtonLocation === "left" && closeButton2 || backButton2 || appendLeft);
693
+ return /* @__PURE__ */ import_react9.default.createElement("div", {
694
+ ref,
695
+ className: appBar({
696
+ border
697
+ }),
698
+ style: (0, import_dynamic2.assignInlineVars)(
699
+ compactMap({
700
+ [globalVars.appBar.iconColor]: iconColor,
701
+ [globalVars.appBar.textColor]: textColor,
702
+ [globalVars.appBar.borderColor]: borderColor,
703
+ [globalVars.appBar.borderSize]: borderSize,
704
+ [globalVars.appBar.height]: height,
705
+ [globalVars.appBar.backgroundColor]: backgroundColor || globalVars.backgroundColor,
706
+ [vars.appBar.center.mainWidth]: `${maxWidth}px`
707
+ })
708
+ )
709
+ }, /* @__PURE__ */ import_react9.default.createElement("div", {
710
+ className: safeArea
711
+ }), /* @__PURE__ */ import_react9.default.createElement("div", {
712
+ className: container
713
+ }, /* @__PURE__ */ import_react9.default.createElement("div", {
714
+ className: left
715
+ }, closeButtonLocation === "left" && renderCloseButton(), renderBackButton(), appendLeft == null ? void 0 : appendLeft()), /* @__PURE__ */ import_react9.default.createElement("div", {
716
+ ref: centerRef,
717
+ className: center
718
+ }, /* @__PURE__ */ import_react9.default.createElement("div", {
719
+ className: centerMain({
720
+ hasLeft
721
+ })
722
+ }, typeof title === "string" ? /* @__PURE__ */ import_react9.default.createElement("div", {
723
+ className: centerText
724
+ }, title) : title, /* @__PURE__ */ import_react9.default.createElement("button", {
725
+ className: centerMainEdge,
726
+ type: "button",
727
+ "aria-hidden": "true",
728
+ onClick: onTopClick
729
+ }))), /* @__PURE__ */ import_react9.default.createElement("div", {
730
+ className: right
731
+ }, appendRight == null ? void 0 : appendRight(), closeButtonLocation === "right" && renderCloseButton())));
732
+ }
733
+ );
734
+ AppBar.displayName = "AppBar";
735
+ var AppBar_default = AppBar;
736
+
737
+ // src/components/AppScreen.tsx
738
+ var AppScreen = ({
739
+ backgroundColor,
740
+ dimBackgroundColor,
741
+ appBar: appBar2,
742
+ preventSwipeBack,
743
+ children
744
+ }) => {
745
+ var _a, _b;
746
+ const globalOptions = useGlobalOptions();
747
+ const activity = useNullableActivity();
748
+ const { pop } = (0, import_react10.useActions)();
749
+ const appScreenRef = (0, import_react11.useRef)(null);
750
+ const dimRef = (0, import_react11.useRef)(null);
751
+ const paperRef = (0, import_react11.useRef)(null);
752
+ const edgeRef = (0, import_react11.useRef)(null);
753
+ const appBarRef = (0, import_react11.useRef)(null);
754
+ useStyleEffectHide({
755
+ refs: [appScreenRef],
756
+ hasEffect: true
757
+ });
758
+ useStyleEffectOffset({
759
+ theme: globalOptions.theme,
760
+ refs: globalOptions.theme === "cupertino" ? [paperRef] : [paperRef, appBarRef],
761
+ hasEffect: true
762
+ });
763
+ useStyleEffectSwipeBack({
764
+ theme: globalOptions.theme,
765
+ dimRef,
766
+ edgeRef,
767
+ paperRef,
768
+ hasEffect: true,
769
+ onSwiped() {
770
+ pop();
771
+ }
772
+ });
773
+ const hasAppBar = !!appBar2;
774
+ const zIndexBase = ((_a = activity == null ? void 0 : activity.zIndex) != null ? _a : 0) * 5;
775
+ const zIndexDim = zIndexBase;
776
+ const zIndexPaper = zIndexBase + (globalOptions.theme === "cupertino" && hasAppBar ? 1 : 3);
777
+ const zIndexEdge = zIndexBase + 4;
778
+ const zIndexAppBar = zIndexBase + 7;
779
+ const transitionState = (_b = activity == null ? void 0 : activity.transitionState) != null ? _b : "enter-done";
780
+ const lazyTransitionState = useLazy(transitionState);
781
+ const onAppBarTopClick = (e) => {
782
+ var _a2, _b2;
783
+ (_a2 = appBar2 == null ? void 0 : appBar2.onTopClick) == null ? void 0 : _a2.call(appBar2, e);
784
+ if (!e.defaultPrevented) {
785
+ (_b2 = paperRef.current) == null ? void 0 : _b2.scroll({
786
+ top: 0,
787
+ behavior: "smooth"
788
+ });
789
+ }
790
+ };
791
+ return /* @__PURE__ */ import_react11.default.createElement("div", {
792
+ ref: appScreenRef,
793
+ className: appScreen({
794
+ transitionState: transitionState === "enter-done" || transitionState === "exit-done" ? transitionState : lazyTransitionState
795
+ }),
796
+ style: (0, import_dynamic3.assignInlineVars)(
797
+ compactMap({
798
+ [globalVars.backgroundColor]: backgroundColor,
799
+ [globalVars.dimBackgroundColor]: dimBackgroundColor,
800
+ [globalVars.appBar.height]: appBar2 == null ? void 0 : appBar2.height,
801
+ [globalVars.appBar.heightTransitionDuration]: appBar2 == null ? void 0 : appBar2.heightTransitionDuration,
802
+ [vars.zIndexes.dim]: `${zIndexDim}`,
803
+ [vars.zIndexes.paper]: `${zIndexPaper}`,
804
+ [vars.zIndexes.edge]: `${zIndexEdge}`,
805
+ [vars.zIndexes.appBar]: `${zIndexAppBar}`,
806
+ [vars.transitionDuration]: transitionState === "enter-active" || transitionState === "exit-active" ? `var(--stackflow-transition-duration)` : "0ms"
807
+ })
808
+ )
809
+ }, /* @__PURE__ */ import_react11.default.createElement("div", {
810
+ className: dim,
811
+ ref: dimRef
812
+ }), /* @__PURE__ */ import_react11.default.createElement("div", {
813
+ key: activity == null ? void 0 : activity.id,
814
+ className: paper({
815
+ hasAppBar
816
+ }),
817
+ ref: paperRef
818
+ }, children), !(activity == null ? void 0 : activity.isRoot) && globalOptions.theme === "cupertino" && !preventSwipeBack && /* @__PURE__ */ import_react11.default.createElement("div", {
819
+ className: edge({ hasAppBar }),
820
+ ref: edgeRef
821
+ }), appBar2 && /* @__PURE__ */ import_react11.default.createElement(AppBar_default, __spreadProps(__spreadValues({}, appBar2), {
822
+ ref: appBarRef,
823
+ onTopClick: onAppBarTopClick
824
+ })));
825
+ };
826
+ AppScreen.displayName = "AppScreen";
827
+ var AppScreen_default = AppScreen;
828
+
829
+ // src/components/BottomSheet.tsx
830
+ var import_react12 = require("@stackflow/react");
831
+ var import_dynamic4 = require("@vanilla-extract/dynamic");
832
+ var import_react13 = __toESM(require("react"));
833
+
834
+ // src/components/BottomSheet.css.ts
835
+ var import_createRuntimeFn3 = require("@vanilla-extract/recipes/createRuntimeFn");
836
+ var container2 = (0, import_createRuntimeFn3.createRuntimeFn)({ defaultClassName: "f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 f__dhthxqc", variantClassNames: { transitionState: { "enter-active": "BottomSheet__1ht38h04", "enter-done": "BottomSheet__1ht38h05", "exit-active": "BottomSheet__1ht38h06", "exit-done": "BottomSheet__1ht38h07" } }, defaultVariants: {}, compoundVariants: [] });
837
+ var dim2 = "BottomSheet__1ht38h0d f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 f__dhthxqc f__dhthxqa f__dhthxq7 BottomSheet__1ht38h03";
838
+ var paper2 = "BottomSheet__1ht38h0e f__dhthxqc BottomSheet__1ht38h03";
839
+ var vars2 = { transitionDuration: "var(--transitionDuration__1ht38h00)", zIndexes: { dim: "var(--zIndexes-dim__1ht38h01)", paper: "var(--zIndexes-paper__1ht38h02)" } };
840
+
841
+ // src/components/BottomSheet.tsx
842
+ var BottomSheet = ({
843
+ borderRadius = "1rem",
844
+ backgroundColor,
845
+ dimBackgroundColor,
846
+ onOutsideClick,
847
+ children
848
+ }) => {
849
+ var _a, _b, _c;
850
+ const activity = useNullableActivity();
851
+ const { pop } = (0, import_react12.useActions)();
852
+ const containerRef = (0, import_react13.useRef)(null);
853
+ const paperRef = (0, import_react13.useRef)(null);
854
+ useStyleEffect({
855
+ styleName: "hide",
856
+ refs: [containerRef]
857
+ });
858
+ useStyleEffect({
859
+ styleName: "offset",
860
+ refs: [paperRef]
861
+ });
862
+ useStyleEffect({
863
+ styleName: "swipe-back",
864
+ refs: [paperRef]
865
+ });
866
+ const popLock = (0, import_react13.useRef)(false);
867
+ const onDimClick = (e) => {
868
+ onOutsideClick == null ? void 0 : onOutsideClick(e);
869
+ if (e.defaultPrevented) {
870
+ return;
871
+ }
872
+ if (popLock.current) {
873
+ return;
874
+ }
875
+ popLock.current = true;
876
+ pop();
877
+ };
878
+ const onPaperClick = (e) => {
879
+ e.stopPropagation();
880
+ };
881
+ const zIndexBase = ((_a = activity == null ? void 0 : activity.zIndex) != null ? _a : 0) * 5 + 3;
882
+ const zIndexPaper = ((_b = activity == null ? void 0 : activity.zIndex) != null ? _b : 0) * 5 + 4;
883
+ const transitionState = (_c = activity == null ? void 0 : activity.transitionState) != null ? _c : "enter-done";
884
+ return /* @__PURE__ */ import_react13.default.createElement("div", {
885
+ className: container2({
886
+ transitionState: useLazy(transitionState)
887
+ }),
888
+ ref: containerRef,
889
+ style: (0, import_dynamic4.assignInlineVars)(
890
+ compactMap({
891
+ [globalVars.bottomSheet.borderRadius]: borderRadius,
892
+ [globalVars.backgroundColor]: backgroundColor,
893
+ [globalVars.dimBackgroundColor]: dimBackgroundColor,
894
+ [vars2.zIndexes.dim]: `${zIndexBase}`,
895
+ [vars2.zIndexes.paper]: `${zIndexPaper}`,
896
+ [vars2.transitionDuration]: transitionState === "enter-active" || transitionState === "exit-active" ? `var(--stackflow-transition-duration)` : "0ms"
897
+ })
898
+ )
899
+ }, /* @__PURE__ */ import_react13.default.createElement("div", {
900
+ className: dim2,
901
+ ref: paperRef,
902
+ onClick: onDimClick
903
+ }, /* @__PURE__ */ import_react13.default.createElement("div", {
904
+ className: paper2,
905
+ onClick: onPaperClick
906
+ }, children)));
907
+ };
908
+ BottomSheet.displayName = "BottomSheet";
909
+ var BottomSheet_default = BottomSheet;
910
+
911
+ // src/components/Modal.tsx
912
+ var import_react14 = require("@stackflow/react");
913
+ var import_dynamic5 = require("@vanilla-extract/dynamic");
914
+ var import_react15 = __toESM(require("react"));
915
+
916
+ // src/components/Modal.css.ts
917
+ var import_createRuntimeFn4 = require("@vanilla-extract/recipes/createRuntimeFn");
918
+ var container3 = (0, import_createRuntimeFn4.createRuntimeFn)({ defaultClassName: "f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 f__dhthxqc", variantClassNames: { transitionState: { "enter-active": "Modal__5ozg8c4", "enter-done": "Modal__5ozg8c5", "exit-active": "Modal__5ozg8c6", "exit-done": "Modal__5ozg8c7" } }, defaultVariants: {}, compoundVariants: [] });
919
+ var dim3 = "Modal__5ozg8cd f__dhthxq4 f__dhthxq0 f__dhthxq1 f__dhthxq2 f__dhthxq3 f__dhthxqc f__dhthxq9 f__dhthxq7 f__dhthxqb Modal__5ozg8c3";
920
+ var paper3 = "Modal__5ozg8ce f__dhthxqc Modal__5ozg8c3";
921
+ var vars3 = { transitionDuration: "var(--transitionDuration__5ozg8c0)", zIndexes: { dim: "var(--zIndexes-dim__5ozg8c1)", paper: "var(--zIndexes-paper__5ozg8c2)" } };
922
+
923
+ // src/components/Modal.tsx
924
+ var Modal = ({
925
+ backgroundColor,
926
+ dimBackgroundColor,
927
+ borderRadius = "1rem",
928
+ onOutsideClick,
929
+ children
930
+ }) => {
931
+ var _a, _b, _c;
932
+ const activity = useNullableActivity();
933
+ const { pop } = (0, import_react14.useActions)();
934
+ const containerRef = (0, import_react15.useRef)(null);
935
+ const paperRef = (0, import_react15.useRef)(null);
936
+ useStyleEffect({
937
+ styleName: "hide",
938
+ refs: [containerRef]
939
+ });
940
+ useStyleEffect({
941
+ styleName: "offset",
942
+ refs: [paperRef]
943
+ });
944
+ useStyleEffect({
945
+ styleName: "swipe-back",
946
+ refs: [paperRef]
947
+ });
948
+ const popLock = (0, import_react15.useRef)(false);
949
+ const onDimClick = (e) => {
950
+ onOutsideClick == null ? void 0 : onOutsideClick(e);
951
+ if (e.defaultPrevented) {
952
+ return;
953
+ }
954
+ if (popLock.current) {
955
+ return;
956
+ }
957
+ popLock.current = true;
958
+ pop();
959
+ };
960
+ const onPaperClick = (e) => {
961
+ e.stopPropagation();
962
+ };
963
+ const zIndexBase = ((_a = activity == null ? void 0 : activity.zIndex) != null ? _a : 0) * 5 + 3;
964
+ const zIndexPaper = ((_b = activity == null ? void 0 : activity.zIndex) != null ? _b : 0) * 5 + 4;
965
+ const transitionState = (_c = activity == null ? void 0 : activity.transitionState) != null ? _c : "enter-done";
966
+ return /* @__PURE__ */ import_react15.default.createElement("div", {
967
+ className: container3({
968
+ transitionState: useLazy(transitionState)
969
+ }),
970
+ ref: containerRef,
971
+ style: (0, import_dynamic5.assignInlineVars)(
972
+ compactMap({
973
+ [globalVars.bottomSheet.borderRadius]: borderRadius,
974
+ [globalVars.backgroundColor]: backgroundColor,
975
+ [globalVars.dimBackgroundColor]: dimBackgroundColor,
976
+ [vars3.zIndexes.dim]: `${zIndexBase}`,
977
+ [vars3.zIndexes.paper]: `${zIndexPaper}`,
978
+ [vars3.transitionDuration]: transitionState === "enter-active" || transitionState === "exit-active" ? `var(--stackflow-transition-duration)` : "0ms"
979
+ })
980
+ )
981
+ }, /* @__PURE__ */ import_react15.default.createElement("div", {
982
+ className: dim3,
983
+ ref: paperRef,
984
+ onClick: onDimClick
985
+ }, /* @__PURE__ */ import_react15.default.createElement("div", {
986
+ className: paper3,
987
+ onClick: onPaperClick
988
+ }, children)));
989
+ };
990
+ Modal.displayName = "Modal";
991
+ var Modal_default = Modal;
2
992
  //# sourceMappingURL=index.js.map