fiboui 2.3.0 → 2.4.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,2528 +0,0 @@
1
- "use client";
2
- var gt = Object.defineProperty;
3
- var bt = (s, t, e) => t in s ? gt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
4
- var l = (s, t, e) => bt(s, typeof t != "symbol" ? t + "" : t, e);
5
- import g, { useRef as w, createContext as j, useContext as O, useCallback as E, useSyncExternalStore as B, useEffect as A, useState as Z, cloneElement as yt } from "react";
6
- import { jsx as C, Fragment as W } from "react/jsx-runtime";
7
- import { r as kt, f as _t, b as xt } from "./themeData-CmTJt3dU.js";
8
- class J {
9
- constructor() {
10
- l(this, "activeEffect", null);
11
- }
12
- }
13
- const Q = new J(), z = [Q];
14
- function tt() {
15
- return new J();
16
- }
17
- function et() {
18
- return z[z.length - 1] ?? Q;
19
- }
20
- function D() {
21
- return et().activeEffect;
22
- }
23
- function $t(s, t) {
24
- z.push(s);
25
- try {
26
- return t();
27
- } finally {
28
- z.pop();
29
- }
30
- }
31
- function M(s) {
32
- const t = et(), e = t.activeEffect;
33
- return t.activeEffect = s, e;
34
- }
35
- class wt {
36
- constructor(t) {
37
- l(this, "dependencies", /* @__PURE__ */ new Set());
38
- l(this, "_onDispose");
39
- this.fn = t, this.run();
40
- }
41
- run() {
42
- const t = M(this);
43
- try {
44
- this.cleanup(), this.fn();
45
- } finally {
46
- M(t);
47
- }
48
- }
49
- track(t) {
50
- this.dependencies.add(t), t.subscribeEffect(this);
51
- }
52
- trigger() {
53
- this.run();
54
- }
55
- cleanup() {
56
- this.dependencies.forEach((t) => t.unsubscribeEffect(this)), this.dependencies.clear();
57
- }
58
- dispose() {
59
- var t;
60
- this.cleanup(), (t = this._onDispose) == null || t.call(this);
61
- }
62
- }
63
- class St {
64
- constructor(t) {
65
- l(this, "dependencies", /* @__PURE__ */ new Set());
66
- this._onInvalidate = t;
67
- }
68
- execute(t) {
69
- const e = M(this);
70
- try {
71
- return this.cleanup(), t();
72
- } finally {
73
- M(e);
74
- }
75
- }
76
- track(t) {
77
- this.dependencies.add(t), t.subscribeEffect(this);
78
- }
79
- trigger() {
80
- this._onInvalidate();
81
- }
82
- cleanup() {
83
- this.dependencies.forEach((t) => t.unsubscribeEffect(this)), this.dependencies.clear();
84
- }
85
- dispose() {
86
- this.cleanup();
87
- }
88
- }
89
- class R {
90
- constructor(t) {
91
- l(this, "listeners", /* @__PURE__ */ new Set());
92
- l(this, "effects", /* @__PURE__ */ new Set());
93
- this._value = t;
94
- }
95
- get value() {
96
- const t = D();
97
- return t && t.track(this), this._value;
98
- }
99
- set value(t) {
100
- this._value !== t && (this._value = t, this.notify());
101
- }
102
- subscribe(t) {
103
- return this.listeners.add(t), () => this.listeners.delete(t);
104
- }
105
- subscribeEffect(t) {
106
- this.effects.add(t);
107
- }
108
- unsubscribeEffect(t) {
109
- this.effects.delete(t);
110
- }
111
- notify() {
112
- const t = Array.from(this.effects), e = Array.from(this.listeners);
113
- t.forEach((r) => r.trigger()), e.forEach((r) => r(this._value));
114
- }
115
- }
116
- function _e(s) {
117
- return new R(s);
118
- }
119
- class vt {
120
- constructor(t) {
121
- l(this, "listeners", /* @__PURE__ */ new Set());
122
- l(this, "effects", /* @__PURE__ */ new Set());
123
- l(this, "_value");
124
- l(this, "_dirty", !0);
125
- l(this, "internalEffect");
126
- this.fn = t, this.internalEffect = new wt(() => {
127
- this._dirty || (this._dirty = !0, this.notify());
128
- });
129
- }
130
- get value() {
131
- const t = D();
132
- if (t && t.track(this), this._dirty) {
133
- const e = M(this.internalEffect);
134
- try {
135
- this.internalEffect.cleanup(), this._value = this.fn(), this._dirty = !1;
136
- } finally {
137
- M(e);
138
- }
139
- }
140
- return this._value;
141
- }
142
- subscribe(t) {
143
- return this.listeners.add(t), () => this.listeners.delete(t);
144
- }
145
- subscribeEffect(t) {
146
- this.effects.add(t);
147
- }
148
- unsubscribeEffect(t) {
149
- this.effects.delete(t);
150
- }
151
- notify() {
152
- const t = Array.from(this.effects), e = Array.from(this.listeners);
153
- t.forEach((r) => r.trigger()), e.forEach((r) => r(this._value));
154
- }
155
- }
156
- function xe(s) {
157
- return new vt(s);
158
- }
159
- class Ct {
160
- constructor(t) {
161
- l(this, "listeners", /* @__PURE__ */ new Set());
162
- l(this, "effects", /* @__PURE__ */ new Set());
163
- this._value = t;
164
- }
165
- get() {
166
- const t = D();
167
- return t && t.track(this), this._value;
168
- }
169
- set(t) {
170
- this._value !== t && (this._value = t, this.notify());
171
- }
172
- subscribe(t) {
173
- return this.listeners.add(t), () => this.listeners.delete(t);
174
- }
175
- subscribeEffect(t) {
176
- this.effects.add(t);
177
- }
178
- unsubscribeEffect(t) {
179
- this.effects.delete(t);
180
- }
181
- notify() {
182
- Array.from(this.effects).forEach((t) => t.trigger()), Array.from(this.listeners).forEach((t) => t(this._value));
183
- }
184
- }
185
- function $e(s) {
186
- return new Ct(s);
187
- }
188
- class Nt {
189
- constructor(t) {
190
- l(this, "listeners", /* @__PURE__ */ new Set());
191
- l(this, "effects", /* @__PURE__ */ new Set());
192
- this.state = t;
193
- }
194
- getState() {
195
- const t = D();
196
- return t && t.track(this), this.state;
197
- }
198
- setState(t) {
199
- const e = typeof t == "function" ? t(this.state) : t, r = { ...this.state, ...e }, o = Object.keys(this.state), i = Object.keys(r);
200
- o.length === i.length && i.every((a) => Object.is(r[a], this.state[a])) || (this.state = r, this.notify());
201
- }
202
- subscribe(t) {
203
- return this.listeners.add(t), () => this.listeners.delete(t);
204
- }
205
- subscribeEffect(t) {
206
- this.effects.add(t);
207
- }
208
- unsubscribeEffect(t) {
209
- this.effects.delete(t);
210
- }
211
- notify() {
212
- Array.from(this.effects).forEach((t) => t.trigger()), Array.from(this.listeners).forEach((t) => t(this.state));
213
- }
214
- }
215
- function we(s) {
216
- return new Nt(s);
217
- }
218
- const Et = tt(), st = j(Et);
219
- function Mt() {
220
- return O(st);
221
- }
222
- function Se({ children: s, scope: t }) {
223
- const e = w(t ?? tt()).current;
224
- return /* @__PURE__ */ C(st.Provider, { value: e, children: s });
225
- }
226
- function Tt({ children: s }) {
227
- const t = w(0), e = w(/* @__PURE__ */ new Set()), r = w(null);
228
- r.current || (r.current = new St(() => {
229
- t.current += 1, e.current.forEach((c) => c());
230
- }));
231
- const o = E((c) => (e.current.add(c), () => {
232
- e.current.delete(c);
233
- }), []), i = E(() => t.current, []);
234
- B(o, i, i), A(() => () => {
235
- var c;
236
- (c = r.current) == null || c.dispose();
237
- }, []);
238
- const n = Mt();
239
- let a = null;
240
- try {
241
- a = $t(n, () => r.current.execute(s));
242
- } catch {
243
- a = null;
244
- }
245
- return /* @__PURE__ */ C(W, { children: a });
246
- }
247
- const It = j(/* @__PURE__ */ new Map()), rt = j(null);
248
- function ve(s) {
249
- const t = O(rt);
250
- if (!t)
251
- throw new Error("useBuilderState must be used under a builder that called .state()");
252
- return [t.get(s), (e) => t.set(s, e)];
253
- }
254
- function Rt({ stateMap: s = /* @__PURE__ */ new Map(), children: t }) {
255
- const [e, r] = Z(() => new Map(s)), o = {
256
- map: e,
257
- get: (i) => e.get(i),
258
- set: (i, n) => {
259
- r((a) => {
260
- if (Object.is(a.get(i), n))
261
- return a;
262
- const c = new Map(a);
263
- return c.set(i, n), c;
264
- });
265
- }
266
- };
267
- return /* @__PURE__ */ C(rt.Provider, { value: o, children: /* @__PURE__ */ C(It.Provider, { value: e, children: t }) });
268
- }
269
- function zt({ observables: s, children: t }) {
270
- const e = w(0), r = E((i) => {
271
- const n = Array.from(s).map(
272
- (a) => a.subscribe(() => {
273
- e.current += 1, i();
274
- })
275
- );
276
- return () => n.forEach((a) => a());
277
- }, [s]), o = E(() => e.current, []);
278
- return B(r, o, o), /* @__PURE__ */ C(W, { children: typeof t == "function" ? t() : t });
279
- }
280
- function jt({ signals: s, children: t }) {
281
- const e = w(0), r = E((i) => {
282
- const n = Array.from(s).map(
283
- (a) => a.subscribe(() => {
284
- e.current += 1, i();
285
- })
286
- );
287
- return () => n.forEach((a) => a());
288
- }, [s]), o = E(() => e.current, []);
289
- return B(r, o, o), /* @__PURE__ */ C(W, { children: typeof t == "function" ? t() : t });
290
- }
291
- const ot = j(/* @__PURE__ */ new Map());
292
- function Ce(s) {
293
- const t = O(ot);
294
- return t == null ? void 0 : t.get(s);
295
- }
296
- function At({ providers: s = /* @__PURE__ */ new Map(), children: t }) {
297
- return /* @__PURE__ */ C(ot.Provider, { value: s, children: t });
298
- }
299
- function Dt(s) {
300
- return !!s && typeof s == "object" && "build" in s && typeof s.build == "function";
301
- }
302
- function Ft(s) {
303
- return g.isValidElement(s) ? s : Dt(s) ? s.build() : s;
304
- }
305
- function H(s) {
306
- return typeof s == "string" || typeof s == "number";
307
- }
308
- function Lt(s, t) {
309
- return g.isValidElement(s) && H(s.key) && s.key !== "" ? s.key : `.$fibo-${t}`;
310
- }
311
- function Vt(s, t) {
312
- return !g.isValidElement(s) || H(s.key) && s.key !== "" ? s : g.cloneElement(s, { key: Lt(s, t) });
313
- }
314
- function K(s) {
315
- if (s == null)
316
- return [];
317
- const t = typeof s == "function" ? s() : s;
318
- return (Array.isArray(t) ? t : [t]).map((r, o) => Vt(Ft(r), o));
319
- }
320
- const Y = /* @__PURE__ */ new Map(), Pt = {
321
- easeIn: "ease-in",
322
- easeOut: "ease-out",
323
- easeInOut: "ease-in-out",
324
- linear: "linear",
325
- ease: "ease"
326
- };
327
- function it(s = {}) {
328
- const t = s.stiffness ?? 170, e = s.damping ?? 26, r = s.mass ?? 1, o = `${t}:${e}:${r}`, i = Y.get(o);
329
- if (i) return i;
330
- const n = 1 / 60, a = 1;
331
- let c = 0, d = 0;
332
- const h = [0];
333
- for (let b = 0; b < 180; b += 1) {
334
- const x = -t * (c - a) - e * d;
335
- if (d += x / r * n, c += d * n, h.push(c), b > 8 && Math.abs(c - a) < 2e-3 && Math.abs(d) < 2e-3) break;
336
- }
337
- h[h.length - 1] !== 1 && h.push(1);
338
- const m = Math.max(1, Math.floor((h.length - 1) / 24)), p = [];
339
- for (let b = 0; b < h.length; b += m) {
340
- const x = b / (h.length - 1), S = Math.round(h[b] * 1e4) / 1e4;
341
- p.push(b === 0 ? `${S}` : `${S} ${Math.round(x * 1e4) / 100}%`);
342
- }
343
- const y = `linear(${p.join(", ")})`;
344
- return Y.set(o, y), y;
345
- }
346
- function v(s, t) {
347
- return s === "spring" ? it(t) : Pt[s] ?? s;
348
- }
349
- const U = [
350
- "fadeIn",
351
- "fadeOut",
352
- "fade",
353
- "slideUp",
354
- "slideDown",
355
- "slideLeft",
356
- "slideRight",
357
- "scaleIn",
358
- "scaleOut",
359
- "scale",
360
- "blurIn",
361
- "blurOut",
362
- "blur",
363
- "pop",
364
- "bounce"
365
- ], Ot = {
366
- fade: "fadeIn",
367
- scale: "scaleIn",
368
- blur: "blurIn"
369
- };
370
- function Bt(s) {
371
- if (!s || typeof s != "object") return !1;
372
- const t = s;
373
- return typeof t.from == "object" && t.from !== null && typeof t.to == "object" && t.to !== null;
374
- }
375
- function G(s) {
376
- const t = /* @__PURE__ */ new Set(["opacity", "zIndex", "z-index", "flex", "fontWeight", "lineHeight"]);
377
- return Object.entries(s).map(([e, r]) => {
378
- const o = e.replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`), i = typeof r == "number" && !t.has(e) ? `${r}px` : String(r);
379
- return `${o}: ${i}`;
380
- }).join("; ");
381
- }
382
- function Wt(s) {
383
- let t = 5381;
384
- for (let e = 0; e < s.length; e += 1) t = (t << 5) + t ^ s.charCodeAt(e);
385
- return (t >>> 0).toString(36);
386
- }
387
- function Ht(s) {
388
- const t = Ot[s] ?? s;
389
- if (!U.includes(t))
390
- throw new Error(`Unknown motion preset "${s}". Use: ${U.join(", ")}`);
391
- return t;
392
- }
393
- const P = `
394
- .fibo-anim {
395
- animation-duration: var(--fibo-dur, 300ms);
396
- animation-timing-function: var(--fibo-ease, ease);
397
- animation-delay: calc(var(--fibo-i, 0) * var(--fibo-stagger, 0ms) + var(--fibo-delay, 0ms));
398
- animation-fill-mode: both;
399
- animation-iteration-count: 1;
400
- }
401
- .fibo-anim-fadeIn, .fibo-anim-fade { animation-name: fibo-fadeIn; }
402
- .fibo-anim-fadeOut { animation-name: fibo-fadeOut; }
403
- .fibo-anim-slideUp { animation-name: fibo-slideUp; }
404
- .fibo-anim-slideDown { animation-name: fibo-slideDown; }
405
- .fibo-anim-slideLeft { animation-name: fibo-slideLeft; }
406
- .fibo-anim-slideRight { animation-name: fibo-slideRight; }
407
- .fibo-anim-scaleIn, .fibo-anim-scale { animation-name: fibo-scaleIn; }
408
- .fibo-anim-scaleOut { animation-name: fibo-scaleOut; }
409
- .fibo-anim-blurIn, .fibo-anim-blur { animation-name: fibo-blurIn; }
410
- .fibo-anim-blurOut { animation-name: fibo-blurOut; }
411
- .fibo-anim-pop { animation-name: fibo-pop; }
412
- .fibo-anim-bounce { animation-name: fibo-bounce; }
413
-
414
- @keyframes fibo-fadeIn { from { opacity: 0; } to { opacity: 1; } }
415
- @keyframes fibo-fadeOut { from { opacity: 1; } to { opacity: 0; } }
416
- @keyframes fibo-slideUp {
417
- from { opacity: 0; transform: translate3d(0, var(--fibo-from, 16px), 0); }
418
- to { opacity: 1; transform: none; }
419
- }
420
- @keyframes fibo-slideDown {
421
- from { opacity: 0; transform: translate3d(0, calc(var(--fibo-from, 16px) * -1), 0); }
422
- to { opacity: 1; transform: none; }
423
- }
424
- @keyframes fibo-slideLeft {
425
- from { opacity: 0; transform: translate3d(var(--fibo-from, 16px), 0, 0); }
426
- to { opacity: 1; transform: none; }
427
- }
428
- @keyframes fibo-slideRight {
429
- from { opacity: 0; transform: translate3d(calc(var(--fibo-from, 16px) * -1), 0, 0); }
430
- to { opacity: 1; transform: none; }
431
- }
432
- @keyframes fibo-scaleIn {
433
- from { opacity: 0; transform: scale(0.94); }
434
- to { opacity: 1; transform: none; }
435
- }
436
- @keyframes fibo-scaleOut {
437
- from { opacity: 1; transform: none; }
438
- to { opacity: 0; transform: scale(0.94); }
439
- }
440
- @keyframes fibo-blurIn {
441
- from { opacity: 0; filter: blur(var(--fibo-from, 8px)); }
442
- to { opacity: 1; filter: none; }
443
- }
444
- @keyframes fibo-blurOut {
445
- from { opacity: 1; filter: none; }
446
- to { opacity: 0; filter: blur(var(--fibo-from, 8px)); }
447
- }
448
- @keyframes fibo-pop {
449
- from { opacity: 0; transform: scale(0.92); }
450
- to { opacity: 1; transform: none; }
451
- }
452
- @keyframes fibo-bounce {
453
- 0% { opacity: 0; transform: translate3d(0, var(--fibo-from, 16px), 0); }
454
- 60% { opacity: 1; transform: translate3d(0, -6px, 0); }
455
- 80% { transform: translate3d(0, 2px, 0); }
456
- 100% { opacity: 1; transform: none; }
457
- }
458
-
459
- @keyframes stripes {
460
- from { background-position: 0 0; }
461
- to { background-position: 40px 0; }
462
- }
463
-
464
- .fibo-stagger-item { display: contents; }
465
-
466
- .fibo-reveal {
467
- min-width: 0;
468
- max-width: 100%;
469
- opacity: 0;
470
- transform: translate3d(0, 12px, 0);
471
- transition-property: opacity, transform, filter;
472
- transition-duration: var(--fibo-dur, 500ms);
473
- transition-timing-function: var(--fibo-ease, ease);
474
- transition-delay: calc(var(--fibo-i, 0) * var(--fibo-stagger, 0ms) + var(--fibo-delay, 0ms));
475
- }
476
- .fibo-reveal-fade { transform: none; }
477
- .fibo-reveal-fadeUp, .fibo-reveal-fadeIn, .fibo-reveal-slideUp { transform: translate3d(0, 16px, 0); }
478
- .fibo-reveal-slideDown { transform: translate3d(0, -16px, 0); }
479
- .fibo-reveal-slideLeft { transform: translate3d(16px, 0, 0); }
480
- .fibo-reveal-slideRight { transform: translate3d(-16px, 0, 0); }
481
- .fibo-reveal-scale, .fibo-reveal-scaleIn { transform: scale(0.96); }
482
- .fibo-reveal-blur { filter: blur(8px); transform: none; }
483
- .fibo-reveal.fibo-inview {
484
- opacity: 1;
485
- transform: none;
486
- filter: none;
487
- }
488
-
489
- .fibo-view-timeline {
490
- animation-timeline: view();
491
- animation-range: entry 0% cover 35%;
492
- }
493
- .fibo-scroll-timeline {
494
- animation-timeline: scroll();
495
- }
496
- .fibo-scroll-progress {
497
- transform: scaleX(var(--fibo-progress, 0));
498
- transform-origin: left center;
499
- animation-name: fibo-progress-grow;
500
- animation-duration: 1s;
501
- animation-timing-function: linear;
502
- animation-fill-mode: both;
503
- animation-timeline: scroll();
504
- }
505
- @keyframes fibo-progress-grow {
506
- from { transform: scaleX(0); }
507
- to { transform: scaleX(1); }
508
- }
509
- @supports not (animation-timeline: scroll()) {
510
- .fibo-scroll-progress {
511
- animation: none;
512
- transform: scaleX(var(--fibo-progress, 0));
513
- }
514
- }
515
-
516
- .fibo-snap-y { scroll-snap-type: y mandatory; }
517
- .fibo-snap-x { scroll-snap-type: x mandatory; }
518
- .fibo-snap-both { scroll-snap-type: both mandatory; }
519
- .fibo-snap-start { scroll-snap-align: start; }
520
- .fibo-snap-center { scroll-snap-align: center; }
521
- .fibo-snap-end { scroll-snap-align: end; }
522
-
523
- @media (prefers-reduced-motion: reduce) {
524
- .fibo-anim:not(.fibo-motion-force),
525
- .fibo-reveal:not(.fibo-motion-force),
526
- .fibo-scroll-progress:not(.fibo-motion-force) {
527
- animation: none !important;
528
- transition: none !important;
529
- opacity: 1 !important;
530
- transform: none !important;
531
- filter: none !important;
532
- }
533
- }
534
- `.trim();
535
- function q(s) {
536
- let t = 5381;
537
- for (let e = 0; e < s.length; e += 1)
538
- t = (t << 5) + t ^ s.charCodeAt(e);
539
- return (t >>> 0).toString(36);
540
- }
541
- const $ = class $ {
542
- constructor() {
543
- l(this, "sheet", null);
544
- l(this, "cache", /* @__PURE__ */ new Map());
545
- l(this, "extras", []);
546
- l(this, "defaultsReady", !1);
547
- this.attachSheet(), this.ensureDefaults();
548
- }
549
- static getInstance() {
550
- return $.instance || ($.instance = new $()), $.instance;
551
- }
552
- /** Test-only: empty cache/sheet so a simulated client starts cold. */
553
- reset() {
554
- this.cache.clear(), this.extras = [], this.defaultsReady = !1, this.sheet = null, this.attachSheet(), this.ensureDefaults();
555
- }
556
- static resetForTests() {
557
- $.getInstance().reset();
558
- }
559
- attachSheet() {
560
- if (typeof document > "u") return;
561
- const t = document.getElementById("fibo-dynamic-styles");
562
- if (t) {
563
- this.sheet = t, this.defaultsReady = !0;
564
- return;
565
- }
566
- this.sheet = document.createElement("style"), this.sheet.id = "fibo-dynamic-styles", this.sheet.setAttribute("data-fibo", "1"), document.head.appendChild(this.sheet);
567
- }
568
- /**
569
- * CSS `@media` rule, deduped. Used by `.media()` / `.md()` / `.responsive()` — not JS resize.
570
- */
571
- registerMedia(t, e, r) {
572
- const o = `@media ${t}|${e}:${r}`;
573
- if (this.cache.has(o))
574
- return this.cache.get(o);
575
- const i = `fibo-mq-${q(o)}`, n = `@media ${t} { .${i} { ${e}: ${r} !important; } }`;
576
- return this.insert(n), this.cache.set(o, i), i;
577
- }
578
- ensureDefaults() {
579
- var t;
580
- this.defaultsReady || (this.defaultsReady = !0, this.sheet && !((t = this.sheet.textContent) != null && t.includes("fibo-fadeIn")) && this.sheet.appendChild(document.createTextNode(P)));
581
- }
582
- getCss() {
583
- this.ensureDefaults();
584
- const t = [...this.extras].sort();
585
- return [P, ...t].filter(Boolean).join(`
586
- `);
587
- }
588
- registerKeyframes(t, e, r) {
589
- const o = `kf:${e}=>${r}`;
590
- if (this.cache.has(o)) return this.cache.get(o);
591
- const i = `fibo-c-${t}`;
592
- return this.insert(`@keyframes ${i} { from { ${e} } to { ${r} } }`), this.insert(`.${i} { animation-name: ${i}; }`), this.cache.set(o, i), i;
593
- }
594
- insert(t, e = !0) {
595
- var r;
596
- if (!(e && this.extras.includes(t)) && (e && this.extras.push(t), !(this.sheet && ((r = this.sheet.textContent) != null && r.includes(t)))))
597
- if (this.sheet && this.sheet.sheet)
598
- try {
599
- this.sheet.sheet.insertRule(t, this.sheet.sheet.cssRules.length);
600
- } catch {
601
- this.sheet && this.sheet.appendChild(document.createTextNode(t));
602
- }
603
- else this.sheet && this.sheet.appendChild(document.createTextNode(t));
604
- }
605
- /** Set a `:root` custom property (e.g. `--fibo-sticky-offset`). */
606
- registerRoot(t, e) {
607
- const r = `:root:${t}:${e}`;
608
- this.cache.has(r) || (this.insert(`:root { ${t}: ${e}; }`), this.cache.set(r, ":root"));
609
- }
610
- /** Once: `html { scroll-padding-top: var(--fibo-sticky-offset, 0px) }`. */
611
- ensureScrollPadding() {
612
- const t = "html:scroll-padding-top";
613
- this.cache.has(t) || (this.insert("html { scroll-padding-top: var(--fibo-sticky-offset, 0px); }"), this.cache.set(t, "html"));
614
- }
615
- register(t, e) {
616
- const r = `${t}:${e}`;
617
- if (this.cache.has(r))
618
- return this.cache.get(r);
619
- const o = e.replace(/[^a-zA-Z0-9-]/g, "_"), i = `fibo-${t}-${o}`, n = `.${i} { ${t}: ${e} !important; }`;
620
- return this.insert(n), this.cache.set(r, i), i;
621
- }
622
- /**
623
- * One class per (pseudo, property, value). Same rules → same class on server and client.
624
- * Order-independent: each declaration hashes on its own.
625
- */
626
- registerPseudo(t, e, r, o = !1) {
627
- const i = `${o ? "group:" : ""}${t}:${e}:${r}`;
628
- if (this.cache.has(i))
629
- return this.cache.get(i);
630
- const n = `fibo-ps-${q(i)}`, a = o ? `.group:${t} .${n} { ${e}: ${r} !important; }` : `.${n}:${t} { ${e}: ${r} !important; }`;
631
- return this.insert(a), this.cache.set(i, n), n;
632
- }
633
- registerGroupPseudo(t, e, r, o) {
634
- return this.registerPseudo(e, r, o, !0);
635
- }
636
- };
637
- l($, "instance");
638
- let T = $;
639
- const u = T.getInstance();
640
- function _() {
641
- T.getInstance().ensureDefaults();
642
- }
643
- function Ne() {
644
- return T.getInstance().getCss();
645
- }
646
- function nt() {
647
- return T.getInstance().getCss();
648
- }
649
- function Ee() {
650
- return `<style id="fibo-dynamic-styles" data-fibo="1">${nt().replace(/<\/style/gi, "<\\/style")}</style>`;
651
- }
652
- function Me() {
653
- return _(), g.createElement("style", {
654
- id: "fibo-dynamic-styles",
655
- "data-fibo": "1",
656
- suppressHydrationWarning: !0,
657
- dangerouslySetInnerHTML: { __html: nt() }
658
- });
659
- }
660
- function Xt() {
661
- return _(), g.createElement("style", {
662
- id: "fibo-motion-presets",
663
- "data-fibo-motion": "1",
664
- dangerouslySetInnerHTML: { __html: P }
665
- });
666
- }
667
- const at = {
668
- sm: 640,
669
- md: 768,
670
- lg: 1024,
671
- xl: 1280
672
- };
673
- function Kt(s) {
674
- return s in at;
675
- }
676
- function Yt(s) {
677
- if (Kt(s))
678
- return `(min-width: ${at[s]}px)`;
679
- const t = s.trim();
680
- return t.startsWith("@media") ? t.replace(/^@media\s+/, "") : t;
681
- }
682
- function lt(s) {
683
- var t, e, r = "";
684
- if (typeof s == "string" || typeof s == "number") r += s;
685
- else if (typeof s == "object") if (Array.isArray(s)) {
686
- var o = s.length;
687
- for (t = 0; t < o; t++) s[t] && (e = lt(s[t])) && (r && (r += " "), r += e);
688
- } else for (e in s) s[e] && (r && (r += " "), r += e);
689
- return r;
690
- }
691
- function Ut() {
692
- for (var s, t, e = 0, r = "", o = arguments.length; e < o; e++) (s = arguments[e]) && (t = lt(s)) && (r && (r += " "), r += t);
693
- return r;
694
- }
695
- function Gt(s) {
696
- const t = s.match(/oklch\(\s*([\d.]+)\s+([\d.]+)\s+([\d.]+)\s*\)/);
697
- if (!t)
698
- return s;
699
- const [, e, r, o] = t, i = parseFloat(e), n = parseFloat(r), a = parseFloat(o), c = n * Math.cos(a * Math.PI / 180), d = n * Math.sin(a * Math.PI / 180), h = i + 0.3963377774 * c + 0.2158037573 * d, f = i - 0.1055613458 * c - 0.0638541728 * d, m = i - 0.0894841775 * c - 1.291485548 * d, p = h * h * h, y = f * f * f, b = m * m * m, x = 4.0767416621 * p - 3.3077115913 * y + 0.2309699292 * b, S = -1.2684380046 * p + 2.6097574011 * y - 0.3413193965 * b, ft = -0.0041960863 * p - 0.7034186147 * y + 1.707614701 * b, F = (I) => I >= 31308e-7 ? 1.055 * I ** (1 / 2.4) - 0.055 : 12.92 * I, dt = Math.max(0, Math.min(1, F(x))), mt = Math.max(0, Math.min(1, F(S))), pt = Math.max(0, Math.min(1, F(ft))), L = (I) => {
700
- var X;
701
- const V = (X = Math.round(I * 255).toString(16)) == null ? void 0 : X.toUpperCase();
702
- return V.length === 1 ? `0${V}` : V;
703
- };
704
- return `#${L(dt)}${L(mt)}${L(pt)}`;
705
- }
706
- function qt(s) {
707
- const t = {}, e = {}, r = s.split(`
708
- `);
709
- for (const o of r) {
710
- const i = o.trim();
711
- if (!i || i.startsWith("//") || i.startsWith("*") || i === "@theme {" || i === "}")
712
- continue;
713
- const n = i.match(/^--color-([a-z0-9\-]+): (oklch\([^)]+\));?$/), a = i.match(/^--color-([a-z0-9\-]+): (#[a-fA-F0-9]{3,6});?$/);
714
- if (n) {
715
- const [, c, d] = n, h = Gt(d);
716
- t[h.toLowerCase()] = `bg-${c}`, e[h.toLowerCase()] = `text-${c}`;
717
- } else if (a) {
718
- const [, c, d] = a;
719
- t[d.toLowerCase()] = `bg-${c}`, e[d.toLowerCase()] = `text-${c}`;
720
- }
721
- }
722
- return { background: t, text: e };
723
- }
724
- const Zt = (s) => {
725
- if (s !== void 0)
726
- return typeof s == "number" ? `${s}px` : s.toString();
727
- }, N = (s, t) => {
728
- const e = Zt(t);
729
- return e === void 0 ? "" : `${s}-[${e}]`;
730
- }, Jt = `
731
- --color-red-50: oklch(0.971 0.013 17.38);
732
- --color-red-100: oklch(0.936 0.032 17.717);
733
- --color-red-200: oklch(0.885 0.062 18.334);
734
- --color-red-300: oklch(0.808 0.114 19.571);
735
- --color-red-400: oklch(0.704 0.191 22.216);
736
- --color-red-500: oklch(0.637 0.237 25.331);
737
- --color-red-600: oklch(0.577 0.245 27.325);
738
- --color-red-700: oklch(0.505 0.213 27.518);
739
- --color-red-800: oklch(0.444 0.177 26.899);
740
- --color-red-900: oklch(0.396 0.141 25.723);
741
- --color-red-950: oklch(0.258 0.092 26.042);
742
- --color-orange-50: oklch(0.98 0.016 73.684);
743
- --color-orange-100: oklch(0.954 0.038 75.164);
744
- --color-orange-200: oklch(0.901 0.076 70.697);
745
- --color-orange-300: oklch(0.837 0.128 66.29);
746
- --color-orange-400: oklch(0.75 0.183 55.934);
747
- --color-orange-500: oklch(0.705 0.213 47.604);
748
- --color-orange-600: oklch(0.646 0.222 41.116);
749
- --color-orange-700: oklch(0.553 0.195 38.402);
750
- --color-orange-800: oklch(0.47 0.157 37.304);
751
- --color-orange-900: oklch(0.408 0.123 38.172);
752
- --color-orange-950: oklch(0.266 0.079 36.259);
753
- --color-amber-50: oklch(0.987 0.022 95.277);
754
- --color-amber-100: oklch(0.962 0.059 95.617);
755
- --color-amber-200: oklch(0.924 0.12 95.746);
756
- --color-amber-300: oklch(0.879 0.169 91.605);
757
- --color-amber-400: oklch(0.828 0.189 84.429);
758
- --color-amber-500: oklch(0.769 0.188 70.08);
759
- --color-amber-600: oklch(0.666 0.179 58.318);
760
- --color-amber-700: oklch(0.555 0.163 48.998);
761
- --color-amber-800: oklch(0.473 0.137 46.201);
762
- --color-amber-900: oklch(0.414 0.112 45.904);
763
- --color-amber-950: oklch(0.279 0.077 45.635);
764
- --color-yellow-50: oklch(0.987 0.026 102.212);
765
- --color-yellow-100: oklch(0.973 0.071 103.193);
766
- --color-yellow-200: oklch(0.945 0.129 101.54);
767
- --color-yellow-300: oklch(0.905 0.182 98.111);
768
- --color-yellow-400: oklch(0.852 0.199 91.936);
769
- --color-yellow-500: oklch(0.795 0.184 86.047);
770
- --color-yellow-600: oklch(0.681 0.162 75.834);
771
- --color-yellow-700: oklch(0.554 0.135 66.442);
772
- --color-yellow-800: oklch(0.476 0.114 61.907);
773
- --color-yellow-900: oklch(0.421 0.095 57.708);
774
- --color-yellow-950: oklch(0.286 0.066 53.813);
775
- --color-lime-50: oklch(0.986 0.031 120.757);
776
- --color-lime-100: oklch(0.967 0.067 122.328);
777
- --color-lime-200: oklch(0.938 0.127 124.321);
778
- --color-lime-300: oklch(0.897 0.196 126.665);
779
- --color-lime-400: oklch(0.841 0.238 128.85);
780
- --color-lime-500: oklch(0.768 0.233 130.85);
781
- --color-lime-600: oklch(0.648 0.2 131.684);
782
- --color-lime-700: oklch(0.532 0.157 131.589);
783
- --color-lime-800: oklch(0.453 0.124 130.933);
784
- --color-lime-900: oklch(0.405 0.101 131.063);
785
- --color-lime-950: oklch(0.274 0.072 132.109);
786
- --color-green-50: oklch(0.982 0.018 155.826);
787
- --color-green-100: oklch(0.962 0.044 156.743);
788
- --color-green-200: oklch(0.925 0.084 155.995);
789
- --color-green-300: oklch(0.871 0.15 154.449);
790
- --color-green-400: oklch(0.792 0.209 151.711);
791
- --color-green-500: oklch(0.723 0.219 149.579);
792
- --color-green-600: oklch(0.627 0.194 149.214);
793
- --color-green-700: oklch(0.527 0.154 150.069);
794
- --color-green-800: oklch(0.448 0.119 151.328);
795
- --color-green-900: oklch(0.393 0.095 152.535);
796
- --color-green-950: oklch(0.266 0.065 152.934);
797
- --color-emerald-50: oklch(0.979 0.021 166.113);
798
- --color-emerald-100: oklch(0.95 0.052 163.051);
799
- --color-emerald-200: oklch(0.905 0.093 164.15);
800
- --color-emerald-300: oklch(0.845 0.143 164.978);
801
- --color-emerald-400: oklch(0.765 0.177 163.223);
802
- --color-emerald-500: oklch(0.696 0.17 162.48);
803
- --color-emerald-600: oklch(0.596 0.145 163.225);
804
- --color-emerald-700: oklch(0.508 0.118 165.612);
805
- --color-emerald-800: oklch(0.432 0.095 166.913);
806
- --color-emerald-900: oklch(0.378 0.077 168.94);
807
- --color-emerald-950: oklch(0.262 0.051 172.552);
808
- --color-teal-50: oklch(0.984 0.014 180.72);
809
- --color-teal-100: oklch(0.953 0.051 180.801);
810
- --color-teal-200: oklch(0.91 0.096 180.426);
811
- --color-teal-300: oklch(0.855 0.138 181.071);
812
- --color-teal-400: oklch(0.777 0.152 181.912);
813
- --color-teal-500: oklch(0.704 0.14 182.503);
814
- --color-teal-600: oklch(0.6 0.118 184.704);
815
- --color-teal-700: oklch(0.511 0.096 186.391);
816
- --color-teal-800: oklch(0.437 0.078 188.216);
817
- --color-teal-900: oklch(0.386 0.063 188.416);
818
- --color-teal-950: oklch(0.277 0.046 192.524);
819
- --color-cyan-50: oklch(0.984 0.019 200.873);
820
- --color-cyan-100: oklch(0.956 0.045 203.388);
821
- --color-cyan-200: oklch(0.917 0.08 205.041);
822
- --color-cyan-300: oklch(0.865 0.127 207.078);
823
- --color-cyan-400: oklch(0.789 0.154 211.53);
824
- --color-cyan-500: oklch(0.715 0.143 215.221);
825
- --color-cyan-600: oklch(0.609 0.126 221.723);
826
- --color-cyan-700: oklch(0.52 0.105 223.128);
827
- --color-cyan-800: oklch(0.45 0.085 224.283);
828
- --color-cyan-900: oklch(0.398 0.07 227.392);
829
- --color-cyan-950: oklch(0.302 0.056 229.695);
830
- --color-sky-50: oklch(0.977 0.013 236.62);
831
- --color-sky-100: oklch(0.951 0.026 236.824);
832
- --color-sky-200: oklch(0.901 0.058 230.902);
833
- --color-sky-300: oklch(0.828 0.111 230.318);
834
- --color-sky-400: oklch(0.746 0.16 232.661);
835
- --color-sky-500: oklch(0.685 0.169 237.323);
836
- --color-sky-600: oklch(0.588 0.158 241.966);
837
- --color-sky-700: oklch(0.5 0.134 242.749);
838
- --color-sky-800: oklch(0.443 0.11 240.79);
839
- --color-sky-900: oklch(0.391 0.09 240.876);
840
- --color-sky-950: oklch(0.293 0.066 243.157);
841
- --color-blue-50: oklch(0.97 0.014 254.604);
842
- --color-blue-100: oklch(0.932 0.032 255.585);
843
- --color-blue-200: oklch(0.882 0.059 254.128);
844
- --color-blue-300: oklch(0.809 0.105 251.813);
845
- --color-blue-400: oklch(0.707 0.165 254.624);
846
- --color-blue-500: oklch(0.623 0.214 259.815);
847
- --color-blue-600: oklch(0.546 0.245 262.881);
848
- --color-blue-700: oklch(0.488 0.243 264.376);
849
- --color-blue-800: oklch(0.424 0.199 265.638);
850
- --color-blue-900: oklch(0.379 0.146 265.522);
851
- --color-blue-950: oklch(0.282 0.091 267.935);
852
- --color-indigo-50: oklch(0.962 0.018 272.314);
853
- --color-indigo-100: oklch(0.93 0.034 272.788);
854
- --color-indigo-200: oklch(0.87 0.065 274.039);
855
- --color-indigo-300: oklch(0.785 0.115 274.713);
856
- --color-indigo-400: oklch(0.673 0.182 276.935);
857
- --color-indigo-500: oklch(0.585 0.233 277.117);
858
- --color-indigo-600: oklch(0.511 0.262 276.966);
859
- --color-indigo-700: oklch(0.457 0.24 277.023);
860
- --color-indigo-800: oklch(0.398 0.195 277.366);
861
- --color-indigo-900: oklch(0.359 0.144 278.697);
862
- --color-indigo-950: oklch(0.257 0.09 281.288);
863
- --color-violet-50: oklch(0.969 0.016 293.756);
864
- --color-violet-100: oklch(0.943 0.029 294.588);
865
- --color-violet-200: oklch(0.894 0.057 293.283);
866
- --color-violet-300: oklch(0.811 0.111 293.571);
867
- --color-violet-400: oklch(0.702 0.183 293.541);
868
- --color-violet-500: oklch(0.606 0.25 292.717);
869
- --color-violet-600: oklch(0.541 0.281 293.009);
870
- --color-violet-700: oklch(0.491 0.27 292.581);
871
- --color-violet-800: oklch(0.432 0.232 292.759);
872
- --color-violet-900: oklch(0.38 0.189 293.745);
873
- --color-violet-950: oklch(0.283 0.141 291.089);
874
- --color-purple-50: oklch(0.977 0.014 308.299);
875
- --color-purple-100: oklch(0.946 0.033 307.174);
876
- --color-purple-200: oklch(0.902 0.063 306.703);
877
- --color-purple-300: oklch(0.827 0.119 306.383);
878
- --color-purple-400: oklch(0.714 0.203 305.504);
879
- --color-purple-500: oklch(0.627 0.265 303.9);
880
- --color-purple-600: oklch(0.558 0.288 302.321);
881
- --color-purple-700: oklch(0.496 0.265 301.924);
882
- --color-purple-800: oklch(0.438 0.218 303.724);
883
- --color-purple-900: oklch(0.381 0.176 304.987);
884
- --color-purple-950: oklch(0.291 0.149 302.717);
885
- --color-fuchsia-50: oklch(0.977 0.017 320.058);
886
- --color-fuchsia-100: oklch(0.952 0.037 318.852);
887
- --color-fuchsia-200: oklch(0.903 0.076 319.62);
888
- --color-fuchsia-300: oklch(0.833 0.145 321.434);
889
- --color-fuchsia-400: oklch(0.74 0.238 322.16);
890
- --color-fuchsia-500: oklch(0.667 0.295 322.15);
891
- --color-fuchsia-600: oklch(0.591 0.293 322.896);
892
- --color-fuchsia-700: oklch(0.518 0.253 323.949);
893
- --color-fuchsia-800: oklch(0.452 0.211 324.591);
894
- --color-fuchsia-900: oklch(0.401 0.17 325.612);
895
- --color-fuchsia-950: oklch(0.293 0.136 325.661);
896
- --color-pink-50: oklch(0.971 0.014 343.198);
897
- --color-pink-100: oklch(0.948 0.028 342.258);
898
- --color-pink-200: oklch(0.899 0.061 343.231);
899
- --color-pink-300: oklch(0.823 0.12 346.018);
900
- --color-pink-400: oklch(0.718 0.202 349.761);
901
- --color-pink-500: oklch(0.656 0.241 354.308);
902
- --color-pink-600: oklch(0.592 0.249 0.584);
903
- --color-pink-700: oklch(0.525 0.223 3.958);
904
- --color-pink-800: oklch(0.459 0.187 3.815);
905
- --color-pink-900: oklch(0.408 0.153 2.432);
906
- --color-pink-950: oklch(0.284 0.109 3.907);
907
- --color-rose-50: oklch(0.969 0.015 12.422);
908
- --color-rose-100: oklch(0.941 0.03 12.58);
909
- --color-rose-200: oklch(0.892 0.058 10.001);
910
- --color-rose-300: oklch(0.81 0.117 11.638);
911
- --color-rose-400: oklch(0.712 0.194 13.428);
912
- --color-rose-500: oklch(0.645 0.246 16.439);
913
- --color-rose-600: oklch(0.586 0.253 17.585);
914
- --color-rose-700: oklch(0.514 0.222 16.935);
915
- --color-rose-800: oklch(0.455 0.188 13.697);
916
- --color-rose-900: oklch(0.41 0.159 10.272);
917
- --color-rose-950: oklch(0.271 0.105 12.094);
918
- --color-slate-50: oklch(0.984 0.003 247.858);
919
- --color-slate-100: oklch(0.968 0.007 247.896);
920
- --color-slate-200: oklch(0.929 0.013 255.508);
921
- --color-slate-300: oklch(0.869 0.022 252.894);
922
- --color-slate-400: oklch(0.704 0.04 256.788);
923
- --color-slate-500: oklch(0.554 0.046 257.417);
924
- --color-slate-600: oklch(0.446 0.043 257.281);
925
- --color-slate-700: oklch(0.372 0.044 257.287);
926
- --color-slate-800: oklch(0.279 0.041 260.031);
927
- --color-slate-900: oklch(0.208 0.042 265.755);
928
- --color-slate-950: oklch(0.129 0.042 264.695);
929
- --color-gray-50: oklch(0.985 0.002 247.839);
930
- --color-gray-100: oklch(0.967 0.003 264.542);
931
- --color-gray-200: oklch(0.928 0.006 264.531);
932
- --color-gray-300: oklch(0.872 0.01 258.338);
933
- --color-gray-400: oklch(0.707 0.022 261.325);
934
- --color-gray-500: oklch(0.551 0.027 264.364);
935
- --color-gray-600: oklch(0.446 0.03 256.802);
936
- --color-gray-700: oklch(0.373 0.034 259.733);
937
- --color-gray-800: oklch(0.278 0.033 256.848);
938
- --color-gray-900: oklch(0.21 0.034 264.665);
939
- --color-gray-950: oklch(0.13 0.028 261.692);
940
- --color-zinc-50: oklch(0.985 0 0);
941
- --color-zinc-100: oklch(0.967 0.001 286.375);
942
- --color-zinc-200: oklch(0.92 0.004 286.32);
943
- --color-zinc-300: oklch(0.871 0.006 286.286);
944
- --color-zinc-400: oklch(0.705 0.015 286.067);
945
- --color-zinc-500: oklch(0.552 0.016 285.938);
946
- --color-zinc-600: oklch(0.442 0.017 285.786);
947
- --color-zinc-700: oklch(0.37 0.013 285.805);
948
- --color-zinc-800: oklch(0.274 0.006 286.033);
949
- --color-zinc-900: oklch(0.21 0.006 285.885);
950
- --color-zinc-950: oklch(0.141 0.005 285.823);
951
- --color-neutral-50: oklch(0.985 0 0);
952
- --color-neutral-100: oklch(0.97 0 0);
953
- --color-neutral-200: oklch(0.922 0 0);
954
- --color-neutral-300: oklch(0.87 0 0);
955
- --color-neutral-400: oklch(0.708 0 0);
956
- --color-neutral-500: oklch(0.556 0 0);
957
- --color-neutral-600: oklch(0.439 0 0);
958
- --color-neutral-700: oklch(0.371 0 0);
959
- --color-neutral-800: oklch(0.269 0 0);
960
- --color-neutral-900: oklch(0.205 0 0);
961
- --color-neutral-950: oklch(0.145 0 0);
962
- --color-stone-50: oklch(0.985 0.001 106.423);
963
- --color-stone-100: oklch(0.97 0.001 106.424);
964
- --color-stone-200: oklch(0.923 0.003 48.717);
965
- --color-stone-300: oklch(0.869 0.005 56.366);
966
- --color-stone-400: oklch(0.709 0.01 56.259);
967
- --color-stone-500: oklch(0.553 0.013 58.071);
968
- --color-stone-600: oklch(0.444 0.011 73.639);
969
- --color-stone-700: oklch(0.374 0.01 67.558);
970
- --color-stone-800: oklch(0.268 0.007 34.298);
971
- --color-stone-900: oklch(0.216 0.006 56.043);
972
- --color-stone-950: oklch(0.147 0.004 49.25);
973
- --color-black: #000;
974
- --color-white: #fff;
975
- `, Qt = qt(Jt), ct = {
976
- borderRadius: {
977
- 0: "rounded-none",
978
- "0px": "rounded-none",
979
- "1px": "rounded-sm",
980
- "2px": "rounded-sm",
981
- "3px": "rounded",
982
- "4px": "rounded",
983
- "5px": "rounded-md",
984
- "6px": "rounded-md",
985
- "7px": "rounded-lg",
986
- "8px": "rounded-lg",
987
- "9px": "rounded-lg",
988
- "10px": "rounded-lg",
989
- "11px": "rounded-xl",
990
- "12px": "rounded-xl",
991
- "14px": "rounded-2xl",
992
- "16px": "rounded-2xl",
993
- "20px": "rounded-3xl",
994
- "50%": "rounded-full",
995
- "9999px": "rounded-full"
996
- },
997
- fontSize: {
998
- "0.75rem": "text-xs",
999
- "0.875rem": "text-sm",
1000
- "1rem": "text-base",
1001
- "1.125rem": "text-lg",
1002
- "1.25rem": "text-xl",
1003
- "1.5rem": "text-2xl",
1004
- "1.875rem": "text-3xl",
1005
- "2.25rem": "text-4xl",
1006
- "3rem": "text-5xl",
1007
- "3.75rem": "text-6xl",
1008
- "4.5rem": "text-7xl",
1009
- "6rem": "text-8xl",
1010
- "8rem": "text-9xl"
1011
- },
1012
- fontWeight: {
1013
- 100: "font-thin",
1014
- 200: "font-extralight",
1015
- 300: "font-light",
1016
- 400: "font-normal",
1017
- 500: "font-medium",
1018
- 600: "font-semibold",
1019
- 700: "font-bold",
1020
- 800: "font-extrabold",
1021
- 900: "font-black"
1022
- },
1023
- fontFamily: {
1024
- "ui-serif": "font-serif",
1025
- "ui-monospace": "font-mono",
1026
- "ui-sans-serif": "font-sans",
1027
- default: "font-sans"
1028
- },
1029
- textAlign: {
1030
- left: "text-left",
1031
- center: "text-center",
1032
- right: "text-right",
1033
- justify: "text-justify"
1034
- },
1035
- textDecoration: {
1036
- underline: "underline",
1037
- overline: "overline",
1038
- "line-through": "line-through",
1039
- none: "no-underline"
1040
- },
1041
- fontVariantNumeric: {
1042
- "tabular-nums": "tabular-nums",
1043
- "oldstyle-nums": "oldstyle-nums",
1044
- "lining-nums": "lining-nums",
1045
- "proportional-nums": "proportional-nums",
1046
- "diagonal-fractions": "diagonal-fractions",
1047
- "stacked-fractions": "stacked-fractions",
1048
- ordinal: "ordinal",
1049
- "slashed-zero": "slashed-zero",
1050
- normal: "normal-nums"
1051
- },
1052
- fontStyle: {
1053
- normal: "normal",
1054
- italic: "italic",
1055
- oblique: "oblique"
1056
- },
1057
- display: {
1058
- block: "block",
1059
- flex: "flex",
1060
- "inline-flex": "inline-flex",
1061
- grid: "grid",
1062
- hidden: "hidden",
1063
- none: "hidden"
1064
- },
1065
- position: {
1066
- static: "static",
1067
- relative: "relative",
1068
- absolute: "absolute",
1069
- fixed: "fixed",
1070
- sticky: "sticky"
1071
- }
1072
- }, te = (s, t) => ({
1073
- // 背景色
1074
- backgroundColor: (e) => e.backgroundColor ? [s.background[e.backgroundColor.toLowerCase()] || `bg-[${e.backgroundColor}]`] : [],
1075
- // 文字色
1076
- color: (e) => e.color ? [s.text[e.color.toLowerCase()] || `text-[${e.color}]`] : [],
1077
- // 圆角
1078
- borderRadius: (e) => {
1079
- if (!e.borderRadius)
1080
- return [];
1081
- const r = ct.borderRadius[e.borderRadius] || N("rounded", e.borderRadius);
1082
- return r ? [r] : [];
1083
- },
1084
- // 外边距
1085
- margin: (e) => {
1086
- const r = [];
1087
- if (e.margin !== void 0) {
1088
- const i = N("m", e.margin);
1089
- return i ? [i] : [];
1090
- }
1091
- return [
1092
- { prop: e.marginTop, dir: "mt" },
1093
- { prop: e.marginRight, dir: "mr" },
1094
- { prop: e.marginBottom, dir: "mb" },
1095
- { prop: e.marginLeft, dir: "ml" },
1096
- { prop: e.marginX, dir: "mx" },
1097
- { prop: e.marginY, dir: "my" }
1098
- ].forEach(({ prop: i, dir: n }) => {
1099
- if (i !== void 0) {
1100
- const a = N(n, i);
1101
- a && r.push(a);
1102
- }
1103
- }), r;
1104
- },
1105
- // 内边距
1106
- padding: (e) => {
1107
- const r = [];
1108
- if (e.padding !== void 0) {
1109
- const i = N("p", e.padding);
1110
- return i ? [i] : [];
1111
- }
1112
- return [
1113
- { prop: e.paddingTop, dir: "pt" },
1114
- { prop: e.paddingRight, dir: "pr" },
1115
- { prop: e.paddingBottom, dir: "pb" },
1116
- { prop: e.paddingLeft, dir: "pl" },
1117
- { prop: e.paddingX, dir: "px" },
1118
- { prop: e.paddingY, dir: "py" }
1119
- ].forEach(({ prop: i, dir: n }) => {
1120
- if (i !== void 0) {
1121
- const a = N(n, i);
1122
- a && r.push(a);
1123
- }
1124
- }), r;
1125
- },
1126
- // 字体
1127
- font: (e) => {
1128
- const r = [];
1129
- if (e.fontSize && r.push(t.fontSize[e.fontSize.toString()] || `text-[${e.fontSize}]`), e.fontWeight) {
1130
- const o = t.fontWeight[e.fontWeight.toString()];
1131
- o && r.push(o);
1132
- }
1133
- if (e.textAlign) {
1134
- const o = t.textAlign[e.textAlign];
1135
- o && r.push(o);
1136
- }
1137
- if (e.fontFamily) {
1138
- const o = t.fontFamily[e.fontFamily];
1139
- o && r.push(o);
1140
- }
1141
- if (e.textDecoration) {
1142
- const o = t.textDecoration[e.textDecoration];
1143
- o && r.push(o);
1144
- }
1145
- if (e.fontVariantNumeric) {
1146
- const o = t.fontVariantNumeric[e.fontVariantNumeric];
1147
- o && r.push(o);
1148
- }
1149
- if (e.fontStyle) {
1150
- const o = t.fontStyle[e.fontStyle];
1151
- o && r.push(o);
1152
- }
1153
- return r;
1154
- },
1155
- // 尺寸
1156
- size: (e) => {
1157
- const r = [];
1158
- if (e.width) {
1159
- const o = e.width.toString();
1160
- r.push(`w-[${o}]`);
1161
- }
1162
- if (e.height) {
1163
- const o = e.height.toString();
1164
- r.push(`h-[${o}]`);
1165
- }
1166
- return r;
1167
- },
1168
- // 布局
1169
- layout: (e) => {
1170
- const r = [];
1171
- if (e.display) {
1172
- const o = t.display[e.display];
1173
- o && r.push(o);
1174
- }
1175
- if (e.flexDirection) {
1176
- const i = {
1177
- row: "flex-row",
1178
- column: "flex-col",
1179
- "row-reverse": "flex-row-reverse",
1180
- "column-reverse": "flex-col-reverse"
1181
- }[e.flexDirection];
1182
- i && r.push(i);
1183
- }
1184
- if (e.justifyContent) {
1185
- const i = {
1186
- "flex-start": "justify-start",
1187
- "flex-end": "justify-end",
1188
- center: "justify-center",
1189
- "space-between": "justify-between",
1190
- "space-around": "justify-around",
1191
- "space-evenly": "justify-evenly"
1192
- }[e.justifyContent];
1193
- i && r.push(i);
1194
- }
1195
- if (e.alignItems) {
1196
- const i = {
1197
- "flex-start": "items-start",
1198
- "flex-end": "items-end",
1199
- center: "items-center",
1200
- baseline: "items-baseline",
1201
- stretch: "items-stretch"
1202
- }[e.alignItems];
1203
- i && r.push(i);
1204
- }
1205
- if (e.gap) {
1206
- const o = N("gap", e.gap);
1207
- o && r.push(o);
1208
- }
1209
- return r;
1210
- },
1211
- // 定位
1212
- position: (e) => e.position ? [t.position[e.position] || ""].filter(Boolean) : [],
1213
- // 透明度
1214
- opacity: (e) => {
1215
- if (e.opacity === void 0)
1216
- return [];
1217
- const r = typeof e.opacity == "string" ? parseFloat(e.opacity) : e.opacity;
1218
- return [`opacity-${{
1219
- 0: "0",
1220
- 0.25: "25",
1221
- 0.5: "50",
1222
- 0.75: "75",
1223
- 1: "100"
1224
- }[r] || Math.round(r * 100)}`];
1225
- },
1226
- // 自定义类名
1227
- className: (e) => e.className ? [e.className] : []
1228
- }), ee = {
1229
- backgroundColor: "backgroundColor",
1230
- color: "color",
1231
- borderRadius: "borderRadius",
1232
- margin: "margin",
1233
- marginTop: "margin",
1234
- marginRight: "margin",
1235
- marginBottom: "margin",
1236
- marginLeft: "margin",
1237
- marginX: "margin",
1238
- marginY: "margin",
1239
- padding: "padding",
1240
- paddingTop: "padding",
1241
- paddingRight: "padding",
1242
- paddingBottom: "padding",
1243
- paddingLeft: "padding",
1244
- paddingX: "padding",
1245
- paddingY: "padding",
1246
- fontSize: "font",
1247
- fontWeight: "font",
1248
- textAlign: "font",
1249
- textDecoration: "font",
1250
- fontVariantNumeric: "font",
1251
- fontStyle: "font",
1252
- width: "size",
1253
- height: "size",
1254
- display: "layout",
1255
- flexDirection: "layout",
1256
- justifyContent: "layout",
1257
- alignItems: "layout",
1258
- gap: "layout",
1259
- position: "position",
1260
- opacity: "opacity",
1261
- className: "className"
1262
- }, se = (s, t) => {
1263
- const e = (t == null ? void 0 : t.colorMaps) || Qt, r = (t == null ? void 0 : t.styleMaps) || ct, o = te(e, r), i = [], n = /* @__PURE__ */ new Set();
1264
- return Object.keys(s).forEach((a) => {
1265
- const c = ee[a];
1266
- if (c && !n.has(c)) {
1267
- const d = o[c];
1268
- if (d) {
1269
- const h = d(s);
1270
- i.push(...h), n.add(c);
1271
- }
1272
- }
1273
- }), i.filter(Boolean).join(" ");
1274
- };
1275
- function re(s) {
1276
- const t = {};
1277
- return s.forEach((e, r) => {
1278
- t[r] = e.value;
1279
- }), t;
1280
- }
1281
- function oe({ animatedProps: s, animationConfig: t, children: e }) {
1282
- const [r, o] = Z(
1283
- () => re(s)
1284
- );
1285
- A(() => {
1286
- const c = [];
1287
- return s.forEach((d, h) => {
1288
- const f = (m) => {
1289
- o((p) => ({
1290
- ...p,
1291
- [h]: m
1292
- }));
1293
- };
1294
- c.push(d.subscribe(f)), f(d.value);
1295
- }), () => {
1296
- c.forEach((d) => d());
1297
- };
1298
- }, [s]);
1299
- const i = [];
1300
- r.translateX !== void 0 && i.push(`translateX(${r.translateX}px)`), r.translateY !== void 0 && i.push(`translateY(${r.translateY}px)`), r.scale !== void 0 && i.push(`scale(${r.scale})`), r.rotate !== void 0 && i.push(`rotate(${r.rotate}deg)`);
1301
- const n = {};
1302
- if (i.length > 0 && (n.transform = i.join(" ")), t) {
1303
- const { duration: c = 300, curve: d = "easeOut", stiffness: h, damping: f } = t, m = v(d, { stiffness: h, damping: f });
1304
- n.transition = `transform ${c}ms ${m}`;
1305
- }
1306
- const a = {
1307
- ...e.props.style,
1308
- ...n
1309
- };
1310
- return yt(e, { style: a });
1311
- }
1312
- class k {
1313
- constructor(t, e, r = !1) {
1314
- l(this, "pseudoState");
1315
- l(this, "parentBuilder");
1316
- l(this, "isGroup");
1317
- l(this, "transitionDuration", 200);
1318
- l(this, "transitionEasing", "ease-in-out");
1319
- l(this, "transitionDelay", 0);
1320
- l(this, "transitionProperties", ["all"]);
1321
- l(this, "transforms", /* @__PURE__ */ new Map());
1322
- this.pseudoState = t, this.parentBuilder = e, this.isGroup = r;
1323
- }
1324
- bg(t) {
1325
- return this.set("background-color", t);
1326
- }
1327
- color(t) {
1328
- return this.set("color", t);
1329
- }
1330
- text(t) {
1331
- return this.color(t);
1332
- }
1333
- opacity(t) {
1334
- return this.set("opacity", String(t));
1335
- }
1336
- borderColor(t) {
1337
- return this.set("border-color", t);
1338
- }
1339
- transform(t) {
1340
- return this.transforms.set("raw", t), this.flushTransform();
1341
- }
1342
- scale(t) {
1343
- return this.transforms.set("scale", `scale(${t})`), this.flushTransform();
1344
- }
1345
- translateX(t) {
1346
- const e = typeof t == "number" ? `${t}px` : t;
1347
- return this.transforms.set("translateX", `translateX(${e})`), this.flushTransform();
1348
- }
1349
- translateY(t) {
1350
- const e = typeof t == "number" ? `${t}px` : t;
1351
- return this.transforms.set("translateY", `translateY(${e})`), this.flushTransform();
1352
- }
1353
- rotate(t) {
1354
- return this.transforms.set("rotate", `rotate(${t}deg)`), this.flushTransform();
1355
- }
1356
- shadow(t) {
1357
- return this.set("box-shadow", t);
1358
- }
1359
- css(t, e) {
1360
- return this.set(t, e);
1361
- }
1362
- transition(t, e, r, o) {
1363
- if (typeof t == "string" && e === void 0)
1364
- return this.set("transition", t);
1365
- const i = Array.isArray(t) ? t.join(", ") : t, n = `${e || this.transitionDuration}ms`, a = v(r || this.transitionEasing), c = o ? `${o}ms` : "0ms";
1366
- return this.set("transition", `${i} ${n} ${a} ${c}`);
1367
- }
1368
- duration(t) {
1369
- return this.transitionDuration = t, this.applyTransition(), this;
1370
- }
1371
- easing(t) {
1372
- return this.transitionEasing = v(t), this.applyTransition(), this;
1373
- }
1374
- ease(t) {
1375
- return this.easing(t);
1376
- }
1377
- delay(t) {
1378
- return this.transitionDelay = t, this.applyTransition(), this;
1379
- }
1380
- properties(t) {
1381
- return this.transitionProperties = t, this.applyTransition(), this;
1382
- }
1383
- applyTransition() {
1384
- const t = this.transitionProperties.join(", "), e = `${this.transitionDuration}ms`, r = this.transitionEasing, o = this.transitionDelay > 0 ? `${this.transitionDelay}ms` : "0ms";
1385
- this.set("transition", `${t} ${e} ${r} ${o}`);
1386
- }
1387
- flushTransform() {
1388
- return this.set("transform", [...this.transforms.values()].join(" "));
1389
- }
1390
- set(t, e) {
1391
- const r = u.registerPseudo(this.pseudoState, t, e, this.isGroup);
1392
- return this.parentBuilder.addClassName(r), this;
1393
- }
1394
- end() {
1395
- return this.parentBuilder;
1396
- }
1397
- }
1398
- function Te(s, t) {
1399
- if (typeof document > "u") return;
1400
- const e = typeof s == "string" ? s : null, r = (e == null ? void 0 : e.replace(/^#/, "")) ?? null;
1401
- t != null && t.hash && r && typeof window < "u" && (window.location.hash = r);
1402
- const o = typeof s == "string" ? document.getElementById(s.replace(/^#/, "")) ?? document.querySelector(s.startsWith("#") ? s : `#${s}`) ?? document.querySelector(s) : s;
1403
- o && o.scrollIntoView({
1404
- behavior: (t == null ? void 0 : t.behavior) ?? "smooth",
1405
- block: (t == null ? void 0 : t.block) ?? "start"
1406
- });
1407
- }
1408
- function Ie(s) {
1409
- const t = typeof document < "u" ? document : void 0, e = t == null ? void 0 : t.startViewTransition;
1410
- if (typeof e == "function") {
1411
- e.call(t, s);
1412
- return;
1413
- }
1414
- s();
1415
- }
1416
- function ie() {
1417
- return typeof CSS > "u" || typeof CSS.supports != "function" ? !1 : CSS.supports("animation-timeline", "view()");
1418
- }
1419
- function ne() {
1420
- return typeof CSS > "u" || typeof CSS.supports != "function" ? !1 : CSS.supports("animation-timeline", "scroll()");
1421
- }
1422
- function ae({
1423
- preset: s = "fadeUp",
1424
- once: t = !0,
1425
- rootMargin: e = "0px 0px -8% 0px",
1426
- threshold: r = 0.12,
1427
- forceMotion: o = !1,
1428
- preferTimeline: i = !1,
1429
- children: n
1430
- }) {
1431
- const a = w(null);
1432
- A(() => {
1433
- _();
1434
- const d = a.current;
1435
- if (!d) return;
1436
- if (i && ie()) {
1437
- d.classList.add("fibo-inview");
1438
- return;
1439
- }
1440
- if (typeof IntersectionObserver > "u") {
1441
- d.classList.add("fibo-inview");
1442
- return;
1443
- }
1444
- const h = new IntersectionObserver(
1445
- (f) => {
1446
- for (const m of f)
1447
- m.isIntersecting ? (m.target.classList.add("fibo-inview"), t && h.unobserve(m.target)) : t || m.target.classList.remove("fibo-inview");
1448
- },
1449
- { rootMargin: e, threshold: r }
1450
- );
1451
- return h.observe(d), () => h.disconnect();
1452
- }, [t, e, r, i]);
1453
- const c = [
1454
- "fibo-reveal",
1455
- `fibo-reveal-${s}`,
1456
- // min-w-0 only — do NOT force w-full (breaks horizontal ScrollView / carousel slides)
1457
- "min-w-0",
1458
- o ? "fibo-motion-force" : ""
1459
- ].filter(Boolean).join(" ");
1460
- return g.createElement("div", { ref: a, className: c, "data-fibo-reveal": s }, n);
1461
- }
1462
- function le({ children: s }) {
1463
- const t = w(null);
1464
- return A(() => {
1465
- if (_(), ne()) return;
1466
- const e = () => {
1467
- var i, n;
1468
- return ((i = t.current) == null ? void 0 : i.querySelector(".fibo-scroll-progress")) ?? ((n = t.current) == null ? void 0 : n.firstElementChild);
1469
- }, r = () => {
1470
- const o = e();
1471
- if (!o) return;
1472
- const i = document.documentElement.scrollHeight - window.innerHeight, n = i > 0 ? Math.min(1, Math.max(0, window.scrollY / i)) : 0;
1473
- o.style.setProperty("--fibo-progress", String(n));
1474
- };
1475
- return r(), window.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r), () => {
1476
- window.removeEventListener("scroll", r), window.removeEventListener("resize", r);
1477
- };
1478
- }, []), g.createElement(
1479
- "div",
1480
- { ref: t, "data-fibo-scroll-progress": "1", style: { display: "contents" } },
1481
- s
1482
- );
1483
- }
1484
- const ht = 64, ce = `${ht}px`;
1485
- class Re {
1486
- constructor() {
1487
- /** @internal Extra DOM props forwarded to the host element. */
1488
- l(this, "_props", {});
1489
- l(this, "_style", {});
1490
- l(this, "_cssStyles", {});
1491
- l(this, "_classNames", []);
1492
- l(this, "_children", []);
1493
- /** Resolved theme for this subtree (SwiftUI Environment / Flutter Theme). */
1494
- l(this, "_theme");
1495
- l(this, "_state", /* @__PURE__ */ new Map());
1496
- l(this, "_providers", /* @__PURE__ */ new Map());
1497
- l(this, "_observers", /* @__PURE__ */ new Set());
1498
- l(this, "_signals", /* @__PURE__ */ new Set());
1499
- l(this, "_isObserver", !1);
1500
- l(this, "_gesture");
1501
- l(this, "_animationConfig");
1502
- l(this, "_animatedProps", /* @__PURE__ */ new Map());
1503
- l(this, "_transforms", []);
1504
- l(this, "_transitionClass");
1505
- l(this, "_motionClass");
1506
- l(this, "_staggerMs");
1507
- l(this, "_reveal");
1508
- l(this, "_scrollProgress", !1);
1509
- l(this, "_viewTransition");
1510
- l(this, "_reducedMotion", "reduce");
1511
- l(this, "_usesCssMotion", !1);
1512
- l(this, "_explicitScrollMargin", !1);
1513
- /** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
1514
- l(this, "_hug", !1);
1515
- // Transition properties
1516
- l(this, "_transitionDuration", 200);
1517
- // ms
1518
- l(this, "_transitionEasing", "ease-in-out");
1519
- l(this, "_transitionDelay", 0);
1520
- // ms
1521
- l(this, "_transitionProperties", ["all"]);
1522
- l(this, "_childFunction");
1523
- }
1524
- hug() {
1525
- return this._hug = !0, this;
1526
- }
1527
- isHug() {
1528
- return this._hug;
1529
- }
1530
- id(t) {
1531
- return this._props.id = t, this;
1532
- }
1533
- /**
1534
- * Scroll target. Same as `.id()`, plus `scroll-margin-top` so the section
1535
- * is not hidden under a sticky header. Pair with `scrollTo('#name')`.
1536
- */
1537
- anchor(t) {
1538
- return this.id(t), this._explicitScrollMargin || this._classNames.push(
1539
- u.register("scroll-margin-top", "var(--fibo-sticky-offset, 0px)")
1540
- ), this;
1541
- }
1542
- /**
1543
- * Explicit `scroll-margin-top` on this node (overrides the sticky CSS variable
1544
- * that `.anchor()` applies).
1545
- */
1546
- scrollMargin(t) {
1547
- this._explicitScrollMargin = !0;
1548
- const e = typeof t == "number" ? `${t}px` : t;
1549
- return this._classNames.push(u.register("scroll-margin-top", e)), this;
1550
- }
1551
- /** Stamp a class onto the host. Used by PseudoStateBuilder (hashed `:hover` etc.). */
1552
- addClassName(t) {
1553
- return t && !this._classNames.includes(t) && this._classNames.push(t), this;
1554
- }
1555
- /**
1556
- * React list key. After this is called, React reads the key as a string
1557
- * on both the builder element and the inner host wrapper.
1558
- * Builders are valid elements — you do not need `.build()`.
1559
- */
1560
- key(t) {
1561
- this._props.key = t;
1562
- const e = this.__fiboElementProps;
1563
- return e && typeof e == "object" && (this.__fiboElementProps = { ...e, key: String(t) }), this;
1564
- }
1565
- paddingHorizontal(t) {
1566
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("padding-left", e), o = u.register("padding-right", e);
1567
- return this._classNames.push(r, o), this;
1568
- }
1569
- paddingVertical(t) {
1570
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("padding-top", e), o = u.register("padding-bottom", e);
1571
- return this._classNames.push(r, o), this;
1572
- }
1573
- marginHorizontal(t) {
1574
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("margin-left", e), o = u.register("margin-right", e);
1575
- return this._classNames.push(r, o), this;
1576
- }
1577
- marginVertical(t) {
1578
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("margin-top", e), o = u.register("margin-bottom", e);
1579
- return this._classNames.push(r, o), this;
1580
- }
1581
- flexDirection(t) {
1582
- return this._classNames.push(`flex-${t}`), this;
1583
- }
1584
- alignItems(t) {
1585
- return this._classNames.push(`items-${t}`), this;
1586
- }
1587
- justifyContent(t) {
1588
- return this._classNames.push(`justify-${t}`), this;
1589
- }
1590
- flex(t) {
1591
- if (this._classNames.push("flex"), t !== void 0)
1592
- if (typeof t == "number") {
1593
- const e = u.register("flex", String(t));
1594
- this._classNames.push(e);
1595
- } else typeof t == "string" && this._classNames.push(`flex-${t}`);
1596
- return this;
1597
- }
1598
- grid() {
1599
- return this._classNames.push("grid"), this;
1600
- }
1601
- inlineFlex() {
1602
- return this._classNames.push("inline-flex"), this;
1603
- }
1604
- inlineGrid() {
1605
- return this._classNames.push("inline-grid"), this;
1606
- }
1607
- block() {
1608
- return this._classNames.push("block"), this;
1609
- }
1610
- inlineBlock() {
1611
- return this._classNames.push("inline-block"), this;
1612
- }
1613
- hidden() {
1614
- return this._classNames.push("hidden"), this;
1615
- }
1616
- center() {
1617
- return this._classNames.push("flex", "items-center", "justify-center"), this;
1618
- }
1619
- centerX() {
1620
- return this._classNames.push("flex", "justify-center"), this;
1621
- }
1622
- centerY() {
1623
- return this._classNames.push("flex", "items-center"), this;
1624
- }
1625
- spaceBetween() {
1626
- return this._classNames.push("justify-between"), this;
1627
- }
1628
- spaceAround() {
1629
- return this._classNames.push("justify-around"), this;
1630
- }
1631
- spaceEvenly() {
1632
- return this._classNames.push("justify-evenly"), this;
1633
- }
1634
- fill() {
1635
- return this._classNames.push("w-full", "h-full"), this;
1636
- }
1637
- fillWidth() {
1638
- return this._classNames.push("w-full"), this;
1639
- }
1640
- fillHeight() {
1641
- return this._classNames.push("h-full"), this;
1642
- }
1643
- square(t) {
1644
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("width", e), o = u.register("height", e);
1645
- return this._classNames.push(r, o), this;
1646
- }
1647
- circle() {
1648
- return this._classNames.push("rounded-full"), this;
1649
- }
1650
- opacity(t) {
1651
- const e = u.register("opacity", String(t));
1652
- return this._classNames.push(e), this;
1653
- }
1654
- p(t) {
1655
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("padding", e);
1656
- return this._classNames.push(r), this;
1657
- }
1658
- px(t) {
1659
- return this.paddingHorizontal(t);
1660
- }
1661
- py(t) {
1662
- return this.paddingVertical(t);
1663
- }
1664
- paddingX(t) {
1665
- return this.paddingHorizontal(t);
1666
- }
1667
- paddingY(t) {
1668
- return this.paddingVertical(t);
1669
- }
1670
- m(t) {
1671
- const e = typeof t == "number" ? `${t}px` : t, r = u.register("margin", e);
1672
- return this._classNames.push(r), this;
1673
- }
1674
- mx(t) {
1675
- return this.marginHorizontal(t);
1676
- }
1677
- my(t) {
1678
- return this.marginVertical(t);
1679
- }
1680
- marginX(t) {
1681
- return this.marginHorizontal(t);
1682
- }
1683
- marginY(t) {
1684
- return this.marginVertical(t);
1685
- }
1686
- bg(t) {
1687
- const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t, r = u.register("background-color", e);
1688
- return this._classNames.push(r), this;
1689
- }
1690
- text(t) {
1691
- const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t, r = u.register("color", e);
1692
- return this._classNames.push(r), this;
1693
- }
1694
- color(t) {
1695
- const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t, r = u.register("color", e);
1696
- return this._classNames.push(r), this;
1697
- }
1698
- resolveSemanticColor(t) {
1699
- return [
1700
- "primary",
1701
- "on-primary",
1702
- "primary-container",
1703
- "on-primary-container",
1704
- "secondary",
1705
- "on-secondary",
1706
- "secondary-container",
1707
- "on-secondary-container",
1708
- "tertiary",
1709
- "on-tertiary",
1710
- "tertiary-container",
1711
- "on-tertiary-container",
1712
- "error",
1713
- "on-error",
1714
- "background",
1715
- "on-background",
1716
- "surface",
1717
- "on-surface",
1718
- "surface-variant",
1719
- "on-surface-variant",
1720
- "outline"
1721
- ].includes(t) ? `var(--fibo-${t})` : t;
1722
- }
1723
- shadow(t) {
1724
- if (t === null || t === "none") {
1725
- const i = u.register("box-shadow", "none");
1726
- return this._classNames.push(i), this;
1727
- }
1728
- const e = {
1729
- sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
1730
- md: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
1731
- lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
1732
- xl: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)",
1733
- "2xl": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
1734
- card: "0 2px 8px rgba(0, 0, 0, 0.1)",
1735
- button: "0 2px 4px rgba(0, 0, 0, 0.12)",
1736
- modal: "0 10px 40px rgba(0, 0, 0, 0.2)",
1737
- float: "0 8px 16px rgba(0, 0, 0, 0.15)",
1738
- inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"
1739
- }, r = (i) => i.startsWith("#") || i.startsWith("rgb") || i.startsWith("hsl") || ["red", "blue", "green", "yellow", "purple", "pink", "orange", "white", "black", "gray"].some((n) => i.includes(n)), o = (i, n, a, c) => {
1740
- let f = a || "rgba(0, 0, 0, " + (c ?? 0.1) + ")";
1741
- if (a && a.startsWith("#") && c !== void 0) {
1742
- const y = parseInt(a.slice(1, 3), 16), b = parseInt(a.slice(3, 5), 16), x = parseInt(a.slice(5, 7), 16);
1743
- f = `rgba(${y}, ${b}, ${x}, ${c})`;
1744
- }
1745
- const p = {
1746
- sm: "2px",
1747
- md: "4px",
1748
- lg: "8px",
1749
- xl: "12px",
1750
- "2xl": "16px"
1751
- }[n] || "4px";
1752
- switch (i) {
1753
- case "top":
1754
- return `0 -${p} ${p} -1px ${f}`;
1755
- case "bottom":
1756
- return `0 ${p} ${p} -1px ${f}`;
1757
- case "left":
1758
- return `-${p} 0 ${p} -1px ${f}`;
1759
- case "right":
1760
- return `${p} 0 ${p} -1px ${f}`;
1761
- case "top-bottom":
1762
- case "vertical":
1763
- return `0 -${p} ${p} -1px ${f}, 0 ${p} ${p} -1px ${f}`;
1764
- case "left-right":
1765
- case "horizontal":
1766
- return `-${p} 0 ${p} -1px ${f}, ${p} 0 ${p} -1px ${f}`;
1767
- case "all":
1768
- default:
1769
- return e[n] || e.md;
1770
- }
1771
- };
1772
- if (!t) {
1773
- const i = u.register("box-shadow", e.md);
1774
- return this._classNames.push(i), this;
1775
- }
1776
- if (typeof t == "string") {
1777
- if (r(t)) {
1778
- const a = o("all", "md", t), c = u.register("box-shadow", a);
1779
- return this._classNames.push(c), this;
1780
- }
1781
- const i = e[t] || e.md, n = u.register("box-shadow", i);
1782
- return this._classNames.push(n), this;
1783
- }
1784
- if (Array.isArray(t)) {
1785
- const [i, n, a, c] = t;
1786
- if (typeof i == "string" && r(i)) {
1787
- const f = o("all", "md", i, n), m = u.register("box-shadow", f);
1788
- return this._classNames.push(m), this;
1789
- }
1790
- const d = i;
1791
- if (typeof n == "string" && r(n)) {
1792
- const f = o(d, "md", n, a), m = u.register("box-shadow", f);
1793
- return this._classNames.push(m), this;
1794
- } else {
1795
- const m = o(d, n, a, c), p = u.register("box-shadow", m);
1796
- return this._classNames.push(p), this;
1797
- }
1798
- }
1799
- return this;
1800
- }
1801
- /**
1802
- * Breakpoint styles compiled to CSS `@media` (same engine as `.md()`).
1803
- * Tiers stay mutually exclusive: mobile `<768`, tablet `768–1023`, desktop `≥1024`.
1804
- * No `window.innerWidth` — hydrate-safe.
1805
- */
1806
- responsive(t) {
1807
- return this.registerMediaStyles("(max-width: 767px)", t.mobile), this.registerMediaStyles("(min-width: 768px) and (max-width: 1023px)", t.tablet), this.registerMediaStyles("(min-width: 1024px)", t.desktop), this;
1808
- }
1809
- /**
1810
- * CSS `@media` (min-width or a raw query). Compiles to a class — no resize JS.
1811
- *
1812
- * @example Box().padding(8).media('md', { padding: 16 }).media('(prefers-color-scheme: dark)', { backgroundColor: '#111' })
1813
- */
1814
- media(t, e) {
1815
- return this.registerMediaStyles(Yt(t), e), this;
1816
- }
1817
- registerMediaStyles(t, e) {
1818
- if (!e) return;
1819
- const r = /* @__PURE__ */ new Set([
1820
- "opacity",
1821
- "zIndex",
1822
- "z-index",
1823
- "flex",
1824
- "flexGrow",
1825
- "flexShrink",
1826
- "order",
1827
- "fontWeight",
1828
- "lineHeight"
1829
- ]);
1830
- for (const [o, i] of Object.entries(e)) {
1831
- if (i == null) continue;
1832
- const n = o.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`), a = typeof i == "number" && !r.has(o) && !r.has(n) ? `${i}px` : String(i);
1833
- this._classNames.push(u.registerMedia(t, n, a));
1834
- }
1835
- }
1836
- sm(t) {
1837
- return this.media("sm", t);
1838
- }
1839
- md(t) {
1840
- return this.media("md", t);
1841
- }
1842
- lg(t) {
1843
- return this.media("lg", t);
1844
- }
1845
- xl(t) {
1846
- return this.media("xl", t);
1847
- }
1848
- rounded(t) {
1849
- if (typeof t == "number") {
1850
- const e = u.register("border-radius", `${t}px`);
1851
- this._classNames.push(e);
1852
- } else if (typeof t == "string" && (t.startsWith("rounded-") || ["sm", "md", "lg", "xl", "2xl", "3xl", "full", "none"].includes(t))) {
1853
- const e = t.startsWith("rounded-") ? t : `rounded-${t}`;
1854
- this._classNames.push(e);
1855
- } else {
1856
- const e = u.register("border-radius", t);
1857
- this._classNames.push(e);
1858
- }
1859
- return this;
1860
- }
1861
- borderRadius(t) {
1862
- if (typeof t == "number") {
1863
- const e = u.register("border-radius", `${t}px`);
1864
- this._classNames.push(e);
1865
- } else {
1866
- const e = u.register("border-radius", t);
1867
- this._classNames.push(e);
1868
- }
1869
- return this;
1870
- }
1871
- borderColor(t) {
1872
- if (t.startsWith("border-"))
1873
- this._classNames.push(t);
1874
- else if (["red", "blue", "green", "gray", "white", "black", "transparent"].some((e) => t.includes(e)))
1875
- this._classNames.push(`border-${t}`);
1876
- else {
1877
- const e = u.register("border-color", t);
1878
- this._classNames.push(e);
1879
- }
1880
- return this;
1881
- }
1882
- width(t) {
1883
- if (typeof t == "number") {
1884
- const e = u.register("width", `${t}px`);
1885
- this._classNames.push(e);
1886
- } else if (typeof t == "string" && (t.startsWith("w-") || t === "full" || t === "screen" || t === "min" || t === "max" || t === "fit")) {
1887
- const e = t.startsWith("w-") ? t : `w-${t}`;
1888
- this._classNames.push(e);
1889
- } else {
1890
- const e = u.register("width", t);
1891
- this._classNames.push(e);
1892
- }
1893
- return this;
1894
- }
1895
- height(t) {
1896
- if (typeof t == "number") {
1897
- const e = u.register("height", `${t}px`);
1898
- this._classNames.push(e);
1899
- } else if (typeof t == "string" && (t.startsWith("h-") || t === "full" || t === "screen" || t === "min" || t === "max" || t === "fit")) {
1900
- const e = t.startsWith("h-") ? t : `h-${t}`;
1901
- this._classNames.push(e);
1902
- } else {
1903
- const e = u.register("height", t);
1904
- this._classNames.push(e);
1905
- }
1906
- return this;
1907
- }
1908
- gap(t) {
1909
- if (typeof t == "number") {
1910
- const e = u.register("gap", `${t}px`);
1911
- this._classNames.push(e);
1912
- } else if (typeof t == "string" && t.startsWith("gap-"))
1913
- this._classNames.push(t);
1914
- else {
1915
- const e = u.register("gap", t);
1916
- this._classNames.push(e);
1917
- }
1918
- return this;
1919
- }
1920
- clean() {
1921
- return this._classNames.push(
1922
- "[&_input]:outline-none",
1923
- "[&_input]:ring-0",
1924
- "[&_input]:border-none",
1925
- "[&_input]:!shadow-none",
1926
- "[&_input]:bg-transparent",
1927
- "[&_input]:h-full",
1928
- "[&_input]:w-full",
1929
- "[&_input]:p-0",
1930
- "[&_textarea]:outline-none",
1931
- "[&_textarea]:ring-0",
1932
- "[&_textarea]:border-none",
1933
- "[&_textarea]:!shadow-none",
1934
- "[&_textarea]:bg-transparent",
1935
- "[&_textarea]:h-full",
1936
- "[&_textarea]:w-full",
1937
- "[&_textarea]:p-0",
1938
- "[&_select]:outline-none",
1939
- "[&_select]:ring-0",
1940
- "[&_select]:border-none",
1941
- "[&_select]:!shadow-none",
1942
- "[&_select]:bg-transparent",
1943
- "[&_select]:h-full",
1944
- "[&_select]:w-full",
1945
- "[&_select]:p-0",
1946
- "[&_.fibo-textfield-input]:outline-none",
1947
- "[&_.fibo-textfield-input]:ring-0",
1948
- "[&_.fibo-textfield-input]:border-none",
1949
- "[&_.fibo-textfield-input]:!shadow-none",
1950
- "[&_.fibo-textfield-input]:bg-transparent",
1951
- "[&_.fibo-textfield-input]:h-full",
1952
- "[&_.fibo-textfield-input]:w-full",
1953
- "[&_.fibo-textfield-input]:p-0",
1954
- "[&_.fibo-textarea-input]:outline-none",
1955
- "[&_.fibo-textarea-input]:ring-0",
1956
- "[&_.fibo-textarea-input]:border-none",
1957
- "[&_.fibo-textarea-input]:!shadow-none",
1958
- "[&_.fibo-textarea-input]:bg-transparent",
1959
- "[&_.fibo-textarea-input]:h-full",
1960
- "[&_.fibo-textarea-input]:w-full",
1961
- "[&_.fibo-textarea-input]:p-0",
1962
- "[&>div]:h-full"
1963
- ), this;
1964
- }
1965
- borderInput(t = "gray-300", e = "blue-500") {
1966
- const r = (n) => ["red", "blue", "green", "yellow", "purple", "pink", "indigo", "gray", "orange", "teal", "cyan", "emerald", "lime", "amber", "fuchsia", "rose", "violet", "sky", "slate", "zinc", "neutral", "stone"].includes(n) ? `${n}-500` : n, o = r(t), i = r(e);
1967
- return this._classNames.push(
1968
- "border",
1969
- `border-${o}`,
1970
- "focus-within:ring-2",
1971
- `focus-within:ring-${i}`,
1972
- `focus-within:border-${i}`
1973
- ), this.clean();
1974
- }
1975
- weight(t) {
1976
- if (typeof t == "number") {
1977
- const e = u.register("font-weight", String(t));
1978
- this._classNames.push(e);
1979
- } else {
1980
- const e = {
1981
- thin: "font-thin",
1982
- extralight: "font-extralight",
1983
- light: "font-light",
1984
- normal: "font-normal",
1985
- medium: "font-medium",
1986
- semibold: "font-semibold",
1987
- bold: "font-bold",
1988
- extrabold: "font-extrabold",
1989
- black: "font-black"
1990
- };
1991
- if (e[t])
1992
- this._classNames.push(e[t]);
1993
- else {
1994
- const r = u.register("font-weight", t);
1995
- this._classNames.push(r);
1996
- }
1997
- }
1998
- return this;
1999
- }
2000
- onClick(t) {
2001
- return this._props.onClick = t, this;
2002
- }
2003
- state(t, e) {
2004
- return this._state.set(t, e), this;
2005
- }
2006
- getState(t) {
2007
- return this._state.get(t);
2008
- }
2009
- setState(t, e) {
2010
- return this._state.set(t, e), this;
2011
- }
2012
- provide(t, e) {
2013
- return this._providers.set(t, e), this;
2014
- }
2015
- consume(t) {
2016
- return this._providers.get(t);
2017
- }
2018
- observer(t) {
2019
- return this._isObserver = !0, typeof t == "object" && t !== null ? t.key !== void 0 && this.key(t.key) : t !== void 0 && this.key(t), this;
2020
- }
2021
- observe(t) {
2022
- return this._observers.add(t), this;
2023
- }
2024
- bindSignal(t) {
2025
- return this._signals.add(t), this;
2026
- }
2027
- translateX(t) {
2028
- return t instanceof R ? this._animatedProps.set("translateX", t) : this._transforms.push(`translateX(${t}px)`), this;
2029
- }
2030
- translateY(t) {
2031
- return t instanceof R ? this._animatedProps.set("translateY", t) : this._transforms.push(`translateY(${t}px)`), this;
2032
- }
2033
- scale(t) {
2034
- return t instanceof R ? this._animatedProps.set("scale", t) : this._transforms.push(`scale(${t})`), this;
2035
- }
2036
- rotate(t) {
2037
- return t instanceof R ? this._animatedProps.set("rotate", t) : this._transforms.push(`rotate(${t}deg)`), this;
2038
- }
2039
- gesture(t) {
2040
- return this._gesture = t, this;
2041
- }
2042
- animation(t) {
2043
- return this._animationConfig = t, this;
2044
- }
2045
- hasStateManagement() {
2046
- return this._state.size > 0 || this._providers.size > 0 || this._observers.size > 0 || this._signals.size > 0 || this._isObserver || this._animatedProps.size > 0;
2047
- }
2048
- className(t) {
2049
- return this._classNames.push(t), this;
2050
- }
2051
- classNames(t) {
2052
- return this._classNames.push(...t), this;
2053
- }
2054
- css(t) {
2055
- return this._cssStyles = { ...this._cssStyles, ...t }, this;
2056
- }
2057
- style(t) {
2058
- return this._style = { ...this._style, ...t }, this;
2059
- }
2060
- props(t) {
2061
- return this._props = { ...this._props, ...t }, this;
2062
- }
2063
- transition(t, e, r, o) {
2064
- if (typeof t == "string" && e === void 0)
2065
- return this.replaceTransitionClass(u.register("transition", t)), this;
2066
- const i = Array.isArray(t) ? t.join(", ") : t, n = `${e || this._transitionDuration}ms`, a = v(r || this._transitionEasing), c = o ? `${o}ms` : "0ms";
2067
- return this.replaceTransitionClass(u.register("transition", `${i} ${n} ${a} ${c}`)), this;
2068
- }
2069
- /**
2070
- * Set transition duration in milliseconds
2071
- * Example: .duration(200) → 200ms
2072
- */
2073
- duration(t) {
2074
- return this._transitionDuration = t, this._motionClass ? (this._style["--fibo-dur"] = `${t}ms`, this) : (this._applyTransition(), this);
2075
- }
2076
- /**
2077
- * Set transition easing function
2078
- * Example: .easing('ease-in-out')
2079
- */
2080
- easing(t) {
2081
- return this._transitionEasing = v(t), this._motionClass ? (this._style["--fibo-ease"] = this._transitionEasing, this) : (this._applyTransition(), this);
2082
- }
2083
- /** Alias of `.easing()`. `'spring'` becomes CSS `linear()`. */
2084
- ease(t) {
2085
- return this.easing(t);
2086
- }
2087
- /**
2088
- * Set transition delay in milliseconds
2089
- * Example: .delay(100) → 100ms delay
2090
- */
2091
- delay(t) {
2092
- return this._transitionDelay = t, this._motionClass ? (this._style["--fibo-delay"] = `${t}ms`, this) : (this._applyTransition(), this);
2093
- }
2094
- /**
2095
- * Set which properties to transition
2096
- * Example: .properties(['color', 'transform'])
2097
- */
2098
- properties(t) {
2099
- return this._transitionProperties = t, this._applyTransition(), this;
2100
- }
2101
- /**
2102
- * Apply the built transition to the element
2103
- */
2104
- _applyTransition() {
2105
- const t = this._transitionProperties.join(", "), e = `${this._transitionDuration}ms`, r = this._transitionEasing, o = this._transitionDelay > 0 ? `${this._transitionDelay}ms` : "0ms";
2106
- this.replaceTransitionClass(u.register("transition", `${t} ${e} ${r} ${o}`));
2107
- }
2108
- replaceTransitionClass(t) {
2109
- this._transitionClass && (this._classNames = this._classNames.filter((e) => e !== this._transitionClass)), this._transitionClass = t, this._classNames.push(t);
2110
- }
2111
- animate(t, e) {
2112
- _(), this._usesCssMotion = !0, this._motionClass && (this._classNames = this._classNames.filter((h) => h !== this._motionClass));
2113
- const r = Bt(t), o = (r ? t.duration : e == null ? void 0 : e.duration) ?? this._transitionDuration, i = (r ? t.delay : e == null ? void 0 : e.delay) ?? this._transitionDelay;
2114
- let n = r ? t.ease : e == null ? void 0 : e.ease;
2115
- const a = {
2116
- stiffness: (r ? t.stiffness : e == null ? void 0 : e.stiffness) ?? void 0,
2117
- damping: (r ? t.damping : e == null ? void 0 : e.damping) ?? void 0,
2118
- mass: (r ? t.mass : e == null ? void 0 : e.mass) ?? void 0
2119
- };
2120
- if (r) {
2121
- const h = G(t.from), f = G(t.to), m = u.registerKeyframes(Wt(`${h}=>${f}`), h, f);
2122
- this._motionClass = `fibo-anim ${m}`, this._props["data-fibo-anim"] = "custom";
2123
- } else {
2124
- const h = Ht(t);
2125
- this._motionClass = `fibo-anim fibo-anim-${h}`, this._props["data-fibo-anim"] = h, (e == null ? void 0 : e.from) !== void 0 && (this._style["--fibo-from"] = typeof e.from == "number" ? `${e.from}px` : e.from), !n && h === "pop" && (n = "spring");
2126
- }
2127
- const c = v(n ?? "ease", a);
2128
- this._classNames.push(this._motionClass);
2129
- const d = this._style;
2130
- return d["--fibo-dur"] = `${o}ms`, d["--fibo-ease"] = c, d["--fibo-delay"] = `${i}ms`, this._reducedMotion === "never" && !this._classNames.includes("fibo-motion-force") && this._classNames.push("fibo-motion-force"), this;
2131
- }
2132
- /** CSS `linear()` spring. Works on `.animate()` and `.transition()` / `.hover()`. */
2133
- spring(t) {
2134
- const e = it(t);
2135
- return this._transitionEasing = e, this._motionClass ? (this._style["--fibo-ease"] = e, this) : (this._applyTransition(), this);
2136
- }
2137
- reducedMotion(t = "reduce") {
2138
- return this._reducedMotion = t, t === "never" && !this._classNames.includes("fibo-motion-force") && this._classNames.push("fibo-motion-force"), this;
2139
- }
2140
- press(t) {
2141
- return this.ensureInteractiveTransition(), t ? (this.active(t), this) : (this.active((e) => {
2142
- e.scale(0.97);
2143
- }), this);
2144
- }
2145
- focusVisible(t) {
2146
- const e = new k("focus-visible", this);
2147
- return t ? (t(e), this) : e;
2148
- }
2149
- stagger(t) {
2150
- return this._staggerMs = t, this._usesCssMotion = !0, this._style["--fibo-stagger"] = `${t}ms`, _(), this;
2151
- }
2152
- /** Scroll-reveal: IntersectionObserver toggles `.fibo-inview`. */
2153
- reveal(t = "fadeUp") {
2154
- return this._reveal = typeof t == "string" ? { preset: t, once: !0 } : { preset: "fadeUp", once: !0, ...t }, this._usesCssMotion = !0, _(), this;
2155
- }
2156
- /** Alias of `.reveal()` for scroll-triggered presets. */
2157
- onScroll(t = "fadeIn") {
2158
- return this.reveal(t);
2159
- }
2160
- /** CSS `animation-timeline: view()` / `scroll()`; IntersectionObserver reveal is the fallback. */
2161
- scrollTimeline(t = "view") {
2162
- return _(), this._classNames.push(t === "scroll" ? "fibo-scroll-timeline" : "fibo-view-timeline"), this._usesCssMotion = !0, t === "view" && !this._reveal && (this._reveal = { preset: "fadeUp", once: !0 }), this;
2163
- }
2164
- scrollProgress() {
2165
- return _(), this._scrollProgress = !0, this._classNames.push("fibo-scroll-progress"), this._usesCssMotion = !0, this;
2166
- }
2167
- smoothScroll() {
2168
- return this._classNames.push(u.register("scroll-behavior", "smooth")), this;
2169
- }
2170
- scrollSnap(t = "y") {
2171
- return _(), this._classNames.push(`fibo-snap-${t}`), this;
2172
- }
2173
- scrollSnapAlign(t = "start") {
2174
- return _(), this._classNames.push(`fibo-snap-${t}`), this;
2175
- }
2176
- sticky(t = 0) {
2177
- if (t === !1) return this;
2178
- this._classNames.push(u.register("position", "sticky"));
2179
- const e = t === !0 ? "0px" : typeof t == "number" ? `${t}px` : t;
2180
- this._classNames.push(u.register("top", e));
2181
- const r = t === !0 || t === 0 ? ce : typeof t == "number" ? `${Math.max(t, ht)}px` : t;
2182
- return this.publishStickyOffset(r), this;
2183
- }
2184
- /**
2185
- * Publish `--fibo-sticky-offset` on `:root` so `.anchor()` / `html` scroll-padding
2186
- * clear this bar. Header uses the real bar height.
2187
- */
2188
- publishStickyOffset(t) {
2189
- const e = typeof t == "number" ? `${t}px` : t;
2190
- u.registerRoot("--fibo-sticky-offset", e), u.ensureScrollPadding();
2191
- }
2192
- viewTransition(t) {
2193
- return this._viewTransition = t, this._style.viewTransitionName = t, this;
2194
- }
2195
- /** Default `:focus-visible` ring. Pass a callback to customize. */
2196
- focusRing(t = "var(--fibo-primary)") {
2197
- return this.focusVisible((e) => {
2198
- e.css("outline", `2px solid ${t}`), e.css("outline-offset", "2px");
2199
- }), this;
2200
- }
2201
- ensureInteractiveTransition() {
2202
- this._transitionClass || this._motionClass || this.replaceTransitionClass(
2203
- u.register(
2204
- "transition",
2205
- `transform ${this._transitionDuration}ms ${this._transitionEasing}, opacity ${this._transitionDuration}ms ${this._transitionEasing}`
2206
- )
2207
- );
2208
- }
2209
- /**
2210
- * Apply a theme to this node and descendants (CSS vars inherit).
2211
- * Fluent: `.theme("noir")` | `.theme(noirTheme)` | `.theme(extendTheme(webTheme, {…}))`.
2212
- * SSR-safe: class + inline vars on first paint (no useEffect).
2213
- */
2214
- theme(t) {
2215
- const e = kt(t);
2216
- return this._theme = e, this.addClassName(_t(e)), this;
2217
- }
2218
- /** Prefer dark/light system chrome for native controls under this subtree. */
2219
- colorScheme(t) {
2220
- return this._style = { ...this._style, colorScheme: t }, this;
2221
- }
2222
- hover(t) {
2223
- this.ensureInteractiveTransition();
2224
- const e = new k("hover", this);
2225
- return t ? (t(e), this) : e;
2226
- }
2227
- focus(t) {
2228
- const e = new k("focus", this);
2229
- return t ? (t(e), this) : e;
2230
- }
2231
- active(t) {
2232
- const e = new k("active", this);
2233
- return t ? (t(e), this) : e;
2234
- }
2235
- visited(t) {
2236
- const e = new k("visited", this);
2237
- return t ? (t(e), this) : e;
2238
- }
2239
- disabledState(t) {
2240
- const e = new k("disabled", this);
2241
- return t ? (t(e), this) : e;
2242
- }
2243
- focusWithin(t) {
2244
- const e = new k("focus-within", this);
2245
- return t ? (t(e), this) : e;
2246
- }
2247
- firstChild(t) {
2248
- const e = new k("first-child", this);
2249
- return t ? (t(e), this) : e;
2250
- }
2251
- lastChild(t) {
2252
- const e = new k("last-child", this);
2253
- return t ? (t(e), this) : e;
2254
- }
2255
- groupHover(t) {
2256
- const e = new k("hover", this, !0);
2257
- return t ? (t(e), this) : e;
2258
- }
2259
- groupFocus(t) {
2260
- const e = new k("focus", this, !0);
2261
- return t ? (t(e), this) : e;
2262
- }
2263
- groupActive(t) {
2264
- const e = new k("active", this, !0);
2265
- return t ? (t(e), this) : e;
2266
- }
2267
- groupFocusWithin(t) {
2268
- const e = new k("focus-within", this, !0);
2269
- return t ? (t(e), this) : e;
2270
- }
2271
- group() {
2272
- return this._classNames.push("group"), this;
2273
- }
2274
- children(t) {
2275
- return typeof t == "function" ? (this._childFunction = t, this._children = []) : (this._children = K(t), this._childFunction = void 0), this;
2276
- }
2277
- getClassName() {
2278
- let t;
2279
- return Object.keys(this._cssStyles).length > 0 && (t = se(this._cssStyles) || void 0), Ut(this._classNames, t);
2280
- }
2281
- getStyle() {
2282
- let t = { ...this._style, ...this._cssStyles };
2283
- if (this._theme && (t = {
2284
- ...xt(this._theme),
2285
- ...t,
2286
- backgroundColor: t.backgroundColor ?? this._theme.colors.background,
2287
- color: t.color ?? this._theme.colors.onBackground,
2288
- fontFamily: t.fontFamily ?? this._theme.fontFamily
2289
- }), this._transforms.length > 0) {
2290
- const e = t.transform || "";
2291
- t.transform = e ? `${e} ${this._transforms.join(" ")}` : this._transforms.join(" ");
2292
- }
2293
- if (this._animationConfig && this._animatedProps.size === 0) {
2294
- const { duration: e = 300, curve: r = "easeOut", stiffness: o, damping: i } = this._animationConfig, n = v(r, { stiffness: o, damping: i });
2295
- t.transition = `all ${e}ms ${n}`;
2296
- }
2297
- return t;
2298
- }
2299
- processChildren() {
2300
- const t = this._childFunction ? K(this._childFunction) : this._children;
2301
- return this._staggerMs == null ? t : t.map(
2302
- (e, r) => g.createElement(
2303
- "span",
2304
- {
2305
- key: g.isValidElement(e) && H(e.key) ? e.key : `fibo-stagger-${r}`,
2306
- className: "fibo-stagger-item",
2307
- style: { "--fibo-i": String(r) }
2308
- },
2309
- e
2310
- )
2311
- );
2312
- }
2313
- getChildFunction() {
2314
- return this._childFunction;
2315
- }
2316
- }
2317
- const he = /* @__PURE__ */ new Set([
2318
- "$$typeof",
2319
- "type",
2320
- "props",
2321
- "ref",
2322
- "_owner",
2323
- "_store",
2324
- "_self",
2325
- "_source",
2326
- "_debugStack",
2327
- "_debugTask",
2328
- "_debugInfo"
2329
- ]);
2330
- function ue(s) {
2331
- var e;
2332
- const t = (e = s._props) == null ? void 0 : e.key;
2333
- if (!(t == null || t === ""))
2334
- return t;
2335
- }
2336
- function fe(s) {
2337
- const t = s._isObserver, e = s._signals, r = s._observers, o = s._state, i = s._providers, n = ue(s), a = () => {
2338
- var S;
2339
- let m = s.build();
2340
- const p = s._animatedProps, y = s._animationConfig;
2341
- p && p.size > 0 && (m = g.createElement(oe, {
2342
- key: n,
2343
- animatedProps: p,
2344
- animationConfig: y,
2345
- children: m
2346
- }));
2347
- const b = s._reveal;
2348
- b && (m = g.createElement(ae, {
2349
- key: n,
2350
- preset: b.preset,
2351
- once: b.once,
2352
- rootMargin: b.rootMargin,
2353
- threshold: b.threshold,
2354
- forceMotion: s._reducedMotion === "never",
2355
- preferTimeline: (S = s._classNames) == null ? void 0 : S.includes("fibo-view-timeline"),
2356
- children: m
2357
- })), s._scrollProgress && (m = g.createElement(le, { key: n, children: m })), s._usesCssMotion && (m = g.createElement(
2358
- g.Fragment,
2359
- { key: n },
2360
- g.createElement(Xt),
2361
- m
2362
- ));
2363
- const x = s._gesture;
2364
- return x && (m = x.wrap(m)), m;
2365
- }, c = typeof s.hasStateManagement == "function" ? s.hasStateManagement() : !!(t || e && e.size || r && r.size || o && o.size || i && i.size), d = t ? g.createElement(Tt, {
2366
- key: n,
2367
- children: a
2368
- }) : null, h = () => d ?? a();
2369
- let f = h();
2370
- return c && e && e.size > 0 ? f = g.createElement(jt, {
2371
- key: n,
2372
- signals: e,
2373
- children: h
2374
- }) : c && r && r.size > 0 && (f = g.createElement(zt, {
2375
- key: n,
2376
- observables: r,
2377
- children: h
2378
- })), c && o && o.size > 0 && (f = g.createElement(Rt, {
2379
- key: n,
2380
- stateMap: o,
2381
- children: f
2382
- })), c && i && i.size > 0 && (f = g.createElement(At, {
2383
- key: n,
2384
- providers: i,
2385
- children: f
2386
- })), f;
2387
- }
2388
- function ut(s, t, e) {
2389
- const r = function() {
2390
- return t();
2391
- };
2392
- r.displayName = e;
2393
- const o = g.createElement(r);
2394
- Object.defineProperty(s, "$$typeof", {
2395
- value: o.$$typeof,
2396
- enumerable: !0,
2397
- configurable: !0
2398
- }), Object.defineProperty(s, "type", {
2399
- value: r,
2400
- enumerable: !0,
2401
- configurable: !0,
2402
- writable: !0
2403
- }), s.ref = o.ref ?? null, s.__fiboElementProps = o.props ?? {}, o._owner !== void 0 && (s._owner = o._owner), s._store = { validated: 1 };
2404
- }
2405
- function ze(s) {
2406
- return (...t) => {
2407
- const e = new s(...t), r = s.name.replace(/Builder$/, "") || "Fibo", o = () => fe(e);
2408
- return ut(e, o, r), new Proxy(e, {
2409
- get(i, n, a) {
2410
- var c, d;
2411
- if (n === "build")
2412
- return o;
2413
- if (n === "key") {
2414
- const h = (c = i._props) == null ? void 0 : c.key;
2415
- if (h != null && h !== "")
2416
- return String(h);
2417
- if (!i.__fiboKeyFn) {
2418
- const f = (m) => (i.key(m), a);
2419
- i.__fiboKeyFn = f;
2420
- }
2421
- return i.__fiboKeyFn;
2422
- }
2423
- if (n === "props") {
2424
- const h = (d = i._props) == null ? void 0 : d.key, f = {
2425
- ...i.__fiboElementProps ?? {},
2426
- ...h != null && h !== "" ? { key: String(h) } : {}
2427
- }, m = Object.getPrototypeOf(i).props;
2428
- return typeof m == "function" ? Object.assign((y) => (m.call(i, y), a), f) : f;
2429
- }
2430
- return he.has(n) || Reflect.has(i, n) ? Reflect.get(i, n, a) : (h) => {
2431
- const f = n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), p = ["opacity", "z-index", "flex", "flex-grow", "flex-shrink", "order", "font-weight", "line-height"].includes(f), y = typeof h == "number" && !p ? `${h}px` : String(h), b = u.register(f, y);
2432
- return i.className(b), a;
2433
- };
2434
- }
2435
- });
2436
- };
2437
- }
2438
- const de = ({
2439
- signal: s,
2440
- builder: t,
2441
- loading: e,
2442
- error: r
2443
- }) => {
2444
- const o = g.useSyncExternalStore(
2445
- g.useCallback((a) => s.subscribe ? s.subscribe(a) : () => {
2446
- }, [s]),
2447
- () => s.value
2448
- ), i = o == null ? void 0 : o.error;
2449
- return i && r ? r(i) : ((o == null ? void 0 : o.isLoading) || (o == null ? void 0 : o.loading)) === !0 && e ? e() : t ? t(o) : null;
2450
- }, me = g.memo(de);
2451
- class pe {
2452
- constructor(t) {
2453
- l(this, "_loading");
2454
- l(this, "_error");
2455
- l(this, "_builder");
2456
- this._signal = t, ut(this, () => this.build(), "ValueBuilder");
2457
- }
2458
- loading(t) {
2459
- return this._loading = typeof t == "function" ? t : () => t, this;
2460
- }
2461
- error(t) {
2462
- return this._error = t, this;
2463
- }
2464
- builder(t) {
2465
- return this._builder = t, this;
2466
- }
2467
- children(t) {
2468
- return this._builder = t, this;
2469
- }
2470
- build() {
2471
- return g.createElement(me, {
2472
- signal: this._signal,
2473
- builder: this._builder,
2474
- loading: this._loading,
2475
- error: this._error
2476
- });
2477
- }
2478
- }
2479
- function je(s) {
2480
- return new pe(s);
2481
- }
2482
- export {
2483
- Ht as A,
2484
- Rt as B,
2485
- vt as C,
2486
- Dt as D,
2487
- wt as E,
2488
- Me as F,
2489
- Ft as G,
2490
- Lt as H,
2491
- K as I,
2492
- q as J,
2493
- P as K,
2494
- at as L,
2495
- U as M,
2496
- Yt as N,
2497
- Ct as O,
2498
- At as P,
2499
- Se as R,
2500
- R as S,
2501
- je as V,
2502
- we as a,
2503
- tt as b,
2504
- xe as c,
2505
- Tt as d,
2506
- Ce as e,
2507
- ae as f,
2508
- et as g,
2509
- le as h,
2510
- Te as i,
2511
- Ie as j,
2512
- ie as k,
2513
- ne as l,
2514
- it as m,
2515
- v as n,
2516
- $e as o,
2517
- Xt as p,
2518
- Ne as q,
2519
- $t as r,
2520
- _e as s,
2521
- nt as t,
2522
- ve as u,
2523
- Ee as v,
2524
- ze as w,
2525
- Re as x,
2526
- Mt as y,
2527
- _ as z
2528
- };