Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stitches/core

Package Overview
Dependencies
Maintainers
3
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stitches/core - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

2

dist/index.iife.js

@@ -1,2 +0,2 @@

(()=>{var{toPrimitive:e}=Symbol,t=Symbol.for("sxs.composers"),{assign:n,create:r,defineProperties:i,getOwnPropertyDescriptors:o}=Object,a=(t,r,a)=>n(i(t,o(a)),{[e]:()=>t[r],toString:()=>t[r]}),l=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),s=(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:d}=Array,{from:c}=Array,{prototype:{toString:g}}=Object,p=/\s*,\s*(?![^()]*\))/,m=/([\d.]+)([^]*)/,h={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},u={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},b=/\s+(?![^()]*\))/,f=e=>t=>e(..."string"==typeof t?String(t).split(b):[t]),S=JSON.stringify,k={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([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})))},B=e=>{let t,n,r,i;const o={},a="sx"===e.prefix?"":"--"+e.prefix;return c=>{const b=S(c);return b in o?o[b]:o[b]=((e,t)=>{const n=new WeakSet,r=(e,i,o,a,c)=>{let m="";e:for(const h in e){const u=64===h.charCodeAt(0);for(const b of u&&d(e[h])?e[h]:[e[h]]){if(t&&(h!==a||b!==c)){const n=t(h,b,e);if(null!==n){m+="object"==typeof n&&n?r(n,i,o,h,b):null==n?"":n;continue e}}if("object"==typeof b&&b&&b.toString===g){n.has(i)&&(n.delete(i),m+="}");const e=Object(h),t=u?i:i.length?s(i,h.split(p)):h.split(p);m+=r(b,t,u?o.concat(e):o),n.has(e)&&(n.delete(e),m+="}"),n.has(t)&&(n.delete(t),m+="}")}else{for(let e=0;e<o.length;++e)n.has(o[e])||(n.add(o[e]),m+=o[e]+"{");i.length&&!n.has(i)&&(n.add(i),m+=i+"{"),m+=(u?h+" ":l(h)+":")+String(b)+";"}}}return m};return r(e,[],[])})(c,((o,s)=>{const d=o.charCodeAt(0),c=64===d?o:/[A-Z]/.test(g=o)?g:g.replace(/-[^]/g,(e=>e[1].toUpperCase()));var g;const p=64===d?o:l(o);if("function"==typeof e.utils[o]){if(e.utils[o]!=r||s!=i)return r=e.utils[o],i=s,r(e)(i)}else if("function"==typeof k[c]&&(k[c]!=r||s!=i))return r=k[c],i=s,r(i);if(i=s,t!=c&&n!=s&&p in h){t=c,n=s;const e=((e,t)=>t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,n,r,i)=>n+("stretch"===r?`-moz-available${i};${e}:${n}-webkit-fill-available`:`-moz-fit-content${i};${e}:${n}fit-content`)+i)))(p,String(n));if(e!=s)return{[o]:e}}let b=64===d?(o.slice(1)in e.media?"@media "+e.media[o.slice(1)]:o).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,n,r,i,o)=>{const a=m.test(t),l=.0625*(a?-1:1),[s,d]=a?[r,t]:[t,r];return"("+("="===n[0]?"":">"===n[0]===a?"max-":"min-")+s+":"+("="!==n[0]&&1===n.length?d.replace(m,((e,t,r)=>Number(t)+l*(">"===n?1:-1)+r)):d)+(i?") and ("+(">"===i[0]?"min-":"max-")+s+":"+(1===i.length?o.replace(m,((e,t,n)=>Number(t)+l*(">"===i?-1:1)+n)):o):"")+")"})):36===d?a+o.replace(/\$/g,"-"):o;const f="object"==typeof s&&s?s:"number"==typeof s&&s&&c in u?String(s)+"px":((e,t,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((t,r,i,o,a)=>"$"==o==!!i?t:(r||"--"==o?"calc(":"")+"var("+("$"===o?"--"+n.prefix+"-"+(a.includes("$")?"":e in n.themeMap?n.themeMap[e]+"-":"")+a.replace(/\$/g,"-"):o+a)+")"+(r||"--"==o?"*"+(r||"")+(i||"1")+")":""))))(c,String(s),e);return s!=f||p!=b?{[b]:f}:null}))}},{ownKeys:I}=Reflect,y=class extends Set{toString(){return c(this).join("")}get hasChanged(){const{size:e}=this;return()=>e<this.size}},x=y;y.prototype[e]=y.prototype.toString;var w="colors",z="sizes",W="space",E={gap:W,gridGap:W,columnGap:W,gridColumnGap:W,rowGap:W,gridRowGap:W,inset:W,insetBlock:W,insetBlockEnd:W,insetBlockStart:W,insetInline:W,insetInlineEnd:W,insetInlineStart:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,marginBlock:W,marginBlockEnd:W,marginBlockStart:W,marginInline:W,marginInlineEnd:W,marginInlineStart:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,paddingBlock:W,paddingBlockEnd:W,paddingBlockStart:W,paddingInline:W,paddingInlineEnd:W,paddingInlineStart:W,top:W,right:W,bottom:W,left:W,scrollMargin:W,scrollMarginTop:W,scrollMarginRight:W,scrollMarginBottom:W,scrollMarginLeft:W,scrollMarginX:W,scrollMarginY:W,scrollMarginBlock:W,scrollMarginBlockEnd:W,scrollMarginBlockStart:W,scrollMarginInline:W,scrollMarginInlineEnd:W,scrollMarginInlineStart:W,scrollPadding:W,scrollPaddingTop:W,scrollPaddingRight:W,scrollPaddingBottom:W,scrollPaddingLeft:W,scrollPaddingX:W,scrollPaddingY:W,scrollPaddingBlock:W,scrollPaddingBlockEnd:W,scrollPaddingBlockStart:W,scrollPaddingInline:W,scrollPaddingInlineEnd:W,scrollPaddingInlineStart:W,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:z,minBlockSize:z,maxBlockSize:z,inlineSize:z,minInlineSize:z,maxInlineSize:z,width:z,minWidth:z,maxWidth:z,height:z,minHeight:z,maxHeight:z,flexBasis:z,gridTemplateColumns:z,gridTemplateRows:z,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"},R=(e,t)=>{for(var n=JSON.stringify(t),r=n.length,i=9;r;)i=Math.imul(i^n.charCodeAt(--r),9**9);return e+(i^i>>>9).toString(36).slice(-5)},M=e=>e?"-"+e:"",C=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"-"+M(this.prefix)+M(this.scale)+"-"+this.token}toString(){return this.computedValue}},P=class extends Array{toString(){return this.join("")}get hasChanged(){const e=String(this);return()=>e!==String(this)}},T=P;P.prototype[e]=P.prototype.toString;var v=e=>{let t,r,i,o,a,l=!1;const s="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})),i||(i=r.firstChild||new Text,l=!i.data),o||(o=r.insertBefore(new Text,i)),r.isConnected||t[s](r),o.data=e,!l&&e&&(clearTimeout(a),a=setTimeout((()=>{i.remove(),l=!0}),250)))}},j=e=>{e="object"==typeof e&&e||{};const i={};i.media=n({initial:"all"},e.media),i.theme="object"==typeof e.theme&&e.theme||{},i.themeMap="object"==typeof e.themeMap&&e.themeMap||E,i.utils="object"==typeof e.utils&&e.utils||{};const o=new Set(e.passthru?[...e.passthru,"as","className"]:["as","className"]),l=i.prefix=e.prefix||"sx";i.insertionMethod=e.insertionMethod||"prepend";const s=("function"==typeof i.insertionMethod?i.insertionMethod:v)(i),d="03kze",g=B(i),p=new x,m=new x,h=new x,u=new x,b=new x([p,m,h,u]);let f="";const S=()=>{const e=c(b).join("");f!==e&&s(f=e)},k=(e,t)=>{t="object"==typeof e&&e||Object(t);const n="root"!==(e="string"==typeof e?e:""),i=(n?".":":root,.")+(e=n&&e||R(l,t)),o=a(r(null),"className",{className:e,selector:i}),s={},c=s[i]={};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 C(r,n,e,l);c[i.variable]=i.value}}const p=e===l+d?"":g(s);return a(o,"className",{get className(){const{hasChanged:t}=m;return m.add(p),t()&&S(),e},selector:i})},y=(e,t="")=>{const n=new x,i=new x;for(const t in e)if(e[t]!==Object(e[t])||I(e[t]).length){const r=g({[t]:e[t]});("@import"===t?n:i).add(r)}const o=a(r(null),"name",{name:t}),l=a((()=>{let e=p.hasChanged,t=h.hasChanged;return n.forEach((e=>{p.add(e)})),i.forEach((e=>{h.add(e)})),(e()||t())&&S(),o}),"name",{get name(){return String(l())}});return l},w=e=>{const t=new x,n=new T,i=new x,o=new x([t,n,i]);let{variants:a,compoundVariants:s,defaultVariants:c,...p}=e;c=Object(c);const m=R(l,e),h="."+m,b=m===l+d?"":g({[h]:p});u.add(o);const f=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(...s||[]);for(const e in k){const{css:t,...i}=k[e],o=I(i),a=o.length;for(const e of o)f[e]=f[e]||r(null),f[e][i[e]]=!0;const l=(e,r)=>{e={...e};for(const t in r)void 0!==e[t]||Object(f[t])[e[t]]||(e[t]=r[t]);const l=new Set;if(o.length&&o.every((t=>{const n=e[t],r=String(i[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 l.add(e),!0}))){let e=Object(t);for(const t of l)e={[t]:e};const r=m+R("",e)+"--"+(1===a?o[0]+"-"+i[o[0]]:"c"+a),s=g({["."+r]:e});return(n[a-1]||(n[a-1]=new x)).add(s),r}};S.push(l)}return{apply(e,r,i){const a=t.hasChanged,l=n.hasChanged;if(t.add(b),e){r.add(m);for(const t of S){const n=t(e,i);n&&r.add(n)}}if(a()||l())return u.add(o),!0},inline(e,t){const n=R("-",e),r=m==="-"+n?"":g({[h+n]:e});t.add(m+n);const{hasChanged:o}=i;return r&&i.add(r),o()},className:m,defaultVariants:c,selector:h,variantProps:f}},z=k("root",i.theme),W=a({css:(...e)=>{let i,l=[],s=r(null);for(const r of e)if(r===Object(r))if(t in r)for(const e of r[t])l.push(e),n(s,e.defaultVariants);else l.push(i=w(r)),n(s,i.defaultVariants);return i||l.push(i=w({})),a((e=>{const{css:n,...d}=Object(e),g=new Set;let p,m=!1;for(const e of l)m=e.apply(d,g,s)||m;n===Object(n)&&(p=i.inline(n,g)),(m||p)&&S();for(const e in i.variantProps)o.has(e)||delete d[e];void 0!==d.className&&String(d.className).split(/\s+/).forEach(g.add,g);const h=c(g);return d.className=h.join(" "),a(r(null),"className",{get[t](){return l},className:d.className,props:d,selector:i.selector})}),"className",{get[t](){return l},get className(){return i.apply()&&S(),i.className},selector:i.selector})},config:i,global:y,keyframes:e=>{const t=R(l,e);return y({["@keyframes "+t]:e},t)},prefix:l,reset:()=>(p.clear(),m.clear(),h.clear(),u.clear(),z.className,W),theme:n(k,z),get cssText(){return f},getCssString:()=>f},"cssText",{});return W},$=()=>$.config||($.config=j()),N=(...e)=>$().css(...e),L=(...e)=>$().global(...e),O=(...e)=>$().keyframes(...e);globalThis.stitches={createCss:j,css:N,defaultThemeMap:E,global:L,keyframes:O}})()
(()=>{var{toPrimitive:e}=Symbol,t=Symbol.for("sxs.composers"),{assign:n,create:r,defineProperties:i,getOwnPropertyDescriptors:o}=Object,a=(t,r,a)=>n(i(t,o(a)),{[e]:()=>t[r],toString:()=>t[r]}),l=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),s=(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:d}=Array,{from:c}=Array,{prototype:{toString:g}}=Object,p=/\s*,\s*(?![^()]*\))/,m=/([\d.]+)([^]*)/,h={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},u={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},b=/\s+(?![^()]*\))/,f=e=>t=>e(..."string"==typeof t?String(t).split(b):[t]),S=JSON.stringify,k={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([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})))},B=e=>{let t,n,r,i;const o={};return a=>{const c=S(a);return c in o?o[c]:o[c]=((e,t)=>{const n=new WeakSet,r=(e,i,o,a,c)=>{let m="";e:for(const h in e){const u=64===h.charCodeAt(0);for(const b of u&&d(e[h])?e[h]:[e[h]]){if(t&&(h!==a||b!==c)){const n=t(h,b,e);if(null!==n){m+="object"==typeof n&&n?r(n,i,o,h,b):null==n?"":n;continue e}}if("object"==typeof b&&b&&b.toString===g){n.has(i)&&(n.delete(i),m+="}");const e=Object(h),t=u?i:i.length?s(i,h.split(p)):h.split(p);m+=r(b,t,u?o.concat(e):o),n.has(e)&&(n.delete(e),m+="}"),n.has(t)&&(n.delete(t),m+="}")}else{for(let e=0;e<o.length;++e)n.has(o[e])||(n.add(o[e]),m+=o[e]+"{");i.length&&!n.has(i)&&(n.add(i),m+=i+"{"),m+=(u?h+" ":l(h)+":")+String(b)+";"}}}return m};return r(e,[],[])})(a,((o,a)=>{const s=o.charCodeAt(0),d=64===s?o:/[A-Z]/.test(c=o)?c:c.replace(/-[^]/g,(e=>e[1].toUpperCase()));var c;const g=64===s?o:l(o);if("function"==typeof e.utils[o]){if(e.utils[o]!=r||a!=i)return r=e.utils[o],i=a,r(e)(i)}else if("function"==typeof k[d]&&(k[d]!=r||a!=i))return r=k[d],i=a,r(i);if(i=a,t!=d&&n!=a&&g in h){t=d,n=a;const e=((e,t)=>t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,n,r,i)=>n+("stretch"===r?`-moz-available${i};${e}:${n}-webkit-fill-available`:`-moz-fit-content${i};${e}:${n}fit-content`)+i)))(g,String(n));if(e!=a)return{[o]:e}}let p=64===s?(o.slice(1)in e.media?"@media "+e.media[o.slice(1)]:o).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,n,r,i,o)=>{const a=m.test(t),l=.0625*(a?-1:1),[s,d]=a?[r,t]:[t,r];return"("+("="===n[0]?"":">"===n[0]===a?"max-":"min-")+s+":"+("="!==n[0]&&1===n.length?d.replace(m,((e,t,r)=>Number(t)+l*(">"===n?1:-1)+r)):d)+(i?") and ("+(">"===i[0]?"min-":"max-")+s+":"+(1===i.length?o.replace(m,((e,t,n)=>Number(t)+l*(">"===i?-1:1)+n)):o):"")+")"})):36===s?("sx"===e.prefix?"-":"--"+e.prefix)+o.replace(/\$/g,"-"):o;const b="object"==typeof a&&a?a:"number"==typeof a&&a&&d in u?String(a)+"px":((e,t,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((t,r,i,o,a)=>"$"==o==!!i?t:(r||"--"==o?"calc(":"")+"var("+("$"===o?("sx"===n.prefix?"-":"--"+n.prefix)+"-"+(a.includes("$")?"":e in n.themeMap?n.themeMap[e]+"-":"")+a.replace(/\$/g,"-"):o+a)+")"+(r||"--"==o?"*"+(r||"")+(i||"1")+")":""))))(d,String(a),e);return a!=b||g!=p?{[p]:b}:null}))}},{ownKeys:I}=Reflect,y=class extends Set{toString(){return c(this).join("")}get hasChanged(){const{size:e}=this;return()=>e<this.size}},x=y;y.prototype[e]=y.prototype.toString;var w="colors",z="sizes",W="space",E={gap:W,gridGap:W,columnGap:W,gridColumnGap:W,rowGap:W,gridRowGap:W,inset:W,insetBlock:W,insetBlockEnd:W,insetBlockStart:W,insetInline:W,insetInlineEnd:W,insetInlineStart:W,margin:W,marginTop:W,marginRight:W,marginBottom:W,marginLeft:W,marginBlock:W,marginBlockEnd:W,marginBlockStart:W,marginInline:W,marginInlineEnd:W,marginInlineStart:W,padding:W,paddingTop:W,paddingRight:W,paddingBottom:W,paddingLeft:W,paddingBlock:W,paddingBlockEnd:W,paddingBlockStart:W,paddingInline:W,paddingInlineEnd:W,paddingInlineStart:W,top:W,right:W,bottom:W,left:W,scrollMargin:W,scrollMarginTop:W,scrollMarginRight:W,scrollMarginBottom:W,scrollMarginLeft:W,scrollMarginX:W,scrollMarginY:W,scrollMarginBlock:W,scrollMarginBlockEnd:W,scrollMarginBlockStart:W,scrollMarginInline:W,scrollMarginInlineEnd:W,scrollMarginInlineStart:W,scrollPadding:W,scrollPaddingTop:W,scrollPaddingRight:W,scrollPaddingBottom:W,scrollPaddingLeft:W,scrollPaddingX:W,scrollPaddingY:W,scrollPaddingBlock:W,scrollPaddingBlockEnd:W,scrollPaddingBlockStart:W,scrollPaddingInline:W,scrollPaddingInlineEnd:W,scrollPaddingInlineStart:W,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:z,minBlockSize:z,maxBlockSize:z,inlineSize:z,minInlineSize:z,maxInlineSize:z,width:z,minWidth:z,maxWidth:z,height:z,minHeight:z,maxHeight:z,flexBasis:z,gridTemplateColumns:z,gridTemplateRows:z,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"},R=(e,t)=>{for(var n=JSON.stringify(t),r=n.length,i=9;r;)i=Math.imul(i^n.charCodeAt(--r),9**9);return e+(i^i>>>9).toString(36).slice(-5)},M=e=>e?"-"+e:"",C=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"-"+M(this.prefix)+M(this.scale)+"-"+this.token}toString(){return this.computedValue}},P=class extends Array{toString(){return this.join("")}get hasChanged(){const e=String(this);return()=>e!==String(this)}},T=P;P.prototype[e]=P.prototype.toString;var v=e=>{let t,r,i,o,a,l=!1;const s="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})),i||(i=r.firstChild||new Text,l=!i.data),o||(o=r.insertBefore(new Text,i)),r.isConnected||t[s](r),o.data=e,!l&&e&&(clearTimeout(a),a=setTimeout((()=>{i.remove(),l=!0}),250)))}},j=e=>{e="object"==typeof e&&e||{};const i={};i.media=n({initial:"all"},e.media),i.theme="object"==typeof e.theme&&e.theme||{},i.themeMap="object"==typeof e.themeMap&&e.themeMap||E,i.utils="object"==typeof e.utils&&e.utils||{};const o=new Set(e.passthru?[...e.passthru,"as","className"]:["as","className"]),l=i.prefix=e.prefix||"sx";i.insertionMethod=e.insertionMethod||"prepend";const s=("function"==typeof i.insertionMethod?i.insertionMethod:v)(i),d="03kze",g=B(i),p=new x,m=new x,h=new x,u=new x,b=new x([p,m,h,u]);let f="";const S=()=>{const e=c(b).join("");f!==e&&s(f=e)},k=(e,t)=>{t="object"==typeof e&&e||Object(t);const n="root"!==(e="string"==typeof e?e:""),i=(n?".":":root,.")+(e=n&&e||R(l,t)),o=a(r(null),"className",{className:e,selector:i}),s={},c=s[i]={};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 C(r,n,e,"sx"===l?"":l);c[i.variable]=i.value}}const p=e===l+d?"":g(s);return a(o,"className",{get className(){const{hasChanged:t}=m;return m.add(p),t()&&S(),e},selector:i})},y=(e,t="")=>{const n=new x,i=new x;for(const t in e)if(e[t]!==Object(e[t])||I(e[t]).length){const r=g({[t]:e[t]});("@import"===t?n:i).add(r)}const o=a(r(null),"name",{name:t}),l=a((()=>{let e=p.hasChanged,t=h.hasChanged;return n.forEach((e=>{p.add(e)})),i.forEach((e=>{h.add(e)})),(e()||t())&&S(),o}),"name",{get name(){return String(l())}});return l},w=e=>{const t=new x,n=new T,i=new x,o=new x([t,n,i]);let{variants:a,compoundVariants:s,defaultVariants:c,...p}=e;c=Object(c);const m=R(l,e),h="."+m,b=m===l+d?"":g({[h]:p});u.add(o);const f=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(...s||[]);for(const e in k){const{css:t,...i}=k[e],o=I(i),a=o.length;for(const e of o)f[e]=f[e]||r(null),f[e][i[e]]=!0;const l=(e,r)=>{e={...e};for(const t in r)void 0!==e[t]||Object(f[t])[e[t]]||(e[t]=r[t]);const l=new Set;if(o.length&&o.every((t=>{const n=e[t],r=String(i[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 l.add(e),!0}))){let e=Object(t);for(const t of l)e={[t]:e};const r=m+R("",e)+"--"+(1===a?o[0]+"-"+i[o[0]]:"c"+a),s=g({["."+r]:e});return(n[a-1]||(n[a-1]=new x)).add(s),r}};S.push(l)}return{apply(e,r,i){const a=t.hasChanged,l=n.hasChanged;if(t.add(b),e){r.add(m);for(const t of S){const n=t(e,i);n&&r.add(n)}}if(a()||l())return u.add(o),!0},inline(e,t){const n=R("-",e),r=m==="-"+n?"":g({[h+n]:e});t.add(m+n);const{hasChanged:o}=i;return r&&i.add(r),o()},className:m,defaultVariants:c,selector:h,variantProps:f}},z=k("root",i.theme),W=a({css:(...e)=>{let i,l=[],s=r(null);for(const r of e)if(r===Object(r))if(t in r)for(const e of r[t])l.push(e),n(s,e.defaultVariants);else l.push(i=w(r)),n(s,i.defaultVariants);return i||l.push(i=w({})),a((e=>{const{css:n,...d}=Object(e),g=new Set;let p,m=!1;for(const e of l)m=e.apply(d,g,s)||m;n===Object(n)&&(p=i.inline(n,g)),(m||p)&&S();for(const e in i.variantProps)o.has(e)||delete d[e];void 0!==d.className&&String(d.className).split(/\s+/).forEach(g.add,g);const h=c(g);return d.className=h.join(" "),a(r(null),"className",{get[t](){return l},className:d.className,props:d,selector:i.selector})}),"className",{get[t](){return l},get className(){return i.apply()&&S(),i.className},selector:i.selector})},config:i,global:y,keyframes:e=>{const t=R(l,e);return y({["@keyframes "+t]:e},t)},prefix:l,reset:()=>(p.clear(),m.clear(),h.clear(),u.clear(),z.className,W),theme:n(k,z),get cssText(){return f},getCssString:()=>f},"cssText",{});return W},$=()=>$.config||($.config=j()),N=(...e)=>$().css(...e),L=(...e)=>$().global(...e),O=(...e)=>$().keyframes(...e);globalThis.stitches={createCss:j,css:N,defaultThemeMap:E,global:L,keyframes:O}})()
//# sourceMappingUrl=index.map
{
"name": "@stitches/core",
"version": "0.1.8",
"version": "0.1.9",
"description": "The modern CSS-in-JS library",

@@ -70,3 +70,3 @@ "type": "module",

],
"gitHead": "aba0fccf739946e8773e4a8f30d3291aa3fccc5f"
"gitHead": "0a355a07ffbdf966f22c1339a2ec1a13ccc63132"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc