@salty-css/react 0.0.1-alpha.205 → 0.0.1-alpha.206

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 r=require("./styles-generator-B45twOrU.cjs");class a extends r.StylesGenerator{constructor(e){super(e),this._params=e}}const n=s=>{const e=new a(s),t=new String(e.cssClassName);return Object.assign(t,{get isClassName(){return!0},factory:e}),t};exports.className=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./styles-generator-RdL74aZ6.cjs");class a extends r.StylesGenerator{constructor(e){super(e),this._params=e}}const n=s=>{const e=new a(s),t=new String(e.cssClassName);return Object.assign(t,{get isClassName(){return!0},generator:e}),t};exports.className=n;
package/class-name.d.ts CHANGED
@@ -2,5 +2,5 @@ import { StyledParams } from '@salty-css/core/types';
2
2
  import { ClassNameGenerator } from '@salty-css/core/generators';
3
3
  export declare const className: <const STYLE_PARAMS extends StyledParams>(params: STYLE_PARAMS) => string & {
4
4
  isClassName: boolean;
5
- factory: ClassNameGenerator<STYLE_PARAMS>;
5
+ generator: ClassNameGenerator<STYLE_PARAMS>;
6
6
  };
package/class-name.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as r } from "./styles-generator-BgWEdgrf.js";
1
+ import { S as r } from "./styles-generator-u7zuyRNK.js";
2
2
  class a extends r {
3
3
  constructor(s) {
4
4
  super(s), this._params = s;
@@ -10,7 +10,7 @@ const o = (e) => {
10
10
  get isClassName() {
11
11
  return !0;
12
12
  },
13
- factory: s
13
+ generator: s
14
14
  }), t;
15
15
  };
