magic-components
Advanced tools
Comparing version 0.0.1-beta.3 to 0.0.1-beta.4
@@ -1,2 +0,2 @@ | ||
var r,e=(r=require("react"))&&"object"==typeof r&&"default"in r?r.default:r,t=require("framer-motion"),o=require("@nksaraf/colors");const a=e.createContext({}),s=()=>e.useContext(a)||{},i=(r,e,t)=>{let o="",a="",s="";for(let p in r){const n=r[p];if("object"==typeof n){let r=e+" "+p;/&/g.test(p)&&(r=p.replace(/&/g,e)),"@"==p[0]&&(r=e,"f"==p[1]&&(r=p)),/@k/.test(p)?a+=p+"{"+i(n,"","")+"}":a+=i(n,r,r==e?p:t||"")}else/^@i/.test(p)?o=p+" "+n+";":s+=i.p?i.p(p.replace(/[A-Z]/g,"-$&").toLowerCase(),n):p.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+n+";"}if(s[0]){const r=e+"{"+s+"}";return t?a+t+"{"+r+"}":o+r+a}return o+a},p=/\s*✨[0-9]+/g,n={data:""},l=r=>{try{let e=r?r.querySelector("#✨📃"):null;return e||(e=(r||document.head).appendChild(document.createElement("style")),e.innerHTML=" ",e.id="✨📃"),e.firstChild}catch(r){}return n},c=(r,e,t)=>{e.data.indexOf(r)<0&&(e.data=t?r+e.data:e.data+r)};let d={};const m=(r,e,t,o)=>{const a=JSON.stringify(r),s=d[a]||(d[a]=".✨"+a.split("").reduce((r,e)=>101*r+e.charCodeAt(0)>>>0,11)),p=d[s]||(d[s]=i(r,t?"":s));return c(p,e,o),s.slice(1)},b=(r,e)=>{let t=Object.assign({},r,e);for(const o in r)r[o]&&"object"==typeof e[o]&&Object.assign(t,{[o]:Object.assign(r[o],e[o])});return t},f={breakpoints:[40,52,64].map(r=>r+"em")},g=r=>"@media screen and (min-width: "+r+")",y=(r,e)=>u(e,r,r),u=(r,e,t,o,a)=>{let s=e&&e.split?e.split("."):[e];for(o=0;o<s.length;o++)r=r?r[s[o]]:a;return r===a?t:r},h=(r,e="ignore",t=!0)=>{const o={},a=(a,s)=>{let i={},p={},n=!1;const l=s&&s.disableStyledSystemCache;for(const c in a){if(!r[c]){"separate"===e?p[c]=a[c]:"merge"===e&&(i[c]=a[c]);continue}const d=r[c],m=a[c],y=u(s,d.scale,d.defaults);if("object"!=typeof m)Object.assign(i,d(m,y,a,s));else{if(!t&&Array.isArray(m)){i[c]=m.map(r=>d(r,y,a,s)[c]);continue}if(d.allowComplex||!t){Object.assign(i,d(m,y,a,s));continue}if(o.breakpoints=!l&&o.breakpoints||u(s,"breakpoints",f.breakpoints),Array.isArray(m)){o.media=!l&&o.media||[null,...o.breakpoints.map(g)],i=b(i,x(o.media,d,y,m,a,s));continue}null!==m&&(i=b(i,S(o.breakpoints,d,y,m,a,s)),n=!0)}}return n&&(i=(r=>{const e={};return Object.keys(r).sort((r,e)=>r.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})).forEach(t=>{e[t]=r[t]}),e})(i)),"separate"===e?[i,p]:i};return a.config=r,a.propNames=Object.keys(r),a.cache=o,a},x=(r,e,t,o,a,s)=>{let i={};return o.slice(0,r.length).forEach((o,p)=>{const n=r[p],l=e(o,t,a,s);Object.assign(i,n?{[n]:Object.assign({},i[n],l)}:l)}),i},S=(r,e,t,o,a,s)=>{let i={};for(let p in o){const n=r[p],l=e(o[p],t,a,s);if(n){const r=g(n);Object.assign(i,{[r]:Object.assign({},i[r],l)})}else Object.assign(i,l)}return i},j=({properties:r,property:e,scale:t,transform:o=y,fallbackScale:a,allowComplex:s=!1})=>{r=r||[e];const i=(e,t,a,i)=>{const p={};let n=o(e,t,a,i);if(null!==n)return s||"object"!=typeof n||(n=e),r.forEach(r=>{p[r]=n}),p};return i.scale=t,i.allowComplex=s,i.defaults=a,i},O=(r={},e="ignore",t=!0)=>{const o={};return Object.keys(r).forEach(e=>{const t=r[e];o[e]=!0!==t?"function"!=typeof t?j(t):t:j({property:e,scale:e})}),h(o,e,t)};function R(r,e){if("number"!=typeof r||r>=0){const t=u(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const t=Math.abs(r),o=u(e,String(t),String(t));return"string"==typeof o?"-"+o:-1*o+"px"}function w(r,e){const t=u(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const k={fontSizes:[12,14,16,20,24,32,48,64,72],space:[0,4,8,16,32,64,128,256,512],sizes:[0,4,8,16,32,64,128,256,512]},T={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths",transform:w},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii",transform:w},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii",transform:w},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii",transform:w},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii",transform:w},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii",transform:w},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths",transform:w},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"},borderBottomWidth:{property:"borderBottomWidth",scale:"borderWidths",transform:w},borderBottomColor:{property:"borderBottomColor",scale:"colors"},borderBottomStyle:{property:"borderBottomStyle",scale:"borderStyles"},borderLeftWidth:{property:"borderLeftWidth",scale:"borderWidths",transform:w},borderLeftColor:{property:"borderLeftColor",scale:"colors"},borderLeftStyle:{property:"borderLeftStyle",scale:"borderStyles"},borderRightWidth:{property:"borderRightWidth",scale:"borderWidths",transform:w},borderRightColor:{property:"borderRightColor",scale:"colors"},borderRightStyle:{property:"borderRightStyle",scale:"borderStyles"},borderTopRadius:{properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:w},borderBottomRadius:{properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:w},borderLeftRadius:{properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:w},borderRightRadius:{properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:w}},C={fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",fallbackScale:k.fontSizes,transform:w},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings",transform:w},textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,textDecoration:{property:"textDecoration"},textDecor:{property:"textDecoration"}},B={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:{property:"flexBasis",scale:"sizes",transform:w},justifySelf:!0,alignSelf:!0,order:!0,flexDir:{property:"flexDirection"}},L={gridGap:{property:"gridGap",scale:"space",fallbackScale:k.space,transform:w},gridColumnGap:{property:"gridColumnGap",scale:"space",fallbackScale:k.space,transform:w},gridRowGap:{property:"gridRowGap",scale:"space",fallbackScale:k.space,transform:w},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0,placeItems:!0};function W(r,e){return u(e,r,"number"!=typeof r||r>1?r:100*r+"%")}const v={width:{property:"width",scale:"sizes",transform:W},w:{property:"width",scale:"sizes",transform:W},height:{property:"height",scale:"sizes",transform:w},h:{property:"height",scale:"sizes",transform:w},minWidth:{property:"minWidth",scale:"sizes",transform:w},minW:{property:"minWidth",scale:"sizes",transform:w},minHeight:{property:"minHeight",scale:"sizes",transform:w},minH:{property:"minHeight",scale:"sizes",transform:w},maxWidth:{property:"maxWidth",scale:"sizes",transform:w},maxW:{property:"maxWidth",scale:"sizes",transform:w},maxHeight:{property:"maxHeight",scale:"sizes",transform:w},maxH:{property:"maxHeight",scale:"sizes",transform:w},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0,boxSizing:!0},z={position:!0,pos:{property:"position"},zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",fallbackScale:k.space,transform:R},right:{property:"right",scale:"space",fallbackScale:k.space,transform:R},bottom:{property:"bottom",scale:"space",fallbackScale:k.space,transform:R},left:{property:"left",scale:"space",fallbackScale:k.space,transform:R}},A={scale:"space",fallbackScale:k.space},H={margin:Object.assign({property:"margin",transform:R},A),m:Object.assign({property:"margin",transform:R},A),marginTop:Object.assign({property:"marginTop",transform:R},A),mt:Object.assign({property:"marginTop",transform:R},A),marginRight:Object.assign({property:"marginRight",transform:R},A),mr:Object.assign({property:"marginRight",transform:R},A),marginBottom:Object.assign({property:"marginBottom",transform:R},A),mb:Object.assign({property:"marginBottom",transform:R},A),marginLeft:Object.assign({property:"marginLeft",transform:R},A),ml:Object.assign({property:"marginLeft",transform:R},A),marginX:Object.assign({properties:["marginLeft","marginRight"],transform:R},A),mx:Object.assign({properties:["marginLeft","marginRight"],transform:R},A),marginY:Object.assign({properties:["marginTop","marginBottom"],transform:R},A),my:Object.assign({properties:["marginTop","marginBottom"],transform:R},A),padding:Object.assign({property:"padding",transform:w},A),p:Object.assign({property:"padding",transform:w},A),paddingTop:Object.assign({property:"paddingTop",transform:w},A),pt:Object.assign({property:"paddingTop",transform:w},A),paddingRight:Object.assign({property:"paddingRight",transform:w},A),pr:Object.assign({property:"paddingRight",transform:w},A),paddingBottom:Object.assign({property:"paddingBottom",transform:w},A),pb:Object.assign({property:"paddingBottom",transform:w},A),paddingLeft:Object.assign({property:"paddingLeft",transform:w},A),pl:Object.assign({property:"paddingLeft",transform:w},A),paddingX:Object.assign({properties:["paddingLeft","paddingRight"],transform:w},A),px:Object.assign({properties:["paddingLeft","paddingRight"],transform:w},A),paddingY:Object.assign({properties:["paddingTop","paddingBottom"],transform:w},A),py:Object.assign({properties:["paddingTop","paddingBottom"],transform:w},A)},I=Object.assign({},{bg:{property:"background",scale:"colors"},bgColor:{property:"backgroundColor",scale:"colors"},background:{property:"background",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,bgImage:{property:"backgroundImage"},bgSize:{property:"backgroundSize"},bgPosition:{property:"backgroundPosition"},bgRepeat:{property:"backgroundRepeat"},bgAttachment:{property:"backgroundAttachment"}},{},T,{},{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},opacity:!0,fill:{property:"fill",scale:"colors"},stroke:{property:"stroke",scale:"colors"},outline:!0,outlineOffset:!0,outlineColor:{property:"outlineColor",scale:"colors"}},{},C,{},B,{},L,{},v,{},{animation:!0,appearance:!0,transform:!0,transformOrigin:!0,visibility:!0,userSelect:!0,pointerEvents:!0,cursor:!0,resize:!0,transition:!0,objectFit:!0,objectPosition:!0,float:!0,willChange:!0,listStyleType:!0,listStylePosition:!0,listStyleImage:!0},{},z,{},{boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}},{},H);function P(r){return r.map(r=>r.includes(" ")?'"'+r+'"':r).join(", ")}const D=[0,4,8,12,16,24,32,40,48,64,80,96,112,128],G=Object.assign({breakpoints:["544px","768px","1012px","1280px"],colors:o.colors,fontSizes:[11,12,14,16,20,24,28,32,40,48],lineHeights:{condensedUltra:1,condensed:1.25,default:1.5,oneLine:"32px"},maxWidths:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},fonts:{normal:P(["Barlow","-apple-system","BlinkMacSystemFont","Segoe UI","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),mono:P(["SF Mono","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontWeights:{lighter:300,normal:400,bold:500,bolder:600},borders:[0,"1px solid"],radii:[0,3,6,12,150],space:D,sizes:D},{shadows:{none:"rgba(0,0,0,0) 0 0px 0px 0",small:"rgba(0,0,0,0.15) 0 3px 6px 0",large:"rgba(0,0,0,0.30) 0 4px 10px 0"},ruleHeight:32}),M=O(I,"separate"),E=O(Object.assign({},I,{x:{property:"x",scale:"space"},y:{property:"y",scale:"space"}}),"merge",!1),F=(r,e,t,o)=>"object"!=typeof r||Array.isArray(F)?r:(console.log(E(r,o)),E(r,o)),q=O({animate:{property:"animate",transform:F,allowComplex:!0},variants:{property:"variants",transform:(r,e,t,o)=>{const a={};for(var s in r)"function"==typeof r[s]?(a[s]=r[s],console.log("here")):a[s]=E(r[s],o);return a},allowComplex:!0},transition:!0,initial:{property:"initial",transform:F,allowComplex:!0},exit:{property:"exit",transform:F,allowComplex:!0},style:!0,transformTemplate:!0,transformValues:!0,onUpdate:!0,onAnimationStart:!0,onAnimationComplete:!0,onPan:!0,onPanStart:!0,onPanSessionStart:!0,onPanEnd:!0,onTap:!0,onTapStart:!0,onTapCancel:!0,whileTap:{property:"whileTap",transform:F,allowComplex:!0},whileHover:{property:"whileHover",transform:F,allowComplex:!0},onHoverStart:!0,onHoverEnd:!0,layoutId:!0,onMagicComplete:!0,magicDependency:!0,allowTransformNone:!0,drag:!0,dragDirectionLock:!0,dragPropagation:!0,dragConstraints:!0,dragElastic:!0,dragMomentum:!0,dragTransition:!0,dragOriginX:!0,dragOriginY:!0,dragControls:!0,dragListener:!0,custom:!0,static:!0,inherit:!0},"separate");let N;N="undefined"!=typeof window?l(document&&document.head):l();const U=r=>e.forwardRef((o,a)=>{let{children:i,className:n,as:l}=o,c=function(r,e){if(null==r)return{};var t,o,a={},s=Object.keys(r);for(o=0;o<s.length;o++)e.indexOf(t=s[o])>=0||(a[t]=r[t]);return a}(o,["children","className","as"]),d=p.test(c.className);const b=s(),[f,g]=q(c,b);let y={},u=void 0;if(0===Object.keys(g).length)u=n;else{const[r,e]=M(g,b);y=e,u=Object.keys(r).length>0?m(r,N,!1,d)+(n?" "+n:""):n}return e.createElement(l||Object.keys(f).length>0?"string"==typeof r?t.motion[r]:t.motion.custom(r):r,Object.assign({},f,y,{ref:a,children:i,className:u}))}),X=U;["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","svg","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].forEach(r=>{X[r]=U(r)}),Object.keys(t).forEach((function(r){"default"!==r&&Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}})})),exports.GOOBER_ID="✨📃",exports.GOOBER_PREFIX=".✨",exports.GOOBER_REGEX=p,exports.Global=({style:r})=>{const t=s();e.useEffect(()=>{m(M(r,t),N,!0,!1)},[])},exports.ThemeContext=a,exports.ThemeProvider=({theme:r={},children:t})=>e.createElement(a.Provider,{value:r},t),exports.baseTheme=G,exports.compose=(...r)=>{let e={};return r.forEach(r=>{r&&r.config&&Object.assign(e,r.config)}),h(e)},exports.createMagic=U,exports.createParser=h,exports.createStyleFunction=j,exports.cssParser=M,exports.deepParser=E,exports.extractCss=r=>{const e=l(r),t=e.data;return e.data="",t},exports.get=u,exports.getSheet=l,exports.hash=m,exports.magic=X,exports.merge=b,exports.motionParser=q,exports.parse=i,exports.ssr=n,exports.system=O,exports.update=c,exports.useTheme=s; | ||
var r,e=(r=require("react"))&&"object"==typeof r&&"default"in r?r.default:r,t=require("framer-motion"),o=require("@nksaraf/colors");function a(r){return r.map(r=>r.includes(" ")?'"'+r+'"':r).join(", ")}const s=[0,4,8,12,16,24,32,40,48,64,80,96,112,128],i=Object.assign({breakpoints:["544px","768px","1012px","1280px"],colors:o.colors,fontSizes:[11,12,14,16,20,24,28,32,40,48],lineHeights:{condensedUltra:1,condensed:1.25,default:1.5,oneLine:"32px"},maxWidths:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},fonts:{normal:a(["Barlow","-apple-system","BlinkMacSystemFont","Segoe UI","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),mono:a(["SF Mono","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontWeights:{lighter:300,normal:400,bold:500,bolder:600},borders:[0,"1px solid"],radii:[0,3,6,12,150],space:s,sizes:s},{shadows:{none:"rgba(0,0,0,0) 0 0px 0px 0",small:"rgba(0,0,0,0.15) 0 3px 6px 0",large:"rgba(0,0,0,0.30) 0 4px 10px 0"},ruleHeight:32}),p=e.createContext(i),n=()=>e.useContext(p)||{},l=(r,e,t)=>{let o="",a="",s="";for(let i in r){const p=r[i];if("object"==typeof p){let r=e+" "+i;/&/g.test(i)&&(r=i.replace(/&/g,e)),"@"==i[0]&&(r=e,"f"==i[1]&&(r=i)),/@k/.test(i)?a+=i+"{"+l(p,"","")+"}":a+=l(p,r,r==e?i:t||"")}else/^@i/.test(i)?o=i+" "+p+";":s+=l.p?l.p(i.replace(/[A-Z]/g,"-$&").toLowerCase(),p):i.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+p+";"}if(s[0]){const r=e+"{"+s+"}";return t?a+t+"{"+r+"}":o+r+a}return o+a},c=/\s*✨[0-9]+/g,d={data:""},m=r=>{try{let e=r?r.querySelector("#✨📃"):null;return e||(e=(r||document.head).appendChild(document.createElement("style")),e.innerHTML=" ",e.id="✨📃"),e.firstChild}catch(r){}return d},b=(r,e,t)=>{e.data.indexOf(r)<0&&(e.data=t?r+e.data:e.data+r)};let f={};const g=(r,e,t,o)=>{const a=JSON.stringify(r),s=f[a]||(f[a]=".✨"+a.split("").reduce((r,e)=>101*r+e.charCodeAt(0)>>>0,11)),i=f[s]||(f[s]=l(r,t?"":s));return b(i,e,o),s.slice(1)},y=(r,e)=>{let t=Object.assign({},r,e);for(const o in r)r[o]&&"object"==typeof e[o]&&Object.assign(t,{[o]:Object.assign(r[o],e[o])});return t},u={breakpoints:[40,52,64].map(r=>r+"em")},h=r=>"@media screen and (min-width: "+r+")",x=(r,e)=>S(e,r,r),S=(r,e,t,o,a)=>{let s=e&&e.split?e.split("."):[e];for(o=0;o<s.length;o++)r=r?r[s[o]]:a;return r===a?t:r},j=(r,e="ignore",t=!0)=>{const o={},a=(a,s)=>{let i={},p={},n=!1;const l=s&&s.disableStyledSystemCache;for(const c in a){if(!r[c]){"separate"===e?p[c]=a[c]:"merge"===e&&(i[c]=a[c]);continue}const d=r[c],m=a[c],b=S(s,d.scale,d.defaults);if("object"!=typeof m)Object.assign(i,d(m,b,a,s));else{if(!t&&Array.isArray(m)){i[c]=m.map(r=>d(r,b,a,s)[c]);continue}if(d.allowComplex||!t){Object.assign(i,d(m,b,a,s));continue}if(o.breakpoints=!l&&o.breakpoints||S(s,"breakpoints",u.breakpoints),Array.isArray(m)){o.media=!l&&o.media||[null,...o.breakpoints.map(h)],i=y(i,O(o.media,d,b,m,a,s));continue}null!==m&&(i=y(i,R(o.breakpoints,d,b,m,a,s)),n=!0)}}return n&&(i=(r=>{const e={};return Object.keys(r).sort((r,e)=>r.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})).forEach(t=>{e[t]=r[t]}),e})(i)),"separate"===e?[i,p]:i};return a.config=r,a.propNames=Object.keys(r),a.cache=o,a},O=(r,e,t,o,a,s)=>{let i={};return o.slice(0,r.length).forEach((o,p)=>{const n=r[p],l=e(o,t,a,s);Object.assign(i,n?{[n]:Object.assign({},i[n],l)}:l)}),i},R=(r,e,t,o,a,s)=>{let i={};for(let p in o){const n=r[p],l=e(o[p],t,a,s);if(n){const r=h(n);Object.assign(i,{[r]:Object.assign({},i[r],l)})}else Object.assign(i,l)}return i},w=({properties:r,property:e,scale:t,transform:o=x,fallbackScale:a,allowComplex:s=!1})=>{r=r||[e];const i=(e,t,a,i)=>{const p={};let n=o(e,t,a,i);if(null!==n)return s||"object"!=typeof n||(n=e),r.forEach(r=>{p[r]=n}),p};return i.scale=t,i.allowComplex=s,i.defaults=a,i},k=(r={},e="ignore",t=!0)=>{const o={};return Object.keys(r).forEach(e=>{const t=r[e];o[e]=!0!==t?"function"!=typeof t?w(t):t:w({property:e,scale:e})}),j(o,e,t)};function T(r,e){if("number"!=typeof r||r>=0){const t=S(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const t=Math.abs(r),o=S(e,String(t),String(t));return"string"==typeof o?"-"+o:-1*o+"px"}function C(r,e){const t=S(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const B={fontSizes:[12,14,16,20,24,32,48,64,72],space:[0,4,8,16,32,64,128,256,512],sizes:[0,4,8,16,32,64,128,256,512]},L={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths",transform:C},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii",transform:C},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii",transform:C},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii",transform:C},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii",transform:C},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii",transform:C},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths",transform:C},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"},borderBottomWidth:{property:"borderBottomWidth",scale:"borderWidths",transform:C},borderBottomColor:{property:"borderBottomColor",scale:"colors"},borderBottomStyle:{property:"borderBottomStyle",scale:"borderStyles"},borderLeftWidth:{property:"borderLeftWidth",scale:"borderWidths",transform:C},borderLeftColor:{property:"borderLeftColor",scale:"colors"},borderLeftStyle:{property:"borderLeftStyle",scale:"borderStyles"},borderRightWidth:{property:"borderRightWidth",scale:"borderWidths",transform:C},borderRightColor:{property:"borderRightColor",scale:"colors"},borderRightStyle:{property:"borderRightStyle",scale:"borderStyles"},borderTopRadius:{properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:C},borderBottomRadius:{properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:C},borderLeftRadius:{properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:C},borderRightRadius:{properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:C}},W={fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",fallbackScale:B.fontSizes,transform:C},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings",transform:C},textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,textDecoration:{property:"textDecoration"},textDecor:{property:"textDecoration"}},v={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:{property:"flexBasis",scale:"sizes",transform:C},justifySelf:!0,alignSelf:!0,order:!0,flexDir:{property:"flexDirection"}},z={gridGap:{property:"gridGap",scale:"space",fallbackScale:B.space,transform:C},gridColumnGap:{property:"gridColumnGap",scale:"space",fallbackScale:B.space,transform:C},gridRowGap:{property:"gridRowGap",scale:"space",fallbackScale:B.space,transform:C},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0,placeItems:!0};function A(r,e){return S(e,r,"number"!=typeof r||r>1?r:100*r+"%")}const H={width:{property:"width",scale:"sizes",transform:A},w:{property:"width",scale:"sizes",transform:A},height:{property:"height",scale:"sizes",transform:C},h:{property:"height",scale:"sizes",transform:C},minWidth:{property:"minWidth",scale:"sizes",transform:C},minW:{property:"minWidth",scale:"sizes",transform:C},minHeight:{property:"minHeight",scale:"sizes",transform:C},minH:{property:"minHeight",scale:"sizes",transform:C},maxWidth:{property:"maxWidth",scale:"sizes",transform:C},maxW:{property:"maxWidth",scale:"sizes",transform:C},maxHeight:{property:"maxHeight",scale:"sizes",transform:C},maxH:{property:"maxHeight",scale:"sizes",transform:C},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0,boxSizing:!0},I={position:!0,pos:{property:"position"},zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",fallbackScale:B.space,transform:T},right:{property:"right",scale:"space",fallbackScale:B.space,transform:T},bottom:{property:"bottom",scale:"space",fallbackScale:B.space,transform:T},left:{property:"left",scale:"space",fallbackScale:B.space,transform:T}},P={scale:"space",fallbackScale:B.space},D={margin:Object.assign({property:"margin",transform:T},P),m:Object.assign({property:"margin",transform:T},P),marginTop:Object.assign({property:"marginTop",transform:T},P),mt:Object.assign({property:"marginTop",transform:T},P),marginRight:Object.assign({property:"marginRight",transform:T},P),mr:Object.assign({property:"marginRight",transform:T},P),marginBottom:Object.assign({property:"marginBottom",transform:T},P),mb:Object.assign({property:"marginBottom",transform:T},P),marginLeft:Object.assign({property:"marginLeft",transform:T},P),ml:Object.assign({property:"marginLeft",transform:T},P),marginX:Object.assign({properties:["marginLeft","marginRight"],transform:T},P),mx:Object.assign({properties:["marginLeft","marginRight"],transform:T},P),marginY:Object.assign({properties:["marginTop","marginBottom"],transform:T},P),my:Object.assign({properties:["marginTop","marginBottom"],transform:T},P),padding:Object.assign({property:"padding",transform:C},P),p:Object.assign({property:"padding",transform:C},P),paddingTop:Object.assign({property:"paddingTop",transform:C},P),pt:Object.assign({property:"paddingTop",transform:C},P),paddingRight:Object.assign({property:"paddingRight",transform:C},P),pr:Object.assign({property:"paddingRight",transform:C},P),paddingBottom:Object.assign({property:"paddingBottom",transform:C},P),pb:Object.assign({property:"paddingBottom",transform:C},P),paddingLeft:Object.assign({property:"paddingLeft",transform:C},P),pl:Object.assign({property:"paddingLeft",transform:C},P),paddingX:Object.assign({properties:["paddingLeft","paddingRight"],transform:C},P),px:Object.assign({properties:["paddingLeft","paddingRight"],transform:C},P),paddingY:Object.assign({properties:["paddingTop","paddingBottom"],transform:C},P),py:Object.assign({properties:["paddingTop","paddingBottom"],transform:C},P)},G=Object.assign({},{bg:{property:"background",scale:"colors"},bgColor:{property:"backgroundColor",scale:"colors"},background:{property:"background",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,bgImage:{property:"backgroundImage"},bgSize:{property:"backgroundSize"},bgPosition:{property:"backgroundPosition"},bgRepeat:{property:"backgroundRepeat"},bgAttachment:{property:"backgroundAttachment"}},{},L,{},{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},opacity:!0,fill:{property:"fill",scale:"colors"},stroke:{property:"stroke",scale:"colors"},outline:!0,outlineOffset:!0,outlineColor:{property:"outlineColor",scale:"colors"}},{},W,{},v,{},z,{},H,{},{animation:!0,appearance:!0,transform:!0,transformOrigin:!0,visibility:!0,userSelect:!0,pointerEvents:!0,cursor:!0,resize:!0,transition:!0,objectFit:!0,objectPosition:!0,float:!0,willChange:!0,listStyleType:!0,listStylePosition:!0,listStyleImage:!0},{},I,{},{boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}},{},D),M=k(G,"separate"),E=k(Object.assign({},G,{x:{property:"x",scale:"space"},y:{property:"y",scale:"space"}}),"merge",!1),F=(r,e,t,o)=>"object"!=typeof r||Array.isArray(F)?r:(console.log(E(r,o)),E(r,o)),q=k({animate:{property:"animate",transform:F,allowComplex:!0},variants:{property:"variants",transform:(r,e,t,o)=>{const a={};for(var s in r)"function"==typeof r[s]?(a[s]=r[s],console.log("here")):a[s]=E(r[s],o);return a},allowComplex:!0},transition:!0,initial:{property:"initial",transform:F,allowComplex:!0},exit:{property:"exit",transform:F,allowComplex:!0},style:!0,transformTemplate:!0,transformValues:!0,onUpdate:!0,onAnimationStart:!0,onAnimationComplete:!0,onPan:!0,onPanStart:!0,onPanSessionStart:!0,onPanEnd:!0,onTap:!0,onTapStart:!0,onTapCancel:!0,whileTap:{property:"whileTap",transform:F,allowComplex:!0},whileHover:{property:"whileHover",transform:F,allowComplex:!0},onHoverStart:!0,onHoverEnd:!0,layoutId:!0,onMagicComplete:!0,magicDependency:!0,allowTransformNone:!0,drag:!0,dragDirectionLock:!0,dragPropagation:!0,dragConstraints:!0,dragElastic:!0,dragMomentum:!0,dragTransition:!0,dragOriginX:!0,dragOriginY:!0,dragControls:!0,dragListener:!0,custom:!0,static:!0,inherit:!0},"separate");let N;N="undefined"!=typeof window?m(document&&document.head):m();const U=r=>e.forwardRef((o,a)=>{let{children:s,className:i,as:p}=o,l=function(r,e){if(null==r)return{};var t,o,a={},s=Object.keys(r);for(o=0;o<s.length;o++)e.indexOf(t=s[o])>=0||(a[t]=r[t]);return a}(o,["children","className","as"]),d=c.test(l.className);const m=n(),[b,f]=q(l,m);let y={},u=void 0;if(0===Object.keys(f).length)u=i;else{const[r,e]=M(f,m);y=e,u=Object.keys(r).length>0?g(r,N,!1,d)+(i?" "+i:""):i}return e.createElement(p||Object.keys(b).length>0?"string"==typeof r?t.motion[r]:t.motion.custom(r):r,Object.assign({},b,y,{ref:a,children:s,className:u}))}),X=U;["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","svg","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].forEach(r=>{X[r]=U(r)}),Object.keys(t).forEach((function(r){"default"!==r&&Object.defineProperty(exports,r,{enumerable:!0,get:function(){return t[r]}})})),exports.GOOBER_ID="✨📃",exports.GOOBER_PREFIX=".✨",exports.GOOBER_REGEX=c,exports.Global=({style:r})=>{const t=n();e.useEffect(()=>{g(M(r,t),N,!0,!1)},[])},exports.ThemeContext=p,exports.ThemeProvider=({theme:r={},children:t})=>e.createElement(p.Provider,{value:r||i},t),exports.baseTheme=i,exports.compose=(...r)=>{let e={};return r.forEach(r=>{r&&r.config&&Object.assign(e,r.config)}),j(e)},exports.createMagic=U,exports.createParser=j,exports.createStyleFunction=w,exports.cssParser=M,exports.deepParser=E,exports.extractCss=r=>{const e=m(r),t=e.data;return e.data="",t},exports.get=S,exports.getSheet=m,exports.hash=g,exports.magic=X,exports.merge=y,exports.motionParser=q,exports.parse=l,exports.ssr=d,exports.system=k,exports.update=b,exports.useTheme=n; | ||
//# sourceMappingURL=magic-components.cjs.js.map |
@@ -1,2 +0,2 @@ | ||
import r from"react";import{motion as e}from"framer-motion";export*from"framer-motion";import{colors as t}from"@nksaraf/colors";const o=r.createContext({}),a=({theme:e={},children:t})=>r.createElement(o.Provider,{value:e},t),i=()=>r.useContext(o)||{},s=(r,e,t)=>{let o="",a="",i="";for(let n in r){const p=r[n];if("object"==typeof p){let r=e+" "+n;/&/g.test(n)&&(r=n.replace(/&/g,e)),"@"==n[0]&&(r=e,"f"==n[1]&&(r=n)),/@k/.test(n)?a+=n+"{"+s(p,"","")+"}":a+=s(p,r,r==e?n:t||"")}else/^@i/.test(n)?o=n+" "+p+";":i+=s.p?s.p(n.replace(/[A-Z]/g,"-$&").toLowerCase(),p):n.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+p+";"}if(i[0]){const r=e+"{"+i+"}";return t?a+t+"{"+r+"}":o+r+a}return o+a},n="✨📃",p=".✨",l=/\s*✨[0-9]+/g,d={data:""},c=r=>{try{let e=r?r.querySelector("#✨📃"):null;return e||(e=(r||document.head).appendChild(document.createElement("style")),e.innerHTML=" ",e.id="✨📃"),e.firstChild}catch(r){}return d},m=r=>{const e=c(r),t=e.data;return e.data="",t},b=(r,e,t)=>{e.data.indexOf(r)<0&&(e.data=t?r+e.data:e.data+r)};let f={};const g=(r,e,t,o)=>{const a=JSON.stringify(r),i=f[a]||(f[a]=".✨"+a.split("").reduce((r,e)=>101*r+e.charCodeAt(0)>>>0,11)),n=f[i]||(f[i]=s(r,t?"":i));return b(n,e,o),i.slice(1)},y=(r,e)=>{let t=Object.assign({},r,e);for(const o in r)r[o]&&"object"==typeof e[o]&&Object.assign(t,{[o]:Object.assign(r[o],e[o])});return t},u={breakpoints:[40,52,64].map(r=>r+"em")},h=r=>"@media screen and (min-width: "+r+")",x=(r,e)=>S(e,r,r),S=(r,e,t,o,a)=>{let i=e&&e.split?e.split("."):[e];for(o=0;o<i.length;o++)r=r?r[i[o]]:a;return r===a?t:r},j=(r,e="ignore",t=!0)=>{const o={},a=(a,i)=>{let s={},n={},p=!1;const l=i&&i.disableStyledSystemCache;for(const d in a){if(!r[d]){"separate"===e?n[d]=a[d]:"merge"===e&&(s[d]=a[d]);continue}const c=r[d],m=a[d],b=S(i,c.scale,c.defaults);if("object"!=typeof m)Object.assign(s,c(m,b,a,i));else{if(!t&&Array.isArray(m)){s[d]=m.map(r=>c(r,b,a,i)[d]);continue}if(c.allowComplex||!t){Object.assign(s,c(m,b,a,i));continue}if(o.breakpoints=!l&&o.breakpoints||S(i,"breakpoints",u.breakpoints),Array.isArray(m)){o.media=!l&&o.media||[null,...o.breakpoints.map(h)],s=y(s,R(o.media,c,b,m,a,i));continue}null!==m&&(s=y(s,O(o.breakpoints,c,b,m,a,i)),p=!0)}}return p&&(s=(r=>{const e={};return Object.keys(r).sort((r,e)=>r.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})).forEach(t=>{e[t]=r[t]}),e})(s)),"separate"===e?[s,n]:s};return a.config=r,a.propNames=Object.keys(r),a.cache=o,a},R=(r,e,t,o,a,i)=>{let s={};return o.slice(0,r.length).forEach((o,n)=>{const p=r[n],l=e(o,t,a,i);Object.assign(s,p?{[p]:Object.assign({},s[p],l)}:l)}),s},O=(r,e,t,o,a,i)=>{let s={};for(let n in o){const p=r[n],l=e(o[n],t,a,i);if(p){const r=h(p);Object.assign(s,{[r]:Object.assign({},s[r],l)})}else Object.assign(s,l)}return s},w=({properties:r,property:e,scale:t,transform:o=x,fallbackScale:a,allowComplex:i=!1})=>{r=r||[e];const s=(e,t,a,s)=>{const n={};let p=o(e,t,a,s);if(null!==p)return i||"object"!=typeof p||(p=e),r.forEach(r=>{n[r]=p}),n};return s.scale=t,s.allowComplex=i,s.defaults=a,s},k=(r={},e="ignore",t=!0)=>{const o={};return Object.keys(r).forEach(e=>{const t=r[e];o[e]=!0!==t?"function"!=typeof t?w(t):t:w({property:e,scale:e})}),j(o,e,t)},T=(...r)=>{let e={};return r.forEach(r=>{r&&r.config&&Object.assign(e,r.config)}),j(e)};function C(r,e){if("number"!=typeof r||r>=0){const t=S(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const t=Math.abs(r),o=S(e,String(t),String(t));return"string"==typeof o?"-"+o:-1*o+"px"}function B(r,e){const t=S(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const L={fontSizes:[12,14,16,20,24,32,48,64,72],space:[0,4,8,16,32,64,128,256,512],sizes:[0,4,8,16,32,64,128,256,512]},W={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths",transform:B},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii",transform:B},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii",transform:B},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii",transform:B},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii",transform:B},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii",transform:B},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths",transform:B},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"},borderBottomWidth:{property:"borderBottomWidth",scale:"borderWidths",transform:B},borderBottomColor:{property:"borderBottomColor",scale:"colors"},borderBottomStyle:{property:"borderBottomStyle",scale:"borderStyles"},borderLeftWidth:{property:"borderLeftWidth",scale:"borderWidths",transform:B},borderLeftColor:{property:"borderLeftColor",scale:"colors"},borderLeftStyle:{property:"borderLeftStyle",scale:"borderStyles"},borderRightWidth:{property:"borderRightWidth",scale:"borderWidths",transform:B},borderRightColor:{property:"borderRightColor",scale:"colors"},borderRightStyle:{property:"borderRightStyle",scale:"borderStyles"},borderTopRadius:{properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:B},borderBottomRadius:{properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:B},borderLeftRadius:{properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:B},borderRightRadius:{properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:B}},v={fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",fallbackScale:L.fontSizes,transform:B},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings",transform:B},textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,textDecoration:{property:"textDecoration"},textDecor:{property:"textDecoration"}},z={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:{property:"flexBasis",scale:"sizes",transform:B},justifySelf:!0,alignSelf:!0,order:!0,flexDir:{property:"flexDirection"}},A={gridGap:{property:"gridGap",scale:"space",fallbackScale:L.space,transform:B},gridColumnGap:{property:"gridColumnGap",scale:"space",fallbackScale:L.space,transform:B},gridRowGap:{property:"gridRowGap",scale:"space",fallbackScale:L.space,transform:B},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0,placeItems:!0};function H(r,e){return S(e,r,"number"!=typeof r||r>1?r:100*r+"%")}const I={width:{property:"width",scale:"sizes",transform:H},w:{property:"width",scale:"sizes",transform:H},height:{property:"height",scale:"sizes",transform:B},h:{property:"height",scale:"sizes",transform:B},minWidth:{property:"minWidth",scale:"sizes",transform:B},minW:{property:"minWidth",scale:"sizes",transform:B},minHeight:{property:"minHeight",scale:"sizes",transform:B},minH:{property:"minHeight",scale:"sizes",transform:B},maxWidth:{property:"maxWidth",scale:"sizes",transform:B},maxW:{property:"maxWidth",scale:"sizes",transform:B},maxHeight:{property:"maxHeight",scale:"sizes",transform:B},maxH:{property:"maxHeight",scale:"sizes",transform:B},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0,boxSizing:!0},P={position:!0,pos:{property:"position"},zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",fallbackScale:L.space,transform:C},right:{property:"right",scale:"space",fallbackScale:L.space,transform:C},bottom:{property:"bottom",scale:"space",fallbackScale:L.space,transform:C},left:{property:"left",scale:"space",fallbackScale:L.space,transform:C}},D={scale:"space",fallbackScale:L.space},G={margin:Object.assign({property:"margin",transform:C},D),m:Object.assign({property:"margin",transform:C},D),marginTop:Object.assign({property:"marginTop",transform:C},D),mt:Object.assign({property:"marginTop",transform:C},D),marginRight:Object.assign({property:"marginRight",transform:C},D),mr:Object.assign({property:"marginRight",transform:C},D),marginBottom:Object.assign({property:"marginBottom",transform:C},D),mb:Object.assign({property:"marginBottom",transform:C},D),marginLeft:Object.assign({property:"marginLeft",transform:C},D),ml:Object.assign({property:"marginLeft",transform:C},D),marginX:Object.assign({properties:["marginLeft","marginRight"],transform:C},D),mx:Object.assign({properties:["marginLeft","marginRight"],transform:C},D),marginY:Object.assign({properties:["marginTop","marginBottom"],transform:C},D),my:Object.assign({properties:["marginTop","marginBottom"],transform:C},D),padding:Object.assign({property:"padding",transform:B},D),p:Object.assign({property:"padding",transform:B},D),paddingTop:Object.assign({property:"paddingTop",transform:B},D),pt:Object.assign({property:"paddingTop",transform:B},D),paddingRight:Object.assign({property:"paddingRight",transform:B},D),pr:Object.assign({property:"paddingRight",transform:B},D),paddingBottom:Object.assign({property:"paddingBottom",transform:B},D),pb:Object.assign({property:"paddingBottom",transform:B},D),paddingLeft:Object.assign({property:"paddingLeft",transform:B},D),pl:Object.assign({property:"paddingLeft",transform:B},D),paddingX:Object.assign({properties:["paddingLeft","paddingRight"],transform:B},D),px:Object.assign({properties:["paddingLeft","paddingRight"],transform:B},D),paddingY:Object.assign({properties:["paddingTop","paddingBottom"],transform:B},D),py:Object.assign({properties:["paddingTop","paddingBottom"],transform:B},D)},M=Object.assign({},{bg:{property:"background",scale:"colors"},bgColor:{property:"backgroundColor",scale:"colors"},background:{property:"background",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,bgImage:{property:"backgroundImage"},bgSize:{property:"backgroundSize"},bgPosition:{property:"backgroundPosition"},bgRepeat:{property:"backgroundRepeat"},bgAttachment:{property:"backgroundAttachment"}},{},W,{},{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},opacity:!0,fill:{property:"fill",scale:"colors"},stroke:{property:"stroke",scale:"colors"},outline:!0,outlineOffset:!0,outlineColor:{property:"outlineColor",scale:"colors"}},{},v,{},z,{},A,{},I,{},{animation:!0,appearance:!0,transform:!0,transformOrigin:!0,visibility:!0,userSelect:!0,pointerEvents:!0,cursor:!0,resize:!0,transition:!0,objectFit:!0,objectPosition:!0,float:!0,willChange:!0,listStyleType:!0,listStylePosition:!0,listStyleImage:!0},{},P,{},{boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}},{},G);function E(r){return r.map(r=>r.includes(" ")?'"'+r+'"':r).join(", ")}const F=[0,4,8,12,16,24,32,40,48,64,80,96,112,128],N=Object.assign({breakpoints:["544px","768px","1012px","1280px"],colors:t,fontSizes:[11,12,14,16,20,24,28,32,40,48],lineHeights:{condensedUltra:1,condensed:1.25,default:1.5,oneLine:"32px"},maxWidths:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},fonts:{normal:E(["Barlow","-apple-system","BlinkMacSystemFont","Segoe UI","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),mono:E(["SF Mono","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontWeights:{lighter:300,normal:400,bold:500,bolder:600},borders:[0,"1px solid"],radii:[0,3,6,12,150],space:F,sizes:F},{shadows:{none:"rgba(0,0,0,0) 0 0px 0px 0",small:"rgba(0,0,0,0.15) 0 3px 6px 0",large:"rgba(0,0,0,0.30) 0 4px 10px 0"},ruleHeight:32}),U=k(M,"separate"),X=k(Object.assign({},M,{x:{property:"x",scale:"space"},y:{property:"y",scale:"space"}}),"merge",!1),Y=(r,e,t,o)=>"object"!=typeof r||Array.isArray(Y)?r:(console.log(X(r,o)),X(r,o)),q=k({animate:{property:"animate",transform:Y,allowComplex:!0},variants:{property:"variants",transform:(r,e,t,o)=>{const a={};for(var i in r)"function"==typeof r[i]?(a[i]=r[i],console.log("here")):a[i]=X(r[i],o);return a},allowComplex:!0},transition:!0,initial:{property:"initial",transform:Y,allowComplex:!0},exit:{property:"exit",transform:Y,allowComplex:!0},style:!0,transformTemplate:!0,transformValues:!0,onUpdate:!0,onAnimationStart:!0,onAnimationComplete:!0,onPan:!0,onPanStart:!0,onPanSessionStart:!0,onPanEnd:!0,onTap:!0,onTapStart:!0,onTapCancel:!0,whileTap:{property:"whileTap",transform:Y,allowComplex:!0},whileHover:{property:"whileHover",transform:Y,allowComplex:!0},onHoverStart:!0,onHoverEnd:!0,layoutId:!0,onMagicComplete:!0,magicDependency:!0,allowTransformNone:!0,drag:!0,dragDirectionLock:!0,dragPropagation:!0,dragConstraints:!0,dragElastic:!0,dragMomentum:!0,dragTransition:!0,dragOriginX:!0,dragOriginY:!0,dragControls:!0,dragListener:!0,custom:!0,static:!0,inherit:!0},"separate");let Z;Z="undefined"!=typeof window?c(document&&document.head):c();const $=({style:e})=>{const t=i();r.useEffect(()=>{g(U(e,t),Z,!0,!1)},[])},J=t=>r.forwardRef((o,a)=>{let{children:s,className:n,as:p}=o,d=function(r,e){if(null==r)return{};var t,o,a={},i=Object.keys(r);for(o=0;o<i.length;o++)e.indexOf(t=i[o])>=0||(a[t]=r[t]);return a}(o,["children","className","as"]),c=l.test(d.className);const m=i(),[b,f]=q(d,m);let y={},u=void 0;if(0===Object.keys(f).length)u=n;else{const[r,e]=U(f,m);y=e,u=Object.keys(r).length>0?g(r,Z,!1,c)+(n?" "+n:""):n}return r.createElement(p||Object.keys(b).length>0?"string"==typeof t?e[t]:e.custom(t):t,Object.assign({},b,y,{ref:a,children:s,className:u}))}),V=J;["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","svg","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].forEach(r=>{V[r]=J(r)});export{n as GOOBER_ID,p as GOOBER_PREFIX,l as GOOBER_REGEX,$ as Global,o as ThemeContext,a as ThemeProvider,N as baseTheme,T as compose,J as createMagic,j as createParser,w as createStyleFunction,U as cssParser,X as deepParser,m as extractCss,S as get,c as getSheet,g as hash,V as magic,y as merge,q as motionParser,s as parse,d as ssr,k as system,b as update,i as useTheme}; | ||
import r from"react";import{motion as e}from"framer-motion";export*from"framer-motion";import{colors as t}from"@nksaraf/colors";function o(r){return r.map(r=>r.includes(" ")?'"'+r+'"':r).join(", ")}const a=[0,4,8,12,16,24,32,40,48,64,80,96,112,128],i=Object.assign({breakpoints:["544px","768px","1012px","1280px"],colors:t,fontSizes:[11,12,14,16,20,24,28,32,40,48],lineHeights:{condensedUltra:1,condensed:1.25,default:1.5,oneLine:"32px"},maxWidths:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},fonts:{normal:o(["Barlow","-apple-system","BlinkMacSystemFont","Segoe UI","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),mono:o(["SF Mono","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontWeights:{lighter:300,normal:400,bold:500,bolder:600},borders:[0,"1px solid"],radii:[0,3,6,12,150],space:a,sizes:a},{shadows:{none:"rgba(0,0,0,0) 0 0px 0px 0",small:"rgba(0,0,0,0.15) 0 3px 6px 0",large:"rgba(0,0,0,0.30) 0 4px 10px 0"},ruleHeight:32}),s=r.createContext(i),n=({theme:e={},children:t})=>r.createElement(s.Provider,{value:e||i},t),p=()=>r.useContext(s)||{},l=(r,e,t)=>{let o="",a="",i="";for(let s in r){const n=r[s];if("object"==typeof n){let r=e+" "+s;/&/g.test(s)&&(r=s.replace(/&/g,e)),"@"==s[0]&&(r=e,"f"==s[1]&&(r=s)),/@k/.test(s)?a+=s+"{"+l(n,"","")+"}":a+=l(n,r,r==e?s:t||"")}else/^@i/.test(s)?o=s+" "+n+";":i+=l.p?l.p(s.replace(/[A-Z]/g,"-$&").toLowerCase(),n):s.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+n+";"}if(i[0]){const r=e+"{"+i+"}";return t?a+t+"{"+r+"}":o+r+a}return o+a},d="✨📃",c=".✨",m=/\s*✨[0-9]+/g,b={data:""},f=r=>{try{let e=r?r.querySelector("#✨📃"):null;return e||(e=(r||document.head).appendChild(document.createElement("style")),e.innerHTML=" ",e.id="✨📃"),e.firstChild}catch(r){}return b},g=r=>{const e=f(r),t=e.data;return e.data="",t},y=(r,e,t)=>{e.data.indexOf(r)<0&&(e.data=t?r+e.data:e.data+r)};let u={};const h=(r,e,t,o)=>{const a=JSON.stringify(r),i=u[a]||(u[a]=".✨"+a.split("").reduce((r,e)=>101*r+e.charCodeAt(0)>>>0,11)),s=u[i]||(u[i]=l(r,t?"":i));return y(s,e,o),i.slice(1)},x=(r,e)=>{let t=Object.assign({},r,e);for(const o in r)r[o]&&"object"==typeof e[o]&&Object.assign(t,{[o]:Object.assign(r[o],e[o])});return t},S={breakpoints:[40,52,64].map(r=>r+"em")},j=r=>"@media screen and (min-width: "+r+")",R=(r,e)=>O(e,r,r),O=(r,e,t,o,a)=>{let i=e&&e.split?e.split("."):[e];for(o=0;o<i.length;o++)r=r?r[i[o]]:a;return r===a?t:r},w=(r,e="ignore",t=!0)=>{const o={},a=(a,i)=>{let s={},n={},p=!1;const l=i&&i.disableStyledSystemCache;for(const d in a){if(!r[d]){"separate"===e?n[d]=a[d]:"merge"===e&&(s[d]=a[d]);continue}const c=r[d],m=a[d],b=O(i,c.scale,c.defaults);if("object"!=typeof m)Object.assign(s,c(m,b,a,i));else{if(!t&&Array.isArray(m)){s[d]=m.map(r=>c(r,b,a,i)[d]);continue}if(c.allowComplex||!t){Object.assign(s,c(m,b,a,i));continue}if(o.breakpoints=!l&&o.breakpoints||O(i,"breakpoints",S.breakpoints),Array.isArray(m)){o.media=!l&&o.media||[null,...o.breakpoints.map(j)],s=x(s,k(o.media,c,b,m,a,i));continue}null!==m&&(s=x(s,T(o.breakpoints,c,b,m,a,i)),p=!0)}}return p&&(s=(r=>{const e={};return Object.keys(r).sort((r,e)=>r.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})).forEach(t=>{e[t]=r[t]}),e})(s)),"separate"===e?[s,n]:s};return a.config=r,a.propNames=Object.keys(r),a.cache=o,a},k=(r,e,t,o,a,i)=>{let s={};return o.slice(0,r.length).forEach((o,n)=>{const p=r[n],l=e(o,t,a,i);Object.assign(s,p?{[p]:Object.assign({},s[p],l)}:l)}),s},T=(r,e,t,o,a,i)=>{let s={};for(let n in o){const p=r[n],l=e(o[n],t,a,i);if(p){const r=j(p);Object.assign(s,{[r]:Object.assign({},s[r],l)})}else Object.assign(s,l)}return s},C=({properties:r,property:e,scale:t,transform:o=R,fallbackScale:a,allowComplex:i=!1})=>{r=r||[e];const s=(e,t,a,s)=>{const n={};let p=o(e,t,a,s);if(null!==p)return i||"object"!=typeof p||(p=e),r.forEach(r=>{n[r]=p}),n};return s.scale=t,s.allowComplex=i,s.defaults=a,s},B=(r={},e="ignore",t=!0)=>{const o={};return Object.keys(r).forEach(e=>{const t=r[e];o[e]=!0!==t?"function"!=typeof t?C(t):t:C({property:e,scale:e})}),w(o,e,t)},L=(...r)=>{let e={};return r.forEach(r=>{r&&r.config&&Object.assign(e,r.config)}),w(e)};function W(r,e){if("number"!=typeof r||r>=0){const t=O(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const t=Math.abs(r),o=O(e,String(t),String(t));return"string"==typeof o?"-"+o:-1*o+"px"}function v(r,e){const t=O(e,String(r),String(r));return"string"==typeof t?t:t+"px"}const z={fontSizes:[12,14,16,20,24,32,48,64,72],space:[0,4,8,16,32,64,128,256,512],sizes:[0,4,8,16,32,64,128,256,512]},A={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths",transform:v},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii",transform:v},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii",transform:v},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii",transform:v},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii",transform:v},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii",transform:v},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths",transform:v},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"},borderBottomWidth:{property:"borderBottomWidth",scale:"borderWidths",transform:v},borderBottomColor:{property:"borderBottomColor",scale:"colors"},borderBottomStyle:{property:"borderBottomStyle",scale:"borderStyles"},borderLeftWidth:{property:"borderLeftWidth",scale:"borderWidths",transform:v},borderLeftColor:{property:"borderLeftColor",scale:"colors"},borderLeftStyle:{property:"borderLeftStyle",scale:"borderStyles"},borderRightWidth:{property:"borderRightWidth",scale:"borderWidths",transform:v},borderRightColor:{property:"borderRightColor",scale:"colors"},borderRightStyle:{property:"borderRightStyle",scale:"borderStyles"},borderTopRadius:{properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:v},borderBottomRadius:{properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:v},borderLeftRadius:{properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:v},borderRightRadius:{properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:v}},H={fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",fallbackScale:z.fontSizes,transform:v},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings",transform:v},textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,textDecoration:{property:"textDecoration"},textDecor:{property:"textDecoration"}},I={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:{property:"flexBasis",scale:"sizes",transform:v},justifySelf:!0,alignSelf:!0,order:!0,flexDir:{property:"flexDirection"}},P={gridGap:{property:"gridGap",scale:"space",fallbackScale:z.space,transform:v},gridColumnGap:{property:"gridColumnGap",scale:"space",fallbackScale:z.space,transform:v},gridRowGap:{property:"gridRowGap",scale:"space",fallbackScale:z.space,transform:v},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0,placeItems:!0};function D(r,e){return O(e,r,"number"!=typeof r||r>1?r:100*r+"%")}const G={width:{property:"width",scale:"sizes",transform:D},w:{property:"width",scale:"sizes",transform:D},height:{property:"height",scale:"sizes",transform:v},h:{property:"height",scale:"sizes",transform:v},minWidth:{property:"minWidth",scale:"sizes",transform:v},minW:{property:"minWidth",scale:"sizes",transform:v},minHeight:{property:"minHeight",scale:"sizes",transform:v},minH:{property:"minHeight",scale:"sizes",transform:v},maxWidth:{property:"maxWidth",scale:"sizes",transform:v},maxW:{property:"maxWidth",scale:"sizes",transform:v},maxHeight:{property:"maxHeight",scale:"sizes",transform:v},maxH:{property:"maxHeight",scale:"sizes",transform:v},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0,boxSizing:!0},M={position:!0,pos:{property:"position"},zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",fallbackScale:z.space,transform:W},right:{property:"right",scale:"space",fallbackScale:z.space,transform:W},bottom:{property:"bottom",scale:"space",fallbackScale:z.space,transform:W},left:{property:"left",scale:"space",fallbackScale:z.space,transform:W}},E={scale:"space",fallbackScale:z.space},F={margin:Object.assign({property:"margin",transform:W},E),m:Object.assign({property:"margin",transform:W},E),marginTop:Object.assign({property:"marginTop",transform:W},E),mt:Object.assign({property:"marginTop",transform:W},E),marginRight:Object.assign({property:"marginRight",transform:W},E),mr:Object.assign({property:"marginRight",transform:W},E),marginBottom:Object.assign({property:"marginBottom",transform:W},E),mb:Object.assign({property:"marginBottom",transform:W},E),marginLeft:Object.assign({property:"marginLeft",transform:W},E),ml:Object.assign({property:"marginLeft",transform:W},E),marginX:Object.assign({properties:["marginLeft","marginRight"],transform:W},E),mx:Object.assign({properties:["marginLeft","marginRight"],transform:W},E),marginY:Object.assign({properties:["marginTop","marginBottom"],transform:W},E),my:Object.assign({properties:["marginTop","marginBottom"],transform:W},E),padding:Object.assign({property:"padding",transform:v},E),p:Object.assign({property:"padding",transform:v},E),paddingTop:Object.assign({property:"paddingTop",transform:v},E),pt:Object.assign({property:"paddingTop",transform:v},E),paddingRight:Object.assign({property:"paddingRight",transform:v},E),pr:Object.assign({property:"paddingRight",transform:v},E),paddingBottom:Object.assign({property:"paddingBottom",transform:v},E),pb:Object.assign({property:"paddingBottom",transform:v},E),paddingLeft:Object.assign({property:"paddingLeft",transform:v},E),pl:Object.assign({property:"paddingLeft",transform:v},E),paddingX:Object.assign({properties:["paddingLeft","paddingRight"],transform:v},E),px:Object.assign({properties:["paddingLeft","paddingRight"],transform:v},E),paddingY:Object.assign({properties:["paddingTop","paddingBottom"],transform:v},E),py:Object.assign({properties:["paddingTop","paddingBottom"],transform:v},E)},N=Object.assign({},{bg:{property:"background",scale:"colors"},bgColor:{property:"backgroundColor",scale:"colors"},background:{property:"background",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,bgImage:{property:"backgroundImage"},bgSize:{property:"backgroundSize"},bgPosition:{property:"backgroundPosition"},bgRepeat:{property:"backgroundRepeat"},bgAttachment:{property:"backgroundAttachment"}},{},A,{},{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},opacity:!0,fill:{property:"fill",scale:"colors"},stroke:{property:"stroke",scale:"colors"},outline:!0,outlineOffset:!0,outlineColor:{property:"outlineColor",scale:"colors"}},{},H,{},I,{},P,{},G,{},{animation:!0,appearance:!0,transform:!0,transformOrigin:!0,visibility:!0,userSelect:!0,pointerEvents:!0,cursor:!0,resize:!0,transition:!0,objectFit:!0,objectPosition:!0,float:!0,willChange:!0,listStyleType:!0,listStylePosition:!0,listStyleImage:!0},{},M,{},{boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}},{},F),U=B(N,"separate"),X=B(Object.assign({},N,{x:{property:"x",scale:"space"},y:{property:"y",scale:"space"}}),"merge",!1),Y=(r,e,t,o)=>"object"!=typeof r||Array.isArray(Y)?r:(console.log(X(r,o)),X(r,o)),q=B({animate:{property:"animate",transform:Y,allowComplex:!0},variants:{property:"variants",transform:(r,e,t,o)=>{const a={};for(var i in r)"function"==typeof r[i]?(a[i]=r[i],console.log("here")):a[i]=X(r[i],o);return a},allowComplex:!0},transition:!0,initial:{property:"initial",transform:Y,allowComplex:!0},exit:{property:"exit",transform:Y,allowComplex:!0},style:!0,transformTemplate:!0,transformValues:!0,onUpdate:!0,onAnimationStart:!0,onAnimationComplete:!0,onPan:!0,onPanStart:!0,onPanSessionStart:!0,onPanEnd:!0,onTap:!0,onTapStart:!0,onTapCancel:!0,whileTap:{property:"whileTap",transform:Y,allowComplex:!0},whileHover:{property:"whileHover",transform:Y,allowComplex:!0},onHoverStart:!0,onHoverEnd:!0,layoutId:!0,onMagicComplete:!0,magicDependency:!0,allowTransformNone:!0,drag:!0,dragDirectionLock:!0,dragPropagation:!0,dragConstraints:!0,dragElastic:!0,dragMomentum:!0,dragTransition:!0,dragOriginX:!0,dragOriginY:!0,dragControls:!0,dragListener:!0,custom:!0,static:!0,inherit:!0},"separate");let Z;Z="undefined"!=typeof window?f(document&&document.head):f();const $=({style:e})=>{const t=p();r.useEffect(()=>{h(U(e,t),Z,!0,!1)},[])},J=t=>r.forwardRef((o,a)=>{let{children:i,className:s,as:n}=o,l=function(r,e){if(null==r)return{};var t,o,a={},i=Object.keys(r);for(o=0;o<i.length;o++)e.indexOf(t=i[o])>=0||(a[t]=r[t]);return a}(o,["children","className","as"]),d=m.test(l.className);const c=p(),[b,f]=q(l,c);let g={},y=void 0;if(0===Object.keys(f).length)y=s;else{const[r,e]=U(f,c);g=e,y=Object.keys(r).length>0?h(r,Z,!1,d)+(s?" "+s:""):s}return r.createElement(n||Object.keys(b).length>0?"string"==typeof t?e[t]:e.custom(t):t,Object.assign({},b,g,{ref:a,children:i,className:y}))}),V=J;["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","svg","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].forEach(r=>{V[r]=J(r)});export{d as GOOBER_ID,c as GOOBER_PREFIX,m as GOOBER_REGEX,$ as Global,s as ThemeContext,n as ThemeProvider,i as baseTheme,L as compose,J as createMagic,w as createParser,C as createStyleFunction,U as cssParser,X as deepParser,g as extractCss,O as get,f as getSheet,h as hash,V as magic,x as merge,q as motionParser,l as parse,b as ssr,B as system,y as update,p as useTheme}; | ||
//# sourceMappingURL=magic-components.js.map |
@@ -1,2 +0,2 @@ | ||
var r,e;r=this,e=function(r,e,t,o){var a=(e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e).createContext({}),n=function(){return e.useContext(a)||{}},i=function r(e,t,o){var a="",n="",i="";for(var p in e){var s=e[p];if("object"==typeof s){var l=t+" "+p;/&/g.test(p)&&(l=p.replace(/&/g,t)),"@"==p[0]&&(l=t,"f"==p[1]&&(l=p)),/@k/.test(p)?n+=p+"{"+r(s,"","")+"}":n+=r(s,l,l==t?p:o||"")}else/^@i/.test(p)?a=p+" "+s+";":i+=r.p?r.p(p.replace(/[A-Z]/g,"-$&").toLowerCase(),s):p.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+s+";"}if(i[0]){var d=t+"{"+i+"}";return o?n+o+"{"+d+"}":a+d+n}return a+n},p=/\s*✨[0-9]+/g,s={data:""},l=function(r){try{var e=r?r.querySelector("#✨📃"):null;return e||((e=(r||document.head).appendChild(document.createElement("style"))).innerHTML=" ",e.id="✨📃"),e.firstChild}catch(r){}return s},d=function(r,e,t){e.data.indexOf(r)<0&&(e.data=t?r+e.data:e.data+r)},c={},f=function(r,e,t,o){var a=JSON.stringify(r),n=c[a]||(c[a]=".✨"+a.split("").reduce((function(r,e){return 101*r+e.charCodeAt(0)>>>0}),11)),p=c[n]||(c[n]=i(r,t?"":n));return d(p,e,o),n.slice(1)},m=function(r,e){var t=Object.assign({},r,e);for(var o in r){var a;r[o]&&"object"==typeof e[o]&&Object.assign(t,((a={})[o]=Object.assign(r[o],e[o]),a))}return t},b={breakpoints:[40,52,64].map((function(r){return r+"em"}))},g=function(r){return"@media screen and (min-width: "+r+")"},u=function(r,e){return y(e,r,r)},y=function(r,e,t,o,a){var n=e&&e.split?e.split("."):[e];for(o=0;o<n.length;o++)r=r?r[n[o]]:a;return r===a?t:r},h=function(r,e,t){void 0===e&&(e="ignore"),void 0===t&&(t=!0);var o={},a=function(a,n){var i,p,s={},l={},d=!1,c=n&&n.disableStyledSystemCache,f=function(i){if(!r[i])return"separate"===e?l[i]=a[i]:"merge"===e&&(s[i]=a[i]),"continue";var p=r[i],f=a[i],u=y(n,p.scale,p.defaults);if("object"==typeof f)return!t&&Array.isArray(f)?(s[i]=f.map((function(r){return p(r,u,a,n)[i]})),"continue"):p.allowComplex||!t?(Object.assign(s,p(f,u,a,n)),"continue"):(o.breakpoints=!c&&o.breakpoints||y(n,"breakpoints",b.breakpoints),Array.isArray(f)?(o.media=!c&&o.media||[null].concat(o.breakpoints.map(g)),s=m(s,v(o.media,p,u,f,a,n)),"continue"):(null!==f&&(s=m(s,x(o.breakpoints,p,u,f,a,n)),d=!0),"continue"));Object.assign(s,p(f,u,a,n))};for(var u in a)f(u);return d&&(i=s,p={},Object.keys(i).sort((function(r,e){return r.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})})).forEach((function(r){p[r]=i[r]})),s=p),"separate"===e?[s,l]:s};return a.config=r,a.propNames=Object.keys(r),a.cache=o,a},v=function(r,e,t,o,a,n){var i={};return o.slice(0,r.length).forEach((function(o,p){var s,l=r[p],d=e(o,t,a,n);Object.assign(i,l?((s={})[l]=Object.assign({},i[l],d),s):d)})),i},x=function(r,e,t,o,a,n){var i={};for(var p in o){var s=r[p],l=e(o[p],t,a,n);if(s){var d,c=g(s);Object.assign(i,((d={})[c]=Object.assign({},i[c],l),d))}else Object.assign(i,l)}return i},S=function(r){var e=r.properties,t=r.transform,o=void 0===t?u:t,a=r.fallbackScale,n=r.allowComplex,i=void 0!==n&&n;e=e||[r.property];var p=function(r,t,a,n){var p={},s=o(r,t,a,n);if(null!==s)return i||"object"!=typeof s||(s=r),e.forEach((function(r){p[r]=s})),p};return p.scale=r.scale,p.allowComplex=i,p.defaults=a,p},j=function(r,e,t){void 0===r&&(r={}),void 0===e&&(e="ignore"),void 0===t&&(t=!0);var o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e]=!0!==t?"function"!=typeof t?S(t):t:S({property:e,scale:e})})),h(o,e,t)};function O(r,e){if("number"!=typeof r||r>=0){var t=y(e,String(r),String(r));return"string"==typeof t?t:t+"px"}var o=Math.abs(r),a=y(e,String(o),String(o));return"string"==typeof a?"-"+a:-1*a+"px"}function R(r,e){var t=y(e,String(r),String(r));return"string"==typeof t?t:t+"px"}var w={fontSizes:[12,14,16,20,24,32,48,64,72],space:[0,4,8,16,32,64,128,256,512],sizes:[0,4,8,16,32,64,128,256,512]},k={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths",transform:R},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii",transform:R},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii",transform:R},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii",transform:R},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii",transform:R},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii",transform:R},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths",transform:R},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"},borderBottomWidth:{property:"borderBottomWidth",scale:"borderWidths",transform:R},borderBottomColor:{property:"borderBottomColor",scale:"colors"},borderBottomStyle:{property:"borderBottomStyle",scale:"borderStyles"},borderLeftWidth:{property:"borderLeftWidth",scale:"borderWidths",transform:R},borderLeftColor:{property:"borderLeftColor",scale:"colors"},borderLeftStyle:{property:"borderLeftStyle",scale:"borderStyles"},borderRightWidth:{property:"borderRightWidth",scale:"borderWidths",transform:R},borderRightColor:{property:"borderRightColor",scale:"colors"},borderRightStyle:{property:"borderRightStyle",scale:"borderStyles"},borderTopRadius:{properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:R},borderBottomRadius:{properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:R},borderLeftRadius:{properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:R},borderRightRadius:{properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:R}},T={fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",fallbackScale:w.fontSizes,transform:R},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings",transform:R},textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,textDecoration:{property:"textDecoration"},textDecor:{property:"textDecoration"}},C={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:{property:"flexBasis",scale:"sizes",transform:R},justifySelf:!0,alignSelf:!0,order:!0,flexDir:{property:"flexDirection"}},B={gridGap:{property:"gridGap",scale:"space",fallbackScale:w.space,transform:R},gridColumnGap:{property:"gridColumnGap",scale:"space",fallbackScale:w.space,transform:R},gridRowGap:{property:"gridRowGap",scale:"space",fallbackScale:w.space,transform:R},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0,placeItems:!0};function L(r,e){return y(e,r,"number"!=typeof r||r>1?r:100*r+"%")}var W={width:{property:"width",scale:"sizes",transform:L},w:{property:"width",scale:"sizes",transform:L},height:{property:"height",scale:"sizes",transform:R},h:{property:"height",scale:"sizes",transform:R},minWidth:{property:"minWidth",scale:"sizes",transform:R},minW:{property:"minWidth",scale:"sizes",transform:R},minHeight:{property:"minHeight",scale:"sizes",transform:R},minH:{property:"minHeight",scale:"sizes",transform:R},maxWidth:{property:"maxWidth",scale:"sizes",transform:R},maxW:{property:"maxWidth",scale:"sizes",transform:R},maxHeight:{property:"maxHeight",scale:"sizes",transform:R},maxH:{property:"maxHeight",scale:"sizes",transform:R},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0,boxSizing:!0},z={position:!0,pos:{property:"position"},zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",fallbackScale:w.space,transform:O},right:{property:"right",scale:"space",fallbackScale:w.space,transform:O},bottom:{property:"bottom",scale:"space",fallbackScale:w.space,transform:O},left:{property:"left",scale:"space",fallbackScale:w.space,transform:O}},A={scale:"space",fallbackScale:w.space},H={margin:Object.assign({property:"margin",transform:O},A),m:Object.assign({property:"margin",transform:O},A),marginTop:Object.assign({property:"marginTop",transform:O},A),mt:Object.assign({property:"marginTop",transform:O},A),marginRight:Object.assign({property:"marginRight",transform:O},A),mr:Object.assign({property:"marginRight",transform:O},A),marginBottom:Object.assign({property:"marginBottom",transform:O},A),mb:Object.assign({property:"marginBottom",transform:O},A),marginLeft:Object.assign({property:"marginLeft",transform:O},A),ml:Object.assign({property:"marginLeft",transform:O},A),marginX:Object.assign({properties:["marginLeft","marginRight"],transform:O},A),mx:Object.assign({properties:["marginLeft","marginRight"],transform:O},A),marginY:Object.assign({properties:["marginTop","marginBottom"],transform:O},A),my:Object.assign({properties:["marginTop","marginBottom"],transform:O},A),padding:Object.assign({property:"padding",transform:R},A),p:Object.assign({property:"padding",transform:R},A),paddingTop:Object.assign({property:"paddingTop",transform:R},A),pt:Object.assign({property:"paddingTop",transform:R},A),paddingRight:Object.assign({property:"paddingRight",transform:R},A),pr:Object.assign({property:"paddingRight",transform:R},A),paddingBottom:Object.assign({property:"paddingBottom",transform:R},A),pb:Object.assign({property:"paddingBottom",transform:R},A),paddingLeft:Object.assign({property:"paddingLeft",transform:R},A),pl:Object.assign({property:"paddingLeft",transform:R},A),paddingX:Object.assign({properties:["paddingLeft","paddingRight"],transform:R},A),px:Object.assign({properties:["paddingLeft","paddingRight"],transform:R},A),paddingY:Object.assign({properties:["paddingTop","paddingBottom"],transform:R},A),py:Object.assign({properties:["paddingTop","paddingBottom"],transform:R},A)},I=Object.assign({},{bg:{property:"background",scale:"colors"},bgColor:{property:"backgroundColor",scale:"colors"},background:{property:"background",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,bgImage:{property:"backgroundImage"},bgSize:{property:"backgroundSize"},bgPosition:{property:"backgroundPosition"},bgRepeat:{property:"backgroundRepeat"},bgAttachment:{property:"backgroundAttachment"}},{},k,{},{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},opacity:!0,fill:{property:"fill",scale:"colors"},stroke:{property:"stroke",scale:"colors"},outline:!0,outlineOffset:!0,outlineColor:{property:"outlineColor",scale:"colors"}},{},T,{},C,{},B,{},W,{},{animation:!0,appearance:!0,transform:!0,transformOrigin:!0,visibility:!0,userSelect:!0,pointerEvents:!0,cursor:!0,resize:!0,transition:!0,objectFit:!0,objectPosition:!0,float:!0,willChange:!0,listStyleType:!0,listStylePosition:!0,listStyleImage:!0},{},z,{},{boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}},{},H);function P(r){return r.map((function(r){return r.includes(" ")?'"'+r+'"':r})).join(", ")}var D,G=[0,4,8,12,16,24,32,40,48,64,80,96,112,128],M=Object.assign({breakpoints:["544px","768px","1012px","1280px"],colors:o.colors,fontSizes:[11,12,14,16,20,24,28,32,40,48],lineHeights:{condensedUltra:1,condensed:1.25,default:1.5,oneLine:"32px"},maxWidths:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},fonts:{normal:P(["Barlow","-apple-system","BlinkMacSystemFont","Segoe UI","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),mono:P(["SF Mono","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontWeights:{lighter:300,normal:400,bold:500,bolder:600},borders:[0,"1px solid"],radii:[0,3,6,12,150],space:G,sizes:G},{shadows:{none:"rgba(0,0,0,0) 0 0px 0px 0",small:"rgba(0,0,0,0.15) 0 3px 6px 0",large:"rgba(0,0,0,0.30) 0 4px 10px 0"},ruleHeight:32}),E=j(I,"separate"),F=j(Object.assign({},I,{x:{property:"x",scale:"space"},y:{property:"y",scale:"space"}}),"merge",!1),q=function r(e,t,o,a){return"object"!=typeof e||Array.isArray(r)?e:(console.log(F(e,a)),F(e,a))},U=j({animate:{property:"animate",transform:q,allowComplex:!0},variants:{property:"variants",transform:function(r,e,t,o){var a={};for(var n in r)"function"==typeof r[n]?(a[n]=r[n],console.log("here")):a[n]=F(r[n],o);return a},allowComplex:!0},transition:!0,initial:{property:"initial",transform:q,allowComplex:!0},exit:{property:"exit",transform:q,allowComplex:!0},style:!0,transformTemplate:!0,transformValues:!0,onUpdate:!0,onAnimationStart:!0,onAnimationComplete:!0,onPan:!0,onPanStart:!0,onPanSessionStart:!0,onPanEnd:!0,onTap:!0,onTapStart:!0,onTapCancel:!0,whileTap:{property:"whileTap",transform:q,allowComplex:!0},whileHover:{property:"whileHover",transform:q,allowComplex:!0},onHoverStart:!0,onHoverEnd:!0,layoutId:!0,onMagicComplete:!0,magicDependency:!0,allowTransformNone:!0,drag:!0,dragDirectionLock:!0,dragPropagation:!0,dragConstraints:!0,dragElastic:!0,dragMomentum:!0,dragTransition:!0,dragOriginX:!0,dragOriginY:!0,dragControls:!0,dragListener:!0,custom:!0,static:!0,inherit:!0},"separate");D="undefined"!=typeof window?l(document&&document.head):l();var X=function(r){return e.forwardRef((function(o,a){var i=o.children,s=o.className,l=o.as,d=function(r,e){if(null==r)return{};var t,o,a={},n=Object.keys(r);for(o=0;o<n.length;o++)e.indexOf(t=n[o])>=0||(a[t]=r[t]);return a}(o,["children","className","as"]),c=p.test(d.className),m=n(),b=U(d,m),g=b[0],u=b[1],y={},h=void 0;if(0===Object.keys(u).length)h=s;else{var v=E(u,m),x=v[0];y=v[1],h=Object.keys(x).length>0?f(x,D,!1,c)+(s?" "+s:""):s}return e.createElement(l||Object.keys(g).length>0?"string"==typeof r?t.motion[r]:t.motion.custom(r):r,Object.assign({},g,y,{ref:a,children:i,className:h}))}))},Y=X;["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","svg","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].forEach((function(r){Y[r]=X(r)})),Object.keys(t).forEach((function(e){"default"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return t[e]}})})),r.GOOBER_ID="✨📃",r.GOOBER_PREFIX=".✨",r.GOOBER_REGEX=p,r.Global=function(r){var t=r.style,o=n();e.useEffect((function(){f(E(t,o),D,!0,!1)}),[])},r.ThemeContext=a,r.ThemeProvider=function(r){var t=r.theme;return e.createElement(a.Provider,{value:void 0===t?{}:t},r.children)},r.baseTheme=M,r.compose=function(){for(var r={},e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t.forEach((function(e){e&&e.config&&Object.assign(r,e.config)}));var a=h(r);return a},r.createMagic=X,r.createParser=h,r.createStyleFunction=S,r.cssParser=E,r.deepParser=F,r.extractCss=function(r){var e=l(r),t=e.data;return e.data="",t},r.get=y,r.getSheet=l,r.hash=f,r.magic=Y,r.merge=m,r.motionParser=U,r.parse=i,r.ssr=s,r.system=j,r.update=d,r.useTheme=n},"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("framer-motion"),require("@nksaraf/colors")):"function"==typeof define&&define.amd?define(["exports","react","framer-motion","@nksaraf/colors"],e):e((r=r||self).Magic={},r.React,r.Motion,r.Colors); | ||
var r,e;r=this,e=function(r,e,t,o){function a(r){return r.map((function(r){return r.includes(" ")?'"'+r+'"':r})).join(", ")}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n=[0,4,8,12,16,24,32,40,48,64,80,96,112,128],i=Object.assign({breakpoints:["544px","768px","1012px","1280px"],colors:o.colors,fontSizes:[11,12,14,16,20,24,28,32,40,48],lineHeights:{condensedUltra:1,condensed:1.25,default:1.5,oneLine:"32px"},maxWidths:{small:"544px",medium:"768px",large:"1012px",xlarge:"1280px"},fonts:{normal:a(["Barlow","-apple-system","BlinkMacSystemFont","Segoe UI","Helvetica","Arial","sans-serif","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"]),mono:a(["SF Mono","Consolas","Liberation Mono","Menlo","Courier","monospace"])},fontWeights:{lighter:300,normal:400,bold:500,bolder:600},borders:[0,"1px solid"],radii:[0,3,6,12,150],space:n,sizes:n},{shadows:{none:"rgba(0,0,0,0) 0 0px 0px 0",small:"rgba(0,0,0,0.15) 0 3px 6px 0",large:"rgba(0,0,0,0.30) 0 4px 10px 0"},ruleHeight:32}),p=e.createContext(i),s=function(){return e.useContext(p)||{}},l=function r(e,t,o){var a="",n="",i="";for(var p in e){var s=e[p];if("object"==typeof s){var l=t+" "+p;/&/g.test(p)&&(l=p.replace(/&/g,t)),"@"==p[0]&&(l=t,"f"==p[1]&&(l=p)),/@k/.test(p)?n+=p+"{"+r(s,"","")+"}":n+=r(s,l,l==t?p:o||"")}else/^@i/.test(p)?a=p+" "+s+";":i+=r.p?r.p(p.replace(/[A-Z]/g,"-$&").toLowerCase(),s):p.replace(/[A-Z]/g,"-$&").toLowerCase()+":"+s+";"}if(i[0]){var d=t+"{"+i+"}";return o?n+o+"{"+d+"}":a+d+n}return a+n},d=/\s*✨[0-9]+/g,c={data:""},f=function(r){try{var e=r?r.querySelector("#✨📃"):null;return e||((e=(r||document.head).appendChild(document.createElement("style"))).innerHTML=" ",e.id="✨📃"),e.firstChild}catch(r){}return c},m=function(r,e,t){e.data.indexOf(r)<0&&(e.data=t?r+e.data:e.data+r)},b={},g=function(r,e,t,o){var a=JSON.stringify(r),n=b[a]||(b[a]=".✨"+a.split("").reduce((function(r,e){return 101*r+e.charCodeAt(0)>>>0}),11)),i=b[n]||(b[n]=l(r,t?"":n));return m(i,e,o),n.slice(1)},u=function(r,e){var t=Object.assign({},r,e);for(var o in r){var a;r[o]&&"object"==typeof e[o]&&Object.assign(t,((a={})[o]=Object.assign(r[o],e[o]),a))}return t},y={breakpoints:[40,52,64].map((function(r){return r+"em"}))},h=function(r){return"@media screen and (min-width: "+r+")"},v=function(r,e){return x(e,r,r)},x=function(r,e,t,o,a){var n=e&&e.split?e.split("."):[e];for(o=0;o<n.length;o++)r=r?r[n[o]]:a;return r===a?t:r},S=function(r,e,t){void 0===e&&(e="ignore"),void 0===t&&(t=!0);var o={},a=function(a,n){var i,p,s={},l={},d=!1,c=n&&n.disableStyledSystemCache,f=function(i){if(!r[i])return"separate"===e?l[i]=a[i]:"merge"===e&&(s[i]=a[i]),"continue";var p=r[i],f=a[i],m=x(n,p.scale,p.defaults);if("object"==typeof f)return!t&&Array.isArray(f)?(s[i]=f.map((function(r){return p(r,m,a,n)[i]})),"continue"):p.allowComplex||!t?(Object.assign(s,p(f,m,a,n)),"continue"):(o.breakpoints=!c&&o.breakpoints||x(n,"breakpoints",y.breakpoints),Array.isArray(f)?(o.media=!c&&o.media||[null].concat(o.breakpoints.map(h)),s=u(s,j(o.media,p,m,f,a,n)),"continue"):(null!==f&&(s=u(s,O(o.breakpoints,p,m,f,a,n)),d=!0),"continue"));Object.assign(s,p(f,m,a,n))};for(var m in a)f(m);return d&&(i=s,p={},Object.keys(i).sort((function(r,e){return r.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"})})).forEach((function(r){p[r]=i[r]})),s=p),"separate"===e?[s,l]:s};return a.config=r,a.propNames=Object.keys(r),a.cache=o,a},j=function(r,e,t,o,a,n){var i={};return o.slice(0,r.length).forEach((function(o,p){var s,l=r[p],d=e(o,t,a,n);Object.assign(i,l?((s={})[l]=Object.assign({},i[l],d),s):d)})),i},O=function(r,e,t,o,a,n){var i={};for(var p in o){var s=r[p],l=e(o[p],t,a,n);if(s){var d,c=h(s);Object.assign(i,((d={})[c]=Object.assign({},i[c],l),d))}else Object.assign(i,l)}return i},R=function(r){var e=r.properties,t=r.transform,o=void 0===t?v:t,a=r.fallbackScale,n=r.allowComplex,i=void 0!==n&&n;e=e||[r.property];var p=function(r,t,a,n){var p={},s=o(r,t,a,n);if(null!==s)return i||"object"!=typeof s||(s=r),e.forEach((function(r){p[r]=s})),p};return p.scale=r.scale,p.allowComplex=i,p.defaults=a,p},w=function(r,e,t){void 0===r&&(r={}),void 0===e&&(e="ignore"),void 0===t&&(t=!0);var o={};return Object.keys(r).forEach((function(e){var t=r[e];o[e]=!0!==t?"function"!=typeof t?R(t):t:R({property:e,scale:e})})),S(o,e,t)};function k(r,e){if("number"!=typeof r||r>=0){var t=x(e,String(r),String(r));return"string"==typeof t?t:t+"px"}var o=Math.abs(r),a=x(e,String(o),String(o));return"string"==typeof a?"-"+a:-1*a+"px"}function T(r,e){var t=x(e,String(r),String(r));return"string"==typeof t?t:t+"px"}var C={fontSizes:[12,14,16,20,24,32,48,64,72],space:[0,4,8,16,32,64,128,256,512],sizes:[0,4,8,16,32,64,128,256,512]},B={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths",transform:T},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii",transform:T},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii",transform:T},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii",transform:T},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii",transform:T},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii",transform:T},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths",transform:T},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"},borderBottomWidth:{property:"borderBottomWidth",scale:"borderWidths",transform:T},borderBottomColor:{property:"borderBottomColor",scale:"colors"},borderBottomStyle:{property:"borderBottomStyle",scale:"borderStyles"},borderLeftWidth:{property:"borderLeftWidth",scale:"borderWidths",transform:T},borderLeftColor:{property:"borderLeftColor",scale:"colors"},borderLeftStyle:{property:"borderLeftStyle",scale:"borderStyles"},borderRightWidth:{property:"borderRightWidth",scale:"borderWidths",transform:T},borderRightColor:{property:"borderRightColor",scale:"colors"},borderRightStyle:{property:"borderRightStyle",scale:"borderStyles"},borderTopRadius:{properties:["borderTopLeftRadius","borderTopRightRadius"],scale:"radii",transform:T},borderBottomRadius:{properties:["borderBottomLeftRadius","borderBottomRightRadius"],scale:"radii",transform:T},borderLeftRadius:{properties:["borderTopLeftRadius","borderBottomLeftRadius"],scale:"radii",transform:T},borderRightRadius:{properties:["borderTopRightRadius","borderBottomRightRadius"],scale:"radii",transform:T}},L={fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",fallbackScale:C.fontSizes,transform:T},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings",transform:T},textAlign:!0,fontStyle:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,textDecoration:{property:"textDecoration"},textDecor:{property:"textDecoration"}},W={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:{property:"flexBasis",scale:"sizes",transform:T},justifySelf:!0,alignSelf:!0,order:!0,flexDir:{property:"flexDirection"}},z={gridGap:{property:"gridGap",scale:"space",fallbackScale:C.space,transform:T},gridColumnGap:{property:"gridColumnGap",scale:"space",fallbackScale:C.space,transform:T},gridRowGap:{property:"gridRowGap",scale:"space",fallbackScale:C.space,transform:T},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0,placeItems:!0};function A(r,e){return x(e,r,"number"!=typeof r||r>1?r:100*r+"%")}var H,I={width:{property:"width",scale:"sizes",transform:A},w:{property:"width",scale:"sizes",transform:A},height:{property:"height",scale:"sizes",transform:T},h:{property:"height",scale:"sizes",transform:T},minWidth:{property:"minWidth",scale:"sizes",transform:T},minW:{property:"minWidth",scale:"sizes",transform:T},minHeight:{property:"minHeight",scale:"sizes",transform:T},minH:{property:"minHeight",scale:"sizes",transform:T},maxWidth:{property:"maxWidth",scale:"sizes",transform:T},maxW:{property:"maxWidth",scale:"sizes",transform:T},maxHeight:{property:"maxHeight",scale:"sizes",transform:T},maxH:{property:"maxHeight",scale:"sizes",transform:T},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0,boxSizing:!0},P={position:!0,pos:{property:"position"},zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",fallbackScale:C.space,transform:k},right:{property:"right",scale:"space",fallbackScale:C.space,transform:k},bottom:{property:"bottom",scale:"space",fallbackScale:C.space,transform:k},left:{property:"left",scale:"space",fallbackScale:C.space,transform:k}},D={scale:"space",fallbackScale:C.space},G={margin:Object.assign({property:"margin",transform:k},D),m:Object.assign({property:"margin",transform:k},D),marginTop:Object.assign({property:"marginTop",transform:k},D),mt:Object.assign({property:"marginTop",transform:k},D),marginRight:Object.assign({property:"marginRight",transform:k},D),mr:Object.assign({property:"marginRight",transform:k},D),marginBottom:Object.assign({property:"marginBottom",transform:k},D),mb:Object.assign({property:"marginBottom",transform:k},D),marginLeft:Object.assign({property:"marginLeft",transform:k},D),ml:Object.assign({property:"marginLeft",transform:k},D),marginX:Object.assign({properties:["marginLeft","marginRight"],transform:k},D),mx:Object.assign({properties:["marginLeft","marginRight"],transform:k},D),marginY:Object.assign({properties:["marginTop","marginBottom"],transform:k},D),my:Object.assign({properties:["marginTop","marginBottom"],transform:k},D),padding:Object.assign({property:"padding",transform:T},D),p:Object.assign({property:"padding",transform:T},D),paddingTop:Object.assign({property:"paddingTop",transform:T},D),pt:Object.assign({property:"paddingTop",transform:T},D),paddingRight:Object.assign({property:"paddingRight",transform:T},D),pr:Object.assign({property:"paddingRight",transform:T},D),paddingBottom:Object.assign({property:"paddingBottom",transform:T},D),pb:Object.assign({property:"paddingBottom",transform:T},D),paddingLeft:Object.assign({property:"paddingLeft",transform:T},D),pl:Object.assign({property:"paddingLeft",transform:T},D),paddingX:Object.assign({properties:["paddingLeft","paddingRight"],transform:T},D),px:Object.assign({properties:["paddingLeft","paddingRight"],transform:T},D),paddingY:Object.assign({properties:["paddingTop","paddingBottom"],transform:T},D),py:Object.assign({properties:["paddingTop","paddingBottom"],transform:T},D)},M=Object.assign({},{bg:{property:"background",scale:"colors"},bgColor:{property:"backgroundColor",scale:"colors"},background:{property:"background",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,bgImage:{property:"backgroundImage"},bgSize:{property:"backgroundSize"},bgPosition:{property:"backgroundPosition"},bgRepeat:{property:"backgroundRepeat"},bgAttachment:{property:"backgroundAttachment"}},{},B,{},{color:{property:"color",scale:"colors"},textColor:{property:"color",scale:"colors"},opacity:!0,fill:{property:"fill",scale:"colors"},stroke:{property:"stroke",scale:"colors"},outline:!0,outlineOffset:!0,outlineColor:{property:"outlineColor",scale:"colors"}},{},L,{},W,{},z,{},I,{},{animation:!0,appearance:!0,transform:!0,transformOrigin:!0,visibility:!0,userSelect:!0,pointerEvents:!0,cursor:!0,resize:!0,transition:!0,objectFit:!0,objectPosition:!0,float:!0,willChange:!0,listStyleType:!0,listStylePosition:!0,listStyleImage:!0},{},P,{},{boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}},{},G),E=w(M,"separate"),F=w(Object.assign({},M,{x:{property:"x",scale:"space"},y:{property:"y",scale:"space"}}),"merge",!1),q=function r(e,t,o,a){return"object"!=typeof e||Array.isArray(r)?e:(console.log(F(e,a)),F(e,a))},U=w({animate:{property:"animate",transform:q,allowComplex:!0},variants:{property:"variants",transform:function(r,e,t,o){var a={};for(var n in r)"function"==typeof r[n]?(a[n]=r[n],console.log("here")):a[n]=F(r[n],o);return a},allowComplex:!0},transition:!0,initial:{property:"initial",transform:q,allowComplex:!0},exit:{property:"exit",transform:q,allowComplex:!0},style:!0,transformTemplate:!0,transformValues:!0,onUpdate:!0,onAnimationStart:!0,onAnimationComplete:!0,onPan:!0,onPanStart:!0,onPanSessionStart:!0,onPanEnd:!0,onTap:!0,onTapStart:!0,onTapCancel:!0,whileTap:{property:"whileTap",transform:q,allowComplex:!0},whileHover:{property:"whileHover",transform:q,allowComplex:!0},onHoverStart:!0,onHoverEnd:!0,layoutId:!0,onMagicComplete:!0,magicDependency:!0,allowTransformNone:!0,drag:!0,dragDirectionLock:!0,dragPropagation:!0,dragConstraints:!0,dragElastic:!0,dragMomentum:!0,dragTransition:!0,dragOriginX:!0,dragOriginY:!0,dragControls:!0,dragListener:!0,custom:!0,static:!0,inherit:!0},"separate");H="undefined"!=typeof window?f(document&&document.head):f();var X=function(r){return e.forwardRef((function(o,a){var n=o.children,i=o.className,p=o.as,l=function(r,e){if(null==r)return{};var t,o,a={},n=Object.keys(r);for(o=0;o<n.length;o++)e.indexOf(t=n[o])>=0||(a[t]=r[t]);return a}(o,["children","className","as"]),c=d.test(l.className),f=s(),m=U(l,f),b=m[0],u=m[1],y={},h=void 0;if(0===Object.keys(u).length)h=i;else{var v=E(u,f),x=v[0];y=v[1],h=Object.keys(x).length>0?g(x,H,!1,c)+(i?" "+i:""):i}return e.createElement(p||Object.keys(b).length>0?"string"==typeof r?t.motion[r]:t.motion.custom(r):r,Object.assign({},b,y,{ref:a,children:n,className:h}))}))},Y=X;["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","svg","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].forEach((function(r){Y[r]=X(r)})),Object.keys(t).forEach((function(e){"default"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return t[e]}})})),r.GOOBER_ID="✨📃",r.GOOBER_PREFIX=".✨",r.GOOBER_REGEX=d,r.Global=function(r){var t=r.style,o=s();e.useEffect((function(){g(E(t,o),H,!0,!1)}),[])},r.ThemeContext=p,r.ThemeProvider=function(r){var t=r.theme;return e.createElement(p.Provider,{value:(void 0===t?{}:t)||i},r.children)},r.baseTheme=i,r.compose=function(){for(var r={},e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t.forEach((function(e){e&&e.config&&Object.assign(r,e.config)}));var a=S(r);return a},r.createMagic=X,r.createParser=S,r.createStyleFunction=R,r.cssParser=E,r.deepParser=F,r.extractCss=function(r){var e=f(r),t=e.data;return e.data="",t},r.get=x,r.getSheet=f,r.hash=g,r.magic=Y,r.merge=u,r.motionParser=U,r.parse=l,r.ssr=c,r.system=w,r.update=m,r.useTheme=s},"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("framer-motion"),require("@nksaraf/colors")):"function"==typeof define&&define.amd?define(["exports","react","framer-motion","@nksaraf/colors"],e):e((r=r||self).Magic={},r.React,r.Motion,r.Colors); | ||
//# sourceMappingURL=magic-components.umd.js.map |
import React from "react"; | ||
export declare const ThemeContext: React.Context<any>; | ||
export declare const ThemeProvider: ({ theme, children, }: React.PropsWithChildren<{ | ||
theme: any; | ||
theme?: any; | ||
}>) => JSX.Element; | ||
export declare const useTheme: () => any; |
{ | ||
"name": "magic-components", | ||
"version": "0.0.1-beta.3", | ||
"version": "0.0.1-beta.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "repository": "Nikhil Saraf/magic-components", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221274