@stitches/react
Advanced tools
Comparing version 0.1.0-canary.0 to 0.1.0-canary.1
@@ -1,2 +0,2 @@ | ||
(()=>{var t=Object,{assign:e,create:n}=Object,{from:o}=Array,r=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 o(this).join("")}},i=class{constructor(t,e,n){this.value=t,this.token=e,this.scale=n}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+this.scale+"-"+this.token}toString(){return this.computedValue}},s=(t,e)=>t.reduce(((t,n)=>(t.push(...e.map((t=>/&/.test(t)?t.replace(/&/,n):t.replace(/^/,n+" ")))),t)),[]),l=e=>e!==t(e)||!(e.constructor===t||null==e.constructor),a=/^/.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)$/),d=Symbol(),c=/\s*,\s*(?![^()]*\))/,g=(t,e,n,o)=>r=>{let i="";const g=[];let h="";const m=({when:r,...p},u)=>{p=r?{...p,when:r}:p;for(let r in p){let f=p[r];if(r in t){let e=t[r](o)(f);if(e=l(e)?String(e):e,l(e))f=e;else{const t=JSON.stringify(e);h!==t&&(h=t,m(e,u),h="",f={})}}const S=64===r.charCodeAt(0);if(l(f)){for(const t of g)t[d]||(i+=t,i+="{",t[d]=!0);u.length&&!u[d]&&(i+=u.join(", "),i+="{",u[d]=!0),i+=(S?r:/^\$/.test(r)?"-"+r.replace(/\$/g,"-"):r.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase())))+(S?" ":":")+("number"==typeof f&&!a(r)&&f?f+"px":String(f).replace(/\$[$-\w]+/g,(t=>"var(-"+(!/.\$/.test(t)&&r in e?"-"+e[r]:"")+t.replace(/\$/g,"-")+")")))+";"}else{const t=(t,e,n)=>{const o=t?g.push(Object(e)):g.length;if(u.length&&u[d]&&(i+="}",u[d]=!1),m(n,t?u:u.length?s(u,e.split(c)):e.split(c)),t&&o)for(const t of g.splice(o-1))i+="}",t[d]=!1};if("when"===r)for(const e in f)t(!0,e in n?n[e]:e,f[e]);else t(S,r,f)}}u.length&&u[d]&&(i+="}",u[d]=!1)};return m(r,[]),i},h="colors",m="sizes",p="space",u={gap:p,gridGap:p,columnGap:p,gridColumnGap:p,rowGap:p,gridRowGap:p,inset:p,insetBlock:p,insetBlockEnd:p,insetBlockStart:p,insetInline:p,insetInlineEnd:p,insetInlineStart:p,margin:p,marginTop:p,marginRight:p,marginBottom:p,marginLeft:p,marginBlock:p,marginBlockEnd:p,marginBlockStart:p,marginInline:p,marginInlineEnd:p,marginInlineStart:p,padding:p,paddingTop:p,paddingRight:p,paddingBottom:p,paddingLeft:p,paddingBlock:p,paddingBlockEnd:p,paddingBlockStart:p,paddingInline:p,paddingInlineEnd:p,paddingInlineStart:p,top:p,right:p,bottom:p,left:p,scrollMargin:p,scrollMarginTop:p,scrollMarginRight:p,scrollMarginBottom:p,scrollMarginLeft:p,scrollMarginX:p,scrollMarginY:p,scrollMarginBlock:p,scrollMarginBlockEnd:p,scrollMarginBlockStart:p,scrollMarginInline:p,scrollMarginInlineEnd:p,scrollMarginInlineStart:p,scrollPadding:p,scrollPaddingTop:p,scrollPaddingRight:p,scrollPaddingBottom:p,scrollPaddingLeft:p,scrollPaddingX:p,scrollPaddingY:p,scrollPaddingBlock:p,scrollPaddingBlockEnd:p,scrollPaddingBlockStart:p,scrollPaddingInline:p,scrollPaddingInlineEnd:p,scrollPaddingInlineStart:p,fontSize:"fontSizes",background:h,backgroundColor:h,backgroundImage:h,border:h,borderColor:h,borderTopColor:h,borderRightColor:h,borderBottomColor:h,borderLeftColor:h,caretColor:h,color:h,columnRuleColor:h,outlineColor:h,fill:h,stroke:h,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",borderLeftWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",zIndex:"zIndices",transition:"transitions"},f=t=>{const e={};for(const n in t)for(const o in t[n])e["$"+n+"-"+o]=String(t[n][o]).replace(/\$[$-\w]+/g,(t=>/[^]\$/.test(t)?t:"$"+n+t));return e},S=(t,e)=>{for(var n=JSON.stringify(e),o=n.length,r=9;o;)r=Math.imul(r^n.charCodeAt(--o),9**9);return t+(r^r>>>9).toString(36).slice(-5)},b=s=>{s=t(s);const l={conditions:e({initial:"@media all"},s.conditions),theme:t(s.theme),utils:t(s.utils)},a=s.prefix||"sx",d=s.classProp||"className",c=g(l.utils,t(s.themeMap||u),l.conditions,l),h=new r(s.onImport),m=new r(s.onGlobal),p=new r(s.onThemed),b=new r(s.onStyled),y=(o,r)=>{r=o===t(o)?o:t(r),o="string"==typeof o?o:"";const s=f(r),l=(o=o||S(a,s)).replace(/^\w/,".$&"),d=c({[l]:s}),g=e((()=>(p.addCss(d),g)),{toString:()=>g().className,className:o,selector:l});for(const t in r){g[t]=n(null);for(const e in r[t])g[t][e]=new i(r[t][e],e,t)}return g},C=(t,n="")=>{const o=[],r=[];for(const e in t){const n=c({[e]:t[e]});("@import"===e?o:r).push(n)}return e((()=>(o.forEach(h.addCss,h),r.forEach(m.addCss,m),n)),{displayName:n,toString(){return String(this())}})};e(y,y(":root",l.theme)());const w=()=>h+p+m+b;return{config:s,getCssString:w,global:C,keyframes:t=>{const e=S(a,t);return C({["@keyframes "+e]:t},e)},css:(i,s)=>{const{variants:g,compoundVariants:h,defaultVariants:m,...p}=t(s||i),u=t(s&&i),f=S(a,p),y="."+f,C=c({[y]:p}),w=b.onChange&&(()=>b.onChange(b)),k=new r(w),B=new r(w),I=new r(w),x=new r(w),R=e(n(null),u.variants);for(const t in g){R[t]=e(n(null),R[t]);for(const e in g[t]){const o=g[t][e],r=f+S("",o)+"--"+t+"-"+e,i=c({["."+r]:o}),s=n(null),l=R[t][e];R[t][e]=t=>{const e=(l?l(t):[]).concat(r);if(null!=t){if(!s[t]){const n=s[t]=r+"--"+S("",t),i=c({[t]:{["."+n]:o}});B.addCss(i),e.push(n)}}else B.addCss(i);return e}}}function E(){const t=(u.classNames?u.classNames():[]).concat(f);return k.addCss(C),t}return b.addCss(k).addCss(B).addCss(I).addCss(x),e((function(e){const{css:n,...r}=t(e);let i=new Set(E());for(const t in m)!(t in r)&&t in R&&(r[t]=m[t]);d in r&&(String(r[d]).split(/\s+/).forEach(i.add,i),delete r[d]);for(const e of[].concat(h||[])){const{css:n,...o}=t(e);let s=n;new Set;if(t.keys(o).every((e=>{if(e in r){const n=r[e],i=o[e];if(n==i)return!0;if(n===t(n)){for(const t in n){const e=n[t],o=l.conditions[t]||t;i==e&&(s={[o]:s})}return!0}}}))){const t=f+S("",s)+"--comp",e=c({["."+t]:s});I.addCss(e),i.add(t)}}for(const t in r)if(t in R){const e=r[t],n=R[t];if(delete r[t],e in n)n[e]().forEach(i.add,i);else for(const t in e){const o=e[t],r=l.conditions[t]||t;o in n&&n[o](r).forEach(i.add,i)}}if(n){const t=f+S("",n)+"--css",e=c({["."+t]:n});x.addCss(e),i.add(t)}return i=o(i),{toString(){return this.className},className:r[d]=i.join(" "),selector:"."+i.join("."),props:r}}),{toString(){return String(this())},className:f,classNames:E,cssText:C,selector:y,variants:R})},theme:y,reset(){return h.clear(),p.clear(),m.clear(),b.clear(),s.onResets&&s.onResets.call(this),y.toString(),this},toString:w}},y=Symbol.for("react.element"),C=Symbol.for("react.forward_ref"),w=n=>{const o="object"==typeof document,r=o&&new Text(""),i=o&&new Text(""),s=o&&new Text(""),l=o&&new Text(""),a=o?t=>e=>t.data=e:()=>{};let d,c;n=e({onImport:a(r,"import"),onGlobal:a(i,"global"),onThemed:a(s,"themed"),onStyled:a(l,"styled"),onResets(){o&&(this.sync(),c.textContent=r.data=i.data=s.data=l.data="",c.append(r,i,s,l))}},n);const g=b(n),{theme:h}=g;function m(){return this.render().selector}function p(){return this().selector}return e(g,{sync(){o&&(d||(d=document.head||document.documentElement),c||(c=document.getElementById("stitches")||e(document.createElement("style"),{id:"stitches"})),c.parentNode||d.prepend(c))},theme:(...t)=>e(h(...t),{[Symbol.toPrimitive]:p,toString:p}),styled:new Proxy(((e="span",n)=>{const o=g.css(e,n);return t.setPrototypeOf({...o,[Symbol.toPrimitive]:m,toString:m,$$typeof:C,render(t,n){const{props:{as:r=e,...i},...s}=o(t);return g.sync(),{...s,constructor:void 0,$$typeof:y,props:i,ref:n,type:r,__v:0}}},t(e))}),{get:(t,e)=>e in t?"function"==typeof t[e]?t[e].bind(t):t[e]:t.bind(null,e)})}).reset()};globalThis.stitches=w;stitches.defaultThemeMap=u})() | ||
(()=>{var t=Object,{assign:e,create:n,defineProperties:o,getOwnPropertyDescriptors:r}=Object,s=(t,e)=>o(t,r(e)),{from:i}=Array,a=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 i(this).join("")}},l=class{constructor(t,e,n){this.value=t,this.token=e,this.scale=n}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+this.scale+"-"+this.token}toString(){return this.computedValue}},d=(t,e)=>t.reduce(((t,n)=>(t.push(...e.map((t=>/&/.test(t)?t.replace(/&/,n):t.replace(/^/,n+" ")))),t)),[]),c=e=>e!==t(e)||!(e.constructor===t||null==e.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(),m=/\s*,\s*(?![^()]*\))/,p=(t,e,n,o)=>r=>{let s="";const i=[];let a="";const l=({when:r,...p},u)=>{p=r?{...p,when:r}:p;for(let r in p){let f=p[r];if(r in t){let e=t[r](o)(f);if(e=c(e)?String(e):e,c(e))f=e;else{const t=JSON.stringify(e);a!==t&&(a=t,l(e,u),a="",f={})}}const S=64===r.charCodeAt(0);if(c(f)){for(const t of i)t[h]||(s+=t,s+="{",t[h]=!0);u.length&&!u[h]&&(s+=u.join(", "),s+="{",u[h]=!0),s+=(S?r:/^\$/.test(r)?"-"+r.replace(/\$/g,"-"):r.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase())))+(S?" ":":")+("number"==typeof f&&!g(r)&&f?f+"px":String(f).replace(/\$[$-\w]+/g,(t=>"var(-"+(!/.\$/.test(t)&&r in e?"-"+e[r]:"")+t.replace(/\$/g,"-")+")")))+";"}else{const t=(t,e,n)=>{const o=t?i.push(Object(e)):i.length;if(u.length&&u[h]&&(s+="}",u[h]=!1),l(n,t?u:u.length?d(u,e.split(m)):e.split(m)),t&&o)for(const t of i.splice(o-1))s+="}",t[h]=!1};if("when"===r)for(const e in f)t(!0,e in n?n[e]:e,f[e]);else t(S,r,f)}}u.length&&u[h]&&(s+="}",u[h]=!1)};return l(r,[]),s},u="colors",f="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:u,backgroundColor:u,backgroundImage:u,border:u,borderColor:u,borderTopColor:u,borderRightColor:u,borderBottomColor:u,borderLeftColor:u,caretColor:u,color:u,columnRuleColor:u,outlineColor:u,fill:u,stroke:u,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:f,minBlockSize:f,maxBlockSize:f,inlineSize:f,minInlineSize:f,maxInlineSize:f,width:f,minWidth:f,maxWidth:f,height:f,minHeight:f,maxHeight:f,flexBasis:f,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderLeftWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",zIndex:"zIndices",transition:"transitions"},y=t=>{const e={};for(const n in t)for(const o in t[n])e["$"+n+"-"+o]=String(t[n][o]).replace(/\$[$-\w]+/g,(t=>/[^]\$/.test(t)?t:"$"+n+t));return e},w=(t,e)=>{for(var n=JSON.stringify(e),o=n.length,r=9;o;)r=Math.imul(r^n.charCodeAt(--o),9**9);return t+(r^r>>>9).toString(36).slice(-5)},C=o=>{o=t(o);const r={conditions:e({initial:"@media all"},o.conditions),theme:t(o.theme),utils:t(o.utils)},d=o.prefix||"sx",c=o.classProp||"className",g=p(r.utils,t(o.themeMap||b),r.conditions,r),h=new a(o.onImport),m=new a(o.onGlobal),u=new a(o.onThemed),f=new a(o.onStyled),S=(e,o)=>{o=e===t(e)?e:t(o),e="string"==typeof e?e:"";const r=y(o),i=(e=e||w(d,r)).replace(/^\w/,".$&"),a=g({[i]:r}),c=s((()=>(u.addCss(a),c)),{toString:()=>(c(),e),get className(){return c(),e},get selector(){return c(),i}});for(const t in o){c[t]=n(null);for(const e in o[t])c[t][e]=new l(o[t][e],e,t)}return c},C=(t,n="")=>{const o=[],r=[];for(const e in t){const n=g({[e]:t[e]});("@import"===e?o:r).push(n)}const s=()=>(o.forEach(h.addCss,h),r.forEach(m.addCss,m),n);return e(s,{displayName:n,toString:()=>String(s())})};e(S,S(":root",r.theme)).toString();const k=()=>h+u+m+f;return{config:o,getCssString:k,global:C,keyframes:t=>{const e=w(d,t);return C({["@keyframes "+e]:t},e)},css:(o,l)=>{const{variants:h,compoundVariants:m,defaultVariants:p,...u}=t(l||o),S=t(l&&o),b=w(d,u),y=g({["."+b]:u}),C=f.onChange&&(()=>f.onChange(f)),k=new a(C),B=new a(C),I=new a(C),x=new a(C),R=e(n(null),S.variants);for(const t in h){R[t]=e(n(null),R[t]);for(const e in h[t]){const o=h[t][e],r=b+w("",o)+"--"+t+"-"+e,s=g({["."+r]:o}),i=n(null),a=R[t][e];R[t][e]=t=>{const e=(a?a(t):[]).concat(r);if(null!=t){if(!i[t]){const n=i[t]=r+"--"+w("",t),s=g({[t]:{["."+n]:o}});B.addCss(s),e.push(n)}}else B.addCss(s);return e}}}function P(){const t=(S.classNames?S.classNames():[]).concat(b);return k.addCss(y),t}f.addCss(k).addCss(B).addCss(I).addCss(x);const E=function(e){const{css:n,...o}=t(e);let s=new Set(P());for(const t in p)!(t in o)&&t in R&&(o[t]=p[t]);c in o&&(String(o[c]).split(/\s+/).forEach(s.add,s),delete o[c]);for(const e of[].concat(m||[])){const{css:n,...i}=t(e);let a=n;new Set;if(t.keys(i).every((e=>{if(e in o){const n=o[e],s=i[e];if(n==s)return!0;if(n===t(n)){for(const t in n){const e=n[t],o=r.conditions[t]||t;s==e&&(a={[o]:a})}return!0}}}))){const t=b+w("",a)+"--comp",e=g({["."+t]:a});I.addCss(e),s.add(t)}}for(const t in o)if(t in R){const e=o[t],n=R[t];if(delete o[t],e in n)n[e]().forEach(s.add,s);else for(const t in e){const o=e[t],i=r.conditions[t]||t;o in n&&n[o](i).forEach(s.add,s)}}if(n){const t=b+w("",n)+"--css",e=g({["."+t]:n});x.addCss(e),s.add(t)}s=i(s);const a=o[c]=s.join(" ");return{toString:()=>a,className:a,selector:"."+s.join("."),props:o}};return s(E,{toString:()=>E().className,get className(){return E().className},get selector(){return E().selector},classNames:P,variants:R})},theme:S,reset(){return h.clear(),u.clear(),m.clear(),f.clear(),o.onResets&&o.onResets.call(this),S.toString(),this},toString:k}},k=Symbol.for("react.element"),B=Symbol.for("react.forward_ref"),I=n=>{const o="object"==typeof document,r=o&&new Text(""),s=o&&new Text(""),i=o&&new Text(""),a=o&&new Text(""),l=o?t=>e=>t.data=e:()=>{};let d,c;n=e({onImport:l(r,"import"),onGlobal:l(s,"global"),onThemed:l(i,"themed"),onStyled:l(a,"styled"),onResets(){o&&(this.sync(),c.textContent=r.data=s.data=i.data=a.data="",c.append(r,s,i,a))}},n);const g=C(n);return e(g,{sync(){o&&(d||(d=document.head||document.documentElement),c||(c=document.getElementById("stitches")||e(document.createElement("style"),{id:"stitches"})),c.parentNode||d.prepend(c))},styled:new Proxy(((e="span",n)=>{const o=g.css(e,n);return t.setPrototypeOf({$$typeof:B,render(t,n){const{props:{as:r=e,...s},...i}=o(t);return g.sync(),{...i,constructor:void 0,$$typeof:k,props:s,ref:n,type:r,__v:0}},[Symbol.toPrimitive]:()=>o.selector,toString:()=>o.selector,get className(){return o.className},get selector(){return o.selector},classNames:o.classNames,variants:o.variants},t(e))}),{get:(t,e)=>e in t?"function"==typeof t[e]?t[e].bind(t):t[e]:t.bind(null,e)})}).reset()};globalThis.stitches=I;stitches.defaultThemeMap=b})() | ||
//# sourceMappingURL=stitches.react.map |
{ | ||
"name": "@stitches/react", | ||
"version": "0.1.0-canary.0", | ||
"version": "0.1.0-canary.1", | ||
"description": "The modern CSS-in-JS library", | ||
@@ -25,3 +25,3 @@ "type": "module", | ||
"dependencies": { | ||
"@stitches/core": "^0.1.0-canary.0" | ||
"@stitches/core": "^0.1.0-canary.1" | ||
}, | ||
@@ -79,3 +79,3 @@ "devDependencies": { | ||
], | ||
"gitHead": "d2d04f083ceaa3eaabe690220799f407993b559c" | ||
"gitHead": "148ea49a8ae4573d0ed01df7102af7935629bf0e" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
79174
251