@versini/ui-table 4.0.4 → 4.0.6

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,12 +1,928 @@
1
- import "react/jsx-runtime";
2
- import { Table as b, TableBody as T, TableCell as r, TableCellSort as t, TableFooter as m, TableHead as p, TableRow as d } from "../../index.js";
3
- import "react";
1
+ import s from "clsx";
2
+ import { jsx as i, jsxs as N, Fragment as ne } from "react/jsx-runtime";
3
+ import S, { useRef as w, useLayoutEffect as G, useEffect as U, useState as ce, useMemo as J, useCallback as de, useContext as B } from "react";
4
+ const z = "thead", W = "tfoot", x = "tbody", R = {
5
+ ASC: "asc",
6
+ DESC: "desc"
7
+ }, ge = ({
8
+ mode: e,
9
+ className: r,
10
+ wrapperClassName: t,
11
+ stickyHeader: a,
12
+ stickyFooter: l
13
+ }) => ({
14
+ wrapper: s(
15
+ "not-prose relative w-full rounded-lg shadow-md",
16
+ {
17
+ "overflow-x-auto": !a && !l,
18
+ "overflow-y-scroll": a || l,
19
+ "bg-surface-darker": e === "dark" || e === "system",
20
+ "bg-surface-light": e === "light" || e === "alt-system",
21
+ "dark:bg-surface-light": e === "system",
22
+ "dark:bg-surface-darker": e === "alt-system",
23
+ "text-copy-light": e === "dark",
24
+ "text-copy-dark": e === "light",
25
+ "text-copy-light dark:text-copy-dark": e === "system",
26
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
27
+ },
28
+ t
29
+ ),
30
+ table: s("my-0 w-full text-left text-sm", r, {
31
+ "text-copy-light": e === "dark",
32
+ "text-copy-dark": e === "light",
33
+ "text-copy-light dark:text-copy-dark": e === "system",
34
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
35
+ }),
36
+ caption: s("py-2 text-sm font-bold", {
37
+ "text-copy-light": e === "dark",
38
+ "text-copy-dark": e === "light",
39
+ "text-copy-light dark:text-copy-dark": e === "system",
40
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
41
+ })
42
+ }), he = ({
43
+ className: e,
44
+ stickyHeader: r,
45
+ mode: t
46
+ }) => s(
47
+ {
48
+ "sticky top-0 z-10": r,
49
+ "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "dark",
50
+ "shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "system",
51
+ "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem]": r && t === "light",
52
+ "shadow-[rgb(65_65_65_/30%)_0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_0.5rem_1rem]": r && t === "alt-system"
53
+ },
54
+ e
55
+ ), be = ({
56
+ className: e,
57
+ stickyFooter: r,
58
+ mode: t
59
+ }) => s(
60
+ {
61
+ "sticky bottom-0 z-10": r,
62
+ "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "dark",
63
+ "shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem] dark:shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "system",
64
+ "shadow-[rgb(65_65_65_/30%)_0_-0.5rem_1rem]": r && t === "light",
65
+ "shadow-[rgb(65_65_65_/30%)_-0_0.5rem_1rem] dark:shadow-[rgb(190_190_190_/20%)_0_-0.5rem_1rem]": r && t === "alt-system"
66
+ },
67
+ e
68
+ ), ue = ({
69
+ mode: e,
70
+ className: r,
71
+ cellWrapper: t
72
+ }) => t === z || t === W ? s(
73
+ {
74
+ "bg-table-head-dark": e === "dark" || e === "system",
75
+ "bg-table-head-light": e === "light" || e === "alt-system",
76
+ "dark:bg-table-head-light": e === "system",
77
+ "dark:bg-table-head-dark": e === "alt-system"
78
+ },
79
+ r
80
+ ) : s(
81
+ "border-b last:border-0",
82
+ {
83
+ "border-table-dark": e === "dark" || e === "system",
84
+ "odd:bg-table-dark-odd even:bg-table-dark-even": t === x && e === "dark",
85
+ "border-table-light": e === "light" || e === "alt-system",
86
+ "odd:bg-table-light-odd even:bg-table-light-even": t === x && e === "light",
87
+ "dark:border-table-light": e === "system",
88
+ "odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": t === x && e === "system",
89
+ "dark:border-table-dark": e === "alt-system",
90
+ "odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": t === x && e === "alt-system"
91
+ },
92
+ r
93
+ ), me = ({
94
+ cellWrapper: e,
95
+ className: r,
96
+ compact: t,
97
+ mode: a,
98
+ align: l
99
+ }) => ({
100
+ alignClasses: s({
101
+ "flex justify-start text-left": l === "left",
102
+ "flex justify-center text-center": l === "center",
103
+ "flex justify-end text-right": l === "right"
104
+ }),
105
+ mainClasses: s(
106
+ {
107
+ "text-copy-light": a === "dark" || a === "system",
108
+ "text-copy-dark": a === "light" || a === "alt-system",
109
+ "dark:text-copy-dark": a === "system",
110
+ "dark:text-copy-light": a === "alt-system",
111
+ "px-4 py-3": !t && (e === z || e === W),
112
+ "p-4": !t && e === x,
113
+ "px-2 py-1.5": t
114
+ },
115
+ r
116
+ )
117
+ }), ye = ({
118
+ buttonClassName: e
119
+ }) => s("rounded-none text-sm", e), q = "av-button", D = "icon", K = "button", P = "link", fe = ({
120
+ type: e,
121
+ size: r,
122
+ labelRight: t,
123
+ labelLeft: a,
124
+ align: l,
125
+ animated: o
126
+ }) => {
127
+ const n = "max-h-8 py-0 px-2", d = "max-h-9 h-8 px-3", c = "max-h-12 py-2 px-4";
128
+ switch (e) {
129
+ case K:
130
+ case P:
131
+ return s({
132
+ [n]: r === "small",
133
+ [d]: r === "medium",
134
+ [c]: r === "large"
135
+ });
136
+ case D:
137
+ return s("flex items-center", {
138
+ "justify-center": l === "center",
139
+ "justify-start": l === "left",
140
+ "justify-end": l === "right",
141
+ "h-6 w-6 p-0": r === "small" && !o && !(t || a),
142
+ "h-6 px-2": r === "small" && !o && (t || a),
143
+ "h-8 w-8 p-1": r === "medium" && !o && !(t || a),
144
+ "h-8 px-3": r === "medium" && !o && (t || a),
145
+ "h-12 w-12 p-2": r === "large" && !o && !(t || a),
146
+ "h-12 px-4": r === "large" && !o && (t || a),
147
+ "h-6 py-0": r === "small" && o && !(t || a),
148
+ "h-6": r === "small" && o && (t || a),
149
+ "h-8 py-1": r === "medium" && o && !(t || a),
150
+ "h-8": r === "medium" && o && (t || a),
151
+ "h-12 py-2": r === "large" && o && !(t || a),
152
+ "h-12": r === "large" && o && (t || a)
153
+ });
154
+ }
155
+ }, ke = ({
156
+ type: e,
157
+ size: r,
158
+ labelRight: t,
159
+ labelLeft: a
160
+ }) => {
161
+ const l = "text-sm font-medium", o = "text-base font-medium", n = "text-lg font-medium";
162
+ switch (e) {
163
+ case K:
164
+ case P:
165
+ return s({
166
+ "text-center": e === P,
167
+ [l]: r === "small",
168
+ [o]: r === "medium",
169
+ [n]: r === "large"
170
+ });
171
+ case D:
172
+ return s({
173
+ [l]: r === "small" && (t || a),
174
+ [o]: r === "medium" && (t || a),
175
+ [n]: r === "large" && (t || a)
176
+ });
177
+ }
178
+ }, ve = ({
179
+ mode: e,
180
+ noBackground: r,
181
+ truncate: t,
182
+ variant: a
183
+ }) => {
184
+ if (r)
185
+ return "not-prose";
186
+ if (a === "primary")
187
+ return s("not-prose", {
188
+ truncate: t,
189
+ "text-copy-light": e === "dark" || e === "system",
190
+ "text-copy-lighter": e === "light" || e === "alt-system",
191
+ "dark:text-copy-lighter": e === "system",
192
+ "dark:text-copy-light": e === "alt-system"
193
+ });
194
+ if (a === "secondary")
195
+ return s("not-prose", {
196
+ truncate: t,
197
+ "text-copy-light": e === "light" || e === "system",
198
+ "text-copy-lighter": e === "dark" || e === "alt-system",
199
+ "dark:text-copy-lighter": e === "alt-system",
200
+ "dark:text-copy-light": e === "system"
201
+ });
202
+ if (a === "danger")
203
+ return s("not-prose", {
204
+ truncate: t,
205
+ "text-copy-light": e === "dark" || e === "system",
206
+ "text-copy-lighter": e === "light" || e === "alt-system",
207
+ "dark:text-copy-lighter": e === "system",
208
+ "dark:text-copy-light": e === "alt-system"
209
+ });
210
+ if (a === "selected")
211
+ return s("not-prose text-copy-lighter", {
212
+ truncate: t
213
+ });
214
+ }, pe = ({
215
+ mode: e,
216
+ noBackground: r,
217
+ variant: t
218
+ }) => {
219
+ if (!r) {
220
+ if (t === "primary")
221
+ return s({
222
+ "bg-action-dark": e === "dark",
223
+ "bg-action-light": e === "light",
224
+ "bg-action-dark dark:bg-action-light": e === "system",
225
+ "bg-action-light dark:bg-action-dark": e === "alt-system"
226
+ });
227
+ if (t === "secondary")
228
+ return s({
229
+ "bg-action-dark": e === "light",
230
+ "bg-action-light": e === "dark",
231
+ "bg-action-dark dark:bg-action-light": e === "alt-system",
232
+ "bg-action-light dark:bg-action-dark": e === "system"
233
+ });
234
+ if (t === "danger")
235
+ return s({
236
+ "bg-action-danger-dark": e === "dark",
237
+ "bg-action-danger-light": e === "light",
238
+ "bg-action-danger-dark dark:bg-action-danger-light": e === "system",
239
+ "bg-action-danger-light dark:bg-action-danger-dark": e === "alt-system"
240
+ });
241
+ if (t === "selected")
242
+ return "bg-action-selected-dark";
243
+ }
244
+ }, _e = ({
245
+ radius: e
246
+ }) => s({
247
+ "rounded-full": e === "large",
248
+ "rounded-md": e === "medium",
249
+ "rounded-xs": e === "small"
250
+ }), xe = ({
251
+ mode: e,
252
+ disabled: r,
253
+ variant: t
254
+ }) => {
255
+ if (r)
256
+ return "";
257
+ if (t === "primary")
258
+ return s("hover:text-copy-light-hover", {
259
+ "hover:bg-action-dark-hover": e === "dark",
260
+ "hover:bg-action-light-hover": e === "light",
261
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
262
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
263
+ });
264
+ if (t === "secondary")
265
+ return s("hover:text-copy-light-hover", {
266
+ "hover:bg-action-dark-hover": e === "light",
267
+ "hover:bg-action-light-hover": e === "dark",
268
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
269
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
270
+ });
271
+ if (t === "danger")
272
+ return s("hover:text-copy-light-hover", {
273
+ "hover:bg-action-danger-dark-hover": e === "dark",
274
+ "hover:bg-action-danger-light-hover": e === "light",
275
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
276
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
277
+ });
278
+ if (t === "selected")
279
+ return "hover:text-copy-light-hover hover:bg-action-selected-dark-hover";
280
+ }, we = ({
281
+ mode: e,
282
+ disabled: r,
283
+ variant: t
284
+ }) => {
285
+ if (r)
286
+ return "";
287
+ if (t === "primary")
288
+ return s("active:text-copy-light-active", {
289
+ "active:bg-action-dark-active": e === "dark",
290
+ "active:bg-action-light-active": e === "light",
291
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
292
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
293
+ });
294
+ if (t === "secondary")
295
+ return s("active:text-copy-light-active", {
296
+ "active:bg-action-dark-active": e === "light",
297
+ "active:bg-action-light-active": e === "dark",
298
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
299
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
300
+ });
301
+ if (t === "danger")
302
+ return s("active:text-copy-lighter-active", {
303
+ "active:bg-action-danger-dark-active": e === "dark",
304
+ "active:bg-action-danger-light-active": e === "light",
305
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
306
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
307
+ });
308
+ if (t === "selected")
309
+ return "active:text-copy-lighter-active active:bg-action-selected-dark-active";
310
+ }, Ne = ({
311
+ mode: e,
312
+ noBorder: r,
313
+ variant: t
314
+ }) => {
315
+ if (r)
316
+ return "border border-transparent";
317
+ if (t === "primary")
318
+ return s("border", {
319
+ "border-border-dark": e === "dark",
320
+ "border-border-accent": e === "light",
321
+ "border-border-dark dark:border-border-accent": e === "system",
322
+ "border-border-accent dark:border-border-dark": e === "alt-system"
323
+ });
324
+ if (t === "secondary")
325
+ return s("border", {
326
+ "border-border-dark": e === "light",
327
+ "border-border-accent": e === "dark",
328
+ "border-border-dark dark:border-border-accent": e === "alt-system",
329
+ "border-border-accent dark:border-border-dark": e === "system"
330
+ });
331
+ if (t === "danger")
332
+ return s("border", {
333
+ "border-border-danger-dark": e === "dark",
334
+ "border-border-danger-medium": e === "light",
335
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
336
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
337
+ });
338
+ if (t === "selected")
339
+ return "border border-border-selected-dark";
340
+ }, Ce = ({
341
+ focusMode: e
342
+ }) => s("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
343
+ "focus:outline-focus-dark": e === "dark",
344
+ "focus:outline-focus-light": e === "light",
345
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
346
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
347
+ }), Be = ({
348
+ mode: e,
349
+ raw: r,
350
+ iconClassName: t
351
+ }) => r ? "" : s(
352
+ {
353
+ "text-copy-accent-dark": e === "light" || e === "alt-system",
354
+ "text-copy-light": e === "dark" || e === "system",
355
+ "dark:text-copy-light": e === "alt-system",
356
+ "dark:text-copy-accent-dark": e === "system"
357
+ },
358
+ t
359
+ ), Te = ({
360
+ animated: e
361
+ }) => s({
362
+ "transition-opacity duration-300 ease-in-out": e
363
+ }), Ie = ({
364
+ type: e,
365
+ className: r,
366
+ raw: t,
367
+ mode: a,
368
+ focusMode: l,
369
+ disabled: o,
370
+ fullWidth: n,
371
+ size: d,
372
+ noBorder: c,
373
+ labelRight: h,
374
+ labelLeft: u,
375
+ noBackground: g,
376
+ variant: b,
377
+ truncate: v,
378
+ align: L,
379
+ radius: M,
380
+ animated: T
381
+ }) => (b || (b = "primary"), t ? s(q, r) : s(
382
+ q,
383
+ ve({
384
+ mode: a,
385
+ variant: b,
386
+ noBackground: g,
387
+ truncate: v
388
+ }),
389
+ pe({ mode: a, noBackground: g, variant: b }),
390
+ _e({ radius: M }),
391
+ fe({
392
+ type: e,
393
+ size: d,
394
+ labelRight: h,
395
+ labelLeft: u,
396
+ align: L,
397
+ animated: T
398
+ }),
399
+ ke({ type: e, size: d, labelRight: h, labelLeft: u }),
400
+ Ne({ mode: a, variant: b, noBorder: c }),
401
+ Ce({ focusMode: l }),
402
+ xe({ mode: a, variant: b, disabled: o }),
403
+ we({ mode: a, variant: b, disabled: o }),
404
+ {
405
+ "w-full": n,
406
+ "disabled:cursor-not-allowed disabled:opacity-50": o
407
+ },
408
+ s({
409
+ "transition-[width] duration-300 ease-in": T
410
+ }),
411
+ r
412
+ )), Re = (e, r, t) => {
413
+ var a;
414
+ !r && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
415
+ }, Q = S.forwardRef((e, r) => {
416
+ const { onClick: t, noInternalClick: a = !1, ...l } = e;
417
+ return /* @__PURE__ */ i(
418
+ "button",
419
+ {
420
+ ref: r,
421
+ onClick: (o) => {
422
+ Re(o, a, t);
423
+ },
424
+ ...l
425
+ }
426
+ );
427
+ });
428
+ Q.displayName = "BaseButton";
429
+ function Ee() {
430
+ const e = w(!1);
431
+ return U(() => (e.current = !0, () => {
432
+ e.current = !1;
433
+ }), []), de(() => e.current, []);
434
+ }
435
+ function Se(e) {
436
+ return J(() => e.every((r) => r == null) ? () => {
437
+ } : (r) => {
438
+ e.forEach((t) => {
439
+ typeof t == "function" ? t(r) : t != null && (t.current = r);
440
+ });
441
+ }, e);
442
+ }
443
+ const ze = {
444
+ x: 0,
445
+ y: 0,
446
+ width: 0,
447
+ height: 0,
448
+ top: 0,
449
+ left: 0,
450
+ bottom: 0,
451
+ right: 0
452
+ };
453
+ function A(e) {
454
+ const r = Ee(), t = w(0), a = w(null), [l, o] = ce(ze), n = J(() => typeof ResizeObserver > "u" ? null : new ResizeObserver((d) => {
455
+ const c = d[0];
456
+ c && (cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
457
+ a.current && r() && o(c.contentRect);
458
+ }));
459
+ }), [r]);
460
+ return U(() => (a.current && (n == null || n.observe(a.current, e)), () => {
461
+ n == null || n.disconnect(), t.current && cancelAnimationFrame(t.current);
462
+ }), [n, e]), [a, l];
463
+ }
464
+ const E = {
465
+ small: 24,
466
+ // w-6
467
+ medium: 32,
468
+ // w-8
469
+ large: 48
470
+ // w-12
471
+ }, Le = {
472
+ small: 8 * 2,
473
+ // px-2 x 2
474
+ medium: 12 * 2,
475
+ // px-3 x 2
476
+ large: 16 * 2
477
+ // px-4 x 2
478
+ }, Me = 2, Ve = 300, X = S.forwardRef(
479
+ ({
480
+ children: e,
481
+ disabled: r = !1,
482
+ mode: t = "system",
483
+ focusMode: a = "system",
484
+ fullWidth: l = !1,
485
+ className: o,
486
+ type: n = "button",
487
+ raw: d = !1,
488
+ noBorder: c = !1,
489
+ "aria-label": h,
490
+ label: u,
491
+ size: g = "medium",
492
+ labelRight: b,
493
+ labelLeft: v,
494
+ noBackground: L = !1,
495
+ align: M = "center",
496
+ radius: T = "large",
497
+ variant: ee = "primary",
498
+ iconClassName: te,
499
+ animated: f = !1,
500
+ ...re
501
+ }, ae) => {
502
+ const le = Ie({
503
+ type: D,
504
+ mode: t,
505
+ focusMode: a,
506
+ fullWidth: l,
507
+ disabled: r,
508
+ raw: d,
509
+ className: o,
510
+ noBorder: c,
511
+ size: g,
512
+ labelRight: b,
513
+ labelLeft: v,
514
+ noBackground: L,
515
+ align: M,
516
+ radius: T,
517
+ variant: ee,
518
+ animated: f
519
+ }), se = Be({ mode: t, raw: d, iconClassName: te }), $ = Te({ animated: f }), oe = "flex items-center justify-center relative w-full h-full overflow-hidden", [m, V] = A(), [y, O] = A(), [I, F] = A(), j = w(0), k = w(null), p = w(null), ie = Se([ae, k]);
520
+ return G(() => {
521
+ I && I.current && f && (j.current = F.width + Le[g] + (c ? 0 : Me), k.current && !k.current.style.width && (k.current.style.width = `${E[g]}px`));
522
+ }, [F, I, g, c, f]), G(() => {
523
+ if (k && k.current && f) {
524
+ let _ = E[g];
525
+ b && m && V.width > 0 ? _ = V.width + j.current : v && y && O.width > 0 && (_ = O.width + j.current), p.current && clearTimeout(p.current), _ !== parseInt(k.current.style.width || "0", 10) && (m.current && (m.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"), k.current.style.width = `${_}px`, _ > E[g] && (p.current = setTimeout(() => {
526
+ m.current && b && (m.current.style.opacity = "1"), y.current && v && (y.current.style.opacity = "1"), p.current = null;
527
+ }, Ve * 0.8))), _ === E[g] && (m.current && (m.current.style.opacity = "0"), y.current && (y.current.style.opacity = "0"));
528
+ }
529
+ }, [
530
+ V,
531
+ b,
532
+ m,
533
+ O,
534
+ v,
535
+ y,
536
+ g,
537
+ f
538
+ ]), U(() => () => {
539
+ p.current && clearTimeout(p.current);
540
+ }, []), /* @__PURE__ */ i(
541
+ Q,
542
+ {
543
+ ref: ie,
544
+ className: le,
545
+ disabled: r,
546
+ type: n,
547
+ "aria-label": h || u,
548
+ ...re,
549
+ children: /* @__PURE__ */ N("div", { className: oe, children: [
550
+ /* @__PURE__ */ i(
551
+ Y,
552
+ {
553
+ label: v,
554
+ labelRef: y,
555
+ labelClass: $,
556
+ labelInnerClass: "pr-2",
557
+ initiallyHidden: f
558
+ }
559
+ ),
560
+ /* @__PURE__ */ i("span", { ref: I, className: se, children: e }),
561
+ /* @__PURE__ */ i(
562
+ Y,
563
+ {
564
+ label: b,
565
+ labelRef: m,
566
+ labelClass: $,
567
+ labelInnerClass: "pl-2",
568
+ initiallyHidden: f
569
+ }
570
+ )
571
+ ] })
572
+ }
573
+ );
574
+ }
575
+ ), Y = ({
576
+ labelRef: e,
577
+ labelClass: r,
578
+ label: t,
579
+ labelInnerClass: a,
580
+ initiallyHidden: l = !1
581
+ }) => /* @__PURE__ */ i(
582
+ "span",
583
+ {
584
+ ref: e,
585
+ className: r,
586
+ style: l ? { opacity: 0 } : void 0,
587
+ children: t && /* @__PURE__ */ i("span", { className: a, children: t })
588
+ }
589
+ );
590
+ X.displayName = "ButtonIcon";
591
+ /*!
592
+ @versini/ui-button v6.0.6
593
+ © 2025 gizmette.com
594
+ */
595
+ try {
596
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
597
+ version: "6.0.6",
598
+ buildTime: "05/26/2025 03:48 PM EDT",
599
+ homepage: "https://github.com/aversini/ui-components",
600
+ license: "MIT"
601
+ });
602
+ } catch {
603
+ }
604
+ const Z = S.forwardRef(
605
+ ({
606
+ children: e,
607
+ mode: r = "system",
608
+ className: t,
609
+ active: a = !1,
610
+ ...l
611
+ }, o) => {
612
+ const n = a ? s(
613
+ "relative",
614
+ "focus-within:static",
615
+ "focus-within:after:border-transparent",
616
+ "after:absolute",
617
+ "after:content-['']",
618
+ "after:border-b-2",
619
+ "after:bottom-[-4px]",
620
+ "after:left-0",
621
+ "after:right-0",
622
+ {
623
+ "after:border-table-dark": r === "dark",
624
+ "after:border-table-light": r === "light",
625
+ "after:border-table-dark dark:after:border-table-light": r === "system",
626
+ "after:border-table-light dark:after:border-table-dark": r === "alt-system"
627
+ }
628
+ ) : "";
629
+ return /* @__PURE__ */ i("div", { className: n, children: /* @__PURE__ */ i(
630
+ X,
631
+ {
632
+ className: s("justify-center", t),
633
+ ref: o,
634
+ mode: r,
635
+ radius: "small",
636
+ ...l,
637
+ children: e
638
+ }
639
+ ) });
640
+ }
641
+ );
642
+ Z.displayName = "ButtonSort";
643
+ const H = ({
644
+ children: e,
645
+ fill: r,
646
+ viewBox: t,
647
+ className: a,
648
+ defaultViewBox: l,
649
+ size: o,
650
+ title: n,
651
+ semantic: d = !1,
652
+ ...c
653
+ }) => {
654
+ const h = s(o, a);
655
+ return /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ N(
656
+ "svg",
657
+ {
658
+ xmlns: "http://www.w3.org/2000/svg",
659
+ className: h,
660
+ viewBox: t || l,
661
+ fill: r || "currentColor",
662
+ role: "img",
663
+ "aria-hidden": !d,
664
+ focusable: !1,
665
+ ...c,
666
+ children: [
667
+ n && d && /* @__PURE__ */ i("title", { children: n }),
668
+ e
669
+ ]
670
+ }
671
+ ) });
672
+ };
673
+ /*!
674
+ @versini/ui-svgicon v4.2.0
675
+ © 2025 gizmette.com
676
+ */
677
+ try {
678
+ window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
679
+ version: "4.2.0",
680
+ buildTime: "05/17/2025 06:18 PM EDT",
681
+ homepage: "https://github.com/aversini/ui-components",
682
+ license: "MIT"
683
+ });
684
+ } catch {
685
+ }
686
+ const Oe = ({
687
+ className: e,
688
+ viewBox: r,
689
+ title: t,
690
+ monotone: a,
691
+ ...l
692
+ }) => /* @__PURE__ */ N(
693
+ H,
694
+ {
695
+ defaultViewBox: "0 0 576 512",
696
+ size: "size-5",
697
+ viewBox: r,
698
+ className: e,
699
+ title: t || "Sort",
700
+ ...l,
701
+ children: [
702
+ /* @__PURE__ */ i(
703
+ "path",
704
+ {
705
+ d: "M297.4 137.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l41.3-41.4V448c0 17.7 14.3 32 32 32s32-14.3 32-32V141.3l41.4 41.4c12.5 12.5 32.8 12.5 45.3 0 6.2-6.2 9.4-14.4 9.4-22.6s-3.1-16.4-9.4-22.6l-96-96c-6.3-6.4-14.5-9.5-22.7-9.5s-16.4 3.1-22.6 9.4z",
706
+ opacity: a ? "1" : "0.4"
707
+ }
708
+ ),
709
+ /* @__PURE__ */ i("path", { d: "M137.4 470.6c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 370.7V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v306.7l-41.4-41.3c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
710
+ ]
711
+ }
712
+ ), je = ({
713
+ className: e,
714
+ viewBox: r,
715
+ title: t,
716
+ monotone: a,
717
+ ...l
718
+ }) => /* @__PURE__ */ N(
719
+ H,
720
+ {
721
+ defaultViewBox: "0 0 576 512",
722
+ size: "size-5",
723
+ viewBox: r,
724
+ className: e,
725
+ title: t || "Sort Down",
726
+ ...l,
727
+ children: [
728
+ /* @__PURE__ */ i(
729
+ "path",
730
+ {
731
+ d: "M288 64c0-17.7 14.3-32 32-32h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32",
732
+ opacity: a ? "1" : "0.4"
733
+ }
734
+ ),
735
+ /* @__PURE__ */ i("path", { d: "M128 480c9 0 17.5-3.8 23.6-10.4l88-96c11.9-13 11.1-33.3-2-45.2s-33.3-11.1-45.2 2L160 365.7V64c0-17.7-14.3-32-32-32S96 46.3 96 64v301.7l-32.4-35.3c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96c6.1 6.6 14.6 10.4 23.6 10.4" })
736
+ ]
737
+ }
738
+ ), Ae = ({
739
+ className: e,
740
+ viewBox: r,
741
+ title: t,
742
+ monotone: a,
743
+ ...l
744
+ }) => /* @__PURE__ */ N(
745
+ H,
746
+ {
747
+ defaultViewBox: "0 0 576 512",
748
+ size: "size-5",
749
+ viewBox: r,
750
+ className: e,
751
+ title: t || "Sort Up",
752
+ ...l,
753
+ children: [
754
+ /* @__PURE__ */ i(
755
+ "path",
756
+ {
757
+ d: "M288 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32h-32c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32h-96c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h160c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32m0 128c0-17.7 14.3-32 32-32h224c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32",
758
+ opacity: a ? "1" : "0.4"
759
+ }
760
+ ),
761
+ /* @__PURE__ */ i("path", { d: "M128 32c9 0 17.5 3.8 23.6 10.4l88 96c11.9 13 11.1 33.3-2 45.2s-33.3 11.1-45.2-2L160 146.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V146.3l-32.4 35.3c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32" })
762
+ ]
763
+ }
764
+ );
765
+ /*!
766
+ @versini/ui-icons v4.10.0
767
+ © 2025 gizmette.com
768
+ */
769
+ try {
770
+ window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
771
+ version: "4.10.0",
772
+ buildTime: "05/17/2025 06:18 PM EDT",
773
+ homepage: "https://github.com/aversini/ui-components",
774
+ license: "MIT"
775
+ });
776
+ } catch {
777
+ }
778
+ const C = S.createContext({
779
+ mode: "light",
780
+ cellWrapper: "thead",
781
+ stickyHeader: !1,
782
+ stickyFooter: !1,
783
+ compact: !1
784
+ }), He = ({
785
+ children: e,
786
+ mode: r = "system",
787
+ caption: t,
788
+ compact: a,
789
+ summary: l,
790
+ className: o,
791
+ wrapperClassName: n,
792
+ maxHeight: d,
793
+ stickyHeader: c,
794
+ stickyFooter: h,
795
+ ...u
796
+ }) => {
797
+ const g = ge({
798
+ mode: r,
799
+ className: o,
800
+ wrapperClassName: n,
801
+ stickyHeader: c,
802
+ stickyFooter: h
803
+ });
804
+ return /* @__PURE__ */ i(
805
+ C.Provider,
806
+ {
807
+ value: { mode: r, stickyHeader: c, stickyFooter: h, compact: a },
808
+ children: /* @__PURE__ */ i(
809
+ "div",
810
+ {
811
+ className: g.wrapper,
812
+ ...d && {
813
+ style: { maxHeight: d }
814
+ },
815
+ children: /* @__PURE__ */ N("table", { className: g.table, summary: l, ...u, children: [
816
+ t && /* @__PURE__ */ i("caption", { className: g.caption, children: t }),
817
+ e
818
+ ] })
819
+ }
820
+ )
821
+ }
822
+ );
823
+ }, $e = ({
824
+ children: e,
825
+ className: r,
826
+ ...t
827
+ }) => {
828
+ const a = B(C);
829
+ a.cellWrapper = z;
830
+ const l = he({
831
+ className: r,
832
+ mode: a.mode,
833
+ stickyHeader: a.stickyHeader
834
+ });
835
+ return /* @__PURE__ */ i("thead", { className: l, ...t, children: e });
836
+ }, Fe = ({
837
+ children: e,
838
+ className: r,
839
+ ...t
840
+ }) => {
841
+ const a = B(C);
842
+ a.cellWrapper = W;
843
+ const l = be({
844
+ className: r,
845
+ mode: a.mode,
846
+ stickyFooter: a.stickyFooter
847
+ });
848
+ return /* @__PURE__ */ i("tfoot", { className: l, ...t, children: e });
849
+ }, Ge = ({ children: e, ...r }) => {
850
+ const t = B(C);
851
+ return t.cellWrapper = x, /* @__PURE__ */ i("tbody", { ...r, children: e });
852
+ }, qe = ({
853
+ children: e,
854
+ className: r,
855
+ ...t
856
+ }) => {
857
+ const a = B(C), l = ue({
858
+ mode: a.mode,
859
+ cellWrapper: a.cellWrapper,
860
+ className: r
861
+ });
862
+ return /* @__PURE__ */ i("tr", { className: l, ...t, children: e });
863
+ }, Pe = ({
864
+ children: e,
865
+ component: r,
866
+ className: t,
867
+ align: a,
868
+ ...l
869
+ }) => {
870
+ const o = B(C), n = r || (o.cellWrapper === z ? "th" : "td"), { mainClasses: d, alignClasses: c } = me({
871
+ cellWrapper: o.cellWrapper,
872
+ className: t,
873
+ mode: o.mode,
874
+ compact: o.compact,
875
+ align: a
876
+ });
877
+ return a ? /* @__PURE__ */ i(n, { className: d, ...l, children: /* @__PURE__ */ i("div", { className: c, children: e }) }) : /* @__PURE__ */ i(n, { className: d, ...l, children: e });
878
+ }, Ye = ({
879
+ align: e,
880
+ children: r,
881
+ buttonClassName: t,
882
+ className: a,
883
+ component: l,
884
+ focusMode: o = "alt-system",
885
+ mode: n = "alt-system",
886
+ onClick: d,
887
+ sortDirection: c,
888
+ sortedCell: h,
889
+ cellId: u,
890
+ ...g
891
+ }) => {
892
+ const b = ye({ buttonClassName: t });
893
+ return /* @__PURE__ */ i(
894
+ Pe,
895
+ {
896
+ component: l,
897
+ className: a,
898
+ role: "columnheader",
899
+ "aria-sort": c === R.ASC && h === u ? "ascending" : c === R.DESC && h === u ? "descending" : "other",
900
+ ...g,
901
+ children: /* @__PURE__ */ i(
902
+ Z,
903
+ {
904
+ active: h === u,
905
+ className: b,
906
+ onClick: d,
907
+ align: e,
908
+ noBorder: !0,
909
+ focusMode: o,
910
+ mode: n,
911
+ fullWidth: !0,
912
+ labelRight: r,
913
+ children: c === R.ASC && h === u ? /* @__PURE__ */ i(Ae, { className: "size-4", monotone: !0 }) : c === R.DESC && h === u ? /* @__PURE__ */ i(je, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ i(Oe, { className: "size-4", monotone: !0 })
914
+ }
915
+ )
916
+ }
917
+ );
918
+ };
4
919
  export {
5
- b as Table,
6
- T as TableBody,
7
- r as TableCell,
8
- t as TableCellSort,
9
- m as TableFooter,
10
- p as TableHead,
11
- d as TableRow
920
+ He as Table,
921
+ Ge as TableBody,
922
+ Pe as TableCell,
923
+ Ye as TableCellSort,
924
+ R as TableCellSortDirections,
925
+ Fe as TableFooter,
926
+ $e as TableHead,
927
+ qe as TableRow
12
928
  };