@salty-css/react 0.0.1-alpha.254 → 0.0.1-alpha.256

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/class-name.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./styles-generator-BYrIpvu6.cjs");class u extends i.StylesGenerator{constructor(s){super(s),this._params=s}}const m=t=>{const s=new u(t),r=a=>{const e=new String(a);return Object.assign(e,{get isClassName(){return!0},variant:(n,c)=>{const o=`${n}-${c}`,l=`${e} ${o}`;return r(l)},generator:s}),e};return r(s.cssClassName)};exports.className=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./styles-generator-CihJA9Kx.cjs");class u extends i.StylesGenerator{constructor(s){super(s),this._params=s}}const m=t=>{const s=new u(t),r=a=>{const e=new String(a);return Object.assign(e,{get isClassName(){return!0},variant:(n,c)=>{const o=`${n}-${c}`,l=`${e} ${o}`;return r(l)},generator:s}),e};return r(s.cssClassName)};exports.className=m;
package/class-name.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as i } from "./styles-generator-CwRnWDqg.js";
1
+ import { S as i } from "./styles-generator-BQCMgM_V.js";
2
2
  class m extends i {
3
3
  constructor(s) {
4
4
  super(s), this._params = s;
@@ -0,0 +1,67 @@
1
+ import { forwardRef as v, createElement as C } from "react";
2
+ import { p as g, d as N } from "./parse-tokens-Cbbbt7eO.js";
3
+ function K(s) {
4
+ var i, e, t = "";
5
+ if (typeof s == "string" || typeof s == "number") t += s;
6
+ else if (typeof s == "object") if (Array.isArray(s)) {
7
+ var d = s.length;
8
+ for (i = 0; i < d; i++) s[i] && (e = K(s[i])) && (t && (t += " "), t += e);
9
+ } else for (e in s) s[e] && (t && (t += " "), t += e);
10
+ return t;
11
+ }
12
+ function A() {
13
+ for (var s, i, e = 0, t = "", d = arguments.length; e < d; e++) (s = arguments[e]) && (i = K(s)) && (t && (t += " "), t += i);
14
+ return t;
15
+ }
16
+ const R = ["passProps"], x = (s, i = "", e = {}, t) => {
17
+ const j = v(({
18
+ extend: o = s,
19
+ element: S = e.element,
20
+ className: O = "",
21
+ children: $,
22
+ passProps: u = e.passProps,
23
+ _vks: l = /* @__PURE__ */ new Set(),
24
+ ...r
25
+ }, w) => {
26
+ const f = { passProps: u };
27
+ e.attr && Object.assign(f, e.attr), t && Object.assign(f, t), e.defaultProps && Object.assign(r, e.defaultProps), r && Object.assign(f, r);
28
+ const b = /* @__PURE__ */ new Set([...i.split(" "), ...O.split(" ")]), y = typeof o == "function" || typeof o == "object", h = y && "isStyled" in o, E = y ? o : S || o;
29
+ if (!E) throw new Error("No element provided");
30
+ const m = f.style || {};
31
+ f.style || (f.style = m), Object.entries(m).forEach(([n, a]) => {
32
+ const c = g(a);
33
+ c && (m[n] = c.transformed);
34
+ }), e.propValueKeys && e.propValueKeys.forEach((n) => {
35
+ const a = `css-${n}`, c = r[a];
36
+ if (c === void 0) return;
37
+ const p = `--props-${N(n)}`;
38
+ m[p] = c, l && l.add(a);
39
+ }), e.variantKeys && e.variantKeys.forEach((n) => {
40
+ const [a, c] = n.split("=");
41
+ r[a] !== void 0 ? (b.add(`${a}-${r[a]}`), l && l.add(a)) : c !== void 0 && b.add(`${a}-${c}`);
42
+ }), l && (!y || !h) ? l.forEach((n) => {
43
+ if (!u) return delete f[n];
44
+ if (u !== !0 && !u.includes(n))
45
+ return delete f[n];
46
+ }) : h && Object.assign(f, { _vks: l }), h || R.forEach((n) => delete f[n]);
47
+ const V = A(...b);
48
+ return C(
49
+ E,
50
+ {
51
+ element: y ? S : void 0,
52
+ className: V,
53
+ ref: w,
54
+ ...f
55
+ },
56
+ $
57
+ );
58
+ });
59
+ return Object.assign(j, {
60
+ isStyled: !0,
61
+ className: i,
62
+ toString: () => `.${i}`
63
+ }), j;
64
+ };
65
+ export {
66
+ x as e
67
+ };
@@ -0,0 +1 @@
1
+ "use strict";const K=require("react"),O=require("./parse-tokens-BnDwbP7V.cjs");function $(s){var i,e,t="";if(typeof s=="string"||typeof s=="number")t+=s;else if(typeof s=="object")if(Array.isArray(s)){var o=s.length;for(i=0;i<o;i++)s[i]&&(e=$(s[i]))&&(t&&(t+=" "),t+=e)}else for(e in s)s[e]&&(t&&(t+=" "),t+=e);return t}function q(){for(var s,i,e=0,t="",o=arguments.length;e<o;e++)(s=arguments[e])&&(i=$(s))&&(t&&(t+=" "),t+=i);return t}const N=["passProps"],A=(s,i="",e={},t)=>{const o=({extend:u=s,element:S=e.element,className:w="",children:V,passProps:d=e.passProps,_vks:r=new Set,...l},v)=>{const f={passProps:d};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),e.defaultProps&&Object.assign(l,e.defaultProps),l&&Object.assign(f,l);const b=new Set([...i.split(" "),...w.split(" ")]),y=typeof u=="function"||typeof u=="object",h=y&&"isStyled"in u,E=y?u:S||u;if(!E)throw new Error("No element provided");const m=f.style||{};f.style||(f.style=m),Object.entries(m).forEach(([n,a])=>{const c=O.parseVariableTokens(a);c&&(m[n]=c.transformed)}),e.propValueKeys&&e.propValueKeys.forEach(n=>{const a=`css-${n}`,c=l[a];if(c===void 0)return;const g=`--props-${O.dashCase(n)}`;m[g]=c,r&&r.add(a)}),e.variantKeys&&e.variantKeys.forEach(n=>{const[a,c]=n.split("=");l[a]!==void 0?(b.add(`${a}-${l[a]}`),r&&r.add(a)):c!==void 0&&b.add(`${a}-${c}`)}),r&&(!y||!h)?r.forEach(n=>{if(!d)return delete f[n];if(d!==!0&&!d.includes(n))return delete f[n]}):h&&Object.assign(f,{_vks:r}),h||N.forEach(n=>delete f[n]);const C=q(...b);return K.createElement(E,{element:y?S:void 0,className:C,ref:v,...f},V)},j=K.forwardRef(o);return Object.assign(j,{isStyled:!0,className:i,toString:()=>`.${i}`}),j};exports.elementFactory=A;
package/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./parse-styles-DWI60Z4z.cjs"),w=async({animationName:l,params:u,appendInitialStyles:y,...t})=>{const e=l||i.toHash(t),r=async(n={})=>{const{duration:s="500ms",easing:o="ease-in-out",delay:c="0s",iterationCount:S="1",direction:p="normal",fillMode:g="forwards",playState:b="running"}={...u,...n},a=`${e} ${s} ${o} ${c} ${S} ${p} ${g} ${b}`;if(!y)return a;const m=t.from||t["0%"];if(!m)return a;const j=await i.parseAndJoinStyles(m,"");return`${a};${j}`},$=Object.entries(t).map(async([n,s])=>{if(!s)return"";const o=await i.parseAndJoinStyles(s,"");return`${typeof n=="number"?`${n}%`:n}{${o}}`}),d=(await Promise.all($)).join(""),f=`@keyframes ${e} {${d}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:e,css:f,keyframes:t}),r};exports.keyframes=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./parse-styles-CfxJtQu_.cjs"),w=async({animationName:l,params:u,appendInitialStyles:y,...t})=>{const e=l||i.toHash(t),r=async(n={})=>{const{duration:s="500ms",easing:o="ease-in-out",delay:c="0s",iterationCount:S="1",direction:p="normal",fillMode:g="forwards",playState:b="running"}={...u,...n},a=`${e} ${s} ${o} ${c} ${S} ${p} ${g} ${b}`;if(!y)return a;const m=t.from||t["0%"];if(!m)return a;const j=await i.parseAndJoinStyles(m,"");return`${a};${j}`},$=Object.entries(t).map(async([n,s])=>{if(!s)return"";const o=await i.parseAndJoinStyles(s,"");return`${typeof n=="number"?`${n}%`:n}{${o}}`}),d=(await Promise.all($)).join(""),f=`@keyframes ${e} {${d}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:e,css:f,keyframes:t}),r};exports.keyframes=w;
package/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as j, p as m } from "./parse-styles-9pzOKdzH.js";
1
+ import { t as j, p as m } from "./parse-styles-anFzH8TT.js";
2
2
  const h = async ({ animationName: $, params: l, appendInitialStyles: u, ...t }) => {
3
3
  const r = $ || j(t), e = async (n = {}) => {
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.254",
3
+ "version": "0.0.1-alpha.256",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "@salty-css/core": "^0.0.1-alpha.254",
69
+ "@salty-css/core": "^0.0.1-alpha.256",
70
70
  "clsx": ">=2.x",
71
71
  "react": ">=19.x || >=18.3.x"
72
72
  }
@@ -0,0 +1,5 @@
1
+ "use strict";const N=require("./parse-tokens-BnDwbP7V.cjs"),J=r=>s=>{if(typeof s!="string"||!r)return;let t=s;const a=[];return Object.values(r).forEach(o=>{const{pattern:S,transform:$}=o;t=t.replace(S,j=>{const{value:A,css:b}=$(j);return b&&a.push(b),A})}),{transformed:t,additionalCss:a}},z=r=>String.fromCharCode(r+(r>25?39:97)),M=(r,s)=>{let t="",a;for(a=Math.abs(r);a>52;a=a/52|0)t=z(a%52)+t;return t=z(a%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},T=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},U=(r,s=5)=>{const t=T(5381,JSON.stringify(r))>>>0;return M(t,s)},q=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],Q=(r,s,t)=>{if(q.some(o=>typeof o=="string"?o===r:o.test(r))){const o=(t==null?void 0:t.defaultUnit)||"px";return`${s}${o}`}return`${s}`},_=["Webkit","Moz","ms","O"],F=r=>r.startsWith("-")?r:_.some(s=>r.startsWith(s))?`-${N.dashCase(r)}`:N.dashCase(r),y=async(r,s="",t,a=!1)=>{if(!r)throw new Error("No styles provided to parseStyles function!");const o=new Set,S=Object.entries(r),$=async([f,e])=>{var C;const n=f.trim().replace(/^\?+/g,""),w=F(n),u=(c,d=";")=>`${w}:${c}${d}`,P={scope:s,config:t};if(typeof e=="function")return $([f,e(P)]);if(e instanceof Promise)return $([f,await e]);if(t!=null&&t.templates&&t.templatePaths[n])try{const[c,d]=t.templatePaths[n].split(";;"),i=await import(d),l=d.includes("salty.config"),p=l?i[c].templates:i[c],h=l?p[n]:p.params[n];if(p&&typeof h=="function"){const E=await h(e),[m]=await y(E,"");return m}}catch(c){console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`,c);return}if(t!=null&&t.templates&&t.templates[n]){if(a)return;const d=e.split(".").reduce((i,l)=>i[l],t.templates[n]);if(d){const[i]=await y(d,"");return i}console.warn(`Template "${n}" with path of "${e}" was not found in config!`);return}if(typeof e=="object"){if(!e)return;if(e.isColor)return u(e.toString());if(n==="defaultVariants")return;if(n==="variants"){const i=Object.entries(e);for(const[l,p]of i){if(!p)continue;const h=Object.entries(p);for(const[E,m]of h){if(!m)continue;const x=`${s}.${l}-${E}`;(await y(m,x,t)).forEach(H=>o.add(H))}}return}if(n==="compoundVariants"){for(const i of e){const{css:l,...p}=i,h=Object.entries(p).reduce((m,[x,V])=>`${m}.${x}-${V}`,s);(await y(l,h,t)).forEach(m=>o.add(m))}return}if(n.startsWith("@")){const i=((C=t==null?void 0:t.mediaQueries)==null?void 0:C[n])||n,l=await W(e,s,t),p=`${i} { ${l} }`;o.add(p);return}const c=f.includes("&")?n.replaceAll("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await y(e,c,t)).forEach(i=>o.add(i));return}if(typeof e=="number"){const c=Q(w,e,t);return u(c)}if(typeof e!="string")if("toString"in e)e=e.toString();else throw new Error(`Invalid value type for property ${w}`);return u(e)},j=S.map($),{modifiers:A}=t||{},b=[N.parseValueTokens(),J(A)],O=(await Promise.all(j).then(f=>Promise.all(f.map(e=>b.reduce(async(n,w)=>{const u=await n;if(!u)return u;const P=await w(u);if(!P)return u;const{transformed:C,additionalCss:c}=P;let d="";if(c)for(const i of c)d+=await W(i,"");return`${d}${C}`},Promise.resolve(e)))))).filter(f=>f!==void 0).join(`
2
+ `);if(!O.trim())return Array.from(o);const v=s?`${s} {
3
+ ${O}
4
+ }`:O;return o.has(v)?Array.from(o):[v,...o]},W=async(r,s,t,a=!1)=>(await y(r,s,t,a)).join(`
5
+ `);exports.parseAndJoinStyles=W;exports.toHash=U;
@@ -0,0 +1,145 @@
1
+ import { d as v, a as U } from "./parse-tokens-Cbbbt7eO.js";
2
+ const H = (r) => (s) => {
3
+ if (typeof s != "string" || !r) return;
4
+ let t = s;
5
+ const i = [];
6
+ return Object.values(r).forEach((o) => {
7
+ const { pattern: j, transform: y } = o;
8
+ t = t.replace(j, (S) => {
9
+ const { value: x, css: b } = y(S);
10
+ return b && i.push(b), x;
11
+ });
12
+ }), { transformed: t, additionalCss: i };
13
+ }, V = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), J = (r, s) => {
14
+ let t = "", i;
15
+ for (i = Math.abs(r); i > 52; i = i / 52 | 0) t = V(i % 52) + t;
16
+ return t = V(i % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
17
+ }, Q = (r, s) => {
18
+ let t = s.length;
19
+ for (; t; ) r = r * 33 ^ s.charCodeAt(--t);
20
+ return r;
21
+ }, G = (r, s = 5) => {
22
+ const t = Q(5381, JSON.stringify(r)) >>> 0;
23
+ return J(t, s);
24
+ }, T = [
25
+ "top",
26
+ "right",
27
+ "bottom",
28
+ "left",
29
+ "min-width",
30
+ /.*width.*/,
31
+ /^[^line]*height.*/,
32
+ // Exclude line-height
33
+ /padding.*/,
34
+ /margin.*/,
35
+ /border.*/,
36
+ /inset.*/,
37
+ /.*radius.*/,
38
+ /.*spacing.*/,
39
+ /.*gap.*/,
40
+ /.*indent.*/,
41
+ /.*offset.*/,
42
+ /.*size.*/,
43
+ /.*thickness.*/,
44
+ /.*font-size.*/
45
+ ], _ = (r, s, t) => {
46
+ if (T.some((o) => typeof o == "string" ? o === r : o.test(r))) {
47
+ const o = (t == null ? void 0 : t.defaultUnit) || "px";
48
+ return `${s}${o}`;
49
+ }
50
+ return `${s}`;
51
+ }, q = ["Webkit", "Moz", "ms", "O"], F = (r) => r.startsWith("-") ? r : q.some((s) => r.startsWith(s)) ? `-${v(r)}` : v(r), $ = async (r, s = "", t, i = !1) => {
52
+ if (!r) throw new Error("No styles provided to parseStyles function!");
53
+ const o = /* @__PURE__ */ new Set(), j = Object.entries(r), y = async ([f, e]) => {
54
+ var E;
55
+ const n = f.trim().replace(/^\?+/g, ""), w = F(n), m = (c, d = ";") => `${w}:${c}${d}`, P = { scope: s, config: t };
56
+ if (typeof e == "function") return y([f, e(P)]);
57
+ if (e instanceof Promise) return y([f, await e]);
58
+ if (t != null && t.templates && t.templatePaths[n])
59
+ try {
60
+ const [c, d] = t.templatePaths[n].split(";;"), a = await import(d), p = d.includes("salty.config"), l = p ? a[c].templates : a[c], h = p ? l[n] : l.params[n];
61
+ if (l && typeof h == "function") {
62
+ const C = await h(e), [u] = await $(C, "");
63
+ return u;
64
+ }
65
+ } catch (c) {
66
+ console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`, c);
67
+ return;
68
+ }
69
+ if (t != null && t.templates && t.templates[n]) {
70
+ if (i) return;
71
+ const d = e.split(".").reduce((a, p) => a[p], t.templates[n]);
72
+ if (d) {
73
+ const [a] = await $(d, "");
74
+ return a;
75
+ }
76
+ console.warn(`Template "${n}" with path of "${e}" was not found in config!`);
77
+ return;
78
+ }
79
+ if (typeof e == "object") {
80
+ if (!e) return;
81
+ if (e.isColor) return m(e.toString());
82
+ if (n === "defaultVariants") return;
83
+ if (n === "variants") {
84
+ const a = Object.entries(e);
85
+ for (const [p, l] of a) {
86
+ if (!l) continue;
87
+ const h = Object.entries(l);
88
+ for (const [C, u] of h) {
89
+ if (!u) continue;
90
+ const O = `${s}.${p}-${C}`;
91
+ (await $(u, O, t)).forEach((M) => o.add(M));
92
+ }
93
+ }
94
+ return;
95
+ }
96
+ if (n === "compoundVariants") {
97
+ for (const a of e) {
98
+ const { css: p, ...l } = a, h = Object.entries(l).reduce((u, [O, W]) => `${u}.${O}-${W}`, s);
99
+ (await $(p, h, t)).forEach((u) => o.add(u));
100
+ }
101
+ return;
102
+ }
103
+ if (n.startsWith("@")) {
104
+ const a = ((E = t == null ? void 0 : t.mediaQueries) == null ? void 0 : E[n]) || n, p = await z(e, s, t), l = `${a} { ${p} }`;
105
+ o.add(l);
106
+ return;
107
+ }
108
+ const c = f.includes("&") ? n.replaceAll("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
109
+ (await $(e, c, t)).forEach((a) => o.add(a));
110
+ return;
111
+ }
112
+ if (typeof e == "number") {
113
+ const c = _(w, e, t);
114
+ return m(c);
115
+ }
116
+ if (typeof e != "string")
117
+ if ("toString" in e) e = e.toString();
118
+ else throw new Error(`Invalid value type for property ${w}`);
119
+ return m(e);
120
+ }, S = j.map(y), { modifiers: x } = t || {}, b = [U(), H(x)], A = (await Promise.all(S).then((f) => Promise.all(
121
+ f.map((e) => b.reduce(async (n, w) => {
122
+ const m = await n;
123
+ if (!m) return m;
124
+ const P = await w(m);
125
+ if (!P) return m;
126
+ const { transformed: E, additionalCss: c } = P;
127
+ let d = "";
128
+ if (c)
129
+ for (const a of c)
130
+ d += await z(a, "");
131
+ return `${d}${E}`;
132
+ }, Promise.resolve(e)))
133
+ ))).filter((f) => f !== void 0).join(`
134
+ `);
135
+ if (!A.trim()) return Array.from(o);
136
+ const N = s ? `${s} {
137
+ ${A}
138
+ }` : A;
139
+ return o.has(N) ? Array.from(o) : [N, ...o];
140
+ }, z = async (r, s, t, i = !1) => (await $(r, s, t, i)).join(`
141
+ `);
142
+ export {
143
+ z as p,
144
+ G as t
145
+ };
@@ -1,12 +1,12 @@
1
1
  function a(e) {
2
- return e ? typeof e != "string" ? a(String(e)) : e.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (r, t) => (t > 0 ? "-" : "") + r.toLowerCase()) : "";
2
+ return e ? typeof e != "string" ? a(String(e)) : e.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (r, n) => (n > 0 ? "-" : "") + r.toLowerCase()) : "";
3
3
  }
