fiboui 2.4.4 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1031 +0,0 @@
1
- "use client";
2
- var le = Object.defineProperty;
3
- var ce = (n, t, e) => t in n ? le(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
4
- var i = (n, t, e) => ce(n, typeof t != "symbol" ? t + "" : t, e);
5
- import s, { useState as X, useRef as L, useLayoutEffect as Z, useEffect as de } from "react";
6
- import { D as w, E as I, Q as T, T as q } from "./builder-B5cebEWZ.js";
7
- import { B as $ } from "./index-orKQGpHl.js";
8
- import { t as me } from "./bundle-mjs-wppB-TKB.js";
9
- import { T as he } from "./index-DbaNIwWW.js";
10
- const ue = s.memo((n) => {
11
- const { text: t, subtitle: e, number: r, color: d, className: p, style: c, children: u, ...g } = n;
12
- return s.createElement(
13
- "div",
14
- {
15
- className: `rounded-[24px] shadow-[0_8px_30px_rgb(0,0,0,0.04)] hover:shadow-[0_8px_30px_rgb(0,0,0,0.08)] transition-shadow duration-300 border-none p-4 ${p || ""}`,
16
- style: { backgroundColor: "#ffffff", ...c },
17
- ...g
18
- },
19
- s.createElement(
20
- "div",
21
- { className: "flex flex-col gap-2" },
22
- t && s.createElement(
23
- "h3",
24
- {
25
- className: "font-semibold text-[var(--fibo-on-surface-variant)] text-sm uppercase tracking-wide"
26
- },
27
- t
28
- ),
29
- r && s.createElement(
30
- "p",
31
- {
32
- className: "font-bold text-[var(--fibo-on-surface)] text-3xl"
33
- },
34
- r
35
- ),
36
- e && s.createElement(
37
- "p",
38
- {
39
- className: "text-[var(--fibo-on-surface-variant)] text-xs"
40
- },
41
- e
42
- ),
43
- ...u
44
- )
45
- );
46
- });
47
- class pe extends I {
48
- constructor() {
49
- super(...arguments);
50
- i(this, "_text", "");
51
- i(this, "_subtitle");
52
- i(this, "_number");
53
- i(this, "_color");
54
- }
55
- text(e) {
56
- return this._text = e, this;
57
- }
58
- subtitle(e) {
59
- return this._subtitle = e, this;
60
- }
61
- number(e) {
62
- return this._number = e, this;
63
- }
64
- color(e) {
65
- return this._color = e, this;
66
- }
67
- build() {
68
- const e = {
69
- green: "border-l-green-500",
70
- orange: "border-l-orange-500",
71
- red: "border-l-red-500",
72
- blue: "border-l-blue-500",
73
- purple: "border-l-purple-500"
74
- }, r = [
75
- "fibo-card",
76
- this._color ? `border-l-4 ${e[this._color]}` : "",
77
- ...this._classNames
78
- ].filter(Boolean).join(" "), d = {
79
- text: this._text,
80
- subtitle: this._subtitle,
81
- number: this._number,
82
- color: this._color,
83
- className: r,
84
- style: this.getStyle(),
85
- children: this.processChildren(),
86
- ...this._props
87
- };
88
- return s.createElement(ue, d);
89
- }
90
- }
91
- const Me = w(pe);
92
- class V {
93
- constructor() {
94
- i(this, "styles", /* @__PURE__ */ new Map());
95
- }
96
- bg(t) {
97
- return this.styles.set("background-color", t), this;
98
- }
99
- color(t) {
100
- return this.styles.set("color", t), this;
101
- }
102
- opacity(t) {
103
- return this.styles.set("opacity", String(t)), this;
104
- }
105
- borderColor(t) {
106
- return this.styles.set("border-color", t), this;
107
- }
108
- transform(t) {
109
- return this.styles.set("transform", t), this;
110
- }
111
- scale(t) {
112
- return this.styles.set("transform", `scale(${t})`), this;
113
- }
114
- translateX(t) {
115
- const e = typeof t == "number" ? `${t}px` : t;
116
- return this.styles.set("transform", `translateX(${e})`), this;
117
- }
118
- translateY(t) {
119
- const e = typeof t == "number" ? `${t}px` : t;
120
- return this.styles.set("transform", `translateY(${e})`), this;
121
- }
122
- shadow(t) {
123
- return this.styles.set("box-shadow", t), this;
124
- }
125
- css(t, e) {
126
- return this.styles.set(t, e), this;
127
- }
128
- toCSSString() {
129
- const t = [];
130
- return this.styles.forEach((e, r) => {
131
- t.push(`${r}: ${e}`);
132
- }), t.join("; ") + ";";
133
- }
134
- }
135
- const fe = 100, J = 60, ee = 5;
136
- function D(n) {
137
- return n.split(";").map((t) => t.trim()).filter(Boolean).map((t) => /\s!important\s*$/i.test(t) ? t : `${t} !important`).join("; ");
138
- }
139
- const ge = s.memo((n) => {
140
- const {
141
- items: t,
142
- renderItem: e,
143
- variant: r,
144
- separator: d,
145
- loading: p,
146
- threshold: c,
147
- onEndReached: u,
148
- className: g,
149
- style: x,
150
- containerHeight: v = 500,
151
- resetItemStyles: m = !1,
152
- direction: a = "vertical",
153
- customItemHover: o,
154
- customItemActive: _,
155
- customItemFocus: y
156
- } = n, [H, te] = X(0), [se, re] = X(0), ie = L(null), R = L(/* @__PURE__ */ new Map()), O = L(/* @__PURE__ */ new Map()), F = L(null), b = a === "horizontal", C = t.length, B = C > fe, A = (h) => O.current.get(h) ?? J, j = (h) => {
157
- let l = 0;
158
- for (let f = 0; f < h; f++)
159
- l += A(f);
160
- return l;
161
- }, ne = () => {
162
- let h = 0;
163
- for (let l = 0; l < C; l++)
164
- h += A(l);
165
- return h;
166
- }, ae = (h) => {
167
- let l = 0, f = C - 1;
168
- for (; l < f; ) {
169
- const N = Math.floor((l + f) / 2);
170
- j(N) < h ? l = N + 1 : f = N;
171
- }
172
- return Math.max(0, l - 1);
173
- };
174
- let S = 0, Y = C, G = 0, M = 0;
175
- if (B) {
176
- S = Math.max(0, ae(H) - ee);
177
- let h = j(S), l = S;
178
- for (; h < H + v + ee * J && l < C; )
179
- h += A(l), l++;
180
- Y = Math.min(C, l), G = j(S), M = ne();
181
- }
182
- const P = t.slice(S, Y);
183
- Z(() => {
184
- if (!B) return;
185
- let h = !1;
186
- P.forEach((l, f) => {
187
- const N = S + f, k = R.current.get(N);
188
- if (k) {
189
- const Q = k.getBoundingClientRect(), z = b ? Q.width : Q.height;
190
- z > 0 && O.current.get(N) !== z && (O.current.set(N, z), h = !0);
191
- }
192
- }), h && re((l) => l + 1);
193
- }, [P, S, B, b, se]), Z(() => {
194
- if (!u || p) return;
195
- const h = new IntersectionObserver(
196
- (l) => {
197
- l[0].isIntersecting && (u == null || u());
198
- },
199
- { threshold: c }
200
- );
201
- return F.current && h.observe(F.current), () => h.disconnect();
202
- }, [p, t.length, u, c]);
203
- const oe = (h) => {
204
- B && te(b ? h.currentTarget.scrollLeft : h.currentTarget.scrollTop);
205
- };
206
- de(() => {
207
- if (typeof document > "u" || !o && !_ && !y) return;
208
- const h = "fibo-list-custom-styles";
209
- let l = document.getElementById(h);
210
- l || (l = document.createElement("style"), l.id = h, document.head.appendChild(l));
211
- let f = "";
212
- return o && (f += `.fibo-list-item-custom-hover:hover { ${D(o)} }
213
- `), _ && (f += `.fibo-list-item-custom-active:active { ${D(_)} }
214
- `), y && (f += `.fibo-list-item-custom-focus:focus { ${D(y)} }
215
- `), l.textContent = f, () => {
216
- };
217
- }, [o, _, y]);
218
- const W = {
219
- default: { gap: "0px" },
220
- card: { gap: "12px" },
221
- floating: { gap: "8px" }
222
- }, U = m ? {
223
- default: {},
224
- card: {},
225
- floating: {}
226
- } : {
227
- default: {
228
- padding: "12px 16px",
229
- borderBottom: d ? "1px solid #F3F4F6" : "none",
230
- // Transparent via class, not inline — so Tailwind / itemHover bg can win.
231
- transition: "background-color 0.2s ease-out"
232
- },
233
- card: {
234
- padding: "16px",
235
- backgroundColor: "#fff",
236
- borderRadius: "16px",
237
- boxShadow: "0 2px 8px -2px rgba(0,0,0,0.05)",
238
- border: "1px solid #F3F4F6",
239
- transform: "translate3d(0, 0, 0)",
240
- transition: "transform 0.2s ease-out, box-shadow 0.2s ease-out"
241
- },
242
- floating: {
243
- padding: "8px 12px",
244
- borderRadius: "12px",
245
- transition: "background-color 0.2s ease-out, box-shadow 0.2s ease-out"
246
- }
247
- }, E = [];
248
- o && E.push("fibo-list-item-custom-hover"), _ && E.push("fibo-list-item-custom-active"), y && E.push("fibo-list-item-custom-focus");
249
- const K = m ? {
250
- default: [...E],
251
- card: [...E],
252
- floating: [...E]
253
- } : {
254
- default: ["hover:bg-gray-50", "first:rounded-t-xl", "last:rounded-b-xl", ...E],
255
- card: ["hover:-translate-y-0.5", "hover:shadow-md", ...E],
256
- floating: ["hover:bg-white", "hover:shadow-sm", ...E]
257
- };
258
- return B ? s.createElement(
259
- "div",
260
- {
261
- ref: ie,
262
- className: `fibo-list fibo-list-virtualized ${g || ""}`,
263
- style: {
264
- height: b ? void 0 : `${v}px`,
265
- width: b ? `${v}px` : void 0,
266
- overflowY: b ? "hidden" : "auto",
267
- overflowX: b ? "auto" : "hidden",
268
- position: "relative",
269
- display: "flex",
270
- flexDirection: b ? "row" : "column",
271
- ...W[r],
272
- ...x
273
- },
274
- onScroll: oe
275
- },
276
- s.createElement("div", {
277
- style: {
278
- height: b ? "1px" : `${M}px`,
279
- width: b ? `${M}px` : "1px",
280
- position: "absolute",
281
- top: 0,
282
- left: 0,
283
- visibility: "hidden",
284
- pointerEvents: "none"
285
- }
286
- }),
287
- s.createElement(
288
- "div",
289
- {
290
- style: {
291
- transform: b ? `translateX(${G}px)` : `translateY(${G}px)`,
292
- width: b ? "auto" : "100%",
293
- height: b ? "100%" : void 0,
294
- display: b ? "flex" : void 0,
295
- flexDirection: b ? "row" : void 0
296
- }
297
- },
298
- P.map((h, l) => {
299
- const f = S + l, N = e ? e(h, f) : null;
300
- return s.cloneElement(
301
- $().style(U[r]).classNames(K[r]).children(N).build(),
302
- {
303
- key: `item-${f}`,
304
- ref: (k) => {
305
- k ? R.current.set(f, k) : R.current.delete(f);
306
- }
307
- }
308
- );
309
- })
310
- ),
311
- u && s.createElement("div", {
312
- ref: F,
313
- className: "py-4 flex justify-center w-full"
314
- }, p ? s.createElement("div", { className: "animate-spin rounded-full h-5 w-5 border-2 border-gray-300 border-b-blue-600" }) : s.createElement("div", { style: { height: "20px" } }))
315
- ) : $().className(g).classNames(["flex", a === "horizontal" ? "flex-row" : "flex-col", "w-full"]).style({
316
- ...W[r],
317
- ...x
318
- }).children(
319
- s.createElement(s.Fragment, {}, [
320
- ...t.map(
321
- (h, l) => s.cloneElement(
322
- $().style(U[r]).classNames(K[r]).children(
323
- e ? e(h, l) : null
324
- ).build(),
325
- { key: `item-${l}` }
326
- )
327
- ),
328
- u && s.createElement("div", {
329
- ref: F,
330
- className: "py-4 flex justify-center w-full"
331
- }, p ? s.createElement("div", { className: "animate-spin rounded-full h-5 w-5 border-2 border-gray-300 border-b-blue-600" }) : s.createElement("div", { style: { height: "20px" } }))
332
- ])
333
- ).build();
334
- });
335
- class _e extends I {
336
- constructor() {
337
- super(...arguments);
338
- i(this, "_items", []);
339
- i(this, "_renderItem");
340
- i(this, "_variant", "default");
341
- i(this, "_separator", !1);
342
- i(this, "_onEndReached");
343
- i(this, "_loading", !1);
344
- i(this, "_threshold", 0.5);
345
- i(this, "_containerHeight", 500);
346
- i(this, "_resetItemStyles", !1);
347
- i(this, "_direction", "vertical");
348
- i(this, "_customItemHover");
349
- i(this, "_customItemActive");
350
- i(this, "_customItemFocus");
351
- }
352
- items(e) {
353
- return this._items = e, this;
354
- }
355
- renderItem(e) {
356
- return this._renderItem = e, this;
357
- }
358
- variant(e) {
359
- return this._variant = e, this;
360
- }
361
- separator(e = !0) {
362
- return this._separator = e, this;
363
- }
364
- onEndReached(e) {
365
- return this._onEndReached = e, this;
366
- }
367
- loading(e) {
368
- return this._loading = e, this;
369
- }
370
- threshold(e) {
371
- return this._threshold = e, this;
372
- }
373
- containerHeight(e) {
374
- return this._containerHeight = e, this;
375
- }
376
- resetItemStyles(e = !0) {
377
- return this._resetItemStyles = e, this;
378
- }
379
- direction(e) {
380
- return this._direction = e, this;
381
- }
382
- reset() {
383
- return this._resetItemStyles = !0, this;
384
- }
385
- itemHover(e) {
386
- if (typeof e == "function") {
387
- const r = new V();
388
- e(r), this._customItemHover = r.toCSSString();
389
- } else
390
- this._customItemHover = e;
391
- return this;
392
- }
393
- itemActive(e) {
394
- if (typeof e == "function") {
395
- const r = new V();
396
- e(r), this._customItemActive = r.toCSSString();
397
- } else
398
- this._customItemActive = e;
399
- return this;
400
- }
401
- itemFocus(e) {
402
- if (typeof e == "function") {
403
- const r = new V();
404
- e(r), this._customItemFocus = r.toCSSString();
405
- } else
406
- this._customItemFocus = e;
407
- return this;
408
- }
409
- build() {
410
- const e = {
411
- items: this._items,
412
- renderItem: this._renderItem,
413
- variant: this._variant,
414
- separator: this._separator,
415
- loading: this._loading,
416
- threshold: this._threshold,
417
- onEndReached: this._onEndReached,
418
- containerHeight: this._containerHeight,
419
- resetItemStyles: this._resetItemStyles,
420
- direction: this._direction,
421
- customItemHover: this._customItemHover,
422
- customItemActive: this._customItemActive,
423
- customItemFocus: this._customItemFocus,
424
- className: this.getClassName(),
425
- style: this.getStyle()
426
- };
427
- return s.createElement(ge, e);
428
- }
429
- }
430
- const Pe = w(_e), be = () => s.createElement(
431
- "svg",
432
- {
433
- width: 12,
434
- height: 12,
435
- viewBox: "0 0 24 24",
436
- fill: "none",
437
- stroke: "currentColor",
438
- strokeWidth: 2,
439
- "aria-hidden": !0
440
- },
441
- s.createElement("path", { d: "M9 5l7 7-7 7" })
442
- ), ye = s.memo((n) => {
443
- const {
444
- leading: t,
445
- title: e,
446
- subtitle: r,
447
- trailing: d,
448
- chevron: p,
449
- divider: c,
450
- dividerColor: u,
451
- onPress: g,
452
- className: x,
453
- style: v,
454
- ...m
455
- } = n, a = v || {}, o = a.padding ?? "14px 0", _ = typeof e == "string" ? s.createElement(
456
- "span",
457
- {
458
- className: "fibo-list-tile-title",
459
- style: { fontSize: 11, letterSpacing: "0.06em", lineHeight: 1.3, margin: 0 }
460
- },
461
- e
462
- ) : e, y = typeof r == "string" ? s.createElement(
463
- "span",
464
- {
465
- className: "fibo-list-tile-subtitle",
466
- style: {
467
- fontSize: 8,
468
- letterSpacing: "0.06em",
469
- lineHeight: 1.3,
470
- margin: 0,
471
- color: "#9a9a9a"
472
- }
473
- },
474
- r
475
- ) : r;
476
- return s.createElement(
477
- "div",
478
- {
479
- className: me("fibo-list-tile flex flex-row items-center w-full", x),
480
- style: {
481
- padding: o,
482
- borderBottom: c ? `1px solid ${u || "#3b3b3b"}` : "none",
483
- cursor: g ? "pointer" : void 0,
484
- ...a
485
- },
486
- onClick: g,
487
- role: g ? "button" : void 0,
488
- ...m
489
- },
490
- t ? s.createElement(
491
- "div",
492
- {
493
- key: "leading",
494
- className: "fibo-list-tile-leading shrink-0 flex items-center",
495
- style: { color: "#9a9a9a", marginRight: 12 }
496
- },
497
- t
498
- ) : null,
499
- s.createElement(
500
- "div",
501
- {
502
- key: "body",
503
- className: "fibo-list-tile-body flex-1 min-w-0 flex flex-col justify-center"
504
- },
505
- _,
506
- y
507
- ),
508
- d ? s.createElement(
509
- "div",
510
- {
511
- key: "trailing",
512
- className: "fibo-list-tile-trailing shrink-0 flex items-center",
513
- style: { color: "#9a9a9a", marginLeft: 12 }
514
- },
515
- d
516
- ) : null,
517
- p ? s.createElement(
518
- "div",
519
- {
520
- key: "chevron",
521
- className: "fibo-list-tile-chevron shrink-0 flex items-center",
522
- style: { color: "#9a9a9a", marginLeft: d ? 8 : 0 }
523
- },
524
- s.createElement(be)
525
- ) : null
526
- );
527
- });
528
- class xe extends I {
529
- constructor() {
530
- super(...arguments);
531
- i(this, "_leading");
532
- i(this, "_title");
533
- i(this, "_subtitle");
534
- i(this, "_trailing");
535
- i(this, "_chevron", !1);
536
- i(this, "_divider", !1);
537
- i(this, "_dividerColor");
538
- i(this, "_onPress");
539
- }
540
- leading(e) {
541
- return this._leading = T(e), this;
542
- }
543
- icon(e) {
544
- return this.leading(e);
545
- }
546
- title(e) {
547
- return this._title = typeof e == "string" ? e : T(e), this;
548
- }
549
- subtitle(e) {
550
- return this._subtitle = typeof e == "string" ? e : T(e), this;
551
- }
552
- trailing(e) {
553
- return this._trailing = T(e), this;
554
- }
555
- chevron(e = !0) {
556
- return this._chevron = e, this;
557
- }
558
- divider(e = !0, r) {
559
- return this._divider = e, r && (this._dividerColor = r), this;
560
- }
561
- onPress(e) {
562
- return this._onPress = e, this;
563
- }
564
- build() {
565
- return s.createElement(ye, {
566
- leading: this._leading,
567
- title: this._title,
568
- subtitle: this._subtitle,
569
- trailing: this._trailing,
570
- chevron: this._chevron,
571
- divider: this._divider,
572
- dividerColor: this._dividerColor,
573
- onPress: this._onPress,
574
- className: this.getClassName(),
575
- style: this.getStyle(),
576
- ...this._props
577
- });
578
- }
579
- }
580
- const ze = w(xe), ve = s.memo((n) => {
581
- const {
582
- data: t,
583
- columns: e,
584
- variant: r,
585
- density: d,
586
- striped: p,
587
- width: c,
588
- className: u,
589
- style: g
590
- } = n, x = {
591
- width: "100%",
592
- borderCollapse: "separate",
593
- borderSpacing: "0",
594
- ...g
595
- };
596
- c && (x.width = typeof c == "number" ? `${c}px` : c);
597
- const v = r === "clean" ? ["bg-white", "rounded-2xl", "border", "border-gray-100", "overflow-hidden", "shadow-sm"] : [], a = {
598
- compact: "10px 16px",
599
- standard: "16px 24px",
600
- relaxed: "24px 32px"
601
- }[d];
602
- return $().className(u).classNames(v).children(
603
- s.createElement("table", { style: x }, [
604
- s.createElement(
605
- "thead",
606
- { key: "thead", className: "bg-gray-50/50" },
607
- s.createElement(
608
- "tr",
609
- {},
610
- e.map(
611
- (o, _) => s.createElement("th", {
612
- key: String(o.accessor ?? o.header ?? _),
613
- scope: "col",
614
- style: {
615
- textAlign: o.align || "left",
616
- padding: a,
617
- width: o.width
618
- },
619
- className: "text-xs font-bold text-gray-400 uppercase tracking-widest"
620
- }, o.header)
621
- )
622
- )
623
- ),
624
- s.createElement(
625
- "tbody",
626
- { key: "tbody" },
627
- t.map(
628
- (o, _) => s.createElement(
629
- "tr",
630
- {
631
- key: (o == null ? void 0 : o.id) ?? (o == null ? void 0 : o.key) ?? _,
632
- className: `group transition-all duration-200 border-b border-gray-50 last:border-b-0 ${p && _ % 2 !== 0 ? "bg-gray-50/30" : "bg-transparent"} ${r === "clean" ? "hover:bg-white hover:shadow-md hover:scale-[1.002] hover:z-10 relative" : "hover:bg-gray-50/50"}`
633
- },
634
- e.map(
635
- (y, H) => s.createElement(
636
- "td",
637
- {
638
- key: H,
639
- style: {
640
- textAlign: y.align || "left",
641
- padding: a,
642
- borderTop: r === "default" ? "1px solid #F3F4F6" : "none"
643
- },
644
- className: "text-sm text-gray-900 font-medium"
645
- },
646
- y.render ? y.render(o) : y.accessor ? o[y.accessor] : null
647
- )
648
- )
649
- )
650
- )
651
- )
652
- ])
653
- ).build();
654
- });
655
- class Ee extends I {
656
- constructor() {
657
- super(...arguments);
658
- i(this, "_data", []);
659
- i(this, "_columns", []);
660
- i(this, "_variant", "clean");
661
- i(this, "_density", "standard");
662
- i(this, "_striped", !1);
663
- i(this, "_width");
664
- }
665
- data(e) {
666
- return this._data = e, this;
667
- }
668
- columns(e) {
669
- return this._columns = e, this;
670
- }
671
- variant(e) {
672
- return this._variant = e, this;
673
- }
674
- density(e) {
675
- return this._density = e, this;
676
- }
677
- striped(e = !0) {
678
- return this._striped = e, this;
679
- }
680
- width(e) {
681
- return this._width = e, this;
682
- }
683
- build() {
684
- const e = {
685
- data: this._data,
686
- columns: this._columns,
687
- variant: this._variant,
688
- density: this._density,
689
- striped: this._striped,
690
- width: this._width,
691
- className: this.getClassName(),
692
- style: this.getStyle()
693
- };
694
- return s.createElement(ve, e);
695
- }
696
- }
697
- const Ve = w(Ee), Ne = s.memo((n) => {
698
- const { items: t, className: e, style: r, ...d } = n, p = t.map(
699
- (c, u) => s.createElement(
700
- "span",
701
- {
702
- key: c.title ? `${c.title}-${u}` : `tag-${u}`,
703
- className: "fibo-tag"
704
- },
705
- c.title
706
- )
707
- );
708
- return s.createElement(
709
- "div",
710
- {
711
- className: e,
712
- style: r,
713
- ...d
714
- },
715
- ...p
716
- );
717
- });
718
- class we extends I {
719
- constructor(e = []) {
720
- super();
721
- i(this, "_items", []);
722
- this._items = e;
723
- }
724
- items(e) {
725
- return this._items = e, this;
726
- }
727
- build() {
728
- const e = ["fibo-tags", "flex", "gap-2", "flex-wrap", ...this._classNames].filter(Boolean).join(" "), r = {
729
- items: this._items,
730
- className: e,
731
- style: this.getStyle(),
732
- ...this._props
733
- };
734
- return s.createElement(Ne, r);
735
- }
736
- }
737
- const De = w(we), Ie = s.memo((n) => {
738
- const { status: t, title: e, subtitle: r, className: d, style: p, ...c } = n;
739
- return s.createElement(
740
- "div",
741
- {
742
- className: d,
743
- style: p,
744
- ...c
745
- },
746
- s.createElement(
747
- "div",
748
- { className: "flex flex-col gap-1" },
749
- e && s.createElement(
750
- "h4",
751
- {
752
- className: "font-semibold text-sm uppercase tracking-wide opacity-90"
753
- },
754
- e
755
- ),
756
- r && s.createElement(
757
- "p",
758
- {
759
- className: "opacity-80 text-sm"
760
- },
761
- r
762
- )
763
- )
764
- );
765
- });
766
- class Se extends I {
767
- constructor(e = "") {
768
- super();
769
- i(this, "_status", "info");
770
- i(this, "_title", "");
771
- i(this, "_subtitle");
772
- this._title = e;
773
- }
774
- status(e) {
775
- return this._status = e, this;
776
- }
777
- title(e) {
778
- return this._title = e, this;
779
- }
780
- subtitle(e) {
781
- return this._subtitle = e, this;
782
- }
783
- build() {
784
- const r = [
785
- "fibo-banner",
786
- `fibo-banner-${this._status}`,
787
- ...this._classNames
788
- ].filter(Boolean).join(" "), d = {
789
- status: this._status,
790
- title: this._title,
791
- subtitle: this._subtitle,
792
- className: r,
793
- style: this.getStyle(),
794
- ...this._props
795
- };
796
- return s.createElement(Ie, d);
797
- }
798
- }
799
- const Xe = w(Se);
800
- class $e extends I {
801
- constructor() {
802
- super(...arguments);
803
- i(this, "_title", "");
804
- i(this, "_content", null);
805
- i(this, "_defaultExpanded", !1);
806
- i(this, "_expanded");
807
- i(this, "_onToggle");
808
- }
809
- title(e) {
810
- return this._title = e, this;
811
- }
812
- content(e) {
813
- return this._content = T(e), this;
814
- }
815
- isOpen(e) {
816
- return this._expanded = e, this;
817
- }
818
- defaultOpen(e) {
819
- return this._defaultExpanded = e, this;
820
- }
821
- onToggle(e) {
822
- return this._onToggle = e, this;
823
- }
824
- build() {
825
- return s.createElement(Ce, {
826
- builder: this,
827
- ...this._props
828
- });
829
- }
830
- }
831
- const Ce = s.memo(({ builder: n }) => {
832
- const t = s.useId(), e = `${t}-content`, r = n._expanded !== void 0, [d, p] = X(n._defaultExpanded), c = r ? n._expanded : d, u = () => {
833
- r || p(!c), n._onToggle && n._onToggle(!c);
834
- };
835
- return $().classNames(["w-full", "border", "border-gray-200", "rounded-xl", "overflow-hidden", "bg-white", "transition-all", "duration-300"]).className(n.getClassName()).style(n.getStyle()).children([
836
- s.createElement("button", {
837
- key: "header",
838
- type: "button",
839
- id: t,
840
- "aria-expanded": c,
841
- "aria-controls": e,
842
- className: "w-full flex items-center justify-between p-4 cursor-pointer hover:bg-gray-50 transition-colors select-none text-left bg-transparent border-0",
843
- onClick: u
844
- }, [
845
- s.createElement(
846
- s.Fragment,
847
- { key: "title" },
848
- typeof n._title == "string" ? he(n._title).fontWeight(600).fontSize(15).color("#1F2937").build() : n._title
849
- ),
850
- s.createElement("span", {
851
- key: "chevron",
852
- className: "transition-transform duration-300",
853
- style: { transform: c ? "rotate(180deg)" : "rotate(0deg)" },
854
- "aria-hidden": !0
855
- }, s.createElement("svg", {
856
- width: "20",
857
- height: "20",
858
- viewBox: "0 0 24 24",
859
- fill: "none",
860
- stroke: "currentColor",
861
- strokeWidth: "2",
862
- strokeLinecap: "round",
863
- strokeLinejoin: "round",
864
- className: "text-gray-400"
865
- }, s.createElement("polyline", { points: "6 9 12 15 18 9" })))
866
- ]),
867
- $().props({
868
- id: e,
869
- role: "region",
870
- "aria-labelledby": t,
871
- hidden: !c || void 0
872
- }).classNames(["transition-all", "duration-300", "ease-in-out", "overflow-hidden"]).style({
873
- maxHeight: c ? "500px" : "0px",
874
- opacity: c ? 1 : 0
875
- }).children(
876
- $().classNames(["p-4", "pt-0", "text-gray-600", "text-sm"]).children(n._content).build()
877
- ).build()
878
- ]).build();
879
- }), Ye = w($e), ke = s.memo((n) => {
880
- const {
881
- children: t,
882
- variant: e = "standard",
883
- columns: r = 1,
884
- gap: d = "md",
885
- className: p,
886
- style: c,
887
- ...u
888
- } = n, g = (m) => typeof m == "number" ? "" : {
889
- none: "gap-0",
890
- sm: "gap-2",
891
- md: "gap-4",
892
- lg: "gap-6",
893
- xl: "gap-8"
894
- }[m] || "gap-4", x = (m) => {
895
- if (typeof m == "number") return m + "px";
896
- }, v = (m) => {
897
- if (typeof m == "number") return `grid-cols-${m}`;
898
- let a = [];
899
- return m.sm && a.push(`sm:grid-cols-${m.sm}`), m.md && a.push(`md:grid-cols-${m.md}`), m.lg && a.push(`lg:grid-cols-${m.lg}`), m.xl && a.push(`xl:grid-cols-${m.xl}`), a.join(" ") || "grid-cols-1";
900
- };
901
- if (e === "bento") {
902
- const m = [
903
- { col: 2, row: 2 },
904
- { col: 1, row: 1 },
905
- { col: 1, row: 1 },
906
- { col: 1, row: 2 },
907
- { col: 2, row: 1 }
908
- ];
909
- return s.createElement("div", {
910
- className: `grid ${v(r)} ${g(d)} ${p}`,
911
- style: {
912
- gap: x(d),
913
- gridAutoFlow: "dense",
914
- ...c
915
- },
916
- ...u
917
- }, s.Children.map(t, (a, o) => {
918
- if (s.isValidElement(a) && typeof a.props.className == "string" && a.props.className.includes("col-span"))
919
- return a;
920
- const _ = m[o % m.length];
921
- return s.createElement("div", {
922
- key: q(a, o),
923
- style: { gridColumn: `span ${_.col}`, gridRow: `span ${_.row}` }
924
- }, a);
925
- }));
926
- }
927
- if (e === "masonry") {
928
- const m = (a) => {
929
- if (typeof a == "number") return `columns-${a}`;
930
- let o = [];
931
- return a.sm && o.push(`sm:columns-${a.sm}`), a.md && o.push(`md:columns-${a.md}`), a.lg && o.push(`lg:columns-${a.lg}`), a.xl && o.push(`xl:columns-${a.xl}`), o.join(" ") || "columns-1";
932
- };
933
- return s.createElement("div", {
934
- className: `${m(r)} ${g(d)} space-y-4 ${p}`,
935
- style: {
936
- columnGap: x(d),
937
- ...c
938
- },
939
- ...u
940
- }, s.Children.map(
941
- t,
942
- (a, o) => s.createElement("div", {
943
- key: q(a, o),
944
- className: "break-inside-avoid mb-4"
945
- }, a)
946
- ));
947
- }
948
- return s.createElement("div", {
949
- className: `grid ${v(r)} ${g(d)} ${p}`,
950
- style: {
951
- gap: x(d),
952
- ...c
953
- },
954
- ...u
955
- }, t);
956
- }), Be = s.memo((n) => {
957
- const { children: t, colSpan: e, rowSpan: r, className: d, style: p, ...c } = n, u = () => {
958
- let g = [];
959
- return e && g.push(`col-span-${e}`), r && g.push(`row-span-${r}`), g.join(" ");
960
- };
961
- return s.createElement("div", {
962
- className: `${u()} ${d}`,
963
- style: p,
964
- ...c
965
- }, t);
966
- });
967
- class Te extends I {
968
- constructor() {
969
- super(...arguments);
970
- i(this, "_variant", "standard");
971
- i(this, "_columns", 1);
972
- i(this, "_gap", "md");
973
- }
974
- variant(e) {
975
- return this._variant = e, this;
976
- }
977
- columns(e) {
978
- return this._columns = e, this;
979
- }
980
- gap(e) {
981
- return this._gap = e, this;
982
- }
983
- build() {
984
- const e = {
985
- variant: this._variant,
986
- columns: this._columns,
987
- gap: this._gap,
988
- children: this.processChildren(),
989
- className: this.getClassName(),
990
- style: this.getStyle(),
991
- ...this._props
992
- };
993
- return s.createElement(ke, e);
994
- }
995
- }
996
- class He extends I {
997
- constructor() {
998
- super(...arguments);
999
- i(this, "_colSpan");
1000
- i(this, "_rowSpan");
1001
- }
1002
- colSpan(e) {
1003
- return this._colSpan = e, this;
1004
- }
1005
- rowSpan(e) {
1006
- return this._rowSpan = e, this;
1007
- }
1008
- build() {
1009
- const e = {
1010
- colSpan: this._colSpan,
1011
- rowSpan: this._rowSpan,
1012
- children: this.processChildren(),
1013
- className: this.getClassName(),
1014
- style: this.getStyle(),
1015
- ...this._props
1016
- };
1017
- return s.createElement(Be, e);
1018
- }
1019
- }
1020
- const We = w(Te), Ue = w(He);
1021
- export {
1022
- Xe as B,
1023
- Me as C,
1024
- We as G,
1025
- Pe as L,
1026
- Ve as T,
1027
- ze as a,
1028
- De as b,
1029
- Ye as c,
1030
- Ue as d
1031
- };