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.0-canary.4 to 0.1.0-canary.5

2

dist/stitches.core.iife.js

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

(()=>{var{from:t}=Array,n=Object,{assign:r,create:o,defineProperties:e,getOwnPropertyDescriptors:i}=Object,s=(t,n)=>e(t,i(n)),l=class extends Set{constructor(t){super().onChange=t}addCss(t){return!this.has(t)&&this.add(t).onChange&&String(t)&&this.onChange(this),this}toString(){return t(this).join("")}},a=class{constructor(t,n,r){this.value=t,this.token=n,this.scale=r}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+this.scale+"-"+this.token}toString(){return this.computedValue}},d=(t,n)=>t.reduce(((t,r)=>(t.push(...n.map((t=>/&/.test(t)?t.replace(/&/,r):t.replace(/^/,r+" ")))),t)),[]),c=t=>t!==n(t)||!(t.constructor===n||null==t.constructor),g=/^/.test.bind(/(Clamp|Column.*|Count|Duration|Flex.*|Group.*|Grow|Index|Opacity|Order|Outset|Row.*|Shrink|Slice|Span|Weight|columns|flex|lineHeight|opacity|order|orphans|tabSize|widows|zoom|(Image|stroke)Width)$/),h=Symbol(),p=/\s*,\s*(?![^()]*\))/,u=(t,n,r,o)=>e=>{let i="";const s=[];let l="";const a=({when:e,...u},f)=>{u=e?{...u,when:e}:u;for(let e in u){let m=u[e];if(e in t){let n=t[e](o)(m);if(n=c(n)?String(n):n,c(n))m=n;else{const t=JSON.stringify(n);l!==t&&(l=t,a(n,f),l="",m={})}}const S=64===e.charCodeAt(0);if(c(m)){for(const t of s)t[h]||(i+=t,i+="{",t[h]=!0);f.length&&!f[h]&&(i+=f.join(", "),i+="{",f[h]=!0),i+=(S?e:/^\$/.test(e)?"-"+e.replace(/\$/g,"-"):e.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase())))+(S?" ":":")+("number"==typeof m&&!g(e)&&m?m+"px":String(m).replace(/\$[$-\w]+/g,(t=>"var(-"+(!/.\$/.test(t)&&e in n?"-"+n[e]:"")+t.replace(/\$/g,"-")+")")))+";"}else{const t=(t,n,r)=>{const o=t?s.push(Object(n)):s.length;if(f.length&&f[h]&&(i+="}",f[h]=!1),a(r,t?f:f.length?d(f,n.split(p)):n.split(p)),t&&o)for(const t of s.splice(o-1))i+="}",t[h]=!1};if("when"===e)for(const n in m)t(!0,n in r?r[n]:n,m[n]);else t(S,e,m)}}f.length&&f[h]&&(i+="}",f[h]=!1)};return a(e,[]),i},f="colors",m="sizes",S="space",b={gap:S,gridGap:S,columnGap:S,gridColumnGap:S,rowGap:S,gridRowGap:S,inset:S,insetBlock:S,insetBlockEnd:S,insetBlockStart:S,insetInline:S,insetInlineEnd:S,insetInlineStart:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockEnd:S,marginBlockStart:S,marginInline:S,marginInlineEnd:S,marginInlineStart:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockEnd:S,paddingBlockStart:S,paddingInline:S,paddingInlineEnd:S,paddingInlineStart:S,top:S,right:S,bottom:S,left:S,scrollMargin:S,scrollMarginTop:S,scrollMarginRight:S,scrollMarginBottom:S,scrollMarginLeft:S,scrollMarginX:S,scrollMarginY:S,scrollMarginBlock:S,scrollMarginBlockEnd:S,scrollMarginBlockStart:S,scrollMarginInline:S,scrollMarginInlineEnd:S,scrollMarginInlineStart:S,scrollPadding:S,scrollPaddingTop:S,scrollPaddingRight:S,scrollPaddingBottom:S,scrollPaddingLeft:S,scrollPaddingX:S,scrollPaddingY:S,scrollPaddingBlock:S,scrollPaddingBlockEnd:S,scrollPaddingBlockStart:S,scrollPaddingInline:S,scrollPaddingInlineEnd:S,scrollPaddingInlineStart:S,fontSize:"fontSizes",background:f,backgroundColor:f,backgroundImage:f,border:f,borderBlock:f,borderBlockEnd:f,borderBlockStart:f,borderBottom:f,borderBottomColor:f,borderColor:f,borderInline:f,borderInlineEnd:f,borderInlineStart:f,borderLeft:f,borderLeftColor:f,borderRight:f,borderRightColor:f,borderTop:f,borderTopColor:f,caretColor:f,color:f,columnRuleColor:f,fill:f,outlineColor:f,stroke:f,textDecorationColor:f,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:m,minBlockSize:m,maxBlockSize:m,inlineSize:m,minInlineSize:m,maxInlineSize:m,width:m,minWidth:m,maxWidth:m,height:m,minHeight:m,maxHeight:m,flexBasis:m,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"},C=t=>{const n={};for(const r in t)for(const o in t[r])n["$"+r+"-"+o]=String(t[r][o]).replace(/\$[$-\w]+/g,(t=>/[^]\$/.test(t)?t:"$"+r+t));return n},k=(t,n)=>{for(var r=JSON.stringify(n),o=r.length,e=9;o;)e=Math.imul(e^r.charCodeAt(--o),9**9);return t+(e^e>>>9).toString(36).slice(-5)},B=e=>{e=n(e);const i={conditions:r({initial:"@media all"},e.conditions),theme:n(e.theme),utils:r(o(null),e.utils)},d=e.prefix||"sx",c=e.classProp||"className",g=u(i.utils,n(e.themeMap||b),i.conditions,i),h=new l(e.onImport),p=new l(e.onGlobal),f=new l(e.onThemed),m=new l(e.onStyled),S=(t,r)=>{r=t===n(t)?t:n(r),t="string"==typeof t?t:"";const e=C(r),i=(t=t||k(d,e)).replace(/^\w/,".$&"),l=g({[i]:e}),c=s((()=>(f.addCss(l),c)),{toString:()=>(c(),t),get className(){return c(),t},get selector(){return c(),i}});for(const t in r){c[t]=o(null);for(const n in r[t])c[t][n]=new a(r[t][n],n,t)}return c},B=(t,n="")=>{const o=[],e=[];for(const n in t){const r=g({[n]:t[n]});("@import"===n?o:e).push(r)}const i=()=>(o.forEach(h.addCss,h),e.forEach(p.addCss,p),n);return r(i,{displayName:n,toString:()=>String(i())})};r(S,S(":root",i.theme)).toString();const w=()=>h+f+p+m;return{config:e,getCssString:w,global:B,keyframes:t=>{const n=k(d,t);return B({["@keyframes "+n]:t},n)},css:(e,a)=>{const{variants:h,compoundVariants:p,defaultVariants:u,...f}=n(a||e),S=n(a&&e),b=k(d,f),C=g({["."+b]:f}),B=m.onChange&&(()=>m.onChange(m)),w=new l(B),y=new l(B),I=new l(B),R=new l(B),x=r(o(null),S.variants);for(const t in h){x[t]=r(o(null),x[t]);for(const n in h[t]){const r=h[t][n],e=b+k("",r)+"--"+t+"-"+n,i=g({["."+e]:r}),s=o(null),l=x[t][n];x[t][n]=t=>{const n=(l?l(t):[]).concat(t?[]:e);if(null!=t){if(!s[t]){const n=e+"--"+k("",t),o=g({[t]:{["."+n]:r}});s[t]=[o,n]}y.addCss(s[t][0]),n.push(s[t][1])}else y.addCss(i);return n}}}function E(){const t=(S.classNames?S.classNames():[]).concat(b);return w.addCss(C),t}m.addCss(w).addCss(y).addCss(I).addCss(R);const M=function(r){const{css:o,...e}=n(r);let s=new Set(E());for(const t in u)!(t in e)&&t in x&&(e[t]=u[t]);c in e&&(String(e[c]).split(/\s+/).forEach(s.add,s),delete e[c]);for(const t of[].concat(p||[])){const{css:r,...o}=n(t);let l=r;if(n.keys(o).every((t=>{if(t in e){const r=e[t],s=o[t];if(r==s)return!0;if(r===n(r)){for(const t in r){const n=r[t],o=i.conditions[t]||t;s==n&&(l={[o]:l})}return!0}}}))){const t=b+k("",l)+"--comp",n=g({["."+t]:l});I.addCss(n),s.add(t)}}for(const t in e)if(t in x){const n=e[t],r=x[t];if("as"!==t&&delete e[t],n in r)r[n]().forEach(s.add,s);else for(const t in n){const o=n[t],e=i.conditions[t]||t;o in r&&r[o](e).forEach(s.add,s)}}if(o){const t=b+k("",o)+"--css",n=g({["."+t]:o});R.addCss(n),s.add(t)}s=t(s);const l=e[c]=s.join(" ");return{toString:()=>l,className:l,selector:"."+s.join("."),props:e}};return s(M,{toString:()=>M().className,get className(){return M().className},get selector(){return M().selector},classNames:E,variants:x})},theme:S,reset(){return h.clear(),f.clear(),p.clear(),m.clear(),e.onResets&&e.onResets.call(this),S.toString(),this},toString:w}};globalThis.stitches=B;stitches.createCss=B;stitches.defaultThemeMap=b})()
(()=>{var{from:t}=Array,n=Object,{assign:r,create:o,defineProperties:e,getOwnPropertyDescriptors:i}=Object,s=(t,n)=>e(t,i(n)),l=class extends Set{constructor(t){super().onChange=t}addCss(t){return!this.has(t)&&this.add(t).onChange&&String(t)&&this.onChange(this),this}toString(){return t(this).join("")}},a=class{constructor(t,n,r){this.value=t,this.token=n,this.scale=r}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+this.scale+"-"+this.token}toString(){return this.computedValue}},d=(t,n)=>t.reduce(((t,r)=>(t.push(...n.map((t=>/&/.test(t)?t.replace(/&/,r):t.replace(/^/,r+" ")))),t)),[]),c=t=>t!==n(t)||!(t.constructor===n||null==t.constructor),g=/^/.test.bind(/(Clamp|Column.*|Count|Duration|Flex.*|Group.*|Grow|Index|Opacity|Order|Outset|Row.*|Shrink|Slice|Span|Weight|columns|flex|lineHeight|opacity|order|orphans|tabSize|widows|zoom|(Image|stroke)Width)$/),h=Symbol(),p=/\s*,\s*(?![^()]*\))/,u=(t,n,r,o)=>e=>{let i="";const s=[];let l="";const a=({when:e,...u},f)=>{u=e?{...u,when:e}:u;for(let e in u){let m=u[e];if(e in t){let n=t[e](o)(m);if(n=c(n)?String(n):n,c(n))m=n;else{const t=JSON.stringify(n);l!==t&&(l=t,a(n,f),l="",m={})}}const S=64===e.charCodeAt(0);if(c(m)){for(const t of s)t[h]||(i+=t,i+="{",t[h]=!0);f.length&&!f[h]&&(i+=f.join(", "),i+="{",f[h]=!0),i+=(S?e:/^\$/.test(e)?"-"+e.replace(/\$/g,"-"):e.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase())))+(S?" ":":")+("number"==typeof m&&!g(e)&&m?m+"px":String(m).replace(/\$[$-\w]+/g,(t=>"var(-"+(!/.\$/.test(t)&&e in n?"-"+n[e]:"")+t.replace(/\$/g,"-")+")")))+";"}else{const t=(t,n,r)=>{const o=t?s.push(Object(n)):s.length;if(f.length&&f[h]&&(i+="}",f[h]=!1),a(r,t?f:f.length?d(f,n.split(p)):n.split(p)),t&&o)for(const t of s.splice(o-1))i+="}",t[h]=!1};if("when"===e)for(const n in m)t(!0,n in r?r[n]:n,m[n]);else t(S,e,m)}}f.length&&f[h]&&(i+="}",f[h]=!1)};return a(e,[]),i},f="colors",m="sizes",S="space",b={gap:S,gridGap:S,columnGap:S,gridColumnGap:S,rowGap:S,gridRowGap:S,inset:S,insetBlock:S,insetBlockEnd:S,insetBlockStart:S,insetInline:S,insetInlineEnd:S,insetInlineStart:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockEnd:S,marginBlockStart:S,marginInline:S,marginInlineEnd:S,marginInlineStart:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockEnd:S,paddingBlockStart:S,paddingInline:S,paddingInlineEnd:S,paddingInlineStart:S,top:S,right:S,bottom:S,left:S,scrollMargin:S,scrollMarginTop:S,scrollMarginRight:S,scrollMarginBottom:S,scrollMarginLeft:S,scrollMarginX:S,scrollMarginY:S,scrollMarginBlock:S,scrollMarginBlockEnd:S,scrollMarginBlockStart:S,scrollMarginInline:S,scrollMarginInlineEnd:S,scrollMarginInlineStart:S,scrollPadding:S,scrollPaddingTop:S,scrollPaddingRight:S,scrollPaddingBottom:S,scrollPaddingLeft:S,scrollPaddingX:S,scrollPaddingY:S,scrollPaddingBlock:S,scrollPaddingBlockEnd:S,scrollPaddingBlockStart:S,scrollPaddingInline:S,scrollPaddingInlineEnd:S,scrollPaddingInlineStart:S,fontSize:"fontSizes",background:f,backgroundColor:f,backgroundImage:f,border:f,borderBlock:f,borderBlockEnd:f,borderBlockStart:f,borderBottom:f,borderBottomColor:f,borderColor:f,borderInline:f,borderInlineEnd:f,borderInlineStart:f,borderLeft:f,borderLeftColor:f,borderRight:f,borderRightColor:f,borderTop:f,borderTopColor:f,caretColor:f,color:f,columnRuleColor:f,fill:f,outlineColor:f,stroke:f,textDecorationColor:f,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:m,minBlockSize:m,maxBlockSize:m,inlineSize:m,minInlineSize:m,maxInlineSize:m,width:m,minWidth:m,maxWidth:m,height:m,minHeight:m,maxHeight:m,flexBasis:m,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"},C=t=>{const n={};for(const r in t)for(const o in t[r])n["$"+r+"-"+o]=String(t[r][o]).replace(/\$[$-\w]+/g,(t=>/[^]\$/.test(t)?t:"$"+r+t));return n},k=(t,n)=>{for(var r=JSON.stringify(n),o=r.length,e=9;o;)e=Math.imul(e^r.charCodeAt(--o),9**9);return t+(e^e>>>9).toString(36).slice(-5)},B=e=>{e=n(e);const i={conditions:r({initial:"@media all"},e.conditions),theme:n(e.theme),utils:r(o(null),e.utils)},d=e.prefix||"sx",c=e.classProp||"className",g=u(i.utils,n(e.themeMap||b),i.conditions,i),h=new l(e.onImport),p=new l(e.onGlobal),f=new l(e.onThemed),m=new l(e.onStyled),S=(t,r)=>{r=t===n(t)?t:n(r),t="string"==typeof t?t:"";const e=C(r),i=(t=t||k(d,e)).replace(/^\w/,".$&"),l=g({[i]:e}),c=s((()=>(f.addCss(l),c)),{toString:()=>(c(),t),get className(){return c(),t},get selector(){return c(),i}});for(const t in r){c[t]=o(null);for(const n in r[t])c[t][n]=new a(r[t][n],n,t)}return c},B=(t,n="")=>{const o=[],e=[];for(const n in t){const r=g({[n]:t[n]});("@import"===n?o:e).push(r)}const i=()=>(o.forEach(h.addCss,h),e.forEach(p.addCss,p),n);return r(i,{displayName:n,toString:()=>String(i())})};r(S,S(":root",i.theme)).toString();const w=()=>h+f+p+m;return{config:e,getCssString:w,global:B,keyframes:t=>{const n=k(d,t);return B({["@keyframes "+n]:t},n)},css:(e,a)=>{const{variants:h,compoundVariants:p,defaultVariants:u,...f}=n(a||e),S=n(a&&e),b=k(d,f),C=g({["."+b]:f}),B=m.onChange&&(()=>m.onChange(m)),w=new l(B),y=new l(B),I=new l(B),R=new l(B),x=r(o(null),S.variants);for(const t in h){x[t]=r(o(null),x[t]);for(const n in h[t]){const r=h[t][n],e=b+k("",r)+"--"+t+"-"+n,i=g({["."+e]:r}),s=o(null),l=x[t][n];x[t][n]=t=>{const n=(l?l(t):[]).concat(t?[]:e);if(null!=t){if(!s[t]){const n=e+"--"+k("",t),o=g({[t]:{["."+n]:r}});s[t]=[o,n]}y.addCss(s[t][0]),n.push(s[t][1])}else y.addCss(i);return n}}}function E(){const t=(S.classNames?S.classNames():[]).concat(b);return w.addCss(C),t}m.addCss(w).addCss(y).addCss(I).addCss(R);const M=function(r){const{css:o,...e}=n(r);let s=new Set(E());for(const t in u)!(t in e)&&t in x&&(e[t]=u[t]);c in e&&(String(e[c]).split(/\s+/).forEach(s.add,s),delete e[c]);for(const t of[].concat(p||[])){const{css:r,...o}=n(t);let l=r;if(n.keys(o).every((t=>{if(t in e){const r=e[t],s=o[t];if(r==s)return!0;if(r===n(r)){for(const t in r){const n=r[t],o=i.conditions[t]||t;s==n&&(l={[o]:l})}return!0}}}))){const t=b+k("",l)+"--comp",n=g({["."+t]:l});I.addCss(n),s.add(t)}}for(const t in e)if(t in x){const n=x[t],r=void 0!==e[t]||void 0 in n?e[t]:u[t];if("as"!==t&&delete e[t],r in n)n[r]().forEach(s.add,s);else for(const t in r){const o=r[t],e=i.conditions[t]||t;o in n&&n[o](e).forEach(s.add,s)}}if(o){const t=b+k("",o)+"--css",n=g({["."+t]:o});R.addCss(n),s.add(t)}s=t(s);const l=e[c]=s.join(" ");return{toString:()=>l,className:l,selector:"."+s.join("."),props:e}};return s(M,{toString:()=>M().className,get className(){return M().className},get selector(){return M().selector},classNames:E,variants:x})},theme:S,reset(){return h.clear(),f.clear(),p.clear(),m.clear(),e.onResets&&e.onResets.call(this),S.toString(),this},toString:w}};globalThis.stitches=B;stitches.createCss=B;stitches.defaultThemeMap=b})()
//# sourceMappingURL=stitches.core.map
{
"name": "@stitches/core",
"version": "0.1.0-canary.4",
"version": "0.1.0-canary.5",
"description": "The modern CSS-in-JS library",

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

],
"gitHead": "9d37eef75fd72577cf3de72f7c4c663be60be135"
"gitHead": "1ecaba8af46615e50a529bd91a3cdb1c261530a2"
}

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