@stitches/core
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -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)),[]),{isArray:c}=Array,{from:d}=Array,{prototype:{toString:g}}=Object,p=/\s*,\s*(?![^()]*\))/,h=/(-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)$/,m=/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,f=/\s+(?![^()]*\))/,u=e=>t=>e(..."string"==typeof t?String(t).split(f):[t]),b=/([\d.]+)([^]*)/,S={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak: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:u(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:u(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:u(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:u(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:u(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:u(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},k=e=>{const{media:t,prefix:n,themeMap:r,utils:o}=e;let i,a,d,f;return u=>((e,t)=>{const n=new WeakSet,r=(e,o,i,a,d)=>{let h="";e:for(const m in e){const f=64===m.charCodeAt(0);for(const u of f&&c(e[m])?e[m]:[e[m]]){if(t&&(m!==a||u!==d)){const n=t(m,u,e);if(null!==n){h+="object"==typeof n&&n?r(n,o,i,m,u):null==n?"":n;continue e}}if("object"==typeof u&&u&&u.toString===g){n.has(o)&&(n.delete(o),h+="}");const e=Object(m),t=f?o:o.length?l(o,m.split(p)):m.split(p);h+=r(u,t,f?i.concat(e):i),n.has(e)&&(n.delete(e),h+="}"),n.has(t)&&(n.delete(t),h+="}")}else{for(let e=0;e<i.length;++e)n.has(i[e])||(n.add(i[e]),h+=i[e]+"{");o.length&&!n.has(o)&&(n.add(o),h+=o+"{"),h+=(f?m+" ":s(m)+":")+String(u)+";"}}}return h};return r(e,[],[])})(u,((l,c)=>{const g=l.charCodeAt(0),p=64===g?l:/[A-Z]/.test(u=l)?u:u.replace(/-[^]/g,(e=>e[1].toUpperCase()));var u;const k=64===g?l:s(l);if("function"==typeof o[l]){if(o[l]!=d||c!=f)return d=o[l],f=c,d(e)(f)}else if("function"==typeof S[p]&&(S[p]!=d||c!=f))return d=S[p],f=c,d(f);if(f=c,i!=p&&a!=c&&/^((min|max)?((Block|Inline)Size|Height|Width)|height|width)$/.test(p)){i=p,a=c;const e=String(a).replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((e,t,n,r)=>t+("stretch"===n?`-moz-available${r};${k}:${t}-webkit-fill-available`:`-moz-fit-content${r};${k}:${t}fit-content`)+r));if(e!=c)return{[l]:e}}let y=64===g?(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=b.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(b,((e,t,r)=>Number(t)+s*(">"===n?1:-1)+r)):c)+(o?") and ("+(">"===o[0]?"min-":"max-")+l+":"+(1===o.length?i.replace(b,((e,t,n)=>Number(t)+s*(">"===o?-1:1)+n)):i):"")+")"})):36===g?"--"+n+l.replace(/\$/g,"-"):l;const B="object"==typeof c&&c?c:c&&"number"==typeof c&&h.test(k)?String(c)+"px":String(c).replace(m,((e,t,o,i,a)=>"$"==i==!!o?e:(t||"--"==i?"calc(":"")+"var("+("$"===i?"--"+n+"-"+(a.includes("$")?"":p in r?r[p]+"-":"")+a.replace(/\$/g,"-"):i+a)+")"+(t||"--"==i?"*"+(t||"")+(o||"1")+")":"")));return c!=B||k!=y?{[y]:B}:null}))},{ownKeys:y}=Reflect,B=class extends Set{toString(){return d(this).join("")}get hasChanged(){const{size:e}=this;return()=>e<this.size}},w=B;B.prototype[e]=B.prototype.toString;var x="colors",I="sizes",C="space",z={gap:C,gridGap:C,columnGap:C,gridColumnGap:C,rowGap:C,gridRowGap:C,inset:C,insetBlock:C,insetBlockEnd:C,insetBlockStart:C,insetInline:C,insetInlineEnd:C,insetInlineStart:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockEnd:C,marginBlockStart:C,marginInline:C,marginInlineEnd:C,marginInlineStart:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockEnd:C,paddingBlockStart:C,paddingInline:C,paddingInlineEnd:C,paddingInlineStart:C,top:C,right:C,bottom:C,left:C,scrollMargin:C,scrollMarginTop:C,scrollMarginRight:C,scrollMarginBottom:C,scrollMarginLeft:C,scrollMarginX:C,scrollMarginY:C,scrollMarginBlock:C,scrollMarginBlockEnd:C,scrollMarginBlockStart:C,scrollMarginInline:C,scrollMarginInlineEnd:C,scrollMarginInlineStart:C,scrollPadding:C,scrollPaddingTop:C,scrollPaddingRight:C,scrollPaddingBottom:C,scrollPaddingLeft:C,scrollPaddingX:C,scrollPaddingY:C,scrollPaddingBlock:C,scrollPaddingBlockEnd:C,scrollPaddingBlockStart:C,scrollPaddingInline:C,scrollPaddingInlineEnd:C,scrollPaddingInlineStart:C,fontSize:"fontSizes",background:x,backgroundColor:x,backgroundImage:x,border:x,borderBlock:x,borderBlockEnd:x,borderBlockStart:x,borderBottom:x,borderBottomColor:x,borderColor:x,borderInline:x,borderInlineEnd:x,borderInlineStart:x,borderLeft:x,borderLeftColor:x,borderRight:x,borderRightColor:x,borderTop:x,borderTopColor:x,caretColor:x,color:x,columnRuleColor:x,fill:x,outline:x,outlineColor:x,stroke:x,textDecorationColor:x,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:I,minBlockSize:I,maxBlockSize:I,inlineSize:I,minInlineSize:I,maxInlineSize:I,width:I,minWidth:I,maxWidth:I,height:I,minHeight:I,maxHeight:I,flexBasis:I,gridTemplateColumns:I,gridTemplateRows:I,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"},j=(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)},v=e=>e?"-"+e:"",$=class{constructor(e,t,n="",r=""){this.value=e,this.token=t,this.scale=n,this.prefix=r}get computedValue(){return"var("+this.variable+")"}get variable(){return"-"+v(this.prefix)+v(this.scale)+"-"+this.token}toString(){return this.computedValue}},M=class extends Array{toString(){return this.join("")}get hasChanged(){const e=String(this);return()=>e!==String(this)}},W=M;M.prototype[e]=M.prototype.toString;var E=e=>{let t,r,o,i,a,s=!1;const l="append"===e.insertionMethod?"append":"prepend";return e=>{"object"==typeof document&&(t||(t=document.head||document.documentElement),r||(r=document.getElementById("stitches")||n(document.createElement("style"),{id:"stitches",textContent:e})),o||(o=r.firstChild||new Text,s=!o.data),i||(i=r.insertBefore(new Text,o)),r.isConnected||t[l](r),i.data=e,!s&&e&&(clearTimeout(a),a=setTimeout((()=>{o.remove(),s=!0}),250)))}},P=e=>{const o={};e=o.config="object"==typeof e&&e||{},o.media=n({initial:"all"},e.media),o.theme="object"==typeof e.theme&&e.theme||{},o.themeMap="object"==typeof e.themeMap&&e.themeMap||z,o.utils="object"==typeof e.utils&&e.utils||{};const i=new Set([].concat(e.passthru||["as","className"])),s=o.prefix=e.prefix||"sx",l=("function"==typeof e.insertionMethod?e.insertionMethod:E)(o),c="03kze",g=k(o),p=new w,h=new w,m=new w,f=new w,u=new w([p,h,m,f]);let b="";const S=()=>{const e=d(u).join("");b!==e&&l(b=e)},B=(e,t)=>{t="object"==typeof e&&e||Object(t);const n=(e=(e="string"==typeof e?e:"")||j(s,t)).replace(/^\w/,".$&"),o=a(r(null),"className",{className:e,selector:n}),i={},l=i[n]={};for(const e in t){o[e]=r(null);for(const n in t[e]){let r=String(t[e][n]);r.includes("$")&&(r=r.replace(/\$([$\w-]+)/g,((t,n)=>n.includes("$")?t:"$"+e+t)));const i=o[e][n]=new $(r,n,e,s);l[i.variable]=i.value}}const d=e===s+c?"":g(i);return a(o,"className",{get className(){const{hasChanged:t}=h;return h.add(d),t()&&S(),e},selector:n})},x=(e,t="")=>{const n=new w,o=new w;for(const t in e)if(e[t]!==Object(e[t])||y(e[t]).length){const r=g({[t]:e[t]});("@import"===t?n:o).add(r)}const i=a(r(null),"name",{name:t}),s=a((()=>{let e=p.hasChanged,t=m.hasChanged;return n.forEach((e=>{p.add(e)})),o.forEach((e=>{m.add(e)})),(e()||t())&&S(),i}),"name",{get name(){return String(s())}});return s},I=e=>{const t=new w,n=new W,o=new w,i=new w([t,n,o]);let{variants:a,compoundVariants:l,defaultVariants:d,...p}=e;d=Object(d);const h=j(s,e),m="."+h,u=h===s+c?"":g({[m]:p});f.add(i);const b=r(null),S=[],k=[];for(const e in a)for(const t in a[e]){const n=a[e][t];k.push({[e]:t,css:n})}k.push(...l||[]);for(const e in k){const{css:t,...o}=k[e],i=y(o),a=i.length;for(const e of i)b[e]=b[e]||r(null),b[e][o[e]]=!0;const s=(e,r)=>{e={...e};for(const t in r)void 0!==e[t]||Object(b[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=h+j("",e)+"--"+(1===a?i[0]+"-"+o[i[0]]:"c"+a),l=g({["."+r]:e});return(n[a-1]||(n[a-1]=new w)).add(l),r}};S.push(s)}return{apply(e,r,o){const a=t.hasChanged,s=n.hasChanged;if(t.add(u),e){r.add(h);for(const t of S){const n=t(e,o);n&&r.add(n)}}if(a()||s())return f.add(i),!0},inline(e,t){const n=j("-",e),r=h==="-"+n?"":g({[m+n]:e});t.add(h+n);const{hasChanged:i}=o;return r&&o.add(r),i()},className:h,defaultVariants:d,selector:m,variantProps:b}},C=B(":root",o.theme),v=a({css:(...e)=>{let o,s=[],l=r(null);for(const r of e)if(r===Object(r))if(t in r)for(const e of r[t])s.push(e),n(l,e.defaultVariants);else s.push(o=I(r)),n(l,o.defaultVariants);return o||s.push(o=I({})),a((e=>{const{css:n,...c}=Object(e),g=new Set;let p,h=!1;for(const e of s)h=e.apply(c,g,l)||h;n===Object(n)&&(p=o.inline(n,g)),(h||p)&&S();for(const e in o.variantProps)i.has(e)||delete c[e];"string"==typeof c.className&&c.className.split(/\s+/).forEach(g.add,g);const m=d(g);return c.className=m.join(" "),a(r(null),"className",{get[t](){return s},className:c.className,props:c,selector:o.selector})}),"className",{get[t](){return s},get className(){return o.apply()&&S(),o.className},selector:o.selector})},config:o,global:x,keyframes:e=>{const t=j(s,e);return x({["@keyframes "+t]:e},t)},prefix:s,reset:()=>(p.clear(),h.clear(),m.clear(),f.clear(),C.className,v),theme:n(B,C),get cssText(){return b},getCssString:()=>b},"cssText",{});return v},T=()=>T.config||(T.config=P()),N=(...e)=>T().css(...e),R=(...e)=>T().global(...e),O=(...e)=>T().keyframes(...e);globalThis.stitches={createCss:P,css:N,defaultThemeMap:z,global:R,keyframes:O}})() | ||
(()=>{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)),[]),{isArray:c}=Array,{from:d}=Array,{prototype:{toString:g}}=Object,p=/\s*,\s*(?![^()]*\))/,h=/(-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)$/,m=/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,u=/\s+(?![^()]*\))/,f=e=>t=>e(..."string"==typeof t?String(t).split(u):[t]),b=/([\d.]+)([^]*)/,S={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak: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:f(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:f(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:f(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:f(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:f(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:f(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},k=e=>{const{media:t,prefix:n,themeMap:r,utils:o}=e;let i,a,d,u;return f=>((e,t)=>{const n=new WeakSet,r=(e,o,i,a,d)=>{let h="";e:for(const m in e){const u=64===m.charCodeAt(0);for(const f of u&&c(e[m])?e[m]:[e[m]]){if(t&&(m!==a||f!==d)){const n=t(m,f,e);if(null!==n){h+="object"==typeof n&&n?r(n,o,i,m,f):null==n?"":n;continue e}}if("object"==typeof f&&f&&f.toString===g){n.has(o)&&(n.delete(o),h+="}");const e=Object(m),t=u?o:o.length?l(o,m.split(p)):m.split(p);h+=r(f,t,u?i.concat(e):i),n.has(e)&&(n.delete(e),h+="}"),n.has(t)&&(n.delete(t),h+="}")}else{for(let e=0;e<i.length;++e)n.has(i[e])||(n.add(i[e]),h+=i[e]+"{");o.length&&!n.has(o)&&(n.add(o),h+=o+"{"),h+=(u?m+" ":s(m)+":")+String(f)+";"}}}return h};return r(e,[],[])})(f,((l,c)=>{const g=l.charCodeAt(0),p=64===g?l:/[A-Z]/.test(f=l)?f:f.replace(/-[^]/g,(e=>e[1].toUpperCase()));var f;const k=64===g?l:s(l);if("function"==typeof o[l]){if(o[l]!=d||c!=u)return d=o[l],u=c,d(e)(u)}else if("function"==typeof S[p]&&(S[p]!=d||c!=u))return d=S[p],u=c,d(u);if(u=c,i!=p&&a!=c&&/^((min|max)?((Block|Inline)Size|Height|Width)|height|width)$/.test(p)){i=p,a=c;const e=String(a).replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((e,t,n,r)=>t+("stretch"===n?`-moz-available${r};${k}:${t}-webkit-fill-available`:`-moz-fit-content${r};${k}:${t}fit-content`)+r));if(e!=c)return{[l]:e}}let y=64===g?(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=b.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(b,((e,t,r)=>Number(t)+s*(">"===n?1:-1)+r)):c)+(o?") and ("+(">"===o[0]?"min-":"max-")+l+":"+(1===o.length?i.replace(b,((e,t,n)=>Number(t)+s*(">"===o?-1:1)+n)):i):"")+")"})):36===g?"--"+n+l.replace(/\$/g,"-"):l;const B="object"==typeof c&&c?c:c&&"number"==typeof c&&h.test(k)?String(c)+"px":String(c).replace(m,((e,t,o,i,a)=>"$"==i==!!o?e:(t||"--"==i?"calc(":"")+"var("+("$"===i?"--"+n+"-"+(a.includes("$")?"":p in r?r[p]+"-":"")+a.replace(/\$/g,"-"):i+a)+")"+(t||"--"==i?"*"+(t||"")+(o||"1")+")":"")));return c!=B||k!=y?{[y]:B}:null}))},{ownKeys:y}=Reflect,B=class extends Set{toString(){return d(this).join("")}get hasChanged(){const{size:e}=this;return()=>e<this.size}},w=B;B.prototype[e]=B.prototype.toString;var x="colors",I="sizes",C="space",z={gap:C,gridGap:C,columnGap:C,gridColumnGap:C,rowGap:C,gridRowGap:C,inset:C,insetBlock:C,insetBlockEnd:C,insetBlockStart:C,insetInline:C,insetInlineEnd:C,insetInlineStart:C,margin:C,marginTop:C,marginRight:C,marginBottom:C,marginLeft:C,marginBlock:C,marginBlockEnd:C,marginBlockStart:C,marginInline:C,marginInlineEnd:C,marginInlineStart:C,padding:C,paddingTop:C,paddingRight:C,paddingBottom:C,paddingLeft:C,paddingBlock:C,paddingBlockEnd:C,paddingBlockStart:C,paddingInline:C,paddingInlineEnd:C,paddingInlineStart:C,top:C,right:C,bottom:C,left:C,scrollMargin:C,scrollMarginTop:C,scrollMarginRight:C,scrollMarginBottom:C,scrollMarginLeft:C,scrollMarginX:C,scrollMarginY:C,scrollMarginBlock:C,scrollMarginBlockEnd:C,scrollMarginBlockStart:C,scrollMarginInline:C,scrollMarginInlineEnd:C,scrollMarginInlineStart:C,scrollPadding:C,scrollPaddingTop:C,scrollPaddingRight:C,scrollPaddingBottom:C,scrollPaddingLeft:C,scrollPaddingX:C,scrollPaddingY:C,scrollPaddingBlock:C,scrollPaddingBlockEnd:C,scrollPaddingBlockStart:C,scrollPaddingInline:C,scrollPaddingInlineEnd:C,scrollPaddingInlineStart:C,fontSize:"fontSizes",background:x,backgroundColor:x,backgroundImage:x,border:x,borderBlock:x,borderBlockEnd:x,borderBlockStart:x,borderBottom:x,borderBottomColor:x,borderColor:x,borderInline:x,borderInlineEnd:x,borderInlineStart:x,borderLeft:x,borderLeftColor:x,borderRight:x,borderRightColor:x,borderTop:x,borderTopColor:x,caretColor:x,color:x,columnRuleColor:x,fill:x,outline:x,outlineColor:x,stroke:x,textDecorationColor:x,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:I,minBlockSize:I,maxBlockSize:I,inlineSize:I,minInlineSize:I,maxInlineSize:I,width:I,minWidth:I,maxWidth:I,height:I,minHeight:I,maxHeight:I,flexBasis:I,gridTemplateColumns:I,gridTemplateRows:I,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"},M=(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=e=>e?"-"+e:"",v=class{constructor(e,t,n="",r=""){this.value=e,this.token=t,this.scale=n,this.prefix=r}get computedValue(){return"var("+this.variable+")"}get variable(){return"-"+j(this.prefix)+j(this.scale)+"-"+this.token}toString(){return this.computedValue}},$=class extends Array{toString(){return this.join("")}get hasChanged(){const e=String(this);return()=>e!==String(this)}},W=$;$.prototype[e]=$.prototype.toString;var E=e=>{let t,r,o,i,a,s=!1;const l="append"===e.insertionMethod?"append":"prepend";return e=>{"object"==typeof document&&(t||(t=document.head||document.documentElement),r||(r=document.getElementById("stitches")||n(document.createElement("style"),{id:"stitches",textContent:e})),o||(o=r.firstChild||new Text,s=!o.data),i||(i=r.insertBefore(new Text,o)),r.isConnected||t[l](r),i.data=e,!s&&e&&(clearTimeout(a),a=setTimeout((()=>{o.remove(),s=!0}),250)))}},P=e=>{e="object"==typeof e&&e||{};const o={};o.media=n({initial:"all"},e.media),o.theme="object"==typeof e.theme&&e.theme||{},o.themeMap="object"==typeof e.themeMap&&e.themeMap||z,o.utils="object"==typeof e.utils&&e.utils||{};const i=new Set(e.passthru?[...e.passthru,"as","className"]:["as","className"]),s=o.prefix=e.prefix||"sx";o.insertionMethod=e.insertionMethod||"prepend";const l=("function"==typeof o.insertionMethod?o.insertionMethod:E)(o),c="03kze",g=k(o),p=new w,h=new w,m=new w,u=new w,f=new w([p,h,m,u]);let b="";const S=()=>{const e=d(f).join("");b!==e&&l(b=e)},B=(e,t)=>{t="object"==typeof e&&e||Object(t);const n=(e=(e="string"==typeof e?e:"")||M(s,t)).replace(/^\w/,".$&"),o=a(r(null),"className",{className:e,selector:n}),i={},l=i[n]={};for(const e in t){o[e]=r(null);for(const n in t[e]){let r=String(t[e][n]);r.includes("$")&&(r=r.replace(/\$([$\w-]+)/g,((t,n)=>n.includes("$")?t:"$"+e+t)));const i=o[e][n]=new v(r,n,e,s);l[i.variable]=i.value}}const d=e===s+c?"":g(i);return a(o,"className",{get className(){const{hasChanged:t}=h;return h.add(d),t()&&S(),e},selector:n})},x=(e,t="")=>{const n=new w,o=new w;for(const t in e)if(e[t]!==Object(e[t])||y(e[t]).length){const r=g({[t]:e[t]});("@import"===t?n:o).add(r)}const i=a(r(null),"name",{name:t}),s=a((()=>{let e=p.hasChanged,t=m.hasChanged;return n.forEach((e=>{p.add(e)})),o.forEach((e=>{m.add(e)})),(e()||t())&&S(),i}),"name",{get name(){return String(s())}});return s},I=e=>{const t=new w,n=new W,o=new w,i=new w([t,n,o]);let{variants:a,compoundVariants:l,defaultVariants:d,...p}=e;d=Object(d);const h=M(s,e),m="."+h,f=h===s+c?"":g({[m]:p});u.add(i);const b=r(null),S=[],k=[];for(const e in a)for(const t in a[e]){const n=a[e][t];k.push({[e]:t,css:n})}k.push(...l||[]);for(const e in k){const{css:t,...o}=k[e],i=y(o),a=i.length;for(const e of i)b[e]=b[e]||r(null),b[e][o[e]]=!0;const s=(e,r)=>{e={...e};for(const t in r)void 0!==e[t]||Object(b[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=h+M("",e)+"--"+(1===a?i[0]+"-"+o[i[0]]:"c"+a),l=g({["."+r]:e});return(n[a-1]||(n[a-1]=new w)).add(l),r}};S.push(s)}return{apply(e,r,o){const a=t.hasChanged,s=n.hasChanged;if(t.add(f),e){r.add(h);for(const t of S){const n=t(e,o);n&&r.add(n)}}if(a()||s())return u.add(i),!0},inline(e,t){const n=M("-",e),r=h==="-"+n?"":g({[m+n]:e});t.add(h+n);const{hasChanged:i}=o;return r&&o.add(r),i()},className:h,defaultVariants:d,selector:m,variantProps:b}},C=B(":root",o.theme),j=a({css:(...e)=>{let o,s=[],l=r(null);for(const r of e)if(r===Object(r))if(t in r)for(const e of r[t])s.push(e),n(l,e.defaultVariants);else s.push(o=I(r)),n(l,o.defaultVariants);return o||s.push(o=I({})),a((e=>{const{css:n,...c}=Object(e),g=new Set;let p,h=!1;for(const e of s)h=e.apply(c,g,l)||h;n===Object(n)&&(p=o.inline(n,g)),(h||p)&&S();for(const e in o.variantProps)i.has(e)||delete c[e];"string"==typeof c.className&&c.className.split(/\s+/).forEach(g.add,g);const m=d(g);return c.className=m.join(" "),a(r(null),"className",{get[t](){return s},className:c.className,props:c,selector:o.selector})}),"className",{get[t](){return s},get className(){return o.apply()&&S(),o.className},selector:o.selector})},config:o,global:x,keyframes:e=>{const t=M(s,e);return x({["@keyframes "+t]:e},t)},prefix:s,reset:()=>(p.clear(),h.clear(),m.clear(),u.clear(),C.className,j),theme:n(B,C),get cssText(){return b},getCssString:()=>b},"cssText",{});return j},N=()=>N.config||(N.config=P()),T=(...e)=>N().css(...e),R=(...e)=>N().global(...e),O=(...e)=>N().keyframes(...e);globalThis.stitches={createCss:P,css:T,defaultThemeMap:z,global:R,keyframes:O}})() | ||
//# sourceMappingUrl=index.map |
{ | ||
"name": "@stitches/core", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "The modern CSS-in-JS library", | ||
@@ -70,3 +70,3 @@ "type": "module", | ||
], | ||
"gitHead": "969def5aea830339d9d019985bfaa6f997a6e596" | ||
"gitHead": "be11e9f498fbe7421f9fdf793c90930959208e16" | ||
} |
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
Sorry, the diff of this file is too big to display
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
389220