ponchojs
Version:
Poncho
48 lines (47 loc) • 2.02 kB
JavaScript
;var e=require("./emotion-react-jsx-runtime.esm-1fb36074.js"),i=require("./styled-components.esm-174f8520.js"),n=require("./close-0aa1354f.js"),t=require("react");const o=t.createContext(!1),s=i.styled.section`
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
background-color: #e2e2e2;
z-index: 10;
filter: blur(2);
opacity: ${({open:e})=>e?.6:0};
visibility: ${({open:e})=>e?"visible":"hidden"};
transition: all 0.3s linear;
animation-delay: ${({open:e})=>(e?.5:0)+"s"};
`,l=i.styled.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:e})=>e?300:11};
opacity: ${({open:e})=>e?1:0};
visibility: ${({open:e})=>e?"visible":"hidden"};
transition: all 0.3s linear;
animation-delay: ${({open:e})=>(e?5:0)+"s"};
`,r=i.styled.div`
transform: ${({open:e})=>`translateY(${e?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:e})=>e?301:12};
width: ${({full:e})=>e?"100%":void 0};
height: ${({full:e})=>e?"100%":void 0};
`,d=i.styled.div`
position: fixed;
top: 18px;
right: 18px;
cursor: pointer;
z-index: 50;
`;exports.FullLoadingProvider=i=>{i=i.children;return e.jsx(o.Provider,Object.assign({value:!0},{children:i}),void 0)},exports.Modal=i=>{const{open:a,onClose:c,children:p,closeClickOutside:u,closeBtn:x,fullScreen:v}=i;return i=t.useContext(o),e.jsxs(e.Fragment,{children:[e.jsx(s,{open:a,onClick:()=>{u&&c&&c()}},void 0),e.jsxs(l,Object.assign({isFullLoading:i,open:a,onClick:()=>{u&&c&&c()}},{children:[e.jsx(r,Object.assign({full:v,open:a,isFullLoading:i},{children:p}),void 0),x&&a&&e.jsx(d,Object.assign({onClick:()=>{c&&c()}},{children:e.jsx(n.Delete,{width:32,height:32},void 0)}),void 0)]}),void 0)]},void 0)};
//# sourceMappingURL=Modal-248b7adc.js.map