fiboui 2.0.0 → 2.2.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.
@@ -1,1842 +0,0 @@
1
- "use client";
2
- var it = Object.defineProperty;
3
- var nt = (o, t, e) => t in o ? it(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
4
- var a = (o, t, e) => nt(o, typeof t != "symbol" ? t + "" : t, e);
5
- import k, { useRef as N, createContext as V, useContext as D, useCallback as C, useSyncExternalStore as A, useEffect as Y, useState as O, memo as ct, cloneElement as H } from "react";
6
- import { jsx as w, Fragment as T } from "react/jsx-runtime";
7
- class U {
8
- constructor() {
9
- a(this, "activeEffect", null);
10
- }
11
- }
12
- const q = new U(), v = [q];
13
- function Z() {
14
- return new U();
15
- }
16
- function K() {
17
- return v[v.length - 1] ?? q;
18
- }
19
- function W() {
20
- return K().activeEffect;
21
- }
22
- function lt(o, t) {
23
- v.push(o);
24
- try {
25
- return t();
26
- } finally {
27
- v.pop();
28
- }
29
- }
30
- function E(o) {
31
- const t = K(), e = t.activeEffect;
32
- return t.activeEffect = o, e;
33
- }
34
- class at {
35
- constructor(t) {
36
- a(this, "dependencies", /* @__PURE__ */ new Set());
37
- a(this, "_onDispose");
38
- this.fn = t, this.run();
39
- }
40
- run() {
41
- const t = E(this);
42
- try {
43
- this.cleanup(), this.fn();
44
- } finally {
45
- E(t);
46
- }
47
- }
48
- track(t) {
49
- this.dependencies.add(t), t.subscribeEffect(this);
50
- }
51
- trigger() {
52
- this.run();
53
- }
54
- cleanup() {
55
- this.dependencies.forEach((t) => t.unsubscribeEffect(this)), this.dependencies.clear();
56
- }
57
- dispose() {
58
- var t;
59
- this.cleanup(), (t = this._onDispose) == null || t.call(this);
60
- }
61
- }
62
- class ht {
63
- constructor(t) {
64
- a(this, "dependencies", /* @__PURE__ */ new Set());
65
- this._onInvalidate = t;
66
- }
67
- execute(t) {
68
- const e = E(this);
69
- try {
70
- return this.cleanup(), t();
71
- } finally {
72
- E(e);
73
- }
74
- }
75
- track(t) {
76
- this.dependencies.add(t), t.subscribeEffect(this);
77
- }
78
- trigger() {
79
- this._onInvalidate();
80
- }
81
- cleanup() {
82
- this.dependencies.forEach((t) => t.unsubscribeEffect(this)), this.dependencies.clear();
83
- }
84
- dispose() {
85
- this.cleanup();
86
- }
87
- }
88
- class R {
89
- constructor(t) {
90
- a(this, "listeners", /* @__PURE__ */ new Set());
91
- a(this, "effects", /* @__PURE__ */ new Set());
92
- this._value = t;
93
- }
94
- get value() {
95
- const t = W();
96
- return t && t.track(this), this._value;
97
- }
98
- set value(t) {
99
- this._value !== t && (this._value = t, this.notify());
100
- }
101
- subscribe(t) {
102
- return this.listeners.add(t), () => this.listeners.delete(t);
103
- }
104
- subscribeEffect(t) {
105
- this.effects.add(t);
106
- }
107
- unsubscribeEffect(t) {
108
- this.effects.delete(t);
109
- }
110
- notify() {
111
- const t = Array.from(this.effects), e = Array.from(this.listeners);
112
- t.forEach((s) => s.trigger()), e.forEach((s) => s(this._value));
113
- }
114
- }
115
- function Ot(o) {
116
- return new R(o);
117
- }
118
- class ut {
119
- constructor(t) {
120
- a(this, "listeners", /* @__PURE__ */ new Set());
121
- a(this, "effects", /* @__PURE__ */ new Set());
122
- a(this, "_value");
123
- a(this, "_dirty", !0);
124
- a(this, "internalEffect");
125
- this.fn = t, this.internalEffect = new at(() => {
126
- this._dirty || (this._dirty = !0, this.notify());
127
- });
128
- }
129
- get value() {
130
- const t = W();
131
- if (t && t.track(this), this._dirty) {
132
- const e = E(this.internalEffect);
133
- try {
134
- this.internalEffect.cleanup(), this._value = this.fn(), this._dirty = !1;
135
- } finally {
136
- E(e);
137
- }
138
- }
139
- return this._value;
140
- }
141
- subscribe(t) {
142
- return this.listeners.add(t), () => this.listeners.delete(t);
143
- }
144
- subscribeEffect(t) {
145
- this.effects.add(t);
146
- }
147
- unsubscribeEffect(t) {
148
- this.effects.delete(t);
149
- }
150
- notify() {
151
- const t = Array.from(this.effects), e = Array.from(this.listeners);
152
- t.forEach((s) => s.trigger()), e.forEach((s) => s(this._value));
153
- }
154
- }
155
- function Ht(o) {
156
- return new ut(o);
157
- }
158
- class dt {
159
- constructor(t) {
160
- a(this, "listeners", /* @__PURE__ */ new Set());
161
- a(this, "effects", /* @__PURE__ */ new Set());
162
- this._value = t;
163
- }
164
- get() {
165
- const t = W();
166
- return t && t.track(this), this._value;
167
- }
168
- set(t) {
169
- this._value !== t && (this._value = t, this.notify());
170
- }
171
- subscribe(t) {
172
- return this.listeners.add(t), () => this.listeners.delete(t);
173
- }
174
- subscribeEffect(t) {
175
- this.effects.add(t);
176
- }
177
- unsubscribeEffect(t) {
178
- this.effects.delete(t);
179
- }
180
- notify() {
181
- Array.from(this.effects).forEach((t) => t.trigger()), Array.from(this.listeners).forEach((t) => t(this._value));
182
- }
183
- }
184
- function Ut(o) {
185
- return new dt(o);
186
- }
187
- class ft {
188
- constructor(t) {
189
- a(this, "listeners", /* @__PURE__ */ new Set());
190
- a(this, "effects", /* @__PURE__ */ new Set());
191
- this.state = t;
192
- }
193
- getState() {
194
- const t = W();
195
- return t && t.track(this), this.state;
196
- }
197
- setState(t) {
198
- const e = typeof t == "function" ? t(this.state) : t, s = { ...this.state, ...e }, r = Object.keys(this.state), i = Object.keys(s);
199
- r.length === i.length && i.every((n) => Object.is(s[n], this.state[n])) || (this.state = s, this.notify());
200
- }
201
- subscribe(t) {
202
- return this.listeners.add(t), () => this.listeners.delete(t);
203
- }
204
- subscribeEffect(t) {
205
- this.effects.add(t);
206
- }
207
- unsubscribeEffect(t) {
208
- this.effects.delete(t);
209
- }
210
- notify() {
211
- Array.from(this.effects).forEach((t) => t.trigger()), Array.from(this.listeners).forEach((t) => t(this.state));
212
- }
213
- }
214
- function qt(o) {
215
- return new ft(o);
216
- }
217
- const pt = Z(), J = V(pt);
218
- function mt() {
219
- return D(J);
220
- }
221
- function Zt({ children: o, scope: t }) {
222
- const e = N(t ?? Z()).current;
223
- return /* @__PURE__ */ w(J.Provider, { value: e, children: o });
224
- }
225
- function gt({ children: o }) {
226
- const t = N(0), e = N(/* @__PURE__ */ new Set()), s = N(null);
227
- s.current || (s.current = new ht(() => {
228
- t.current += 1, e.current.forEach((h) => h());
229
- }));
230
- const r = C((h) => (e.current.add(h), () => {
231
- e.current.delete(h);
232
- }), []), i = C(() => t.current, []);
233
- A(r, i, i), Y(() => () => {
234
- var h;
235
- (h = s.current) == null || h.dispose();
236
- }, []);
237
- const l = mt();
238
- let n = null;
239
- try {
240
- n = lt(l, () => s.current.execute(o));
241
- } catch {
242
- n = null;
243
- }
244
- return /* @__PURE__ */ w(T, { children: n });
245
- }
246
- const bt = V(/* @__PURE__ */ new Map()), Q = V(null);
247
- function Kt(o) {
248
- const t = D(Q);
249
- if (!t)
250
- throw new Error("useBuilderState must be used under a builder that called .state()");
251
- return [t.get(o), (e) => t.set(o, e)];
252
- }
253
- function kt({ stateMap: o = /* @__PURE__ */ new Map(), children: t }) {
254
- const [e, s] = O(() => new Map(o)), r = {
255
- map: e,
256
- get: (i) => e.get(i),
257
- set: (i, l) => {
258
- s((n) => {
259
- if (Object.is(n.get(i), l))
260
- return n;
261
- const h = new Map(n);
262
- return h.set(i, l), h;
263
- });
264
- }
265
- };
266
- return /* @__PURE__ */ w(Q.Provider, { value: r, children: /* @__PURE__ */ w(bt.Provider, { value: e, children: t }) });
267
- }
268
- function yt({ observables: o, children: t }) {
269
- const e = N(0), s = C((i) => {
270
- const l = Array.from(o).map(
271
- (n) => n.subscribe(() => {
272
- e.current += 1, i();
273
- })
274
- );
275
- return () => l.forEach((n) => n());
276
- }, [o]), r = C(() => e.current, []);
277
- return A(s, r, r), /* @__PURE__ */ w(T, { children: typeof t == "function" ? t() : t });
278
- }
279
- function _t({ signals: o, children: t }) {
280
- const e = N(0), s = C((i) => {
281
- const l = Array.from(o).map(
282
- (n) => n.subscribe(() => {
283
- e.current += 1, i();
284
- })
285
- );
286
- return () => l.forEach((n) => n());
287
- }, [o]), r = C(() => e.current, []);
288
- return A(s, r, r), /* @__PURE__ */ w(T, { children: typeof t == "function" ? t() : t });
289
- }
290
- const tt = V(/* @__PURE__ */ new Map());
291
- function Jt(o) {
292
- const t = D(tt);
293
- return t == null ? void 0 : t.get(o);
294
- }
295
- function xt({ providers: o = /* @__PURE__ */ new Map(), children: t }) {
296
- return /* @__PURE__ */ w(tt.Provider, { value: o, children: t });
297
- }
298
- function wt(o) {
299
- return !!o && typeof o == "object" && "build" in o && typeof o.build == "function";
300
- }
301
- function St(o) {
302
- return wt(o) ? o.build() : o;
303
- }
304
- function I(o) {
305
- if (o == null)
306
- return [];
307
- const t = typeof o == "function" ? o() : o;
308
- return (Array.isArray(t) ? t : [t]).map(St);
309
- }
310
- function $t(o, t, e) {
311
- if (!t) return o;
312
- const s = e ?? (typeof window < "u" ? window.innerWidth : void 0);
313
- if (s === void 0)
314
- return o;
315
- let r = { ...o };
316
- return s < 768 && t.mobile ? r = { ...r, ...t.mobile } : s >= 768 && s < 1024 && t.tablet ? r = { ...r, ...t.tablet } : s >= 1024 && t.desktop && (r = { ...r, ...t.desktop }), r;
317
- }
318
- function Qt(o, t) {
319
- const e = ct(o, t);
320
- return (s) => k.createElement(e, s);
321
- }
322
- function et(o) {
323
- var t, e, s = "";
324
- if (typeof o == "string" || typeof o == "number") s += o;
325
- else if (typeof o == "object") if (Array.isArray(o)) {
326
- var r = o.length;
327
- for (t = 0; t < r; t++) o[t] && (e = et(o[t])) && (s && (s += " "), s += e);
328
- } else for (e in o) o[e] && (s && (s += " "), s += e);
329
- return s;
330
- }
331
- function Nt() {
332
- for (var o, t, e = 0, s = "", r = arguments.length; e < r; e++) (o = arguments[e]) && (t = et(o)) && (s && (s += " "), s += t);
333
- return s;
334
- }
335
- const x = class x {
336
- constructor() {
337
- a(this, "sheet", null);
338
- a(this, "cache", /* @__PURE__ */ new Map());
339
- typeof document < "u" && (this.sheet = document.createElement("style"), this.sheet.id = "fibo-dynamic-styles", document.head.appendChild(this.sheet));
340
- }
341
- static getInstance() {
342
- return x.instance || (x.instance = new x()), x.instance;
343
- }
344
- register(t, e) {
345
- const s = `${t}:${e}`;
346
- if (this.cache.has(s))
347
- return this.cache.get(s);
348
- const r = e.replace(/[^a-zA-Z0-9-]/g, "_"), i = `fibo-${t}-${r}`, l = `.${i} { ${t}: ${e} !important; }`;
349
- if (this.sheet && this.sheet.sheet)
350
- try {
351
- this.sheet.sheet.insertRule(l, this.sheet.sheet.cssRules.length);
352
- } catch (n) {
353
- console.error("FiboUI: Failed to inject dynamic style", n);
354
- }
355
- return this.cache.set(s, i), i;
356
- }
357
- registerPseudo(t, e, s, r) {
358
- const i = `${t}:${e}:${s}:${r}`;
359
- if (this.cache.has(i))
360
- return t;
361
- const l = `.${t}:${e} { ${s}: ${r} !important; }`;
362
- if (this.sheet && this.sheet.sheet)
363
- try {
364
- this.sheet.sheet.insertRule(l, this.sheet.sheet.cssRules.length);
365
- } catch (n) {
366
- console.error("FiboUI: Failed to inject pseudo-state style", n);
367
- }
368
- return this.cache.set(i, t), t;
369
- }
370
- registerGroupPseudo(t, e, s, r) {
371
- const i = `group:${t}:${e}:${s}:${r}`;
372
- if (this.cache.has(i))
373
- return t;
374
- const l = `.group:${e} .${t} { ${s}: ${r} !important; }`;
375
- if (this.sheet && this.sheet.sheet)
376
- try {
377
- this.sheet.sheet.insertRule(l, this.sheet.sheet.cssRules.length);
378
- } catch (n) {
379
- console.error("FiboUI: Failed to inject group pseudo-state style", n);
380
- }
381
- return this.cache.set(i, t), t;
382
- }
383
- };
384
- a(x, "instance");
385
- let B = x;
386
- const c = B.getInstance();
387
- function Ct(o) {
388
- const t = o.match(/oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)/);
389
- if (!t)
390
- return o;
391
- const [, e, s, r] = t, i = parseFloat(e), l = parseFloat(s), n = parseFloat(r), h = l * Math.cos(n * Math.PI / 180), u = l * Math.sin(n * Math.PI / 180), p = i + 0.3963377774 * h + 0.2158037573 * u, d = i - 0.1055613458 * h - 0.0638541728 * u, m = i - 0.0894841775 * h - 1.291485548 * u, f = p * p * p, _ = d * d * d, g = m * m * m, y = 4.0767416621 * f - 3.3077115913 * _ + 0.2309699292 * g, P = -1.2684380046 * f + 2.6097574011 * _ - 0.3413193965 * g, F = -0.0041960863 * f - 0.7034186147 * _ + 1.707614701 * g, S = (z) => z >= 31308e-7 ? 1.055 * z ** (1 / 2.4) - 0.055 : 12.92 * z, j = Math.max(0, Math.min(1, S(y))), ot = Math.max(0, Math.min(1, S(P))), rt = Math.max(0, Math.min(1, S(F))), M = (z) => {
392
- var L;
393
- const G = (L = Math.round(z * 255).toString(16)) == null ? void 0 : L.toUpperCase();
394
- return G.length === 1 ? `0${G}` : G;
395
- };
396
- return `#${M(j)}${M(ot)}${M(rt)}`;
397
- }
398
- function Et(o) {
399
- const t = {}, e = {}, s = o.split(`
400
- `);
401
- for (const r of s) {
402
- const i = r.trim();
403
- if (!i || i.startsWith("//") || i.startsWith("*") || i === "@theme {" || i === "}")
404
- continue;
405
- const l = i.match(/^--color-([a-z0-9\-]+): (oklch\([^)]+\));?$/), n = i.match(/^--color-([a-z0-9\-]+): (#[a-fA-F0-9]{3,6});?$/);
406
- if (l) {
407
- const [, h, u] = l, p = Ct(u);
408
- t[p.toLowerCase()] = `bg-${h}`, e[p.toLowerCase()] = `text-${h}`;
409
- } else if (n) {
410
- const [, h, u] = n;
411
- t[u.toLowerCase()] = `bg-${h}`, e[u.toLowerCase()] = `text-${h}`;
412
- }
413
- }
414
- return { background: t, text: e };
415
- }
416
- const Pt = (o) => {
417
- if (o !== void 0)
418
- return typeof o == "number" ? `${o}px` : o.toString();
419
- }, $ = (o, t) => {
420
- const e = Pt(t);
421
- return e === void 0 ? "" : `${o}-[${e}]`;
422
- }, zt = `
423
- --color-red-50: oklch(0.971 0.013 17.38);
424
- --color-red-100: oklch(0.936 0.032 17.717);
425
- --color-red-200: oklch(0.885 0.062 18.334);
426
- --color-red-300: oklch(0.808 0.114 19.571);
427
- --color-red-400: oklch(0.704 0.191 22.216);
428
- --color-red-500: oklch(0.637 0.237 25.331);
429
- --color-red-600: oklch(0.577 0.245 27.325);
430
- --color-red-700: oklch(0.505 0.213 27.518);
431
- --color-red-800: oklch(0.444 0.177 26.899);
432
- --color-red-900: oklch(0.396 0.141 25.723);
433
- --color-red-950: oklch(0.258 0.092 26.042);
434
- --color-orange-50: oklch(0.98 0.016 73.684);
435
- --color-orange-100: oklch(0.954 0.038 75.164);
436
- --color-orange-200: oklch(0.901 0.076 70.697);
437
- --color-orange-300: oklch(0.837 0.128 66.29);
438
- --color-orange-400: oklch(0.75 0.183 55.934);
439
- --color-orange-500: oklch(0.705 0.213 47.604);
440
- --color-orange-600: oklch(0.646 0.222 41.116);
441
- --color-orange-700: oklch(0.553 0.195 38.402);
442
- --color-orange-800: oklch(0.47 0.157 37.304);
443
- --color-orange-900: oklch(0.408 0.123 38.172);
444
- --color-orange-950: oklch(0.266 0.079 36.259);
445
- --color-amber-50: oklch(0.987 0.022 95.277);
446
- --color-amber-100: oklch(0.962 0.059 95.617);
447
- --color-amber-200: oklch(0.924 0.12 95.746);
448
- --color-amber-300: oklch(0.879 0.169 91.605);
449
- --color-amber-400: oklch(0.828 0.189 84.429);
450
- --color-amber-500: oklch(0.769 0.188 70.08);
451
- --color-amber-600: oklch(0.666 0.179 58.318);
452
- --color-amber-700: oklch(0.555 0.163 48.998);
453
- --color-amber-800: oklch(0.473 0.137 46.201);
454
- --color-amber-900: oklch(0.414 0.112 45.904);
455
- --color-amber-950: oklch(0.279 0.077 45.635);
456
- --color-yellow-50: oklch(0.987 0.026 102.212);
457
- --color-yellow-100: oklch(0.973 0.071 103.193);
458
- --color-yellow-200: oklch(0.945 0.129 101.54);
459
- --color-yellow-300: oklch(0.905 0.182 98.111);
460
- --color-yellow-400: oklch(0.852 0.199 91.936);
461
- --color-yellow-500: oklch(0.795 0.184 86.047);
462
- --color-yellow-600: oklch(0.681 0.162 75.834);
463
- --color-yellow-700: oklch(0.554 0.135 66.442);
464
- --color-yellow-800: oklch(0.476 0.114 61.907);
465
- --color-yellow-900: oklch(0.421 0.095 57.708);
466
- --color-yellow-950: oklch(0.286 0.066 53.813);
467
- --color-lime-50: oklch(0.986 0.031 120.757);
468
- --color-lime-100: oklch(0.967 0.067 122.328);
469
- --color-lime-200: oklch(0.938 0.127 124.321);
470
- --color-lime-300: oklch(0.897 0.196 126.665);
471
- --color-lime-400: oklch(0.841 0.238 128.85);
472
- --color-lime-500: oklch(0.768 0.233 130.85);
473
- --color-lime-600: oklch(0.648 0.2 131.684);
474
- --color-lime-700: oklch(0.532 0.157 131.589);
475
- --color-lime-800: oklch(0.453 0.124 130.933);
476
- --color-lime-900: oklch(0.405 0.101 131.063);
477
- --color-lime-950: oklch(0.274 0.072 132.109);
478
- --color-green-50: oklch(0.982 0.018 155.826);
479
- --color-green-100: oklch(0.962 0.044 156.743);
480
- --color-green-200: oklch(0.925 0.084 155.995);
481
- --color-green-300: oklch(0.871 0.15 154.449);
482
- --color-green-400: oklch(0.792 0.209 151.711);
483
- --color-green-500: oklch(0.723 0.219 149.579);
484
- --color-green-600: oklch(0.627 0.194 149.214);
485
- --color-green-700: oklch(0.527 0.154 150.069);
486
- --color-green-800: oklch(0.448 0.119 151.328);
487
- --color-green-900: oklch(0.393 0.095 152.535);
488
- --color-green-950: oklch(0.266 0.065 152.934);
489
- --color-emerald-50: oklch(0.979 0.021 166.113);
490
- --color-emerald-100: oklch(0.95 0.052 163.051);
491
- --color-emerald-200: oklch(0.905 0.093 164.15);
492
- --color-emerald-300: oklch(0.845 0.143 164.978);
493
- --color-emerald-400: oklch(0.765 0.177 163.223);
494
- --color-emerald-500: oklch(0.696 0.17 162.48);
495
- --color-emerald-600: oklch(0.596 0.145 163.225);
496
- --color-emerald-700: oklch(0.508 0.118 165.612);
497
- --color-emerald-800: oklch(0.432 0.095 166.913);
498
- --color-emerald-900: oklch(0.378 0.077 168.94);
499
- --color-emerald-950: oklch(0.262 0.051 172.552);
500
- --color-teal-50: oklch(0.984 0.014 180.72);
501
- --color-teal-100: oklch(0.953 0.051 180.801);
502
- --color-teal-200: oklch(0.91 0.096 180.426);
503
- --color-teal-300: oklch(0.855 0.138 181.071);
504
- --color-teal-400: oklch(0.777 0.152 181.912);
505
- --color-teal-500: oklch(0.704 0.14 182.503);
506
- --color-teal-600: oklch(0.6 0.118 184.704);
507
- --color-teal-700: oklch(0.511 0.096 186.391);
508
- --color-teal-800: oklch(0.437 0.078 188.216);
509
- --color-teal-900: oklch(0.386 0.063 188.416);
510
- --color-teal-950: oklch(0.277 0.046 192.524);
511
- --color-cyan-50: oklch(0.984 0.019 200.873);
512
- --color-cyan-100: oklch(0.956 0.045 203.388);
513
- --color-cyan-200: oklch(0.917 0.08 205.041);
514
- --color-cyan-300: oklch(0.865 0.127 207.078);
515
- --color-cyan-400: oklch(0.789 0.154 211.53);
516
- --color-cyan-500: oklch(0.715 0.143 215.221);
517
- --color-cyan-600: oklch(0.609 0.126 221.723);
518
- --color-cyan-700: oklch(0.52 0.105 223.128);
519
- --color-cyan-800: oklch(0.45 0.085 224.283);
520
- --color-cyan-900: oklch(0.398 0.07 227.392);
521
- --color-cyan-950: oklch(0.302 0.056 229.695);
522
- --color-sky-50: oklch(0.977 0.013 236.62);
523
- --color-sky-100: oklch(0.951 0.026 236.824);
524
- --color-sky-200: oklch(0.901 0.058 230.902);
525
- --color-sky-300: oklch(0.828 0.111 230.318);
526
- --color-sky-400: oklch(0.746 0.16 232.661);
527
- --color-sky-500: oklch(0.685 0.169 237.323);
528
- --color-sky-600: oklch(0.588 0.158 241.966);
529
- --color-sky-700: oklch(0.5 0.134 242.749);
530
- --color-sky-800: oklch(0.443 0.11 240.79);
531
- --color-sky-900: oklch(0.391 0.09 240.876);
532
- --color-sky-950: oklch(0.293 0.066 243.157);
533
- --color-blue-50: oklch(0.97 0.014 254.604);
534
- --color-blue-100: oklch(0.932 0.032 255.585);
535
- --color-blue-200: oklch(0.882 0.059 254.128);
536
- --color-blue-300: oklch(0.809 0.105 251.813);
537
- --color-blue-400: oklch(0.707 0.165 254.624);
538
- --color-blue-500: oklch(0.623 0.214 259.815);
539
- --color-blue-600: oklch(0.546 0.245 262.881);
540
- --color-blue-700: oklch(0.488 0.243 264.376);
541
- --color-blue-800: oklch(0.424 0.199 265.638);
542
- --color-blue-900: oklch(0.379 0.146 265.522);
543
- --color-blue-950: oklch(0.282 0.091 267.935);
544
- --color-indigo-50: oklch(0.962 0.018 272.314);
545
- --color-indigo-100: oklch(0.93 0.034 272.788);
546
- --color-indigo-200: oklch(0.87 0.065 274.039);
547
- --color-indigo-300: oklch(0.785 0.115 274.713);
548
- --color-indigo-400: oklch(0.673 0.182 276.935);
549
- --color-indigo-500: oklch(0.585 0.233 277.117);
550
- --color-indigo-600: oklch(0.511 0.262 276.966);
551
- --color-indigo-700: oklch(0.457 0.24 277.023);
552
- --color-indigo-800: oklch(0.398 0.195 277.366);
553
- --color-indigo-900: oklch(0.359 0.144 278.697);
554
- --color-indigo-950: oklch(0.257 0.09 281.288);
555
- --color-violet-50: oklch(0.969 0.016 293.756);
556
- --color-violet-100: oklch(0.943 0.029 294.588);
557
- --color-violet-200: oklch(0.894 0.057 293.283);
558
- --color-violet-300: oklch(0.811 0.111 293.571);
559
- --color-violet-400: oklch(0.702 0.183 293.541);
560
- --color-violet-500: oklch(0.606 0.25 292.717);
561
- --color-violet-600: oklch(0.541 0.281 293.009);
562
- --color-violet-700: oklch(0.491 0.27 292.581);
563
- --color-violet-800: oklch(0.432 0.232 292.759);
564
- --color-violet-900: oklch(0.38 0.189 293.745);
565
- --color-violet-950: oklch(0.283 0.141 291.089);
566
- --color-purple-50: oklch(0.977 0.014 308.299);
567
- --color-purple-100: oklch(0.946 0.033 307.174);
568
- --color-purple-200: oklch(0.902 0.063 306.703);
569
- --color-purple-300: oklch(0.827 0.119 306.383);
570
- --color-purple-400: oklch(0.714 0.203 305.504);
571
- --color-purple-500: oklch(0.627 0.265 303.9);
572
- --color-purple-600: oklch(0.558 0.288 302.321);
573
- --color-purple-700: oklch(0.496 0.265 301.924);
574
- --color-purple-800: oklch(0.438 0.218 303.724);
575
- --color-purple-900: oklch(0.381 0.176 304.987);
576
- --color-purple-950: oklch(0.291 0.149 302.717);
577
- --color-fuchsia-50: oklch(0.977 0.017 320.058);
578
- --color-fuchsia-100: oklch(0.952 0.037 318.852);
579
- --color-fuchsia-200: oklch(0.903 0.076 319.62);
580
- --color-fuchsia-300: oklch(0.833 0.145 321.434);
581
- --color-fuchsia-400: oklch(0.74 0.238 322.16);
582
- --color-fuchsia-500: oklch(0.667 0.295 322.15);
583
- --color-fuchsia-600: oklch(0.591 0.293 322.896);
584
- --color-fuchsia-700: oklch(0.518 0.253 323.949);
585
- --color-fuchsia-800: oklch(0.452 0.211 324.591);
586
- --color-fuchsia-900: oklch(0.401 0.17 325.612);
587
- --color-fuchsia-950: oklch(0.293 0.136 325.661);
588
- --color-pink-50: oklch(0.971 0.014 343.198);
589
- --color-pink-100: oklch(0.948 0.028 342.258);
590
- --color-pink-200: oklch(0.899 0.061 343.231);
591
- --color-pink-300: oklch(0.823 0.12 346.018);
592
- --color-pink-400: oklch(0.718 0.202 349.761);
593
- --color-pink-500: oklch(0.656 0.241 354.308);
594
- --color-pink-600: oklch(0.592 0.249 0.584);
595
- --color-pink-700: oklch(0.525 0.223 3.958);
596
- --color-pink-800: oklch(0.459 0.187 3.815);
597
- --color-pink-900: oklch(0.408 0.153 2.432);
598
- --color-pink-950: oklch(0.284 0.109 3.907);
599
- --color-rose-50: oklch(0.969 0.015 12.422);
600
- --color-rose-100: oklch(0.941 0.03 12.58);
601
- --color-rose-200: oklch(0.892 0.058 10.001);
602
- --color-rose-300: oklch(0.81 0.117 11.638);
603
- --color-rose-400: oklch(0.712 0.194 13.428);
604
- --color-rose-500: oklch(0.645 0.246 16.439);
605
- --color-rose-600: oklch(0.586 0.253 17.585);
606
- --color-rose-700: oklch(0.514 0.222 16.935);
607
- --color-rose-800: oklch(0.455 0.188 13.697);
608
- --color-rose-900: oklch(0.41 0.159 10.272);
609
- --color-rose-950: oklch(0.271 0.105 12.094);
610
- --color-slate-50: oklch(0.984 0.003 247.858);
611
- --color-slate-100: oklch(0.968 0.007 247.896);
612
- --color-slate-200: oklch(0.929 0.013 255.508);
613
- --color-slate-300: oklch(0.869 0.022 252.894);
614
- --color-slate-400: oklch(0.704 0.04 256.788);
615
- --color-slate-500: oklch(0.554 0.046 257.417);
616
- --color-slate-600: oklch(0.446 0.043 257.281);
617
- --color-slate-700: oklch(0.372 0.044 257.287);
618
- --color-slate-800: oklch(0.279 0.041 260.031);
619
- --color-slate-900: oklch(0.208 0.042 265.755);
620
- --color-slate-950: oklch(0.129 0.042 264.695);
621
- --color-gray-50: oklch(0.985 0.002 247.839);
622
- --color-gray-100: oklch(0.967 0.003 264.542);
623
- --color-gray-200: oklch(0.928 0.006 264.531);
624
- --color-gray-300: oklch(0.872 0.01 258.338);
625
- --color-gray-400: oklch(0.707 0.022 261.325);
626
- --color-gray-500: oklch(0.551 0.027 264.364);
627
- --color-gray-600: oklch(0.446 0.03 256.802);
628
- --color-gray-700: oklch(0.373 0.034 259.733);
629
- --color-gray-800: oklch(0.278 0.033 256.848);
630
- --color-gray-900: oklch(0.21 0.034 264.665);
631
- --color-gray-950: oklch(0.13 0.028 261.692);
632
- --color-zinc-50: oklch(0.985 0 0);
633
- --color-zinc-100: oklch(0.967 0.001 286.375);
634
- --color-zinc-200: oklch(0.92 0.004 286.32);
635
- --color-zinc-300: oklch(0.871 0.006 286.286);
636
- --color-zinc-400: oklch(0.705 0.015 286.067);
637
- --color-zinc-500: oklch(0.552 0.016 285.938);
638
- --color-zinc-600: oklch(0.442 0.017 285.786);
639
- --color-zinc-700: oklch(0.37 0.013 285.805);
640
- --color-zinc-800: oklch(0.274 0.006 286.033);
641
- --color-zinc-900: oklch(0.21 0.006 285.885);
642
- --color-zinc-950: oklch(0.141 0.005 285.823);
643
- --color-neutral-50: oklch(0.985 0 0);
644
- --color-neutral-100: oklch(0.97 0 0);
645
- --color-neutral-200: oklch(0.922 0 0);
646
- --color-neutral-300: oklch(0.87 0 0);
647
- --color-neutral-400: oklch(0.708 0 0);
648
- --color-neutral-500: oklch(0.556 0 0);
649
- --color-neutral-600: oklch(0.439 0 0);
650
- --color-neutral-700: oklch(0.371 0 0);
651
- --color-neutral-800: oklch(0.269 0 0);
652
- --color-neutral-900: oklch(0.205 0 0);
653
- --color-neutral-950: oklch(0.145 0 0);
654
- --color-stone-50: oklch(0.985 0.001 106.423);
655
- --color-stone-100: oklch(0.97 0.001 106.424);
656
- --color-stone-200: oklch(0.923 0.003 48.717);
657
- --color-stone-300: oklch(0.869 0.005 56.366);
658
- --color-stone-400: oklch(0.709 0.01 56.259);
659
- --color-stone-500: oklch(0.553 0.013 58.071);
660
- --color-stone-600: oklch(0.444 0.011 73.639);
661
- --color-stone-700: oklch(0.374 0.01 67.558);
662
- --color-stone-800: oklch(0.268 0.007 34.298);
663
- --color-stone-900: oklch(0.216 0.006 56.043);
664
- --color-stone-950: oklch(0.147 0.004 49.25);
665
- --color-black: #000;
666
- --color-white: #fff;
667
- `, Rt = Et(zt), st = {
668
- borderRadius: {
669
- 0: "rounded-none",
670
- "0px": "rounded-none",
671
- "1px": "rounded-sm",
672
- "2px": "rounded-sm",
673
- "3px": "rounded",
674
- "4px": "rounded",
675
- "5px": "rounded-md",
676
- "6px": "rounded-md",
677
- "7px": "rounded-lg",
678
- "8px": "rounded-lg",
679
- "9px": "rounded-lg",
680
- "10px": "rounded-lg",
681
- "11px": "rounded-xl",
682
- "12px": "rounded-xl",
683
- "14px": "rounded-2xl",
684
- "16px": "rounded-2xl",
685
- "20px": "rounded-3xl",
686
- "50%": "rounded-full",
687
- "9999px": "rounded-full"
688
- },
689
- fontSize: {
690
- "0.75rem": "text-xs",
691
- "0.875rem": "text-sm",
692
- "1rem": "text-base",
693
- "1.125rem": "text-lg",
694
- "1.25rem": "text-xl",
695
- "1.5rem": "text-2xl",
696
- "1.875rem": "text-3xl",
697
- "2.25rem": "text-4xl",
698
- "3rem": "text-5xl",
699
- "3.75rem": "text-6xl",
700
- "4.5rem": "text-7xl",
701
- "6rem": "text-8xl",
702
- "8rem": "text-9xl"
703
- },
704
- fontWeight: {
705
- 100: "font-thin",
706
- 200: "font-extralight",
707
- 300: "font-light",
708
- 400: "font-normal",
709
- 500: "font-medium",
710
- 600: "font-semibold",
711
- 700: "font-bold",
712
- 800: "font-extrabold",
713
- 900: "font-black"
714
- },
715
- fontFamily: {
716
- "ui-serif": "font-serif",
717
- "ui-monospace": "font-mono",
718
- "ui-sans-serif": "font-sans",
719
- default: "font-sans"
720
- },
721
- textAlign: {
722
- left: "text-left",
723
- center: "text-center",
724
- right: "text-right",
725
- justify: "text-justify"
726
- },
727
- textDecoration: {
728
- underline: "underline",
729
- overline: "overline",
730
- "line-through": "line-through",
731
- none: "no-underline"
732
- },
733
- fontVariantNumeric: {
734
- "tabular-nums": "tabular-nums",
735
- "oldstyle-nums": "oldstyle-nums",
736
- "lining-nums": "lining-nums",
737
- "proportional-nums": "proportional-nums",
738
- "diagonal-fractions": "diagonal-fractions",
739
- "stacked-fractions": "stacked-fractions",
740
- ordinal: "ordinal",
741
- "slashed-zero": "slashed-zero",
742
- normal: "normal-nums"
743
- },
744
- fontStyle: {
745
- normal: "normal",
746
- italic: "italic",
747
- oblique: "oblique"
748
- },
749
- display: {
750
- block: "block",
751
- flex: "flex",
752
- "inline-flex": "inline-flex",
753
- grid: "grid",
754
- hidden: "hidden",
755
- none: "hidden"
756
- },
757
- position: {
758
- static: "static",
759
- relative: "relative",
760
- absolute: "absolute",
761
- fixed: "fixed",
762
- sticky: "sticky"
763
- }
764
- }, jt = (o, t) => ({
765
- // 背景色
766
- backgroundColor: (e) => e.backgroundColor ? [o.background[e.backgroundColor.toLowerCase()] || `bg-[${e.backgroundColor}]`] : [],
767
- // 文字色
768
- color: (e) => e.color ? [o.text[e.color.toLowerCase()] || `text-[${e.color}]`] : [],
769
- // 圆角
770
- borderRadius: (e) => {
771
- if (!e.borderRadius)
772
- return [];
773
- const s = st.borderRadius[e.borderRadius] || $("rounded", e.borderRadius);
774
- return s ? [s] : [];
775
- },
776
- // 外边距
777
- margin: (e) => {
778
- const s = [];
779
- if (e.margin !== void 0) {
780
- const i = $("m", e.margin);
781
- return i ? [i] : [];
782
- }
783
- return [
784
- { prop: e.marginTop, dir: "mt" },
785
- { prop: e.marginRight, dir: "mr" },
786
- { prop: e.marginBottom, dir: "mb" },
787
- { prop: e.marginLeft, dir: "ml" },
788
- { prop: e.marginX, dir: "mx" },
789
- { prop: e.marginY, dir: "my" }
790
- ].forEach(({ prop: i, dir: l }) => {
791
- if (i !== void 0) {
792
- const n = $(l, i);
793
- n && s.push(n);
794
- }
795
- }), s;
796
- },
797
- // 内边距
798
- padding: (e) => {
799
- const s = [];
800
- if (e.padding !== void 0) {
801
- const i = $("p", e.padding);
802
- return i ? [i] : [];
803
- }
804
- return [
805
- { prop: e.paddingTop, dir: "pt" },
806
- { prop: e.paddingRight, dir: "pr" },
807
- { prop: e.paddingBottom, dir: "pb" },
808
- { prop: e.paddingLeft, dir: "pl" },
809
- { prop: e.paddingX, dir: "px" },
810
- { prop: e.paddingY, dir: "py" }
811
- ].forEach(({ prop: i, dir: l }) => {
812
- if (i !== void 0) {
813
- const n = $(l, i);
814
- n && s.push(n);
815
- }
816
- }), s;
817
- },
818
- // 字体
819
- font: (e) => {
820
- const s = [];
821
- if (e.fontSize && s.push(t.fontSize[e.fontSize.toString()] || `text-[${e.fontSize}]`), e.fontWeight) {
822
- const r = t.fontWeight[e.fontWeight.toString()];
823
- r && s.push(r);
824
- }
825
- if (e.textAlign) {
826
- const r = t.textAlign[e.textAlign];
827
- r && s.push(r);
828
- }
829
- if (e.fontFamily) {
830
- const r = t.fontFamily[e.fontFamily];
831
- r && s.push(r);
832
- }
833
- if (e.textDecoration) {
834
- const r = t.textDecoration[e.textDecoration];
835
- r && s.push(r);
836
- }
837
- if (e.fontVariantNumeric) {
838
- const r = t.fontVariantNumeric[e.fontVariantNumeric];
839
- r && s.push(r);
840
- }
841
- if (e.fontStyle) {
842
- const r = t.fontStyle[e.fontStyle];
843
- r && s.push(r);
844
- }
845
- return s;
846
- },
847
- // 尺寸
848
- size: (e) => {
849
- const s = [];
850
- if (e.width) {
851
- const r = e.width.toString();
852
- s.push(`w-[${r}]`);
853
- }
854
- if (e.height) {
855
- const r = e.height.toString();
856
- s.push(`h-[${r}]`);
857
- }
858
- return s;
859
- },
860
- // 布局
861
- layout: (e) => {
862
- const s = [];
863
- if (e.display) {
864
- const r = t.display[e.display];
865
- r && s.push(r);
866
- }
867
- if (e.flexDirection) {
868
- const i = {
869
- row: "flex-row",
870
- column: "flex-col",
871
- "row-reverse": "flex-row-reverse",
872
- "column-reverse": "flex-col-reverse"
873
- }[e.flexDirection];
874
- i && s.push(i);
875
- }
876
- if (e.justifyContent) {
877
- const i = {
878
- "flex-start": "justify-start",
879
- "flex-end": "justify-end",
880
- center: "justify-center",
881
- "space-between": "justify-between",
882
- "space-around": "justify-around",
883
- "space-evenly": "justify-evenly"
884
- }[e.justifyContent];
885
- i && s.push(i);
886
- }
887
- if (e.alignItems) {
888
- const i = {
889
- "flex-start": "items-start",
890
- "flex-end": "items-end",
891
- center: "items-center",
892
- baseline: "items-baseline",
893
- stretch: "items-stretch"
894
- }[e.alignItems];
895
- i && s.push(i);
896
- }
897
- if (e.gap) {
898
- const r = $("gap", e.gap);
899
- r && s.push(r);
900
- }
901
- return s;
902
- },
903
- // 定位
904
- position: (e) => e.position ? [t.position[e.position] || ""].filter(Boolean) : [],
905
- // 透明度
906
- opacity: (e) => {
907
- if (e.opacity === void 0)
908
- return [];
909
- const s = typeof e.opacity == "string" ? parseFloat(e.opacity) : e.opacity;
910
- return [`opacity-${{
911
- 0: "0",
912
- 0.25: "25",
913
- 0.5: "50",
914
- 0.75: "75",
915
- 1: "100"
916
- }[s] || Math.round(s * 100)}`];
917
- },
918
- // 自定义类名
919
- className: (e) => e.className ? [e.className] : []
920
- }), vt = {
921
- backgroundColor: "backgroundColor",
922
- color: "color",
923
- borderRadius: "borderRadius",
924
- margin: "margin",
925
- marginTop: "margin",
926
- marginRight: "margin",
927
- marginBottom: "margin",
928
- marginLeft: "margin",
929
- marginX: "margin",
930
- marginY: "margin",
931
- padding: "padding",
932
- paddingTop: "padding",
933
- paddingRight: "padding",
934
- paddingBottom: "padding",
935
- paddingLeft: "padding",
936
- paddingX: "padding",
937
- paddingY: "padding",
938
- fontSize: "font",
939
- fontWeight: "font",
940
- textAlign: "font",
941
- textDecoration: "font",
942
- fontVariantNumeric: "font",
943
- fontStyle: "font",
944
- width: "size",
945
- height: "size",
946
- display: "layout",
947
- flexDirection: "layout",
948
- justifyContent: "layout",
949
- alignItems: "layout",
950
- gap: "layout",
951
- position: "position",
952
- opacity: "opacity",
953
- className: "className"
954
- }, Vt = (o, t) => {
955
- const e = (t == null ? void 0 : t.colorMaps) || Rt, s = (t == null ? void 0 : t.styleMaps) || st, r = jt(e, s), i = [], l = /* @__PURE__ */ new Set();
956
- return Object.keys(o).forEach((n) => {
957
- const h = vt[n];
958
- if (h && !l.has(h)) {
959
- const u = r[h];
960
- if (u) {
961
- const p = u(o);
962
- i.push(...p), l.add(h);
963
- }
964
- }
965
- }), i.filter(Boolean).join(" ");
966
- };
967
- function At(o) {
968
- const t = {};
969
- return o.forEach((e, s) => {
970
- t[s] = e.value;
971
- }), t;
972
- }
973
- function Wt({ animatedProps: o, animationConfig: t, children: e }) {
974
- const [s, r] = O(
975
- () => At(o)
976
- );
977
- Y(() => {
978
- const h = [];
979
- return o.forEach((u, p) => {
980
- const d = (m) => {
981
- r((f) => ({
982
- ...f,
983
- [p]: m
984
- }));
985
- };
986
- h.push(u.subscribe(d)), d(u.value);
987
- }), () => {
988
- h.forEach((u) => u());
989
- };
990
- }, [o]);
991
- const i = [];
992
- s.translateX !== void 0 && i.push(`translateX(${s.translateX}px)`), s.translateY !== void 0 && i.push(`translateY(${s.translateY}px)`), s.scale !== void 0 && i.push(`scale(${s.scale})`), s.rotate !== void 0 && i.push(`rotate(${s.rotate}deg)`);
993
- const l = {};
994
- if (i.length > 0 && (l.transform = i.join(" ")), t) {
995
- const { duration: h = 300, curve: u = "easeOut" } = t, p = u === "spring" ? "cubic-bezier(0.68, -0.55, 0.265, 1.55)" : u;
996
- l.transition = `transform ${h}ms ${p}`;
997
- }
998
- const n = {
999
- ...e.props.style,
1000
- ...l
1001
- };
1002
- return H(e, { style: n });
1003
- }
1004
- class b {
1005
- constructor(t, e, s, r = !1) {
1006
- a(this, "baseClassName");
1007
- a(this, "pseudoState");
1008
- a(this, "parentBuilder");
1009
- a(this, "isGroup");
1010
- a(this, "transitionDuration", 200);
1011
- a(this, "transitionEasing", "ease-in-out");
1012
- a(this, "transitionDelay", 0);
1013
- a(this, "transitionProperties", ["all"]);
1014
- this.baseClassName = t, this.pseudoState = e, this.parentBuilder = s, this.isGroup = r;
1015
- }
1016
- bg(t) {
1017
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "background-color", t) : c.registerPseudo(this.baseClassName, this.pseudoState, "background-color", t), this;
1018
- }
1019
- color(t) {
1020
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "color", t) : c.registerPseudo(this.baseClassName, this.pseudoState, "color", t), this;
1021
- }
1022
- text(t) {
1023
- return this.color(t);
1024
- }
1025
- opacity(t) {
1026
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "opacity", String(t)) : c.registerPseudo(this.baseClassName, this.pseudoState, "opacity", String(t)), this;
1027
- }
1028
- borderColor(t) {
1029
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "border-color", t) : c.registerPseudo(this.baseClassName, this.pseudoState, "border-color", t), this;
1030
- }
1031
- transform(t) {
1032
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transform", t) : c.registerPseudo(this.baseClassName, this.pseudoState, "transform", t), this;
1033
- }
1034
- scale(t) {
1035
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transform", `scale(${t})`) : c.registerPseudo(this.baseClassName, this.pseudoState, "transform", `scale(${t})`), this;
1036
- }
1037
- translateX(t) {
1038
- const e = typeof t == "number" ? `${t}px` : t;
1039
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transform", `translateX(${e})`) : c.registerPseudo(this.baseClassName, this.pseudoState, "transform", `translateX(${e})`), this;
1040
- }
1041
- translateY(t) {
1042
- const e = typeof t == "number" ? `${t}px` : t;
1043
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transform", `translateY(${e})`) : c.registerPseudo(this.baseClassName, this.pseudoState, "transform", `translateY(${e})`), this;
1044
- }
1045
- shadow(t) {
1046
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "box-shadow", t) : c.registerPseudo(this.baseClassName, this.pseudoState, "box-shadow", t), this;
1047
- }
1048
- css(t, e) {
1049
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, t, e) : c.registerPseudo(this.baseClassName, this.pseudoState, t, e), this;
1050
- }
1051
- transition(t, e, s, r) {
1052
- if (typeof t == "string" && e === void 0)
1053
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transition", t) : c.registerPseudo(this.baseClassName, this.pseudoState, "transition", t), this;
1054
- const i = Array.isArray(t) ? t.join(", ") : t, l = `${e || this.transitionDuration}ms`, n = s || this.transitionEasing, h = r ? `${r}ms` : "0ms", u = `${i} ${l} ${n} ${h}`;
1055
- return this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transition", u) : c.registerPseudo(this.baseClassName, this.pseudoState, "transition", u), this;
1056
- }
1057
- duration(t) {
1058
- return this.transitionDuration = t, this.applyTransition(), this;
1059
- }
1060
- easing(t) {
1061
- return this.transitionEasing = t, this.applyTransition(), this;
1062
- }
1063
- delay(t) {
1064
- return this.transitionDelay = t, this.applyTransition(), this;
1065
- }
1066
- properties(t) {
1067
- return this.transitionProperties = t, this.applyTransition(), this;
1068
- }
1069
- applyTransition() {
1070
- const t = this.transitionProperties.join(", "), e = `${this.transitionDuration}ms`, s = this.transitionEasing, r = this.transitionDelay > 0 ? `${this.transitionDelay}ms` : "0ms", i = `${t} ${e} ${s} ${r}`;
1071
- this.isGroup ? c.registerGroupPseudo(this.baseClassName, this.pseudoState, "transition", i) : c.registerPseudo(this.baseClassName, this.pseudoState, "transition", i);
1072
- }
1073
- end() {
1074
- return this.parentBuilder;
1075
- }
1076
- }
1077
- function Ft(o) {
1078
- return typeof window > "u" ? () => {
1079
- } : (window.addEventListener("resize", o), () => window.removeEventListener("resize", o));
1080
- }
1081
- function Mt() {
1082
- return typeof window > "u" ? 1024 : window.innerWidth;
1083
- }
1084
- function Gt({ responsive: o, children: t }) {
1085
- const e = A(Ft, Mt, () => 1024), s = $t(t.props.style ?? {}, o, e);
1086
- return H(t, { style: s });
1087
- }
1088
- let X = 0;
1089
- function Bt(o) {
1090
- return X += 1, `${o}-${X}`;
1091
- }
1092
- class te {
1093
- constructor() {
1094
- /** @internal Extra DOM props forwarded to the host element. */
1095
- a(this, "_props", {});
1096
- a(this, "_style", {});
1097
- a(this, "_cssStyles", {});
1098
- a(this, "_classNames", []);
1099
- a(this, "_children", []);
1100
- a(this, "_responsive");
1101
- a(this, "_theme");
1102
- a(this, "_state", /* @__PURE__ */ new Map());
1103
- a(this, "_providers", /* @__PURE__ */ new Map());
1104
- a(this, "_observers", /* @__PURE__ */ new Set());
1105
- a(this, "_signals", /* @__PURE__ */ new Set());
1106
- a(this, "_isObserver", !1);
1107
- a(this, "_gesture");
1108
- a(this, "_animationConfig");
1109
- a(this, "_animatedProps", /* @__PURE__ */ new Map());
1110
- a(this, "_transforms", []);
1111
- a(this, "_pseudoStateClassName");
1112
- /** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
1113
- a(this, "_hug", !1);
1114
- // Transition properties
1115
- a(this, "_transitionDuration", 200);
1116
- // ms
1117
- a(this, "_transitionEasing", "ease-in-out");
1118
- a(this, "_transitionDelay", 0);
1119
- // ms
1120
- a(this, "_transitionProperties", ["all"]);
1121
- a(this, "_childFunction");
1122
- }
1123
- hug() {
1124
- return this._hug = !0, this;
1125
- }
1126
- isHug() {
1127
- return this._hug;
1128
- }
1129
- id(t) {
1130
- return this._props.id = t, this;
1131
- }
1132
- key(t) {
1133
- return this._props.key = t, this;
1134
- }
1135
- paddingHorizontal(t) {
1136
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("padding-left", e), r = c.register("padding-right", e);
1137
- return this._classNames.push(s, r), this;
1138
- }
1139
- paddingVertical(t) {
1140
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("padding-top", e), r = c.register("padding-bottom", e);
1141
- return this._classNames.push(s, r), this;
1142
- }
1143
- marginHorizontal(t) {
1144
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("margin-left", e), r = c.register("margin-right", e);
1145
- return this._classNames.push(s, r), this;
1146
- }
1147
- marginVertical(t) {
1148
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("margin-top", e), r = c.register("margin-bottom", e);
1149
- return this._classNames.push(s, r), this;
1150
- }
1151
- flexDirection(t) {
1152
- return this._classNames.push(`flex-${t}`), this;
1153
- }
1154
- alignItems(t) {
1155
- return this._classNames.push(`items-${t}`), this;
1156
- }
1157
- justifyContent(t) {
1158
- return this._classNames.push(`justify-${t}`), this;
1159
- }
1160
- flex(t) {
1161
- if (this._classNames.push("flex"), t !== void 0)
1162
- if (typeof t == "number") {
1163
- const e = c.register("flex", String(t));
1164
- this._classNames.push(e);
1165
- } else typeof t == "string" && this._classNames.push(`flex-${t}`);
1166
- return this;
1167
- }
1168
- grid() {
1169
- return this._classNames.push("grid"), this;
1170
- }
1171
- inlineFlex() {
1172
- return this._classNames.push("inline-flex"), this;
1173
- }
1174
- inlineGrid() {
1175
- return this._classNames.push("inline-grid"), this;
1176
- }
1177
- block() {
1178
- return this._classNames.push("block"), this;
1179
- }
1180
- inlineBlock() {
1181
- return this._classNames.push("inline-block"), this;
1182
- }
1183
- hidden() {
1184
- return this._classNames.push("hidden"), this;
1185
- }
1186
- center() {
1187
- return this._classNames.push("flex", "items-center", "justify-center"), this;
1188
- }
1189
- centerX() {
1190
- return this._classNames.push("flex", "justify-center"), this;
1191
- }
1192
- centerY() {
1193
- return this._classNames.push("flex", "items-center"), this;
1194
- }
1195
- spaceBetween() {
1196
- return this._classNames.push("justify-between"), this;
1197
- }
1198
- spaceAround() {
1199
- return this._classNames.push("justify-around"), this;
1200
- }
1201
- spaceEvenly() {
1202
- return this._classNames.push("justify-evenly"), this;
1203
- }
1204
- fill() {
1205
- return this._classNames.push("w-full", "h-full"), this;
1206
- }
1207
- fillWidth() {
1208
- return this._classNames.push("w-full"), this;
1209
- }
1210
- fillHeight() {
1211
- return this._classNames.push("h-full"), this;
1212
- }
1213
- square(t) {
1214
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("width", e), r = c.register("height", e);
1215
- return this._classNames.push(s, r), this;
1216
- }
1217
- circle() {
1218
- return this._classNames.push("rounded-full"), this;
1219
- }
1220
- opacity(t) {
1221
- const e = c.register("opacity", String(t));
1222
- return this._classNames.push(e), this;
1223
- }
1224
- p(t) {
1225
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("padding", e);
1226
- return this._classNames.push(s), this;
1227
- }
1228
- px(t) {
1229
- return this.paddingHorizontal(t);
1230
- }
1231
- py(t) {
1232
- return this.paddingVertical(t);
1233
- }
1234
- paddingX(t) {
1235
- return this.paddingHorizontal(t);
1236
- }
1237
- paddingY(t) {
1238
- return this.paddingVertical(t);
1239
- }
1240
- m(t) {
1241
- const e = typeof t == "number" ? `${t}px` : t, s = c.register("margin", e);
1242
- return this._classNames.push(s), this;
1243
- }
1244
- mx(t) {
1245
- return this.marginHorizontal(t);
1246
- }
1247
- my(t) {
1248
- return this.marginVertical(t);
1249
- }
1250
- marginX(t) {
1251
- return this.marginHorizontal(t);
1252
- }
1253
- marginY(t) {
1254
- return this.marginVertical(t);
1255
- }
1256
- bg(t) {
1257
- const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t, s = c.register("background-color", e);
1258
- return this._classNames.push(s), this;
1259
- }
1260
- text(t) {
1261
- const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t, s = c.register("color", e);
1262
- return this._classNames.push(s), this;
1263
- }
1264
- color(t) {
1265
- const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t, s = c.register("color", e);
1266
- return this._classNames.push(s), this;
1267
- }
1268
- resolveSemanticColor(t) {
1269
- return [
1270
- "primary",
1271
- "on-primary",
1272
- "primary-container",
1273
- "on-primary-container",
1274
- "secondary",
1275
- "on-secondary",
1276
- "secondary-container",
1277
- "on-secondary-container",
1278
- "tertiary",
1279
- "on-tertiary",
1280
- "tertiary-container",
1281
- "on-tertiary-container",
1282
- "error",
1283
- "on-error",
1284
- "background",
1285
- "on-background",
1286
- "surface",
1287
- "on-surface",
1288
- "surface-variant",
1289
- "on-surface-variant",
1290
- "outline"
1291
- ].includes(t) ? `var(--fibo-${t})` : t;
1292
- }
1293
- shadow(t) {
1294
- if (t === null || t === "none") {
1295
- const i = c.register("box-shadow", "none");
1296
- return this._classNames.push(i), this;
1297
- }
1298
- const e = {
1299
- sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
1300
- md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
1301
- lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
1302
- xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
1303
- "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
1304
- card: "0 2px 8px rgba(0, 0, 0, 0.1)",
1305
- button: "0 2px 4px rgba(0, 0, 0, 0.12)",
1306
- modal: "0 10px 40px rgba(0, 0, 0, 0.2)",
1307
- float: "0 8px 16px rgba(0, 0, 0, 0.15)",
1308
- inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"
1309
- }, s = (i) => i.startsWith("#") || i.startsWith("rgb") || i.startsWith("hsl") || ["red", "blue", "green", "yellow", "purple", "pink", "orange", "white", "black", "gray"].some((l) => i.includes(l)), r = (i, l, n, h) => {
1310
- let d = n || "rgba(0, 0, 0, " + (h ?? 0.1) + ")";
1311
- if (n && n.startsWith("#") && h !== void 0) {
1312
- const _ = parseInt(n.slice(1, 3), 16), g = parseInt(n.slice(3, 5), 16), y = parseInt(n.slice(5, 7), 16);
1313
- d = `rgba(${_}, ${g}, ${y}, ${h})`;
1314
- }
1315
- const f = {
1316
- sm: "2px",
1317
- md: "4px",
1318
- lg: "8px",
1319
- xl: "12px",
1320
- "2xl": "16px"
1321
- }[l] || "4px";
1322
- switch (i) {
1323
- case "top":
1324
- return `0 -${f} ${f} -1px ${d}`;
1325
- case "bottom":
1326
- return `0 ${f} ${f} -1px ${d}`;
1327
- case "left":
1328
- return `-${f} 0 ${f} -1px ${d}`;
1329
- case "right":
1330
- return `${f} 0 ${f} -1px ${d}`;
1331
- case "top-bottom":
1332
- case "vertical":
1333
- return `0 -${f} ${f} -1px ${d}, 0 ${f} ${f} -1px ${d}`;
1334
- case "left-right":
1335
- case "horizontal":
1336
- return `-${f} 0 ${f} -1px ${d}, ${f} 0 ${f} -1px ${d}`;
1337
- case "all":
1338
- default:
1339
- return e[l] || e.md;
1340
- }
1341
- };
1342
- if (!t) {
1343
- const i = c.register("box-shadow", e.md);
1344
- return this._classNames.push(i), this;
1345
- }
1346
- if (typeof t == "string") {
1347
- if (s(t)) {
1348
- const n = r("all", "md", t), h = c.register("box-shadow", n);
1349
- return this._classNames.push(h), this;
1350
- }
1351
- const i = e[t] || e.md, l = c.register("box-shadow", i);
1352
- return this._classNames.push(l), this;
1353
- }
1354
- if (Array.isArray(t)) {
1355
- const [i, l, n, h] = t;
1356
- if (typeof i == "string" && s(i)) {
1357
- const d = r("all", "md", i, l), m = c.register("box-shadow", d);
1358
- return this._classNames.push(m), this;
1359
- }
1360
- const u = i;
1361
- if (typeof l == "string" && s(l)) {
1362
- const d = r(u, "md", l, n), m = c.register("box-shadow", d);
1363
- return this._classNames.push(m), this;
1364
- } else {
1365
- const m = r(u, l, n, h), f = c.register("box-shadow", m);
1366
- return this._classNames.push(f), this;
1367
- }
1368
- }
1369
- return this;
1370
- }
1371
- responsive(t) {
1372
- return this._responsive = t, this;
1373
- }
1374
- rounded(t) {
1375
- if (typeof t == "number") {
1376
- const e = c.register("border-radius", `${t}px`);
1377
- this._classNames.push(e);
1378
- } else if (typeof t == "string" && (t.startsWith("rounded-") || ["sm", "md", "lg", "xl", "2xl", "3xl", "full", "none"].includes(t))) {
1379
- const e = t.startsWith("rounded-") ? t : `rounded-${t}`;
1380
- this._classNames.push(e);
1381
- } else {
1382
- const e = c.register("border-radius", t);
1383
- this._classNames.push(e);
1384
- }
1385
- return this;
1386
- }
1387
- borderRadius(t) {
1388
- if (typeof t == "number") {
1389
- const e = c.register("border-radius", `${t}px`);
1390
- this._classNames.push(e);
1391
- } else {
1392
- const e = c.register("border-radius", t);
1393
- this._classNames.push(e);
1394
- }
1395
- return this;
1396
- }
1397
- borderColor(t) {
1398
- if (t.startsWith("border-"))
1399
- this._classNames.push(t);
1400
- else if (["red", "blue", "green", "gray", "white", "black", "transparent"].some((e) => t.includes(e)))
1401
- this._classNames.push(`border-${t}`);
1402
- else {
1403
- const e = c.register("border-color", t);
1404
- this._classNames.push(e);
1405
- }
1406
- return this;
1407
- }
1408
- width(t) {
1409
- if (typeof t == "number") {
1410
- const e = c.register("width", `${t}px`);
1411
- this._classNames.push(e);
1412
- } else if (typeof t == "string" && (t.startsWith("w-") || t === "full" || t === "screen" || t === "min" || t === "max" || t === "fit")) {
1413
- const e = t.startsWith("w-") ? t : `w-${t}`;
1414
- this._classNames.push(e);
1415
- } else {
1416
- const e = c.register("width", t);
1417
- this._classNames.push(e);
1418
- }
1419
- return this;
1420
- }
1421
- height(t) {
1422
- if (typeof t == "number") {
1423
- const e = c.register("height", `${t}px`);
1424
- this._classNames.push(e);
1425
- } else if (typeof t == "string" && (t.startsWith("h-") || t === "full" || t === "screen" || t === "min" || t === "max" || t === "fit")) {
1426
- const e = t.startsWith("h-") ? t : `h-${t}`;
1427
- this._classNames.push(e);
1428
- } else {
1429
- const e = c.register("height", t);
1430
- this._classNames.push(e);
1431
- }
1432
- return this;
1433
- }
1434
- gap(t) {
1435
- if (typeof t == "number") {
1436
- const e = c.register("gap", `${t}px`);
1437
- this._classNames.push(e);
1438
- } else if (typeof t == "string" && t.startsWith("gap-"))
1439
- this._classNames.push(t);
1440
- else {
1441
- const e = c.register("gap", t);
1442
- this._classNames.push(e);
1443
- }
1444
- return this;
1445
- }
1446
- clean() {
1447
- return this._classNames.push(
1448
- "[&_input]:outline-none",
1449
- "[&_input]:ring-0",
1450
- "[&_input]:border-none",
1451
- "[&_input]:!shadow-none",
1452
- "[&_input]:bg-transparent",
1453
- "[&_input]:h-full",
1454
- "[&_input]:w-full",
1455
- "[&_input]:p-0",
1456
- "[&_textarea]:outline-none",
1457
- "[&_textarea]:ring-0",
1458
- "[&_textarea]:border-none",
1459
- "[&_textarea]:!shadow-none",
1460
- "[&_textarea]:bg-transparent",
1461
- "[&_textarea]:h-full",
1462
- "[&_textarea]:w-full",
1463
- "[&_textarea]:p-0",
1464
- "[&_select]:outline-none",
1465
- "[&_select]:ring-0",
1466
- "[&_select]:border-none",
1467
- "[&_select]:!shadow-none",
1468
- "[&_select]:bg-transparent",
1469
- "[&_select]:h-full",
1470
- "[&_select]:w-full",
1471
- "[&_select]:p-0",
1472
- "[&_.fibo-textfield-input]:outline-none",
1473
- "[&_.fibo-textfield-input]:ring-0",
1474
- "[&_.fibo-textfield-input]:border-none",
1475
- "[&_.fibo-textfield-input]:!shadow-none",
1476
- "[&_.fibo-textfield-input]:bg-transparent",
1477
- "[&_.fibo-textfield-input]:h-full",
1478
- "[&_.fibo-textfield-input]:w-full",
1479
- "[&_.fibo-textfield-input]:p-0",
1480
- "[&_.fibo-textarea-input]:outline-none",
1481
- "[&_.fibo-textarea-input]:ring-0",
1482
- "[&_.fibo-textarea-input]:border-none",
1483
- "[&_.fibo-textarea-input]:!shadow-none",
1484
- "[&_.fibo-textarea-input]:bg-transparent",
1485
- "[&_.fibo-textarea-input]:h-full",
1486
- "[&_.fibo-textarea-input]:w-full",
1487
- "[&_.fibo-textarea-input]:p-0",
1488
- "[&>div]:h-full"
1489
- ), this;
1490
- }
1491
- borderInput(t = "gray-300", e = "blue-500") {
1492
- const s = (l) => ["red", "blue", "green", "yellow", "purple", "pink", "indigo", "gray", "orange", "teal", "cyan", "emerald", "lime", "amber", "fuchsia", "rose", "violet", "sky", "slate", "zinc", "neutral", "stone"].includes(l) ? `${l}-500` : l, r = s(t), i = s(e);
1493
- return this._classNames.push(
1494
- "border",
1495
- `border-${r}`,
1496
- "focus-within:ring-2",
1497
- `focus-within:ring-${i}`,
1498
- `focus-within:border-${i}`
1499
- ), this.clean();
1500
- }
1501
- weight(t) {
1502
- if (typeof t == "number") {
1503
- const e = c.register("font-weight", String(t));
1504
- this._classNames.push(e);
1505
- } else {
1506
- const e = {
1507
- thin: "font-thin",
1508
- extralight: "font-extralight",
1509
- light: "font-light",
1510
- normal: "font-normal",
1511
- medium: "font-medium",
1512
- semibold: "font-semibold",
1513
- bold: "font-bold",
1514
- extrabold: "font-extrabold",
1515
- black: "font-black"
1516
- };
1517
- if (e[t])
1518
- this._classNames.push(e[t]);
1519
- else {
1520
- const s = c.register("font-weight", t);
1521
- this._classNames.push(s);
1522
- }
1523
- }
1524
- return this;
1525
- }
1526
- onClick(t) {
1527
- return this._props.onClick = t, this;
1528
- }
1529
- state(t, e) {
1530
- return this._state.set(t, e), this;
1531
- }
1532
- getState(t) {
1533
- return this._state.get(t);
1534
- }
1535
- setState(t, e) {
1536
- return this._state.set(t, e), this;
1537
- }
1538
- provide(t, e) {
1539
- return this._providers.set(t, e), this;
1540
- }
1541
- consume(t) {
1542
- return this._providers.get(t);
1543
- }
1544
- observer(t) {
1545
- return this._isObserver = !0, typeof t == "object" && t !== null ? t.key !== void 0 && this.key(t.key) : t !== void 0 && this.key(t), this;
1546
- }
1547
- observe(t) {
1548
- return this._observers.add(t), this;
1549
- }
1550
- bindSignal(t) {
1551
- return this._signals.add(t), this;
1552
- }
1553
- translateX(t) {
1554
- return t instanceof R ? this._animatedProps.set("translateX", t) : this._transforms.push(`translateX(${t}px)`), this;
1555
- }
1556
- translateY(t) {
1557
- return t instanceof R ? this._animatedProps.set("translateY", t) : this._transforms.push(`translateY(${t}px)`), this;
1558
- }
1559
- scale(t) {
1560
- return t instanceof R ? this._animatedProps.set("scale", t) : this._transforms.push(`scale(${t})`), this;
1561
- }
1562
- rotate(t) {
1563
- return t instanceof R ? this._animatedProps.set("rotate", t) : this._transforms.push(`rotate(${t}deg)`), this;
1564
- }
1565
- gesture(t) {
1566
- return this._gesture = t, this;
1567
- }
1568
- animation(t) {
1569
- return this._animationConfig = t, this;
1570
- }
1571
- hasStateManagement() {
1572
- return this._state.size > 0 || this._providers.size > 0 || this._observers.size > 0 || this._signals.size > 0 || this._isObserver || this._animatedProps.size > 0;
1573
- }
1574
- className(t) {
1575
- return this._classNames.push(t), this;
1576
- }
1577
- classNames(t) {
1578
- return this._classNames.push(...t), this;
1579
- }
1580
- css(t) {
1581
- return this._cssStyles = { ...this._cssStyles, ...t }, this;
1582
- }
1583
- style(t) {
1584
- return this._style = { ...this._style, ...t }, this;
1585
- }
1586
- props(t) {
1587
- return this._props = { ...this._props, ...t }, this;
1588
- }
1589
- transition(t, e, s, r) {
1590
- if (typeof t == "string" && e === void 0) {
1591
- const d = c.register("transition", t);
1592
- return this._classNames.push(d), this;
1593
- }
1594
- const i = Array.isArray(t) ? t.join(", ") : t, l = `${e || this._transitionDuration}ms`, n = s || this._transitionEasing, h = r ? `${r}ms` : "0ms", u = `${i} ${l} ${n} ${h}`, p = c.register("transition", u);
1595
- return this._classNames.push(p), this;
1596
- }
1597
- /**
1598
- * Set transition duration in milliseconds
1599
- * Example: .duration(200) → 200ms
1600
- */
1601
- duration(t) {
1602
- return this._transitionDuration = t, this._applyTransition(), this;
1603
- }
1604
- /**
1605
- * Set transition easing function
1606
- * Example: .easing('ease-in-out')
1607
- */
1608
- easing(t) {
1609
- return this._transitionEasing = t, this._applyTransition(), this;
1610
- }
1611
- /**
1612
- * Set transition delay in milliseconds
1613
- * Example: .delay(100) → 100ms delay
1614
- */
1615
- delay(t) {
1616
- return this._transitionDelay = t, this._applyTransition(), this;
1617
- }
1618
- /**
1619
- * Set which properties to transition
1620
- * Example: .properties(['color', 'transform'])
1621
- */
1622
- properties(t) {
1623
- return this._transitionProperties = t, this._applyTransition(), this;
1624
- }
1625
- /**
1626
- * Apply the built transition to the element
1627
- */
1628
- _applyTransition() {
1629
- const t = this._transitionProperties.join(", "), e = `${this._transitionDuration}ms`, s = this._transitionEasing, r = this._transitionDelay > 0 ? `${this._transitionDelay}ms` : "0ms", i = `${t} ${e} ${s} ${r}`, l = c.register("transition", i);
1630
- this._classNames.push(l);
1631
- }
1632
- theme(t) {
1633
- return this._theme = t, this;
1634
- }
1635
- getPseudoStateClassName() {
1636
- return this._pseudoStateClassName || (this._pseudoStateClassName = Bt("fibo-pseudo"), this._classNames.push(this._pseudoStateClassName)), this._pseudoStateClassName;
1637
- }
1638
- hover(t) {
1639
- const e = this.getPseudoStateClassName(), s = new b(e, "hover", this);
1640
- return t ? (t(s), this) : s;
1641
- }
1642
- focus(t) {
1643
- const e = this.getPseudoStateClassName(), s = new b(e, "focus", this);
1644
- return t ? (t(s), this) : s;
1645
- }
1646
- active(t) {
1647
- const e = this.getPseudoStateClassName(), s = new b(e, "active", this);
1648
- return t ? (t(s), this) : s;
1649
- }
1650
- visited(t) {
1651
- const e = this.getPseudoStateClassName(), s = new b(e, "visited", this);
1652
- return t ? (t(s), this) : s;
1653
- }
1654
- disabledState(t) {
1655
- const e = this.getPseudoStateClassName(), s = new b(e, "disabled", this);
1656
- return t ? (t(s), this) : s;
1657
- }
1658
- focusWithin(t) {
1659
- const e = this.getPseudoStateClassName(), s = new b(e, "focus-within", this);
1660
- return t ? (t(s), this) : s;
1661
- }
1662
- firstChild(t) {
1663
- const e = this.getPseudoStateClassName(), s = new b(e, "first-child", this);
1664
- return t ? (t(s), this) : s;
1665
- }
1666
- lastChild(t) {
1667
- const e = this.getPseudoStateClassName(), s = new b(e, "last-child", this);
1668
- return t ? (t(s), this) : s;
1669
- }
1670
- groupHover(t) {
1671
- const e = this.getPseudoStateClassName(), s = new b(e, "hover", this, !0);
1672
- return t ? (t(s), this) : s;
1673
- }
1674
- groupFocus(t) {
1675
- const e = this.getPseudoStateClassName(), s = new b(e, "focus", this, !0);
1676
- return t ? (t(s), this) : s;
1677
- }
1678
- groupActive(t) {
1679
- const e = this.getPseudoStateClassName(), s = new b(e, "active", this, !0);
1680
- return t ? (t(s), this) : s;
1681
- }
1682
- groupFocusWithin(t) {
1683
- const e = this.getPseudoStateClassName(), s = new b(e, "focus-within", this, !0);
1684
- return t ? (t(s), this) : s;
1685
- }
1686
- group() {
1687
- return this._classNames.push("group"), this;
1688
- }
1689
- children(t) {
1690
- return typeof t == "function" ? (this._childFunction = t, this._children = []) : (this._children = I(t), this._childFunction = void 0), this;
1691
- }
1692
- getClassName() {
1693
- let t;
1694
- return Object.keys(this._cssStyles).length > 0 && (t = Vt(this._cssStyles) || void 0), Nt(this._classNames, t);
1695
- }
1696
- getStyle() {
1697
- let t = { ...this._style, ...this._cssStyles };
1698
- if (this._theme) {
1699
- const e = this._theme.colors || this._theme.colorScheme;
1700
- if (e) {
1701
- const s = t;
1702
- e.primary && (s["--fibo-primary"] = e.primary), e.onPrimary && (s["--fibo-on-primary"] = e.onPrimary), e.secondary && (s["--fibo-secondary"] = e.secondary), e.onSecondary && (s["--fibo-on-secondary"] = e.onSecondary), e.background && (s["--fibo-background"] = e.background), e.onBackground && (s["--fibo-on-background"] = e.onBackground), e.surface && (s["--fibo-surface"] = e.surface), e.onSurface && (s["--fibo-on-surface"] = e.onSurface), e.error && (s["--fibo-error"] = e.error);
1703
- }
1704
- }
1705
- if (this._transforms.length > 0) {
1706
- const e = t.transform || "";
1707
- t.transform = e ? `${e} ${this._transforms.join(" ")}` : this._transforms.join(" ");
1708
- }
1709
- if (this._animationConfig && this._animatedProps.size === 0) {
1710
- const { duration: e = 300, curve: s = "easeOut" } = this._animationConfig, r = s === "spring" ? "cubic-bezier(0.68, -0.55, 0.265, 1.55)" : s;
1711
- t.transition = `all ${e}ms ${r}`;
1712
- }
1713
- return t;
1714
- }
1715
- processChildren() {
1716
- return this._childFunction ? I(this._childFunction) : this._children;
1717
- }
1718
- getChildFunction() {
1719
- return this._childFunction;
1720
- }
1721
- }
1722
- function ee(o) {
1723
- return (...t) => {
1724
- const e = new o(...t);
1725
- return new Proxy(e, {
1726
- get(s, r, i) {
1727
- return r === "build" ? () => {
1728
- const l = s._isObserver, n = s._signals, h = s._observers, u = s._state, p = s._providers, d = () => {
1729
- let y = s.build();
1730
- const P = s._animatedProps, F = s._animationConfig;
1731
- P && P.size > 0 && (y = k.createElement(Wt, {
1732
- animatedProps: P,
1733
- animationConfig: F,
1734
- children: y
1735
- }));
1736
- const S = s._gesture;
1737
- S && (y = S.wrap(y));
1738
- const j = s._responsive;
1739
- return j && (y = k.createElement(Gt, {
1740
- responsive: j,
1741
- children: y
1742
- })), y;
1743
- }, m = typeof s.hasStateManagement == "function" ? s.hasStateManagement() : !!(l || n && n.size || h && h.size || u && u.size || p && p.size), f = l ? k.createElement(gt, {
1744
- key: s._props.key,
1745
- children: d
1746
- }) : null, _ = () => f ?? d();
1747
- let g = _();
1748
- return m && n && n.size > 0 ? g = k.createElement(_t, {
1749
- key: s._props.key,
1750
- signals: n,
1751
- children: _
1752
- }) : m && h && h.size > 0 && (g = k.createElement(yt, {
1753
- observables: h,
1754
- children: _
1755
- })), m && u && u.size > 0 && (g = k.createElement(kt, {
1756
- stateMap: u,
1757
- children: g
1758
- })), m && p && p.size > 0 && (g = k.createElement(xt, {
1759
- providers: p,
1760
- children: g
1761
- })), g;
1762
- } : Reflect.has(s, r) ? Reflect.get(s, r, i) : (l) => {
1763
- const n = r.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), u = ["opacity", "z-index", "flex", "flex-grow", "flex-shrink", "order", "font-weight", "line-height"].includes(n), p = typeof l == "number" && !u ? `${l}px` : String(l), d = c.register(n, p);
1764
- return s.className(d), i;
1765
- };
1766
- }
1767
- });
1768
- };
1769
- }
1770
- const Dt = ({
1771
- signal: o,
1772
- builder: t,
1773
- loading: e,
1774
- error: s
1775
- }) => {
1776
- const r = k.useSyncExternalStore(
1777
- k.useCallback((n) => o.subscribe ? o.subscribe(n) : () => {
1778
- }, [o]),
1779
- () => o.value
1780
- ), i = r == null ? void 0 : r.error;
1781
- return i && s ? s(i) : ((r == null ? void 0 : r.isLoading) || (r == null ? void 0 : r.loading)) === !0 && e ? e() : t ? t(r) : null;
1782
- }, Tt = k.memo(Dt);
1783
- class Lt {
1784
- constructor(t) {
1785
- a(this, "_loading");
1786
- a(this, "_error");
1787
- a(this, "_builder");
1788
- this._signal = t;
1789
- }
1790
- loading(t) {
1791
- return this._loading = typeof t == "function" ? t : () => t, this;
1792
- }
1793
- error(t) {
1794
- return this._error = t, this;
1795
- }
1796
- builder(t) {
1797
- return this._builder = t, this;
1798
- }
1799
- children(t) {
1800
- return this._builder = t, this;
1801
- }
1802
- build() {
1803
- return k.createElement(Tt, {
1804
- signal: this._signal,
1805
- builder: this._builder,
1806
- loading: this._loading,
1807
- error: this._error
1808
- });
1809
- }
1810
- }
1811
- function se(o) {
1812
- return new Lt(o);
1813
- }
1814
- export {
1815
- ut as C,
1816
- at as E,
1817
- te as F,
1818
- dt as O,
1819
- xt as P,
1820
- Zt as R,
1821
- R as S,
1822
- se as V,
1823
- qt as a,
1824
- Z as b,
1825
- Ht as c,
1826
- gt as d,
1827
- Jt as e,
1828
- $t as f,
1829
- K as g,
1830
- ee as h,
1831
- mt as i,
1832
- kt as j,
1833
- wt as k,
1834
- St as l,
1835
- Bt as m,
1836
- I as n,
1837
- Ut as o,
1838
- Qt as p,
1839
- lt as r,
1840
- Ot as s,
1841
- Kt as u
1842
- };