16
16
  export {
@@ -1,5 +1,5 @@
1
- import { forwardRef as g, createElement as p } from "react";
2
- import { d as N, p as A } from "./parse-tokens-CdNpUjpp.js";
1
+ import { forwardRef as C, createElement as g } from "react";
2
+ import { p as N, d as A } from "./parse-tokens-CssTiO78.js";
3
3
  function K(n) {
4
4
  var s, e, t = "";
5
5
  if (typeof n == "string" || typeof n == "number") t += n;
@@ -13,39 +13,39 @@ function R() {
13
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
14
  return t;
15
15
  }
16
- const F = ["passProps"], x = (n, s, e, t) => {
17
- const j = g(({
16
+ const q = ["passProps"], x = (n, s = "", e = {}, t) => {
17
+ const j = C(({
18
18
  extend: d = n,
19
19
  element: S = e.element,
20
20
  className: O = "",
21
21
  children: $,
22
22
  passProps: u = e.passProps,
23
- _vks: c = /* @__PURE__ */ new Set(),
23
+ _vks: l = /* @__PURE__ */ new Set(),
24
24
  ...r
25
25
  }, w) => {
26
26
  const f = { passProps: u };
27
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 = new Set(O.split(" ")), y = typeof d == "function" || typeof d == "object", h = y && "isStyled" in d, E = y ? d : S || d;
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
29
  if (!E) throw new Error("No element provided");
30
30
  const m = f.style || {};
31
31
  f.style || (f.style = m), Object.entries(m).forEach(([i, a]) => {
32
- const { result: l } = A(a);
33
- m[i] = l;
32
+ const c = N(a);
33
+ c && (m[i] = c.transformed);
34
34
  }), e.propValueKeys && e.propValueKeys.forEach((i) => {
35
- const a = `css-${i}`, l = r[a];
36
- if (l === void 0) return;
37
- const C = `--props-${N(i)}`;
38
- m[C] = l, c && c.add(a);
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
39
  }), e.variantKeys && e.variantKeys.forEach((i) => {
40
- const [a, l] = i.split("=");
41
- r[a] !== void 0 ? (b.add(`${a}-${r[a]}`), c && c.add(a)) : l !== void 0 && b.add(`${a}-${l}`);
42
- }), c && (!y || !h) ? c.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
43
  if (!u) return delete f[i];
44
44
  if (u !== !0 && !u.includes(i))
45
45
  return delete f[i];
46
- }) : h && Object.assign(f, { _vks: c }), h || F.forEach((i) => delete f[i]);
47
- const V = R(s, ...b);
48
- return p(
46
+ }) : h && Object.assign(f, { _vks: l }), h || q.forEach((i) => delete f[i]);
47
+ const V = R(...b);
48
+ return g(
49
49
  E,
50
50
  {
51
51
  element: y ? S : void 0,
@@ -0,0 +1 @@
1
+ "use strict";const K=require("react"),O=require("./parse-tokens-DfRKmjt1.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,3 +1,3 @@
1
1
  import { StyledComponentProps, Tag } from '@salty-css/core/types';
2
2
  import { StyledGeneratorClientProps } from '@salty-css/core/generators';
3
- export declare const elementFactory: (tagName: Tag<any>, _className: string, _generatorProps: StyledGeneratorClientProps, _additionalProps?: Record<PropertyKey, any>) => import('react').ForwardRefExoticComponent<Omit<StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
3
+ export declare const elementFactory: (tagName: Tag<any>, _className?: string, _generatorProps?: StyledGeneratorClientProps, _additionalProps?: Record<PropertyKey, any>) => import('react').ForwardRefExoticComponent<Omit<StyledComponentProps, "ref"> & import('react').RefAttributes<any>>;
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./keyframes.cjs"),n=require("./media.cjs"),a=r=>`{${r}}`,o=(...r)=>r.flat().reduce((t,e)=>e!=null&&e._current?{...t,...e._current}:{...t,...e},{}),c=(...r)=>r.flat().reduce((t,e)=>({...t,...e._children}),{});exports.keyframes=u.keyframes;exports.MediaQueryFactory=n.MediaQueryFactory;exports.media=n.media;exports.mergeFactories=c;exports.mergeStyles=o;exports.token=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./keyframes.cjs"),n=require("./media.cjs"),u=r=>`{${r}}`,a=(...r)=>r.flat().reduce((t,e)=>e!=null&&e._current?{...t,...e._current}:{...t,...e},{}),o=(...r)=>r.flat().reduce((t,e)=>({...t,...e._children}),{});exports.keyframes=c.keyframes;exports.MediaQueryFactory=n.MediaQueryFactory;exports.media=n.media;exports.mergeFactories=o;exports.mergeObjects=a;exports.token=u;
package/index.js CHANGED
@@ -6,6 +6,6 @@ export {
6
6
  f as keyframes,
7
7
  i as media,
8
8
  u as mergeFactories,
9
- o as mergeStyles,
9
+ o as mergeObjects,
10
10
  n as token
11
11
  };
package/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./parse-styles-D_bszbUo.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-DJxMVgvl.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-CbFZTiNo.js";
1
+ import { t as j, p as m } from "./parse-styles-Dytk8Vyz.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.205",
3
+ "version": "0.0.1-alpha.206",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@salty-css/core": "^0.0.1-alpha.205",
65
+ "@salty-css/core": "^0.0.1-alpha.206",
66
66
  "clsx": ">=2.x",
67
67
  "react": ">=19.x || >=18.3.x"
68
68
  }
@@ -0,0 +1,3 @@
1
+ "use strict";const x=require("./parse-tokens-DfRKmjt1.cjs"),M=e=>s=>{if(typeof s!="string"||!e)return;let t=s;const a=[];return Object.values(e).forEach(i=>{const{pattern:N,transform:y}=i;t=t.replace(N,b=>{const{value:P,css:C}=y(b);return C&&a.push(C),P})}),{transformed:t,additionalCss:a}},z=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=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},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(i=>typeof i=="string"?i===e:i.test(e))){const i=(t==null?void 0:t.defaultUnit)||"px";return`${s}${i}`}return`${s}`},F=["Webkit","Moz","ms","O"],I=e=>e.startsWith("-")?e:F.some(s=>e.startsWith(s))?`-${x.dashCase(e)}`:x.dashCase(e),m=async(e,s="",t,a=!1)=>{if(!e)throw new Error("No styles provided to parseStyles function!");const i=new Set,y=Object.entries(e).map(async([w,r])=>{var $;const n=w.trim(),h=I(n),f=(d,c=";")=>`${h}:${d}${c}`;if(typeof r=="function"&&(r=r({scope:s,config:t})),r instanceof Promise&&(r=await r),t!=null&&t.templates&&t.templatePaths[n]){const{default:d}=await import(t.templatePaths[n]);if(typeof d.params[n]=="function"){const c=await d.params[n](r),[o]=await m(c,"");return o}}if(t!=null&&t.templates&&t.templates[n]){if(a)return;const c=r.split(".").reduce((o,u)=>o[u],t.templates[n]);if(c){const[o]=await m(c,"");return o}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 f(r.toString());if(n==="defaultVariants")return;if(n==="variants"){const o=Object.entries(r);for(const[u,p]of o){if(!p)return;const O=Object.entries(p);for(const[W,l]of O){if(!l)return;const S=`${s}.${u}-${W}`;(await m(l,S,t)).forEach(J=>i.add(J))}}return}if(n==="compoundVariants"){for(const o of r){const{css:u,...p}=o,O=Object.entries(p).reduce((l,[S,V])=>`${l}.${S}-${V}`,s);(await m(u,O,t)).forEach(l=>i.add(l))}return}if(n.startsWith("@")){const o=(($=t==null?void 0:t.mediaQueries)==null?void 0:$[n])||n,u=await A(r,s,t),p=`${o} { ${u} }`;i.add(p);return}const d=w.includes("&")?n.replace("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await m(r,d,t)).forEach(o=>i.add(o));return}if(typeof r=="number"){const d=_(h,r,t);return f(d)}if(typeof r!="string")if("toString"in r)r=r.toString();else throw new Error(`Invalid value type for property ${h}`);return f(r)}),{modifiers:b}=t||{},P=[x.parseValueTokens(),M(b)],j=(await Promise.all(y).then(w=>Promise.all(w.map(r=>P.reduce(async(n,h)=>{const f=await n;if(!f)return f;const E=await h(f);if(!E)return f;const{transformed:$,additionalCss:d}=E;let c="";if(d)for(const o of d)c+=await A(o,"");return`${c}${$}`},Promise.resolve(r)))))).join(`
2
+ `);if(!j.trim())return i;const H=s?`${s} { ${j} }`:j;return i.add(H),i},A=async(e,s,t,a=!1)=>[...await m(e,s,t,a)].join(`
3
+ `);exports.parseAndJoinStyles=A;exports.toHash=q;
@@ -0,0 +1,137 @@
1
+ import { d as A, a as H } from "./parse-tokens-CssTiO78.js";
2
+ const J = (e) => (s) => {
3
+ if (typeof s != "string" || !e) return;
4
+ let t = s;
5
+ const a = [];
6
+ return Object.values(e).forEach((i) => {
7
+ const { pattern: S, transform: y } = i;
8
+ t = t.replace(S, (b) => {
9
+ const { value: P, css: C } = y(b);
10
+ return C && a.push(C), P;
11
+ });
12
+ }), { transformed: t, additionalCss: a };
13
+ }, V = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), Q = (e, s) => {
14
+ let t = "", a;
15
+ for (a = Math.abs(e); a > 52; a = a / 52 | 0) t = V(a % 52) + t;
16
+ return t = V(a % 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
+ }, D = (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((i) => typeof i == "string" ? i === e : i.test(e))) {
47
+ const i = (t == null ? void 0 : t.defaultUnit) || "px";
48
+ return `${s}${i}`;
49
+ }
50
+ return `${s}`;
51
+ }, F = ["Webkit", "Moz", "ms", "O"], I = (e) => e.startsWith("-") ? e : F.some((s) => e.startsWith(s)) ? `-${A(e)}` : A(e), m = async (e, s = "", t, a = !1) => {
52
+ if (!e) throw new Error("No styles provided to parseStyles function!");
53
+ const i = /* @__PURE__ */ new Set(), y = Object.entries(e).map(async ([w, r]) => {
54
+ var $;
55
+ const n = w.trim(), h = I(n), f = (d, c = ";") => `${h}:${d}${c}`;
56
+ if (typeof r == "function" && (r = r({ scope: s, config: t })), r instanceof Promise && (r = await r), t != null && t.templates && t.templatePaths[n]) {
57
+ const { default: d } = await import(t.templatePaths[n]);
58
+ if (typeof d.params[n] == "function") {
59
+ const c = await d.params[n](r), [o] = await m(c, "");
60
+ return o;
61
+ }
62
+ }
63
+ if (t != null && t.templates && t.templates[n]) {
64
+ if (a) return;
65
+ const c = r.split(".").reduce((o, p) => o[p], t.templates[n]);
66
+ if (c) {
67
+ const [o] = await m(c, "");
68
+ return o;
69
+ }
70
+ console.warn(`Template "${n}" with path of "${r}" was not found in config!`);
71
+ return;
72
+ }
73
+ if (typeof r == "object") {
74
+ if (!r) return;
75
+ if (r.isColor) return f(r.toString());
76
+ if (n === "defaultVariants") return;
77
+ if (n === "variants") {
78
+ const o = Object.entries(r);
79
+ for (const [p, u] of o) {
80
+ if (!u) return;
81
+ const O = Object.entries(u);
82
+ for (const [N, l] of O) {
83
+ if (!l) return;
84
+ const x = `${s}.${p}-${N}`;
85
+ (await m(l, x, t)).forEach((U) => i.add(U));
86
+ }
87
+ }
88
+ return;
89
+ }
90
+ if (n === "compoundVariants") {
91
+ for (const o of r) {
92
+ const { css: p, ...u } = o, O = Object.entries(u).reduce((l, [x, W]) => `${l}.${x}-${W}`, s);
93
+ (await m(p, O, t)).forEach((l) => i.add(l));
94
+ }
95
+ return;
96
+ }
97
+ if (n.startsWith("@")) {
98
+ const o = (($ = t == null ? void 0 : t.mediaQueries) == null ? void 0 : $[n]) || n, p = await z(r, s, t), u = `${o} { ${p} }`;
99
+ i.add(u);
100
+ return;
101
+ }
102
+ const d = w.includes("&") ? n.replace("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
103
+ (await m(r, d, t)).forEach((o) => i.add(o));
104
+ return;
105
+ }
106
+ if (typeof r == "number") {
107
+ const d = q(h, r, t);
108
+ return f(d);
109
+ }
110
+ if (typeof r != "string")
111
+ if ("toString" in r) r = r.toString();
112
+ else throw new Error(`Invalid value type for property ${h}`);
113
+ return f(r);
114
+ }), { modifiers: b } = t || {}, P = [H(), J(b)], j = (await Promise.all(y).then((w) => Promise.all(
115
+ w.map((r) => P.reduce(async (n, h) => {
116
+ const f = await n;
117
+ if (!f) return f;
118
+ const E = await h(f);
119
+ if (!E) return f;
120
+ const { transformed: $, additionalCss: d } = E;
121
+ let c = "";
122
+ if (d)
123
+ for (const o of d)
124
+ c += await z(o, "");
125
+ return `${c}${$}`;
126
+ }, Promise.resolve(r)))
127
+ ))).join(`
128
+ `);
129
+ if (!j.trim()) return i;
130
+ const M = s ? `${s} { ${j} }` : j;
131
+ return i.add(M), i;
132
+ }, z = async (e, s, t, a = !1) => [...await m(e, s, t, a)].join(`
133
+ `);
134
+ export {
135
+ z as p,
136
+ D as t
137
+ };
@@ -0,0 +1,9 @@
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, n) => (n > 0 ? "-" : "") + r.toLowerCase()) : "";
3
+ }
4
+ const s = (e) => (r) => typeof r != "string" || !/\{[^{}]+\}/g.test(r) ? void 0 : { transformed: r.replace(/\{([^{}]+)\}/g, (...t) => `var(--${a(t[1].replaceAll(".", "-"))})`) }, f = s();
5
+ export {
6
+ s as a,
7
+ a as d,
8
+ f as p
9
+ };
@@ -0,0 +1 @@
1
+ "use strict";function n(e){return e?typeof e!="string"?n(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(r,a)=>(a>0?"-":"")+r.toLowerCase()):""}const s=e=>r=>typeof r!="string"||!/\{[^{}]+\}/g.test(r)?void 0:{transformed:r.replace(/\{([^{}]+)\}/g,(...t)=>`var(--${n(t[1].replaceAll(".","-"))})`)},o=s();exports.dashCase=n;exports.parseValueTokens=s;exports.parseVariableTokens=o;
package/styled-client.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./element-factory-xzOUBIyk.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-DjYdX8Jd.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-BqXNML99.js";
1
+ import { e as o } from "./element-factory-B1PSIJV4.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 m=require("./styles-generator-B45twOrU.cjs"),g=require("./element-factory-xzOUBIyk.cjs");class h extends m.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return 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:a=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:f}=this.buildContext,o=new Set([]),i=s=>{const r=d[s];r!==void 0?o.add(`${s}=${String(r)}`):o.add(s)};Object.keys(t).forEach(i),a.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);s&&s.forEach(r=>{const p=r.replace(/\{props\.([\w\d]+)\}/gi,"$1");p&&c.add(p)})}return{element:e,variantKeys:[...o],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":f?void 0:y}}}}const b=(n,e)=>{const t=new h(n,e),a=g.elementFactory(n,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:t}),a};exports.styled=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./styles-generator-RdL74aZ6.cjs"),g=require("./element-factory-DjYdX8Jd.cjs");class h extends m.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return 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:a=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:f}=this.buildContext,o=new Set([]),i=s=>{const r=d[s];r!==void 0?o.add(`${s}=${String(r)}`):o.add(s)};Object.keys(t).forEach(i),a.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{props\.([\w\d]+)\}/gi);s&&s.forEach(r=>{const p=r.replace(/\{props\.([\w\d]+)\}/gi,"$1");p&&c.add(p)})}return{element:e,variantKeys:[...o],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":f?void 0:y}}}}const b=(n,e)=>{const t=new h(n,e),a=g.elementFactory(n,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(a,{generator:t}),a};exports.styled=b;
package/styled.js CHANGED
@@ -1,5 +1,5 @@
1
- import { S as y } from "./styles-generator-BgWEdgrf.js";
2
- import { e as h } from "./element-factory-BqXNML99.js";
1
+ import { S as y } from "./styles-generator-u7zuyRNK.js";
2
+ import { e as h } from "./element-factory-B1PSIJV4.js";
3
3
  class g extends y {
4
4
  constructor(e, t) {
5
5
  super(t), this.tagName = e, this._params = t;
@@ -0,0 +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 h=(a,s,t)=>l(a,typeof s!="symbol"?s+"":s,t);const n=require("./parse-styles-DJxMVgvl.cjs"),o=require("./parse-tokens-DfRKmjt1.cjs");class u{constructor(s){h(this,"buildContext",{});this.params=s}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){return n.toHash(this.params.base||this.params)}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_${o.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(o.dashCase(`${r}-${i}`),4)),e),[])}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
@@ -0,0 +1,46 @@
1
+ var c = Object.defineProperty;
2
+ var l = (a, s, t) => s in a ? c(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
+ var o = (a, s, t) => l(a, typeof s != "symbol" ? s + "" : s, t);
4
+ import { t as h, p as m } from "./parse-styles-Dytk8Vyz.js";
5
+ import { d as n } from "./parse-tokens-CssTiO78.js";
6
+ class C {
7
+ constructor(s) {
8
+ o(this, "buildContext", {});
9
+ this.params = s;
10
+ }
11
+ get priority() {
12
+ return 0;
13
+ }
14
+ get isRoot() {
15
+ return this.priority === 0;
16
+ }
17
+ get hash() {
18
+ return h(this.params.base || this.params);
19
+ }
20
+ get cssClassName() {
21
+ return this.hash;
22
+ }
23
+ get classNames() {
24
+ const s = /* @__PURE__ */ new Set([this.cssClassName]), { className: t } = this.params;
25
+ 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(" ");
26
+ }
27
+ get cssFileName() {
28
+ const { callerName: s } = this.buildContext;
29
+ return s ? `cl_${n(s)}-${this.hash}.css` : `${this.hash}.css`;
30
+ }
31
+ get css() {
32
+ const { base: s = {}, variants: t = {}, compoundVariants: e = [] } = this.params, { config: r } = this.buildContext, i = { ...s, variants: t, compoundVariants: e };
33
+ return m(i, `.${this.cssClassName}`, r, this.isRoot);
34
+ }
35
+ getTemplateClasses(s = this.buildContext.config) {
36
+ if (!(s != null && s.templates) || !this.params.base || this.priority > 0) return [];
37
+ const t = Object.keys(s.templates);
38
+ return Object.entries(this.params.base).reduce((e, [r, i]) => (t.includes(r) && e.push("t_" + h(n(`${r}-${i}`), 4)), e), []);
39
+ }
40
+ _withBuildContext(s) {
41
+ return this.buildContext = s, this;
42
+ }
43
+ }
44
+ export {
45
+ C as S
46
+ };
@@ -1 +0,0 @@
1
- "use strict";const K=require("react"),O=require("./parse-tokens-CNGyn07A.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 q(){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:c=new Set,...r},C)=>{const f={passProps:o};e.attr&&Object.assign(f,e.attr),t&&Object.assign(f,t),e.defaultProps&&Object.assign(r,e.defaultProps),r&&Object.assign(f,r);const b=new Set(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{result:l}=O.parseValueTokens(a);m[i]=l}),e.propValueKeys&&e.propValueKeys.forEach(i=>{const a=`css-${i}`,l=r[a];if(l===void 0)return;const N=`--props-${O.dashCase(i)}`;m[N]=l,c&&c.add(a)}),e.variantKeys&&e.variantKeys.forEach(i=>{const[a,l]=i.split("=");r[a]!==void 0?(b.add(`${a}-${r[a]}`),c&&c.add(a)):l!==void 0&&b.add(`${a}-${l}`)}),c&&(!y||!h)?c.forEach(i=>{if(!o)return delete f[i];if(o!==!0&&!o.includes(i))return delete f[i]}):h&&Object.assign(f,{_vks:c}),h||A.forEach(i=>delete f[i]);const g=q(s,...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,136 +0,0 @@
1
- import { d as W, p as U } from "./parse-tokens-CdNpUjpp.js";
2
- const H = (e) => (s) => {
3
- if (typeof s != "string" || !e) return;
4
- let t = s;
5
- const i = [];
6
- return Object.values(e).forEach((c) => {
7
- const { pattern: b, transform: P } = c;
8
- t = t.replace(b, (C) => {
9
- const { value: x, css: u } = P(C);
10
- return u && i.push(u), x;
11
- });
12
- }), { transformed: t, additionalCss: i };
13
- }, A = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), J = (e, s) => {
14
- let t = "", i;
15
- for (i = Math.abs(e); i > 52; i = i / 52 | 0) t = A(i % 52) + t;
16
- return t = A(i % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
17
- }, Q = (e, s) => {
18
- let t = s.length;
19
- for (; t; ) e = e * 33 ^ s.charCodeAt(--t);
20
- return e;
21
- }, B = (e, s = 5) => {
22
- const t = Q(5381, JSON.stringify(e)) >>> 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
- ], _ = (e, s, t) => {
46
- if (T.some((c) => typeof c == "string" ? c === e : c.test(e))) {
47
- const c = (t == null ? void 0 : t.defaultUnit) || "px";
48
- return `${s}${c}`;
49
- }
50
- return `${s}`;
51
- }, q = ["Webkit", "Moz", "ms", "O"], F = (e) => e.startsWith("-") ? e : q.some((s) => e.startsWith(s)) ? `-${W(e)}` : W(e), h = async (e, s = "", t) => {
52
- if (!e) throw new Error("No styles provided to parseStyles function!");
53
- const i = /* @__PURE__ */ new Set(), b = Object.entries(e).map(async ([$, r]) => {
54
- var y;
55
- const n = $.trim(), w = F(n), f = (a, d = ";") => `${w}:${a}${d}`;
56
- if (typeof r == "function" && (r = r({ scope: s, config: t })), r instanceof Promise && (r = await r), t != null && t.templates && t.templatePaths[n]) {
57
- const { default: a } = await import(t.templatePaths[n]);
58
- if (typeof a.params[n] == "function") {
59
- const d = await a.params[n](r), [o] = await h(d, "");
60
- return o;
61
- }
62
- }
63
- if (t != null && t.templates && t.templates[n]) {
64
- const d = r.split(".").reduce((o, p) => o[p], t.templates[n]);
65
- if (d) {
66
- const [o] = await h(d, "");
67
- return o;
68
- }
69
- console.warn(`Template "${n}" with path of "${r}" was not found in config!`);
70
- return;
71
- }
72
- if (typeof r == "object") {
73
- if (!r) return;
74
- if (r.isColor) return f(r.toString());
75
- if (n === "defaultVariants") return;
76
- if (n === "variants") {
77
- const o = Object.entries(r);
78
- for (const [p, m] of o) {
79
- if (!m) return;
80
- const E = Object.entries(m);
81
- for (const [S, l] of E) {
82
- if (!l) return;
83
- const O = `${s}.${p}-${S}`;
84
- (await h(l, O, t)).forEach((M) => i.add(M));
85
- }
86
- }
87
- return;
88
- }
89
- if (n === "compoundVariants") {
90
- for (const o of r) {
91
- const { css: p, ...m } = o, E = Object.entries(m).reduce((l, [O, N]) => `${l}.${O}-${N}`, s);
92
- (await h(p, E, t)).forEach((l) => i.add(l));
93
- }
94
- return;
95
- }
96
- if (n.startsWith("@")) {
97
- const o = ((y = t == null ? void 0 : t.mediaQueries) == null ? void 0 : y[n]) || n, p = await V(r, s, t), m = `${o} { ${p} }`;
98
- i.add(m);
99
- return;
100
- }
101
- const a = $.includes("&") ? n.replace("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
102
- (await h(r, a, t)).forEach((o) => i.add(o));
103
- return;
104
- }
105
- if (typeof r == "number") {
106
- const a = _(w, r, t);
107
- return f(a);
108
- }
109
- if (typeof r != "string")
110
- if ("toString" in r) r = r.toString();
111
- else throw new Error(`Invalid value type for property ${w}`);
112
- return f(r);
113
- }), { modifiers: P } = t || {}, C = [U(), H(P)], u = (await Promise.all(b).then(($) => Promise.all(
114
- $.map((r) => C.reduce(async (n, w) => {
115
- const f = await n;
116
- if (!f) return f;
117
- const j = await w(f);
118
- if (!j) return f;
119
- const { transformed: y, additionalCss: a } = j;
120
- let d = "";
121
- if (a)
122
- for (const o of a)
123
- d += await V(o, "");
124
- return `${d}${y}`;
125
- }, Promise.resolve(r)))
126
- ))).join(`
127
- `);
128
- if (!u.trim()) return i;
129
- const z = s ? `${s} { ${u} }` : u;
130
- return i.add(z), i;
131
- }, V = async (e, s, t) => [...await h(e, s, t)].join(`
132
- `);
133
- export {
134
- V as p,
135
- B as t
136
- };
@@ -1,3 +0,0 @@
1
- "use strict";const S=require("./parse-tokens-CNGyn07A.cjs"),J=e=>s=>{if(typeof s!="string"||!e)return;let t=s;const i=[];return Object.values(e).forEach(c=>{const{pattern:b,transform:P}=c;t=t.replace(b,C=>{const{value:A,css:u}=P(C);return u&&i.push(u),A})}),{transformed:t,additionalCss:i}},V=e=>String.fromCharCode(e+(e>25?39:97)),M=(e,s)=>{let t="",i;for(i=Math.abs(e);i>52;i=i/52|0)t=V(i%52)+t;return t=V(i%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},U=(e,s=5)=>{const t=T(5381,JSON.stringify(e))>>>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=(e,s,t)=>{if(q.some(c=>typeof c=="string"?c===e:c.test(e))){const c=(t==null?void 0:t.defaultUnit)||"px";return`${s}${c}`}return`${s}`},_=["Webkit","Moz","ms","O"],F=e=>e.startsWith("-")?e:_.some(s=>e.startsWith(s))?`-${S.dashCase(e)}`:S.dashCase(e),h=async(e,s="",t)=>{if(!e)throw new Error("No styles provided to parseStyles function!");const i=new Set,b=Object.entries(e).map(async([$,r])=>{var y;const n=$.trim(),w=F(n),f=(a,d=";")=>`${w}:${a}${d}`;if(typeof r=="function"&&(r=r({scope:s,config:t})),r instanceof Promise&&(r=await r),t!=null&&t.templates&&t.templatePaths[n]){const{default:a}=await import(t.templatePaths[n]);if(typeof a.params[n]=="function"){const d=await a.params[n](r),[o]=await h(d,"");return o}}if(t!=null&&t.templates&&t.templates[n]){const d=r.split(".").reduce((o,p)=>o[p],t.templates[n]);if(d){const[o]=await h(d,"");return o}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 f(r.toString());if(n==="defaultVariants")return;if(n==="variants"){const o=Object.entries(r);for(const[p,l]of o){if(!l)return;const E=Object.entries(l);for(const[N,m]of E){if(!m)return;const O=`${s}.${p}-${N}`;(await h(m,O,t)).forEach(H=>i.add(H))}}return}if(n==="compoundVariants"){for(const o of r){const{css:p,...l}=o,E=Object.entries(l).reduce((m,[O,W])=>`${m}.${O}-${W}`,s);(await h(p,E,t)).forEach(m=>i.add(m))}return}if(n.startsWith("@")){const o=((y=t==null?void 0:t.mediaQueries)==null?void 0:y[n])||n,p=await x(r,s,t),l=`${o} { ${p} }`;i.add(l);return}const a=$.includes("&")?n.replace("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await h(r,a,t)).forEach(o=>i.add(o));return}if(typeof r=="number"){const a=Q(w,r,t);return f(a)}if(typeof r!="string")if("toString"in r)r=r.toString();else throw new Error(`Invalid value type for property ${w}`);return f(r)}),{modifiers:P}=t||{},C=[S.parseValueTokens(),J(P)],u=(await Promise.all(b).then($=>Promise.all($.map(r=>C.reduce(async(n,w)=>{const f=await n;if(!f)return f;const j=await w(f);if(!j)return f;const{transformed:y,additionalCss:a}=j;let d="";if(a)for(const o of a)d+=await x(o,"");return`${d}${y}`},Promise.resolve(r)))))).join(`
2
- `);if(!u.trim())return i;const z=s?`${s} { ${u} }`:u;return i.add(z),i},x=async(e,s,t)=>[...await h(e,s,t)].join(`
3
- `);exports.parseAndJoinStyles=x;exports.toHash=U;
@@ -1 +0,0 @@
1
- "use strict";function t(e){return e?typeof e!="string"?t(String(e)):e.replace(/[\s.]/g,"-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(n,s)=>(s>0?"-":"")+n.toLowerCase()):""}const o=e=>n=>typeof n!="string"||!/\{[^{}]+\}/g.test(n)?void 0:{transformed:n.replace(/\{([^{}]+)\}/g,(...a)=>{const r=t(a[1].replaceAll(".","-"));return e&&!e.includes(r)&&console.warn(`Token ${r} might not exist`),`var(--${r})`})};exports.dashCase=t;exports.parseValueTokens=o;
@@ -1,11 +0,0 @@
1
- function o(e) {
2
- return e ? typeof e != "string" ? o(String(e)) : e.replace(/[\s.]/g, "-").replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g, (n, t) => (t > 0 ? "-" : "") + n.toLowerCase()) : "";
3
- }
4
- const i = (e) => (n) => typeof n != "string" || !/\{[^{}]+\}/g.test(n) ? void 0 : { transformed: n.replace(/\{([^{}]+)\}/g, (...s) => {
5
- const r = o(s[1].replaceAll(".", "-"));
6
- return e && !e.includes(r) && console.warn(`Token ${r} might not exist`), `var(--${r})`;
7
- }) };
8
- export {
9
- o as d,
10
- i as p
11
- };
@@ -1 +0,0 @@
1
- "use strict";var h=Object.defineProperty;var o=(e,s,t)=>s in e?h(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var a=(e,s,t)=>o(e,typeof s!="symbol"?s+"":s,t);const r=require("./parse-styles-D_bszbUo.cjs"),l=require("./parse-tokens-CNGyn07A.cjs");class u{constructor(s){a(this,"buildContext",{});this.params=s}get hash(){return r.toHash(this.params.base||this.params)}get cssClassName(){return this.hash}get classNames(){const s=[this.hash],{className:t}=this.params;return typeof t=="string"&&s.push(t),typeof t=="object"&&s.push(...t),s.join(" ")}get cssFileName(){const{callerName:s}=this.buildContext;return s?`cl_${l.dashCase(s)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:t={},compoundVariants:i=[]}=this.params,{config:n}=this.buildContext,c={...s,variants:t,compoundVariants:i};return r.parseAndJoinStyles(c,`.${this.cssClassName}`,n)}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
@@ -1,35 +0,0 @@
1
- var n = Object.defineProperty;
2
- var o = (a, s, t) => s in a ? n(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
- var e = (a, s, t) => o(a, typeof s != "symbol" ? s + "" : s, t);
4
- import { t as c, p as l } from "./parse-styles-CbFZTiNo.js";
5
- import { d as m } from "./parse-tokens-CdNpUjpp.js";
6
- class f {
7
- constructor(s) {
8
- e(this, "buildContext", {});
9
- this.params = s;
10
- }
11
- get hash() {
12
- return c(this.params.base || this.params);
13
- }
14
- get cssClassName() {
15
- return this.hash;
16
- }
17
- get classNames() {
18
- const s = [this.hash], { className: t } = this.params;
19
- return typeof t == "string" && s.push(t), typeof t == "object" && s.push(...t), s.join(" ");
20
- }
21
- get cssFileName() {
22
- const { callerName: s } = this.buildContext;
23
- return s ? `cl_${m(s)}-${this.hash}.css` : `${this.hash}.css`;
24
- }
25
- get css() {
26
- const { base: s = {}, variants: t = {}, compoundVariants: i = [] } = this.params, { config: r } = this.buildContext, h = { ...s, variants: t, compoundVariants: i };
27
- return l(h, `.${this.cssClassName}`, r);
28
- }
29
- _withBuildContext(s) {
30
- return this.buildContext = s, this;
31
- }
32
- }
33
- export {
34
- f as S
35
- };