tekivex-ui 2.5.2 → 2.5.4
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/TkxForm-DSMDo2Ol.js +388 -0
- package/dist/TkxForm-DwV_n-eE.cjs +12 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +324 -301
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +396 -195
- package/dist/i18n.cjs +1 -0
- package/dist/i18n.js +757 -0
- package/dist/index.cjs +27 -22
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4994 -5089
- package/dist/quantum.cjs +91 -0
- package/dist/quantum.js +2312 -0
- package/dist/realtime.cjs +25 -0
- package/dist/realtime.js +944 -0
- package/dist/security-C369oOWH.cjs +1 -0
- package/dist/security-CzAmaMqa.js +97 -0
- package/dist/src/charts/TkxDonutChart.d.ts.map +1 -1
- package/dist/src/charts/TkxPieChart.d.ts.map +1 -1
- package/dist/src/components/TkxDataGrid.d.ts +9 -1
- package/dist/src/components/TkxDataGrid.d.ts.map +1 -1
- package/dist/src/components/TkxDropdown.d.ts +41 -0
- package/dist/src/components/TkxDropdown.d.ts.map +1 -0
- package/dist/src/components/TkxLiveFeed.d.ts +891 -0
- package/dist/src/components/TkxLiveFeed.d.ts.map +1 -0
- package/dist/src/components/TkxLiveLog.d.ts +892 -0
- package/dist/src/components/TkxLiveLog.d.ts.map +1 -0
- package/dist/src/components/TkxLiveMetrics.d.ts +24 -0
- package/dist/src/components/TkxLiveMetrics.d.ts.map +1 -0
- package/dist/src/components/TkxPlayground.d.ts +15 -0
- package/dist/src/components/TkxPlayground.d.ts.map +1 -0
- package/dist/src/components/TkxQuantumForm.d.ts +20 -0
- package/dist/src/components/TkxQuantumForm.d.ts.map +1 -0
- package/dist/src/components/TkxRealTimeChart.d.ts +27 -0
- package/dist/src/components/TkxRealTimeChart.d.ts.map +1 -0
- package/dist/src/components/TkxTable.d.ts +11 -1
- package/dist/src/components/TkxTable.d.ts.map +1 -1
- package/dist/src/components/TkxThemeBuilder.d.ts +9 -0
- package/dist/src/components/TkxThemeBuilder.d.ts.map +1 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/engine/index.d.ts +2 -0
- package/dist/src/engine/index.d.ts.map +1 -1
- package/dist/src/engine/quantum-ai.d.ts +201 -0
- package/dist/src/engine/quantum-ai.d.ts.map +1 -0
- package/dist/src/engine/tkx.d.ts.map +1 -1
- package/dist/src/headless/index.d.ts +6 -0
- package/dist/src/headless/index.d.ts.map +1 -1
- package/dist/src/headless/useInfiniteQuery.d.ts +35 -0
- package/dist/src/headless/useInfiniteQuery.d.ts.map +1 -0
- package/dist/src/headless/useSSE.d.ts +36 -0
- package/dist/src/headless/useSSE.d.ts.map +1 -0
- package/dist/src/headless/useWebSocket.d.ts +33 -0
- package/dist/src/headless/useWebSocket.d.ts.map +1 -0
- package/dist/src/quantum/index.d.ts +9 -0
- package/dist/src/quantum/index.d.ts.map +1 -0
- package/dist/src/realtime/index.d.ts +9 -0
- package/dist/src/realtime/index.d.ts.map +1 -0
- package/dist/{TkxForm-BWK4LqY3.js → tkx-BJ10JtMv.js} +372 -721
- package/dist/tkx-BeNyC0w7.cjs +4 -0
- package/package.json +16 -1
- package/src/charts/TkxDonutChart.tsx +15 -2
- package/src/charts/TkxPieChart.tsx +17 -2
- package/src/components/TkxDataGrid.tsx +72 -0
- package/src/components/TkxDropdown.tsx +802 -0
- package/src/components/TkxLiveFeed.tsx +329 -0
- package/src/components/TkxLiveLog.tsx +470 -0
- package/src/components/TkxLiveMetrics.tsx +291 -0
- package/src/components/TkxPlayground.tsx +736 -0
- package/src/components/TkxQuantumForm.tsx +592 -0
- package/src/components/TkxRealTimeChart.tsx +381 -0
- package/src/components/TkxTable.tsx +351 -77
- package/src/components/TkxThemeBuilder.tsx +685 -0
- package/src/components/index.ts +4 -0
- package/src/engine/index.ts +2 -0
- package/src/engine/quantum-ai.ts +1045 -0
- package/src/engine/tkx.ts +95 -4
- package/src/headless/index.ts +6 -0
- package/src/headless/useInfiniteQuery.ts +153 -0
- package/src/headless/useSSE.ts +165 -0
- package/src/headless/useWebSocket.ts +229 -0
- package/src/quantum/index.ts +39 -0
- package/src/realtime/index.ts +21 -0
- package/dist/TkxForm-ljQjX7KD.cjs +0 -15
|
@@ -1,150 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { jsx as _, jsxs as L, Fragment as jt } from "react/jsx-runtime";
|
|
4
|
-
const Mt = {
|
|
5
|
-
"<": "<",
|
|
6
|
-
">": ">",
|
|
7
|
-
"&": "&",
|
|
8
|
-
"'": "'",
|
|
9
|
-
'"': """
|
|
10
|
-
};
|
|
11
|
-
function K(t) {
|
|
12
|
-
return String(t).replace(/[<>&'"]/g, (i) => Mt[i] ?? i);
|
|
13
|
-
}
|
|
14
|
-
function pt(t) {
|
|
15
|
-
const i = {};
|
|
16
|
-
for (const o of Object.keys(t))
|
|
17
|
-
i[o] = mt(t[o]);
|
|
18
|
-
return i;
|
|
19
|
-
}
|
|
20
|
-
function mt(t) {
|
|
21
|
-
return typeof t == "string" ? K(t) : Array.isArray(t) ? t.map(mt) : t !== null && typeof t == "object" && !zt(t) ? pt(t) : t;
|
|
22
|
-
}
|
|
23
|
-
function zt(t) {
|
|
24
|
-
return typeof t == "object" && t !== null && "$$typeof" in t;
|
|
25
|
-
}
|
|
26
|
-
function Et(t, i) {
|
|
27
|
-
const o = [];
|
|
28
|
-
for (const [s, a] of Object.entries(i)) {
|
|
29
|
-
const l = t[s], g = l == null;
|
|
30
|
-
if (a.required && g) {
|
|
31
|
-
o.push(`prop '${s}' is required`);
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (!g) {
|
|
35
|
-
if (typeof l !== a.type) {
|
|
36
|
-
o.push(`prop '${s}' must be of type ${a.type}, got ${typeof l}`);
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
a.type === "number" && typeof l == "number" && (a.min !== void 0 && l < a.min && o.push(`prop '${s}' must be >= ${a.min}`), a.max !== void 0 && l > a.max && o.push(`prop '${s}' must be <= ${a.max}`)), a.type === "string" && typeof l == "string" && a.pattern && !a.pattern.test(l) && o.push(`prop '${s}' does not match pattern ${a.pattern}`), a.enum && !a.enum.includes(l) && o.push(`prop '${s}' must be one of: ${a.enum.join(", ")}`);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return { valid: o.length === 0, errors: o };
|
|
43
|
-
}
|
|
44
|
-
const ht = /* @__PURE__ */ new Map();
|
|
45
|
-
function Rt(t, i) {
|
|
46
|
-
const o = {
|
|
47
|
-
"default-src": ["'self'"],
|
|
48
|
-
"style-src": i.allowInlineStyles ? ["'self'", "'unsafe-inline'"] : ["'self'"],
|
|
49
|
-
"img-src": i.allowDataUrls ? ["'self'", "data:"] : i.allowExternalSrc ? ["'self'", "*"] : ["'self'"],
|
|
50
|
-
"script-src": i.allowScripts ? ["'self'"] : ["'none'"]
|
|
51
|
-
}, s = { componentId: t, permissions: i, directives: o };
|
|
52
|
-
return ht.set(t, s), s;
|
|
53
|
-
}
|
|
54
|
-
function Tt(t, i) {
|
|
55
|
-
const o = ht.get(t);
|
|
56
|
-
return (o == null ? void 0 : o.permissions[i]) === !0;
|
|
57
|
-
}
|
|
58
|
-
let D = [];
|
|
59
|
-
function At(t, i, o) {
|
|
60
|
-
const s = Q(JSON.stringify(o ?? {})), a = D.length > 0 ? D[D.length - 1].chainHash : "00000000", l = Q(a + s + i + t), g = Object.freeze({
|
|
61
|
-
timestamp: Date.now(),
|
|
62
|
-
component: i,
|
|
63
|
-
action: t,
|
|
64
|
-
propsHash: s,
|
|
65
|
-
chainHash: l
|
|
66
|
-
});
|
|
67
|
-
return D = Object.freeze([...D, g]), g;
|
|
68
|
-
}
|
|
69
|
-
function Ct(t) {
|
|
70
|
-
let i = D;
|
|
71
|
-
return t != null && t.component && (i = i.filter((o) => o.component === t.component)), t != null && t.action && (i = i.filter((o) => o.action === t.action)), t != null && t.limit && (i = i.slice(-t.limit)), i;
|
|
72
|
-
}
|
|
73
|
-
function It() {
|
|
74
|
-
let t = "00000000";
|
|
75
|
-
for (const i of D) {
|
|
76
|
-
if (Q(t + i.propsHash + i.component + i.action) !== i.chainHash) return !1;
|
|
77
|
-
t = i.chainHash;
|
|
78
|
-
}
|
|
79
|
-
return !0;
|
|
80
|
-
}
|
|
81
|
-
const re = {
|
|
82
|
-
sanitize: K,
|
|
83
|
-
sanitizeProps: pt,
|
|
84
|
-
validateProps: Et,
|
|
85
|
-
createCSP: Rt,
|
|
86
|
-
hasPermission: Tt,
|
|
87
|
-
audit: At,
|
|
88
|
-
getAuditLog: Ct,
|
|
89
|
-
verifyAuditIntegrity: It
|
|
90
|
-
};
|
|
91
|
-
function ne() {
|
|
92
|
-
const [t, i] = nt(() => typeof window > "u" ? !1 : Ft());
|
|
93
|
-
return U(() => {
|
|
94
|
-
if (typeof window > "u") return;
|
|
95
|
-
const o = window.matchMedia("(prefers-reduced-motion: reduce)"), s = (a) => i(a.matches);
|
|
96
|
-
return o.addEventListener("change", s), () => o.removeEventListener("change", s);
|
|
97
|
-
}, []), t;
|
|
98
|
-
}
|
|
99
|
-
function ie() {
|
|
100
|
-
const [t, i] = nt(() => typeof window > "u" ? !1 : St());
|
|
101
|
-
return U(() => {
|
|
102
|
-
if (typeof window > "u") return;
|
|
103
|
-
const o = window.matchMedia("(forced-colors: active)"), s = (a) => i(a.matches);
|
|
104
|
-
return o.addEventListener("change", s), () => o.removeEventListener("change", s);
|
|
105
|
-
}, []), t;
|
|
106
|
-
}
|
|
107
|
-
function oe(t) {
|
|
108
|
-
const i = S(null);
|
|
109
|
-
return U(() => {
|
|
110
|
-
if (!t || !i.current) return;
|
|
111
|
-
const o = kt(i.current);
|
|
112
|
-
return o.activate(), () => o.deactivate();
|
|
113
|
-
}, [t]), i;
|
|
114
|
-
}
|
|
115
|
-
function se() {
|
|
116
|
-
const t = S(null);
|
|
117
|
-
return U(() => {
|
|
118
|
-
if (!(typeof document > "u"))
|
|
119
|
-
return t.current = $t(), () => {
|
|
120
|
-
var i;
|
|
121
|
-
(i = t.current) == null || i.destroy();
|
|
122
|
-
};
|
|
123
|
-
}, []), k((i, o = "polite") => {
|
|
124
|
-
var s;
|
|
125
|
-
(s = t.current) == null || s.announce(i, o);
|
|
126
|
-
}, []);
|
|
127
|
-
}
|
|
128
|
-
function ae(t, i = !0) {
|
|
129
|
-
const o = S(t);
|
|
130
|
-
o.current = t, U(() => {
|
|
131
|
-
if (!i || typeof document > "u") return;
|
|
132
|
-
const s = (a) => {
|
|
133
|
-
a.key === "Escape" && o.current();
|
|
134
|
-
};
|
|
135
|
-
return document.addEventListener("keydown", s), () => document.removeEventListener("keydown", s);
|
|
136
|
-
}, [i]);
|
|
137
|
-
}
|
|
138
|
-
function ce(t, i) {
|
|
139
|
-
const o = S(i);
|
|
140
|
-
o.current = i, U(() => {
|
|
141
|
-
const s = (a) => {
|
|
142
|
-
!t.current || t.current.contains(a.target) || o.current();
|
|
143
|
-
};
|
|
144
|
-
return document.addEventListener("pointerdown", s), () => document.removeEventListener("pointerdown", s);
|
|
145
|
-
}, [t]);
|
|
146
|
-
}
|
|
147
|
-
const d = {
|
|
1
|
+
import { n as V } from "./index-eT_U4qB2.js";
|
|
2
|
+
const l = {
|
|
148
3
|
0: "0",
|
|
149
4
|
px: "1px",
|
|
150
5
|
"0.5": "2px",
|
|
@@ -188,7 +43,7 @@ const d = {
|
|
|
188
43
|
fit: "fit-content",
|
|
189
44
|
max: "max-content",
|
|
190
45
|
min: "min-content"
|
|
191
|
-
},
|
|
46
|
+
}, H = { ...l, screen: "100vh" }, x = {
|
|
192
47
|
"1/2": "50%",
|
|
193
48
|
"1/3": "33.333333%",
|
|
194
49
|
"2/3": "66.666667%",
|
|
@@ -205,7 +60,7 @@ const d = {
|
|
|
205
60
|
"5/12": "41.666667%",
|
|
206
61
|
"7/12": "58.333333%",
|
|
207
62
|
"11/12": "91.666667%"
|
|
208
|
-
},
|
|
63
|
+
}, y = {
|
|
209
64
|
none: "0",
|
|
210
65
|
sm: "2px",
|
|
211
66
|
"": "4px",
|
|
@@ -215,7 +70,7 @@ const d = {
|
|
|
215
70
|
"2xl": "16px",
|
|
216
71
|
"3xl": "24px",
|
|
217
72
|
full: "9999px"
|
|
218
|
-
},
|
|
73
|
+
}, U = {
|
|
219
74
|
sm: "0 1px 2px 0 rgba(0,0,0,.05)",
|
|
220
75
|
"": "0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1)",
|
|
221
76
|
md: "0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)",
|
|
@@ -224,7 +79,7 @@ const d = {
|
|
|
224
79
|
"2xl": "0 25px 50px -12px rgba(0,0,0,.25)",
|
|
225
80
|
inner: "inset 0 2px 4px 0 rgba(0,0,0,.05)",
|
|
226
81
|
none: "none"
|
|
227
|
-
},
|
|
82
|
+
}, J = {
|
|
228
83
|
xs: ["0.75rem", "1rem"],
|
|
229
84
|
sm: ["0.875rem", "1.25rem"],
|
|
230
85
|
base: ["1rem", "1.5rem"],
|
|
@@ -238,7 +93,7 @@ const d = {
|
|
|
238
93
|
"7xl": ["4.5rem", "1"],
|
|
239
94
|
"8xl": ["6rem", "1"],
|
|
240
95
|
"9xl": ["8rem", "1"]
|
|
241
|
-
},
|
|
96
|
+
}, Q = {
|
|
242
97
|
thin: "100",
|
|
243
98
|
extralight: "200",
|
|
244
99
|
light: "300",
|
|
@@ -248,7 +103,7 @@ const d = {
|
|
|
248
103
|
bold: "700",
|
|
249
104
|
extrabold: "800",
|
|
250
105
|
black: "900"
|
|
251
|
-
},
|
|
106
|
+
}, tt = {
|
|
252
107
|
none: "1",
|
|
253
108
|
tight: "1.25",
|
|
254
109
|
snug: "1.375",
|
|
@@ -263,14 +118,14 @@ const d = {
|
|
|
263
118
|
8: "2rem",
|
|
264
119
|
9: "2.25rem",
|
|
265
120
|
10: "2.5rem"
|
|
266
|
-
},
|
|
121
|
+
}, et = {
|
|
267
122
|
tighter: "-0.05em",
|
|
268
123
|
tight: "-0.025em",
|
|
269
124
|
normal: "0em",
|
|
270
125
|
wide: "0.025em",
|
|
271
126
|
wider: "0.05em",
|
|
272
127
|
widest: "0.1em"
|
|
273
|
-
},
|
|
128
|
+
}, k = {
|
|
274
129
|
none: "0",
|
|
275
130
|
sm: "4px",
|
|
276
131
|
"": "8px",
|
|
@@ -279,9 +134,9 @@ const d = {
|
|
|
279
134
|
xl: "24px",
|
|
280
135
|
"2xl": "40px",
|
|
281
136
|
"3xl": "64px"
|
|
282
|
-
},
|
|
137
|
+
}, rt = Object.fromEntries(
|
|
283
138
|
[0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100].map((t) => [String(t), String(t / 100)])
|
|
284
|
-
),
|
|
139
|
+
), Y = /* @__PURE__ */ new Set([
|
|
285
140
|
"bg",
|
|
286
141
|
"surface",
|
|
287
142
|
"surfaceAlt",
|
|
@@ -294,31 +149,159 @@ const d = {
|
|
|
294
149
|
"warning",
|
|
295
150
|
"success",
|
|
296
151
|
"info"
|
|
297
|
-
]),
|
|
152
|
+
]), nt = {
|
|
298
153
|
sm: "640px",
|
|
299
154
|
md: "768px",
|
|
300
155
|
lg: "1024px",
|
|
301
156
|
xl: "1280px",
|
|
302
157
|
"2xl": "1536px"
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
158
|
+
}, it = /javascript\s*:|vbscript\s*:|data\s*:\s*text\/html|data\s*:\s*text\/javascript|expression\s*\(|[\r\n\x00]/i, ot = /* @__PURE__ */ new Set([
|
|
159
|
+
"behavior",
|
|
160
|
+
"-moz-binding",
|
|
161
|
+
"-webkit-binding",
|
|
162
|
+
"src"
|
|
163
|
+
]), st = /* @__PURE__ */ new Set([
|
|
164
|
+
// Box model
|
|
165
|
+
"width",
|
|
166
|
+
"min-width",
|
|
167
|
+
"max-width",
|
|
168
|
+
"height",
|
|
169
|
+
"min-height",
|
|
170
|
+
"max-height",
|
|
171
|
+
"margin",
|
|
172
|
+
"margin-top",
|
|
173
|
+
"margin-right",
|
|
174
|
+
"margin-bottom",
|
|
175
|
+
"margin-left",
|
|
176
|
+
"padding",
|
|
177
|
+
"padding-top",
|
|
178
|
+
"padding-right",
|
|
179
|
+
"padding-bottom",
|
|
180
|
+
"padding-left",
|
|
181
|
+
// Positioning
|
|
182
|
+
"position",
|
|
183
|
+
"top",
|
|
184
|
+
"right",
|
|
185
|
+
"bottom",
|
|
186
|
+
"left",
|
|
187
|
+
"z-index",
|
|
188
|
+
"inset",
|
|
189
|
+
// Flexbox / Grid
|
|
190
|
+
"flex",
|
|
191
|
+
"flex-grow",
|
|
192
|
+
"flex-shrink",
|
|
193
|
+
"flex-basis",
|
|
194
|
+
"flex-direction",
|
|
195
|
+
"flex-wrap",
|
|
196
|
+
"align-items",
|
|
197
|
+
"align-self",
|
|
198
|
+
"align-content",
|
|
199
|
+
"justify-content",
|
|
200
|
+
"justify-items",
|
|
201
|
+
"justify-self",
|
|
202
|
+
"gap",
|
|
203
|
+
"row-gap",
|
|
204
|
+
"column-gap",
|
|
205
|
+
"grid-template-columns",
|
|
206
|
+
"grid-template-rows",
|
|
207
|
+
"grid-column",
|
|
208
|
+
"grid-row",
|
|
209
|
+
"grid-area",
|
|
210
|
+
"grid-template-areas",
|
|
211
|
+
// Typography
|
|
212
|
+
"font-size",
|
|
213
|
+
"font-weight",
|
|
214
|
+
"font-family",
|
|
215
|
+
"font-style",
|
|
216
|
+
"line-height",
|
|
217
|
+
"letter-spacing",
|
|
218
|
+
"text-align",
|
|
219
|
+
"text-decoration",
|
|
220
|
+
"text-transform",
|
|
221
|
+
"text-overflow",
|
|
222
|
+
"white-space",
|
|
223
|
+
"word-break",
|
|
224
|
+
"word-wrap",
|
|
225
|
+
"overflow-wrap",
|
|
226
|
+
// Color / Background
|
|
227
|
+
"color",
|
|
228
|
+
"background",
|
|
229
|
+
"background-color",
|
|
230
|
+
"background-image",
|
|
231
|
+
"background-position",
|
|
232
|
+
"background-size",
|
|
233
|
+
"background-repeat",
|
|
234
|
+
"opacity",
|
|
235
|
+
// Border
|
|
236
|
+
"border",
|
|
237
|
+
"border-top",
|
|
238
|
+
"border-right",
|
|
239
|
+
"border-bottom",
|
|
240
|
+
"border-left",
|
|
241
|
+
"border-width",
|
|
242
|
+
"border-style",
|
|
243
|
+
"border-color",
|
|
244
|
+
"border-radius",
|
|
245
|
+
"outline",
|
|
246
|
+
"outline-offset",
|
|
247
|
+
// Effects
|
|
248
|
+
"box-shadow",
|
|
249
|
+
"text-shadow",
|
|
250
|
+
"filter",
|
|
251
|
+
"backdrop-filter",
|
|
252
|
+
"transform",
|
|
253
|
+
"transition",
|
|
254
|
+
"animation",
|
|
255
|
+
// Layout
|
|
256
|
+
"display",
|
|
257
|
+
"overflow",
|
|
258
|
+
"overflow-x",
|
|
259
|
+
"overflow-y",
|
|
260
|
+
"visibility",
|
|
261
|
+
"pointer-events",
|
|
262
|
+
"cursor",
|
|
263
|
+
"user-select",
|
|
264
|
+
// Misc safe
|
|
265
|
+
"aspect-ratio",
|
|
266
|
+
"object-fit",
|
|
267
|
+
"object-position",
|
|
268
|
+
"list-style",
|
|
269
|
+
"vertical-align",
|
|
270
|
+
"float",
|
|
271
|
+
"clear",
|
|
272
|
+
"resize",
|
|
273
|
+
"scroll-behavior",
|
|
274
|
+
"content"
|
|
275
|
+
// allow content: '' for pseudo-like patterns but value is guarded
|
|
276
|
+
]);
|
|
277
|
+
function B(t) {
|
|
278
|
+
return it.test(t) || t.includes("}") || t.includes("{") || t.includes("<") || t.includes(">") ? null : t;
|
|
279
|
+
}
|
|
280
|
+
function at(t) {
|
|
281
|
+
const o = t.toLowerCase().trim();
|
|
282
|
+
return ot.has(o) || !st.has(o) ? null : o;
|
|
307
283
|
}
|
|
308
|
-
function
|
|
309
|
-
|
|
284
|
+
function i(t) {
|
|
285
|
+
const o = t.match(/^\[(.+)]$/);
|
|
286
|
+
return o ? B(o[1]) : null;
|
|
287
|
+
}
|
|
288
|
+
function h(t) {
|
|
289
|
+
if (Y.has(t)) return `var(--tkx-${t})`;
|
|
310
290
|
if (t === "transparent") return "transparent";
|
|
311
291
|
if (t === "current") return "currentColor";
|
|
312
292
|
if (t === "white") return "#ffffff";
|
|
313
293
|
if (t === "black") return "#000000";
|
|
314
294
|
if (t === "inherit") return "inherit";
|
|
315
|
-
const
|
|
316
|
-
return
|
|
295
|
+
const o = i(t);
|
|
296
|
+
return o || (/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(t), t);
|
|
317
297
|
}
|
|
318
|
-
function
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
|
|
298
|
+
function lt(t) {
|
|
299
|
+
const o = t.match(/^\[([a-zA-Z-]+):(.+)]$/);
|
|
300
|
+
if (o) {
|
|
301
|
+
const r = at(o[1]), n = B(o[2]);
|
|
302
|
+
return r && n ? { [r]: n } : null;
|
|
303
|
+
}
|
|
304
|
+
const s = {
|
|
322
305
|
flex: "flex",
|
|
323
306
|
"inline-flex": "inline-flex",
|
|
324
307
|
grid: "grid",
|
|
@@ -335,40 +318,40 @@ function Lt(t) {
|
|
|
335
318
|
"table-caption": "table-caption",
|
|
336
319
|
"list-item": "list-item"
|
|
337
320
|
};
|
|
338
|
-
if (
|
|
339
|
-
const
|
|
321
|
+
if (s[t]) return { display: s[t] };
|
|
322
|
+
const a = {
|
|
340
323
|
"flex-row": "row",
|
|
341
324
|
"flex-col": "column",
|
|
342
325
|
"flex-row-reverse": "row-reverse",
|
|
343
326
|
"flex-col-reverse": "column-reverse"
|
|
344
327
|
};
|
|
345
|
-
if (
|
|
346
|
-
const
|
|
328
|
+
if (a[t]) return { "flex-direction": a[t] };
|
|
329
|
+
const f = {
|
|
347
330
|
"flex-wrap": "wrap",
|
|
348
331
|
"flex-nowrap": "nowrap",
|
|
349
332
|
"flex-wrap-reverse": "wrap-reverse"
|
|
350
333
|
};
|
|
351
|
-
if (
|
|
352
|
-
const
|
|
334
|
+
if (f[t]) return { "flex-wrap": f[t] };
|
|
335
|
+
const b = {
|
|
353
336
|
"flex-1": "1 1 0%",
|
|
354
337
|
"flex-auto": "1 1 auto",
|
|
355
338
|
"flex-none": "none",
|
|
356
339
|
"flex-initial": "0 1 auto"
|
|
357
340
|
};
|
|
358
|
-
if (
|
|
341
|
+
if (b[t]) return { flex: b[t] };
|
|
359
342
|
if (t === "grow" || t === "flex-grow") return { "flex-grow": "1" };
|
|
360
343
|
if (t === "grow-0") return { "flex-grow": "0" };
|
|
361
344
|
if (t === "shrink" || t === "flex-shrink") return { "flex-shrink": "1" };
|
|
362
345
|
if (t === "shrink-0" || t === "flex-shrink-0") return { "flex-shrink": "0" };
|
|
363
|
-
const
|
|
346
|
+
const $ = {
|
|
364
347
|
"items-start": "flex-start",
|
|
365
348
|
"items-end": "flex-end",
|
|
366
349
|
"items-center": "center",
|
|
367
350
|
"items-stretch": "stretch",
|
|
368
351
|
"items-baseline": "baseline"
|
|
369
352
|
};
|
|
370
|
-
if (
|
|
371
|
-
const
|
|
353
|
+
if ($[t]) return { "align-items": $[t] };
|
|
354
|
+
const d = {
|
|
372
355
|
"justify-start": "flex-start",
|
|
373
356
|
"justify-end": "flex-end",
|
|
374
357
|
"justify-center": "center",
|
|
@@ -378,8 +361,8 @@ function Lt(t) {
|
|
|
378
361
|
"justify-stretch": "stretch",
|
|
379
362
|
"justify-normal": "normal"
|
|
380
363
|
};
|
|
381
|
-
if (
|
|
382
|
-
const
|
|
364
|
+
if (d[t]) return { "justify-content": d[t] };
|
|
365
|
+
const c = {
|
|
383
366
|
"self-auto": "auto",
|
|
384
367
|
"self-start": "flex-start",
|
|
385
368
|
"self-end": "flex-end",
|
|
@@ -387,7 +370,7 @@ function Lt(t) {
|
|
|
387
370
|
"self-stretch": "stretch",
|
|
388
371
|
"self-baseline": "baseline"
|
|
389
372
|
};
|
|
390
|
-
if (
|
|
373
|
+
if (c[t]) return { "align-self": c[t] };
|
|
391
374
|
const m = {
|
|
392
375
|
"content-start": "flex-start",
|
|
393
376
|
"content-end": "flex-end",
|
|
@@ -417,87 +400,87 @@ function Lt(t) {
|
|
|
417
400
|
if (t === "grid-flow-row-dense") return { "grid-auto-flow": "row dense" };
|
|
418
401
|
if (t === "grid-flow-col-dense") return { "grid-auto-flow": "column dense" };
|
|
419
402
|
if (e = t.match(/^p-(.+)$/)) {
|
|
420
|
-
const r =
|
|
403
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
421
404
|
if (r) return { padding: r };
|
|
422
405
|
}
|
|
423
406
|
if (e = t.match(/^px-(.+)$/)) {
|
|
424
|
-
const r =
|
|
407
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
425
408
|
if (r) return { "padding-left": r, "padding-right": r };
|
|
426
409
|
}
|
|
427
410
|
if (e = t.match(/^py-(.+)$/)) {
|
|
428
|
-
const r =
|
|
411
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
429
412
|
if (r) return { "padding-top": r, "padding-bottom": r };
|
|
430
413
|
}
|
|
431
414
|
if (e = t.match(/^pt-(.+)$/)) {
|
|
432
|
-
const r =
|
|
415
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
433
416
|
if (r) return { "padding-top": r };
|
|
434
417
|
}
|
|
435
418
|
if (e = t.match(/^pr-(.+)$/)) {
|
|
436
|
-
const r =
|
|
419
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
437
420
|
if (r) return { "padding-right": r };
|
|
438
421
|
}
|
|
439
422
|
if (e = t.match(/^pb-(.+)$/)) {
|
|
440
|
-
const r =
|
|
423
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
441
424
|
if (r) return { "padding-bottom": r };
|
|
442
425
|
}
|
|
443
426
|
if (e = t.match(/^pl-(.+)$/)) {
|
|
444
|
-
const r =
|
|
427
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
445
428
|
if (r) return { "padding-left": r };
|
|
446
429
|
}
|
|
447
430
|
if (e = t.match(/^-?m-(.+)$/)) {
|
|
448
|
-
const r = t.startsWith("-"), n =
|
|
431
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
449
432
|
if (n) return { margin: r && n !== "0" ? `-${n}` : n };
|
|
450
433
|
}
|
|
451
434
|
if (e = t.match(/^-?mx-(.+)$/)) {
|
|
452
|
-
const r = t.startsWith("-"), n =
|
|
435
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
453
436
|
if (n) {
|
|
454
437
|
const p = r && n !== "0" ? `-${n}` : n;
|
|
455
438
|
return { "margin-left": p, "margin-right": p };
|
|
456
439
|
}
|
|
457
440
|
}
|
|
458
441
|
if (e = t.match(/^-?my-(.+)$/)) {
|
|
459
|
-
const r = t.startsWith("-"), n =
|
|
442
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
460
443
|
if (n) {
|
|
461
444
|
const p = r && n !== "0" ? `-${n}` : n;
|
|
462
445
|
return { "margin-top": p, "margin-bottom": p };
|
|
463
446
|
}
|
|
464
447
|
}
|
|
465
448
|
if (e = t.match(/^-?mt-(.+)$/)) {
|
|
466
|
-
const r = t.startsWith("-"), n =
|
|
449
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
467
450
|
if (n) return { "margin-top": r && n !== "0" ? `-${n}` : n };
|
|
468
451
|
}
|
|
469
452
|
if (e = t.match(/^-?mr-(.+)$/)) {
|
|
470
|
-
const r = t.startsWith("-"), n =
|
|
453
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
471
454
|
if (n) return { "margin-right": r && n !== "0" ? `-${n}` : n };
|
|
472
455
|
}
|
|
473
456
|
if (e = t.match(/^-?mb-(.+)$/)) {
|
|
474
|
-
const r = t.startsWith("-"), n =
|
|
457
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
475
458
|
if (n) return { "margin-bottom": r && n !== "0" ? `-${n}` : n };
|
|
476
459
|
}
|
|
477
460
|
if (e = t.match(/^-?ml-(.+)$/)) {
|
|
478
|
-
const r = t.startsWith("-"), n =
|
|
461
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? i(e[1]);
|
|
479
462
|
if (n) return { "margin-left": r && n !== "0" ? `-${n}` : n };
|
|
480
463
|
}
|
|
481
464
|
if (t === "mx-auto") return { "margin-left": "auto", "margin-right": "auto" };
|
|
482
465
|
if (t === "my-auto") return { "margin-top": "auto", "margin-bottom": "auto" };
|
|
483
466
|
if (e = t.match(/^gap-(.+)$/)) {
|
|
484
|
-
const r =
|
|
467
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
485
468
|
if (r) return { gap: r };
|
|
486
469
|
}
|
|
487
470
|
if (e = t.match(/^gap-x-(.+)$/)) {
|
|
488
|
-
const r =
|
|
471
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
489
472
|
if (r) return { "column-gap": r };
|
|
490
473
|
}
|
|
491
474
|
if (e = t.match(/^gap-y-(.+)$/)) {
|
|
492
|
-
const r =
|
|
475
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
493
476
|
if (r) return { "row-gap": r };
|
|
494
477
|
}
|
|
495
478
|
if (e = t.match(/^w-(.+)$/)) {
|
|
496
|
-
const r = e[1], n =
|
|
479
|
+
const r = e[1], n = l[r] ?? x[r] ?? i(r);
|
|
497
480
|
if (n) return { width: n };
|
|
498
481
|
}
|
|
499
482
|
if (e = t.match(/^min-w-(.+)$/)) {
|
|
500
|
-
const r =
|
|
483
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
501
484
|
if (r) return { "min-width": r };
|
|
502
485
|
}
|
|
503
486
|
if (e = t.match(/^max-w-(.+)$/)) {
|
|
@@ -519,40 +502,40 @@ function Lt(t) {
|
|
|
519
502
|
min: "min-content",
|
|
520
503
|
max: "max-content",
|
|
521
504
|
fit: "fit-content"
|
|
522
|
-
}[e[1]] ??
|
|
505
|
+
}[e[1]] ?? l[e[1]] ?? i(e[1]);
|
|
523
506
|
if (n) return { "max-width": n };
|
|
524
507
|
}
|
|
525
508
|
if (e = t.match(/^h-(.+)$/)) {
|
|
526
|
-
const r = e[1], n =
|
|
509
|
+
const r = e[1], n = H[r] ?? x[r] ?? i(r);
|
|
527
510
|
if (n) return { height: n };
|
|
528
511
|
}
|
|
529
512
|
if (e = t.match(/^min-h-(.+)$/)) {
|
|
530
|
-
const n = { 0: "0", full: "100%", screen: "100vh", svh: "100svh", dvh: "100dvh" }[e[1]] ??
|
|
513
|
+
const n = { 0: "0", full: "100%", screen: "100vh", svh: "100svh", dvh: "100dvh" }[e[1]] ?? l[e[1]] ?? i(e[1]);
|
|
531
514
|
if (n) return { "min-height": n };
|
|
532
515
|
}
|
|
533
516
|
if (e = t.match(/^max-h-(.+)$/)) {
|
|
534
|
-
const r =
|
|
517
|
+
const r = H[e[1]] ?? i(e[1]);
|
|
535
518
|
if (r) return { "max-height": r };
|
|
536
519
|
}
|
|
537
520
|
if (e = t.match(/^size-(.+)$/)) {
|
|
538
|
-
const r =
|
|
521
|
+
const r = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
539
522
|
if (r) return { width: r, height: r };
|
|
540
523
|
}
|
|
541
524
|
if (e = t.match(/^text-(xs|sm|base|lg|[2-9]xl|\d+xl)$/)) {
|
|
542
|
-
const [r, n] =
|
|
525
|
+
const [r, n] = J[e[1]] ?? ["1rem", "1.5rem"];
|
|
543
526
|
return { "font-size": r, "line-height": n };
|
|
544
527
|
}
|
|
545
528
|
if (e = t.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\d+)$/))
|
|
546
|
-
return { "font-weight":
|
|
529
|
+
return { "font-weight": Q[e[1]] ?? e[1] };
|
|
547
530
|
if (e = t.match(/^leading-(.+)$/)) {
|
|
548
|
-
const r =
|
|
531
|
+
const r = tt[e[1]] ?? i(e[1]);
|
|
549
532
|
if (r) return { "line-height": r };
|
|
550
533
|
}
|
|
551
534
|
if (e = t.match(/^tracking-(.+)$/)) {
|
|
552
|
-
const r =
|
|
535
|
+
const r = et[e[1]] ?? i(e[1]);
|
|
553
536
|
if (r) return { "letter-spacing": r };
|
|
554
537
|
}
|
|
555
|
-
const
|
|
538
|
+
const u = {
|
|
556
539
|
"text-left": "left",
|
|
557
540
|
"text-center": "center",
|
|
558
541
|
"text-right": "right",
|
|
@@ -560,7 +543,7 @@ function Lt(t) {
|
|
|
560
543
|
"text-start": "start",
|
|
561
544
|
"text-end": "end"
|
|
562
545
|
};
|
|
563
|
-
if (
|
|
546
|
+
if (u[t]) return { "text-align": u[t] };
|
|
564
547
|
if (t === "italic") return { "font-style": "italic" };
|
|
565
548
|
if (t === "not-italic") return { "font-style": "normal" };
|
|
566
549
|
if (t === "uppercase") return { "text-transform": "uppercase" };
|
|
@@ -587,13 +570,13 @@ function Lt(t) {
|
|
|
587
570
|
if (t === "font-serif") return { "font-family": "ui-serif,Georgia,serif" };
|
|
588
571
|
if (t === "antialiased") return { "-webkit-font-smoothing": "antialiased", "-moz-osx-font-smoothing": "grayscale" };
|
|
589
572
|
if (e = t.match(/^indent-(.+)$/)) {
|
|
590
|
-
const r =
|
|
573
|
+
const r = l[e[1]] ?? i(e[1]);
|
|
591
574
|
if (r) return { "text-indent": r };
|
|
592
575
|
}
|
|
593
576
|
if (e = t.match(/^line-clamp-(\d+)$/))
|
|
594
577
|
return { overflow: "hidden", display: "-webkit-box", "-webkit-line-clamp": e[1], "-webkit-box-orient": "vertical" };
|
|
595
578
|
if (e = t.match(/^text-(.+)$/)) {
|
|
596
|
-
const [r, n] = e[1].split("/"), p =
|
|
579
|
+
const [r, n] = e[1].split("/"), p = h(r);
|
|
597
580
|
if (![
|
|
598
581
|
"left",
|
|
599
582
|
"center",
|
|
@@ -616,32 +599,32 @@ function Lt(t) {
|
|
|
616
599
|
"9xl"
|
|
617
600
|
].includes(r)) {
|
|
618
601
|
if (n) {
|
|
619
|
-
const
|
|
620
|
-
return { color: p, opacity: String(
|
|
602
|
+
const K = parseInt(n) / 100;
|
|
603
|
+
return { color: p, opacity: String(K) };
|
|
621
604
|
}
|
|
622
605
|
return { color: p };
|
|
623
606
|
}
|
|
624
607
|
}
|
|
625
608
|
if (e = t.match(/^bg-(.+)$/)) {
|
|
626
|
-
const [r, n] = e[1].split("/"), p =
|
|
609
|
+
const [r, n] = e[1].split("/"), p = h(r);
|
|
627
610
|
return n ? { "background-color": p, opacity: String(parseInt(n) / 100) } : r === "none" ? { background: "none" } : { "background-color": p };
|
|
628
611
|
}
|
|
629
612
|
if (e = t.match(/^border-color-(.+)$/))
|
|
630
|
-
return { "border-color":
|
|
613
|
+
return { "border-color": h(e[1]) };
|
|
631
614
|
if (e = t.match(/^fill-(.+)$/))
|
|
632
|
-
return { fill:
|
|
615
|
+
return { fill: h(e[1]) };
|
|
633
616
|
if (e = t.match(/^stroke-(.+)$/))
|
|
634
|
-
return { stroke:
|
|
617
|
+
return { stroke: h(e[1]) };
|
|
635
618
|
if (e = t.match(/^shadow-color-(.+)$/))
|
|
636
|
-
return { "--tkx-shadow-color":
|
|
619
|
+
return { "--tkx-shadow-color": h(e[1]) };
|
|
637
620
|
if (e = t.match(/^ring-color-(.+)$/))
|
|
638
|
-
return { "--tkx-ring-color":
|
|
621
|
+
return { "--tkx-ring-color": h(e[1]) };
|
|
639
622
|
if (e = t.match(/^accent-(.+)$/))
|
|
640
|
-
return { "accent-color":
|
|
623
|
+
return { "accent-color": h(e[1]) };
|
|
641
624
|
if (e = t.match(/^caret-(.+)$/))
|
|
642
|
-
return { "caret-color":
|
|
625
|
+
return { "caret-color": h(e[1]) };
|
|
643
626
|
if (e = t.match(/^outline-color-(.+)$/))
|
|
644
|
-
return { "outline-color":
|
|
627
|
+
return { "outline-color": h(e[1]) };
|
|
645
628
|
if (t === "border") return { "border-width": "1px" };
|
|
646
629
|
if (e = t.match(/^border-(\d+)$/)) return { "border-width": `${e[1]}px` };
|
|
647
630
|
if (t === "border-t") return { "border-top-width": "1px" };
|
|
@@ -659,16 +642,16 @@ function Lt(t) {
|
|
|
659
642
|
if (t === "border-dashed") return { "border-style": "dashed" };
|
|
660
643
|
if (t === "border-dotted") return { "border-style": "dotted" };
|
|
661
644
|
if (t === "border-double") return { "border-style": "double" };
|
|
662
|
-
if ((e = t.match(/^border-([a-zA-Z].*)$/)) &&
|
|
645
|
+
if ((e = t.match(/^border-([a-zA-Z].*)$/)) && Y.has(e[1]))
|
|
663
646
|
return { "border-color": `var(--tkx-${e[1]})` };
|
|
664
647
|
if (e = t.match(/^border-\[(.+)]$/))
|
|
665
648
|
return { "border-color": e[1] };
|
|
666
649
|
if (t === "border-0") return { "border-width": "0" };
|
|
667
|
-
if (t === "rounded") return { "border-radius":
|
|
650
|
+
if (t === "rounded") return { "border-radius": y[""] };
|
|
668
651
|
if (e = t.match(/^rounded-(none|sm|md|lg|xl|2xl|3xl|full|\[.+])$/))
|
|
669
|
-
return { "border-radius":
|
|
652
|
+
return { "border-radius": y[e[1]] ?? i(e[1]) ?? e[1] };
|
|
670
653
|
if (e = t.match(/^rounded-(t|r|b|l|tl|tr|br|bl)(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/)) {
|
|
671
|
-
const r = e[1], n =
|
|
654
|
+
const r = e[1], n = y[e[2] ?? ""] ?? y[""];
|
|
672
655
|
return {
|
|
673
656
|
t: { "border-top-left-radius": n, "border-top-right-radius": n },
|
|
674
657
|
r: { "border-top-right-radius": n, "border-bottom-right-radius": n },
|
|
@@ -687,89 +670,89 @@ function Lt(t) {
|
|
|
687
670
|
if (t === "ring-inset") return { "--tkx-ring-offset": "inset" };
|
|
688
671
|
if (e = t.match(/^ring-offset-(\d+)$/))
|
|
689
672
|
return { "--tkx-ring-offset-width": `${e[1]}px`, "box-shadow": `0 0 0 ${e[1]}px var(--tkx-bg)` };
|
|
690
|
-
if (t === "shadow") return { "box-shadow":
|
|
691
|
-
if (e = t.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/)) return { "box-shadow":
|
|
673
|
+
if (t === "shadow") return { "box-shadow": U[""] };
|
|
674
|
+
if (e = t.match(/^shadow-(sm|md|lg|xl|2xl|inner|none)$/)) return { "box-shadow": U[e[1]] };
|
|
692
675
|
if (e = t.match(/^opacity-(\d+)$/)) {
|
|
693
|
-
const r =
|
|
676
|
+
const r = rt[e[1]];
|
|
694
677
|
if (r !== void 0) return { opacity: r };
|
|
695
678
|
}
|
|
696
679
|
if (t === "bg-none") return { background: "none" };
|
|
697
|
-
const
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
680
|
+
const A = { "bg-auto": "auto", "bg-cover": "cover", "bg-contain": "contain" };
|
|
681
|
+
if (A[t]) return { "background-size": A[t] };
|
|
682
|
+
const C = {
|
|
700
683
|
"bg-center": "center",
|
|
701
684
|
"bg-top": "top",
|
|
702
685
|
"bg-bottom": "bottom",
|
|
703
686
|
"bg-left": "left",
|
|
704
687
|
"bg-right": "right"
|
|
705
688
|
};
|
|
706
|
-
if (
|
|
707
|
-
const
|
|
689
|
+
if (C[t]) return { "background-position": C[t] };
|
|
690
|
+
const W = {
|
|
708
691
|
"bg-repeat": "repeat",
|
|
709
692
|
"bg-no-repeat": "no-repeat",
|
|
710
693
|
"bg-repeat-x": "repeat-x",
|
|
711
694
|
"bg-repeat-y": "repeat-y"
|
|
712
695
|
};
|
|
713
|
-
if (
|
|
714
|
-
if (t === "backdrop-blur") return { "backdrop-filter": `blur(${
|
|
696
|
+
if (W[t]) return { "background-repeat": W[t] };
|
|
697
|
+
if (t === "backdrop-blur") return { "backdrop-filter": `blur(${k[""]})` };
|
|
715
698
|
if (e = t.match(/^backdrop-blur-(none|sm|md|lg|xl|2xl|3xl)$/))
|
|
716
|
-
return { "backdrop-filter": `blur(${
|
|
717
|
-
if (t === "blur") return { filter: `blur(${
|
|
699
|
+
return { "backdrop-filter": `blur(${k[e[1]]})` };
|
|
700
|
+
if (t === "blur") return { filter: `blur(${k[""]})` };
|
|
718
701
|
if (e = t.match(/^blur-(none|sm|md|lg|xl|2xl|3xl)$/))
|
|
719
|
-
return { filter: `blur(${
|
|
702
|
+
return { filter: `blur(${k[e[1]]})` };
|
|
720
703
|
if (t === "grayscale") return { filter: "grayscale(100%)" };
|
|
721
704
|
if (t === "grayscale-0") return { filter: "grayscale(0)" };
|
|
722
705
|
if (t === "invert") return { filter: "invert(100%)" };
|
|
723
706
|
if (t === "invert-0") return { filter: "invert(0)" };
|
|
724
|
-
const
|
|
707
|
+
const E = {
|
|
725
708
|
static: "static",
|
|
726
709
|
relative: "relative",
|
|
727
710
|
absolute: "absolute",
|
|
728
711
|
fixed: "fixed",
|
|
729
712
|
sticky: "sticky"
|
|
730
713
|
};
|
|
731
|
-
if (
|
|
714
|
+
if (E[t]) return { position: E[t] };
|
|
732
715
|
if (t === "inset-0") return { top: "0", right: "0", bottom: "0", left: "0" };
|
|
733
716
|
if (t === "inset-auto") return { top: "auto", right: "auto", bottom: "auto", left: "auto" };
|
|
734
717
|
if (t === "inset-full") return { top: "100%", right: "100%", bottom: "100%", left: "100%" };
|
|
735
718
|
if (t === "inset-x-0") return { left: "0", right: "0" };
|
|
736
719
|
if (t === "inset-y-0") return { top: "0", bottom: "0" };
|
|
737
720
|
if (e = t.match(/^-?top-(.+)$/)) {
|
|
738
|
-
const r = t.startsWith("-"), n =
|
|
721
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
739
722
|
if (n) return { top: r && n !== "0" ? `-${n}` : n };
|
|
740
723
|
}
|
|
741
724
|
if (e = t.match(/^-?right-(.+)$/)) {
|
|
742
|
-
const r = t.startsWith("-"), n =
|
|
725
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
743
726
|
if (n) return { right: r && n !== "0" ? `-${n}` : n };
|
|
744
727
|
}
|
|
745
728
|
if (e = t.match(/^-?bottom-(.+)$/)) {
|
|
746
|
-
const r = t.startsWith("-"), n =
|
|
729
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
747
730
|
if (n) return { bottom: r && n !== "0" ? `-${n}` : n };
|
|
748
731
|
}
|
|
749
732
|
if (e = t.match(/^-?left-(.+)$/)) {
|
|
750
|
-
const r = t.startsWith("-"), n =
|
|
733
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
751
734
|
if (n) return { left: r && n !== "0" ? `-${n}` : n };
|
|
752
735
|
}
|
|
753
|
-
const
|
|
736
|
+
const Z = { 0: "0", 10: "10", 20: "20", 30: "30", 40: "40", 50: "50", 100: "100", 1e3: "1000", 9e3: "9000", auto: "auto" };
|
|
754
737
|
if (e = t.match(/^z-(.+)$/)) {
|
|
755
|
-
const r =
|
|
738
|
+
const r = Z[e[1]] ?? i(e[1]);
|
|
756
739
|
if (r) return { "z-index": r };
|
|
757
740
|
}
|
|
758
|
-
const
|
|
741
|
+
const O = {
|
|
759
742
|
"overflow-auto": "auto",
|
|
760
743
|
"overflow-hidden": "hidden",
|
|
761
744
|
"overflow-visible": "visible",
|
|
762
745
|
"overflow-scroll": "scroll",
|
|
763
746
|
"overflow-clip": "clip"
|
|
764
747
|
};
|
|
765
|
-
if (
|
|
748
|
+
if (O[t]) return { overflow: O[t] };
|
|
766
749
|
if (e = t.match(/^overflow-(x|y)-(auto|hidden|visible|scroll|clip)$/))
|
|
767
750
|
return { [`overflow-${e[1]}`]: e[2] };
|
|
768
751
|
if (t === "scrollbar-hide") return { "-ms-overflow-style": "none", "scrollbar-width": "none" };
|
|
769
752
|
if (t === "visible") return { visibility: "visible" };
|
|
770
753
|
if (t === "invisible") return { visibility: "hidden" };
|
|
771
754
|
if (t === "collapse") return { visibility: "collapse" };
|
|
772
|
-
const
|
|
755
|
+
const R = {
|
|
773
756
|
"cursor-auto": "auto",
|
|
774
757
|
"cursor-default": "default",
|
|
775
758
|
"cursor-pointer": "pointer",
|
|
@@ -785,7 +768,7 @@ function Lt(t) {
|
|
|
785
768
|
"cursor-zoom-out": "zoom-out",
|
|
786
769
|
"cursor-crosshair": "crosshair"
|
|
787
770
|
};
|
|
788
|
-
if (
|
|
771
|
+
if (R[t]) return { cursor: R[t] };
|
|
789
772
|
if (t === "select-none") return { "user-select": "none" };
|
|
790
773
|
if (t === "select-text") return { "user-select": "text" };
|
|
791
774
|
if (t === "select-all") return { "user-select": "all" };
|
|
@@ -794,39 +777,39 @@ function Lt(t) {
|
|
|
794
777
|
if (t === "pointer-events-auto") return { "pointer-events": "auto" };
|
|
795
778
|
const j = { 0: "0", 50: ".5", 75: ".75", 90: ".9", 95: ".95", 100: "1", 105: "1.05", 110: "1.1", 125: "1.25", 150: "1.5" };
|
|
796
779
|
if (e = t.match(/^scale-(.+)$/)) {
|
|
797
|
-
const r = j[e[1]] ??
|
|
780
|
+
const r = j[e[1]] ?? i(e[1]);
|
|
798
781
|
if (r) return { transform: `scale(${r})` };
|
|
799
782
|
}
|
|
800
783
|
if (e = t.match(/^scale-x-(.+)$/)) {
|
|
801
|
-
const r = j[e[1]] ??
|
|
784
|
+
const r = j[e[1]] ?? i(e[1]);
|
|
802
785
|
if (r) return { transform: `scaleX(${r})` };
|
|
803
786
|
}
|
|
804
787
|
if (e = t.match(/^scale-y-(.+)$/)) {
|
|
805
|
-
const r = j[e[1]] ??
|
|
788
|
+
const r = j[e[1]] ?? i(e[1]);
|
|
806
789
|
if (r) return { transform: `scaleY(${r})` };
|
|
807
790
|
}
|
|
808
|
-
const
|
|
791
|
+
const q = { 0: "0deg", 1: "1deg", 2: "2deg", 3: "3deg", 6: "6deg", 12: "12deg", 45: "45deg", 90: "90deg", 180: "180deg" };
|
|
809
792
|
if (e = t.match(/^-?rotate-(.+)$/)) {
|
|
810
|
-
const r = t.startsWith("-"), n =
|
|
793
|
+
const r = t.startsWith("-"), n = q[e[1]] ?? i(e[1]);
|
|
811
794
|
if (n) return { transform: r ? `rotate(-${n})` : `rotate(${n})` };
|
|
812
795
|
}
|
|
813
796
|
if (e = t.match(/^-?translate-x-(.+)$/)) {
|
|
814
|
-
const r = t.startsWith("-"), n =
|
|
797
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
815
798
|
if (n) return { transform: `translateX(${r && n !== "0" ? `-${n}` : n})` };
|
|
816
799
|
}
|
|
817
800
|
if (e = t.match(/^-?translate-y-(.+)$/)) {
|
|
818
|
-
const r = t.startsWith("-"), n =
|
|
801
|
+
const r = t.startsWith("-"), n = l[e[1]] ?? x[e[1]] ?? i(e[1]);
|
|
819
802
|
if (n) return { transform: `translateY(${r && n !== "0" ? `-${n}` : n})` };
|
|
820
803
|
}
|
|
821
804
|
if (e = t.match(/^-?skew-x-(.+)$/)) {
|
|
822
|
-
const r = t.startsWith("-"), n =
|
|
805
|
+
const r = t.startsWith("-"), n = i(e[1]) ?? `${e[1]}deg`;
|
|
823
806
|
return { transform: r ? `skewX(-${n})` : `skewX(${n})` };
|
|
824
807
|
}
|
|
825
808
|
if (e = t.match(/^-?skew-y-(.+)$/)) {
|
|
826
|
-
const r = t.startsWith("-"), n =
|
|
809
|
+
const r = t.startsWith("-"), n = i(e[1]) ?? `${e[1]}deg`;
|
|
827
810
|
return { transform: r ? `skewY(-${n})` : `skewY(${n})` };
|
|
828
811
|
}
|
|
829
|
-
const
|
|
812
|
+
const P = {
|
|
830
813
|
"origin-center": "center",
|
|
831
814
|
"origin-top": "top",
|
|
832
815
|
"origin-top-right": "top right",
|
|
@@ -837,8 +820,8 @@ function Lt(t) {
|
|
|
837
820
|
"origin-left": "left",
|
|
838
821
|
"origin-top-left": "top left"
|
|
839
822
|
};
|
|
840
|
-
if (
|
|
841
|
-
const
|
|
823
|
+
if (P[t]) return { "transform-origin": P[t] };
|
|
824
|
+
const I = {
|
|
842
825
|
transition: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
|
|
843
826
|
"transition-all": "all",
|
|
844
827
|
"transition-colors": "color,background-color,border-color,text-decoration-color,fill,stroke",
|
|
@@ -847,24 +830,24 @@ function Lt(t) {
|
|
|
847
830
|
"transition-transform": "transform",
|
|
848
831
|
"transition-none": "none"
|
|
849
832
|
};
|
|
850
|
-
if (
|
|
851
|
-
const
|
|
833
|
+
if (I[t]) return { "transition-property": I[t], "transition-timing-function": "cubic-bezier(0.4,0,0.2,1)", "transition-duration": "150ms" };
|
|
834
|
+
const T = { 75: "75ms", 100: "100ms", 150: "150ms", 200: "200ms", 300: "300ms", 500: "500ms", 700: "700ms", 1e3: "1000ms" };
|
|
852
835
|
if (e = t.match(/^duration-(.+)$/)) {
|
|
853
|
-
const r =
|
|
836
|
+
const r = T[e[1]] ?? i(e[1]);
|
|
854
837
|
if (r) return { "transition-duration": r };
|
|
855
838
|
}
|
|
856
839
|
if (e = t.match(/^delay-(.+)$/)) {
|
|
857
|
-
const r =
|
|
840
|
+
const r = T[e[1]] ?? i(e[1]);
|
|
858
841
|
if (r) return { "transition-delay": r };
|
|
859
842
|
}
|
|
860
|
-
const
|
|
843
|
+
const N = {
|
|
861
844
|
"ease-linear": "linear",
|
|
862
845
|
"ease-in": "cubic-bezier(0.4,0,1,1)",
|
|
863
846
|
"ease-out": "cubic-bezier(0,0,0.2,1)",
|
|
864
847
|
"ease-in-out": "cubic-bezier(0.4,0,0.2,1)"
|
|
865
848
|
};
|
|
866
|
-
if (
|
|
867
|
-
const
|
|
849
|
+
if (N[t]) return { "transition-timing-function": N[t] };
|
|
850
|
+
const _ = {
|
|
868
851
|
"animate-none": "none",
|
|
869
852
|
"animate-spin": "tkx-spin 1s linear infinite",
|
|
870
853
|
"animate-ping": "tkx-ping 1s cubic-bezier(0,0,0.2,1) infinite",
|
|
@@ -874,15 +857,15 @@ function Lt(t) {
|
|
|
874
857
|
"animate-slide-up": "tkx-slide-up 200ms ease both",
|
|
875
858
|
"animate-shimmer": "tkx-shimmer 1.5s infinite"
|
|
876
859
|
};
|
|
877
|
-
if (
|
|
878
|
-
const
|
|
860
|
+
if (_[t]) return { animation: _[t] };
|
|
861
|
+
const F = {
|
|
879
862
|
"object-contain": "contain",
|
|
880
863
|
"object-cover": "cover",
|
|
881
864
|
"object-fill": "fill",
|
|
882
865
|
"object-none": "none",
|
|
883
866
|
"object-scale-down": "scale-down"
|
|
884
867
|
};
|
|
885
|
-
if (
|
|
868
|
+
if (F[t]) return { "object-fit": F[t] };
|
|
886
869
|
if (t === "aspect-square") return { "aspect-ratio": "1 / 1" };
|
|
887
870
|
if (t === "aspect-video") return { "aspect-ratio": "16 / 9" };
|
|
888
871
|
if (t === "aspect-auto") return { "aspect-ratio": "auto" };
|
|
@@ -943,116 +926,116 @@ function Lt(t) {
|
|
|
943
926
|
if (t === "scroll-auto") return { "scroll-behavior": "auto" };
|
|
944
927
|
if (e = t.match(/^\[(--[a-zA-Z0-9-]+):(.+)]$/))
|
|
945
928
|
return { [e[1]]: e[2] };
|
|
946
|
-
const
|
|
947
|
-
return
|
|
929
|
+
const D = ht(t);
|
|
930
|
+
return D || null;
|
|
948
931
|
}
|
|
949
|
-
function
|
|
950
|
-
let
|
|
951
|
-
for (let
|
|
952
|
-
if (t[
|
|
953
|
-
else if (t[
|
|
954
|
-
else if (t[
|
|
955
|
-
|
|
932
|
+
function ct(t) {
|
|
933
|
+
let o = 0, s = -1;
|
|
934
|
+
for (let a = 0; a < t.length; a++)
|
|
935
|
+
if (t[a] === "[") o++;
|
|
936
|
+
else if (t[a] === "]") o--;
|
|
937
|
+
else if (t[a] === ":" && o === 0) {
|
|
938
|
+
s = a;
|
|
956
939
|
break;
|
|
957
940
|
}
|
|
958
|
-
return
|
|
941
|
+
return s === -1 ? { variant: null, utility: t } : { variant: t.slice(0, s), utility: t.slice(s + 1) };
|
|
959
942
|
}
|
|
960
|
-
function
|
|
961
|
-
for (const [
|
|
962
|
-
t[
|
|
943
|
+
function G(t, o) {
|
|
944
|
+
for (const [s, a] of Object.entries(o))
|
|
945
|
+
t[s] = a;
|
|
963
946
|
}
|
|
964
|
-
function
|
|
965
|
-
return Object.entries(t).map(([
|
|
947
|
+
function M(t) {
|
|
948
|
+
return Object.entries(t).map(([o, s]) => `${o}:${s}`).join(";");
|
|
966
949
|
}
|
|
967
|
-
const
|
|
968
|
-
let
|
|
969
|
-
function
|
|
970
|
-
return (!
|
|
950
|
+
const S = /* @__PURE__ */ new Map();
|
|
951
|
+
let g = null, v = null;
|
|
952
|
+
function L() {
|
|
953
|
+
return (!g || !g.isConnected) && (g = document.getElementById("tkx-atomic"), g || (g = document.createElement("style"), g.id = "tkx-atomic", document.head.appendChild(g))), g;
|
|
971
954
|
}
|
|
972
|
-
function
|
|
973
|
-
if (
|
|
955
|
+
function ft() {
|
|
956
|
+
if (v) return v;
|
|
974
957
|
try {
|
|
975
958
|
const t = new CSSStyleSheet();
|
|
976
|
-
return document.adoptedStyleSheets = [...document.adoptedStyleSheets, t],
|
|
959
|
+
return document.adoptedStyleSheets = [...document.adoptedStyleSheets, t], v = t, t;
|
|
977
960
|
} catch {
|
|
978
961
|
return null;
|
|
979
962
|
}
|
|
980
963
|
}
|
|
981
|
-
function
|
|
982
|
-
if (
|
|
983
|
-
const
|
|
984
|
-
if (
|
|
985
|
-
const
|
|
986
|
-
for (const
|
|
964
|
+
function dt(t, o) {
|
|
965
|
+
if (S.has(t) || (S.set(t, o), typeof document > "u")) return;
|
|
966
|
+
const s = ft();
|
|
967
|
+
if (s) {
|
|
968
|
+
const a = pt(o);
|
|
969
|
+
for (const f of a)
|
|
987
970
|
try {
|
|
988
|
-
|
|
971
|
+
s.insertRule(f, s.cssRules.length);
|
|
989
972
|
} catch {
|
|
990
|
-
|
|
973
|
+
L().textContent += f + `
|
|
991
974
|
`;
|
|
992
975
|
}
|
|
993
976
|
} else
|
|
994
|
-
|
|
977
|
+
L().textContent += o + `
|
|
995
978
|
`;
|
|
996
979
|
}
|
|
997
|
-
function
|
|
998
|
-
const
|
|
999
|
-
let
|
|
1000
|
-
for (let
|
|
1001
|
-
if (t[
|
|
1002
|
-
else if (t[
|
|
1003
|
-
const
|
|
1004
|
-
|
|
980
|
+
function pt(t) {
|
|
981
|
+
const o = [];
|
|
982
|
+
let s = 0, a = 0;
|
|
983
|
+
for (let f = 0; f < t.length; f++)
|
|
984
|
+
if (t[f] === "{") s++;
|
|
985
|
+
else if (t[f] === "}" && (s--, s === 0)) {
|
|
986
|
+
const b = t.slice(a, f + 1).trim();
|
|
987
|
+
b && o.push(b), a = f + 1;
|
|
1005
988
|
}
|
|
1006
|
-
return
|
|
989
|
+
return o;
|
|
1007
990
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const
|
|
1010
|
-
for (const
|
|
1011
|
-
if (
|
|
1012
|
-
if (typeof
|
|
1013
|
-
|
|
1014
|
-
else if (Array.isArray(
|
|
1015
|
-
|
|
1016
|
-
else if (typeof
|
|
1017
|
-
for (const [
|
|
1018
|
-
|
|
991
|
+
function X(t) {
|
|
992
|
+
const o = [];
|
|
993
|
+
for (const s of t)
|
|
994
|
+
if (s) {
|
|
995
|
+
if (typeof s == "string")
|
|
996
|
+
o.push(...s.split(/\s+/).filter(Boolean));
|
|
997
|
+
else if (Array.isArray(s))
|
|
998
|
+
o.push(...X(s));
|
|
999
|
+
else if (typeof s == "object")
|
|
1000
|
+
for (const [a, f] of Object.entries(s))
|
|
1001
|
+
f && o.push(a);
|
|
1019
1002
|
}
|
|
1020
|
-
return
|
|
1003
|
+
return o;
|
|
1021
1004
|
}
|
|
1022
|
-
function
|
|
1023
|
-
const
|
|
1024
|
-
if (
|
|
1025
|
-
const
|
|
1026
|
-
for (const
|
|
1027
|
-
const { variant: m, utility: e } =
|
|
1028
|
-
|
|
1005
|
+
function mt(...t) {
|
|
1006
|
+
const o = X(t);
|
|
1007
|
+
if (o.length === 0) return "";
|
|
1008
|
+
const s = { base: {}, variants: {} };
|
|
1009
|
+
for (const c of o) {
|
|
1010
|
+
const { variant: m, utility: e } = ct(c), u = lt(e);
|
|
1011
|
+
u && (m ? (s.variants[m] || (s.variants[m] = {}), G(s.variants[m], u)) : G(s.base, u));
|
|
1029
1012
|
}
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
for (const [
|
|
1033
|
-
const e =
|
|
1013
|
+
const a = [], f = M(s.base), b = [f, ...Object.entries(s.variants).map(([c, m]) => `${c}{${M(m)}}`)].join("|"), $ = V(b), d = `tkx-${$}`;
|
|
1014
|
+
f && a.push(`.${d}{${f}}`);
|
|
1015
|
+
for (const [c, m] of Object.entries(s.variants)) {
|
|
1016
|
+
const e = M(m);
|
|
1034
1017
|
if (e)
|
|
1035
|
-
if (
|
|
1036
|
-
const
|
|
1037
|
-
w &&
|
|
1038
|
-
} else if (
|
|
1039
|
-
|
|
1040
|
-
else if (
|
|
1041
|
-
|
|
1042
|
-
else if (
|
|
1043
|
-
|
|
1044
|
-
else if (
|
|
1045
|
-
|
|
1046
|
-
else if (
|
|
1047
|
-
|
|
1048
|
-
else if (
|
|
1049
|
-
|
|
1050
|
-
else if (
|
|
1051
|
-
|
|
1052
|
-
else if (
|
|
1053
|
-
|
|
1054
|
-
else if (
|
|
1055
|
-
|
|
1018
|
+
if (c.startsWith("@")) {
|
|
1019
|
+
const u = c.slice(1), w = nt[u];
|
|
1020
|
+
w && a.push(`@media(min-width:${w}){.${d}{${e}}}`);
|
|
1021
|
+
} else if (c === "motion-safe")
|
|
1022
|
+
a.push(`@media(prefers-reduced-motion:no-preference){.${d}{${e}}}`);
|
|
1023
|
+
else if (c === "motion-reduce")
|
|
1024
|
+
a.push(`@media(prefers-reduced-motion:reduce){.${d}{${e}}}`);
|
|
1025
|
+
else if (c === "contrast-more")
|
|
1026
|
+
a.push(`@media(prefers-contrast:more){.${d}{${e}}}`);
|
|
1027
|
+
else if (c === "forced-colors")
|
|
1028
|
+
a.push(`@media(forced-colors:active){.${d}{${e}}}`);
|
|
1029
|
+
else if (c === "dark")
|
|
1030
|
+
a.push(`@media(prefers-color-scheme:dark){.${d}{${e}}}`);
|
|
1031
|
+
else if (c === "print")
|
|
1032
|
+
a.push(`@media print{.${d}{${e}}}`);
|
|
1033
|
+
else if (c === "group-hover")
|
|
1034
|
+
a.push(`.group:hover .${d}{${e}}`);
|
|
1035
|
+
else if (c === "group-focus")
|
|
1036
|
+
a.push(`.group:focus-within .${d}{${e}}`);
|
|
1037
|
+
else if (c === "peer-hover")
|
|
1038
|
+
a.push(`.peer:hover~.${d}{${e}}`);
|
|
1056
1039
|
else {
|
|
1057
1040
|
const w = {
|
|
1058
1041
|
hover: ":hover",
|
|
@@ -1084,378 +1067,46 @@ function M(...t) {
|
|
|
1084
1067
|
selection: "::selection",
|
|
1085
1068
|
"file-selector": "::file-selector-button",
|
|
1086
1069
|
marker: "::marker"
|
|
1087
|
-
}[
|
|
1088
|
-
|
|
1070
|
+
}[c] ?? `:${c}`;
|
|
1071
|
+
a.push(`.${d}${w}{${e}}`);
|
|
1089
1072
|
}
|
|
1090
1073
|
}
|
|
1091
|
-
return
|
|
1074
|
+
return a.length > 0 && dt($, a.join("")), d;
|
|
1092
1075
|
}
|
|
1093
|
-
const
|
|
1094
|
-
function
|
|
1095
|
-
return Array.from(
|
|
1076
|
+
const xt = mt;
|
|
1077
|
+
function gt() {
|
|
1078
|
+
return Array.from(S.values()).join(`
|
|
1096
1079
|
`);
|
|
1097
1080
|
}
|
|
1098
|
-
function
|
|
1099
|
-
|
|
1081
|
+
function bt() {
|
|
1082
|
+
S.clear(), g = null, v && typeof document < "u" && (document.adoptedStyleSheets = document.adoptedStyleSheets.filter((t) => t !== v), v = null);
|
|
1100
1083
|
}
|
|
1101
|
-
function
|
|
1084
|
+
function wt(...t) {
|
|
1102
1085
|
return t.filter(Boolean).join(" ");
|
|
1103
1086
|
}
|
|
1104
|
-
const
|
|
1105
|
-
function
|
|
1106
|
-
|
|
1087
|
+
const z = /* @__PURE__ */ new Map();
|
|
1088
|
+
function vt(t) {
|
|
1089
|
+
z.set(t.name, t.utilities);
|
|
1107
1090
|
}
|
|
1108
|
-
function
|
|
1109
|
-
|
|
1091
|
+
function $t(t) {
|
|
1092
|
+
z.delete(t);
|
|
1110
1093
|
}
|
|
1111
|
-
function
|
|
1112
|
-
return Array.from(
|
|
1094
|
+
function yt() {
|
|
1095
|
+
return Array.from(z.keys());
|
|
1113
1096
|
}
|
|
1114
|
-
function
|
|
1115
|
-
for (const
|
|
1116
|
-
if (
|
|
1117
|
-
return null;
|
|
1118
|
-
}
|
|
1119
|
-
const it = yt(null);
|
|
1120
|
-
function Ut() {
|
|
1121
|
-
const t = dt(it);
|
|
1122
|
-
if (!t)
|
|
1123
|
-
throw new Error("TkxFormField must be used inside a <TkxForm>. Wrap your fields in a TkxForm component.");
|
|
1124
|
-
return t;
|
|
1125
|
-
}
|
|
1126
|
-
async function lt(t, i) {
|
|
1127
|
-
for (const o of i) {
|
|
1128
|
-
if (o.required && (t == null || t === "" || Array.isArray(t) && t.length === 0))
|
|
1129
|
-
return o.message ?? "This field is required";
|
|
1130
|
-
if (!(t == null || t === "")) {
|
|
1131
|
-
if (o.min !== void 0) {
|
|
1132
|
-
if (typeof t == "string" && t.length < o.min)
|
|
1133
|
-
return o.message ?? `Must be at least ${o.min} characters`;
|
|
1134
|
-
if (typeof t == "number" && t < o.min)
|
|
1135
|
-
return o.message ?? `Must be at least ${o.min}`;
|
|
1136
|
-
}
|
|
1137
|
-
if (o.max !== void 0) {
|
|
1138
|
-
if (typeof t == "string" && t.length > o.max)
|
|
1139
|
-
return o.message ?? `Must be no more than ${o.max} characters`;
|
|
1140
|
-
if (typeof t == "number" && t > o.max)
|
|
1141
|
-
return o.message ?? `Must be no more than ${o.max}`;
|
|
1142
|
-
}
|
|
1143
|
-
if (o.pattern && typeof t == "string" && !o.pattern.test(t))
|
|
1144
|
-
return o.message ?? "Invalid format";
|
|
1145
|
-
if (o.validator) {
|
|
1146
|
-
const s = await o.validator(t);
|
|
1147
|
-
if (s)
|
|
1148
|
-
return s;
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1097
|
+
function ht(t) {
|
|
1098
|
+
for (const o of z.values())
|
|
1099
|
+
if (o[t]) return o[t];
|
|
1152
1100
|
return null;
|
|
1153
1101
|
}
|
|
1154
|
-
function Kt(t, i) {
|
|
1155
|
-
const o = t ? [...t] : [];
|
|
1156
|
-
return i && !o.some((s) => s.required) && o.unshift({ required: !0, message: "This field is required" }), o;
|
|
1157
|
-
}
|
|
1158
|
-
function Xt(t) {
|
|
1159
|
-
return t.some((i) => i.required);
|
|
1160
|
-
}
|
|
1161
|
-
function he() {
|
|
1162
|
-
const t = dt(it), i = S({}), o = S({}), s = S({}), a = X(() => ({
|
|
1163
|
-
getFieldValue: (l) => i.current[l],
|
|
1164
|
-
setFieldValue: (l, g) => {
|
|
1165
|
-
i.current[l] = g;
|
|
1166
|
-
},
|
|
1167
|
-
getFieldsValue: () => ({ ...i.current }),
|
|
1168
|
-
setFieldsValue: (l) => {
|
|
1169
|
-
Object.assign(i.current, l);
|
|
1170
|
-
},
|
|
1171
|
-
validateFields: () => Promise.resolve({ ...i.current }),
|
|
1172
|
-
validateField: (l) => Promise.resolve(!0),
|
|
1173
|
-
resetFields: () => {
|
|
1174
|
-
i.current = {}, o.current = {}, s.current = {};
|
|
1175
|
-
},
|
|
1176
|
-
getFieldError: (l) => o.current[l] ?? null,
|
|
1177
|
-
isFieldTouched: (l) => s.current[l] ?? !1
|
|
1178
|
-
}), []);
|
|
1179
|
-
return t ? t.instance : a;
|
|
1180
|
-
}
|
|
1181
|
-
function Zt({
|
|
1182
|
-
onSubmit: t,
|
|
1183
|
-
onValuesChange: i,
|
|
1184
|
-
initialValues: o = {},
|
|
1185
|
-
layout: s = "vertical",
|
|
1186
|
-
disabled: a = !1,
|
|
1187
|
-
children: l,
|
|
1188
|
-
className: g,
|
|
1189
|
-
style: h,
|
|
1190
|
-
form: u
|
|
1191
|
-
}) {
|
|
1192
|
-
const m = ut(), [e, x] = nt({
|
|
1193
|
-
values: { ...o },
|
|
1194
|
-
errors: {},
|
|
1195
|
-
touched: {}
|
|
1196
|
-
}), w = S(o), b = S({}), v = S(e);
|
|
1197
|
-
v.current = e;
|
|
1198
|
-
const E = k((f, r) => {
|
|
1199
|
-
b.current[f] = r;
|
|
1200
|
-
}, []), I = k((f) => {
|
|
1201
|
-
delete b.current[f];
|
|
1202
|
-
}, []), W = k((f, r) => {
|
|
1203
|
-
x((n) => {
|
|
1204
|
-
const p = {
|
|
1205
|
-
...n,
|
|
1206
|
-
values: { ...n.values, [f]: r }
|
|
1207
|
-
};
|
|
1208
|
-
return i == null || i({ [f]: r }, p.values), p;
|
|
1209
|
-
});
|
|
1210
|
-
}, [i]), H = k((f, r) => {
|
|
1211
|
-
x((n) => ({
|
|
1212
|
-
...n,
|
|
1213
|
-
errors: { ...n.errors, [f]: r }
|
|
1214
|
-
}));
|
|
1215
|
-
}, []), F = k((f) => {
|
|
1216
|
-
x((r) => ({
|
|
1217
|
-
...r,
|
|
1218
|
-
touched: { ...r.touched, [f]: !0 }
|
|
1219
|
-
}));
|
|
1220
|
-
}, []), j = k(async (f) => {
|
|
1221
|
-
const r = b.current[f];
|
|
1222
|
-
if (!r) return !0;
|
|
1223
|
-
const n = v.current.values[f], p = await lt(n, r.rules);
|
|
1224
|
-
return x((y) => ({
|
|
1225
|
-
...y,
|
|
1226
|
-
errors: { ...y.errors, [f]: p },
|
|
1227
|
-
touched: { ...y.touched, [f]: !0 }
|
|
1228
|
-
})), p === null;
|
|
1229
|
-
}, []), R = k(async () => {
|
|
1230
|
-
const f = Object.keys(b.current), r = await Promise.all(
|
|
1231
|
-
f.map(async ($) => {
|
|
1232
|
-
const T = b.current[$], bt = v.current.values[$], vt = await lt(bt, T.rules);
|
|
1233
|
-
return { name: $, error: vt };
|
|
1234
|
-
})
|
|
1235
|
-
), n = {}, p = {};
|
|
1236
|
-
let y = !1;
|
|
1237
|
-
for (const { name: $, error: T } of r)
|
|
1238
|
-
n[$] = T, p[$] = !0, T && (y = !0);
|
|
1239
|
-
if (x(($) => ({
|
|
1240
|
-
...$,
|
|
1241
|
-
errors: { ...$.errors, ...n },
|
|
1242
|
-
touched: { ...$.touched, ...p }
|
|
1243
|
-
})), y) {
|
|
1244
|
-
const $ = Object.fromEntries(
|
|
1245
|
-
r.filter((T) => T.error).map((T) => [T.name, T.error])
|
|
1246
|
-
);
|
|
1247
|
-
return Promise.reject($);
|
|
1248
|
-
}
|
|
1249
|
-
return { ...v.current.values };
|
|
1250
|
-
}, []), O = k(() => {
|
|
1251
|
-
x({
|
|
1252
|
-
values: { ...w.current },
|
|
1253
|
-
errors: {},
|
|
1254
|
-
touched: {}
|
|
1255
|
-
});
|
|
1256
|
-
}, []), B = X(() => ({
|
|
1257
|
-
getFieldValue: (f) => v.current.values[f],
|
|
1258
|
-
setFieldValue: W,
|
|
1259
|
-
getFieldsValue: () => ({ ...v.current.values }),
|
|
1260
|
-
setFieldsValue: (f) => {
|
|
1261
|
-
x((r) => {
|
|
1262
|
-
const n = { ...r.values, ...f };
|
|
1263
|
-
return i == null || i(f, n), { ...r, values: n };
|
|
1264
|
-
});
|
|
1265
|
-
},
|
|
1266
|
-
validateFields: R,
|
|
1267
|
-
validateField: j,
|
|
1268
|
-
resetFields: O,
|
|
1269
|
-
getFieldError: (f) => v.current.errors[f] ?? null,
|
|
1270
|
-
isFieldTouched: (f) => !!v.current.touched[f]
|
|
1271
|
-
}), [W, R, j, O, i]), N = k(async (f) => {
|
|
1272
|
-
f.preventDefault();
|
|
1273
|
-
try {
|
|
1274
|
-
const r = await R();
|
|
1275
|
-
await (t == null ? void 0 : t(r));
|
|
1276
|
-
} catch {
|
|
1277
|
-
}
|
|
1278
|
-
}, [R, t]), q = M(s === "inline" ? "flex flex-row flex-wrap items-end gap-4" : "flex flex-col gap-5"), P = u ?? B, Y = X(() => ({
|
|
1279
|
-
state: e,
|
|
1280
|
-
initialValues: w.current,
|
|
1281
|
-
layout: s,
|
|
1282
|
-
disabled: a,
|
|
1283
|
-
fieldMeta: b,
|
|
1284
|
-
setFieldValue: W,
|
|
1285
|
-
setFieldError: H,
|
|
1286
|
-
setFieldTouched: F,
|
|
1287
|
-
registerField: E,
|
|
1288
|
-
unregisterField: I,
|
|
1289
|
-
validateField: j,
|
|
1290
|
-
instance: P
|
|
1291
|
-
}), [e, s, a, W, H, F, E, I, j, P]);
|
|
1292
|
-
return /* @__PURE__ */ _(it.Provider, { value: Y, children: /* @__PURE__ */ _(
|
|
1293
|
-
"form",
|
|
1294
|
-
{
|
|
1295
|
-
noValidate: !0,
|
|
1296
|
-
role: "form",
|
|
1297
|
-
"aria-label": "Form",
|
|
1298
|
-
onSubmit: N,
|
|
1299
|
-
className: V(q, g),
|
|
1300
|
-
style: {
|
|
1301
|
-
color: m.text,
|
|
1302
|
-
...h
|
|
1303
|
-
},
|
|
1304
|
-
children: l
|
|
1305
|
-
}
|
|
1306
|
-
) });
|
|
1307
|
-
}
|
|
1308
|
-
Zt.displayName = "TkxForm";
|
|
1309
|
-
function Jt({
|
|
1310
|
-
name: t,
|
|
1311
|
-
label: i,
|
|
1312
|
-
rules: o,
|
|
1313
|
-
help: s,
|
|
1314
|
-
required: a,
|
|
1315
|
-
children: l,
|
|
1316
|
-
className: g,
|
|
1317
|
-
style: h
|
|
1318
|
-
}) {
|
|
1319
|
-
const u = ut(), m = Ut(), { state: e, layout: x, disabled: w } = m, b = X(() => Kt(o, a), [o, a]), v = Xt(b), E = S({ rules: b });
|
|
1320
|
-
E.current.rules = b;
|
|
1321
|
-
const I = S(!1);
|
|
1322
|
-
I.current || (m.registerField(t, E.current), I.current = !0), X(() => {
|
|
1323
|
-
m.registerField(t, E.current);
|
|
1324
|
-
}, [b, t, m]);
|
|
1325
|
-
const W = e.values[t], H = e.touched[t] ? e.errors[t] ?? null : null, F = H ? K(H) : null, j = i ? K(i) : void 0, R = s ? K(s) : void 0, O = k(
|
|
1326
|
-
(n) => {
|
|
1327
|
-
let p;
|
|
1328
|
-
if (n !== null && typeof n == "object" && "target" in n) {
|
|
1329
|
-
const y = n.target;
|
|
1330
|
-
p = y.type === "checkbox" ? y.checked : y.value;
|
|
1331
|
-
} else
|
|
1332
|
-
p = n;
|
|
1333
|
-
m.setFieldValue(t, p);
|
|
1334
|
-
},
|
|
1335
|
-
[m, t]
|
|
1336
|
-
), B = k(() => {
|
|
1337
|
-
m.setFieldTouched(t), m.validateField(t);
|
|
1338
|
-
}, [m, t]), N = wt(l, {
|
|
1339
|
-
value: W ?? "",
|
|
1340
|
-
onChange: O,
|
|
1341
|
-
onBlur: B,
|
|
1342
|
-
error: F ?? void 0,
|
|
1343
|
-
isInvalid: !!F,
|
|
1344
|
-
isRequired: v,
|
|
1345
|
-
disabled: w || l.props.disabled,
|
|
1346
|
-
name: t
|
|
1347
|
-
}), q = x === "horizontal", P = x === "inline", Y = /* @__PURE__ */ _("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ _("path", { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) }), f = j ? /* @__PURE__ */ L(
|
|
1348
|
-
"label",
|
|
1349
|
-
{
|
|
1350
|
-
className: M(
|
|
1351
|
-
"text-sm font-medium font-sans",
|
|
1352
|
-
q ? "min-w-[140px] pt-2.5" : ""
|
|
1353
|
-
),
|
|
1354
|
-
style: { color: u.text },
|
|
1355
|
-
children: [
|
|
1356
|
-
j,
|
|
1357
|
-
v && /* @__PURE__ */ _("span", { "aria-hidden": "true", className: M("ml-1"), style: { color: u.danger }, children: "*" })
|
|
1358
|
-
]
|
|
1359
|
-
}
|
|
1360
|
-
) : null, r = /* @__PURE__ */ L(jt, { children: [
|
|
1361
|
-
R && !F && /* @__PURE__ */ _("span", { className: M("text-xs mt-0.5"), style: { color: u.textMuted }, children: R }),
|
|
1362
|
-
F && /* @__PURE__ */ L(
|
|
1363
|
-
"span",
|
|
1364
|
-
{
|
|
1365
|
-
role: "alert",
|
|
1366
|
-
className: M("text-xs flex items-center gap-1 mt-0.5"),
|
|
1367
|
-
style: {
|
|
1368
|
-
color: u.danger,
|
|
1369
|
-
animation: "tkxFormErrorReveal 200ms ease-out"
|
|
1370
|
-
},
|
|
1371
|
-
children: [
|
|
1372
|
-
Y,
|
|
1373
|
-
F
|
|
1374
|
-
]
|
|
1375
|
-
}
|
|
1376
|
-
)
|
|
1377
|
-
] });
|
|
1378
|
-
return P ? /* @__PURE__ */ L(
|
|
1379
|
-
"div",
|
|
1380
|
-
{
|
|
1381
|
-
className: V(M("flex flex-col gap-1"), g),
|
|
1382
|
-
style: h,
|
|
1383
|
-
children: [
|
|
1384
|
-
f,
|
|
1385
|
-
N,
|
|
1386
|
-
r
|
|
1387
|
-
]
|
|
1388
|
-
}
|
|
1389
|
-
) : q ? /* @__PURE__ */ L(
|
|
1390
|
-
"div",
|
|
1391
|
-
{
|
|
1392
|
-
className: V(M("flex flex-row gap-4 items-start"), g),
|
|
1393
|
-
style: h,
|
|
1394
|
-
children: [
|
|
1395
|
-
f,
|
|
1396
|
-
/* @__PURE__ */ L("div", { className: M("flex flex-col gap-1 flex-1 min-w-0"), children: [
|
|
1397
|
-
N,
|
|
1398
|
-
r
|
|
1399
|
-
] })
|
|
1400
|
-
]
|
|
1401
|
-
}
|
|
1402
|
-
) : /* @__PURE__ */ L(
|
|
1403
|
-
"div",
|
|
1404
|
-
{
|
|
1405
|
-
className: V(M("flex flex-col gap-1"), g),
|
|
1406
|
-
style: h,
|
|
1407
|
-
children: [
|
|
1408
|
-
f,
|
|
1409
|
-
N,
|
|
1410
|
-
r
|
|
1411
|
-
]
|
|
1412
|
-
}
|
|
1413
|
-
);
|
|
1414
|
-
}
|
|
1415
|
-
Jt.displayName = "TkxFormField";
|
|
1416
|
-
let ft = !1;
|
|
1417
|
-
function Vt() {
|
|
1418
|
-
if (ft || typeof document > "u") return;
|
|
1419
|
-
ft = !0;
|
|
1420
|
-
const t = document.createElement("style");
|
|
1421
|
-
t.setAttribute("data-tkx-form", ""), t.textContent = `
|
|
1422
|
-
@keyframes tkxFormErrorReveal {
|
|
1423
|
-
from {
|
|
1424
|
-
opacity: 0;
|
|
1425
|
-
transform: translateY(-4px);
|
|
1426
|
-
}
|
|
1427
|
-
to {
|
|
1428
|
-
opacity: 1;
|
|
1429
|
-
transform: translateY(0);
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
`, document.head.appendChild(t);
|
|
1433
|
-
}
|
|
1434
|
-
Vt();
|
|
1435
1102
|
export {
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
fe as h,
|
|
1446
|
-
Ct as i,
|
|
1447
|
-
Gt as j,
|
|
1448
|
-
pt as k,
|
|
1449
|
-
me as l,
|
|
1450
|
-
ue as m,
|
|
1451
|
-
pe as n,
|
|
1452
|
-
le as o,
|
|
1453
|
-
ie as p,
|
|
1454
|
-
he as q,
|
|
1455
|
-
de as r,
|
|
1456
|
-
K as s,
|
|
1457
|
-
M as t,
|
|
1458
|
-
ne as u,
|
|
1459
|
-
Et as v,
|
|
1460
|
-
It as w
|
|
1103
|
+
ht as a,
|
|
1104
|
+
yt as b,
|
|
1105
|
+
wt as c,
|
|
1106
|
+
vt as d,
|
|
1107
|
+
gt as e,
|
|
1108
|
+
$t as f,
|
|
1109
|
+
xt as g,
|
|
1110
|
+
bt as r,
|
|
1111
|
+
mt as t
|
|
1461
1112
|
};
|