@tenoxui/moxie 0.2.0 → 0.3.0

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/dist/index.es.js CHANGED
@@ -1,122 +1,99 @@
1
- var K = Object.defineProperty;
2
- var V = Object.getOwnPropertySymbols;
3
- var E = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
4
- var W = (b, e, s) => e in b ? K(b, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : b[e] = s, N = (b, e) => {
5
- for (var s in e || (e = {}))
6
- E.call(e, s) && W(b, s, e[s]);
7
- if (V)
8
- for (var s of V(e))
9
- _.call(e, s) && W(b, s, e[s]);
10
- return b;
1
+ var j = Object.defineProperty;
2
+ var R = Object.getOwnPropertySymbols;
3
+ var z = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
4
+ var V = (P, s, e) => s in P ? j(P, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : P[s] = e, W = (P, s) => {
5
+ for (var e in s || (s = {}))
6
+ z.call(s, e) && V(P, e, s[e]);
7
+ if (R)
8
+ for (var e of R(s))
9
+ S.call(s, e) && V(P, e, s[e]);
10
+ return P;
11
11
  };
12
- class T {
13
- constructor({
14
- property: e = {},
15
- values: s = {},
16
- classes: t = {},
17
- aliases: n = {},
18
- breakpoints: r = []
19
- } = {}) {
20
- this.property = N({
21
- moxie: ({ key: i }) => i
22
- }, e), this.values = s, this.classes = t, this.aliases = n, this.breakpoints = r;
12
+ class _ {
13
+ constructor({ property: s = {}, values: e = {}, classes: t = {}, aliases: n = {} } = {}) {
14
+ this.property = W({
15
+ moxie: ({ key: r }) => r
16
+ }, s), this.values = e, this.classes = t, this.aliases = n;
23
17
  }
24
- toKebabCase(e) {
25
- if (/^(webkit|moz|ms|o)[A-Z]/.test(e)) {
26
- const s = e.match(/^(webkit|moz|ms|o)/);
27
- if (s) {
28
- const t = s[0];
29
- return `-${t}${e.slice(t.length).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`)}`;
18
+ toKebabCase(s) {
19
+ if (/^(webkit|moz|ms|o)[A-Z]/.test(s)) {
20
+ const e = s.match(/^(webkit|moz|ms|o)/);
21
+ if (e) {
22
+ const t = e[0];
23
+ return `-${t}${s.slice(t.length).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`)}`;
30
24
  }
31
25
  }
32
- return e.replace(/[A-Z]/g, (s) => `-${s.toLowerCase()}`);
26
+ return s.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
33
27
  }
34
- escapeCSSSelector(e) {
35
- return e.replace(/([ #{}.:;?%&,@+*~'"!^$[\]()=>|/])/g, "\\$1");
28
+ escapeCSSSelector(s) {
29
+ return s.replace(/([ #{}.:;?%&,@+*~'"!^$[\]()=>|/])/g, "\\$1");
36
30
  }
37
- getAllClassNames(e) {
38
- if (!e) return [];
39
- const s = /* @__PURE__ */ new Set();
40
- return Object.entries(e).forEach(([t, n]) => {
31
+ getAllClassNames(s) {
32
+ if (!s) return [];
33
+ const e = /* @__PURE__ */ new Set();
34
+ return Object.entries(s).forEach(([t, n]) => {
41
35
  n && typeof n == "object" && Object.keys(n).forEach((r) => {
42
- s.add(r);
36
+ e.add(r);
43
37
  });
44
- }), Array.from(s);
38
+ }), Array.from(e);
45
39
  }
46
- getTypePrefixes() {
47
- const e = this.property, s = this.classes, t = Object.keys(e);
48
- if (!s)
49
- return t.sort((i, a) => a.length - i.length).join("|");
50
- const r = [...this.getAllClassNames(s)];
51
- return [...t, ...r].sort((i, a) => a.length - i.length).join("|");
40
+ getTypePrefixes(s = []) {
41
+ const e = this.property, t = this.classes, n = Object.keys(e);
42
+ if (!t)
43
+ return [...n, ...s].sort((i, l) => l.length - i.length).join("|");
44
+ const c = [...this.getAllClassNames(t)];
45
+ return [...n, ...c, ...s].sort((i, l) => l.length - i.length).join("|");
52
46
  }
53
- generateClassNameRegEx() {
54
- const e = this.getTypePrefixes(), s = "(?:([a-zA-Z0-9-]+|\\[[^\\]]+\\]|\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)|\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}):)?", t = `(${e}|\\[[^\\]]+\\])`, n = "(?:-)?", r = "(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|(?:\\[[^\\]]+\\])|(?:\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\})|(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\))|(?:\\$[^\\s\\/]+))", i = "([a-zA-Z%]*)", a = "(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|(?:\\[[^\\]]+\\])|(?:\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\})|(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\))|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";
47
+ generateClassNameRegEx(s) {
48
+ const e = this.getTypePrefixes(s), t = "\\[[^\\]]+\\]", n = "\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)", r = "\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}", c = "(?:([a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?:-" + t + ")|" + // Direct bracket, parenthesis, or brace content
49
+ t + "|" + n + "|" + r + "):)?", i = `(${e}|\\[[^\\]]+\\])`, l = "(?:-)?", h = "(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + // Hex colors
50
+ t + "|" + // Bracket content
51
+ r + "|" + // Curly brace content
52
+ n + "|(?:\\$[^\\s\\/]+))", f = "([a-zA-Z%]*)", a = "(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + t + "|" + r + "|" + n + "|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";
55
53
  return new RegExp(
56
- s + t + n + r + i + a
54
+ c + i + l + h + f + a
57
55
  );
58
56
  }
59
- parse(e) {
60
- for (const [$, o] of Object.entries(this.classes))
61
- if (o && typeof o == "object" && e in o)
62
- return [void 0, e, "", "", void 0, void 0];
63
- const s = this.generateClassNameRegEx(), t = e.match(s);
64
- if (!t) return null;
65
- const [, n, r, i, a, l, h] = t;
66
- return [
67
- n,
68
- //? as its name. e.g. hover, md, focus
69
- r,
70
- //? compute css properties or variables that will styled. e.g. [color]-, [--red,background]-, bg-,
71
- i || "",
72
- //? parsed css value from the class name. e.g. red, space-between, 64, 100
73
- a || "",
74
- //? is optional if the value is numbers. e.g. px, rem, %
75
- // same as value and unit, parsed after the '/' character
76
- l,
77
- h
78
- ];
79
- }
80
- generateMediaQuery(e, s, t) {
81
- const { name: n, min: r, max: i } = e;
82
- let a = "screen and ";
83
- return r !== void 0 && i !== void 0 ? a += `(min-width: ${r}px) and (max-width: ${i}px)` : r !== void 0 ? a += `(min-width: ${r}px)` : i !== void 0 && (a += `(max-width: ${i}px)`), {
84
- mediaKey: `@media ${a}`,
85
- ruleSet: `.${n}\\:${s} { ${t} }`
86
- };
57
+ parse(s, e) {
58
+ if (Object.values(this.classes).some((p) => p == null ? void 0 : p[s]))
59
+ return [void 0, s, "", "", void 0, void 0];
60
+ const t = this.generateClassNameRegEx(e), n = (s + "-dummy").match(t);
61
+ if (!n) return null;
62
+ const [, r, c, i, l, h, f] = n, a = i === "dummy" ? "" : i.replace("-dummy", "");
63
+ return [r, c, a, l || "", h, f];
87
64
  }
88
65
  // unique value parser
89
- processValue(e, s, t) {
66
+ processValue(s, e, t) {
90
67
  if (!s) return "";
91
- const n = (r) => r.replace(/\{([^}]+)\}/g, (i, a) => {
92
- const l = typeof this.values == "object" && this.values !== null ? this.values[a] : void 0;
93
- return typeof l == "string" ? l : i;
68
+ const n = (r) => r.replace(/\{([^}]+)\}/g, (c, i) => {
69
+ const l = this.values, h = l !== null ? typeof l[t] == "object" ? l[t][i] : l[i] : void 0;
70
+ return typeof h == "string" ? h : c;
94
71
  });
95
- if (typeof this.values == "object" && this.values !== null && (this.values[e] && typeof this.values[e] == "object" && this.values[e][s] || this.values[s]))
96
- return typeof this.values[e] == "object" && this.values[e] !== null ? this.values[e][s] : this.values[s];
72
+ if (typeof this.values == "object" && this.values !== null && (this.values[t] && typeof this.values[t] == "object" && this.values[t][s] || this.values[s]))
73
+ return typeof this.values[t] == "object" && this.values[t] !== null ? this.values[t][s] : this.values[s];
97
74
  if (s.startsWith("$"))
98
75
  return `var(--${s.slice(1)})`;
99
76
  if (s.startsWith("[") && s.endsWith("]") || s.startsWith("(") && s.endsWith(")")) {
100
77
  const r = s.slice(1, -1).replace(/_/g, " ");
101
78
  return r.includes("{") ? n(r) : r.startsWith("--") ? `var(${r})` : r;
102
79
  }
103
- return s + (t || "");
80
+ return s + (e || "");
104
81
  }
105
- processShorthand(e = "", s = "", t = "", n, r = "", i = "", a = !0) {
106
- const l = this.property[e], h = /^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;
107
- let $ = null, o = s || "";
108
- const m = o.match(h);
109
- m && ($ = m[1].trim(), o = m[2].trim());
110
- let g;
111
- s.includes($ + ":") ? g = s.startsWith("(") ? `(${o})` : `[${o}]` : g = s;
112
- const c = this.processValue(e, g, t), f = this.processValue(e, r, i);
113
- if (e.startsWith("[") && e.endsWith("]")) {
114
- const d = e.slice(1, -1).split(",").map((p) => p.trim()).map((p) => {
115
- const u = this.property[p] || p;
116
- return `${typeof u == "string" && u.startsWith("--") ? String(u) : this.toKebabCase(String(u))}: ${c}`;
82
+ processShorthand(s = "", e = "", t = "", n, r = "", c = "", i = !0) {
83
+ const l = this.property[s], h = /^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;
84
+ let f = null, a = e || "";
85
+ const p = a.match(h);
86
+ p && (f = p[1].trim(), a = p[2].trim());
87
+ let o;
88
+ e.includes(f + ":") ? o = e.startsWith("(") ? `(${a})` : `[${a}]` : o = e;
89
+ const u = this.processValue(o, t, s), m = this.processValue(r, c, s);
90
+ if (s.startsWith("[") && s.endsWith("]")) {
91
+ const d = s.slice(1, -1).split(",").map((y) => y.trim()).map((y) => {
92
+ const $ = this.property[y] || y;
93
+ return `${typeof $ == "string" && $.startsWith("--") ? String($) : this.toKebabCase(String($))}: ${u}`;
117
94
  }).join("; ");
118
95
  return {
119
- className: `${`[${e.slice(1, -1)}]${a ? "-" : ""}${s}${t}`}`,
96
+ className: `${`[${s.slice(1, -1)}]${i ? "-" : ""}${e}${t}`}`,
120
97
  cssRules: d,
121
98
  // return css rules directly
122
99
  value: null,
@@ -127,95 +104,96 @@ class T {
127
104
  if (l) {
128
105
  if (typeof l == "object" && "property" in l && "value" in l) {
129
106
  const d = typeof l.property == "function" ? l.property({
130
- value: t ? s : c,
107
+ value: t ? e : u,
131
108
  unit: t,
132
- secondValue: i ? r : f,
133
- secondUnit: i,
134
- key: $
135
- }) : l.property, p = l.value;
136
- let u;
137
- typeof p == "function" ? u = p({
138
- value: t ? s : c,
139
- unit: t,
140
- secondValue: i ? r : f,
141
- secondUnit: i,
142
- key: $,
143
- property: d
144
- }) : p && typeof p == "string" ? u = this.parseValuePattern(e, p, c, "", f, "") ? this.parseValuePattern(e, p, c, "", f, "") : c : u = null;
145
- const A = `${e}${s ? `${a && a ? "-" : ""}${s}${t}` : ""}${r ? `/${r}${i}` : ""}`;
109
+ secondValue: c ? r : m,
110
+ secondUnit: c,
111
+ key: f
112
+ }) : l.property, y = l.value;
113
+ let $;
114
+ if (typeof y == "function")
115
+ $ = y({
116
+ value: t ? e : u,
117
+ unit: t,
118
+ secondValue: c ? r : m,
119
+ secondUnit: c,
120
+ key: f,
121
+ property: d
122
+ });
123
+ else if (y && typeof y == "string") {
124
+ const C = l.group || s, A = this.processValue(o, t, C);
125
+ console.log(o), $ = this.values[o] || this.values[C][o] || o.includes("{") || y.includes("{") ? this.parseValuePattern(C, y, A, "", m, "") : u;
126
+ } else $ = null;
146
127
  return {
147
- className: l.classNameSuffix ? {
148
- className: A,
149
- modifier: l.classNameSuffix
150
- } : A,
128
+ className: `${s}${e ? `${i && i ? "-" : ""}${e}${t}` : ""}${r ? `/${r}${c}` : ""}`,
151
129
  cssRules: Array.isArray(d) || typeof d == "string" && d.includes(":") ? d : this.toKebabCase(String(d)),
152
- value: p === null ? null : s.startsWith("[") ? c : u,
130
+ value: y === null ? null : e.startsWith("[") ? u : $,
153
131
  prefix: n
154
132
  };
155
133
  }
156
- const y = typeof l == "function" ? l({
157
- value: t ? s : c,
134
+ const g = typeof l == "function" ? l({
135
+ value: t ? e : u,
158
136
  unit: t,
159
- secondValue: i ? r : f,
160
- secondUnit: i,
161
- key: $
137
+ secondValue: c ? r : m,
138
+ secondUnit: c,
139
+ key: f
162
140
  }) : l;
163
141
  return {
164
- className: `${e}${s ? (a ? "-" : "") + s + t : ""}`,
165
- cssRules: Array.isArray(l) ? y : typeof y == "string" && y.startsWith("value:") ? y.slice(6) : this.toKebabCase(String(y)),
166
- value: typeof y == "string" && y.startsWith("value:") ? null : c,
142
+ className: `${s}${e ? (i ? "-" : "") + e + t : ""}`,
143
+ cssRules: Array.isArray(l) ? g : typeof g == "string" && g.startsWith("value:") ? g.slice(6) : this.toKebabCase(String(g)),
144
+ value: typeof g == "string" && g.startsWith("value:") ? null : u,
167
145
  prefix: n
168
146
  };
169
147
  }
170
148
  return null;
171
149
  }
172
- parseValuePattern(e, s, t, n, r, i) {
173
- if (!s.includes("{0}") && !s.includes("{1") && !s.includes("||"))
174
- return s;
175
- const [a, l] = s.split("||").map((o) => o.trim()), h = this.processValue(e, t, n), $ = this.processValue(e, r, i);
176
- if (s.includes("{0}") && s.includes("{1") || s.includes("{1")) {
177
- let o = a;
178
- if (t && (o = o.replace("{0}", h)), s.includes("{1")) {
179
- const m = o.match(/{1([^}]*)}/);
180
- if (s.includes("{1}"))
181
- r ? o = r.startsWith("[") ? $ : o.replace("{1}", $) : o = l;
182
- else if (m) {
183
- const g = m[0], c = m[1].trim();
184
- let f = $;
185
- !f && c.includes("|") ? f = c.split("|")[1].trim() : f || (f = ""), o = t.startsWith("[") ? h : o.replace(g, f);
150
+ parseValuePattern(s, e, t, n, r, c) {
151
+ if (!e.includes("{0}") && !e.includes("{1") && !e.includes("||"))
152
+ return e;
153
+ const [i, l] = e.split("||").map((a) => a.trim()), h = this.processValue(t, n, s), f = this.processValue(r, c, s);
154
+ if (e.includes("{0}") && e.includes("{1") || e.includes("{1")) {
155
+ let a = i;
156
+ if (t && (a = a.replace("{0}", h)), e.includes("{1")) {
157
+ const p = a.match(/{1([^}]*)}/);
158
+ if (e.includes("{1}"))
159
+ r ? a = r.startsWith("[") ? f : a.replace("{1}", f) : a = l;
160
+ else if (p) {
161
+ const o = p[0], u = p[1].trim();
162
+ let m = f;
163
+ !m && u.includes("|") ? m = u.split("|")[1].trim() : m || (m = ""), a = t.startsWith("[") ? h : a.replace(o, m);
186
164
  }
187
165
  }
188
- return t ? o : l || a;
166
+ return t ? a : l || i;
189
167
  } else
190
- return t ? t.startsWith("[") ? h : a.replace("{0}", h) : l || a;
168
+ return t ? t.startsWith("[") ? h : i.replace("{0}", h) : l || i;
191
169
  }
192
- getParentClass(e) {
170
+ getParentClass(s) {
193
171
  return Object.keys(this.classes).filter(
194
- (s) => Object.prototype.hasOwnProperty.call(
195
- this.classes[s],
196
- e
172
+ (e) => Object.prototype.hasOwnProperty.call(
173
+ this.classes[e],
174
+ s
197
175
  )
198
176
  );
199
177
  }
200
- processCustomClass(e, s = "", t = "", n = "", r = "", i = "", a = !0) {
201
- if (!e) return null;
202
- const l = this.getParentClass(e);
178
+ processCustomClass(s, e = "", t = "", n = "", r = "", c = "", i = !0) {
179
+ if (!s) return null;
180
+ const l = this.getParentClass(s);
203
181
  if (l.length > 0) {
204
- const h = l.map((m) => {
205
- const g = this.classes[m];
206
- if (!g) return "";
207
- const c = this.parseValuePattern(
208
- e,
209
- g[e] || "",
182
+ const h = l.map((p) => {
183
+ const o = this.classes[p];
184
+ if (!o) return "";
185
+ const u = this.parseValuePattern(
210
186
  s,
187
+ o[s] || "",
188
+ e,
211
189
  t,
212
190
  r,
213
- i
191
+ c
214
192
  );
215
- return `${this.toKebabCase(String(m))}: ${c}`;
216
- }).filter(Boolean).join("; "), $ = e.slice(-(s + t).length), o = `${e}${s ? `${a ? "-" : ""}${s}${t}` : ""}${r ? `/${r}${i}` : ""}`;
193
+ return `${this.toKebabCase(String(p))}: ${u}`;
194
+ }).filter(Boolean).join("; "), f = s.slice(-(e + t).length), a = `${s}${e ? `${i ? "-" : ""}${e}${t}` : ""}${r ? `/${r}${c}` : ""}`;
217
195
  return {
218
- className: this.escapeCSSSelector(s === $ ? e : o),
196
+ className: e === f ? s : a,
219
197
  cssRules: h,
220
198
  value: null,
221
199
  prefix: n
@@ -223,118 +201,83 @@ class T {
223
201
  }
224
202
  return null;
225
203
  }
226
- processAlias(e, s = "") {
227
- const t = this.aliases[e];
204
+ processAlias(s, e = "") {
205
+ const t = this.aliases[s];
228
206
  if (!t) return null;
229
207
  const n = t.split(" "), r = [];
230
- return n.forEach((i) => {
231
- const [a, l] = i.split(":"), h = l || a, $ = l ? a : void 0, o = this.parse(i), m = o || [$, h, "", ""];
232
- if (!m) return;
233
- const [g, c, f, y, d, p] = m, u = this.processShorthand(c, f, y, void 0, d, p), A = this.processCustomClass(c, f, y, g, d, p);
234
- if (A) {
235
- const { cssRules: S } = A;
236
- r.push(S);
208
+ return n.forEach((c) => {
209
+ const [i, l] = c.split(":"), h = l || i, f = l ? i : void 0, a = this.parse(c), p = a || [f, h, "", ""];
210
+ if (!p) return;
211
+ const [o, u, m, g, d, y] = p, $ = this.processShorthand(u, m, g, void 0, d, y), x = this.processCustomClass(u, m, g, o, d, y);
212
+ if (x) {
213
+ const { cssRules: C } = x;
214
+ r.push(C);
237
215
  return;
238
216
  }
239
- if (u) {
240
- const S = u.value !== null ? `: ${u.value}` : "";
241
- Array.isArray(u.cssRules) ? u.cssRules.forEach((R) => {
242
- r.push(`${this.toKebabCase(R)}${S}`);
243
- }) : r.push(`${u.cssRules}${S}`);
217
+ if ($) {
218
+ const C = $.value !== null ? `: ${$.value}` : "";
219
+ Array.isArray($.cssRules) ? $.cssRules.forEach((A) => {
220
+ r.push(`${this.toKebabCase(A)}${C}`);
221
+ }) : r.push(`${$.cssRules}${C}`);
244
222
  }
245
223
  }), {
246
- className: e,
224
+ className: s,
247
225
  cssRules: r.join("; "),
248
226
  value: null,
249
- prefix: s
227
+ prefix: e
250
228
  };
251
229
  }
252
- process(e) {
253
- const s = Array.isArray(e) ? e : e.split(/\s+/), t = [];
254
- return s.forEach((n) => {
230
+ process(s) {
231
+ const e = Array.isArray(s) ? s : s.split(/\s+/), t = [];
232
+ return e.forEach((n) => {
255
233
  if (!n) return this;
256
- const [r, i] = n.split(":"), a = i || r, l = i ? r : void 0, h = this.breakpoints.find((x) => x.name === l), $ = this.processAlias(a, l);
257
- if ($) {
258
- const { className: x, cssRules: C } = $;
259
- if (h) {
260
- const { mediaKey: v, ruleSet: P } = this.generateMediaQuery(
261
- h,
262
- x,
263
- C
264
- );
265
- t.push({
266
- className: v,
267
- cssRules: P,
268
- value: null,
269
- prefix: null
270
- });
271
- } else
272
- t.push({
273
- className: x,
274
- cssRules: C,
275
- value: null,
276
- prefix: l
277
- });
234
+ const [r, c] = n.split(":"), i = c || r, l = c ? r : void 0, h = this.processAlias(i, l);
235
+ if (h) {
236
+ const { className: A, cssRules: b } = h;
237
+ t.push({
238
+ className: A,
239
+ cssRules: b,
240
+ value: null,
241
+ prefix: l
242
+ });
278
243
  return;
279
244
  }
280
- const o = this.parse(n), m = o || [l, a, "", ""];
281
- if (!m) return this;
282
- const [g, c, f, y, d, p] = m, u = !n.includes((c || "") + (f || "")), A = this.getParentClass(`${c}${u ? "-" : ""}${f}`).length > 0 ? `${c}${u ? "-" : ""}${f}` : c, S = this.processCustomClass(
283
- A,
284
- f,
285
- y,
245
+ const f = this.parse(n), a = f || [l, i, "", ""];
246
+ if (!a) return this;
247
+ const [p, o, u, m, g, d] = a, y = !n.includes((o || "") + (u || "")), $ = this.getParentClass(`${o}${y ? "-" : ""}${u}`).length > 0 ? `${o}${y ? "-" : ""}${u}` : o, x = this.processCustomClass(
248
+ $,
249
+ u,
250
+ m,
251
+ p,
286
252
  g,
287
253
  d,
288
- p,
289
- u
254
+ y
290
255
  );
291
- if (S) {
292
- const { className: x, cssRules: C, prefix: v } = S;
293
- if (h) {
294
- const { mediaKey: P, ruleSet: j } = this.generateMediaQuery(
295
- h,
296
- x,
297
- C
298
- );
299
- t.push({
300
- className: P,
301
- cssRules: j,
302
- value: null,
303
- prefix: null
304
- });
305
- } else
306
- t.push({
307
- className: x,
308
- cssRules: C,
309
- value: null,
310
- prefix: v
311
- });
256
+ if (x) {
257
+ const { className: A, cssRules: b, prefix: v } = x;
258
+ t.push({
259
+ className: A,
260
+ cssRules: b,
261
+ value: null,
262
+ prefix: v
263
+ });
312
264
  return;
313
265
  }
314
- const R = this.processShorthand(c, f, y, g, d, p, u);
315
- if (R) {
316
- const { className: x, cssRules: C, value: v, prefix: P } = R, j = typeof x == "string" ? this.escapeCSSSelector(x) : this.escapeCSSSelector(x.className) + x.modifier;
317
- if (h) {
318
- const Z = Array.isArray(C) ? C.map((z) => `${this.toKebabCase(z)}: ${v}`).join("; ") : `${C}${v !== null ? `: ${v}` : ""}`, { mediaKey: k, ruleSet: w } = this.generateMediaQuery(h, j, Z);
319
- t.push({
320
- className: k,
321
- cssRules: w,
322
- value: null,
323
- prefix: null
324
- });
325
- } else
326
- t.push({
327
- className: j,
328
- cssRules: C,
329
- value: v,
330
- prefix: P
331
- });
266
+ const C = this.processShorthand(o, u, m, p, g, d, y);
267
+ if (C) {
268
+ const { className: A, cssRules: b, value: v, prefix: Z } = C;
269
+ t.push({
270
+ className: A,
271
+ cssRules: b,
272
+ value: v,
273
+ prefix: Z
274
+ });
332
275
  }
333
276
  }), t;
334
277
  }
335
278
  }
336
279
  export {
337
- T as TenoxUI,
338
- T as default
280
+ _ as TenoxUI,
281
+ _ as default
339
282
  };
340
283
  //# sourceMappingURL=index.es.js.map