@stitches/core
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,2 +0,2 @@ | ||
(()=>{var{toPrimitive:e}=Symbol,t=Symbol.for("sxs.composers"),{assign:n,create:r,defineProperties:o,getOwnPropertyDescriptors:i}=Object,a=(t,r,a)=>n(o(t,i(a)),{[e]:()=>t[r],toString:()=>t[r]}),s=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),l=(e,t)=>e.reduce(((e,n)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(n)&&/&[^]*&/.test(e)?`:is(${n})`:n):n+" "+e))),e)),[]),c=/\s*,\s*(?![^()]*\))/,d=/(-columns|(^|[^e]-)padding|[^t]-spacing|l-align|rows|(^|(^border|[dkmnptx]|le|ne)-)width|^border|tom|[ek]-start|(o|[^e]-du)ration|us|(^|[^tv]-)left|(^|-)top|tance|rgin|e-offset|(er|g|n|t)-block|(^|[^tv]-)right|basis|[gnt]-inline|gap|(^|[^e]-)height|ness|(^|[^p]-)inset|[ek]-end|elay|tline|ve|dent|-rotate|n-rule|(c|ck|d|ne|t)-size)$/,g=/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,p=/\s+(?![^()]*\))/,m=e=>t=>e(..."string"==typeof t?String(t).split(p):[t]),h=/([\d.]+)([^]*)/,u={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:/^([^]*["'][^]*|[A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:m(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:m(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:m(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:m(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:m(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:m(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},f=e=>{const{media:t,themeMap:n,utils:r}=e;let o,i,a,p;return m=>((e,t)=>{const n=new WeakSet;let r,o;const i=(e,a,d)=>{let g="";e:for(let p in e){const m=64===p.charCodeAt(0);for(const h of m?[].concat(e[p]):[e[p]]){if("function"==typeof t&&(p!==r||h!==o)){const n=t(p,h,e);if(null!==n){r=p,o=h,g+=n===Object(n)?i(n,a,d):null==n?"":n;continue e}}const m=64===p.charCodeAt(0);if(h!==Object(h)||"length"in h){for(let e=0;e<d.length;++e)n.has(d[e])||(n.add(d[e]),g+=d[e]+"{");a.length&&!n.has(a)&&(n.add(a),g+=a+"{");for(const e of/^@import/i.test(p)?[].concat(h):[h])g+=(m?p+" ":s(p)+":")+String(e)+";"}else{n.has(a)&&(n.delete(a),g+="}");const e=Object(p),t=m?a:a.length?l(a,p.split(c)):p.split(c);g+=i(h,t,m?d.concat(e):d),n.has(e)&&(n.delete(e),g+="}"),n.has(t)&&(n.delete(t),g+="}")}}}return g};return i(e,[],[])})(m,((l,c)=>{const m=l.charCodeAt(0),f=64===m?l:/[A-Z]/.test(b=l)?b:b.replace(/-[^]/g,(e=>e[1].toUpperCase()));var b;const S=64===m?l:s(l);if("function"==typeof r[l]){if(r[l]!=a||c!=p)return a=r[l],p=c,a(e)(p)}else if("function"==typeof u[f]&&(u[f]!=a||c!=p))return a=u[f],p=c,a(p);if(p=c,o!=f&&i!=c&&/^((min|max)?((Block|Inline)Size|Height|Width)|height|width)$/.test(f)){o=f,i=c;const e=i.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((e,t,n,r)=>t+("stretch"===n?`-moz-available${r};${S}:${t}-webkit-fill-available`:`-moz-fit-content${r};${S}:${t}fit-content`)+r));if(e!=c)return{[l]:e}}let k=64===m?(l.slice(1)in t?"@media "+t[l.slice(1)]:l).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,n,r,o,i)=>{const a=h.test(t),s=.0625*(a?-1:1),[l,c]=a?[r,t]:[t,r];return"("+("="===n[0]?"":">"===n[0]===a?"max-":"min-")+l+":"+("="!==n[0]&&1===n.length?c.replace(h,((e,t,r)=>Number(t)+s*(">"===n?1:-1)+r)):c)+(o?") and ("+(">"===o[0]?"min-":"max-")+l+":"+(1===o.length?i.replace(h,((e,t,n)=>Number(t)+s*(">"===o?-1:1)+n)):i):"")+")"})):36===m?"-"+l.replace(/\$/g,"-"):l;const y=c===Object(c)?c:c&&"number"==typeof c&&d.test(S)?String(c)+"px":String(c).replace(g,((e,t,r,o,i)=>"$"==o==!!r?e:(t||"--"==o?"calc(":"")+"var("+("$"===o?"--"+(i.includes("$")?"":f in n?n[f]+"-":"")+i.replace(/\$/g,"-"):o+i)+")"+(t||"--"==o?"*"+(t||"")+(r||"1")+")":"")));return c!=y||S!=k?{[k]:y}:null}))},{from:b,isArray:S}=Array,{ownKeys:k}=Reflect,y=class extends Set{toString(){return b(this).join("")}get hasChanged(){const{size:e}=this;return()=>e<this.size}},B=y;y.prototype[e]=y.prototype.toString;var w="colors",C="sizes",I="space",x={gap:I,gridGap:I,columnGap:I,gridColumnGap:I,rowGap:I,gridRowGap:I,inset:I,insetBlock:I,insetBlockEnd:I,insetBlockStart:I,insetInline:I,insetInlineEnd:I,insetInlineStart:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockEnd:I,marginBlockStart:I,marginInline:I,marginInlineEnd:I,marginInlineStart:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockEnd:I,paddingBlockStart:I,paddingInline:I,paddingInlineEnd:I,paddingInlineStart:I,top:I,right:I,bottom:I,left:I,scrollMargin:I,scrollMarginTop:I,scrollMarginRight:I,scrollMarginBottom:I,scrollMarginLeft:I,scrollMarginX:I,scrollMarginY:I,scrollMarginBlock:I,scrollMarginBlockEnd:I,scrollMarginBlockStart:I,scrollMarginInline:I,scrollMarginInlineEnd:I,scrollMarginInlineStart:I,scrollPadding:I,scrollPaddingTop:I,scrollPaddingRight:I,scrollPaddingBottom:I,scrollPaddingLeft:I,scrollPaddingX:I,scrollPaddingY:I,scrollPaddingBlock:I,scrollPaddingBlockEnd:I,scrollPaddingBlockStart:I,scrollPaddingInline:I,scrollPaddingInlineEnd:I,scrollPaddingInlineStart:I,fontSize:"fontSizes",background:w,backgroundColor:w,backgroundImage:w,border:w,borderBlock:w,borderBlockEnd:w,borderBlockStart:w,borderBottom:w,borderBottomColor:w,borderColor:w,borderInline:w,borderInlineEnd:w,borderInlineStart:w,borderLeft:w,borderLeftColor:w,borderRight:w,borderRightColor:w,borderTop:w,borderTopColor:w,caretColor:w,color:w,columnRuleColor:w,fill:w,outline:w,outlineColor:w,stroke:w,textDecorationColor:w,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:C,minBlockSize:C,maxBlockSize:C,inlineSize:C,minInlineSize:C,maxInlineSize:C,width:C,minWidth:C,maxWidth:C,height:C,minHeight:C,maxHeight:C,flexBasis:C,gridTemplateColumns:C,gridTemplateRows:C,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},z=e=>{const t={};for(const n in e)for(const r in e[n])t["$"+n+"-"+r]=String(e[n][r]).replace(/\$[$\w-]+/g,(e=>/[^]\$/.test(e)?e:"$"+n+e));return t},$=(e,t)=>{for(var n=JSON.stringify(t),r=n.length,o=9;r;)o=Math.imul(o^n.charCodeAt(--r),9**9);return e+(o^o>>>9).toString(36).slice(-5)},j=class{constructor(e,t,n){this.value=e,this.token=t,this.scale=n}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+this.scale+"-"+this.token}toString(){return this.computedValue}},E=class extends Array{toString(){return this.join("")}get hasChanged(){const e=String(this);return()=>e!==String(this)}},M=E;E.prototype[e]=E.prototype.toString;var W=e=>{let t=null,r=null,o=null;const i="append"===e.insertionMethod;return e=>{if("object"==typeof document){cancelAnimationFrame(o);const a=(e=>(t||(t=document.head||document.documentElement),r||(r=document.getElementById("stitches")||n(document.createElement("style"),{id:"stitches",textContent:e})),r.parentNode||t[i?"append":"prepend"](r),r.textContent))();a?a!==e&&"complete"==document.readyState&&(o=requestAnimationFrame((()=>r.textContent=e))):r.textContent=e}}},v=e=>{e=Object(e);const o=n({initial:"all"},e.media),i=Object(e.theme),s=Object(e.themeMap||x),l=Object(e.utils),c=new Set([].concat(e.passthru||["as","className"])),d=e.prefix||"sx",g=("function"==typeof e.insertionMethod?e.insertionMethod:W)(e),p="03kze",m={theme:i,media:o,prefix:d,themeMap:s,utils:l},h=f(m),u=new B,S=new B,y=new B,w=new B,C=new B([u,S,y,w]);let I="";const E=()=>{const e=b(C).join("");I!==e&&g(I=e)},v=(e,t)=>{t=e===Object(e)?e:Object(t),e="string"==typeof e?e:"";const n=z(t),o=(e=e||$(d,n)).replace(/^\w/,".$&"),i=e===d+p?"":h({[o]:n}),s=a(r(null),"className",{className:e,selector:o});for(const e in t){s[e]=r(null);for(const n in t[e])s[e][n]=new j(t[e][n],n,e)}return a(s,"className",{get className(){const{hasChanged:t}=S;return S.add(i),t()&&E(),e},selector:o})},O=(e,t="")=>{const n=new B,o=new B;for(const t in e)if(e[t]!==Object(e[t])||k(e[t]).length){const r=h({[t]:e[t]});("@import"===t?n:o).add(r)}const i=a(r(null),"name",{name:t}),s=a((()=>{let e=u.hasChanged,t=y.hasChanged;return n.forEach((e=>{u.add(e)})),o.forEach((e=>{y.add(e)})),(e()||t())&&E(),i}),"name",{get name(){return String(s())}});return s},P=e=>{const t=new B,n=new M,o=new B,i=new B([t,n,o]);let{variants:a,compoundVariants:s,defaultVariants:l,...c}=e;l=Object(l);const g=$(d,e),m="."+g,u=g===d+p?"":h({[m]:c});w.add(i);const f=r(null),b=[],S=[];for(const e in a)for(const t in a[e]){const n=a[e][t];S.push({[e]:t,css:n})}S.push(...s||[]);for(const e in S){const{css:t,...o}=S[e],i=k(o),a=i.length;for(const e of i)f[e]=f[e]||r(null),f[e][o[e]]=!0;const s=(e,r)=>{e={...e};for(const t in r)void 0!==e[t]||Object(f[t])[e[t]]||(e[t]=r[t]);const s=new Set;if(i.length&&i.every((t=>{const n=e[t],r=String(o[t]);if(r===String(n))return!0;if(n===Object(n))for(const e in n)if(r==String(n[e])&&64===e.charCodeAt(0))return s.add(e),!0}))){let e=Object(t);for(const t of s)e={[t]:e};const r=g+$("",e)+"--"+(1===a?i[0]+"-"+o[i[0]]:"c"+a),l=h({["."+r]:e});return(n[a-1]||(n[a-1]=new B)).add(l),r}};b.push(s)}return{apply(e,r,o){const a=t.hasChanged,s=n.hasChanged;if(t.add(u),e){r.add(g);for(const t of b){const n=t(e,o);n&&r.add(n)}}if(a()||s())return w.add(i),!0},inline(e,t){const n=$("-",e),r=g==="-"+n?"":h({[m+n]:e});t.add(g+n);const{hasChanged:i}=o;return r&&o.add(r),i()},className:g,defaultVariants:l,selector:m,variantProps:f}},N=v(":root",i),R=a({css:(...e)=>{let o,i=[],s=r(null);for(const r of e)if(r===Object(r))if(t in r)for(const e of r[t])i.push(e),n(s,e.defaultVariants);else i.push(o=P(r)),n(s,o.defaultVariants);return o=o||P({}),a((e=>{const{css:n,...l}=Object(e),d=new Set;let g,p=!1;for(const e of i)p=e.apply(l,d,s)||p;n===Object(n)&&(g=o.inline(n,d)),(p||g)&&E();for(const e in o.variantProps)c.has(e)||delete l[e];"className"in l&&String(l.className).split(/\s+/).forEach(d.add,d);const m=b(d);return l.className=m.join(" "),a(r(null),"className",{get[t](){return i},className:l.className,props:l,selector:o.selector})}),"className",{get[t](){return i},get className(){return o.apply()&&E(),o.className},selector:o.selector})},config:m,global:O,keyframes:e=>{const t=$(d,e);return O({["@keyframes "+t]:e},t)},prefix:d,reset:()=>(u.clear(),S.clear(),y.clear(),w.clear(),N.className,R),theme:n(v,N),get cssText(){return I},getCssString:()=>I},"cssText",{});return R},O=()=>O.config||(O.config=v()),P=(...e)=>O().css(...e),N=(...e)=>O().global(...e),R=(...e)=>O().keyframes(...e);globalThis.stitches={createCss:v,css:P,defaultThemeMap:x,global:N,keyframes:R}})() | ||
(()=>{var{toPrimitive:e}=Symbol,t=Symbol.for("sxs.composers"),{assign:n,create:r,defineProperties:o,getOwnPropertyDescriptors:i}=Object,a=(t,r,a)=>n(o(t,i(a)),{[e]:()=>t[r],toString:()=>t[r]}),s=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),l=(e,t)=>e.reduce(((e,n)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(n)&&/&[^]*&/.test(e)?`:is(${n})`:n):n+" "+e))),e)),[]),c=/\s*,\s*(?![^()]*\))/,d=/(-columns|(^|[^e]-)padding|[^t]-spacing|l-align|rows|(^|(^border|[dkmnptx]|le|ne)-)width|^border|tom|[ek]-start|(o|[^e]-du)ration|us|(^|[^tv]-)left|(^|-)top|tance|rgin|e-offset|(er|g|n|t)-block|(^|[^tv]-)right|basis|[gnt]-inline|gap|(^|[^e]-)height|ness|(^|[^p]-)inset|[ek]-end|elay|tline|ve|dent|-rotate|n-rule|(c|ck|d|ne|t)-size)$/,g=/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,p=/\s+(?![^()]*\))/,m=e=>t=>e(..."string"==typeof t?String(t).split(p):[t]),h=/([\d.]+)([^]*)/,u={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:/^([^]*["'][^]*|[A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:m(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:m(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:m(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:m(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:m(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:m(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},f=e=>{const{media:t,themeMap:n,utils:r}=e;let o,i,a,p;return m=>((e,t)=>{const n=new WeakSet;let r,o;const i=(e,a,d)=>{let g="";e:for(let p in e){const m=64===p.charCodeAt(0);for(const h of m?[].concat(e[p]):[e[p]]){if("function"==typeof t&&(p!==r||h!==o)){const n=t(p,h,e);if(null!==n){r=p,o=h,g+=n===Object(n)?i(n,a,d):null==n?"":n;continue e}}const m=64===p.charCodeAt(0);if(h!==Object(h)||"length"in h){for(let e=0;e<d.length;++e)n.has(d[e])||(n.add(d[e]),g+=d[e]+"{");a.length&&!n.has(a)&&(n.add(a),g+=a+"{");for(const e of/^@import/i.test(p)?[].concat(h):[h])g+=(m?p+" ":s(p)+":")+String(e)+";"}else{n.has(a)&&(n.delete(a),g+="}");const e=Object(p),t=m?a:a.length?l(a,p.split(c)):p.split(c);g+=i(h,t,m?d.concat(e):d),n.has(e)&&(n.delete(e),g+="}"),n.has(t)&&(n.delete(t),g+="}")}}}return g};return i(e,[],[])})(m,((l,c)=>{const m=l.charCodeAt(0),f=64===m?l:/[A-Z]/.test(b=l)?b:b.replace(/-[^]/g,(e=>e[1].toUpperCase()));var b;const S=64===m?l:s(l);if("function"==typeof r[l]){if(r[l]!=a||c!=p)return a=r[l],p=c,a(e)(p)}else if("function"==typeof u[f]&&(u[f]!=a||c!=p))return a=u[f],p=c,a(p);if(p=c,o!=f&&i!=c&&/^((min|max)?((Block|Inline)Size|Height|Width)|height|width)$/.test(f)){o=f,i=c;const e=String(i).replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((e,t,n,r)=>t+("stretch"===n?`-moz-available${r};${S}:${t}-webkit-fill-available`:`-moz-fit-content${r};${S}:${t}fit-content`)+r));if(e!=c)return{[l]:e}}let k=64===m?(l.slice(1)in t?"@media "+t[l.slice(1)]:l).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,n,r,o,i)=>{const a=h.test(t),s=.0625*(a?-1:1),[l,c]=a?[r,t]:[t,r];return"("+("="===n[0]?"":">"===n[0]===a?"max-":"min-")+l+":"+("="!==n[0]&&1===n.length?c.replace(h,((e,t,r)=>Number(t)+s*(">"===n?1:-1)+r)):c)+(o?") and ("+(">"===o[0]?"min-":"max-")+l+":"+(1===o.length?i.replace(h,((e,t,n)=>Number(t)+s*(">"===o?-1:1)+n)):i):"")+")"})):36===m?"-"+l.replace(/\$/g,"-"):l;const y=c===Object(c)?c:c&&"number"==typeof c&&d.test(S)?String(c)+"px":String(c).replace(g,((e,t,r,o,i)=>"$"==o==!!r?e:(t||"--"==o?"calc(":"")+"var("+("$"===o?"--"+(i.includes("$")?"":f in n?n[f]+"-":"")+i.replace(/\$/g,"-"):o+i)+")"+(t||"--"==o?"*"+(t||"")+(r||"1")+")":"")));return c!=y||S!=k?{[k]:y}:null}))},{from:b,isArray:S}=Array,{ownKeys:k}=Reflect,y=class extends Set{toString(){return b(this).join("")}get hasChanged(){const{size:e}=this;return()=>e<this.size}},B=y;y.prototype[e]=y.prototype.toString;var w="colors",C="sizes",I="space",x={gap:I,gridGap:I,columnGap:I,gridColumnGap:I,rowGap:I,gridRowGap:I,inset:I,insetBlock:I,insetBlockEnd:I,insetBlockStart:I,insetInline:I,insetInlineEnd:I,insetInlineStart:I,margin:I,marginTop:I,marginRight:I,marginBottom:I,marginLeft:I,marginBlock:I,marginBlockEnd:I,marginBlockStart:I,marginInline:I,marginInlineEnd:I,marginInlineStart:I,padding:I,paddingTop:I,paddingRight:I,paddingBottom:I,paddingLeft:I,paddingBlock:I,paddingBlockEnd:I,paddingBlockStart:I,paddingInline:I,paddingInlineEnd:I,paddingInlineStart:I,top:I,right:I,bottom:I,left:I,scrollMargin:I,scrollMarginTop:I,scrollMarginRight:I,scrollMarginBottom:I,scrollMarginLeft:I,scrollMarginX:I,scrollMarginY:I,scrollMarginBlock:I,scrollMarginBlockEnd:I,scrollMarginBlockStart:I,scrollMarginInline:I,scrollMarginInlineEnd:I,scrollMarginInlineStart:I,scrollPadding:I,scrollPaddingTop:I,scrollPaddingRight:I,scrollPaddingBottom:I,scrollPaddingLeft:I,scrollPaddingX:I,scrollPaddingY:I,scrollPaddingBlock:I,scrollPaddingBlockEnd:I,scrollPaddingBlockStart:I,scrollPaddingInline:I,scrollPaddingInlineEnd:I,scrollPaddingInlineStart:I,fontSize:"fontSizes",background:w,backgroundColor:w,backgroundImage:w,border:w,borderBlock:w,borderBlockEnd:w,borderBlockStart:w,borderBottom:w,borderBottomColor:w,borderColor:w,borderInline:w,borderInlineEnd:w,borderInlineStart:w,borderLeft:w,borderLeftColor:w,borderRight:w,borderRightColor:w,borderTop:w,borderTopColor:w,caretColor:w,color:w,columnRuleColor:w,fill:w,outline:w,outlineColor:w,stroke:w,textDecorationColor:w,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:C,minBlockSize:C,maxBlockSize:C,inlineSize:C,minInlineSize:C,maxInlineSize:C,width:C,minWidth:C,maxWidth:C,height:C,minHeight:C,maxHeight:C,flexBasis:C,gridTemplateColumns:C,gridTemplateRows:C,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},z=e=>{const t={};for(const n in e)for(const r in e[n])t["$"+n+"-"+r]=String(e[n][r]).replace(/\$[$\w-]+/g,(e=>/[^]\$/.test(e)?e:"$"+n+e));return t},$=(e,t)=>{for(var n=JSON.stringify(t),r=n.length,o=9;r;)o=Math.imul(o^n.charCodeAt(--r),9**9);return e+(o^o>>>9).toString(36).slice(-5)},j=class{constructor(e,t,n){this.value=e,this.token=t,this.scale=n}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+this.scale+"-"+this.token}toString(){return this.computedValue}},E=class extends Array{toString(){return this.join("")}get hasChanged(){const e=String(this);return()=>e!==String(this)}},M=E;E.prototype[e]=E.prototype.toString;var W=e=>{let t=null,r=null,o=null;const i="append"===e.insertionMethod;return e=>{if("object"==typeof document){cancelAnimationFrame(o);const a=(e=>(t||(t=document.head||document.documentElement),r||(r=document.getElementById("stitches")||n(document.createElement("style"),{id:"stitches",textContent:e})),r.parentNode||t[i?"append":"prepend"](r),r.textContent))();a?a!==e&&"complete"==document.readyState&&(o=requestAnimationFrame((()=>r.textContent=e))):r.textContent=e}}},v=e=>{e=Object(e);const o=n({initial:"all"},e.media),i=Object(e.theme),s=Object(e.themeMap||x),l=Object(e.utils),c=new Set([].concat(e.passthru||["as","className"])),d=e.prefix||"sx",g=("function"==typeof e.insertionMethod?e.insertionMethod:W)(e),p="03kze",m={theme:i,media:o,prefix:d,themeMap:s,utils:l},h=f(m),u=new B,S=new B,y=new B,w=new B,C=new B([u,S,y,w]);let I="";const E=()=>{const e=b(C).join("");I!==e&&g(I=e)},v=(e,t)=>{t=e===Object(e)?e:Object(t),e="string"==typeof e?e:"";const n=z(t),o=(e=e||$(d,n)).replace(/^\w/,".$&"),i=e===d+p?"":h({[o]:n}),s=a(r(null),"className",{className:e,selector:o});for(const e in t){s[e]=r(null);for(const n in t[e])s[e][n]=new j(t[e][n],n,e)}return a(s,"className",{get className(){const{hasChanged:t}=S;return S.add(i),t()&&E(),e},selector:o})},O=(e,t="")=>{const n=new B,o=new B;for(const t in e)if(e[t]!==Object(e[t])||k(e[t]).length){const r=h({[t]:e[t]});("@import"===t?n:o).add(r)}const i=a(r(null),"name",{name:t}),s=a((()=>{let e=u.hasChanged,t=y.hasChanged;return n.forEach((e=>{u.add(e)})),o.forEach((e=>{y.add(e)})),(e()||t())&&E(),i}),"name",{get name(){return String(s())}});return s},P=e=>{const t=new B,n=new M,o=new B,i=new B([t,n,o]);let{variants:a,compoundVariants:s,defaultVariants:l,...c}=e;l=Object(l);const g=$(d,e),m="."+g,u=g===d+p?"":h({[m]:c});w.add(i);const f=r(null),b=[],S=[];for(const e in a)for(const t in a[e]){const n=a[e][t];S.push({[e]:t,css:n})}S.push(...s||[]);for(const e in S){const{css:t,...o}=S[e],i=k(o),a=i.length;for(const e of i)f[e]=f[e]||r(null),f[e][o[e]]=!0;const s=(e,r)=>{e={...e};for(const t in r)void 0!==e[t]||Object(f[t])[e[t]]||(e[t]=r[t]);const s=new Set;if(i.length&&i.every((t=>{const n=e[t],r=String(o[t]);if(r===String(n))return!0;if(n===Object(n))for(const e in n)if(r==String(n[e])&&64===e.charCodeAt(0))return s.add(e),!0}))){let e=Object(t);for(const t of s)e={[t]:e};const r=g+$("",e)+"--"+(1===a?i[0]+"-"+o[i[0]]:"c"+a),l=h({["."+r]:e});return(n[a-1]||(n[a-1]=new B)).add(l),r}};b.push(s)}return{apply(e,r,o){const a=t.hasChanged,s=n.hasChanged;if(t.add(u),e){r.add(g);for(const t of b){const n=t(e,o);n&&r.add(n)}}if(a()||s())return w.add(i),!0},inline(e,t){const n=$("-",e),r=g==="-"+n?"":h({[m+n]:e});t.add(g+n);const{hasChanged:i}=o;return r&&o.add(r),i()},className:g,defaultVariants:l,selector:m,variantProps:f}},N=v(":root",i),R=a({css:(...e)=>{let o,i=[],s=r(null);for(const r of e)if(r===Object(r))if(t in r)for(const e of r[t])i.push(e),n(s,e.defaultVariants);else i.push(o=P(r)),n(s,o.defaultVariants);return o=o||P({}),a((e=>{const{css:n,...l}=Object(e),d=new Set;let g,p=!1;for(const e of i)p=e.apply(l,d,s)||p;n===Object(n)&&(g=o.inline(n,d)),(p||g)&&E();for(const e in o.variantProps)c.has(e)||delete l[e];"className"in l&&String(l.className).split(/\s+/).forEach(d.add,d);const m=b(d);return l.className=m.join(" "),a(r(null),"className",{get[t](){return i},className:l.className,props:l,selector:o.selector})}),"className",{get[t](){return i},get className(){return o.apply()&&E(),o.className},selector:o.selector})},config:m,global:O,keyframes:e=>{const t=$(d,e);return O({["@keyframes "+t]:e},t)},prefix:d,reset:()=>(u.clear(),S.clear(),y.clear(),w.clear(),N.className,R),theme:n(v,N),get cssText(){return I},getCssString:()=>I},"cssText",{});return R},O=()=>O.config||(O.config=v()),P=(...e)=>O().css(...e),N=(...e)=>O().global(...e),R=(...e)=>O().keyframes(...e);globalThis.stitches={createCss:v,css:P,defaultThemeMap:x,global:N,keyframes:R}})() | ||
//# sourceMappingUrl=index.map |
{ | ||
"name": "@stitches/core", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "The modern CSS-in-JS library", | ||
@@ -65,3 +65,3 @@ "type": "module", | ||
], | ||
"gitHead": "bb85b2106de7e0d7ad954079dcc111640d3f0339" | ||
"gitHead": "f39deeb0f31d952edd68b4f6cca5273b50eeb61e" | ||
} |
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
386921