fiboui 2.2.3 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/{FineGrain-BEvB51B2.js → FineGrain-CLKZ-Sv6.js} +1 -1
- package/dist/{builder-3Bc2PfP9.js → builder-DTH8K7ph.js} +608 -595
- package/dist/content.js +3 -3
- package/dist/core.js +3 -3
- package/dist/{index-Cae2Rtx1.js → index-BIEK3zDu.js} +51 -51
- package/dist/{index-DgRpEUs0.js → index-BqVgjY03.js} +4 -4
- package/dist/{index-BlciuWzU.js → index-DPQMrIgq.js} +1 -1
- package/dist/{index-CZQ5erLU.js → index-DkRkbmmY.js} +1 -1
- package/dist/{index-DbjaknWm.js → index-txulk1zM.js} +3 -3
- package/dist/{index-CxbrZGXa.js → index-yb7roisl.js} +3 -3
- package/dist/index-z5BF-Y8H.js +160 -0
- package/dist/index.d.ts +364 -282
- package/dist/index.js +579 -523
- package/dist/interactive.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/{mount-D59e1COl.js → mount-DR5PekCC.js} +1 -1
- package/dist/provider-Muljv62_.js +44 -0
- package/dist/structure.js +2 -2
- package/dist/style.css +1 -1
- package/dist/theme.js +14 -4
- package/dist/themeData-CmTJt3dU.js +441 -0
- package/package.json +1 -1
- package/dist/index-BObp1JkM.js +0 -111
- package/dist/provider-CihtUuRx.js +0 -302
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
var gt = Object.defineProperty;
|
|
3
|
-
var bt = (
|
|
4
|
-
var
|
|
5
|
-
import g, { useRef as w, createContext as j, useContext as O, useCallback as E, useSyncExternalStore as B, useEffect as A, useState as
|
|
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
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";
|
|
7
8
|
class J {
|
|
8
9
|
constructor() {
|
|
9
|
-
|
|
10
|
+
l(this, "activeEffect", null);
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
const Q = new J(), z = [Q];
|
|
@@ -19,22 +20,22 @@ function et() {
|
|
|
19
20
|
function D() {
|
|
20
21
|
return et().activeEffect;
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
z.push(
|
|
23
|
+
function $t(s, t) {
|
|
24
|
+
z.push(s);
|
|
24
25
|
try {
|
|
25
26
|
return t();
|
|
26
27
|
} finally {
|
|
27
28
|
z.pop();
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
function M(
|
|
31
|
+
function M(s) {
|
|
31
32
|
const t = et(), e = t.activeEffect;
|
|
32
|
-
return t.activeEffect =
|
|
33
|
+
return t.activeEffect = s, e;
|
|
33
34
|
}
|
|
34
|
-
class
|
|
35
|
+
class wt {
|
|
35
36
|
constructor(t) {
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
l(this, "dependencies", /* @__PURE__ */ new Set());
|
|
38
|
+
l(this, "_onDispose");
|
|
38
39
|
this.fn = t, this.run();
|
|
39
40
|
}
|
|
40
41
|
run() {
|
|
@@ -59,9 +60,9 @@ class _t {
|
|
|
59
60
|
this.cleanup(), (t = this._onDispose) == null || t.call(this);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
|
-
class
|
|
63
|
+
class St {
|
|
63
64
|
constructor(t) {
|
|
64
|
-
|
|
65
|
+
l(this, "dependencies", /* @__PURE__ */ new Set());
|
|
65
66
|
this._onInvalidate = t;
|
|
66
67
|
}
|
|
67
68
|
execute(t) {
|
|
@@ -87,8 +88,8 @@ class xt {
|
|
|
87
88
|
}
|
|
88
89
|
class R {
|
|
89
90
|
constructor(t) {
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
l(this, "listeners", /* @__PURE__ */ new Set());
|
|
92
|
+
l(this, "effects", /* @__PURE__ */ new Set());
|
|
92
93
|
this._value = t;
|
|
93
94
|
}
|
|
94
95
|
get value() {
|
|
@@ -109,20 +110,20 @@ class R {
|
|
|
109
110
|
}
|
|
110
111
|
notify() {
|
|
111
112
|
const t = Array.from(this.effects), e = Array.from(this.listeners);
|
|
112
|
-
t.forEach((
|
|
113
|
+
t.forEach((r) => r.trigger()), e.forEach((r) => r(this._value));
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
function
|
|
116
|
-
return new R(
|
|
116
|
+
function _e(s) {
|
|
117
|
+
return new R(s);
|
|
117
118
|
}
|
|
118
|
-
class
|
|
119
|
+
class vt {
|
|
119
120
|
constructor(t) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.fn = t, this.internalEffect = new
|
|
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(() => {
|
|
126
127
|
this._dirty || (this._dirty = !0, this.notify());
|
|
127
128
|
});
|
|
128
129
|
}
|
|
@@ -149,16 +150,16 @@ class $t {
|
|
|
149
150
|
}
|
|
150
151
|
notify() {
|
|
151
152
|
const t = Array.from(this.effects), e = Array.from(this.listeners);
|
|
152
|
-
t.forEach((
|
|
153
|
+
t.forEach((r) => r.trigger()), e.forEach((r) => r(this._value));
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
-
return new
|
|
156
|
+
function xe(s) {
|
|
157
|
+
return new vt(s);
|
|
157
158
|
}
|
|
158
|
-
class
|
|
159
|
+
class Ct {
|
|
159
160
|
constructor(t) {
|
|
160
|
-
|
|
161
|
-
|
|
161
|
+
l(this, "listeners", /* @__PURE__ */ new Set());
|
|
162
|
+
l(this, "effects", /* @__PURE__ */ new Set());
|
|
162
163
|
this._value = t;
|
|
163
164
|
}
|
|
164
165
|
get() {
|
|
@@ -181,13 +182,13 @@ class wt {
|
|
|
181
182
|
Array.from(this.effects).forEach((t) => t.trigger()), Array.from(this.listeners).forEach((t) => t(this._value));
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
return new
|
|
185
|
+
function $e(s) {
|
|
186
|
+
return new Ct(s);
|
|
186
187
|
}
|
|
187
|
-
class
|
|
188
|
+
class Nt {
|
|
188
189
|
constructor(t) {
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
l(this, "listeners", /* @__PURE__ */ new Set());
|
|
191
|
+
l(this, "effects", /* @__PURE__ */ new Set());
|
|
191
192
|
this.state = t;
|
|
192
193
|
}
|
|
193
194
|
getState() {
|
|
@@ -195,8 +196,8 @@ class St {
|
|
|
195
196
|
return t && t.track(this), this.state;
|
|
196
197
|
}
|
|
197
198
|
setState(t) {
|
|
198
|
-
const e = typeof t == "function" ? t(this.state) : t,
|
|
199
|
-
|
|
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());
|
|
200
201
|
}
|
|
201
202
|
subscribe(t) {
|
|
202
203
|
return this.listeners.add(t), () => this.listeners.delete(t);
|
|
@@ -211,127 +212,127 @@ class St {
|
|
|
211
212
|
Array.from(this.effects).forEach((t) => t.trigger()), Array.from(this.listeners).forEach((t) => t(this.state));
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
-
return new
|
|
215
|
+
function we(s) {
|
|
216
|
+
return new Nt(s);
|
|
216
217
|
}
|
|
217
|
-
const
|
|
218
|
-
function
|
|
218
|
+
const Et = tt(), st = j(Et);
|
|
219
|
+
function Mt() {
|
|
219
220
|
return O(st);
|
|
220
221
|
}
|
|
221
|
-
function
|
|
222
|
+
function Se({ children: s, scope: t }) {
|
|
222
223
|
const e = w(t ?? tt()).current;
|
|
223
|
-
return /* @__PURE__ */ C(st.Provider, { value: e, children:
|
|
224
|
+
return /* @__PURE__ */ C(st.Provider, { value: e, children: s });
|
|
224
225
|
}
|
|
225
|
-
function
|
|
226
|
-
const t = w(0), e = w(/* @__PURE__ */ new Set()),
|
|
227
|
-
|
|
228
|
-
t.current += 1, e.current.forEach((
|
|
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());
|
|
229
230
|
}));
|
|
230
|
-
const
|
|
231
|
-
e.current.delete(
|
|
232
|
-
}), []),
|
|
233
|
-
B(
|
|
234
|
-
var
|
|
235
|
-
(
|
|
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();
|
|
236
237
|
}, []);
|
|
237
|
-
const n =
|
|
238
|
+
const n = Mt();
|
|
238
239
|
let a = null;
|
|
239
240
|
try {
|
|
240
|
-
a =
|
|
241
|
+
a = $t(n, () => r.current.execute(s));
|
|
241
242
|
} catch {
|
|
242
243
|
a = null;
|
|
243
244
|
}
|
|
244
245
|
return /* @__PURE__ */ C(W, { children: a });
|
|
245
246
|
}
|
|
246
|
-
const
|
|
247
|
-
function
|
|
247
|
+
const It = j(/* @__PURE__ */ new Map()), rt = j(null);
|
|
248
|
+
function ve(s) {
|
|
248
249
|
const t = O(rt);
|
|
249
250
|
if (!t)
|
|
250
251
|
throw new Error("useBuilderState must be used under a builder that called .state()");
|
|
251
|
-
return [t.get(
|
|
252
|
+
return [t.get(s), (e) => t.set(s, e)];
|
|
252
253
|
}
|
|
253
|
-
function
|
|
254
|
-
const [e,
|
|
254
|
+
function Rt({ stateMap: s = /* @__PURE__ */ new Map(), children: t }) {
|
|
255
|
+
const [e, r] = Z(() => new Map(s)), o = {
|
|
255
256
|
map: e,
|
|
256
|
-
get: (
|
|
257
|
-
set: (
|
|
258
|
-
|
|
259
|
-
if (Object.is(a.get(
|
|
257
|
+
get: (i) => e.get(i),
|
|
258
|
+
set: (i, n) => {
|
|
259
|
+
r((a) => {
|
|
260
|
+
if (Object.is(a.get(i), n))
|
|
260
261
|
return a;
|
|
261
|
-
const
|
|
262
|
-
return
|
|
262
|
+
const c = new Map(a);
|
|
263
|
+
return c.set(i, n), c;
|
|
263
264
|
});
|
|
264
265
|
}
|
|
265
266
|
};
|
|
266
|
-
return /* @__PURE__ */ C(rt.Provider, { value:
|
|
267
|
+
return /* @__PURE__ */ C(rt.Provider, { value: o, children: /* @__PURE__ */ C(It.Provider, { value: e, children: t }) });
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
-
const e = w(0),
|
|
270
|
-
const n = Array.from(
|
|
269
|
+
function zt({ observables: s, children: t }) {
|
|
270
|
+
const e = w(0), r = E((i) => {
|
|
271
|
+
const n = Array.from(s).map(
|
|
271
272
|
(a) => a.subscribe(() => {
|
|
272
|
-
e.current += 1,
|
|
273
|
+
e.current += 1, i();
|
|
273
274
|
})
|
|
274
275
|
);
|
|
275
276
|
return () => n.forEach((a) => a());
|
|
276
|
-
}, [
|
|
277
|
-
return B(
|
|
277
|
+
}, [s]), o = E(() => e.current, []);
|
|
278
|
+
return B(r, o, o), /* @__PURE__ */ C(W, { children: typeof t == "function" ? t() : t });
|
|
278
279
|
}
|
|
279
|
-
function
|
|
280
|
-
const e = w(0),
|
|
281
|
-
const n = Array.from(
|
|
280
|
+
function jt({ signals: s, children: t }) {
|
|
281
|
+
const e = w(0), r = E((i) => {
|
|
282
|
+
const n = Array.from(s).map(
|
|
282
283
|
(a) => a.subscribe(() => {
|
|
283
|
-
e.current += 1,
|
|
284
|
+
e.current += 1, i();
|
|
284
285
|
})
|
|
285
286
|
);
|
|
286
287
|
return () => n.forEach((a) => a());
|
|
287
|
-
}, [
|
|
288
|
-
return B(
|
|
288
|
+
}, [s]), o = E(() => e.current, []);
|
|
289
|
+
return B(r, o, o), /* @__PURE__ */ C(W, { children: typeof t == "function" ? t() : t });
|
|
289
290
|
}
|
|
290
291
|
const ot = j(/* @__PURE__ */ new Map());
|
|
291
|
-
function
|
|
292
|
+
function Ce(s) {
|
|
292
293
|
const t = O(ot);
|
|
293
|
-
return t == null ? void 0 : t.get(
|
|
294
|
+
return t == null ? void 0 : t.get(s);
|
|
294
295
|
}
|
|
295
|
-
function
|
|
296
|
-
return /* @__PURE__ */ C(ot.Provider, { value:
|
|
296
|
+
function At({ providers: s = /* @__PURE__ */ new Map(), children: t }) {
|
|
297
|
+
return /* @__PURE__ */ C(ot.Provider, { value: s, children: t });
|
|
297
298
|
}
|
|
298
|
-
function
|
|
299
|
-
return !!
|
|
299
|
+
function Dt(s) {
|
|
300
|
+
return !!s && typeof s == "object" && "build" in s && typeof s.build == "function";
|
|
300
301
|
}
|
|
301
|
-
function
|
|
302
|
-
return g.isValidElement(
|
|
302
|
+
function Ft(s) {
|
|
303
|
+
return g.isValidElement(s) ? s : Dt(s) ? s.build() : s;
|
|
303
304
|
}
|
|
304
|
-
function H(
|
|
305
|
-
return typeof
|
|
305
|
+
function H(s) {
|
|
306
|
+
return typeof s == "string" || typeof s == "number";
|
|
306
307
|
}
|
|
307
|
-
function
|
|
308
|
-
return g.isValidElement(
|
|
308
|
+
function Lt(s, t) {
|
|
309
|
+
return g.isValidElement(s) && H(s.key) && s.key !== "" ? s.key : `.$fibo-${t}`;
|
|
309
310
|
}
|
|
310
|
-
function
|
|
311
|
-
return !g.isValidElement(
|
|
311
|
+
function Vt(s, t) {
|
|
312
|
+
return !g.isValidElement(s) || H(s.key) && s.key !== "" ? s : g.cloneElement(s, { key: Lt(s, t) });
|
|
312
313
|
}
|
|
313
|
-
function K(
|
|
314
|
-
if (
|
|
314
|
+
function K(s) {
|
|
315
|
+
if (s == null)
|
|
315
316
|
return [];
|
|
316
|
-
const t = typeof
|
|
317
|
-
return (Array.isArray(t) ? t : [t]).map((
|
|
317
|
+
const t = typeof s == "function" ? s() : s;
|
|
318
|
+
return (Array.isArray(t) ? t : [t]).map((r, o) => Vt(Ft(r), o));
|
|
318
319
|
}
|
|
319
|
-
const Y = /* @__PURE__ */ new Map(),
|
|
320
|
+
const Y = /* @__PURE__ */ new Map(), Pt = {
|
|
320
321
|
easeIn: "ease-in",
|
|
321
322
|
easeOut: "ease-out",
|
|
322
323
|
easeInOut: "ease-in-out",
|
|
323
324
|
linear: "linear",
|
|
324
325
|
ease: "ease"
|
|
325
326
|
};
|
|
326
|
-
function it(
|
|
327
|
-
const t =
|
|
328
|
-
if (
|
|
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;
|
|
329
330
|
const n = 1 / 60, a = 1;
|
|
330
|
-
let
|
|
331
|
+
let c = 0, d = 0;
|
|
331
332
|
const h = [0];
|
|
332
333
|
for (let b = 0; b < 180; b += 1) {
|
|
333
|
-
const x = -t * (
|
|
334
|
-
if (d += x /
|
|
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;
|
|
335
336
|
}
|
|
336
337
|
h[h.length - 1] !== 1 && h.push(1);
|
|
337
338
|
const m = Math.max(1, Math.floor((h.length - 1) / 24)), p = [];
|
|
@@ -340,10 +341,10 @@ function it(r = {}) {
|
|
|
340
341
|
p.push(b === 0 ? `${S}` : `${S} ${Math.round(x * 1e4) / 100}%`);
|
|
341
342
|
}
|
|
342
343
|
const y = `linear(${p.join(", ")})`;
|
|
343
|
-
return Y.set(
|
|
344
|
+
return Y.set(o, y), y;
|
|
344
345
|
}
|
|
345
|
-
function v(
|
|
346
|
-
return
|
|
346
|
+
function v(s, t) {
|
|
347
|
+
return s === "spring" ? it(t) : Pt[s] ?? s;
|
|
347
348
|
}
|
|
348
349
|
const U = [
|
|
349
350
|
"fadeIn",
|
|
@@ -361,35 +362,35 @@ const U = [
|
|
|
361
362
|
"blur",
|
|
362
363
|
"pop",
|
|
363
364
|
"bounce"
|
|
364
|
-
],
|
|
365
|
+
], Ot = {
|
|
365
366
|
fade: "fadeIn",
|
|
366
367
|
scale: "scaleIn",
|
|
367
368
|
blur: "blurIn"
|
|
368
369
|
};
|
|
369
|
-
function
|
|
370
|
-
if (!
|
|
371
|
-
const t =
|
|
370
|
+
function Bt(s) {
|
|
371
|
+
if (!s || typeof s != "object") return !1;
|
|
372
|
+
const t = s;
|
|
372
373
|
return typeof t.from == "object" && t.from !== null && typeof t.to == "object" && t.to !== null;
|
|
373
374
|
}
|
|
374
|
-
function G(
|
|
375
|
+
function G(s) {
|
|
375
376
|
const t = /* @__PURE__ */ new Set(["opacity", "zIndex", "z-index", "flex", "fontWeight", "lineHeight"]);
|
|
376
|
-
return Object.entries(
|
|
377
|
-
const
|
|
378
|
-
return `${
|
|
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}`;
|
|
379
380
|
}).join("; ");
|
|
380
381
|
}
|
|
381
|
-
function
|
|
382
|
+
function Wt(s) {
|
|
382
383
|
let t = 5381;
|
|
383
|
-
for (let e = 0; e <
|
|
384
|
+
for (let e = 0; e < s.length; e += 1) t = (t << 5) + t ^ s.charCodeAt(e);
|
|
384
385
|
return (t >>> 0).toString(36);
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
-
const t =
|
|
387
|
+
function Ht(s) {
|
|
388
|
+
const t = Ot[s] ?? s;
|
|
388
389
|
if (!U.includes(t))
|
|
389
|
-
throw new Error(`Unknown motion preset "${
|
|
390
|
+
throw new Error(`Unknown motion preset "${s}". Use: ${U.join(", ")}`);
|
|
390
391
|
return t;
|
|
391
392
|
}
|
|
392
|
-
const
|
|
393
|
+
const P = `
|
|
393
394
|
.fibo-anim {
|
|
394
395
|
animation-duration: var(--fibo-dur, 300ms);
|
|
395
396
|
animation-timing-function: var(--fibo-ease, ease);
|
|
@@ -531,18 +532,18 @@ const F = `
|
|
|
531
532
|
}
|
|
532
533
|
}
|
|
533
534
|
`.trim();
|
|
534
|
-
function
|
|
535
|
+
function q(s) {
|
|
535
536
|
let t = 5381;
|
|
536
|
-
for (let e = 0; e <
|
|
537
|
-
t = (t << 5) + t ^
|
|
537
|
+
for (let e = 0; e < s.length; e += 1)
|
|
538
|
+
t = (t << 5) + t ^ s.charCodeAt(e);
|
|
538
539
|
return (t >>> 0).toString(36);
|
|
539
540
|
}
|
|
540
541
|
const $ = class $ {
|
|
541
542
|
constructor() {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
543
|
+
l(this, "sheet", null);
|
|
544
|
+
l(this, "cache", /* @__PURE__ */ new Map());
|
|
545
|
+
l(this, "extras", []);
|
|
546
|
+
l(this, "defaultsReady", !1);
|
|
546
547
|
this.attachSheet(), this.ensureDefaults();
|
|
547
548
|
}
|
|
548
549
|
static getInstance() {
|
|
@@ -567,32 +568,32 @@ const $ = class $ {
|
|
|
567
568
|
/**
|
|
568
569
|
* CSS `@media` rule, deduped. Used by `.media()` / `.md()` / `.responsive()` — not JS resize.
|
|
569
570
|
*/
|
|
570
|
-
registerMedia(t, e,
|
|
571
|
-
const
|
|
572
|
-
if (this.cache.has(
|
|
573
|
-
return this.cache.get(
|
|
574
|
-
const
|
|
575
|
-
return this.insert(n), this.cache.set(
|
|
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;
|
|
576
577
|
}
|
|
577
578
|
ensureDefaults() {
|
|
578
579
|
var t;
|
|
579
|
-
this.defaultsReady || (this.defaultsReady = !0, this.sheet && !((t = this.sheet.textContent) != null && t.includes("fibo-fadeIn")) && this.sheet.appendChild(document.createTextNode(
|
|
580
|
+
this.defaultsReady || (this.defaultsReady = !0, this.sheet && !((t = this.sheet.textContent) != null && t.includes("fibo-fadeIn")) && this.sheet.appendChild(document.createTextNode(P)));
|
|
580
581
|
}
|
|
581
582
|
getCss() {
|
|
582
583
|
this.ensureDefaults();
|
|
583
584
|
const t = [...this.extras].sort();
|
|
584
|
-
return [
|
|
585
|
+
return [P, ...t].filter(Boolean).join(`
|
|
585
586
|
`);
|
|
586
587
|
}
|
|
587
|
-
registerKeyframes(t, e,
|
|
588
|
-
const
|
|
589
|
-
if (this.cache.has(
|
|
590
|
-
const
|
|
591
|
-
return this.insert(`@keyframes ${
|
|
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;
|
|
592
593
|
}
|
|
593
594
|
insert(t, e = !0) {
|
|
594
|
-
var
|
|
595
|
-
if (!(e && this.extras.includes(t)) && (e && this.extras.push(t), !(this.sheet && ((
|
|
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)))))
|
|
596
597
|
if (this.sheet && this.sheet.sheet)
|
|
597
598
|
try {
|
|
598
599
|
this.sheet.sheet.insertRule(t, this.sheet.sheet.cssRules.length);
|
|
@@ -603,8 +604,8 @@ const $ = class $ {
|
|
|
603
604
|
}
|
|
604
605
|
/** Set a `:root` custom property (e.g. `--fibo-sticky-offset`). */
|
|
605
606
|
registerRoot(t, e) {
|
|
606
|
-
const
|
|
607
|
-
this.cache.has(
|
|
607
|
+
const r = `:root:${t}:${e}`;
|
|
608
|
+
this.cache.has(r) || (this.insert(`:root { ${t}: ${e}; }`), this.cache.set(r, ":root"));
|
|
608
609
|
}
|
|
609
610
|
/** Once: `html { scroll-padding-top: var(--fibo-sticky-offset, 0px) }`. */
|
|
610
611
|
ensureScrollPadding() {
|
|
@@ -612,43 +613,43 @@ const $ = class $ {
|
|
|
612
613
|
this.cache.has(t) || (this.insert("html { scroll-padding-top: var(--fibo-sticky-offset, 0px); }"), this.cache.set(t, "html"));
|
|
613
614
|
}
|
|
614
615
|
register(t, e) {
|
|
615
|
-
const
|
|
616
|
-
if (this.cache.has(
|
|
617
|
-
return this.cache.get(
|
|
618
|
-
const
|
|
619
|
-
return this.insert(n), this.cache.set(
|
|
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;
|
|
620
621
|
}
|
|
621
622
|
/**
|
|
622
623
|
* One class per (pseudo, property, value). Same rules → same class on server and client.
|
|
623
624
|
* Order-independent: each declaration hashes on its own.
|
|
624
625
|
*/
|
|
625
|
-
registerPseudo(t, e,
|
|
626
|
-
const
|
|
627
|
-
if (this.cache.has(
|
|
628
|
-
return this.cache.get(
|
|
629
|
-
const n = `fibo-ps-${
|
|
630
|
-
return this.insert(a), this.cache.set(
|
|
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;
|
|
631
632
|
}
|
|
632
|
-
registerGroupPseudo(t, e,
|
|
633
|
-
return this.registerPseudo(e,
|
|
633
|
+
registerGroupPseudo(t, e, r, o) {
|
|
634
|
+
return this.registerPseudo(e, r, o, !0);
|
|
634
635
|
}
|
|
635
636
|
};
|
|
636
|
-
|
|
637
|
+
l($, "instance");
|
|
637
638
|
let T = $;
|
|
638
|
-
const
|
|
639
|
+
const u = T.getInstance();
|
|
639
640
|
function _() {
|
|
640
641
|
T.getInstance().ensureDefaults();
|
|
641
642
|
}
|
|
642
|
-
function
|
|
643
|
+
function Ne() {
|
|
643
644
|
return T.getInstance().getCss();
|
|
644
645
|
}
|
|
645
646
|
function nt() {
|
|
646
647
|
return T.getInstance().getCss();
|
|
647
648
|
}
|
|
648
|
-
function
|
|
649
|
+
function Ee() {
|
|
649
650
|
return `<style id="fibo-dynamic-styles" data-fibo="1">${nt().replace(/<\/style/gi, "<\\/style")}</style>`;
|
|
650
651
|
}
|
|
651
|
-
function
|
|
652
|
+
function Me() {
|
|
652
653
|
return _(), g.createElement("style", {
|
|
653
654
|
id: "fibo-dynamic-styles",
|
|
654
655
|
"data-fibo": "1",
|
|
@@ -656,11 +657,11 @@ function ve() {
|
|
|
656
657
|
dangerouslySetInnerHTML: { __html: nt() }
|
|
657
658
|
});
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
+
function Xt() {
|
|
660
661
|
return _(), g.createElement("style", {
|
|
661
662
|
id: "fibo-motion-presets",
|
|
662
663
|
"data-fibo-motion": "1",
|
|
663
|
-
dangerouslySetInnerHTML: { __html:
|
|
664
|
+
dangerouslySetInnerHTML: { __html: P }
|
|
664
665
|
});
|
|
665
666
|
}
|
|
666
667
|
const at = {
|
|
@@ -669,64 +670,64 @@ const at = {
|
|
|
669
670
|
lg: 1024,
|
|
670
671
|
xl: 1280
|
|
671
672
|
};
|
|
672
|
-
function
|
|
673
|
-
return
|
|
673
|
+
function Kt(s) {
|
|
674
|
+
return s in at;
|
|
674
675
|
}
|
|
675
|
-
function
|
|
676
|
-
if (
|
|
677
|
-
return `(min-width: ${at[
|
|
678
|
-
const t =
|
|
676
|
+
function Yt(s) {
|
|
677
|
+
if (Kt(s))
|
|
678
|
+
return `(min-width: ${at[s]}px)`;
|
|
679
|
+
const t = s.trim();
|
|
679
680
|
return t.startsWith("@media") ? t.replace(/^@media\s+/, "") : t;
|
|
680
681
|
}
|
|
681
|
-
function
|
|
682
|
-
var t, e,
|
|
683
|
-
if (typeof
|
|
684
|
-
else if (typeof
|
|
685
|
-
var
|
|
686
|
-
for (t = 0; t <
|
|
687
|
-
} else for (e in
|
|
688
|
-
return
|
|
689
|
-
}
|
|
690
|
-
function
|
|
691
|
-
for (var
|
|
692
|
-
return
|
|
693
|
-
}
|
|
694
|
-
function
|
|
695
|
-
const t =
|
|
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*\)/);
|
|
696
697
|
if (!t)
|
|
697
|
-
return
|
|
698
|
-
const [, e,
|
|
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) => {
|
|
699
700
|
var X;
|
|
700
|
-
const
|
|
701
|
-
return
|
|
701
|
+
const V = (X = Math.round(I * 255).toString(16)) == null ? void 0 : X.toUpperCase();
|
|
702
|
+
return V.length === 1 ? `0${V}` : V;
|
|
702
703
|
};
|
|
703
|
-
return `#${
|
|
704
|
+
return `#${L(dt)}${L(mt)}${L(pt)}`;
|
|
704
705
|
}
|
|
705
|
-
function
|
|
706
|
-
const t = {}, e = {},
|
|
706
|
+
function qt(s) {
|
|
707
|
+
const t = {}, e = {}, r = s.split(`
|
|
707
708
|
`);
|
|
708
|
-
for (const
|
|
709
|
-
const
|
|
710
|
-
if (!
|
|
709
|
+
for (const o of r) {
|
|
710
|
+
const i = o.trim();
|
|
711
|
+
if (!i || i.startsWith("//") || i.startsWith("*") || i === "@theme {" || i === "}")
|
|
711
712
|
continue;
|
|
712
|
-
const n =
|
|
713
|
+
const n = i.match(/^--color-([a-z0-9\-]+): (oklch\([^)]+\));?$/), a = i.match(/^--color-([a-z0-9\-]+): (#[a-fA-F0-9]{3,6});?$/);
|
|
713
714
|
if (n) {
|
|
714
|
-
const [,
|
|
715
|
-
t[h.toLowerCase()] = `bg-${
|
|
715
|
+
const [, c, d] = n, h = Gt(d);
|
|
716
|
+
t[h.toLowerCase()] = `bg-${c}`, e[h.toLowerCase()] = `text-${c}`;
|
|
716
717
|
} else if (a) {
|
|
717
|
-
const [,
|
|
718
|
-
t[d.toLowerCase()] = `bg-${
|
|
718
|
+
const [, c, d] = a;
|
|
719
|
+
t[d.toLowerCase()] = `bg-${c}`, e[d.toLowerCase()] = `text-${c}`;
|
|
719
720
|
}
|
|
720
721
|
}
|
|
721
722
|
return { background: t, text: e };
|
|
722
723
|
}
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
return typeof
|
|
726
|
-
}, N = (
|
|
727
|
-
const e =
|
|
728
|
-
return e === void 0 ? "" : `${
|
|
729
|
-
},
|
|
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 = `
|
|
730
731
|
--color-red-50: oklch(0.971 0.013 17.38);
|
|
731
732
|
--color-red-100: oklch(0.936 0.032 17.717);
|
|
732
733
|
--color-red-200: oklch(0.885 0.062 18.334);
|
|
@@ -971,7 +972,7 @@ const Ut = (r) => {
|
|
|
971
972
|
--color-stone-950: oklch(0.147 0.004 49.25);
|
|
972
973
|
--color-black: #000;
|
|
973
974
|
--color-white: #fff;
|
|
974
|
-
`,
|
|
975
|
+
`, Qt = qt(Jt), ct = {
|
|
975
976
|
borderRadius: {
|
|
976
977
|
0: "rounded-none",
|
|
977
978
|
"0px": "rounded-none",
|
|
@@ -1068,24 +1069,24 @@ const Ut = (r) => {
|
|
|
1068
1069
|
fixed: "fixed",
|
|
1069
1070
|
sticky: "sticky"
|
|
1070
1071
|
}
|
|
1071
|
-
},
|
|
1072
|
+
}, te = (s, t) => ({
|
|
1072
1073
|
// 背景色
|
|
1073
|
-
backgroundColor: (e) => e.backgroundColor ? [
|
|
1074
|
+
backgroundColor: (e) => e.backgroundColor ? [s.background[e.backgroundColor.toLowerCase()] || `bg-[${e.backgroundColor}]`] : [],
|
|
1074
1075
|
// 文字色
|
|
1075
|
-
color: (e) => e.color ? [
|
|
1076
|
+
color: (e) => e.color ? [s.text[e.color.toLowerCase()] || `text-[${e.color}]`] : [],
|
|
1076
1077
|
// 圆角
|
|
1077
1078
|
borderRadius: (e) => {
|
|
1078
1079
|
if (!e.borderRadius)
|
|
1079
1080
|
return [];
|
|
1080
|
-
const
|
|
1081
|
-
return
|
|
1081
|
+
const r = ct.borderRadius[e.borderRadius] || N("rounded", e.borderRadius);
|
|
1082
|
+
return r ? [r] : [];
|
|
1082
1083
|
},
|
|
1083
1084
|
// 外边距
|
|
1084
1085
|
margin: (e) => {
|
|
1085
|
-
const
|
|
1086
|
+
const r = [];
|
|
1086
1087
|
if (e.margin !== void 0) {
|
|
1087
|
-
const
|
|
1088
|
-
return
|
|
1088
|
+
const i = N("m", e.margin);
|
|
1089
|
+
return i ? [i] : [];
|
|
1089
1090
|
}
|
|
1090
1091
|
return [
|
|
1091
1092
|
{ prop: e.marginTop, dir: "mt" },
|
|
@@ -1094,19 +1095,19 @@ const Ut = (r) => {
|
|
|
1094
1095
|
{ prop: e.marginLeft, dir: "ml" },
|
|
1095
1096
|
{ prop: e.marginX, dir: "mx" },
|
|
1096
1097
|
{ prop: e.marginY, dir: "my" }
|
|
1097
|
-
].forEach(({ prop:
|
|
1098
|
-
if (
|
|
1099
|
-
const a = N(n,
|
|
1100
|
-
a &&
|
|
1098
|
+
].forEach(({ prop: i, dir: n }) => {
|
|
1099
|
+
if (i !== void 0) {
|
|
1100
|
+
const a = N(n, i);
|
|
1101
|
+
a && r.push(a);
|
|
1101
1102
|
}
|
|
1102
|
-
}),
|
|
1103
|
+
}), r;
|
|
1103
1104
|
},
|
|
1104
1105
|
// 内边距
|
|
1105
1106
|
padding: (e) => {
|
|
1106
|
-
const
|
|
1107
|
+
const r = [];
|
|
1107
1108
|
if (e.padding !== void 0) {
|
|
1108
|
-
const
|
|
1109
|
-
return
|
|
1109
|
+
const i = N("p", e.padding);
|
|
1110
|
+
return i ? [i] : [];
|
|
1110
1111
|
}
|
|
1111
1112
|
return [
|
|
1112
1113
|
{ prop: e.paddingTop, dir: "pt" },
|
|
@@ -1115,73 +1116,73 @@ const Ut = (r) => {
|
|
|
1115
1116
|
{ prop: e.paddingLeft, dir: "pl" },
|
|
1116
1117
|
{ prop: e.paddingX, dir: "px" },
|
|
1117
1118
|
{ prop: e.paddingY, dir: "py" }
|
|
1118
|
-
].forEach(({ prop:
|
|
1119
|
-
if (
|
|
1120
|
-
const a = N(n,
|
|
1121
|
-
a &&
|
|
1119
|
+
].forEach(({ prop: i, dir: n }) => {
|
|
1120
|
+
if (i !== void 0) {
|
|
1121
|
+
const a = N(n, i);
|
|
1122
|
+
a && r.push(a);
|
|
1122
1123
|
}
|
|
1123
|
-
}),
|
|
1124
|
+
}), r;
|
|
1124
1125
|
},
|
|
1125
1126
|
// 字体
|
|
1126
1127
|
font: (e) => {
|
|
1127
|
-
const
|
|
1128
|
-
if (e.fontSize &&
|
|
1129
|
-
const
|
|
1130
|
-
|
|
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);
|
|
1131
1132
|
}
|
|
1132
1133
|
if (e.textAlign) {
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1134
|
+
const o = t.textAlign[e.textAlign];
|
|
1135
|
+
o && r.push(o);
|
|
1135
1136
|
}
|
|
1136
1137
|
if (e.fontFamily) {
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1138
|
+
const o = t.fontFamily[e.fontFamily];
|
|
1139
|
+
o && r.push(o);
|
|
1139
1140
|
}
|
|
1140
1141
|
if (e.textDecoration) {
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1142
|
+
const o = t.textDecoration[e.textDecoration];
|
|
1143
|
+
o && r.push(o);
|
|
1143
1144
|
}
|
|
1144
1145
|
if (e.fontVariantNumeric) {
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1146
|
+
const o = t.fontVariantNumeric[e.fontVariantNumeric];
|
|
1147
|
+
o && r.push(o);
|
|
1147
1148
|
}
|
|
1148
1149
|
if (e.fontStyle) {
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1150
|
+
const o = t.fontStyle[e.fontStyle];
|
|
1151
|
+
o && r.push(o);
|
|
1151
1152
|
}
|
|
1152
|
-
return
|
|
1153
|
+
return r;
|
|
1153
1154
|
},
|
|
1154
1155
|
// 尺寸
|
|
1155
1156
|
size: (e) => {
|
|
1156
|
-
const
|
|
1157
|
+
const r = [];
|
|
1157
1158
|
if (e.width) {
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1159
|
+
const o = e.width.toString();
|
|
1160
|
+
r.push(`w-[${o}]`);
|
|
1160
1161
|
}
|
|
1161
1162
|
if (e.height) {
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1163
|
+
const o = e.height.toString();
|
|
1164
|
+
r.push(`h-[${o}]`);
|
|
1164
1165
|
}
|
|
1165
|
-
return
|
|
1166
|
+
return r;
|
|
1166
1167
|
},
|
|
1167
1168
|
// 布局
|
|
1168
1169
|
layout: (e) => {
|
|
1169
|
-
const
|
|
1170
|
+
const r = [];
|
|
1170
1171
|
if (e.display) {
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1172
|
+
const o = t.display[e.display];
|
|
1173
|
+
o && r.push(o);
|
|
1173
1174
|
}
|
|
1174
1175
|
if (e.flexDirection) {
|
|
1175
|
-
const
|
|
1176
|
+
const i = {
|
|
1176
1177
|
row: "flex-row",
|
|
1177
1178
|
column: "flex-col",
|
|
1178
1179
|
"row-reverse": "flex-row-reverse",
|
|
1179
1180
|
"column-reverse": "flex-col-reverse"
|
|
1180
1181
|
}[e.flexDirection];
|
|
1181
|
-
|
|
1182
|
+
i && r.push(i);
|
|
1182
1183
|
}
|
|
1183
1184
|
if (e.justifyContent) {
|
|
1184
|
-
const
|
|
1185
|
+
const i = {
|
|
1185
1186
|
"flex-start": "justify-start",
|
|
1186
1187
|
"flex-end": "justify-end",
|
|
1187
1188
|
center: "justify-center",
|
|
@@ -1189,23 +1190,23 @@ const Ut = (r) => {
|
|
|
1189
1190
|
"space-around": "justify-around",
|
|
1190
1191
|
"space-evenly": "justify-evenly"
|
|
1191
1192
|
}[e.justifyContent];
|
|
1192
|
-
|
|
1193
|
+
i && r.push(i);
|
|
1193
1194
|
}
|
|
1194
1195
|
if (e.alignItems) {
|
|
1195
|
-
const
|
|
1196
|
+
const i = {
|
|
1196
1197
|
"flex-start": "items-start",
|
|
1197
1198
|
"flex-end": "items-end",
|
|
1198
1199
|
center: "items-center",
|
|
1199
1200
|
baseline: "items-baseline",
|
|
1200
1201
|
stretch: "items-stretch"
|
|
1201
1202
|
}[e.alignItems];
|
|
1202
|
-
|
|
1203
|
+
i && r.push(i);
|
|
1203
1204
|
}
|
|
1204
1205
|
if (e.gap) {
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1206
|
+
const o = N("gap", e.gap);
|
|
1207
|
+
o && r.push(o);
|
|
1207
1208
|
}
|
|
1208
|
-
return
|
|
1209
|
+
return r;
|
|
1209
1210
|
},
|
|
1210
1211
|
// 定位
|
|
1211
1212
|
position: (e) => e.position ? [t.position[e.position] || ""].filter(Boolean) : [],
|
|
@@ -1213,18 +1214,18 @@ const Ut = (r) => {
|
|
|
1213
1214
|
opacity: (e) => {
|
|
1214
1215
|
if (e.opacity === void 0)
|
|
1215
1216
|
return [];
|
|
1216
|
-
const
|
|
1217
|
+
const r = typeof e.opacity == "string" ? parseFloat(e.opacity) : e.opacity;
|
|
1217
1218
|
return [`opacity-${{
|
|
1218
1219
|
0: "0",
|
|
1219
1220
|
0.25: "25",
|
|
1220
1221
|
0.5: "50",
|
|
1221
1222
|
0.75: "75",
|
|
1222
1223
|
1: "100"
|
|
1223
|
-
}[
|
|
1224
|
+
}[r] || Math.round(r * 100)}`];
|
|
1224
1225
|
},
|
|
1225
1226
|
// 自定义类名
|
|
1226
1227
|
className: (e) => e.className ? [e.className] : []
|
|
1227
|
-
}),
|
|
1228
|
+
}), ee = {
|
|
1228
1229
|
backgroundColor: "backgroundColor",
|
|
1229
1230
|
color: "color",
|
|
1230
1231
|
borderRadius: "borderRadius",
|
|
@@ -1258,49 +1259,49 @@ const Ut = (r) => {
|
|
|
1258
1259
|
position: "position",
|
|
1259
1260
|
opacity: "opacity",
|
|
1260
1261
|
className: "className"
|
|
1261
|
-
},
|
|
1262
|
-
const e = (t == null ? void 0 : t.colorMaps) ||
|
|
1263
|
-
return Object.keys(
|
|
1264
|
-
const
|
|
1265
|
-
if (
|
|
1266
|
-
const d =
|
|
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];
|
|
1267
1268
|
if (d) {
|
|
1268
|
-
const h = d(
|
|
1269
|
-
|
|
1269
|
+
const h = d(s);
|
|
1270
|
+
i.push(...h), n.add(c);
|
|
1270
1271
|
}
|
|
1271
1272
|
}
|
|
1272
|
-
}),
|
|
1273
|
+
}), i.filter(Boolean).join(" ");
|
|
1273
1274
|
};
|
|
1274
|
-
function
|
|
1275
|
+
function re(s) {
|
|
1275
1276
|
const t = {};
|
|
1276
|
-
return
|
|
1277
|
-
t[
|
|
1277
|
+
return s.forEach((e, r) => {
|
|
1278
|
+
t[r] = e.value;
|
|
1278
1279
|
}), t;
|
|
1279
1280
|
}
|
|
1280
|
-
function
|
|
1281
|
-
const [
|
|
1282
|
-
() =>
|
|
1281
|
+
function oe({ animatedProps: s, animationConfig: t, children: e }) {
|
|
1282
|
+
const [r, o] = Z(
|
|
1283
|
+
() => re(s)
|
|
1283
1284
|
);
|
|
1284
1285
|
A(() => {
|
|
1285
|
-
const
|
|
1286
|
-
return
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1286
|
+
const c = [];
|
|
1287
|
+
return s.forEach((d, h) => {
|
|
1288
|
+
const f = (m) => {
|
|
1289
|
+
o((p) => ({
|
|
1289
1290
|
...p,
|
|
1290
1291
|
[h]: m
|
|
1291
1292
|
}));
|
|
1292
1293
|
};
|
|
1293
|
-
|
|
1294
|
+
c.push(d.subscribe(f)), f(d.value);
|
|
1294
1295
|
}), () => {
|
|
1295
|
-
|
|
1296
|
+
c.forEach((d) => d());
|
|
1296
1297
|
};
|
|
1297
|
-
}, [
|
|
1298
|
-
const
|
|
1299
|
-
|
|
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)`);
|
|
1300
1301
|
const n = {};
|
|
1301
|
-
if (
|
|
1302
|
-
const { duration:
|
|
1303
|
-
n.transition = `transform ${
|
|
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}`;
|
|
1304
1305
|
}
|
|
1305
1306
|
const a = {
|
|
1306
1307
|
...e.props.style,
|
|
@@ -1309,16 +1310,16 @@ function ee({ animatedProps: r, animationConfig: t, children: e }) {
|
|
|
1309
1310
|
return yt(e, { style: a });
|
|
1310
1311
|
}
|
|
1311
1312
|
class k {
|
|
1312
|
-
constructor(t, e,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
this.pseudoState = t, this.parentBuilder = e, this.isGroup =
|
|
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;
|
|
1322
1323
|
}
|
|
1323
1324
|
bg(t) {
|
|
1324
1325
|
return this.set("background-color", t);
|
|
@@ -1358,11 +1359,11 @@ class k {
|
|
|
1358
1359
|
css(t, e) {
|
|
1359
1360
|
return this.set(t, e);
|
|
1360
1361
|
}
|
|
1361
|
-
transition(t, e,
|
|
1362
|
+
transition(t, e, r, o) {
|
|
1362
1363
|
if (typeof t == "string" && e === void 0)
|
|
1363
1364
|
return this.set("transition", t);
|
|
1364
|
-
const
|
|
1365
|
-
return this.set("transition", `${
|
|
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}`);
|
|
1366
1367
|
}
|
|
1367
1368
|
duration(t) {
|
|
1368
1369
|
return this.transitionDuration = t, this.applyTransition(), this;
|
|
@@ -1380,49 +1381,51 @@ class k {
|
|
|
1380
1381
|
return this.transitionProperties = t, this.applyTransition(), this;
|
|
1381
1382
|
}
|
|
1382
1383
|
applyTransition() {
|
|
1383
|
-
const t = this.transitionProperties.join(", "), e = `${this.transitionDuration}ms`,
|
|
1384
|
-
this.set("transition", `${t} ${e} ${
|
|
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}`);
|
|
1385
1386
|
}
|
|
1386
1387
|
flushTransform() {
|
|
1387
1388
|
return this.set("transform", [...this.transforms.values()].join(" "));
|
|
1388
1389
|
}
|
|
1389
1390
|
set(t, e) {
|
|
1390
|
-
const
|
|
1391
|
-
return this.parentBuilder.addClassName(
|
|
1391
|
+
const r = u.registerPseudo(this.pseudoState, t, e, this.isGroup);
|
|
1392
|
+
return this.parentBuilder.addClassName(r), this;
|
|
1392
1393
|
}
|
|
1393
1394
|
end() {
|
|
1394
1395
|
return this.parentBuilder;
|
|
1395
1396
|
}
|
|
1396
1397
|
}
|
|
1397
|
-
function
|
|
1398
|
+
function Te(s, t) {
|
|
1398
1399
|
if (typeof document > "u") return;
|
|
1399
|
-
const e = typeof
|
|
1400
|
-
|
|
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({
|
|
1401
1404
|
behavior: (t == null ? void 0 : t.behavior) ?? "smooth",
|
|
1402
1405
|
block: (t == null ? void 0 : t.block) ?? "start"
|
|
1403
1406
|
});
|
|
1404
1407
|
}
|
|
1405
|
-
function
|
|
1408
|
+
function Ie(s) {
|
|
1406
1409
|
const t = typeof document < "u" ? document : void 0, e = t == null ? void 0 : t.startViewTransition;
|
|
1407
1410
|
if (typeof e == "function") {
|
|
1408
|
-
e.call(t,
|
|
1411
|
+
e.call(t, s);
|
|
1409
1412
|
return;
|
|
1410
1413
|
}
|
|
1411
|
-
|
|
1414
|
+
s();
|
|
1412
1415
|
}
|
|
1413
|
-
function
|
|
1416
|
+
function ie() {
|
|
1414
1417
|
return typeof CSS > "u" || typeof CSS.supports != "function" ? !1 : CSS.supports("animation-timeline", "view()");
|
|
1415
1418
|
}
|
|
1416
|
-
function
|
|
1419
|
+
function ne() {
|
|
1417
1420
|
return typeof CSS > "u" || typeof CSS.supports != "function" ? !1 : CSS.supports("animation-timeline", "scroll()");
|
|
1418
1421
|
}
|
|
1419
|
-
function
|
|
1420
|
-
preset:
|
|
1422
|
+
function ae({
|
|
1423
|
+
preset: s = "fadeUp",
|
|
1421
1424
|
once: t = !0,
|
|
1422
1425
|
rootMargin: e = "0px 0px -8% 0px",
|
|
1423
|
-
threshold:
|
|
1424
|
-
forceMotion:
|
|
1425
|
-
preferTimeline:
|
|
1426
|
+
threshold: r = 0.12,
|
|
1427
|
+
forceMotion: o = !1,
|
|
1428
|
+
preferTimeline: i = !1,
|
|
1426
1429
|
children: n
|
|
1427
1430
|
}) {
|
|
1428
1431
|
const a = w(null);
|
|
@@ -1430,7 +1433,7 @@ function oe({
|
|
|
1430
1433
|
_();
|
|
1431
1434
|
const d = a.current;
|
|
1432
1435
|
if (!d) return;
|
|
1433
|
-
if (
|
|
1436
|
+
if (i && ie()) {
|
|
1434
1437
|
d.classList.add("fibo-inview");
|
|
1435
1438
|
return;
|
|
1436
1439
|
}
|
|
@@ -1439,83 +1442,84 @@ function oe({
|
|
|
1439
1442
|
return;
|
|
1440
1443
|
}
|
|
1441
1444
|
const h = new IntersectionObserver(
|
|
1442
|
-
(
|
|
1443
|
-
for (const m of
|
|
1445
|
+
(f) => {
|
|
1446
|
+
for (const m of f)
|
|
1444
1447
|
m.isIntersecting ? (m.target.classList.add("fibo-inview"), t && h.unobserve(m.target)) : t || m.target.classList.remove("fibo-inview");
|
|
1445
1448
|
},
|
|
1446
|
-
{ rootMargin: e, threshold:
|
|
1449
|
+
{ rootMargin: e, threshold: r }
|
|
1447
1450
|
);
|
|
1448
1451
|
return h.observe(d), () => h.disconnect();
|
|
1449
|
-
}, [t, e,
|
|
1450
|
-
const
|
|
1452
|
+
}, [t, e, r, i]);
|
|
1453
|
+
const c = [
|
|
1451
1454
|
"fibo-reveal",
|
|
1452
|
-
`fibo-reveal-${
|
|
1455
|
+
`fibo-reveal-${s}`,
|
|
1453
1456
|
// min-w-0 only — do NOT force w-full (breaks horizontal ScrollView / carousel slides)
|
|
1454
1457
|
"min-w-0",
|
|
1455
|
-
|
|
1458
|
+
o ? "fibo-motion-force" : ""
|
|
1456
1459
|
].filter(Boolean).join(" ");
|
|
1457
|
-
return g.createElement("div", { ref: a, className:
|
|
1460
|
+
return g.createElement("div", { ref: a, className: c, "data-fibo-reveal": s }, n);
|
|
1458
1461
|
}
|
|
1459
|
-
function
|
|
1462
|
+
function le({ children: s }) {
|
|
1460
1463
|
const t = w(null);
|
|
1461
1464
|
return A(() => {
|
|
1462
|
-
if (_(),
|
|
1465
|
+
if (_(), ne()) return;
|
|
1463
1466
|
const e = () => {
|
|
1464
|
-
var
|
|
1465
|
-
return ((
|
|
1466
|
-
},
|
|
1467
|
-
const
|
|
1468
|
-
if (!
|
|
1469
|
-
const
|
|
1470
|
-
|
|
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));
|
|
1471
1474
|
};
|
|
1472
|
-
return
|
|
1473
|
-
window.removeEventListener("scroll",
|
|
1475
|
+
return r(), window.addEventListener("scroll", r, { passive: !0 }), window.addEventListener("resize", r), () => {
|
|
1476
|
+
window.removeEventListener("scroll", r), window.removeEventListener("resize", r);
|
|
1474
1477
|
};
|
|
1475
1478
|
}, []), g.createElement(
|
|
1476
1479
|
"div",
|
|
1477
1480
|
{ ref: t, "data-fibo-scroll-progress": "1", style: { display: "contents" } },
|
|
1478
|
-
|
|
1481
|
+
s
|
|
1479
1482
|
);
|
|
1480
1483
|
}
|
|
1481
|
-
const ht = 64,
|
|
1482
|
-
class
|
|
1484
|
+
const ht = 64, ce = `${ht}px`;
|
|
1485
|
+
class Re {
|
|
1483
1486
|
constructor() {
|
|
1484
1487
|
/** @internal Extra DOM props forwarded to the host element. */
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
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);
|
|
1509
1513
|
/** Shrink-wrap: skip the default `w-full` / `self-stretch` on Row and Column. */
|
|
1510
|
-
|
|
1514
|
+
l(this, "_hug", !1);
|
|
1511
1515
|
// Transition properties
|
|
1512
|
-
|
|
1516
|
+
l(this, "_transitionDuration", 200);
|
|
1513
1517
|
// ms
|
|
1514
|
-
|
|
1515
|
-
|
|
1518
|
+
l(this, "_transitionEasing", "ease-in-out");
|
|
1519
|
+
l(this, "_transitionDelay", 0);
|
|
1516
1520
|
// ms
|
|
1517
|
-
|
|
1518
|
-
|
|
1521
|
+
l(this, "_transitionProperties", ["all"]);
|
|
1522
|
+
l(this, "_childFunction");
|
|
1519
1523
|
}
|
|
1520
1524
|
hug() {
|
|
1521
1525
|
return this._hug = !0, this;
|
|
@@ -1532,7 +1536,7 @@ class Ee {
|
|
|
1532
1536
|
*/
|
|
1533
1537
|
anchor(t) {
|
|
1534
1538
|
return this.id(t), this._explicitScrollMargin || this._classNames.push(
|
|
1535
|
-
|
|
1539
|
+
u.register("scroll-margin-top", "var(--fibo-sticky-offset, 0px)")
|
|
1536
1540
|
), this;
|
|
1537
1541
|
}
|
|
1538
1542
|
/**
|
|
@@ -1542,7 +1546,7 @@ class Ee {
|
|
|
1542
1546
|
scrollMargin(t) {
|
|
1543
1547
|
this._explicitScrollMargin = !0;
|
|
1544
1548
|
const e = typeof t == "number" ? `${t}px` : t;
|
|
1545
|
-
return this._classNames.push(
|
|
1549
|
+
return this._classNames.push(u.register("scroll-margin-top", e)), this;
|
|
1546
1550
|
}
|
|
1547
1551
|
/** Stamp a class onto the host. Used by PseudoStateBuilder (hashed `:hover` etc.). */
|
|
1548
1552
|
addClassName(t) {
|
|
@@ -1559,20 +1563,20 @@ class Ee {
|
|
|
1559
1563
|
return e && typeof e == "object" && (this.__fiboElementProps = { ...e, key: String(t) }), this;
|
|
1560
1564
|
}
|
|
1561
1565
|
paddingHorizontal(t) {
|
|
1562
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1563
|
-
return this._classNames.push(
|
|
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;
|
|
1564
1568
|
}
|
|
1565
1569
|
paddingVertical(t) {
|
|
1566
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1567
|
-
return this._classNames.push(
|
|
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;
|
|
1568
1572
|
}
|
|
1569
1573
|
marginHorizontal(t) {
|
|
1570
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1571
|
-
return this._classNames.push(
|
|
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;
|
|
1572
1576
|
}
|
|
1573
1577
|
marginVertical(t) {
|
|
1574
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1575
|
-
return this._classNames.push(
|
|
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;
|
|
1576
1580
|
}
|
|
1577
1581
|
flexDirection(t) {
|
|
1578
1582
|
return this._classNames.push(`flex-${t}`), this;
|
|
@@ -1586,7 +1590,7 @@ class Ee {
|
|
|
1586
1590
|
flex(t) {
|
|
1587
1591
|
if (this._classNames.push("flex"), t !== void 0)
|
|
1588
1592
|
if (typeof t == "number") {
|
|
1589
|
-
const e =
|
|
1593
|
+
const e = u.register("flex", String(t));
|
|
1590
1594
|
this._classNames.push(e);
|
|
1591
1595
|
} else typeof t == "string" && this._classNames.push(`flex-${t}`);
|
|
1592
1596
|
return this;
|
|
@@ -1637,19 +1641,19 @@ class Ee {
|
|
|
1637
1641
|
return this._classNames.push("h-full"), this;
|
|
1638
1642
|
}
|
|
1639
1643
|
square(t) {
|
|
1640
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1641
|
-
return this._classNames.push(
|
|
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;
|
|
1642
1646
|
}
|
|
1643
1647
|
circle() {
|
|
1644
1648
|
return this._classNames.push("rounded-full"), this;
|
|
1645
1649
|
}
|
|
1646
1650
|
opacity(t) {
|
|
1647
|
-
const e =
|
|
1651
|
+
const e = u.register("opacity", String(t));
|
|
1648
1652
|
return this._classNames.push(e), this;
|
|
1649
1653
|
}
|
|
1650
1654
|
p(t) {
|
|
1651
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1652
|
-
return this._classNames.push(
|
|
1655
|
+
const e = typeof t == "number" ? `${t}px` : t, r = u.register("padding", e);
|
|
1656
|
+
return this._classNames.push(r), this;
|
|
1653
1657
|
}
|
|
1654
1658
|
px(t) {
|
|
1655
1659
|
return this.paddingHorizontal(t);
|
|
@@ -1664,8 +1668,8 @@ class Ee {
|
|
|
1664
1668
|
return this.paddingVertical(t);
|
|
1665
1669
|
}
|
|
1666
1670
|
m(t) {
|
|
1667
|
-
const e = typeof t == "number" ? `${t}px` : t,
|
|
1668
|
-
return this._classNames.push(
|
|
1671
|
+
const e = typeof t == "number" ? `${t}px` : t, r = u.register("margin", e);
|
|
1672
|
+
return this._classNames.push(r), this;
|
|
1669
1673
|
}
|
|
1670
1674
|
mx(t) {
|
|
1671
1675
|
return this.marginHorizontal(t);
|
|
@@ -1680,16 +1684,16 @@ class Ee {
|
|
|
1680
1684
|
return this.marginVertical(t);
|
|
1681
1685
|
}
|
|
1682
1686
|
bg(t) {
|
|
1683
|
-
const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t,
|
|
1684
|
-
return this._classNames.push(
|
|
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;
|
|
1685
1689
|
}
|
|
1686
1690
|
text(t) {
|
|
1687
|
-
const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t,
|
|
1688
|
-
return this._classNames.push(
|
|
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;
|
|
1689
1693
|
}
|
|
1690
1694
|
color(t) {
|
|
1691
|
-
const e = typeof t == "string" && !t.startsWith("#") && !t.startsWith("rgb") ? this.resolveSemanticColor(t) : t,
|
|
1692
|
-
return this._classNames.push(
|
|
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;
|
|
1693
1697
|
}
|
|
1694
1698
|
resolveSemanticColor(t) {
|
|
1695
1699
|
return [
|
|
@@ -1718,8 +1722,8 @@ class Ee {
|
|
|
1718
1722
|
}
|
|
1719
1723
|
shadow(t) {
|
|
1720
1724
|
if (t === null || t === "none") {
|
|
1721
|
-
const
|
|
1722
|
-
return this._classNames.push(
|
|
1725
|
+
const i = u.register("box-shadow", "none");
|
|
1726
|
+
return this._classNames.push(i), this;
|
|
1723
1727
|
}
|
|
1724
1728
|
const e = {
|
|
1725
1729
|
sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
|
|
@@ -1732,11 +1736,11 @@ class Ee {
|
|
|
1732
1736
|
modal: "0 10px 40px rgba(0, 0, 0, 0.2)",
|
|
1733
1737
|
float: "0 8px 16px rgba(0, 0, 0, 0.15)",
|
|
1734
1738
|
inner: "inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)"
|
|
1735
|
-
},
|
|
1736
|
-
let
|
|
1737
|
-
if (a && a.startsWith("#") &&
|
|
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) {
|
|
1738
1742
|
const y = parseInt(a.slice(1, 3), 16), b = parseInt(a.slice(3, 5), 16), x = parseInt(a.slice(5, 7), 16);
|
|
1739
|
-
|
|
1743
|
+
f = `rgba(${y}, ${b}, ${x}, ${c})`;
|
|
1740
1744
|
}
|
|
1741
1745
|
const p = {
|
|
1742
1746
|
sm: "2px",
|
|
@@ -1745,50 +1749,50 @@ class Ee {
|
|
|
1745
1749
|
xl: "12px",
|
|
1746
1750
|
"2xl": "16px"
|
|
1747
1751
|
}[n] || "4px";
|
|
1748
|
-
switch (
|
|
1752
|
+
switch (i) {
|
|
1749
1753
|
case "top":
|
|
1750
|
-
return `0 -${p} ${p} -1px ${
|
|
1754
|
+
return `0 -${p} ${p} -1px ${f}`;
|
|
1751
1755
|
case "bottom":
|
|
1752
|
-
return `0 ${p} ${p} -1px ${
|
|
1756
|
+
return `0 ${p} ${p} -1px ${f}`;
|
|
1753
1757
|
case "left":
|
|
1754
|
-
return `-${p} 0 ${p} -1px ${
|
|
1758
|
+
return `-${p} 0 ${p} -1px ${f}`;
|
|
1755
1759
|
case "right":
|
|
1756
|
-
return `${p} 0 ${p} -1px ${
|
|
1760
|
+
return `${p} 0 ${p} -1px ${f}`;
|
|
1757
1761
|
case "top-bottom":
|
|
1758
1762
|
case "vertical":
|
|
1759
|
-
return `0 -${p} ${p} -1px ${
|
|
1763
|
+
return `0 -${p} ${p} -1px ${f}, 0 ${p} ${p} -1px ${f}`;
|
|
1760
1764
|
case "left-right":
|
|
1761
1765
|
case "horizontal":
|
|
1762
|
-
return `-${p} 0 ${p} -1px ${
|
|
1766
|
+
return `-${p} 0 ${p} -1px ${f}, ${p} 0 ${p} -1px ${f}`;
|
|
1763
1767
|
case "all":
|
|
1764
1768
|
default:
|
|
1765
1769
|
return e[n] || e.md;
|
|
1766
1770
|
}
|
|
1767
1771
|
};
|
|
1768
1772
|
if (!t) {
|
|
1769
|
-
const
|
|
1770
|
-
return this._classNames.push(
|
|
1773
|
+
const i = u.register("box-shadow", e.md);
|
|
1774
|
+
return this._classNames.push(i), this;
|
|
1771
1775
|
}
|
|
1772
1776
|
if (typeof t == "string") {
|
|
1773
|
-
if (
|
|
1774
|
-
const a =
|
|
1775
|
-
return this._classNames.push(
|
|
1777
|
+
if (r(t)) {
|
|
1778
|
+
const a = o("all", "md", t), c = u.register("box-shadow", a);
|
|
1779
|
+
return this._classNames.push(c), this;
|
|
1776
1780
|
}
|
|
1777
|
-
const
|
|
1781
|
+
const i = e[t] || e.md, n = u.register("box-shadow", i);
|
|
1778
1782
|
return this._classNames.push(n), this;
|
|
1779
1783
|
}
|
|
1780
1784
|
if (Array.isArray(t)) {
|
|
1781
|
-
const [
|
|
1782
|
-
if (typeof
|
|
1783
|
-
const
|
|
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);
|
|
1784
1788
|
return this._classNames.push(m), this;
|
|
1785
1789
|
}
|
|
1786
|
-
const d =
|
|
1787
|
-
if (typeof n == "string" &&
|
|
1788
|
-
const
|
|
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);
|
|
1789
1793
|
return this._classNames.push(m), this;
|
|
1790
1794
|
} else {
|
|
1791
|
-
const m =
|
|
1795
|
+
const m = o(d, n, a, c), p = u.register("box-shadow", m);
|
|
1792
1796
|
return this._classNames.push(p), this;
|
|
1793
1797
|
}
|
|
1794
1798
|
}
|
|
@@ -1808,11 +1812,11 @@ class Ee {
|
|
|
1808
1812
|
* @example Box().padding(8).media('md', { padding: 16 }).media('(prefers-color-scheme: dark)', { backgroundColor: '#111' })
|
|
1809
1813
|
*/
|
|
1810
1814
|
media(t, e) {
|
|
1811
|
-
return this.registerMediaStyles(
|
|
1815
|
+
return this.registerMediaStyles(Yt(t), e), this;
|
|
1812
1816
|
}
|
|
1813
1817
|
registerMediaStyles(t, e) {
|
|
1814
1818
|
if (!e) return;
|
|
1815
|
-
const
|
|
1819
|
+
const r = /* @__PURE__ */ new Set([
|
|
1816
1820
|
"opacity",
|
|
1817
1821
|
"zIndex",
|
|
1818
1822
|
"z-index",
|
|
@@ -1823,10 +1827,10 @@ class Ee {
|
|
|
1823
1827
|
"fontWeight",
|
|
1824
1828
|
"lineHeight"
|
|
1825
1829
|
]);
|
|
1826
|
-
for (const [
|
|
1827
|
-
if (
|
|
1828
|
-
const n =
|
|
1829
|
-
this._classNames.push(
|
|
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));
|
|
1830
1834
|
}
|
|
1831
1835
|
}
|
|
1832
1836
|
sm(t) {
|
|
@@ -1843,23 +1847,23 @@ class Ee {
|
|
|
1843
1847
|
}
|
|
1844
1848
|
rounded(t) {
|
|
1845
1849
|
if (typeof t == "number") {
|
|
1846
|
-
const e =
|
|
1850
|
+
const e = u.register("border-radius", `${t}px`);
|
|
1847
1851
|
this._classNames.push(e);
|
|
1848
1852
|
} else if (typeof t == "string" && (t.startsWith("rounded-") || ["sm", "md", "lg", "xl", "2xl", "3xl", "full", "none"].includes(t))) {
|
|
1849
1853
|
const e = t.startsWith("rounded-") ? t : `rounded-${t}`;
|
|
1850
1854
|
this._classNames.push(e);
|
|
1851
1855
|
} else {
|
|
1852
|
-
const e =
|
|
1856
|
+
const e = u.register("border-radius", t);
|
|
1853
1857
|
this._classNames.push(e);
|
|
1854
1858
|
}
|
|
1855
1859
|
return this;
|
|
1856
1860
|
}
|
|
1857
1861
|
borderRadius(t) {
|
|
1858
1862
|
if (typeof t == "number") {
|
|
1859
|
-
const e =
|
|
1863
|
+
const e = u.register("border-radius", `${t}px`);
|
|
1860
1864
|
this._classNames.push(e);
|
|
1861
1865
|
} else {
|
|
1862
|
-
const e =
|
|
1866
|
+
const e = u.register("border-radius", t);
|
|
1863
1867
|
this._classNames.push(e);
|
|
1864
1868
|
}
|
|
1865
1869
|
return this;
|
|
@@ -1870,45 +1874,45 @@ class Ee {
|
|
|
1870
1874
|
else if (["red", "blue", "green", "gray", "white", "black", "transparent"].some((e) => t.includes(e)))
|
|
1871
1875
|
this._classNames.push(`border-${t}`);
|
|
1872
1876
|
else {
|
|
1873
|
-
const e =
|
|
1877
|
+
const e = u.register("border-color", t);
|
|
1874
1878
|
this._classNames.push(e);
|
|
1875
1879
|
}
|
|
1876
1880
|
return this;
|
|
1877
1881
|
}
|
|
1878
1882
|
width(t) {
|
|
1879
1883
|
if (typeof t == "number") {
|
|
1880
|
-
const e =
|
|
1884
|
+
const e = u.register("width", `${t}px`);
|
|
1881
1885
|
this._classNames.push(e);
|
|
1882
1886
|
} else if (typeof t == "string" && (t.startsWith("w-") || t === "full" || t === "screen" || t === "min" || t === "max" || t === "fit")) {
|
|
1883
1887
|
const e = t.startsWith("w-") ? t : `w-${t}`;
|
|
1884
1888
|
this._classNames.push(e);
|
|
1885
1889
|
} else {
|
|
1886
|
-
const e =
|
|
1890
|
+
const e = u.register("width", t);
|
|
1887
1891
|
this._classNames.push(e);
|
|
1888
1892
|
}
|
|
1889
1893
|
return this;
|
|
1890
1894
|
}
|
|
1891
1895
|
height(t) {
|
|
1892
1896
|
if (typeof t == "number") {
|
|
1893
|
-
const e =
|
|
1897
|
+
const e = u.register("height", `${t}px`);
|
|
1894
1898
|
this._classNames.push(e);
|
|
1895
1899
|
} else if (typeof t == "string" && (t.startsWith("h-") || t === "full" || t === "screen" || t === "min" || t === "max" || t === "fit")) {
|
|
1896
1900
|
const e = t.startsWith("h-") ? t : `h-${t}`;
|
|
1897
1901
|
this._classNames.push(e);
|
|
1898
1902
|
} else {
|
|
1899
|
-
const e =
|
|
1903
|
+
const e = u.register("height", t);
|
|
1900
1904
|
this._classNames.push(e);
|
|
1901
1905
|
}
|
|
1902
1906
|
return this;
|
|
1903
1907
|
}
|
|
1904
1908
|
gap(t) {
|
|
1905
1909
|
if (typeof t == "number") {
|
|
1906
|
-
const e =
|
|
1910
|
+
const e = u.register("gap", `${t}px`);
|
|
1907
1911
|
this._classNames.push(e);
|
|
1908
1912
|
} else if (typeof t == "string" && t.startsWith("gap-"))
|
|
1909
1913
|
this._classNames.push(t);
|
|
1910
1914
|
else {
|
|
1911
|
-
const e =
|
|
1915
|
+
const e = u.register("gap", t);
|
|
1912
1916
|
this._classNames.push(e);
|
|
1913
1917
|
}
|
|
1914
1918
|
return this;
|
|
@@ -1959,18 +1963,18 @@ class Ee {
|
|
|
1959
1963
|
), this;
|
|
1960
1964
|
}
|
|
1961
1965
|
borderInput(t = "gray-300", e = "blue-500") {
|
|
1962
|
-
const
|
|
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);
|
|
1963
1967
|
return this._classNames.push(
|
|
1964
1968
|
"border",
|
|
1965
|
-
`border-${
|
|
1969
|
+
`border-${o}`,
|
|
1966
1970
|
"focus-within:ring-2",
|
|
1967
|
-
`focus-within:ring-${
|
|
1968
|
-
`focus-within:border-${
|
|
1971
|
+
`focus-within:ring-${i}`,
|
|
1972
|
+
`focus-within:border-${i}`
|
|
1969
1973
|
), this.clean();
|
|
1970
1974
|
}
|
|
1971
1975
|
weight(t) {
|
|
1972
1976
|
if (typeof t == "number") {
|
|
1973
|
-
const e =
|
|
1977
|
+
const e = u.register("font-weight", String(t));
|
|
1974
1978
|
this._classNames.push(e);
|
|
1975
1979
|
} else {
|
|
1976
1980
|
const e = {
|
|
@@ -1987,8 +1991,8 @@ class Ee {
|
|
|
1987
1991
|
if (e[t])
|
|
1988
1992
|
this._classNames.push(e[t]);
|
|
1989
1993
|
else {
|
|
1990
|
-
const
|
|
1991
|
-
this._classNames.push(
|
|
1994
|
+
const r = u.register("font-weight", t);
|
|
1995
|
+
this._classNames.push(r);
|
|
1992
1996
|
}
|
|
1993
1997
|
}
|
|
1994
1998
|
return this;
|
|
@@ -2056,11 +2060,11 @@ class Ee {
|
|
|
2056
2060
|
props(t) {
|
|
2057
2061
|
return this._props = { ...this._props, ...t }, this;
|
|
2058
2062
|
}
|
|
2059
|
-
transition(t, e,
|
|
2063
|
+
transition(t, e, r, o) {
|
|
2060
2064
|
if (typeof t == "string" && e === void 0)
|
|
2061
|
-
return this.replaceTransitionClass(
|
|
2062
|
-
const
|
|
2063
|
-
return this.replaceTransitionClass(
|
|
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;
|
|
2064
2068
|
}
|
|
2065
2069
|
/**
|
|
2066
2070
|
* Set transition duration in milliseconds
|
|
@@ -2098,32 +2102,32 @@ class Ee {
|
|
|
2098
2102
|
* Apply the built transition to the element
|
|
2099
2103
|
*/
|
|
2100
2104
|
_applyTransition() {
|
|
2101
|
-
const t = this._transitionProperties.join(", "), e = `${this._transitionDuration}ms`,
|
|
2102
|
-
this.replaceTransitionClass(
|
|
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}`));
|
|
2103
2107
|
}
|
|
2104
2108
|
replaceTransitionClass(t) {
|
|
2105
2109
|
this._transitionClass && (this._classNames = this._classNames.filter((e) => e !== this._transitionClass)), this._transitionClass = t, this._classNames.push(t);
|
|
2106
2110
|
}
|
|
2107
2111
|
animate(t, e) {
|
|
2108
2112
|
_(), this._usesCssMotion = !0, this._motionClass && (this._classNames = this._classNames.filter((h) => h !== this._motionClass));
|
|
2109
|
-
const
|
|
2110
|
-
let n =
|
|
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;
|
|
2111
2115
|
const a = {
|
|
2112
|
-
stiffness: (
|
|
2113
|
-
damping: (
|
|
2114
|
-
mass: (
|
|
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
|
|
2115
2119
|
};
|
|
2116
|
-
if (
|
|
2117
|
-
const h = G(t.from),
|
|
2120
|
+
if (r) {
|
|
2121
|
+
const h = G(t.from), f = G(t.to), m = u.registerKeyframes(Wt(`${h}=>${f}`), h, f);
|
|
2118
2122
|
this._motionClass = `fibo-anim ${m}`, this._props["data-fibo-anim"] = "custom";
|
|
2119
2123
|
} else {
|
|
2120
|
-
const h =
|
|
2124
|
+
const h = Ht(t);
|
|
2121
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");
|
|
2122
2126
|
}
|
|
2123
|
-
const
|
|
2127
|
+
const c = v(n ?? "ease", a);
|
|
2124
2128
|
this._classNames.push(this._motionClass);
|
|
2125
2129
|
const d = this._style;
|
|
2126
|
-
return d["--fibo-dur"] = `${
|
|
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;
|
|
2127
2131
|
}
|
|
2128
2132
|
/** CSS `linear()` spring. Works on `.animate()` and `.transition()` / `.hover()`. */
|
|
2129
2133
|
spring(t) {
|
|
@@ -2161,7 +2165,7 @@ class Ee {
|
|
|
2161
2165
|
return _(), this._scrollProgress = !0, this._classNames.push("fibo-scroll-progress"), this._usesCssMotion = !0, this;
|
|
2162
2166
|
}
|
|
2163
2167
|
smoothScroll() {
|
|
2164
|
-
return this._classNames.push(
|
|
2168
|
+
return this._classNames.push(u.register("scroll-behavior", "smooth")), this;
|
|
2165
2169
|
}
|
|
2166
2170
|
scrollSnap(t = "y") {
|
|
2167
2171
|
return _(), this._classNames.push(`fibo-snap-${t}`), this;
|
|
@@ -2171,11 +2175,11 @@ class Ee {
|
|
|
2171
2175
|
}
|
|
2172
2176
|
sticky(t = 0) {
|
|
2173
2177
|
if (t === !1) return this;
|
|
2174
|
-
this._classNames.push(
|
|
2178
|
+
this._classNames.push(u.register("position", "sticky"));
|
|
2175
2179
|
const e = t === !0 ? "0px" : typeof t == "number" ? `${t}px` : t;
|
|
2176
|
-
this._classNames.push(
|
|
2177
|
-
const
|
|
2178
|
-
return this.publishStickyOffset(
|
|
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;
|
|
2179
2183
|
}
|
|
2180
2184
|
/**
|
|
2181
2185
|
* Publish `--fibo-sticky-offset` on `:root` so `.anchor()` / `html` scroll-padding
|
|
@@ -2183,7 +2187,7 @@ class Ee {
|
|
|
2183
2187
|
*/
|
|
2184
2188
|
publishStickyOffset(t) {
|
|
2185
2189
|
const e = typeof t == "number" ? `${t}px` : t;
|
|
2186
|
-
|
|
2190
|
+
u.registerRoot("--fibo-sticky-offset", e), u.ensureScrollPadding();
|
|
2187
2191
|
}
|
|
2188
2192
|
viewTransition(t) {
|
|
2189
2193
|
return this._viewTransition = t, this._style.viewTransitionName = t, this;
|
|
@@ -2196,14 +2200,24 @@ class Ee {
|
|
|
2196
2200
|
}
|
|
2197
2201
|
ensureInteractiveTransition() {
|
|
2198
2202
|
this._transitionClass || this._motionClass || this.replaceTransitionClass(
|
|
2199
|
-
|
|
2203
|
+
u.register(
|
|
2200
2204
|
"transition",
|
|
2201
2205
|
`transform ${this._transitionDuration}ms ${this._transitionEasing}, opacity ${this._transitionDuration}ms ${this._transitionEasing}`
|
|
2202
2206
|
)
|
|
2203
2207
|
);
|
|
2204
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
|
+
*/
|
|
2205
2214
|
theme(t) {
|
|
2206
|
-
|
|
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;
|
|
2207
2221
|
}
|
|
2208
2222
|
hover(t) {
|
|
2209
2223
|
this.ensureInteractiveTransition();
|
|
@@ -2262,23 +2276,22 @@ class Ee {
|
|
|
2262
2276
|
}
|
|
2263
2277
|
getClassName() {
|
|
2264
2278
|
let t;
|
|
2265
|
-
return Object.keys(this._cssStyles).length > 0 && (t =
|
|
2279
|
+
return Object.keys(this._cssStyles).length > 0 && (t = se(this._cssStyles) || void 0), Ut(this._classNames, t);
|
|
2266
2280
|
}
|
|
2267
2281
|
getStyle() {
|
|
2268
2282
|
let t = { ...this._style, ...this._cssStyles };
|
|
2269
|
-
if (this._theme
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
}
|
|
2276
|
-
if (this._transforms.length > 0) {
|
|
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) {
|
|
2277
2290
|
const e = t.transform || "";
|
|
2278
2291
|
t.transform = e ? `${e} ${this._transforms.join(" ")}` : this._transforms.join(" ");
|
|
2279
2292
|
}
|
|
2280
2293
|
if (this._animationConfig && this._animatedProps.size === 0) {
|
|
2281
|
-
const { duration: e = 300, curve:
|
|
2294
|
+
const { duration: e = 300, curve: r = "easeOut", stiffness: o, damping: i } = this._animationConfig, n = v(r, { stiffness: o, damping: i });
|
|
2282
2295
|
t.transition = `all ${e}ms ${n}`;
|
|
2283
2296
|
}
|
|
2284
2297
|
return t;
|
|
@@ -2286,12 +2299,12 @@ class Ee {
|
|
|
2286
2299
|
processChildren() {
|
|
2287
2300
|
const t = this._childFunction ? K(this._childFunction) : this._children;
|
|
2288
2301
|
return this._staggerMs == null ? t : t.map(
|
|
2289
|
-
(e,
|
|
2302
|
+
(e, r) => g.createElement(
|
|
2290
2303
|
"span",
|
|
2291
2304
|
{
|
|
2292
|
-
key: g.isValidElement(e) && H(e.key) ? e.key : `fibo-stagger-${
|
|
2305
|
+
key: g.isValidElement(e) && H(e.key) ? e.key : `fibo-stagger-${r}`,
|
|
2293
2306
|
className: "fibo-stagger-item",
|
|
2294
|
-
style: { "--fibo-i": String(
|
|
2307
|
+
style: { "--fibo-i": String(r) }
|
|
2295
2308
|
},
|
|
2296
2309
|
e
|
|
2297
2310
|
)
|
|
@@ -2301,7 +2314,7 @@ class Ee {
|
|
|
2301
2314
|
return this._childFunction;
|
|
2302
2315
|
}
|
|
2303
2316
|
}
|
|
2304
|
-
const
|
|
2317
|
+
const he = /* @__PURE__ */ new Set([
|
|
2305
2318
|
"$$typeof",
|
|
2306
2319
|
"type",
|
|
2307
2320
|
"props",
|
|
@@ -2314,133 +2327,133 @@ const ae = /* @__PURE__ */ new Set([
|
|
|
2314
2327
|
"_debugTask",
|
|
2315
2328
|
"_debugInfo"
|
|
2316
2329
|
]);
|
|
2317
|
-
function
|
|
2330
|
+
function ue(s) {
|
|
2318
2331
|
var e;
|
|
2319
|
-
const t = (e =
|
|
2332
|
+
const t = (e = s._props) == null ? void 0 : e.key;
|
|
2320
2333
|
if (!(t == null || t === ""))
|
|
2321
2334
|
return t;
|
|
2322
2335
|
}
|
|
2323
|
-
function
|
|
2324
|
-
const t =
|
|
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 = () => {
|
|
2325
2338
|
var S;
|
|
2326
|
-
let m =
|
|
2327
|
-
const p =
|
|
2328
|
-
p && p.size > 0 && (m = g.createElement(
|
|
2339
|
+
let m = s.build();
|
|
2340
|
+
const p = s._animatedProps, y = s._animationConfig;
|
|
2341
|
+
p && p.size > 0 && (m = g.createElement(oe, {
|
|
2329
2342
|
key: n,
|
|
2330
2343
|
animatedProps: p,
|
|
2331
2344
|
animationConfig: y,
|
|
2332
2345
|
children: m
|
|
2333
2346
|
}));
|
|
2334
|
-
const b =
|
|
2335
|
-
b && (m = g.createElement(
|
|
2347
|
+
const b = s._reveal;
|
|
2348
|
+
b && (m = g.createElement(ae, {
|
|
2336
2349
|
key: n,
|
|
2337
2350
|
preset: b.preset,
|
|
2338
2351
|
once: b.once,
|
|
2339
2352
|
rootMargin: b.rootMargin,
|
|
2340
2353
|
threshold: b.threshold,
|
|
2341
|
-
forceMotion:
|
|
2342
|
-
preferTimeline: (S =
|
|
2354
|
+
forceMotion: s._reducedMotion === "never",
|
|
2355
|
+
preferTimeline: (S = s._classNames) == null ? void 0 : S.includes("fibo-view-timeline"),
|
|
2343
2356
|
children: m
|
|
2344
|
-
})),
|
|
2357
|
+
})), s._scrollProgress && (m = g.createElement(le, { key: n, children: m })), s._usesCssMotion && (m = g.createElement(
|
|
2345
2358
|
g.Fragment,
|
|
2346
2359
|
{ key: n },
|
|
2347
|
-
g.createElement(
|
|
2360
|
+
g.createElement(Xt),
|
|
2348
2361
|
m
|
|
2349
2362
|
));
|
|
2350
|
-
const x =
|
|
2363
|
+
const x = s._gesture;
|
|
2351
2364
|
return x && (m = x.wrap(m)), m;
|
|
2352
|
-
},
|
|
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, {
|
|
2353
2366
|
key: n,
|
|
2354
2367
|
children: a
|
|
2355
2368
|
}) : null, h = () => d ?? a();
|
|
2356
|
-
let
|
|
2357
|
-
return
|
|
2369
|
+
let f = h();
|
|
2370
|
+
return c && e && e.size > 0 ? f = g.createElement(jt, {
|
|
2358
2371
|
key: n,
|
|
2359
2372
|
signals: e,
|
|
2360
2373
|
children: h
|
|
2361
|
-
}) :
|
|
2374
|
+
}) : c && r && r.size > 0 && (f = g.createElement(zt, {
|
|
2362
2375
|
key: n,
|
|
2363
|
-
observables:
|
|
2376
|
+
observables: r,
|
|
2364
2377
|
children: h
|
|
2365
|
-
})),
|
|
2378
|
+
})), c && o && o.size > 0 && (f = g.createElement(Rt, {
|
|
2366
2379
|
key: n,
|
|
2367
|
-
stateMap:
|
|
2368
|
-
children:
|
|
2369
|
-
})),
|
|
2380
|
+
stateMap: o,
|
|
2381
|
+
children: f
|
|
2382
|
+
})), c && i && i.size > 0 && (f = g.createElement(At, {
|
|
2370
2383
|
key: n,
|
|
2371
|
-
providers:
|
|
2372
|
-
children:
|
|
2373
|
-
})),
|
|
2384
|
+
providers: i,
|
|
2385
|
+
children: f
|
|
2386
|
+
})), f;
|
|
2374
2387
|
}
|
|
2375
|
-
function
|
|
2376
|
-
const
|
|
2388
|
+
function ut(s, t, e) {
|
|
2389
|
+
const r = function() {
|
|
2377
2390
|
return t();
|
|
2378
2391
|
};
|
|
2379
|
-
|
|
2380
|
-
const
|
|
2381
|
-
Object.defineProperty(
|
|
2382
|
-
value:
|
|
2392
|
+
r.displayName = e;
|
|
2393
|
+
const o = g.createElement(r);
|
|
2394
|
+
Object.defineProperty(s, "$$typeof", {
|
|
2395
|
+
value: o.$$typeof,
|
|
2383
2396
|
enumerable: !0,
|
|
2384
2397
|
configurable: !0
|
|
2385
|
-
}), Object.defineProperty(
|
|
2386
|
-
value:
|
|
2398
|
+
}), Object.defineProperty(s, "type", {
|
|
2399
|
+
value: r,
|
|
2387
2400
|
enumerable: !0,
|
|
2388
2401
|
configurable: !0,
|
|
2389
2402
|
writable: !0
|
|
2390
|
-
}),
|
|
2403
|
+
}), s.ref = o.ref ?? null, s.__fiboElementProps = o.props ?? {}, o._owner !== void 0 && (s._owner = o._owner), s._store = { validated: 1 };
|
|
2391
2404
|
}
|
|
2392
|
-
function
|
|
2405
|
+
function ze(s) {
|
|
2393
2406
|
return (...t) => {
|
|
2394
|
-
const e = new
|
|
2395
|
-
return
|
|
2396
|
-
get(
|
|
2397
|
-
var
|
|
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;
|
|
2398
2411
|
if (n === "build")
|
|
2399
|
-
return
|
|
2412
|
+
return o;
|
|
2400
2413
|
if (n === "key") {
|
|
2401
|
-
const h = (
|
|
2414
|
+
const h = (c = i._props) == null ? void 0 : c.key;
|
|
2402
2415
|
if (h != null && h !== "")
|
|
2403
2416
|
return String(h);
|
|
2404
|
-
if (!
|
|
2405
|
-
const
|
|
2406
|
-
|
|
2417
|
+
if (!i.__fiboKeyFn) {
|
|
2418
|
+
const f = (m) => (i.key(m), a);
|
|
2419
|
+
i.__fiboKeyFn = f;
|
|
2407
2420
|
}
|
|
2408
|
-
return
|
|
2421
|
+
return i.__fiboKeyFn;
|
|
2409
2422
|
}
|
|
2410
2423
|
if (n === "props") {
|
|
2411
|
-
const h = (d =
|
|
2412
|
-
...
|
|
2424
|
+
const h = (d = i._props) == null ? void 0 : d.key, f = {
|
|
2425
|
+
...i.__fiboElementProps ?? {},
|
|
2413
2426
|
...h != null && h !== "" ? { key: String(h) } : {}
|
|
2414
|
-
}, m = Object.getPrototypeOf(
|
|
2415
|
-
return typeof m == "function" ? Object.assign((y) => (m.call(
|
|
2427
|
+
}, m = Object.getPrototypeOf(i).props;
|
|
2428
|
+
return typeof m == "function" ? Object.assign((y) => (m.call(i, y), a), f) : f;
|
|
2416
2429
|
}
|
|
2417
|
-
return
|
|
2418
|
-
const
|
|
2419
|
-
return
|
|
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;
|
|
2420
2433
|
};
|
|
2421
2434
|
}
|
|
2422
2435
|
});
|
|
2423
2436
|
};
|
|
2424
2437
|
}
|
|
2425
|
-
const
|
|
2426
|
-
signal:
|
|
2438
|
+
const de = ({
|
|
2439
|
+
signal: s,
|
|
2427
2440
|
builder: t,
|
|
2428
2441
|
loading: e,
|
|
2429
|
-
error:
|
|
2442
|
+
error: r
|
|
2430
2443
|
}) => {
|
|
2431
|
-
const
|
|
2432
|
-
g.useCallback((a) =>
|
|
2433
|
-
}, [
|
|
2434
|
-
() =>
|
|
2435
|
-
),
|
|
2436
|
-
return
|
|
2437
|
-
},
|
|
2438
|
-
class
|
|
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 {
|
|
2439
2452
|
constructor(t) {
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
this._signal = t,
|
|
2453
|
+
l(this, "_loading");
|
|
2454
|
+
l(this, "_error");
|
|
2455
|
+
l(this, "_builder");
|
|
2456
|
+
this._signal = t, ut(this, () => this.build(), "ValueBuilder");
|
|
2444
2457
|
}
|
|
2445
2458
|
loading(t) {
|
|
2446
2459
|
return this._loading = typeof t == "function" ? t : () => t, this;
|
|
@@ -2455,7 +2468,7 @@ class ue {
|
|
|
2455
2468
|
return this._builder = t, this;
|
|
2456
2469
|
}
|
|
2457
2470
|
build() {
|
|
2458
|
-
return g.createElement(
|
|
2471
|
+
return g.createElement(me, {
|
|
2459
2472
|
signal: this._signal,
|
|
2460
2473
|
builder: this._builder,
|
|
2461
2474
|
loading: this._loading,
|
|
@@ -2463,53 +2476,53 @@ class ue {
|
|
|
2463
2476
|
});
|
|
2464
2477
|
}
|
|
2465
2478
|
}
|
|
2466
|
-
function
|
|
2467
|
-
return new
|
|
2479
|
+
function je(s) {
|
|
2480
|
+
return new pe(s);
|
|
2468
2481
|
}
|
|
2469
2482
|
export {
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
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,
|
|
2478
2491
|
K as I,
|
|
2479
|
-
|
|
2480
|
-
|
|
2492
|
+
q as J,
|
|
2493
|
+
P as K,
|
|
2481
2494
|
at as L,
|
|
2482
2495
|
U as M,
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2496
|
+
Yt as N,
|
|
2497
|
+
Ct as O,
|
|
2498
|
+
At as P,
|
|
2499
|
+
Se as R,
|
|
2487
2500
|
R as S,
|
|
2488
|
-
|
|
2489
|
-
|
|
2501
|
+
je as V,
|
|
2502
|
+
we as a,
|
|
2490
2503
|
tt as b,
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2504
|
+
xe as c,
|
|
2505
|
+
Tt as d,
|
|
2506
|
+
Ce as e,
|
|
2507
|
+
ae as f,
|
|
2495
2508
|
et as g,
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2509
|
+
le as h,
|
|
2510
|
+
Te as i,
|
|
2511
|
+
Ie as j,
|
|
2512
|
+
ie as k,
|
|
2513
|
+
ne as l,
|
|
2501
2514
|
it as m,
|
|
2502
2515
|
v as n,
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2516
|
+
$e as o,
|
|
2517
|
+
Xt as p,
|
|
2518
|
+
Ne as q,
|
|
2519
|
+
$t as r,
|
|
2520
|
+
_e as s,
|
|
2508
2521
|
nt as t,
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2522
|
+
ve as u,
|
|
2523
|
+
Ee as v,
|
|
2524
|
+
ze as w,
|
|
2525
|
+
Re as x,
|
|
2526
|
+
Mt as y,
|
|
2514
2527
|
_ as z
|
|
2515
2528
|
};
|