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-canary.1 to 0.2.0-canary.2

2

dist/index.iife.js

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

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

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

],
"gitHead": "4c728e198205b1e80d69c7664fc9fbed619a59fb"
"gitHead": "bf9248a38d3fd1b4a0eb82009062d40f31f8f65e"
}

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