@salty-css/react 0.0.1-alpha.198 → 0.0.1-alpha.199

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-DiRGNPkK.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-BrE8FCb_.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;
package/class-name.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as r } from "./styles-generator-BrTv_frY.js";
1
+ import { S as r } from "./styles-generator-w1A7H8ur.js";
2
2
  class a extends r {
3
3
  constructor(s) {
4
4
  super(s), this._params = s;
package/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./parse-styles-2-3qmnK9.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-DpQqctxA.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-uvlQsNy-.js";
1
+ import { t as j, p as m } from "./parse-styles-clzzEdJt.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.198",
3
+ "version": "0.0.1-alpha.199",
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.198",
65
+ "@salty-css/core": "^0.0.1-alpha.199",
66
66
  "clsx": ">=2.x",
67
67
  "react": ">=19.x || >=18.3.x"
68
68
  }
@@ -0,0 +1,7 @@
1
+ "use strict";const j=require("./parse-tokens-p68muVgG.cjs"),x=(r,s)=>{if(typeof r!="string")return{result:r};if(!s)return{result:r};const t=[];return Object.values(s).forEach(n=>{const{pattern:p,transform:y}=n;r=r.replace(p,o=>{const{value:d,css:e}=y(o);return e&&t.push(e),d})}),{result:r,additionalCss:t}},P=r=>String.fromCharCode(r+(r>25?39:97)),z=(r,s)=>{let t="",n;for(n=Math.abs(r);n>52;n=n/52|0)t=P(n%52)+t;return t=P(n%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},A=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},C=(r,s=5)=>{const t=A(5381,JSON.stringify(r))>>>0;return z(t,s)},H=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],M=(r,s,t)=>{if(H.some(p=>typeof p=="string"?p===r:p.test(r))){const p=(t==null?void 0:t.defaultUnit)||"px";return`${s}${p}`}return`${s}`},T=["Webkit","Moz","ms","O"],U=r=>r.startsWith("-")?r:T.some(s=>r.startsWith(s))?`-${j.dashCase(r)}`:j.dashCase(r),a=(r,s,t)=>{if(!r)return"";const n=[],p=Object.entries(r).reduce((o,[d,e])=>{const i=d.trim(),w=U(i),O=(h,c=";")=>o=`${o}${h}${c}`,m=h=>O(`${w}:${h}`);if(typeof e=="function"&&(e=e()),typeof e=="object"){if(!e)return o;if(e.isColor)return m(e.toString()),o;if(i==="variants")return Object.entries(e).forEach(([f,u])=>{u&&Object.entries(u).forEach(([b,$])=>{if(!$)return;const l=`${s}.${f}-${b}`,S=a($,l,t);n.push(S)})}),o;if(i==="defaultVariants")return o;if(i==="compoundVariants")return e.forEach(f=>{const{css:u,...b}=f,$=Object.entries(b).reduce((S,[W,N])=>`${S}.${W}-${N}`,s),l=a(u,$,t);n.push(l)}),o;if(i.startsWith("@")){const f=a(e,s,t),u=`${i} {
2
+ ${f.replace(`
3
+ `,`
4
+ `)}
5
+ }`;return n.push(u),o}const h=d.includes("&")?i.replace("&",s):i.startsWith(":")?`${s}${i}`:`${s} ${i}`,c=a(e,h,t);return n.push(c),o}if(t!=null&&t.templates&&t.templates[i]){const c=e.split(".").reduce((f,u)=>f[u],t.templates[i]);if(c){const f=a(c,"");return`${o}${f}`}return console.warn(`Template "${i}" with path of "${e}" was not found in config!`),o}if(typeof e=="number"){const h=M(w,e,t);return m(h)}if(typeof e!="string")if("toString"in e)e=e.toString();else return o;const{modifiers:E}=t||{},V=function*(){yield j.parseValueTokens(e),yield x(e,E)}();for(const{result:h,additionalCss:c=[]}of V)e=h,c.forEach(f=>{const u=a(f,"");O(u,"")});return m(e)},"");return p?s?[`${s} { ${p} }`,...n].join(`
6
+ `):p:n.join(`
7
+ `)};exports.parseStyles=a;exports.toHash=C;
@@ -0,0 +1,117 @@
1
+ import { d as O, p as N } from "./parse-tokens-YUi047xd.js";
2
+ const z = (r, s) => {
3
+ if (typeof r != "string") return { result: r };
4
+ if (!s) return { result: r };
5
+ const t = [];
6
+ return Object.values(s).forEach((n) => {
7
+ const { pattern: p, transform: j } = n;
8
+ r = r.replace(p, (o) => {
9
+ const { value: d, css: e } = j(o);
10
+ return e && t.push(e), d;
11
+ });
12
+ }), { result: r, additionalCss: t };
13
+ }, P = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), A = (r, s) => {
14
+ let t = "", n;
15
+ for (n = Math.abs(r); n > 52; n = n / 52 | 0) t = P(n % 52) + t;
16
+ return t = P(n % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
17
+ }, M = (r, s) => {
18
+ let t = s.length;
19
+ for (; t; ) r = r * 33 ^ s.charCodeAt(--t);
20
+ return r;
21
+ }, J = (r, s = 5) => {
22
+ const t = M(5381, JSON.stringify(r)) >>> 0;
23
+ return A(t, s);
24
+ }, U = [
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
+ ], C = (r, s, t) => {
46
+ if (U.some((p) => typeof p == "string" ? p === r : p.test(r))) {
47
+ const p = (t == null ? void 0 : t.defaultUnit) || "px";
48
+ return `${s}${p}`;
49
+ }
50
+ return `${s}`;
51
+ }, H = ["Webkit", "Moz", "ms", "O"], T = (r) => r.startsWith("-") ? r : H.some((s) => r.startsWith(s)) ? `-${O(r)}` : O(r), a = (r, s, t) => {
52
+ if (!r) return "";
53
+ const n = [], p = Object.entries(r).reduce((o, [d, e]) => {
54
+ const i = d.trim(), w = T(i), y = (h, c = ";") => o = `${o}${h}${c}`, m = (h) => y(`${w}:${h}`);
55
+ if (typeof e == "function" && (e = e()), typeof e == "object") {
56
+ if (!e) return o;
57
+ if (e.isColor)
58
+ return m(e.toString()), o;
59
+ if (i === "variants")
60
+ return Object.entries(e).forEach(([f, u]) => {
61
+ u && Object.entries(u).forEach(([b, $]) => {
62
+ if (!$) return;
63
+ const l = `${s}.${f}-${b}`, S = a($, l, t);
64
+ n.push(S);
65
+ });
66
+ }), o;
67
+ if (i === "defaultVariants")
68
+ return o;
69
+ if (i === "compoundVariants")
70
+ return e.forEach((f) => {
71
+ const { css: u, ...b } = f, $ = Object.entries(b).reduce((S, [W, x]) => `${S}.${W}-${x}`, s), l = a(u, $, t);
72
+ n.push(l);
73
+ }), o;
74
+ if (i.startsWith("@")) {
75
+ const f = a(e, s, t), u = `${i} {
76
+ ${f.replace(`
77
+ `, `
78
+ `)}
79
+ }`;
80
+ return n.push(u), o;
81
+ }
82
+ const h = d.includes("&") ? i.replace("&", s) : i.startsWith(":") ? `${s}${i}` : `${s} ${i}`, c = a(e, h, t);
83
+ return n.push(c), o;
84
+ }
85
+ if (t != null && t.templates && t.templates[i]) {
86
+ const c = e.split(".").reduce((f, u) => f[u], t.templates[i]);
87
+ if (c) {
88
+ const f = a(c, "");
89
+ return `${o}${f}`;
90
+ }
91
+ return console.warn(`Template "${i}" with path of "${e}" was not found in config!`), o;
92
+ }
93
+ if (typeof e == "number") {
94
+ const h = C(w, e, t);
95
+ return m(h);
96
+ }
97
+ if (typeof e != "string")
98
+ if ("toString" in e) e = e.toString();
99
+ else return o;
100
+ const { modifiers: E } = t || {}, V = function* () {
101
+ yield N(e), yield z(e, E);
102
+ }();
103
+ for (const { result: h, additionalCss: c = [] } of V)
104
+ e = h, c.forEach((f) => {
105
+ const u = a(f, "");
106
+ y(u, "");
107
+ });
108
+ return m(e);
109
+ }, "");
110
+ return p ? s ? [`${s} { ${p} }`, ...n].join(`
111
+ `) : p : n.join(`
112
+ `);
113
+ };
114
+ export {
115
+ a as p,
116
+ J as t
117
+ };
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./styles-generator-DiRGNPkK.cjs"),g=require("./element-factory-D4kpeFoW.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-BrE8FCb_.cjs"),g=require("./element-factory-D4kpeFoW.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,4 +1,4 @@
1
- import { S as y } from "./styles-generator-BrTv_frY.js";
1
+ import { S as y } from "./styles-generator-w1A7H8ur.js";
2
2
  import { e as h } from "./element-factory-C7JVLDq7.js";
3
3
  class g extends y {
4
4
  constructor(e, t) {
@@ -1 +1 @@
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-2-3qmnK9.cjs"),l=require("./parse-tokens-p68muVgG.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.parseStyles(c,`.${this.cssClassName}`,n)}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
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-DpQqctxA.cjs"),l=require("./parse-tokens-p68muVgG.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.parseStyles(c,`.${this.cssClassName}`,n)}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
@@ -1,7 +1,7 @@
1
1
  var o = Object.defineProperty;
2
2
  var n = (a, s, t) => s in a ? o(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
3
  var e = (a, s, t) => n(a, typeof s != "symbol" ? s + "" : s, t);
4
- import { t as c, p as l } from "./parse-styles-uvlQsNy-.js";
4
+ import { t as c, p as l } from "./parse-styles-clzzEdJt.js";
5
5
  import { d as m } from "./parse-tokens-YUi047xd.js";
6
6
  class f {
7
7
  constructor(s) {
@@ -1,7 +0,0 @@
1
- "use strict";const O=require("./parse-tokens-p68muVgG.cjs"),P=e=>String.fromCharCode(e+(e>25?39:97)),N=(e,s)=>{let t="",n;for(n=Math.abs(e);n>52;n=n/52|0)t=P(n%52)+t;return t=P(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},U=(e,s=5)=>{const t=T(5381,JSON.stringify(e))>>>0;return N(t,s)},W=(e,s)=>{if(typeof e!="string")return{result:e};if(!s)return{result:e};const t=[];return Object.values(s).forEach(n=>{const{pattern:p,transform:S}=n;e=e.replace(p,i=>{const{value:d,css:r}=S(i);return r&&t.push(r),d})}),{result:e,additionalCss:t}},k=["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(k.some(p=>typeof p=="string"?p===e:p.test(e))){const p=(t==null?void 0:t.defaultUnit)||"px";return`${s}${p}`}return`${s}`},a=(e,s,t)=>{if(!e)return"";const n=[],p=Object.entries(e).reduce((i,[d,r])=>{const o=d.trim(),j=o.startsWith("-")?o:O.dashCase(o),w=(h,c=";")=>i=`${i}${h}${c}`,m=h=>w(`${j}:${h}`);if(typeof r=="function"&&(r=r()),typeof r=="object"){if(!r)return i;if(r.isColor)return m(r.toString()),i;if(o==="variants")return Object.entries(r).forEach(([f,u])=>{u&&Object.entries(u).forEach(([b,$])=>{if(!$)return;const l=`${s}.${f}-${b}`,y=a($,l,t);n.push(y)})}),i;if(o==="defaultVariants")return i;if(o==="compoundVariants")return r.forEach(f=>{const{css:u,...b}=f,$=Object.entries(b).reduce((y,[A,H])=>`${y}.${A}-${H}`,s),l=a(u,$,t);n.push(l)}),i;if(o.startsWith("@")){const f=a(r,s,t),u=`${o} {
2
- ${f.replace(`
3
- `,`
4
- `)}
5
- }`;return n.push(u),i}const h=d.includes("&")?o.replace("&",s):o.startsWith(":")?`${s}${o}`:`${s} ${o}`,c=a(r,h,t);return n.push(c),i}if(t!=null&&t.templates&&t.templates[o]){const c=r.split(".").reduce((f,u)=>f[u],t.templates[o]);if(c){const f=a(c,"");return`${i}${f}`}return console.warn(`Template "${o}" with path of "${r}" was not found in config!`),i}if(typeof r=="number"){const h=q(j,r,t);return m(h)}if(typeof r!="string")if("toString"in r)r=r.toString();else return i;const{modifiers:E}=t||{},V=function*(){yield O.parseValueTokens(r),yield W(r,E)}();for(const{result:h,additionalCss:c=[]}of V)r=h,c.forEach(f=>{const u=a(f,"");w(u,"")});return m(r)},"");return p?s?[`${s} { ${p} }`,...n].join(`
6
- `):p:n.join(`
7
- `)};exports.parseStyles=a;exports.toHash=U;
@@ -1,117 +0,0 @@
1
- import { d as A, p as N } from "./parse-tokens-YUi047xd.js";
2
- const O = (e) => String.fromCharCode(e + (e > 25 ? 39 : 97)), U = (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
- }, W = (e, s) => {
7
- let t = s.length;
8
- for (; t; ) e = e * 33 ^ s.charCodeAt(--t);
9
- return e;
10
- }, k = (e, s = 5) => {
11
- const t = W(5381, JSON.stringify(e)) >>> 0;
12
- return U(t, s);
13
- }, z = (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: p, transform: S } = n;
19
- e = e.replace(p, (i) => {
20
- const { value: d, css: r } = S(i);
21
- return r && t.push(r), d;
22
- });
23
- }), { result: e, additionalCss: t };
24
- }, H = [
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
- ], M = (e, s, t) => {
46
- if (H.some((p) => typeof p == "string" ? p === e : p.test(e))) {
47
- const p = (t == null ? void 0 : t.defaultUnit) || "px";
48
- return `${s}${p}`;
49
- }
50
- return `${s}`;
51
- }, a = (e, s, t) => {
52
- if (!e) return "";
53
- const n = [], p = Object.entries(e).reduce((i, [d, r]) => {
54
- const o = d.trim(), j = o.startsWith("-") ? o : A(o), w = (h, c = ";") => i = `${i}${h}${c}`, m = (h) => w(`${j}:${h}`);
55
- if (typeof r == "function" && (r = r()), typeof r == "object") {
56
- if (!r) return i;
57
- if (r.isColor)
58
- return m(r.toString()), i;
59
- if (o === "variants")
60
- return Object.entries(r).forEach(([f, u]) => {
61
- u && Object.entries(u).forEach(([b, $]) => {
62
- if (!$) return;
63
- const l = `${s}.${f}-${b}`, y = a($, l, t);
64
- n.push(y);
65
- });
66
- }), i;
67
- if (o === "defaultVariants")
68
- return i;
69
- if (o === "compoundVariants")
70
- return r.forEach((f) => {
71
- const { css: u, ...b } = f, $ = Object.entries(b).reduce((y, [V, x]) => `${y}.${V}-${x}`, s), l = a(u, $, t);
72
- n.push(l);
73
- }), i;
74
- if (o.startsWith("@")) {
75
- const f = a(r, s, t), u = `${o} {
76
- ${f.replace(`
77
- `, `
78
- `)}
79
- }`;
80
- return n.push(u), i;
81
- }
82
- const h = d.includes("&") ? o.replace("&", s) : o.startsWith(":") ? `${s}${o}` : `${s} ${o}`, c = a(r, h, t);
83
- return n.push(c), i;
84
- }
85
- if (t != null && t.templates && t.templates[o]) {
86
- const c = r.split(".").reduce((f, u) => f[u], t.templates[o]);
87
- if (c) {
88
- const f = a(c, "");
89
- return `${i}${f}`;
90
- }
91
- return console.warn(`Template "${o}" with path of "${r}" was not found in config!`), i;
92
- }
93
- if (typeof r == "number") {
94
- const h = M(j, r, t);
95
- return m(h);
96
- }
97
- if (typeof r != "string")
98
- if ("toString" in r) r = r.toString();
99
- else return i;
100
- const { modifiers: P } = t || {}, E = function* () {
101
- yield N(r), yield z(r, P);
102
- }();
103
- for (const { result: h, additionalCss: c = [] } of E)
104
- r = h, c.forEach((f) => {
105
- const u = a(f, "");
106
- w(u, "");
107
- });
108
- return m(r);
109
- }, "");
110
- return p ? s ? [`${s} { ${p} }`, ...n].join(`
111
- `) : p : n.join(`
112
- `);
113
- };
114
- export {
115
- a as p,
116
- k as t
117
- };