UNPKG

@szum-tech/design-system

Version:

Szum-Tech design system with tailwindcss support

3 lines 880 B
import*as c from'react';function p({check:e,scope:o,message:t}){c.useEffect(()=>{e||console.error(`%c[Szum Tech-Design System]%c ${o}%c ${t}`,"color: #ef4444; font-weight: bold;","color: #3b82f6; font-weight: bold;","color: #f59e0b;");},[e,o,t]);}function a(e,o){if(typeof e=="function")return e(o);e!=null&&(e.current=o);}function u(...e){return o=>{let t=false,i=e.map(n=>{let r=a(n,o);return !t&&typeof r=="function"&&(t=true),r});if(t)return ()=>{for(let n=0;n<i.length;n++){let r=i[n];typeof r=="function"?r():a(e[n],null);}}}}function m(...e){return c.useCallback(u(...e),e)}var s=768;function b(){let[e,o]=c.useState(void 0);return c.useEffect(()=>{let t=window.matchMedia(`(max-width: ${s-1}px)`),i=()=>o(window.innerWidth<s);return t.addEventListener("change",i),o(window.innerWidth<s),()=>t.removeEventListener("change",i)},[]),!!e}export{p as a,u as b,m as c,b as d};