fiboui 2.2.4 → 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.
- package/README.md +3 -2
- package/dist/{FineGrain-Bishpo5C.js → FineGrain-BBvoBgWP.js} +1 -1
- package/dist/builder-FPfXLYM6.js +4160 -0
- package/dist/content.js +3 -3
- package/dist/core.js +57 -51
- package/dist/{index-CdDg3sZt.js → index-3GitHTeZ.js} +51 -51
- package/dist/{index-B_NshIUT.js → index-BuatCnp7.js} +3 -3
- package/dist/{index-K-VIFyCP.js → index-ClppTuYv.js} +35 -35
- package/dist/{index-CKbAiJg2.js → index-Cnox750A.js} +4 -4
- package/dist/{index-CIUytVXq.js → index-DkH15EIF.js} +12 -12
- package/dist/{index-nFXU29Ly.js → index-kWLK5n5t.js} +3 -3
- package/dist/index-y7-9rhRQ.js +160 -0
- package/dist/index.d.ts +588 -380
- package/dist/index.js +363 -347
- package/dist/interactive.js +1 -1
- package/dist/layout.js +2 -2
- package/dist/{mount-B316Ig0o.js → mount-Du-X9Dqn.js} +17 -17
- 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/builder-DxmEDvW3.js +0 -2517
- package/dist/index-Des7FiFH.js +0 -111
- package/dist/provider-CihtUuRx.js +0 -302
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var r = (n, s, e) =>
|
|
5
|
-
import i, { useState as
|
|
6
|
-
import {
|
|
2
|
+
var X = Object.defineProperty;
|
|
3
|
+
var q = (n, s, e) => s in n ? X(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
4
|
+
var r = (n, s, e) => q(n, typeof s != "symbol" ? s + "" : s, e);
|
|
5
|
+
import i, { useState as T, useRef as D, useLayoutEffect as G } from "react";
|
|
6
|
+
import { B as _, D as b, T as J, N as V, P as K } from "./builder-FPfXLYM6.js";
|
|
7
7
|
import { P as W } from "./PluginManager-D5-ApsSN.js";
|
|
8
|
-
import { R as Q, I as U } from "./index-
|
|
9
|
-
import { T as ee } from "./index-
|
|
8
|
+
import { R as Q, I as U } from "./index-kWLK5n5t.js";
|
|
9
|
+
import { T as ee } from "./index-y7-9rhRQ.js";
|
|
10
10
|
import { e as te, L as ie } from "./Link-ElmaMZB8.js";
|
|
11
11
|
class se extends b {
|
|
12
12
|
build() {
|
|
@@ -28,7 +28,7 @@ class se extends b {
|
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const Se = _(se);
|
|
32
32
|
class re extends b {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(...arguments);
|
|
@@ -91,7 +91,7 @@ class re extends b {
|
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const Ie = _(re);
|
|
95
95
|
class ne extends b {
|
|
96
96
|
build() {
|
|
97
97
|
const s = this.getClassName(), e = this.getStyle(), t = this.processChildren();
|
|
@@ -214,7 +214,7 @@ class ae extends b {
|
|
|
214
214
|
content: i.createElement(i.Fragment, null, ...J(e.children)),
|
|
215
215
|
fixed: e.fixed ?? !1
|
|
216
216
|
} : {
|
|
217
|
-
content:
|
|
217
|
+
content: V(e),
|
|
218
218
|
fixed: !1
|
|
219
219
|
};
|
|
220
220
|
}
|
|
@@ -222,8 +222,8 @@ class ae extends b {
|
|
|
222
222
|
return !e || typeof e != "object" || i.isValidElement(e) || "build" in e && typeof e.build == "function" ? !1 : "children" in e && !("type" in e);
|
|
223
223
|
}
|
|
224
224
|
build() {
|
|
225
|
-
var
|
|
226
|
-
const e = this.processChildren(), t = this._structure, o = this._headerBar && ((
|
|
225
|
+
var k, C, z, j, y, E, S, L, R, $, A, O, l, a, m, g, I, M, H, P, F, Y;
|
|
226
|
+
const e = this.processChildren(), t = this._structure, o = this._headerBar && ((k = t.header) == null ? void 0 : k.visible) !== !1, h = this._footerBar && ((C = t.footer) == null ? void 0 : C.visible) !== !1, c = this._sideBarLeft && ((z = t.sidebarLeft) == null ? void 0 : z.visible) !== !1, d = this._sideBarRight && ((j = t.sidebarRight) == null ? void 0 : j.visible) !== !1, f = c && ((y = t.sidebarLeft) == null ? void 0 : y.fullHeight), p = d && ((E = t.sidebarRight) == null ? void 0 : E.fullHeight), B = i.createElement(
|
|
227
227
|
"div",
|
|
228
228
|
{
|
|
229
229
|
key: "scaffold-middle",
|
|
@@ -240,7 +240,7 @@ class ae extends b {
|
|
|
240
240
|
key: "sidebar-left",
|
|
241
241
|
className: "z-20",
|
|
242
242
|
style: {
|
|
243
|
-
width: (
|
|
243
|
+
width: (S = t.sidebarLeft) == null ? void 0 : S.width,
|
|
244
244
|
position: ((L = t.sidebarLeft) == null ? void 0 : L.mode) === "over" ? "absolute" : ((R = t.sidebarLeft) == null ? void 0 : R.behavior) === "fixed" || this._sideBarLeft.fixed ? "sticky" : void 0,
|
|
245
245
|
top: (($ = t.sidebarLeft) == null ? void 0 : $.behavior) === "fixed" || this._sideBarLeft.fixed ? 0 : void 0,
|
|
246
246
|
height: ((A = t.sidebarLeft) == null ? void 0 : A.behavior) === "fixed" || this._sideBarLeft.fixed ? "100%" : void 0,
|
|
@@ -278,7 +278,7 @@ class ae extends b {
|
|
|
278
278
|
key: "header-bar",
|
|
279
279
|
className: "z-30",
|
|
280
280
|
style: {
|
|
281
|
-
height: (
|
|
281
|
+
height: (I = t.header) == null ? void 0 : I.height,
|
|
282
282
|
position: ((M = t.header) == null ? void 0 : M.position) || (this._headerBar.fixed ? "sticky" : "static"),
|
|
283
283
|
top: 0,
|
|
284
284
|
backgroundColor: "var(--fibo-surface, #ffffff)",
|
|
@@ -318,7 +318,7 @@ class ae extends b {
|
|
|
318
318
|
i.createElement("div", {
|
|
319
319
|
key: "sidebar-left-full",
|
|
320
320
|
style: {
|
|
321
|
-
width: (
|
|
321
|
+
width: (F = t.sidebarLeft) == null ? void 0 : F.width,
|
|
322
322
|
overflowY: "auto",
|
|
323
323
|
borderRight: "1px solid var(--fibo-outline, #e0e0e0)",
|
|
324
324
|
backgroundColor: "var(--fibo-surface, #ffffff)",
|
|
@@ -408,10 +408,10 @@ class ce extends b {
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
const Re = _(ce), de = i.memo((n) => {
|
|
411
|
-
const { width: s = 260, collapsed: e, className: t, style: o, children: h, ...c } = n, d = te(), f = (d == null ? void 0 : d.currentPath) ?? "", p = e ? 80 : s, w = W.getInstance().getSidebarItems().map((u,
|
|
411
|
+
const { width: s = 260, collapsed: e, className: t, style: o, children: h, ...c } = n, d = te(), f = (d == null ? void 0 : d.currentPath) ?? "", p = e ? 80 : s, w = W.getInstance().getSidebarItems().map((u, N) => {
|
|
412
412
|
const x = f === u.path;
|
|
413
413
|
return i.createElement(ie, {
|
|
414
|
-
key: `plugin-item-${u.path ||
|
|
414
|
+
key: `plugin-item-${u.path || N}`,
|
|
415
415
|
to: u.path,
|
|
416
416
|
className: "no-underline block mb-1",
|
|
417
417
|
children: Q().padding(12).alignItems("center").gap(12).className(`
|
|
@@ -459,7 +459,7 @@ class fe extends b {
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
const $e = _(fe), ue = i.memo((n) => {
|
|
462
|
-
const { sidebar: s, header: e, children: t, className: o, style: h, ...c } = n, [d, f] =
|
|
462
|
+
const { sidebar: s, header: e, children: t, className: o, style: h, ...c } = n, [d, f] = T(!1);
|
|
463
463
|
return i.createElement(
|
|
464
464
|
"div",
|
|
465
465
|
{
|
|
@@ -517,10 +517,10 @@ class me extends b {
|
|
|
517
517
|
r(this, "_header");
|
|
518
518
|
}
|
|
519
519
|
sidebar(e) {
|
|
520
|
-
return this._sidebar =
|
|
520
|
+
return this._sidebar = V(e), this;
|
|
521
521
|
}
|
|
522
522
|
header(e) {
|
|
523
|
-
return this._header =
|
|
523
|
+
return this._header = V(e), this;
|
|
524
524
|
}
|
|
525
525
|
build() {
|
|
526
526
|
const e = {
|
|
@@ -666,19 +666,19 @@ const Me = _(be), ye = i.memo((n) => {
|
|
|
666
666
|
containerHeight: c = 500,
|
|
667
667
|
className: d,
|
|
668
668
|
style: f
|
|
669
|
-
} = n, [p, B] =
|
|
669
|
+
} = n, [p, B] = T(0), w = D(null), u = D(/* @__PURE__ */ new Map()), N = D(/* @__PURE__ */ new Map()), x = s.length, v = e !== void 0, k = (l) => v ? e : N.current.get(l) ?? t, C = (l) => {
|
|
670
670
|
if (v)
|
|
671
671
|
return l * e;
|
|
672
672
|
let a = 0;
|
|
673
673
|
for (let m = 0; m < l; m++)
|
|
674
|
-
a +=
|
|
674
|
+
a += k(m);
|
|
675
675
|
return a;
|
|
676
676
|
}, z = () => {
|
|
677
677
|
if (v)
|
|
678
678
|
return x * e;
|
|
679
679
|
let l = 0;
|
|
680
680
|
for (let a = 0; a < x; a++)
|
|
681
|
-
l +=
|
|
681
|
+
l += k(a);
|
|
682
682
|
return l;
|
|
683
683
|
}, y = Math.max(0, ((l) => {
|
|
684
684
|
if (v)
|
|
@@ -697,21 +697,21 @@ const Me = _(be), ye = i.memo((n) => {
|
|
|
697
697
|
} else {
|
|
698
698
|
let l = C(y), a = y;
|
|
699
699
|
for (; l < p + c + h * t && a < x; )
|
|
700
|
-
l +=
|
|
700
|
+
l += k(a), a++;
|
|
701
701
|
E = Math.min(x, a);
|
|
702
702
|
}
|
|
703
|
-
const
|
|
704
|
-
|
|
703
|
+
const S = s.slice(y, E), L = C(y), R = z(), [$, A] = T(0);
|
|
704
|
+
G(() => {
|
|
705
705
|
if (!o || v) return;
|
|
706
706
|
let l = !1;
|
|
707
|
-
|
|
708
|
-
const g = y + m,
|
|
709
|
-
if (
|
|
710
|
-
const H =
|
|
711
|
-
H > 0 &&
|
|
707
|
+
S.forEach((a, m) => {
|
|
708
|
+
const g = y + m, I = u.current.get(g);
|
|
709
|
+
if (I) {
|
|
710
|
+
const H = I.getBoundingClientRect().height;
|
|
711
|
+
H > 0 && N.current.get(g) !== H && (N.current.set(g, H), l = !0);
|
|
712
712
|
}
|
|
713
713
|
}), l && A((a) => a + 1);
|
|
714
|
-
}, [
|
|
714
|
+
}, [S, y, o, v, $]);
|
|
715
715
|
const O = (l) => {
|
|
716
716
|
B(l.currentTarget.scrollTop);
|
|
717
717
|
};
|
|
@@ -747,7 +747,7 @@ const Me = _(be), ye = i.memo((n) => {
|
|
|
747
747
|
width: "100%"
|
|
748
748
|
}
|
|
749
749
|
},
|
|
750
|
-
|
|
750
|
+
S.map((l, a) => {
|
|
751
751
|
const m = y + a;
|
|
752
752
|
return i.createElement(
|
|
753
753
|
"div",
|
|
@@ -804,14 +804,14 @@ class xe extends b {
|
|
|
804
804
|
}
|
|
805
805
|
const Pe = _(xe);
|
|
806
806
|
export {
|
|
807
|
-
|
|
807
|
+
Se as C,
|
|
808
808
|
Ae as D,
|
|
809
809
|
Re as H,
|
|
810
810
|
je as L,
|
|
811
811
|
ze as S,
|
|
812
812
|
Pe as V,
|
|
813
813
|
Oe as Z,
|
|
814
|
-
|
|
814
|
+
Ie as a,
|
|
815
815
|
He as b,
|
|
816
816
|
Le as c,
|
|
817
817
|
$e as d,
|
|
@@ -3,10 +3,10 @@ var U = Object.defineProperty;
|
|
|
3
3
|
var G = (n, s, e) => s in n ? U(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
4
4
|
var r = (n, s, e) => G(n, typeof s != "symbol" ? s + "" : s, e);
|
|
5
5
|
import t from "react";
|
|
6
|
-
import {
|
|
7
|
-
import { B as j } from "./index-
|
|
8
|
-
import { T as O } from "./index-
|
|
9
|
-
import { R as J } from "./index-
|
|
6
|
+
import { B as C, D as F } from "./builder-FPfXLYM6.js";
|
|
7
|
+
import { B as j } from "./index-BuatCnp7.js";
|
|
8
|
+
import { T as O } from "./index-y7-9rhRQ.js";
|
|
9
|
+
import { R as J } from "./index-kWLK5n5t.js";
|
|
10
10
|
import { jsxs as $, jsx as f } from "react/jsx-runtime";
|
|
11
11
|
const K = ({ size: n }) => t.createElement(
|
|
12
12
|
"svg",
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
var oe = Object.defineProperty;
|
|
3
3
|
var le = (n, s, e) => s in n ? oe(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
4
4
|
var i = (n, s, e) => le(n, typeof s != "symbol" ? s + "" : s, e);
|
|
5
|
-
import t, { useState as D, useRef as L, useLayoutEffect as
|
|
6
|
-
import { w,
|
|
7
|
-
import { B as C } from "./index-
|
|
5
|
+
import t, { useState as D, useRef as L, useLayoutEffect as Q, useEffect as ce } from "react";
|
|
6
|
+
import { B as w, D as I, N as T, Q as Z } from "./builder-FPfXLYM6.js";
|
|
7
|
+
import { B as C } from "./index-BuatCnp7.js";
|
|
8
8
|
import { t as de } from "./bundle-mjs-wppB-TKB.js";
|
|
9
|
-
import { T as me } from "./index-
|
|
9
|
+
import { T as me } from "./index-y7-9rhRQ.js";
|
|
10
10
|
const he = t.memo((n) => {
|
|
11
11
|
const { text: s, subtitle: e, number: r, color: d, className: p, style: c, children: u, ...g } = n;
|
|
12
12
|
return t.createElement(
|
|
@@ -132,7 +132,7 @@ class V {
|
|
|
132
132
|
}), s.join("; ") + ";";
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
const pe = 100,
|
|
135
|
+
const pe = 100, q = 60, J = 5, fe = t.memo((n) => {
|
|
136
136
|
const {
|
|
137
137
|
items: s,
|
|
138
138
|
renderItem: e,
|
|
@@ -149,7 +149,7 @@ const pe = 100, J = 60, Q = 5, fe = t.memo((n) => {
|
|
|
149
149
|
customItemHover: o,
|
|
150
150
|
customItemActive: _,
|
|
151
151
|
customItemFocus: y
|
|
152
|
-
} = n, [H, ee] = D(0), [te, se] = D(0), re = L(null), R = L(/* @__PURE__ */ new Map()), O = L(/* @__PURE__ */ new Map()), F = L(null), b = a === "horizontal", $ = s.length, B = $ > pe, A = (h) => O.current.get(h) ??
|
|
152
|
+
} = n, [H, ee] = D(0), [te, se] = D(0), re = L(null), R = L(/* @__PURE__ */ new Map()), O = L(/* @__PURE__ */ new Map()), F = L(null), b = a === "horizontal", $ = s.length, B = $ > pe, A = (h) => O.current.get(h) ?? q, j = (h) => {
|
|
153
153
|
let l = 0;
|
|
154
154
|
for (let f = 0; f < h; f++)
|
|
155
155
|
l += A(f);
|
|
@@ -169,14 +169,14 @@ const pe = 100, J = 60, Q = 5, fe = t.memo((n) => {
|
|
|
169
169
|
};
|
|
170
170
|
let S = 0, X = $, G = 0, M = 0;
|
|
171
171
|
if (B) {
|
|
172
|
-
S = Math.max(0, ne(H) -
|
|
172
|
+
S = Math.max(0, ne(H) - J);
|
|
173
173
|
let h = j(S), l = S;
|
|
174
|
-
for (; h < H + v +
|
|
174
|
+
for (; h < H + v + J * q && l < $; )
|
|
175
175
|
h += A(l), l++;
|
|
176
176
|
X = Math.min($, l), G = j(S), M = ie();
|
|
177
177
|
}
|
|
178
178
|
const P = s.slice(S, X);
|
|
179
|
-
|
|
179
|
+
Q(() => {
|
|
180
180
|
if (!B) return;
|
|
181
181
|
let h = !1;
|
|
182
182
|
P.forEach((l, f) => {
|
|
@@ -186,7 +186,7 @@ const pe = 100, J = 60, Q = 5, fe = t.memo((n) => {
|
|
|
186
186
|
z > 0 && O.current.get(N) !== z && (O.current.set(N, z), h = !0);
|
|
187
187
|
}
|
|
188
188
|
}), h && se((l) => l + 1);
|
|
189
|
-
}, [P, S, B, b, te]),
|
|
189
|
+
}, [P, S, B, b, te]), Q(() => {
|
|
190
190
|
if (!u || p) return;
|
|
191
191
|
const h = new IntersectionObserver(
|
|
192
192
|
(l) => {
|
|
@@ -915,7 +915,7 @@ const Ce = t.memo(({ builder: n }) => {
|
|
|
915
915
|
return a;
|
|
916
916
|
const _ = m[o % m.length];
|
|
917
917
|
return t.createElement("div", {
|
|
918
|
-
key:
|
|
918
|
+
key: Z(a, o),
|
|
919
919
|
style: { gridColumn: `span ${_.col}`, gridRow: `span ${_.row}` }
|
|
920
920
|
}, a);
|
|
921
921
|
}));
|
|
@@ -936,7 +936,7 @@ const Ce = t.memo(({ builder: n }) => {
|
|
|
936
936
|
}, t.Children.map(
|
|
937
937
|
s,
|
|
938
938
|
(a, o) => t.createElement("div", {
|
|
939
|
-
key:
|
|
939
|
+
key: Z(a, o),
|
|
940
940
|
className: "break-inside-avoid mb-4"
|
|
941
941
|
}, a)
|
|
942
942
|
));
|
|
@@ -3,7 +3,7 @@ var m = Object.defineProperty;
|
|
|
3
3
|
var p = (e, t, s) => t in e ? m(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
4
4
|
var r = (e, t, s) => p(e, typeof t != "symbol" ? t + "" : t, s);
|
|
5
5
|
import o from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { B as a, D as u } from "./builder-FPfXLYM6.js";
|
|
7
7
|
class g extends u {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
@@ -59,7 +59,7 @@ class g extends u {
|
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const x = a(g), _ = o.memo((e) => {
|
|
63
63
|
const {
|
|
64
64
|
source: t,
|
|
65
65
|
color: s,
|
|
@@ -116,5 +116,5 @@ class f extends u {
|
|
|
116
116
|
const w = a(f);
|
|
117
117
|
export {
|
|
118
118
|
w as I,
|
|
119
|
-
|
|
119
|
+
x as R
|
|
120
120
|
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var f = Object.defineProperty;
|
|
3
|
+
var b = (i, e, t) => e in i ? f(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
4
|
+
var a = (i, e, t) => b(i, typeof e != "symbol" ? e + "" : e, t);
|
|
5
|
+
import o from "react";
|
|
6
|
+
import { B as c, D as x } from "./builder-FPfXLYM6.js";
|
|
7
|
+
import { F as g } from "./FineGrain-BBvoBgWP.js";
|
|
8
|
+
const p = {
|
|
9
|
+
h1: {
|
|
10
|
+
fontSize: "var(--fibo-text-h1-size, 2.25rem)",
|
|
11
|
+
fontWeight: "var(--fibo-text-h1-weight, 700)",
|
|
12
|
+
letterSpacing: "var(--fibo-text-h1-tracking, -0.025em)",
|
|
13
|
+
lineHeight: "var(--fibo-text-h1-height, 1.2)",
|
|
14
|
+
color: "var(--fibo-text-h1-color, inherit)"
|
|
15
|
+
},
|
|
16
|
+
h2: {
|
|
17
|
+
fontSize: "var(--fibo-text-h2-size, 1.875rem)",
|
|
18
|
+
fontWeight: "var(--fibo-text-h2-weight, 700)",
|
|
19
|
+
letterSpacing: "var(--fibo-text-h2-tracking, -0.025em)",
|
|
20
|
+
lineHeight: "var(--fibo-text-h2-height, 1.25)",
|
|
21
|
+
color: "var(--fibo-text-h2-color, inherit)"
|
|
22
|
+
},
|
|
23
|
+
h3: {
|
|
24
|
+
fontSize: "var(--fibo-text-h3-size, 1.5rem)",
|
|
25
|
+
fontWeight: "var(--fibo-text-h3-weight, 600)",
|
|
26
|
+
letterSpacing: "var(--fibo-text-h3-tracking, -0.02em)",
|
|
27
|
+
lineHeight: "var(--fibo-text-h3-height, 1.3)",
|
|
28
|
+
color: "var(--fibo-text-h3-color, inherit)"
|
|
29
|
+
},
|
|
30
|
+
h4: {
|
|
31
|
+
fontSize: "var(--fibo-text-h4-size, 1.25rem)",
|
|
32
|
+
fontWeight: "var(--fibo-text-h4-weight, 600)",
|
|
33
|
+
lineHeight: "var(--fibo-text-h4-height, 1.35)",
|
|
34
|
+
color: "var(--fibo-text-h4-color, inherit)"
|
|
35
|
+
},
|
|
36
|
+
h5: {
|
|
37
|
+
fontSize: "var(--fibo-text-h5-size, 1.125rem)",
|
|
38
|
+
fontWeight: "var(--fibo-text-h5-weight, 600)",
|
|
39
|
+
lineHeight: "var(--fibo-text-h5-height, 1.4)",
|
|
40
|
+
color: "var(--fibo-text-h5-color, inherit)"
|
|
41
|
+
},
|
|
42
|
+
h6: {
|
|
43
|
+
fontSize: "var(--fibo-text-h6-size, 1rem)",
|
|
44
|
+
fontWeight: "var(--fibo-text-h6-weight, 600)",
|
|
45
|
+
lineHeight: "var(--fibo-text-h6-height, 1.45)",
|
|
46
|
+
color: "var(--fibo-text-h6-color, inherit)"
|
|
47
|
+
},
|
|
48
|
+
body: {
|
|
49
|
+
fontSize: "var(--fibo-text-body-size, 1rem)",
|
|
50
|
+
fontWeight: "var(--fibo-text-body-weight, 400)",
|
|
51
|
+
lineHeight: "var(--fibo-text-body-height, 1.5)",
|
|
52
|
+
color: "var(--fibo-text-body-color, inherit)"
|
|
53
|
+
},
|
|
54
|
+
caption: {
|
|
55
|
+
fontSize: "var(--fibo-text-caption-size, 0.875rem)",
|
|
56
|
+
fontWeight: "var(--fibo-text-caption-weight, 400)",
|
|
57
|
+
lineHeight: "var(--fibo-text-caption-height, 1.4)",
|
|
58
|
+
color: "var(--fibo-text-caption-color, inherit)"
|
|
59
|
+
},
|
|
60
|
+
label: {
|
|
61
|
+
fontSize: "var(--fibo-text-label-size, 0.875rem)",
|
|
62
|
+
fontWeight: "var(--fibo-text-label-weight, 500)",
|
|
63
|
+
letterSpacing: "var(--fibo-text-label-tracking, 0.01em)",
|
|
64
|
+
lineHeight: "var(--fibo-text-label-height, 1.4)",
|
|
65
|
+
color: "var(--fibo-text-label-color, inherit)"
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function n(i, e) {
|
|
69
|
+
return {
|
|
70
|
+
margin: 0,
|
|
71
|
+
overflowWrap: "anywhere",
|
|
72
|
+
wordBreak: "break-word",
|
|
73
|
+
maxWidth: "100%",
|
|
74
|
+
...p[i],
|
|
75
|
+
...e
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const m = o.memo((i) => {
|
|
79
|
+
const { text: e, type: t, className: h, style: r, ...s } = i, l = {
|
|
80
|
+
h1: "h1",
|
|
81
|
+
h2: "h2",
|
|
82
|
+
h3: "h3",
|
|
83
|
+
h4: "h4",
|
|
84
|
+
h5: "h5",
|
|
85
|
+
h6: "h6",
|
|
86
|
+
body: "p",
|
|
87
|
+
caption: "span",
|
|
88
|
+
label: "label"
|
|
89
|
+
};
|
|
90
|
+
return o.createElement(
|
|
91
|
+
l[t],
|
|
92
|
+
{
|
|
93
|
+
className: `fibo-text fibo-text-${t} min-w-0 ${h}`,
|
|
94
|
+
style: n(t, r),
|
|
95
|
+
...s
|
|
96
|
+
},
|
|
97
|
+
e
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
class v extends x {
|
|
101
|
+
constructor(t = "") {
|
|
102
|
+
super();
|
|
103
|
+
a(this, "_text", "");
|
|
104
|
+
a(this, "_type", "body");
|
|
105
|
+
this.text(t);
|
|
106
|
+
}
|
|
107
|
+
text(t) {
|
|
108
|
+
return this._text = t, this;
|
|
109
|
+
}
|
|
110
|
+
type(t) {
|
|
111
|
+
return this._type = t, this;
|
|
112
|
+
}
|
|
113
|
+
variant(t) {
|
|
114
|
+
return this._type = t, this;
|
|
115
|
+
}
|
|
116
|
+
nowrap() {
|
|
117
|
+
return this._classNames.push("whitespace-nowrap"), this;
|
|
118
|
+
}
|
|
119
|
+
mono() {
|
|
120
|
+
return this._classNames.push("font-mono"), this;
|
|
121
|
+
}
|
|
122
|
+
muted() {
|
|
123
|
+
return this._style = { ...this._style, color: "#9a9a9a" }, this;
|
|
124
|
+
}
|
|
125
|
+
build() {
|
|
126
|
+
const t = {
|
|
127
|
+
h1: "h1",
|
|
128
|
+
h2: "h2",
|
|
129
|
+
h3: "h3",
|
|
130
|
+
h4: "h4",
|
|
131
|
+
h5: "h5",
|
|
132
|
+
h6: "h6",
|
|
133
|
+
body: "p",
|
|
134
|
+
caption: "span",
|
|
135
|
+
label: "label"
|
|
136
|
+
};
|
|
137
|
+
if (typeof this._text == "function") {
|
|
138
|
+
const r = this._text;
|
|
139
|
+
return o.createElement(g, {
|
|
140
|
+
compute: r,
|
|
141
|
+
as: t[this._type],
|
|
142
|
+
className: `fibo-text fibo-text-${this._type} min-w-0 ${this.getClassName()}`,
|
|
143
|
+
style: n(this._type, this.getStyle()),
|
|
144
|
+
...this._props
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const h = {
|
|
148
|
+
text: this._text,
|
|
149
|
+
type: this._type,
|
|
150
|
+
className: this.getClassName(),
|
|
151
|
+
style: this.getStyle(),
|
|
152
|
+
...this._props
|
|
153
|
+
};
|
|
154
|
+
return o.createElement(m, h);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const z = c(v);
|
|
158
|
+
export {
|
|
159
|
+
z as T
|
|
160
|
+
};
|