4
4
  const o = (e) => (r) => typeof r != "string" || !/\{[^{}]+\}/g.test(r) ? void 0 : { transformed: r.replace(/\{([^{}]+)\}/g, (...s) => {
5
- const n = a(s[1].replaceAll(".", "-"));
6
- return n.startsWith("-") ? `-${n}` : `var(--${n})`;
7
- }) }, f = o();
5
+ const t = a(s[1].replaceAll(".", "-"));
6
+ return t.startsWith("-") ? `-${t}` : `var(--${t})`;
7
+ }) }, c = o();
8
8
  export {
9
9
  o as a,
10
10
  a as d,
11
- f as p
11
+ c as p
12
12
  };
package/styled-client.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-C2FUkBsK.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-Dt_Z9aHy.cjs"),n=(e,t,r)=>l.elementFactory(e,t,r);exports.styledClient=n;
package/styled-client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e as o } from "./element-factory-BZyANreM.js";
1
+ import { e as o } from "./element-factory-DrGBPkh2.js";
2
2
  const l = (e, t, r) => o(e, t, r);
3
3
  export {
4
4
  l as styledClient
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./styles-generator-BYrIpvu6.cjs"),g=require("./parse-tokens-BnDwbP7V.cjs"),b=require("./element-factory-C2FUkBsK.cjs");class S extends h.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((e=this.tagName.generator)==null?void 0:e.priority)||0)+1:0}get clientProps(){const{element:e,variants:t={},compoundVariants:r=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:f}=this.buildContext,o=new Set([]),i=s=>{const a=d[s];a!==void 0?o.add(`${s}=${String(a)}`):o.add(s)};Object.keys(t).forEach(i),r.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);s&&s.forEach(a=>{const p=a.replace(/\{(?:-)?props\.([^}]+)\}/gi,"$1"),m=g.dashCase(p);p&&c.add(m)})}return{element:e,variantKeys:[...o],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":f?void 0:y}}}}const v=(n,e)=>{const t=new S(n,e),r=b.elementFactory(n,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:t}),r};exports.styled=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./styles-generator-CihJA9Kx.cjs"),g=require("./parse-tokens-BnDwbP7V.cjs"),b=require("./element-factory-Dt_Z9aHy.cjs");class v extends h.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((e=this.tagName.generator)==null?void 0:e.priority)||0)+1:0}get clientProps(){const{element:e,variants:t={},compoundVariants:r=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:m}=this.buildContext,n=new Set([]),i=s=>{const a=d[s];a!==void 0?n.add(`${s}=${String(a)}`):n.add(s)};Object.keys(t).forEach(i),r.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);s&&s.forEach(a=>{const p=a.replace(/\{(?:-)?props\.([^}]+)\}/gi,"$1"),f=g.dashCase(p);p&&c.add(f)})}return{element:e,variantKeys:[...n],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":m?void 0:y}}}}const S=(o,e)=>{const t=new v(o,e),r=b.elementFactory(o,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:t}),r};exports.styled=S;
package/styled.js CHANGED
@@ -1,7 +1,7 @@
1
- import { S as y } from "./styles-generator-CwRnWDqg.js";
2
- import { d as g } from "./parse-tokens-BqB-N10P.js";
3
- import { e as b } from "./element-factory-BZyANreM.js";
4
- class S extends y {
1
+ import { S as y } from "./styles-generator-BQCMgM_V.js";
2
+ import { d as g } from "./parse-tokens-Cbbbt7eO.js";
3
+ import { e as v } from "./element-factory-DrGBPkh2.js";
4
+ class b extends y {
5
5
  constructor(e, t) {
6
6
  super(t), this.tagName = e, this._params = t;
7
7
  }
@@ -10,11 +10,11 @@ class S extends y {
10
10
  return this.params.priority ? this.params.priority : typeof this.tagName == "function" || typeof this.tagName == "object" ? (((e = this.tagName.generator) == null ? void 0 : e.priority) || 0) + 1 : 0;
11
11
  }
12
12
  get clientProps() {
13
- const { element: e, variants: t = {}, compoundVariants: s = [], defaultVariants: d = {}, defaultProps: m = {}, passProps: f } = this.params, { callerName: l, isProduction: u } = this.buildContext, o = /* @__PURE__ */ new Set([]), i = (a) => {
13
+ const { element: e, variants: t = {}, compoundVariants: s = [], defaultVariants: d = {}, defaultProps: m = {}, passProps: l } = this.params, { callerName: f, isProduction: u } = this.buildContext, i = /* @__PURE__ */ new Set([]), n = (a) => {
14
14
  const r = d[a];
15
- r !== void 0 ? o.add(`${a}=${String(r)}`) : o.add(a);
15
+ r !== void 0 ? i.add(`${a}=${String(r)}`) : i.add(a);
16
16
  };
17
- Object.keys(t).forEach(i), s.map((a) => Object.keys(a).forEach(i));
17
+ Object.keys(t).forEach(n), s.map((a) => Object.keys(a).forEach(n));
18
18
  const c = /* @__PURE__ */ new Set([]);
19
19
  if (this.params.base) {
20
20
  const a = JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);
@@ -25,18 +25,18 @@ class S extends y {
25
25
  }
26
26
  return {
27
27
  element: e,
28
- variantKeys: [...o],
28
+ variantKeys: [...i],
29
29
  propValueKeys: [...c],
30
- passProps: f,
30
+ passProps: l,
31
31
  defaultProps: m,
32
32
  attr: {
33
- "data-component-name": u ? void 0 : l
33
+ "data-component-name": u ? void 0 : f
34
34
  }
35
35
  };
36
36
  }
37
37
  }
38
- const K = (n, e) => {
39
- const t = new S(n, e), s = b(n, t.cssClassName, t.clientProps, {
38
+ const K = (o, e) => {
39
+ const t = new b(o, e), s = v(o, t.cssClassName, t.clientProps, {
40
40
  "data-unoptimized-client-component": !0
41
41
  });
42
42
  return Object.assign(s, {
@@ -1,8 +1,8 @@
1
1
  var c = Object.defineProperty;
2
2
  var l = (a, s, t) => s in a ? c(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
3
  var o = (a, s, t) => l(a, typeof s != "symbol" ? s + "" : s, t);
4
- import { t as n, p as d } from "./parse-styles-9pzOKdzH.js";
5
- import { d as h } from "./parse-tokens-BqB-N10P.js";
4
+ import { t as n, p as d } from "./parse-styles-anFzH8TT.js";
5
+ import { d as h } from "./parse-tokens-Cbbbt7eO.js";
6
6
  class C {
7
7
  constructor(s) {
8
8
  o(this, "buildContext", {});
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var l=(a,s,t)=>s in a?c(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var o=(a,s,t)=>l(a,typeof s!="symbol"?s+"":s,t);const n=require("./parse-styles-DWI60Z4z.cjs"),h=require("./parse-tokens-BnDwbP7V.cjs");class u{constructor(s){o(this,"buildContext",{});this.params=s}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){const{base:s,variants:t,compoundVariants:e}=this.params;return n.toHash({base:s,variants:t,compoundVariants:e})}get cssClassName(){return this.hash}get classNames(){const s=new Set([this.cssClassName]),{className:t}=this.params;return typeof t=="string"&&s.add(t),typeof t=="object"&&t.forEach(e=>s.add(e)),this.getTemplateClasses().forEach(e=>s.add(e)),this.buildContext.classNames&&this.buildContext.classNames.forEach(e=>s.add(e)),[...s].join(" ")}get cssFileName(){const{callerName:s}=this.buildContext;return s?`cl_${h.dashCase(s)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:t={},compoundVariants:e=[]}=this.params,{config:r}=this.buildContext,i={...s,variants:t,compoundVariants:e};return n.parseAndJoinStyles(i,`.${this.cssClassName}`,r,this.isRoot)}getTemplateClasses(s=this.buildContext.config){if(!(s!=null&&s.templates)||!this.params.base||this.priority>0)return[];const t=Object.keys(s.templates);return Object.entries(this.params.base).reduce((e,[r,i])=>(t.includes(r)&&e.push("t_"+n.toHash(h.dashCase(`${r}-${i}`),4)),e),[])}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
1
+ "use strict";var c=Object.defineProperty;var l=(a,s,t)=>s in a?c(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var o=(a,s,t)=>l(a,typeof s!="symbol"?s+"":s,t);const n=require("./parse-styles-CfxJtQu_.cjs"),h=require("./parse-tokens-BnDwbP7V.cjs");class u{constructor(s){o(this,"buildContext",{});this.params=s}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){const{base:s,variants:t,compoundVariants:e}=this.params;return n.toHash({base:s,variants:t,compoundVariants:e})}get cssClassName(){return this.hash}get classNames(){const s=new Set([this.cssClassName]),{className:t}=this.params;return typeof t=="string"&&s.add(t),typeof t=="object"&&t.forEach(e=>s.add(e)),this.getTemplateClasses().forEach(e=>s.add(e)),this.buildContext.classNames&&this.buildContext.classNames.forEach(e=>s.add(e)),[...s].join(" ")}get cssFileName(){const{callerName:s}=this.buildContext;return s?`cl_${h.dashCase(s)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:t={},compoundVariants:e=[]}=this.params,{config:r}=this.buildContext,i={...s,variants:t,compoundVariants:e};return n.parseAndJoinStyles(i,`.${this.cssClassName}`,r,this.isRoot)}getTemplateClasses(s=this.buildContext.config){if(!(s!=null&&s.templates)||!this.params.base||this.priority>0)return[];const t=Object.keys(s.templates);return Object.entries(this.params.base).reduce((e,[r,i])=>(t.includes(r)&&e.push("t_"+n.toHash(h.dashCase(`${r}-${i}`),4)),e),[])}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
@@ -1,67 +0,0 @@
1
- import { forwardRef as C, createElement as g } from "react";
2
- import { p as N, d as A } from "./parse-tokens-BqB-N10P.js";
3
- function K(n) {
4
- var s, e, t = "";
5
- if (typeof n == "string" || typeof n == "number") t += n;
6
- else if (typeof n == "object") if (Array.isArray(n)) {
7
- var o = n.length;
8
- for (s = 0; s < o; s++) n[s] && (e = K(n[s])) && (t && (t += " "), t += e);
9
- } else for (e in n) n[e] && (t && (t += " "), t += e);
10
- return t;
11
- }
12
- function R() {
13
- for (var n, s, e = 0, t = "", o = arguments.length; e < o; e++) (n = arguments[e]) && (s = K(n)) && (t && (t += " "), t += s);
14
- return t;
15
- }
16
- const q = ["passProps"], x = (n, s = "", e = {}, t) => {
17
- const j = C(({
18
- extend: d = n,
19
- element: S = e.element,
20
- className: O = "",
21
- children: $,
22
- passProps: u = e.passProps,
23
- _vks: l = /* @__PURE__ */ new Set(),
24
- ...r
25
- }, w) => {
26
- const f = { passProps: u };
27
- e.attr && Object.assign(f, e.attr), t && Object.assign(f, t), e.defaultProps && Object.assign(r, e.defaultProps), r && Object.assign(f, r);
28
- const b = /* @__PURE__ */ new Set([...s.split(" "), ...O.split(" ")]), y = typeof d == "function" || typeof d == "object", h = y && "isStyled" in d, E = y ? d : S || d;
29
- if (!E) throw new Error("No element provided");
30
- const m = f.style || {};
31
- f.style || (f.style = m), Object.entries(m).forEach(([i, a]) => {
32
- const c = N(a);
33
- c && (m[i] = c.transformed);
34
- }), e.propValueKeys && e.propValueKeys.forEach((i) => {
35
- const a = `css-${i}`, c = r[a];
36
- if (c === void 0) return;
37
- const p = `--props-${A(i)}`;
38
- m[p] = c, l && l.add(a);
39
- }), e.variantKeys && e.variantKeys.forEach((i) => {
40
- const [a, c] = i.split("=");
41
- r[a] !== void 0 ? (b.add(`${a}-${r[a]}`), l && l.add(a)) : c !== void 0 && b.add(`${a}-${c}`);
42
- }), l && (!y || !h) ? l.forEach((i) => {
43
- if (!u) return delete f[i];
44
- if (u !== !0 && !u.includes(i))
45
- return delete f[i];
46
- }) : h && Object.assign(f, { _vks: l }), h || q.forEach((i) => delete f[i]);
47
- const V = R(...b);
48
- return g(
49
- E,
50
- {
51
- element: y ? S : void 0,
52
- className: V,
53
- ref: w,
54
- ...f
55
- },
56
- $
57
- );
58
- });
59
- return Object.assign(j, {
60
- isStyled: !0,
61
- className: s,
62
- toString: () => `.${s}`
63
- }), j;
64
- };
65
- export {
66
- x as e
67
- };
@@ -1 +0,0 @@
1
- "use strict";const K=require("react"),O=require("./parse-tokens-BnDwbP7V.cjs");function $(n){var s,e,t="";if(typeof n=="string"||typeof n=="number")t+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(s=0;s<u;s++)n[s]&&(e=$(n[s]))&&(t&&(t+=" "),t+=e)}else for(e in n)n[e]&&(t&&(t+=" "),t+=e);return t}function N(){for(var n,s,e=0,t="",u=arguments.length;e<u;e++)(n=arguments[e])&&(s=$(n))&&(t&&(t+=" "),t+=s);return t}const A=["passProps"],F=(n,s="",e={},t)=>{const u=({extend:d=n,element:S=e.element,className:w="",children:V,passProps:o=e.passProps,_vks:r=new Set,...l},C)=>{const f={passProps:o};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),e.defaultProps&&Object.assign(l,e.defaultProps),l&&Object.assign(f,l);const b=new Set([...s.split(" "),...w.split(" ")]),y=typeof d=="function"||typeof d=="object",h=y&&"isStyled"in d,E=y?d:S||d;if(!E)throw new Error("No element provided");const m=f.style||{};f.style||(f.style=m),Object.entries(m).forEach(([i,a])=>{const c=O.parseVariableTokens(a);c&&(m[i]=c.transformed)}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const a=`css-${i}`,c=l[a];if(c===void 0)return;const q=`--props-${O.dashCase(i)}`;m[q]=c,r&&r.add(a)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[a,c]=i.split("=");l[a]!==void 0?(b.add(`${a}-${l[a]}`),r&&r.add(a)):c!==void 0&&b.add(`${a}-${c}`)}),r&&(!y||!h)?r.forEach(i=>{if(!o)return delete f[i];if(o!==!0&&!o.includes(i))return delete f[i]}):h&&Object.assign(f,{_vks:r}),h||A.forEach(i=>delete f[i]);const g=N(...b);return K.createElement(E,{element:y?S:void 0,className:g,ref:C,...f},V)},j=K.forwardRef(u);return Object.assign(j,{isStyled:!0,className:s,toString:()=>`.${s}`}),j};exports.elementFactory=F;
@@ -1,145 +0,0 @@
1
- import { d as V, a as H } from "./parse-tokens-BqB-N10P.js";
2
- const J = (e) => (s) => {
3
- if (typeof s != "string" || !e) return;
4
- let t = s;
5
- const i = [];
6
- return Object.values(e).forEach((o) => {
7
- const { pattern: j, transform: y } = o;
8
- t = t.replace(j, (S) => {
9
- const { value: x, css: b } = y(S);
10
- return b && i.push(b), x;
11
- });
12
- }), { transformed: t, additionalCss: i };
13
- }, z = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), Q = (e, s) => {
14
- let t = "", i;
15
- for (i = Math.abs(e); i > 52; i = i / 52 | 0) t = z(i % 52) + t;
16
- return t = z(i % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
17
- }, T = (e, s) => {
18
- let t = s.length;
19
- for (; t; ) e = e * 33 ^ s.charCodeAt(--t);
20
- return e;
21
- }, K = (e, s = 5) => {
22
- const t = T(5381, JSON.stringify(e)) >>> 0;
23
- return Q(t, s);
24
- }, _ = [
25
- "top",
26
- "right",
27
- "bottom",
28
- "left",
29
- "min-width",
30
- /.*width.*/,
31
- /^[^line]*height.*/,
32
- // Exclude line-height
33
- /padding.*/,
34
- /margin.*/,
35
- /border.*/,
36
- /inset.*/,
37
- /.*radius.*/,
38
- /.*spacing.*/,
39
- /.*gap.*/,
40
- /.*indent.*/,
41
- /.*offset.*/,
42
- /.*size.*/,
43
- /.*thickness.*/,
44
- /.*font-size.*/
45
- ], q = (e, s, t) => {
46
- if (_.some((o) => typeof o == "string" ? o === e : o.test(e))) {
47
- const o = (t == null ? void 0 : t.defaultUnit) || "px";
48
- return `${s}${o}`;
49
- }
50
- return `${s}`;
51
- }, F = ["Webkit", "Moz", "ms", "O"], I = (e) => e.startsWith("-") ? e : F.some((s) => e.startsWith(s)) ? `-${V(e)}` : V(e), $ = async (e, s = "", t, i = !1) => {
52
- if (!e) throw new Error("No styles provided to parseStyles function!");
53
- const o = /* @__PURE__ */ new Set(), j = Object.entries(e), y = async ([u, r]) => {
54
- var E;
55
- const n = u.trim(), w = I(n), l = (c, d = ";") => `${w}:${c}${d}`, P = { scope: s, config: t };
56
- if (typeof r == "function") return y([u, r(P)]);
57
- if (r instanceof Promise) return y([u, await r]);
58
- if (t != null && t.templates && t.templatePaths[n])
59
- try {
60
- const [c, d] = t.templatePaths[n].split(";;"), a = await import(d), f = d.includes("salty.config"), p = f ? a[c].templates : a[c], h = f ? p[n] : p.params[n];
61
- if (p && typeof h == "function") {
62
- const C = await h(r), [m] = await $(C, "");
63
- return m;
64
- }
65
- } catch (c) {
66
- console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`, c);
67
- return;
68
- }
69
- if (t != null && t.templates && t.templates[n]) {
70
- if (i) return;
71
- const d = r.split(".").reduce((a, f) => a[f], t.templates[n]);
72
- if (d) {
73
- const [a] = await $(d, "");
74
- return a;
75
- }
76
- console.warn(`Template "${n}" with path of "${r}" was not found in config!`);
77
- return;
78
- }
79
- if (typeof r == "object") {
80
- if (!r) return;
81
- if (r.isColor) return l(r.toString());
82
- if (n === "defaultVariants") return;
83
- if (n === "variants") {
84
- const a = Object.entries(r);
85
- for (const [f, p] of a) {
86
- if (!p) continue;
87
- const h = Object.entries(p);
88
- for (const [C, m] of h) {
89
- if (!m) continue;
90
- const O = `${s}.${f}-${C}`;
91
- (await $(m, O, t)).forEach((U) => o.add(U));
92
- }
93
- }
94
- return;
95
- }
96
- if (n === "compoundVariants") {
97
- for (const a of r) {
98
- const { css: f, ...p } = a, h = Object.entries(p).reduce((m, [O, W]) => `${m}.${O}-${W}`, s);
99
- (await $(f, h, t)).forEach((m) => o.add(m));
100
- }
101
- return;
102
- }
103
- if (n.startsWith("@")) {
104
- const a = ((E = t == null ? void 0 : t.mediaQueries) == null ? void 0 : E[n]) || n, f = await M(r, s, t), p = `${a} { ${f} }`;
105
- o.add(p);
106
- return;
107
- }
108
- const c = u.includes("&") ? n.replaceAll("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
109
- (await $(r, c, t)).forEach((a) => o.add(a));
110
- return;
111
- }
112
- if (typeof r == "number") {
113
- const c = q(w, r, t);
114
- return l(c);
115
- }
116
- if (typeof r != "string")
117
- if ("toString" in r) r = r.toString();
118
- else throw new Error(`Invalid value type for property ${w}`);
119
- return l(r);
120
- }, S = j.map(y), { modifiers: x } = t || {}, b = [H(), J(x)], A = (await Promise.all(S).then((u) => Promise.all(
121
- u.map((r) => b.reduce(async (n, w) => {
122
- const l = await n;
123
- if (!l) return l;
124
- const P = await w(l);
125
- if (!P) return l;
126
- const { transformed: E, additionalCss: c } = P;
127
- let d = "";
128
- if (c)
129
- for (const a of c)
130
- d += await M(a, "");
131
- return `${d}${E}`;
132
- }, Promise.resolve(r)))
133
- ))).filter((u) => u !== void 0).join(`
134
- `);
135
- if (!A.trim()) return Array.from(o);
136
- const N = s ? `${s} {
137
- ${A}
138
- }` : A;
139
- return o.has(N) ? Array.from(o) : [N, ...o];
140
- }, M = async (e, s, t, i = !1) => (await $(e, s, t, i)).join(`
141
- `);
142
- export {
143
- M as p,
144
- K as t
145
- };
@@ -1,5 +0,0 @@
1
- "use strict";const N=require("./parse-tokens-BnDwbP7V.cjs"),M=e=>s=>{if(typeof s!="string"||!e)return;let t=s;const a=[];return Object.values(e).forEach(o=>{const{pattern:S,transform:$}=o;t=t.replace(S,j=>{const{value:A,css:b}=$(j);return b&&a.push(b),A})}),{transformed:t,additionalCss:a}},H=e=>String.fromCharCode(e+(e>25?39:97)),T=(e,s)=>{let t="",a;for(a=Math.abs(e);a>52;a=a/52|0)t=H(a%52)+t;return t=H(a%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},U=(e,s)=>{let t=s.length;for(;t;)e=e*33^s.charCodeAt(--t);return e},q=(e,s=5)=>{const t=U(5381,JSON.stringify(e))>>>0;return T(t,s)},Q=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],_=(e,s,t)=>{if(Q.some(o=>typeof o=="string"?o===e:o.test(e))){const o=(t==null?void 0:t.defaultUnit)||"px";return`${s}${o}`}return`${s}`},F=["Webkit","Moz","ms","O"],I=e=>e.startsWith("-")?e:F.some(s=>e.startsWith(s))?`-${N.dashCase(e)}`:N.dashCase(e),y=async(e,s="",t,a=!1)=>{if(!e)throw new Error("No styles provided to parseStyles function!");const o=new Set,S=Object.entries(e),$=async([l,r])=>{var C;const n=l.trim(),w=I(n),p=(c,d=";")=>`${w}:${c}${d}`,P={scope:s,config:t};if(typeof r=="function")return $([l,r(P)]);if(r instanceof Promise)return $([l,await r]);if(t!=null&&t.templates&&t.templatePaths[n])try{const[c,d]=t.templatePaths[n].split(";;"),i=await import(d),f=d.includes("salty.config"),u=f?i[c].templates:i[c],h=f?u[n]:u.params[n];if(u&&typeof h=="function"){const E=await h(r),[m]=await y(E,"");return m}}catch(c){console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`,c);return}if(t!=null&&t.templates&&t.templates[n]){if(a)return;const d=r.split(".").reduce((i,f)=>i[f],t.templates[n]);if(d){const[i]=await y(d,"");return i}console.warn(`Template "${n}" with path of "${r}" was not found in config!`);return}if(typeof r=="object"){if(!r)return;if(r.isColor)return p(r.toString());if(n==="defaultVariants")return;if(n==="variants"){const i=Object.entries(r);for(const[f,u]of i){if(!u)continue;const h=Object.entries(u);for(const[E,m]of h){if(!m)continue;const x=`${s}.${f}-${E}`;(await y(m,x,t)).forEach(J=>o.add(J))}}return}if(n==="compoundVariants"){for(const i of r){const{css:f,...u}=i,h=Object.entries(u).reduce((m,[x,z])=>`${m}.${x}-${z}`,s);(await y(f,h,t)).forEach(m=>o.add(m))}return}if(n.startsWith("@")){const i=((C=t==null?void 0:t.mediaQueries)==null?void 0:C[n])||n,f=await W(r,s,t),u=`${i} { ${f} }`;o.add(u);return}const c=l.includes("&")?n.replaceAll("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await y(r,c,t)).forEach(i=>o.add(i));return}if(typeof r=="number"){const c=_(w,r,t);return p(c)}if(typeof r!="string")if("toString"in r)r=r.toString();else throw new Error(`Invalid value type for property ${w}`);return p(r)},j=S.map($),{modifiers:A}=t||{},b=[N.parseValueTokens(),M(A)],O=(await Promise.all(j).then(l=>Promise.all(l.map(r=>b.reduce(async(n,w)=>{const p=await n;if(!p)return p;const P=await w(p);if(!P)return p;const{transformed:C,additionalCss:c}=P;let d="";if(c)for(const i of c)d+=await W(i,"");return`${d}${C}`},Promise.resolve(r)))))).filter(l=>l!==void 0).join(`
2
- `);if(!O.trim())return Array.from(o);const V=s?`${s} {
3
- ${O}
4
- }`:O;return o.has(V)?Array.from(o):[V,...o]},W=async(e,s,t,a=!1)=>(await y(e,s,t,a)).join(`
5
- `);exports.parseAndJoinStyles=W;exports.toHash=q;