freemium-ui 1.0.193 → 1.0.194
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/lib/index.cjs.js +1 -1
- package/lib/index.esm.js +1 -1
- package/package.json +1 -1
package/lib/index.cjs.js
CHANGED
|
@@ -292,7 +292,7 @@ object-assign
|
|
|
292
292
|
background: ${({theme:e})=>e.palette.elephant};
|
|
293
293
|
`,ac=tt.div`
|
|
294
294
|
${({theme:{colors:{components:{confirmModal:e}}}})=>`\n position: fixed;\n bottom: 0;\n width: 100%;\n justify-content: flex-end;\n display: flex;\n padding: 12px 16px 12px 16px;\n border-top: 1px solid ${e.border};\n background: ${e.background};\n border-radius: 4px;\n `}
|
|
295
|
-
`,oc=t.createContext({content:{},overlay:{}}),cc=()=>t.useContext(oc);function ic(e){const{in:n,children:r,placement:a}=e;return t.createElement(jo,{in:n,placement:a,timeout:450},(e=>t.createElement(Po,{in:n,timeout:250},(t=>r({content:e,overlay:t})))))}const sc=({children:e,size:n})=>{const{content:r}=cc();return t.createElement(Qo,{className:"modal-content",size:n,style:r},e)},lc=({isOpen:e,children:n,...r})=>{const{overlay:a}=cc();return t.createElement(qo,Object.assign({className:"model-overlay",isOpen:e,style:a},r),n)},hc=(e,t)=>{const n=()=>(new Date).getTime(),r=()=>o=n();let a,o=n()-t;return(...c)=>new Promise((i=>{const s=o+t-n();a&&clearTimeout(a),o+t<=n()?(r(),i(e(...c))):a=setTimeout((()=>{r(),i(e(...c))}),s)}))},uc={height:0,width:0,x:2e3,y:2e3,bottom:0,left:0,right:0,top:0,toJSON:()=>{}};let pc;const dc=e=>{const{onClose:t=(()=>{}),children:r,autoCloseDuration:a=800,anchorEl:o=null,hoverOutToClose:c=!1,clickOutToClose:s=!0,id:l,anchorOrigin:h={vertical:"bottom",horizontal:"center"},transformOrigin:u={vertical:"top",horizontal:"center"}}=e,p=o&&o.getBoundingClientRect()||uc,[d,m]=n.useState({left:p.y,top:p.x}),v=n.createRef(),f=()=>{const e=v.current&&v.current.getBoundingClientRect()||uc;if(v.current){const t=((e,t,n,r)=>{let a=e.y,o=e.x;const{width:c,height:i}=t;switch(n.vertical){case"center":a+=e.height/2;break;case"bottom":a+=e.height}switch(n.horizontal){case"center":o+=e.width/2;break;case"right":o+=e.width}switch(r.vertical){case"center":a-=i/2;break;case"bottom":a-=i}switch(r.horizontal){case"center":o-=c/2;break;case"right":o-=c}const{innerWidth:s,innerHeight:l}=window;o+c>s&&(o-=o+c-s+16);a+i>l&&(a-=a+i-l+16);return{top:a,left:o}})(p,e,h,u);m(t)}};window.addEventListener("resize",hc(f,500)),window.addEventListener("scroll",hc(f,500)),n.useEffect((()=>{f(),o&&(clearTimeout(pc),pc=setTimeout((()=>{t()}),a))}),[o]);const g=o&&o.getAttribute("aria-describedby");return o&&l===g?i.createPortal(n.createElement(vc,{id:l,onClick:s?e=>t(e):()=>{}},n.createElement(mc,{onMouseEnter:()=>clearTimeout(pc),onMouseLeave:c?e=>t(e):()=>{},ref:v,style:d},r)),document.body):null},mc=tt.div`
|
|
295
|
+
`,oc=t.createContext({content:{},overlay:{}}),cc=()=>t.useContext(oc);function ic(e){const{in:n,children:r,placement:a}=e;return t.createElement(jo,{in:n,placement:a,timeout:450},(e=>t.createElement(Po,{in:n,timeout:250},(t=>r({content:e,overlay:t})))))}const sc=({children:e,size:n})=>{const{content:r}=cc();return t.createElement(Qo,{className:"modal-content",size:n,style:r},e)},lc=({isOpen:e,children:n,...r})=>{const{overlay:a}=cc();return t.createElement(qo,Object.assign({className:"model-overlay",isOpen:e,style:a},r),n)},hc=(e,t)=>{const n=()=>(new Date).getTime(),r=()=>o=n();let a,o=n()-t;return(...c)=>new Promise((i=>{const s=o+t-n();a&&clearTimeout(a),o+t<=n()?(r(),i(e(...c))):a=setTimeout((()=>{r(),i(e(...c))}),s)}))},uc={height:0,width:0,x:2e3,y:2e3,bottom:0,left:0,right:0,top:0,toJSON:()=>{}};let pc;const dc=e=>{const{onClose:t=(()=>{}),children:r,autoCloseDuration:a=800,anchorEl:o=null,hoverOutToClose:c=!1,clickOutToClose:s=!0,id:l,anchorOrigin:h={vertical:"bottom",horizontal:"center"},transformOrigin:u={vertical:"top",horizontal:"center"}}=e,p=o&&o.getBoundingClientRect()||uc,[d,m]=n.useState({left:p.y,top:p.x}),v=n.createRef(),f=()=>{const e=v.current&&v.current.getBoundingClientRect()||uc;if(v.current){const t=((e,t,n,r)=>{let a=e.y,o=e.x;const{width:c,height:i}=t;switch(n.vertical){case"center":a+=e.height/2;break;case"bottom":a+=e.height}switch(n.horizontal){case"center":o+=e.width/2;break;case"right":o+=e.width}switch(r.vertical){case"center":a-=i/2;break;case"bottom":a-=i}switch(r.horizontal){case"center":o-=c/2;break;case"right":o-=c}const{innerWidth:s,innerHeight:l}=window;o+c>s&&(o-=o+c-s+16);a+i>l&&(a-=a+i-l+16);return{top:a,left:o}})(p,e,h,u);m(t)}};window.addEventListener("resize",hc(f,500)),window.addEventListener("scroll",hc(f,500)),n.useEffect((()=>{f(),o&&c&&(clearTimeout(pc),pc=setTimeout((()=>{t()}),a))}),[o]);const g=o&&o.getAttribute("aria-describedby");return o&&l===g?i.createPortal(n.createElement(vc,{id:l,onClick:s?e=>t(e):()=>{}},n.createElement(mc,{onMouseEnter:()=>clearTimeout(pc),onMouseLeave:c?e=>t(e):()=>{},ref:v,style:d},r)),document.body):null},mc=tt.div`
|
|
296
296
|
position: absolute;
|
|
297
297
|
`,vc=tt.div`
|
|
298
298
|
top: 0;
|
package/lib/index.esm.js
CHANGED
|
@@ -292,7 +292,7 @@ object-assign
|
|
|
292
292
|
background: ${({theme:e})=>e.palette.elephant};
|
|
293
293
|
`,Oc=Et.div`
|
|
294
294
|
${({theme:{colors:{components:{confirmModal:e}}}})=>`\n position: fixed;\n bottom: 0;\n width: 100%;\n justify-content: flex-end;\n display: flex;\n padding: 12px 16px 12px 16px;\n border-top: 1px solid ${e.border};\n background: ${e.background};\n border-radius: 4px;\n `}
|
|
295
|
-
`,Ic=d({content:{},overlay:{}}),Nc=()=>t(Ic);function Pc(e){const{in:t,children:n,placement:r}=e;return o(mc,{in:t,placement:r,timeout:450},(e=>o(pc,{in:t,timeout:250},(t=>n({content:e,overlay:t})))))}function Tc(e){const{isOpen:t,onDismiss:n,hideDismissIcon:r,clickOutToClose:a=!0,size:c="default",placement:i="right",children:s,...l}=e;return o(Pc,{in:t,placement:i},(e=>o(Ic.Provider,{value:e},o(Fc,{isOpen:!0,onDismiss:a?n:()=>{}},o(Rc,{size:c},!r&&o(Dc,{onClick:n},o(er,{glyph:"close",size:"12",viewBox:"-2 -2 10 10"})),s)))))}const Rc=({children:e,size:t})=>{const{content:n}=Nc();return o(kc,{className:"modal-content",size:t,style:n},e)},Fc=({isOpen:e,children:t,...n})=>{const{overlay:r}=Nc();return o(wc,Object.assign({className:"model-overlay",isOpen:e,style:r},n),t)},jc=(e,t)=>{let n=0;return(...r)=>{clearTimeout(n),n=setTimeout((()=>e(...r)),t)}},Yc=(e,t)=>{const n=()=>(new Date).getTime(),r=()=>o=n();let a,o=n()-t;return(...c)=>new Promise((i=>{const s=o+t-n();a&&clearTimeout(a),o+t<=n()?(r(),i(e(...c))):a=setTimeout((()=>{r(),i(e(...c))}),s)}))},Bc={height:0,width:0,x:2e3,y:2e3,bottom:0,left:0,right:0,top:0,toJSON:()=>{}};let $c;const Wc=t=>{const{onClose:n=(()=>{}),children:r,autoCloseDuration:a=800,anchorEl:o=null,hoverOutToClose:c=!1,clickOutToClose:i=!0,id:s,anchorOrigin:l={vertical:"bottom",horizontal:"center"},transformOrigin:h={vertical:"top",horizontal:"center"}}=t,p=o&&o.getBoundingClientRect()||Bc,[d,u]=e.useState({left:p.y,top:p.x}),m=e.createRef(),v=()=>{const e=m.current&&m.current.getBoundingClientRect()||Bc;if(m.current){const t=((e,t,n,r)=>{let a=e.y,o=e.x;const{width:c,height:i}=t;switch(n.vertical){case"center":a+=e.height/2;break;case"bottom":a+=e.height}switch(n.horizontal){case"center":o+=e.width/2;break;case"right":o+=e.width}switch(r.vertical){case"center":a-=i/2;break;case"bottom":a-=i}switch(r.horizontal){case"center":o-=c/2;break;case"right":o-=c}const{innerWidth:s,innerHeight:l}=window;o+c>s&&(o-=o+c-s+16);a+i>l&&(a-=a+i-l+16);return{top:a,left:o}})(p,e,l,h);u(t)}};window.addEventListener("resize",Yc(v,500)),window.addEventListener("scroll",Yc(v,500)),e.useEffect((()=>{v(),o&&(clearTimeout($c),$c=setTimeout((()=>{n()}),a))}),[o]);const f=o&&o.getAttribute("aria-describedby");return o&&s===f?V.createPortal(e.createElement(Kc,{id:s,onClick:i?e=>n(e):()=>{}},e.createElement(Uc,{onMouseEnter:()=>clearTimeout($c),onMouseLeave:c?e=>n(e):()=>{},ref:m,style:d},r)),document.body):null},Uc=Et.div`
|
|
295
|
+
`,Ic=d({content:{},overlay:{}}),Nc=()=>t(Ic);function Pc(e){const{in:t,children:n,placement:r}=e;return o(mc,{in:t,placement:r,timeout:450},(e=>o(pc,{in:t,timeout:250},(t=>n({content:e,overlay:t})))))}function Tc(e){const{isOpen:t,onDismiss:n,hideDismissIcon:r,clickOutToClose:a=!0,size:c="default",placement:i="right",children:s,...l}=e;return o(Pc,{in:t,placement:i},(e=>o(Ic.Provider,{value:e},o(Fc,{isOpen:!0,onDismiss:a?n:()=>{}},o(Rc,{size:c},!r&&o(Dc,{onClick:n},o(er,{glyph:"close",size:"12",viewBox:"-2 -2 10 10"})),s)))))}const Rc=({children:e,size:t})=>{const{content:n}=Nc();return o(kc,{className:"modal-content",size:t,style:n},e)},Fc=({isOpen:e,children:t,...n})=>{const{overlay:r}=Nc();return o(wc,Object.assign({className:"model-overlay",isOpen:e,style:r},n),t)},jc=(e,t)=>{let n=0;return(...r)=>{clearTimeout(n),n=setTimeout((()=>e(...r)),t)}},Yc=(e,t)=>{const n=()=>(new Date).getTime(),r=()=>o=n();let a,o=n()-t;return(...c)=>new Promise((i=>{const s=o+t-n();a&&clearTimeout(a),o+t<=n()?(r(),i(e(...c))):a=setTimeout((()=>{r(),i(e(...c))}),s)}))},Bc={height:0,width:0,x:2e3,y:2e3,bottom:0,left:0,right:0,top:0,toJSON:()=>{}};let $c;const Wc=t=>{const{onClose:n=(()=>{}),children:r,autoCloseDuration:a=800,anchorEl:o=null,hoverOutToClose:c=!1,clickOutToClose:i=!0,id:s,anchorOrigin:l={vertical:"bottom",horizontal:"center"},transformOrigin:h={vertical:"top",horizontal:"center"}}=t,p=o&&o.getBoundingClientRect()||Bc,[d,u]=e.useState({left:p.y,top:p.x}),m=e.createRef(),v=()=>{const e=m.current&&m.current.getBoundingClientRect()||Bc;if(m.current){const t=((e,t,n,r)=>{let a=e.y,o=e.x;const{width:c,height:i}=t;switch(n.vertical){case"center":a+=e.height/2;break;case"bottom":a+=e.height}switch(n.horizontal){case"center":o+=e.width/2;break;case"right":o+=e.width}switch(r.vertical){case"center":a-=i/2;break;case"bottom":a-=i}switch(r.horizontal){case"center":o-=c/2;break;case"right":o-=c}const{innerWidth:s,innerHeight:l}=window;o+c>s&&(o-=o+c-s+16);a+i>l&&(a-=a+i-l+16);return{top:a,left:o}})(p,e,l,h);u(t)}};window.addEventListener("resize",Yc(v,500)),window.addEventListener("scroll",Yc(v,500)),e.useEffect((()=>{v(),o&&c&&(clearTimeout($c),$c=setTimeout((()=>{n()}),a))}),[o]);const f=o&&o.getAttribute("aria-describedby");return o&&s===f?V.createPortal(e.createElement(Kc,{id:s,onClick:i?e=>n(e):()=>{}},e.createElement(Uc,{onMouseEnter:()=>clearTimeout($c),onMouseLeave:c?e=>n(e):()=>{},ref:m,style:d},r)),document.body):null},Uc=Et.div`
|
|
296
296
|
position: absolute;
|
|
297
297
|
`,Kc=Et.div`
|
|
298
298
|
top: 0;
|