ponchojs
Version:
Poncho
48 lines (47 loc) • 1.96 kB
JavaScript
import{a as i,j as e,F as n}from"./emotion-react-jsx-runtime.esm-991ce217.js";import{s as o}from"./styled-components.esm-0d53f334.js";import{D as t}from"./close-3228efe8.js";import{createContext as s,useContext as l}from"react";const r=s(!1),a=e=>{e=e.children;return i(r.Provider,Object.assign({value:!0},{children:e}),void 0)},d=o.section`
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-color: #e2e2e2;
z-index: 10;
filter: blur(2);
opacity: ${({open:i})=>i?.6:0};
visibility: ${({open:i})=>i?"visible":"hidden"};
transition: all 0.3s linear;
animation-delay: ${({open:i})=>(i?.5:0)+"s"};
`,c=o.div`
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
/* pointer-events: none; */
display: flex;
align-items: center;
justify-content: center;
z-index: ${({isFullLoading:i})=>i?300:11};
opacity: ${({open:i})=>i?1:0};
visibility: ${({open:i})=>i?"visible":"hidden"};
transition: all 0.3s linear;
animation-delay: ${({open:i})=>(i?5:0)+"s"};
`,p=o.div`
transform: ${({open:i})=>`translateY(${i?0:1500}px)`};
transition: all 0.5s linear;
animation-delay: 0.5s;
display: flex;
align-items: center;
justify-content: center;
/* pointer-events: initial; */
z-index: ${({isFullLoading:i})=>i?301:12};
width: ${({full:i})=>i?"100%":void 0};
height: ${({full:i})=>i?"100%":void 0};
`,f=o.div`
position: fixed;
top: 18px;
right: 18px;
cursor: pointer;
z-index: 50;
`,m=o=>{const{open:s,onClose:a,children:m,closeClickOutside:v,closeBtn:h,fullScreen:u}=o;return o=l(r),e(n,{children:[i(d,{open:s,onClick:()=>{v&&a&&a()}},void 0),e(c,Object.assign({isFullLoading:o,open:s,onClick:()=>{v&&a&&a()}},{children:[i(p,Object.assign({full:u,open:s,isFullLoading:o},{children:m}),void 0),h&&s&&i(f,Object.assign({onClick:()=>{a&&a()}},{children:i(t,{width:32,height:32},void 0)}),void 0)]}),void 0)]},void 0)};export{a as F,m as M};
//# sourceMappingURL=Modal-d2e0a7d3.js.map