@salty-css/react 0.0.1-alpha.133 → 0.0.1-alpha.135

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-D6baBDwH.cjs"),j=({animationName:m,params:l,appendInitialStyles:f,...t})=>{const r=m||u.toHash(t),o=(n={})=>{const{duration:e="500ms",easing:s="ease-in-out",delay:a="0s",iterationCount:i="1",direction:d="normal",fillMode:g="forwards",playState:p="running"}={...l,...n},c=`${r} ${e} ${s} ${a} ${i} ${d} ${g} ${p}`;if(!f)return c;const $=t.from||t["0%"];if(!$)return c;const b=u.parseStyles($,"");return`${c};${b}`},y=Object.entries(t).reduce((n,[e,s])=>{if(!s)return n;const a=u.parseStyles(s,""),i=typeof e=="number"?`${e}%`:e;return`${n}${i}{${a}}`},""),S=`@keyframes ${r} {${y}}`;return Object.assign(o,{toString:o,isKeyframes:!0,animationName:r,css:S,keyframes:t}),o};exports.keyframes=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-JzVmxd-u.cjs"),j=({animationName:m,params:l,appendInitialStyles:f,...t})=>{const r=m||u.toHash(t),o=(n={})=>{const{duration:e="500ms",easing:s="ease-in-out",delay:a="0s",iterationCount:i="1",direction:d="normal",fillMode:g="forwards",playState:p="running"}={...l,...n},c=`${r} ${e} ${s} ${a} ${i} ${d} ${g} ${p}`;if(!f)return c;const $=t.from||t["0%"];if(!$)return c;const b=u.parseStyles($,"");return`${c};${b}`},y=Object.entries(t).reduce((n,[e,s])=>{if(!s)return n;const a=u.parseStyles(s,""),i=typeof e=="number"?`${e}%`:e;return`${n}${i}{${a}}`},""),S=`@keyframes ${r} {${y}}`;return Object.assign(o,{toString:o,isKeyframes:!0,animationName:r,css:S,keyframes:t}),o};exports.keyframes=j;
package/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as j, p as m } from "./parse-styles-il2AlFcl.js";
1
+ import { t as j, p as m } from "./parse-styles-lB6EJuGj.js";
2
2
  const N = ({ animationName: u, params: f, appendInitialStyles: l, ...t }) => {
3
3
  const e = u || j(t), o = (s = {}) => {
4
4
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/react",
3
- "version": "0.0.1-alpha.133",
3
+ "version": "0.0.1-alpha.135",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@salty-css/core": "^0.0.1-alpha.133",
49
+ "@salty-css/core": "^0.0.1-alpha.135",
50
50
  "clsx": ">=2.x",
51
51
  "react": ">=19.x || >=18.3.x"
52
52
  }
@@ -0,0 +1,7 @@
1
+ "use strict";const O=require("./parse-tokens-p68muVgG.cjs"),E=e=>String.fromCharCode(e+(e>25?39:97)),P=(e,s)=>{let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=E(n%52)+t;return t=E(n%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},T=(e,s)=>{let t=s.length;for(;t;)e=e*33^s.charCodeAt(--t);return e},W=(e,s=5)=>{const t=T(5381,JSON.stringify(e))>>>0;return P(t,s)},k=(e,s)=>{if(typeof e!="string")return{result:e};if(!s)return{result:e};const t=[];return Object.values(s).forEach(n=>{const{pattern:a,transform:b}=n;e=e.replace(a,i=>{const{value:$,css:r}=b(i);return r&&t.push(r),$})}),{result:e,additionalCss:t}},h=(e,s,t)=>{if(!e)return"";const n=[],a=Object.entries(e).reduce((i,[$,r])=>{const o=$.trim();if(typeof r=="function"&&(r=r()),typeof r=="object"){if(!r)return i;if(o==="variants")return Object.entries(r).forEach(([p,c])=>{c&&Object.entries(c).forEach(([m,d])=>{if(!d)return;const l=`${s}.${p}-${m}`,y=h(d,l,t);n.push(y)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return r.forEach(p=>{const{css:c,...m}=p,d=Object.entries(m).reduce((y,[H,N])=>`${y}.${H}-${N}`,s),l=h(c,d,t);n.push(l)}),i;if(o.startsWith("@")){const p=h(r,s,t),c=`${o} {
2
+ ${p.replace(`
3
+ `,`
4
+ `)}
5
+ }`;return n.push(c),i}const f=$.includes("&")?o.replace("&",s):o.startsWith(":")?`${s}${o}`:`${s} ${o}`,u=h(r,f,t);return n.push(u),i}if(t!=null&&t.templates&&t.templates[o]){const u=r.split(".").reduce((p,c)=>p[c],t.templates[o]);if(u){const p=h(u,"");return`${i}${p}`}return console.warn(`Template "${o}" with path of "${r}" was not found in config!`),i}const V=o.startsWith("-")?o:O.dashCase(o),S=(f,u=";")=>i=`${i}${f}${u}`,j=f=>S(`${V}:${f}`);if(typeof r=="number")return j(r);if(typeof r!="string")if("toString"in r)r=r.toString();else return i;const{modifiers:w}=t||{},A=function*(){yield O.parseValueTokens(r),yield k(r,w)}();for(const{result:f,additionalCss:u=[]}of A)r=f,u.forEach(p=>{const c=h(p,"");S(c,"")});return j(r)},"");return a?s?[`${s} { ${a} }`,...n].join(`
6
+ `):a:n.join(`
7
+ `)};exports.parseStyles=h;exports.toHash=W;
@@ -0,0 +1,86 @@
1
+ import { d as P, p as W } from "./parse-tokens-YUi047xd.js";
2
+ const O = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), H = (e, s) => {
3
+ let t = "", n;
4
+ for (n = Math.abs(e); n > 52; n = n / 52 | 0) t = O(n % 52) + t;
5
+ return t = O(n % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
6
+ }, M = (e, s) => {
7
+ let t = s.length;
8
+ for (; t; ) e = e * 33 ^ s.charCodeAt(--t);
9
+ return e;
10
+ }, x = (e, s = 5) => {
11
+ const t = M(5381, JSON.stringify(e)) >>> 0;
12
+ return H(t, s);
13
+ }, T = (e, s) => {
14
+ if (typeof e != "string") return { result: e };
15
+ if (!s) return { result: e };
16
+ const t = [];
17
+ return Object.values(s).forEach((n) => {
18
+ const { pattern: h, transform: y } = n;
19
+ e = e.replace(h, (i) => {
20
+ const { value: $, css: r } = y(i);
21
+ return r && t.push(r), $;
22
+ });
23
+ }), { result: e, additionalCss: t };
24
+ }, a = (e, s, t) => {
25
+ if (!e) return "";
26
+ const n = [], h = Object.entries(e).reduce((i, [$, r]) => {
27
+ const o = $.trim();
28
+ if (typeof r == "function" && (r = r()), typeof r == "object") {
29
+ if (!r) return i;
30
+ if (o === "variants")
31
+ return Object.entries(r).forEach(([p, f]) => {
32
+ f && Object.entries(f).forEach(([m, d]) => {
33
+ if (!d) return;
34
+ const b = `${s}.${p}-${m}`, l = a(d, b, t);
35
+ n.push(l);
36
+ });
37
+ }), i;
38
+ if (o === "defaultVariants")
39
+ return i;
40
+ if (o === "compoundVariants")
41
+ return r.forEach((p) => {
42
+ const { css: f, ...m } = p, d = Object.entries(m).reduce((l, [A, N]) => `${l}.${A}-${N}`, s), b = a(f, d, t);
43
+ n.push(b);
44
+ }), i;
45
+ if (o.startsWith("@")) {
46
+ const p = a(r, s, t), f = `${o} {
47
+ ${p.replace(`
48
+ `, `
49
+ `)}
50
+ }`;
51
+ return n.push(f), i;
52
+ }
53
+ const c = $.includes("&") ? o.replace("&", s) : o.startsWith(":") ? `${s}${o}` : `${s} ${o}`, u = a(r, c, t);
54
+ return n.push(u), i;
55
+ }
56
+ if (t != null && t.templates && t.templates[o]) {
57
+ const u = r.split(".").reduce((p, f) => p[f], t.templates[o]);
58
+ if (u) {
59
+ const p = a(u, "");
60
+ return `${i}${p}`;
61
+ }
62
+ return console.warn(`Template "${o}" with path of "${r}" was not found in config!`), i;
63
+ }
64
+ const E = o.startsWith("-") ? o : P(o), j = (c, u = ";") => i = `${i}${c}${u}`, S = (c) => j(`${E}:${c}`);
65
+ if (typeof r == "number") return S(r);
66
+ if (typeof r != "string")
67
+ if ("toString" in r) r = r.toString();
68
+ else return i;
69
+ const { modifiers: V } = t || {}, w = function* () {
70
+ yield W(r), yield T(r, V);
71
+ }();
72
+ for (const { result: c, additionalCss: u = [] } of w)
73
+ r = c, u.forEach((p) => {
74
+ const f = a(p, "");
75
+ j(f, "");
76
+ });
77
+ return S(r);
78
+ }, "");
79
+ return h ? s ? [`${s} { ${h} }`, ...n].join(`
80
+ `) : h : n.join(`
81
+ `);
82
+ };
83
+ export {
84
+ a as p,
85
+ x as t
86
+ };
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var y=Object.defineProperty;var g=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>g(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./parse-styles-D6baBDwH.cjs"),f=require("./parse-tokens-p68muVgG.cjs"),N=require("./element-factory-D4kpeFoW.cjs"),_=e=>Object.keys(e);class b{constructor(t,s){c(this,"_isProd");c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return d.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return s&&t.push(s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get cssFileName(){return this._callerName?`c_${f.dashCase(this._callerName)}-${this.hash}-${this.priority}.css`:`${this.hash}-${this.priority}.css`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?_(this._context.config.templates):[]}get css(){var n;const{base:t={},variants:s={},compoundVariants:r=[]}=this.params,i={...t,variants:s,compoundVariants:r};return d.parseStyles(i,`.${this.cssClassName}`,this.priority,(n=this._context)==null?void 0:n.config)}get props(){const{element:t,variants:s={},compoundVariants:r=[],defaultVariants:i={},defaultProps:n={},passProps:u}=this.params,h=new Set([]),p=a=>{const o=i[a];o!==void 0?h.add(`${a}=${String(o)}`):h.add(a)};Object.keys(s).forEach(p),r.map(a=>Object.keys(a).forEach(p));const l=new Set([]);if(this.params.base){const a=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);a&&a.forEach(o=>{const m=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");m&&l.add(m)})}return{element:t,variantKeys:[...h],propValueKeys:[...l],passProps:u,defaultProps:n,attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:r,prod:i}=t;return this._isProd=i,this._callerName=s,this}}const $=(e,t)=>{const s=new b(e,t),r=N.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:s}),r};exports.styled=$;
1
+ "use strict";var y=Object.defineProperty;var g=(e,t,s)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var c=(e,t,s)=>g(e,typeof t!="symbol"?t+"":t,s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-JzVmxd-u.cjs"),f=require("./parse-tokens-p68muVgG.cjs"),N=require("./element-factory-D4kpeFoW.cjs"),_=e=>Object.keys(e);class b{constructor(t,s){c(this,"_isProd");c(this,"_callerName");c(this,"_context");this.tagName=t,this.params=s}get hash(){return u.toHash(this.params.base||this.params)}get priority(){var t;return typeof this.tagName=="function"||typeof this.tagName=="object"?(((t=this.tagName.generator)==null?void 0:t.priority)||0)+1:0}get classNames(){const t=[this.hash],{className:s}=this.params;return s&&t.push(s),t.join(" ")}get cssClassName(){return this.hash}get cssDisplayNameVar(){return`--${this.hash}-display-name: ${this._callerName};`}get cssFileName(){return this._callerName?`c_${f.dashCase(this._callerName)}-${this.hash}-${this.priority}.css`:`${this.hash}-${this.priority}.css`}get templateKeys(){var t;return(t=this._context)!=null&&t.config.templates?_(this._context.config.templates):[]}get css(){var n;const{base:t={},variants:s={},compoundVariants:r=[]}=this.params,i={...t,variants:s,compoundVariants:r};return u.parseStyles(i,`.${this.cssClassName}`,(n=this._context)==null?void 0:n.config)}get props(){const{element:t,variants:s={},compoundVariants:r=[],defaultVariants:i={},defaultProps:p={},passProps:n}=this.params,h=new Set([]),l=a=>{const o=i[a];o!==void 0?h.add(`${a}=${String(o)}`):h.add(a)};Object.keys(s).forEach(l),r.map(a=>Object.keys(a).forEach(l));const m=new Set([]);if(this.params.base){const a=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);a&&a.forEach(o=>{const d=o.replace(/\{props\.([\w\d]+)\}/gi,"$1");d&&m.add(d)})}return{element:t,variantKeys:[...h],propValueKeys:[...m],passProps:n,defaultProps:p,attr:{"data-component-name":this._isProd?void 0:this._callerName}}}_withBuildContext(t){this._context=t;const{name:s,config:r,prod:i}=t;return this._isProd=i,this._callerName=s,this}}const $=(e,t)=>{const s=new b(e,t),r=N.elementFactory(e,s.cssClassName,s.props,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:s}),r};exports.styled=$;
package/styled.js CHANGED
@@ -1,27 +1,27 @@
1
1
  var u = Object.defineProperty;
2
- var f = (e, t, s) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var c = (e, t, s) => f(e, typeof t != "symbol" ? t + "" : t, s);
4
- import { t as y, p as g } from "./parse-styles-il2AlFcl.js";
2
+ var f = (e, s, t) => s in e ? u(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
3
+ var c = (e, s, t) => f(e, typeof s != "symbol" ? s + "" : s, t);
4
+ import { t as g, p as y } from "./parse-styles-lB6EJuGj.js";
5
5
  import { d as N } from "./parse-tokens-YUi047xd.js";
6
6
  import { e as _ } from "./element-factory-C7JVLDq7.js";
7
7
  const $ = (e) => Object.keys(e);
8
8
  class b {
9
- constructor(t, s) {
9
+ constructor(s, t) {
10
10
  c(this, "_isProd");
11
11
  c(this, "_callerName");
12
12
  c(this, "_context");
13
- this.tagName = t, this.params = s;
13
+ this.tagName = s, this.params = t;
14
14
  }
15
15
  get hash() {
16
- return y(this.params.base || this.params);
16
+ return g(this.params.base || this.params);
17
17
  }
18
18
  get priority() {
19
- var t;
20
- return typeof this.tagName == "function" || typeof this.tagName == "object" ? (((t = this.tagName.generator) == null ? void 0 : t.priority) || 0) + 1 : 0;
19
+ var s;
20
+ return typeof this.tagName == "function" || typeof this.tagName == "object" ? (((s = this.tagName.generator) == null ? void 0 : s.priority) || 0) + 1 : 0;
21
21
  }
22
22
  get classNames() {
23
- const t = [this.hash], { className: s } = this.params;
24
- return s && t.push(s), t.join(" ");
23
+ const s = [this.hash], { className: t } = this.params;
24
+ return t && s.push(t), s.join(" ");
25
25
  }
26
26
  get cssClassName() {
27
27
  return this.hash;
@@ -33,51 +33,51 @@ class b {
33
33
  return this._callerName ? `c_${N(this._callerName)}-${this.hash}-${this.priority}.css` : `${this.hash}-${this.priority}.css`;
34
34
  }
35
35
  get templateKeys() {
36
- var t;
37
- return (t = this._context) != null && t.config.templates ? $(this._context.config.templates) : [];
36
+ var s;
37
+ return (s = this._context) != null && s.config.templates ? $(this._context.config.templates) : [];
38
38
  }
39
39
  get css() {
40
40
  var n;
41
- const { base: t = {}, variants: s = {}, compoundVariants: r = [] } = this.params, i = { ...t, variants: s, compoundVariants: r };
42
- return g(i, `.${this.cssClassName}`, this.priority, (n = this._context) == null ? void 0 : n.config);
41
+ const { base: s = {}, variants: t = {}, compoundVariants: r = [] } = this.params, i = { ...s, variants: t, compoundVariants: r };
42
+ return y(i, `.${this.cssClassName}`, (n = this._context) == null ? void 0 : n.config);
43
43
  }
44
44
  get props() {
45
- const { element: t, variants: s = {}, compoundVariants: r = [], defaultVariants: i = {}, defaultProps: n = {}, passProps: d } = this.params, h = /* @__PURE__ */ new Set([]), p = (a) => {
45
+ const { element: s, variants: t = {}, compoundVariants: r = [], defaultVariants: i = {}, defaultProps: p = {}, passProps: n } = this.params, h = /* @__PURE__ */ new Set([]), m = (a) => {
46
46
  const o = i[a];
47
47
  o !== void 0 ? h.add(`${a}=${String(o)}`) : h.add(a);
48
48
  };
49
- Object.keys(s).forEach(p), r.map((a) => Object.keys(a).forEach(p));
50
- const m = /* @__PURE__ */ new Set([]);
49
+ Object.keys(t).forEach(m), r.map((a) => Object.keys(a).forEach(m));
50
+ const l = /* @__PURE__ */ new Set([]);
51
51
  if (this.params.base) {
52
52
  const a = JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);
53
53
  a && a.forEach((o) => {
54
- const l = o.replace(/\{props\.([\w\d]+)\}/gi, "$1");
55
- l && m.add(l);
54
+ const d = o.replace(/\{props\.([\w\d]+)\}/gi, "$1");
55
+ d && l.add(d);
56
56
  });
57
57
  }
58
58
  return {
59
- element: t,
59
+ element: s,
60
60
  variantKeys: [...h],
61
- propValueKeys: [...m],
62
- passProps: d,
63
- defaultProps: n,
61
+ propValueKeys: [...l],
62
+ passProps: n,
63
+ defaultProps: p,
64
64
  attr: {
65
65
  "data-component-name": this._isProd ? void 0 : this._callerName
66
66
  }
67
67
  };
68
68
  }
69
- _withBuildContext(t) {
70
- this._context = t;
71
- const { name: s, config: r, prod: i } = t;
72
- return this._isProd = i, this._callerName = s, this;
69
+ _withBuildContext(s) {
70
+ this._context = s;
71
+ const { name: t, config: r, prod: i } = s;
72
+ return this._isProd = i, this._callerName = t, this;
73
73
  }
74
74
  }
75
- const j = (e, t) => {
76
- const s = new b(e, t), r = _(e, s.cssClassName, s.props, {
75
+ const j = (e, s) => {
76
+ const t = new b(e, s), r = _(e, t.cssClassName, t.props, {
77
77
  "data-unoptimized-client-component": !0
78
78
  });
79
79
  return Object.assign(r, {
80
- generator: s
80
+ generator: t
81
81
  }), r;
82
82
  };
83
83
  export {
@@ -1,7 +0,0 @@
1
- "use strict";const E=require("./parse-tokens-p68muVgG.cjs"),V=e=>String.fromCharCode(e+(e>25?39:97)),T=(e,r)=>{let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=V(n%52)+t;return t=V(n%52)+t,t.length<r?t=t.padStart(r,"a"):t.length>r&&(t=t.slice(-r)),t},W=(e,r)=>{let t=r.length;for(;t;)e=e*33^r.charCodeAt(--t);return e},k=(e,r=5)=>{const t=W(5381,JSON.stringify(e))>>>0;return T(t,r)},q=(e,r)=>{if(typeof e!="string")return{result:e};if(!r)return{result:e};const t=[];return Object.values(r).forEach(n=>{const{pattern:c,transform:a}=n;e=e.replace(c,d=>{const{value:i,css:m}=a(d);return m&&t.push(m),i})}),{result:e,additionalCss:t}},$=(e,r,t,n)=>{if(!e)return"";const c=[],a=Object.entries(e).reduce((i,[m,s])=>{const o=m.trim();if(typeof s=="function"&&(s=s()),typeof s=="object"){if(!s)return i;if(o==="variants")return Object.entries(s).forEach(([p,f])=>{f&&Object.entries(f).forEach(([l,b])=>{if(!b)return;const S=`${r}.${p}-${l}`,j=$(b,S,t,n);c.push(j)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return s.forEach(p=>{const{css:f,...l}=p,b=Object.entries(l).reduce((j,[N,P])=>`${j}.${N}-${P}`,r),S=$(f,b,t,n);c.push(S)}),i;if(o.startsWith("@")){const p=$(s,r,t,n),f=`${o} {
2
- ${p.replace(`
3
- `,`
4
- `)}
5
- }`;return c.push(f),i}const u=m.includes("&")?o.replace("&",r):o.startsWith(":")?`${r}${o}`:`${r} ${o}`,h=$(s,u,t,n);return c.push(h),i}if(n!=null&&n.templates&&n.templates[o]){const h=s.split(".").reduce((p,f)=>p[f],n.templates[o]);if(h){const p=$(h,"");return`${i}${p}`}return console.warn(`Template "${o}" with path of "${s}" was not found in config!`),i}const w=o.startsWith("-")?o:E.dashCase(o),y=(u,h=";")=>i=`${i}${u}${h}`,O=u=>y(`${w}:${u}`);if(typeof s=="number")return O(s);if(typeof s!="string")if("toString"in s)s=s.toString();else return i;const{modifiers:A}=n||{},H=function*(){yield E.parseValueTokens(s),yield q(s,A)}();for(const{result:u,additionalCss:h=[]}of H)s=u,h.forEach(p=>{const f=$(p,"");y(f,"")});return O(s)},"");if(!a)return c.join(`
6
- `);if(!r)return a;let d="";return t!==void 0?d=`@layer l${t} { ${r} { ${a} } }`:d=`${r} { ${a} }`,[d,...c].join(`
7
- `)};exports.parseStyles=$;exports.toHash=k;
@@ -1,89 +0,0 @@
1
- import { d as W, p as H } from "./parse-tokens-YUi047xd.js";
2
- const E = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), M = (e, r) => {
3
- let t = "", n;
4
- for (n = Math.abs(e); n > 52; n = n / 52 | 0) t = E(n % 52) + t;
5
- return t = E(n % 52) + t, t.length < r ? t = t.padStart(r, "a") : t.length > r && (t = t.slice(-r)), t;
6
- }, T = (e, r) => {
7
- let t = r.length;
8
- for (; t; ) e = e * 33 ^ r.charCodeAt(--t);
9
- return e;
10
- }, J = (e, r = 5) => {
11
- const t = T(5381, JSON.stringify(e)) >>> 0;
12
- return M(t, r);
13
- }, k = (e, r) => {
14
- if (typeof e != "string") return { result: e };
15
- if (!r) return { result: e };
16
- const t = [];
17
- return Object.values(r).forEach((n) => {
18
- const { pattern: c, transform: $ } = n;
19
- e = e.replace(c, (d) => {
20
- const { value: i, css: m } = $(d);
21
- return m && t.push(m), i;
22
- });
23
- }), { result: e, additionalCss: t };
24
- }, a = (e, r, t, n) => {
25
- if (!e) return "";
26
- const c = [], $ = Object.entries(e).reduce((i, [m, s]) => {
27
- const o = m.trim();
28
- if (typeof s == "function" && (s = s()), typeof s == "object") {
29
- if (!s) return i;
30
- if (o === "variants")
31
- return Object.entries(s).forEach(([p, f]) => {
32
- f && Object.entries(f).forEach(([j, b]) => {
33
- if (!b) return;
34
- const l = `${r}.${p}-${j}`, S = a(b, l, t, n);
35
- c.push(S);
36
- });
37
- }), i;
38
- if (o === "defaultVariants")
39
- return i;
40
- if (o === "compoundVariants")
41
- return s.forEach((p) => {
42
- const { css: f, ...j } = p, b = Object.entries(j).reduce((S, [N, P]) => `${S}.${N}-${P}`, r), l = a(f, b, t, n);
43
- c.push(l);
44
- }), i;
45
- if (o.startsWith("@")) {
46
- const p = a(s, r, t, n), f = `${o} {
47
- ${p.replace(`
48
- `, `
49
- `)}
50
- }`;
51
- return c.push(f), i;
52
- }
53
- const u = m.includes("&") ? o.replace("&", r) : o.startsWith(":") ? `${r}${o}` : `${r} ${o}`, h = a(s, u, t, n);
54
- return c.push(h), i;
55
- }
56
- if (n != null && n.templates && n.templates[o]) {
57
- const h = s.split(".").reduce((p, f) => p[f], n.templates[o]);
58
- if (h) {
59
- const p = a(h, "");
60
- return `${i}${p}`;
61
- }
62
- return console.warn(`Template "${o}" with path of "${s}" was not found in config!`), i;
63
- }
64
- const V = o.startsWith("-") ? o : W(o), y = (u, h = ";") => i = `${i}${u}${h}`, O = (u) => y(`${V}:${u}`);
65
- if (typeof s == "number") return O(s);
66
- if (typeof s != "string")
67
- if ("toString" in s) s = s.toString();
68
- else return i;
69
- const { modifiers: w } = n || {}, A = function* () {
70
- yield H(s), yield k(s, w);
71
- }();
72
- for (const { result: u, additionalCss: h = [] } of A)
73
- s = u, h.forEach((p) => {
74
- const f = a(p, "");
75
- y(f, "");
76
- });
77
- return O(s);
78
- }, "");
79
- if (!$) return c.join(`
80
- `);
81
- if (!r) return $;
82
- let d = "";
83
- return t !== void 0 ? d = `@layer l${t} { ${r} { ${$} } }` : d = `${r} { ${$} }`, [d, ...c].join(`
84
- `);
85
- };
86
- export {
87
- a as p,
88
- J as t
89
- };