Socket
Socket
Sign inDemoInstall

@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.10 to 0.1.0-canary.11

2

dist/stitches.core.iife.js

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

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

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

],
"gitHead": "3bd733186c62cc5dfb13a34f861198a6b420cddd"
"gitHead": "a188f820663448e0240c85b0544102040fe5248d"
}
import { DeclarationListWithRootAtRules, Properties } from './css-types'
export { DeclarationListWithRootAtRules }
export type CSSPropertiesToTokenScale = {

@@ -227,3 +229,3 @@ gap: 'space'

> = FlatInternalCSS<Conditions, Theme, Utils, ThemeMap> & {
[k: string]: InternalCSS<Conditions, Theme, Utils, ThemeMap> | number | string | { [k: string]: InternalCSS<Conditions, Theme, Utils, ThemeMap> }
[k: string]: InternalCSS<Conditions, Theme, Utils, ThemeMap> | number | string | undefined | { [k: string]: InternalCSS<Conditions, Theme, Utils, ThemeMap> }
}

@@ -282,3 +284,3 @@

type OmitKey<T, U extends keyof any> = T & { [P in U]?: unknown }
export type OmitKey<T, U extends keyof any> = T & { [P in U]?: unknown }

@@ -492,4 +494,9 @@ export type ThemeToken = {

declare const styled: TStyledSheetFactory
type TStyledSheetGlobal = (definition: OmitKey<Record<string, {}>, '@font-face' | '@import'> | DeclarationListWithRootAtRules) => GlobalRule
export { styled as default, styled as createCss }
export declare const createCss: TStyledSheetFactory
export declare const css: TStyledSheet<{ initial: '' }, {}, {}, '', CSSPropertiesToTokenScale>
export declare const global: (definition: OmitKey<Record<string, InternalCSS<{}, {}, {}, CSSPropertiesToTokenScale>>, '@font-face' | '@import'> | DeclarationListWithRootAtRules) => GlobalRule
export declare const keyframes: (definition: { [k: string]: FlatInternalCSS<{}, {}, {}, CSSPropertiesToTokenScale> }) => GlobalRule
export default createCss

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