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.2.0 to 0.2.1

2

dist/index.iife.js

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

var e,t={all:"all"},i="colors",n="sizes",r="space",o={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:i,backgroundColor:i,backgroundImage:i,border:i,borderBlock:i,borderBlockEnd:i,borderBlockStart:i,borderBottom:i,borderBottomColor:i,borderColor:i,borderInline:i,borderInlineEnd:i,borderInlineStart:i,borderLeft:i,borderLeftColor:i,borderRight:i,borderRightColor:i,borderTop:i,borderTopColor:i,caretColor:i,color:i,columnRuleColor:i,fill:i,outline:i,outlineColor:i,stroke:i,textDecorationColor:i,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:n,minBlockSize:n,maxBlockSize:n,inlineSize:n,minInlineSize:n,maxInlineSize:n,width:n,minWidth:n,maxWidth:n,height:n,minHeight:n,maxHeight:n,flexBasis:n,gridTemplateColumns:n,gridTemplateRows:n,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"},l=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,s=()=>{const e=Object.create(null);return(t,i,...n)=>{const r=(e=>JSON.stringify(e,l))(t);return r in e?e[r]:e[r]=i(t,...n)}},a=Symbol.for("sxs.composers"),c=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),d=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:g}=Object.prototype,u=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),p=/\s+(?![^()]*\))/,h=e=>t=>e(..."string"==typeof t?String(t).split(p):[t]),f={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:h(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:h(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:h(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:h(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:h(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:h(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},m=/([\d.]+)([^]*)/,b=(e,t)=>e.length?e.reduce(((e,i)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(e)?`:is(${i})`:i):i+" "+e))),e)),[]):t,S=(e,t)=>e in k&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,i,n,r)=>i+("stretch"===n?`-moz-available${r};${e}:${i}-webkit-fill-available`:`-moz-fit-content${r};${e}:${i}fit-content`)+r)):String(t),k={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},R=e=>e?e+"-":"",B=(e,t,i)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((e,n,r,o,l)=>"$"==o==!!r?e:(n||"--"==o?"calc(":"")+"var(--"+("$"===o?R(t)+(l.includes("$")?"":R(i))+l.replace(/\$/g,"-"):l)+")"+(n||"--"==o?"*"+(n||"")+(r||"1")+")":""))),y=/\s*,\s*(?![^()]*\))/,$=Object.prototype.toString,x=(e,t,i,n,r)=>{let o,l,s;const a=(e,t,i)=>{let c,d;const g=e=>{for(c in e){const k=64===c.charCodeAt(0),x=k&&Array.isArray(e[c])?e[c]:[e[c]];for(d of x){const e="object"==typeof d&&d&&d.toString===$,x=/[A-Z]/.test(h=c)?h:h.replace(/-[^]/g,(e=>e[1].toUpperCase()));if(x in n.utils){const e=n.utils[x];if(e!==l){l=e,g(e(n)(d)),l=null;continue}}else if(x in f){const e=f[x];if(e!==s){s=e,g(e(d)),s=null;continue}}if(k&&(p=c.slice(1)in n.media?"@media "+n.media[c.slice(1)]:c,c=p.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,i,n,r,o)=>{const l=m.test(t),s=.0625*(l?-1:1),[a,c]=l?[n,t]:[t,n];return"("+("="===i[0]?"":">"===i[0]===l?"max-":"min-")+a+":"+("="!==i[0]&&1===i.length?c.replace(m,((e,t,n)=>Number(t)+s*(">"===i?1:-1)+n)):c)+(r?") and ("+(">"===r[0]?"min-":"max-")+a+":"+(1===r.length?o.replace(m,((e,t,i)=>Number(t)+s*(">"===r?-1:1)+i)):o):"")+")"}))),e){const e=k?i.concat(c):[...i],n=k?[...t]:b(t,c.split(y));void 0!==o&&r(I(...o)),o=void 0,a(d,n,e)}else void 0===o&&(o=[[],t,i]),c=k||36!==c.charCodeAt(0)?c:`--${R(n.prefix)}${c.slice(1).replace(/\$/g,"-")}`,d=e?d:"number"==typeof d?d&&x in W?String(d)+"px":String(d):B(S(x,d),n.prefix,n.themeMap[x]),o[0].push(`${k?`${c} `:`${u(c)}:`}${d}`)}}var p,h};g(e),void 0!==o&&r(I(...o)),o=void 0};a(e,t,i)},I=(e,t,i)=>`${i.map((e=>`${e}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(i.length?i.length+1:0).join("}")}`,W={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},v=e=>String.fromCharCode(e+(e>25?39:97)),w=e=>(e=>{let t,i="";for(t=Math.abs(e);t>52;t=t/52|0)i=v(t%52)+i;return v(t%52)+i})(((e,t)=>{let i=t.length;for(;i;)e=33*e^t.charCodeAt(--i);return e})(5381,JSON.stringify(e))>>>0),z=s(),j=(e,t)=>z(e,(()=>(...i)=>{let n=null;const r=new Set;for(const t of i)if(null!=t)switch(typeof t){case"function":if(null==n&&!t[a]){n=t;break}case"object":if(null==n&&null!=t.type&&(n=t.type),a in t)for(const e of t[a])r.add(e);else if(!("$$typeof"in t)){const i=E(t,e);r.add(i)}break;case"string":n=t}return null==n&&(n="span"),r.size||r.add(["PJLV",{},[],[],{},[]]),P(e,n,r,t)})),E=({variants:e,compoundVariants:t,defaultVariants:i,...n},r)=>{const o=`${R(r.prefix)}c-${w(n)}`,l=[],s=[],a=Object.create(null),c=[];for(const e in i)a[e]=String(i[e]);if("object"==typeof e&&e)for(const t in e){u=a,p=t,g.call(u,p)||(a[t]="undefined");const i=e[t];for(const e in i){const n={[t]:String(e)};"undefined"===String(e)&&c.push(t);const r=i[e],o=[n,r,!d(r)];l.push(o)}}var u,p;if("object"==typeof t&&t)for(const e of t){let{css:t,...i}=e;t="object"==typeof t&&t||{};for(const e in i)i[e]=String(i[e]);const n=[i,t,!d(t)];s.push(n)}return[o,n,l,s,a,c]},P=(e,t,i,n)=>{const[r,o,l,s]=M(i),d=`.${r}`,g=a=>{a="object"==typeof a&&a||T;const{css:c,...g}=a,u={};for(const e in l)if(delete g[e],e in a){let t=a[e];"object"==typeof t&&t?u[e]={"@initial":l[e],...t}:(t=String(t),u[e]="undefined"!==t||s.has(e)?t:l[e])}else u[e]=l[e];const p=new Set([...o]);for(const[t,r,o,l]of i){if(!n.rules.styled.cache.has(t)){n.rules.styled.cache.add(t);let i=n.rules.styled.group.cssRules.length;x(r,[`.${t}`],[],e,(e=>{n.rules.styled.group.insertRule(e,i++)}))}const i=C(o,u,e.media),s=C(l,u,e.media,!0);for(const r of i)if(void 0!==r)for(const[i,o]of r){const r=`${t}-${w(o)}-${i}`;if(p.add(r),!n.rules.onevar.cache.has(r)){n.rules.onevar.cache.add(r);let t=n.rules.onevar.group.cssRules.length;x(o,[`.${r}`],[],e,(e=>{n.rules.onevar.group.insertRule(e,t++)}))}}for(const i of s)if(void 0!==i)for(const[r,o]of i){const i=`${t}-${w(o)}-${r}`;if(p.add(i),!n.rules.allvar.cache.has(i)){n.rules.allvar.cache.add(i);let t=n.rules.allvar.group.cssRules.length;x(o,[`.${i}`],[],e,(e=>{n.rules.allvar.group.insertRule(e,t++)}))}}}if("object"==typeof c&&c){const t=`${r}-i${w(c)}-css`;if(p.add(t),!n.rules.inline.cache.has(t)){n.rules.inline.cache.add(t);let i=n.rules.inline.group.cssRules.length;x(c,[`.${t}`],[],e,(e=>{n.rules.inline.group.insertRule(e,i++)}))}}for(const e of String(a.className||"").trim().split(/\s+/))e&&p.add(e);const h=g.className=[...p].join(" ");return{type:t,className:h,selector:d,props:g,toString:()=>h}};return c(g,{type:t,className:r,selector:d,[a]:i,toString:()=>(n.rules.styled.cache.has(r)||g(),r)})},M=e=>{let t="";const i=[],n={},r=[];for(const[o,,,,l,s]of e){""===t&&(t=o),i.push(o),r.push(...s);for(const e in l)n[e]=l[e]}return[t,i,n,new Set(r)]},C=(e,t,i,n)=>{const r=[];e:for(let[o,l,s]of e){if(s)continue;let e,a=0;for(e in o){const n=o[e];let r=t[e];if(r!==n){if("object"!=typeof r||!r)continue e;{let e,t=0;for(const o in r)n===String(r[o])&&("@initial"!==o&&(l={[o in i?i[o]:o]:l}),a+=t,e=!0),++t;if(!e)continue e}}}(r[a]=r[a]||[]).push([n?"cv":`${e}-${o[e]}`,l])}return r},T={},L=s(),O=(e,t)=>L(e,(()=>i=>{const n=w(i="object"==typeof i&&i||{}),r=()=>{if(!t.rules.global.cache.has(n)){if(t.rules.global.cache.add(n),"@import"in i){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let n of[].concat(i["@import"]))n=n.includes('"')||n.includes("'")?n:`"${n}"`,t.sheet.insertRule(`@import ${n};`,e++);delete i["@import"]}let r=t.rules.global.group.cssRules.length;x(i,[],[],e,(e=>{t.rules.global.group.insertRule(e,r++)}))}return""};return c(r,{toString:r,[Symbol.toPrimitive]:r})})),A=s(),D=(e,t)=>A(e,(()=>i=>{const n=`${R(e.prefix)}k-${w(i)}`,r=()=>{if(!t.rules.global.cache.has(n)){t.rules.global.cache.add(n);let r=t.rules.global.group.cssRules.length;const o=[];x(i,[],[],e,(e=>o.push(e)));const l=`@keyframes ${n}{${o.join("")}}`;t.rules.global.group.insertRule(l,r++)}return n};return c(r,{get name(){return r()},toString:r,[Symbol.toPrimitive]:r})})),H=class{constructor(e,t,i,n){this.name=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==i?"":String(i),this.prefix=null==n?"":String(n)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+R(this.prefix)+R(this.scale)+this.name}toString(){return this.computedValue}},N=s(),V=(e,t)=>N(e,(()=>(i,n)=>{n="object"==typeof i&&i||Object(n);const r=`.${i=(i="string"==typeof i?i:"")||`${R(e.prefix)}t-${w(n)}`}`,o={},l=[];for(const t in n){o[t]={};for(const i in n[t]){const r=`--${R(e.prefix)}${t}-${i}`,s=B(String(n[t][i]),e.prefix,t);o[t][i]=new H(i,s,t,e.prefix),l.push(`${r}:${s}`)}}const s=()=>{if(l.length&&!t.rules.themed.cache.has(i)){t.rules.themed.cache.add(i);let r=t.rules.themed.group.cssRules.length;const o=`${n===e.theme?":root,":""}.${i}{${l.join(";")}}`;t.rules.themed.group.insertRule(o,r++)}return i};return{...o,className:i,selector:r,toString:s,[Symbol.toPrimitive]:s}})),G=["themed","global","styled","onevar","allvar","inline"],F=e=>{let t;const i=()=>{if(t){const{rules:e,sheet:i}=t;if(!i.deleteRule){for(;3===Object(Object(i.cssRules)[0]).type;)i.cssRules.splice(0,1);i.cssRules=[]}for(const t in e)delete e[t];i.ownerRule&&(i.ownerRule.textContent=i.ownerRule.textContent)}const n=Object(e).styleSheets||[];for(const e of n)if(!e.href||e.href.startsWith(location.origin)){for(let n=0,r=e.cssRules;r[n];++n){const o=Object(r[n]);if(1!==o.type)continue;const l=Object(r[n+1]);if(4!==l.type)continue;++n;const{cssText:s}=o;if(!s.startsWith("--stitches"))continue;const a=s.slice(16,-3).trim().split(/\s+/),c=G[a[0]];c&&(t||(t={sheet:e,reset:i,rules:{}}),t.rules[c]={group:l,index:n,cache:new Set(a)})}if(t)break}if(!t){const n=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,n(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,(e=>e.cssText)).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:n("","text/css"),rules:{},reset:i,toString(){const{cssRules:e}=t.sheet;return[].map.call(e,((i,n)=>{const{cssText:r}=i;let o="";if(r.startsWith("--stitches"))return"";if(e[n-1]&&(o=e[n-1].cssText).startsWith("--stitches")){if(!i.cssRules.length)return"";for(const e in t.rules)if(t.rules[e].group===i)return`--stitches{--:${[...t.rules[e].cache].join(" ")}}${r}`;return i.cssRules.length?`${o}${r}`:""}return r})).join("")}}}const{sheet:r,rules:o}=t;if(!o.inline){const e=r.cssRules.length;r.insertRule("@media{}",e),r.insertRule("--stitches{--:5}",e),o.inline={index:e,group:r.cssRules[e+1],cache:new Set([5])}}if(!o.allvar){const e=o.inline.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:4}",e),o.allvar={index:e,group:r.cssRules[e+1],cache:new Set([4])}}if(!o.onevar){const e=o.allvar.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:3}",e),o.onevar={index:e,group:r.cssRules[e+1],cache:new Set([3])}}if(!o.styled){const e=o.onevar.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:2}",e),o.styled={index:e,group:r.cssRules[e+1],cache:new Set([2])}}if(!o.global){const e=o.styled.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:1}",e),o.global={index:e,group:r.cssRules[e+1],cache:new Set([1])}}if(!o.themed){const e=o.global.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:0}",e),o.themed={index:e,group:r.cssRules[e+1],cache:new Set([0])}}};return i(),t},J=s(),U=e=>{let i=!1;const n=J(e,(e=>{i=!0;const n="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",r={...t,..."object"==typeof e.media&&e.media||{}},l="object"==typeof e.root?e.root||null:globalThis.document||null,s="object"==typeof e.theme&&e.theme||{},a={prefix:n,media:r,root:l,theme:s,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...o},utils:"object"==typeof e.utils&&e.utils||{}},c=F(l),d={css:j(a,c),global:O(a,c),keyframes:D(a,c),theme:V(a,c),reset(){c.reset(),g.toString()},sheet:c,config:a,prefix:n,getCssString:c.toString,toString:c.toString,[Symbol.toPrimitive]:c.toString},g=d.theme(s);return Object.assign(d.theme,g),g.toString(),d}));return i||n.reset(),n},Z=()=>e||(e=U()),X=(...e)=>Z().css(...e),Y=(...e)=>Z().global(...e),q=(...e)=>Z().keyframes(...e);globalThis.stitches={createCss:U,css:X,defaultThemeMap:o,global:Y,keyframes:q};
var e,t={all:"all"},n="colors",i="sizes",r="space",o={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:n,backgroundColor:n,backgroundImage:n,border:n,borderBlock:n,borderBlockEnd:n,borderBlockStart:n,borderBottom:n,borderBottomColor:n,borderColor:n,borderInline:n,borderInlineEnd:n,borderInlineStart:n,borderLeft:n,borderLeftColor:n,borderRight:n,borderRightColor:n,borderTop:n,borderTopColor:n,caretColor:n,color:n,columnRuleColor:n,fill:n,outline:n,outlineColor:n,stroke:n,textDecorationColor:n,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"},l=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,s=()=>{const e=Object.create(null);return(t,n,...i)=>{const r=(e=>JSON.stringify(e,l))(t);return r in e?e[r]:e[r]=n(t,...i)}},a=Symbol.for("sxs.composers"),c=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),d=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:g}=Object.prototype,u=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),p=/\s+(?![^()]*\))/,h=e=>t=>e(..."string"==typeof t?String(t).split(p):[t]),f={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:h(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:h(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:h(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:h(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:h(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:h(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},m=/([\d.]+)([^]*)/,b=(e,t)=>e.length?e.reduce(((e,n)=>(e.push(...t.map((e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(n)&&/&.*&/.test(e)?`:is(${n})`:n):n+" "+e))),e)),[]):t,S=(e,t)=>e in k&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((t,n,i,r)=>n+("stretch"===i?`-moz-available${r};${e}:${n}-webkit-fill-available`:`-moz-fit-content${r};${e}:${n}fit-content`)+r)):String(t),k={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},y=e=>e?e+"-":"",B=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((e,i,r,o,l)=>"$"==o==!!r?e:(i||"--"==o?"calc(":"")+"var(--"+("$"===o?y(t)+(l.includes("$")?"":y(n))+l.replace(/\$/g,"-"):l)+")"+(i||"--"==o?"*"+(i||"")+(r||"1")+")":""))),R=/\s*,\s*(?![^()]*\))/,$=Object.prototype.toString,x=(e,t,n,i,r)=>{let o,l,s;const a=(e,t,n)=>{let c,d;const g=e=>{for(c in e){const k=64===c.charCodeAt(0),x=k&&Array.isArray(e[c])?e[c]:[e[c]];for(d of x){const e="object"==typeof d&&d&&d.toString===$,x=/[A-Z]/.test(h=c)?h:h.replace(/-[^]/g,(e=>e[1].toUpperCase()));if(x in i.utils){const e=i.utils[x];if(e!==l){l=e,g(e(i)(d)),l=null;continue}}else if(x in f){const e=f[x];if(e!==s){s=e,g(e(d)),s=null;continue}}if(k&&(p=c.slice(1)in i.media?"@media "+i.media[c.slice(1)]:c,c=p.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((e,t,n,i,r,o)=>{const l=m.test(t),s=.0625*(l?-1:1),[a,c]=l?[i,t]:[t,i];return"("+("="===n[0]?"":">"===n[0]===l?"max-":"min-")+a+":"+("="!==n[0]&&1===n.length?c.replace(m,((e,t,i)=>Number(t)+s*(">"===n?1:-1)+i)):c)+(r?") and ("+(">"===r[0]?"min-":"max-")+a+":"+(1===r.length?o.replace(m,((e,t,n)=>Number(t)+s*(">"===r?-1:1)+n)):o):"")+")"}))),e){const e=k?n.concat(c):[...n],i=k?[...t]:b(t,c.split(R));void 0!==o&&r(I(...o)),o=void 0,a(d,i,e)}else void 0===o&&(o=[[],t,n]),c=k||36!==c.charCodeAt(0)?c:`--${y(i.prefix)}${c.slice(1).replace(/\$/g,"-")}`,d=e?d:"number"==typeof d?d&&x in W?String(d)+"px":String(d):B(S(x,d),i.prefix,i.themeMap[x]),o[0].push(`${k?`${c} `:`${u(c)}:`}${d}`)}}var p,h};g(e),void 0!==o&&r(I(...o)),o=void 0};a(e,t,n)},I=(e,t,n)=>`${n.map((e=>`${e}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,W={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},w=e=>String.fromCharCode(e+(e>25?39:97)),z=e=>(e=>{let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=w(t%52)+n;return w(t%52)+n})(((e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e})(5381,JSON.stringify(e))>>>0),j=s(),v=(e,t)=>j(e,(()=>(...n)=>{let i=null;const r=new Set;for(const t of n)if(null!=t)switch(typeof t){case"function":if(null==i&&!t[a]){i=t;break}case"object":if(null==i&&null!=t.type&&(i=t.type),a in t)for(const e of t[a])r.add(e);else if(!("$$typeof"in t)){const n=E(t,e);r.add(n)}break;case"string":i=t}return null==i&&(i="span"),r.size||r.add(["PJLV",{},[],[],{},[]]),M(e,i,r,t)})),E=({variants:e,compoundVariants:t,defaultVariants:n,...i},r)=>{const o=`${y(r.prefix)}c-${z(i)}`,l=[],s=[],a=Object.create(null),c=[];for(const e in n)a[e]=String(n[e]);if("object"==typeof e&&e)for(const t in e){u=a,p=t,g.call(u,p)||(a[t]="undefined");const n=e[t];for(const e in n){const i={[t]:String(e)};"undefined"===String(e)&&c.push(t);const r=n[e],o=[i,r,!d(r)];l.push(o)}}var u,p;if("object"==typeof t&&t)for(const e of t){let{css:t,...n}=e;t="object"==typeof t&&t||{};for(const e in n)n[e]=String(n[e]);const i=[n,t,!d(t)];s.push(i)}return[o,i,l,s,a,c]},M=(e,t,n,i)=>{const[r,o,l,s]=C(n),d=`.${r}`,g=a=>{a="object"==typeof a&&a||T;const{css:c,...g}=a,u={};for(const e in l)if(delete g[e],e in a){let t=a[e];"object"==typeof t&&t?u[e]={"@initial":l[e],...t}:(t=String(t),u[e]="undefined"!==t||s.has(e)?t:l[e])}else u[e]=l[e];const p=new Set([...o]);for(const[t,r,o,l]of n){i.rules.styled.cache.has(t)||(i.rules.styled.cache.add(t),x(r,[`.${t}`],[],e,(e=>{i.rules.styled.apply(e)})));const n=P(o,u,e.media),s=P(l,u,e.media,!0);for(const r of n)if(void 0!==r)for(const[n,o]of r){const r=`${t}-${z(o)}-${n}`;p.add(r),i.rules.onevar.cache.has(r)||(i.rules.onevar.cache.add(r),x(o,[`.${r}`],[],e,(e=>{i.rules.onevar.apply(e)})))}for(const n of s)if(void 0!==n)for(const[r,o]of n){const n=`${t}-${z(o)}-${r}`;p.add(n),i.rules.allvar.cache.has(n)||(i.rules.allvar.cache.add(n),x(o,[`.${n}`],[],e,(e=>{i.rules.allvar.apply(e)})))}}if("object"==typeof c&&c){const t=`${r}-i${z(c)}-css`;p.add(t),i.rules.inline.cache.has(t)||(i.rules.inline.cache.add(t),x(c,[`.${t}`],[],e,(e=>{i.rules.inline.apply(e)})))}for(const e of String(a.className||"").trim().split(/\s+/))e&&p.add(e);const h=g.className=[...p].join(" ");return{type:t,className:h,selector:d,props:g,toString:()=>h}};return c(g,{type:t,className:r,selector:d,[a]:n,toString:()=>(i.rules.styled.cache.has(r)||g(),r)})},C=e=>{let t="";const n=[],i={},r=[];for(const[o,,,,l,s]of e){""===t&&(t=o),n.push(o),r.push(...s);for(const e in l)i[e]=l[e]}return[t,n,i,new Set(r)]},P=(e,t,n,i)=>{const r=[];e:for(let[o,l,s]of e){if(s)continue;let e,a=0;for(e in o){const i=o[e];let r=t[e];if(r!==i){if("object"!=typeof r||!r)continue e;{let e,t=0;for(const o in r)i===String(r[o])&&("@initial"!==o&&(l={[o in n?n[o]:o]:l}),a+=t,e=!0),++t;if(!e)continue e}}}(r[a]=r[a]||[]).push([i?"cv":`${e}-${o[e]}`,l])}return r},T={},L=s(),O=(e,t)=>L(e,(()=>n=>{const i=z(n="object"==typeof n&&n||{}),r=()=>{if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in n){let e=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let i of[].concat(n["@import"]))i=i.includes('"')||i.includes("'")?i:`"${i}"`,t.sheet.insertRule(`@import ${i};`,e++);delete n["@import"]}x(n,[],[],e,(e=>{t.rules.global.apply(e)}))}return""};return c(r,{toString:r})})),A=s(),D=(e,t)=>A(e,(()=>n=>{const i=`${y(e.prefix)}k-${z(n)}`,r=()=>{if(!t.rules.global.cache.has(i)){t.rules.global.cache.add(i);const r=[];x(n,[],[],e,(e=>r.push(e)));const o=`@keyframes ${i}{${r.join("")}}`;t.rules.global.apply(o)}return i};return c(r,{get name(){return r()},toString:r})})),H=class{constructor(e,t,n,i){this.name=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==n?"":String(n),this.prefix=null==i?"":String(i)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+y(this.prefix)+y(this.scale)+this.name}toString(){return this.computedValue}},N=s(),V=(e,t)=>N(e,(()=>(n,i)=>{i="object"==typeof n&&n||Object(i);const r=`.${n=(n="string"==typeof n?n:"")||`${y(e.prefix)}t-${z(i)}`}`,o={},l=[];for(const t in i){o[t]={};for(const n in i[t]){const r=`--${y(e.prefix)}${t}-${n}`,s=B(String(i[t][n]),e.prefix,t);o[t][n]=new H(n,s,t,e.prefix),l.push(`${r}:${s}`)}}return{...o,className:n,selector:r,toString:()=>{if(l.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const r=`${i===e.theme?":root,":""}.${n}{${l.join(";")}}`;t.rules.themed.apply(r)}return n}}})),G=["themed","global","styled","onevar","allvar","inline"],F=e=>{let t;const n=()=>{if(t){const{rules:e,sheet:n}=t;if(!n.deleteRule){for(;3===Object(Object(n.cssRules)[0]).type;)n.cssRules.splice(0,1);n.cssRules=[]}for(const t in e)delete e[t];n.ownerRule&&(n.ownerRule.textContent=n.ownerRule.textContent)}const i=Object(e).styleSheets||[];for(const e of i)if(!e.href||e.href.startsWith(location.origin)){for(let i=0,r=e.cssRules;r[i];++i){const o=Object(r[i]);if(1!==o.type)continue;const l=Object(r[i+1]);if(4!==l.type)continue;++i;const{cssText:s}=o;if(!s.startsWith("--stitches"))continue;const a=s.slice(16,-3).trim().split(/\s+/),c=G[a[0]];c&&(t||(t={sheet:e,reset:n,rules:{}}),t.rules[c]={group:l,index:i,cache:new Set(a)})}if(t)break}if(!t){const i=(e,t)=>({type:t,cssRules:[],insertRule(e,t){this.cssRules.splice(t,0,i(e,{import:3,undefined:1}[(e.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===e?`@media{${[].map.call(this.cssRules,(e=>e.cssText)).join("")}}`:e}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:i("","text/css"),rules:{},reset:n,toString(){const{cssRules:e}=t.sheet;return[].map.call(e,((n,i)=>{const{cssText:r}=n;let o="";if(r.startsWith("--stitches"))return"";if(e[i-1]&&(o=e[i-1].cssText).startsWith("--stitches")){if(!n.cssRules.length)return"";for(const e in t.rules)if(t.rules[e].group===n)return`--stitches{--:${[...t.rules[e].cache].join(" ")}}${r}`;return n.cssRules.length?`${o}${r}`:""}return r})).join("")}}}const{sheet:r,rules:o}=t;if(!o.inline){const e=r.cssRules.length;r.insertRule("@media{}",e),r.insertRule("--stitches{--:5}",e),o.inline={index:e,group:r.cssRules[e+1],cache:new Set([5])}}if(J(o.inline),!o.allvar){const e=o.inline.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:4}",e),o.allvar={index:e,group:r.cssRules[e+1],cache:new Set([4])}}if(J(o.allvar),!o.onevar){const e=o.allvar.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:3}",e),o.onevar={index:e,group:r.cssRules[e+1],cache:new Set([3])}}if(J(o.onevar),!o.styled){const e=o.onevar.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:2}",e),o.styled={index:e,group:r.cssRules[e+1],cache:new Set([2])}}if(J(o.styled),!o.global){const e=o.styled.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:1}",e),o.global={index:e,group:r.cssRules[e+1],cache:new Set([1])}}if(J(o.global),!o.themed){const e=o.global.index;r.insertRule("@media{}",e),r.insertRule("--stitches{--:0}",e),o.themed={index:e,group:r.cssRules[e+1],cache:new Set([0])}}J(o.themed)};return n(),t},J=e=>{const t=e.group;let n=0;e.apply=e=>{try{t.insertRule(e,n),++n}catch(e){console.warn(e.message)}}},U=s(),Z=e=>{let n=!1;const i=U(e,(e=>{n=!0;const i="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",r={...t,..."object"==typeof e.media&&e.media||{}},l="object"==typeof e.root?e.root||null:globalThis.document||null,s="object"==typeof e.theme&&e.theme||{},a={prefix:i,media:r,root:l,theme:s,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...o},utils:"object"==typeof e.utils&&e.utils||{}},c=F(l),d={css:v(a,c),global:O(a,c),keyframes:D(a,c),theme:V(a,c),reset(){c.reset(),g.toString()},sheet:c,config:a,prefix:i,getCssString:c.toString,toString:c.toString},g=d.theme(s);return Object.assign(d.theme,g),g.toString(),d}));return n||i.reset(),i},X=()=>e||(e=Z()),Y=(...e)=>X().css(...e),q=(...e)=>X().global(...e),K=(...e)=>X().keyframes(...e);globalThis.stitches={createCss:Z,css:Y,defaultThemeMap:o,global:q,keyframes:K};
//# sourceMappingUrl=index.map
{
"name": "@stitches/core",
"version": "0.2.0",
"version": "0.2.1",
"description": "The modern CSS-in-JS library",

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

],
"gitHead": "627da008f62832dded2b7c09f3f47fbdeea06050"
"gitHead": "5ebf57cf99706125c1a1d203d439e80608d8302d"
}

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