@versini/ui-table 2.0.10 → 3.0.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/dist/index.d.ts CHANGED
@@ -59,6 +59,10 @@ type TableCellProps = {
59
59
  * @default "td"
60
60
  */
61
61
  component?: "td" | "th";
62
+ /**
63
+ * Whether to align the cell content to the left, center, or right.
64
+ */
65
+ align?: "left" | "center" | "right";
62
66
  } & React.ThHTMLAttributes<HTMLTableCellElement> &
63
67
  React.TdHTMLAttributes<HTMLTableCellElement>;
64
68
 
@@ -119,7 +123,7 @@ declare const TableHead: ({ children, className, ...otherProps }: TableHeadProps
119
123
  declare const TableFooter: ({ children, className, ...otherProps }: TableHeadProps) => react_jsx_runtime.JSX.Element;
120
124
  declare const TableBody: ({ children, ...otherProps }: TableBodyProps) => react_jsx_runtime.JSX.Element;
121
125
  declare const TableRow: ({ children, className, ...otherProps }: TableRowProps) => react_jsx_runtime.JSX.Element;
122
- declare const TableCell: ({ children, component, className, ...otherProps }: TableCellProps) => react_jsx_runtime.JSX.Element;
126
+ declare const TableCell: ({ children, component, className, align, ...otherProps }: TableCellProps) => react_jsx_runtime.JSX.Element;
123
127
  declare const TableCellSort: ({ align, children, buttonClassName, className, component, focusMode, mode, onClick, sortDirection, sortedCell, cellId, ...otherProps }: TableCellSortProps) => react_jsx_runtime.JSX.Element;
124
128
 
125
129
  export { Table, TableBody, TableCell, TableCellSort, TableCellSortDirections, TableFooter, TableHead, TableRow };
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import i from "clsx";
2
- import { jsx as l, jsxs as k, Fragment as A } from "react/jsx-runtime";
2
+ import { jsx as s, jsxs as y, Fragment as j } from "react/jsx-runtime";
3
3
  import T, { useContext as v } from "react";
4
4
  /*!
5
- @versini/ui-table v2.0.10
5
+ @versini/ui-table v3.0.0
6
6
  © 2025 gizmette.com
7
7
  */
8
8
  try {
9
9
  window.__VERSINI_UI_TABLE__ || (window.__VERSINI_UI_TABLE__ = {
10
- version: "2.0.10",
11
- buildTime: "01/02/2025 05:13 PM EST",
10
+ version: "3.0.0",
11
+ buildTime: "01/03/2025 10:45 AM EST",
12
12
  homepage: "https://github.com/aversini/ui-components",
13
13
  license: "MIT"
14
14
  });
15
15
  } catch {
16
16
  }
17
- const f = "thead", B = "tfoot", u = "tbody", _ = {
17
+ const _ = "thead", B = "tfoot", u = "tbody", f = {
18
18
  ASC: "asc",
19
19
  DESC: "desc"
20
20
  }, W = ({
@@ -29,10 +29,14 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
29
29
  {
30
30
  "overflow-x-auto": !r && !o,
31
31
  "overflow-y-scroll": r || o,
32
- "bg-surface-darker text-copy-light": e === "dark",
33
- "bg-surface-light text-copy-dark": e === "light",
34
- "bg-surface-darker text-copy-light dark:bg-surface-light dark:text-copy-dark": e === "system",
35
- "bg-surface-light text-copy-dark dark:bg-surface-darker dark:text-copy-light": e === "alt-system"
32
+ "bg-surface-darker": e === "dark" || e === "system",
33
+ "bg-surface-light": e === "light" || e === "alt-system",
34
+ "dark:bg-surface-light": e === "system",
35
+ "dark:bg-surface-darker": e === "alt-system",
36
+ "text-copy-light": e === "dark",
37
+ "text-copy-dark": e === "light",
38
+ "text-copy-light dark:text-copy-dark": e === "system",
39
+ "text-copy-dark dark:text-copy-light": e === "alt-system"
36
40
  },
37
41
  t
38
42
  ),
@@ -48,7 +52,7 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
48
52
  "text-copy-light dark:text-copy-dark": e === "system",
49
53
  "text-copy-dark dark:text-copy-light": e === "alt-system"
50
54
  })
51
- }), j = ({
55
+ }), P = ({
52
56
  className: e,
53
57
  stickyHeader: a,
54
58
  mode: t
@@ -78,24 +82,24 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
78
82
  mode: e,
79
83
  className: a,
80
84
  cellWrapper: t
81
- }) => t === f || t === B ? i(
85
+ }) => t === _ || t === B ? i(
82
86
  {
83
- "bg-table-head-dark": e === "dark",
84
- "bg-table-head-light": e === "light",
85
- "bg-table-head-dark dark:bg-table-head-light": e === "system",
86
- "bg-table-head-light dark:bg-table-head-dark": e === "alt-system"
87
+ "bg-table-head-dark": e === "dark" || e === "system",
88
+ "bg-table-head-light": e === "light" || e === "alt-system",
89
+ "dark:bg-table-head-light": e === "system",
90
+ "dark:bg-table-head-dark": e === "alt-system"
87
91
  },
88
92
  a
89
93
  ) : i(
90
94
  "border-b last:border-0",
91
95
  {
92
- "border-table-dark": e === "dark",
96
+ "border-table-dark": e === "dark" || e === "system",
93
97
  "odd:bg-table-dark-odd even:bg-table-dark-even": t === u && e === "dark",
94
- "border-table-light": e === "light",
98
+ "border-table-light": e === "light" || e === "alt-system",
95
99
  "odd:bg-table-light-odd even:bg-table-light-even": t === u && e === "light",
96
- "border-table-dark dark:border-table-light": e === "system",
100
+ "dark:border-table-light": e === "system",
97
101
  "odd:bg-table-dark-odd even:bg-table-dark-even dark:odd:bg-table-light-odd dark:even:bg-table-light-even": t === u && e === "system",
98
- "border-table-light dark:border-table-dark": e === "alt-system",
102
+ "dark:border-table-dark": e === "alt-system",
99
103
  "odd:bg-table-light-odd even:bg-table-light-even dark:odd:bg-table-dark-odd dark:even:bg-table-dark-even": t === u && e === "alt-system"
100
104
  },
101
105
  a
@@ -103,14 +107,18 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
103
107
  cellWrapper: e,
104
108
  className: a,
105
109
  compact: t,
106
- mode: r
110
+ mode: r,
111
+ align: o
107
112
  }) => i(
108
113
  {
109
- "text-copy-light": r === "dark",
110
- "text-copy-dark": r === "light",
111
- "text-copy-light dark:text-copy-dark": r === "system",
112
- "text-copy-dark dark:text-copy-light": r === "alt-system",
113
- "px-4 py-3": !t && (e === f || e === B),
114
+ "flex justify-start": o === "left",
115
+ "flex justify-center": o === "center",
116
+ "flex justify-end": o === "right",
117
+ "text-copy-light": r === "dark" || r === "system",
118
+ "text-copy-dark": r === "light" || r === "alt-system",
119
+ "dark:text-copy-dark": r === "system",
120
+ "dark:text-copy-light": r === "alt-system",
121
+ "px-4 py-3": !t && (e === _ || e === B),
114
122
  "p-4": !t && e === u,
115
123
  "px-2 py-1.5": t
116
124
  },
@@ -124,14 +132,14 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
124
132
  labelLeft: r,
125
133
  align: o
126
134
  }) => {
127
- const d = "max-h-8 py-0 px-2", c = "max-h-9 py-1 px-3", s = "max-h-12 py-2 px-4";
135
+ const l = "max-h-8 py-0 px-2", d = "max-h-9 py-1 px-3", c = "max-h-12 py-2 px-4";
128
136
  switch (e) {
129
137
  case S:
130
138
  case N:
131
139
  return i({
132
- [d]: a === "small",
133
- [c]: a === "medium",
134
- [s]: a === "large"
140
+ [l]: a === "small",
141
+ [d]: a === "medium",
142
+ [c]: a === "large"
135
143
  });
136
144
  case C:
137
145
  return i("inline-flex items-center", {
@@ -152,21 +160,21 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
152
160
  labelRight: t,
153
161
  labelLeft: r
154
162
  }) => {
155
- const o = "text-sm font-medium", d = "text-base font-medium", c = "text-lg font-medium";
163
+ const o = "text-sm font-medium", l = "text-base font-medium", d = "text-lg font-medium";
156
164
  switch (e) {
157
165
  case S:
158
166
  case N:
159
167
  return i({
160
168
  "text-center": e === N,
161
169
  [o]: a === "small",
162
- [d]: a === "medium",
163
- [c]: a === "large"
170
+ [l]: a === "medium",
171
+ [d]: a === "large"
164
172
  });
165
173
  case C:
166
174
  return i({
167
175
  [o]: a === "small" && (t || r),
168
- [d]: a === "medium" && (t || r),
169
- [c]: a === "large" && (t || r)
176
+ [l]: a === "medium" && (t || r),
177
+ [d]: a === "large" && (t || r)
170
178
  });
171
179
  }
172
180
  }, K = ({
@@ -348,9 +356,9 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
348
356
  raw: t,
349
357
  mode: r,
350
358
  focusMode: o,
351
- disabled: d,
352
- fullWidth: c,
353
- size: s,
359
+ disabled: l,
360
+ fullWidth: d,
361
+ size: c,
354
362
  noBorder: g,
355
363
  labelRight: n,
356
364
  labelLeft: b,
@@ -371,19 +379,19 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
371
379
  X({ radius: w }),
372
380
  q({
373
381
  type: e,
374
- size: s,
382
+ size: c,
375
383
  labelRight: n,
376
384
  labelLeft: b,
377
385
  align: x
378
386
  }),
379
- J({ type: e, size: s, labelRight: n, labelLeft: b }),
387
+ J({ type: e, size: c, labelRight: n, labelLeft: b }),
380
388
  ee({ mode: r, variant: h, noBorder: g }),
381
389
  te({ focusMode: o }),
382
- Z({ mode: r, variant: h, disabled: d }),
383
- $({ mode: r, variant: h, disabled: d }),
390
+ Z({ mode: r, variant: h, disabled: l }),
391
+ $({ mode: r, variant: h, disabled: l }),
384
392
  {
385
- "w-full": c,
386
- "disabled:cursor-not-allowed disabled:opacity-50": d
393
+ "w-full": d,
394
+ "disabled:cursor-not-allowed disabled:opacity-50": l
387
395
  },
388
396
  a
389
397
  )), re = (e, a, t) => {
@@ -391,12 +399,12 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
391
399
  !a && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((r = e == null ? void 0 : e.currentTarget) == null ? void 0 : r.focus) == "function" && e.currentTarget.focus(), typeof t == "function" && t(e);
392
400
  }, E = T.forwardRef((e, a) => {
393
401
  const { onClick: t, noInternalClick: r = !1, ...o } = e;
394
- return /* @__PURE__ */ l(
402
+ return /* @__PURE__ */ s(
395
403
  "button",
396
404
  {
397
405
  ref: a,
398
- onClick: (d) => {
399
- re(d, r, t);
406
+ onClick: (l) => {
407
+ re(l, r, t);
400
408
  },
401
409
  ...o
402
410
  }
@@ -404,13 +412,13 @@ const f = "thead", B = "tfoot", u = "tbody", _ = {
404
412
  });
405
413
  E.displayName = "BaseButton";
406
414
  /*!
407
- @versini/ui-button v3.2.2
415
+ @versini/ui-button v4.0.0
408
416
  © 2025 gizmette.com
409
417
  */
410
418
  try {
411
419
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
412
- version: "3.2.2",
413
- buildTime: "01/02/2025 05:13 PM EST",
420
+ version: "4.0.0",
421
+ buildTime: "01/03/2025 10:45 AM EST",
414
422
  homepage: "https://github.com/aversini/ui-components",
415
423
  license: "MIT"
416
424
  });
@@ -423,9 +431,9 @@ const R = T.forwardRef(
423
431
  mode: t = "system",
424
432
  focusMode: r = "system",
425
433
  fullWidth: o = !1,
426
- className: d,
427
- type: c = "button",
428
- raw: s = !1,
434
+ className: l,
435
+ type: d = "button",
436
+ raw: c = !1,
429
437
  noBorder: g = !1,
430
438
  "aria-label": n,
431
439
  label: b,
@@ -437,15 +445,15 @@ const R = T.forwardRef(
437
445
  active: V = !1,
438
446
  radius: L = "large",
439
447
  ...M
440
- }, H) => {
441
- const U = ae({
448
+ }, A) => {
449
+ const H = ae({
442
450
  type: C,
443
451
  mode: t,
444
452
  focusMode: r,
445
453
  fullWidth: o,
446
454
  disabled: a,
447
- raw: s,
448
- className: d,
455
+ raw: c,
456
+ className: l,
449
457
  noBorder: g,
450
458
  size: m,
451
459
  labelRight: h,
@@ -453,11 +461,11 @@ const R = T.forwardRef(
453
461
  noBackground: x,
454
462
  align: w,
455
463
  radius: L
456
- }), P = i({
457
- "text-copy-accent-dark": t === "light" && !s,
458
- "text-copy-light": t === "dark" && !s,
459
- "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !s,
460
- "text-copy-light dark:text-copy-accent-dark": t === "system" && !s
464
+ }), U = i({
465
+ "text-copy-accent-dark": t === "light" && !c,
466
+ "text-copy-light": t === "dark" && !c,
467
+ "text-copy-accent-dark dark:text-copy-light": t === "alt-system" && !c,
468
+ "text-copy-light dark:text-copy-accent-dark": t === "system" && !c
461
469
  }), O = V ? i(
462
470
  "relative",
463
471
  "focus-within:static",
@@ -475,19 +483,19 @@ const R = T.forwardRef(
475
483
  "after:border-table-light dark:after:border-table-dark": t === "alt-system"
476
484
  }
477
485
  ) : "";
478
- return /* @__PURE__ */ l("div", { className: O, children: /* @__PURE__ */ k(
486
+ return /* @__PURE__ */ s("div", { className: O, children: /* @__PURE__ */ y(
479
487
  E,
480
488
  {
481
- ref: H,
482
- className: U,
489
+ ref: A,
490
+ className: H,
483
491
  disabled: a,
484
- type: c,
492
+ type: d,
485
493
  "aria-label": n || b,
486
494
  ...M,
487
495
  children: [
488
- p && /* @__PURE__ */ l("span", { className: "pr-2", children: p }),
489
- /* @__PURE__ */ l("div", { className: P, children: e }),
490
- h && /* @__PURE__ */ l("span", { className: "pl-2", children: h })
496
+ p && /* @__PURE__ */ s("span", { className: "pr-2", children: p }),
497
+ /* @__PURE__ */ s("div", { className: U, children: e }),
498
+ h && /* @__PURE__ */ s("span", { className: "pl-2", children: h })
491
499
  ]
492
500
  }
493
501
  ) });
@@ -500,14 +508,14 @@ const z = ({
500
508
  viewBox: t,
501
509
  className: r,
502
510
  defaultViewBox: o,
503
- size: d,
504
- title: c,
505
- semantic: s = !1,
511
+ size: l,
512
+ title: d,
513
+ semantic: c = !1,
506
514
  ...g
507
515
  }) => {
508
- const n = i(d, r);
509
- return /* @__PURE__ */ k(A, { children: [
510
- /* @__PURE__ */ l(
516
+ const n = i(l, r);
517
+ return /* @__PURE__ */ y(j, { children: [
518
+ /* @__PURE__ */ s(
511
519
  "svg",
512
520
  {
513
521
  xmlns: "http://www.w3.org/2000/svg",
@@ -515,23 +523,23 @@ const z = ({
515
523
  viewBox: t || o,
516
524
  fill: a || "currentColor",
517
525
  role: "img",
518
- "aria-hidden": !s,
526
+ "aria-hidden": !c,
519
527
  focusable: !1,
520
528
  ...g,
521
529
  children: e
522
530
  }
523
531
  ),
524
- c && s && /* @__PURE__ */ l("span", { className: "sr-only", children: c })
532
+ d && c && /* @__PURE__ */ s("span", { className: "sr-only", children: d })
525
533
  ] });
526
534
  };
527
535
  /*!
528
- @versini/ui-svgicon v3.0.3
536
+ @versini/ui-svgicon v4.0.0
529
537
  © 2025 gizmette.com
530
538
  */
531
539
  try {
532
540
  window.__VERSINI_UI_SVGICON__ || (window.__VERSINI_UI_SVGICON__ = {
533
- version: "3.0.3",
534
- buildTime: "01/02/2025 05:13 PM EST",
541
+ version: "4.0.0",
542
+ buildTime: "01/03/2025 10:45 AM EST",
535
543
  homepage: "https://github.com/aversini/ui-components",
536
544
  license: "MIT"
537
545
  });
@@ -543,7 +551,7 @@ const oe = ({
543
551
  title: t,
544
552
  monotone: r,
545
553
  ...o
546
- }) => /* @__PURE__ */ k(
554
+ }) => /* @__PURE__ */ y(
547
555
  z,
548
556
  {
549
557
  defaultViewBox: "0 0 576 512",
@@ -553,14 +561,14 @@ const oe = ({
553
561
  title: t || "Sort",
554
562
  ...o,
555
563
  children: [
556
- /* @__PURE__ */ l(
564
+ /* @__PURE__ */ s(
557
565
  "path",
558
566
  {
559
567
  opacity: r ? "1" : "0.4",
560
568
  d: "M393.4 41.4c12.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 0L448 141.3V448c0 17.7-14.3 32-32 32s-32-14.3-32-32V141.3l-41.4 41.4c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l96-96z"
561
569
  }
562
570
  ),
563
- /* @__PURE__ */ l("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 32V370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
571
+ /* @__PURE__ */ s("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 32V370.7L86.6 329.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96z" })
564
572
  ]
565
573
  }
566
574
  ), ie = ({
@@ -569,7 +577,7 @@ const oe = ({
569
577
  title: t,
570
578
  monotone: r,
571
579
  ...o
572
- }) => /* @__PURE__ */ k(
580
+ }) => /* @__PURE__ */ y(
573
581
  z,
574
582
  {
575
583
  defaultViewBox: "0 0 576 512",
@@ -579,23 +587,23 @@ const oe = ({
579
587
  title: t || "Sort Down",
580
588
  ...o,
581
589
  children: [
582
- /* @__PURE__ */ l(
590
+ /* @__PURE__ */ s(
583
591
  "path",
584
592
  {
585
593
  opacity: r ? "1" : "0.4",
586
594
  d: "M288 448c0 17.7 14.3 32 32 32h32c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32h96c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32zm0-128c0 17.7 14.3 32 32 32H544c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-17.7 0-32 14.3-32 32z"
587
595
  }
588
596
  ),
589
- /* @__PURE__ */ l("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-32s-32 14.3-32 32V365.7L63.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C110.5 476.2 119 480 128 480z" })
597
+ /* @__PURE__ */ s("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-32s-32 14.3-32 32V365.7L63.6 330.4c-11.9-13-32.2-13.9-45.2-2s-13.9 32.2-2 45.2l88 96C110.5 476.2 119 480 128 480z" })
590
598
  ]
591
599
  }
592
- ), le = ({
600
+ ), se = ({
593
601
  className: e,
594
602
  viewBox: a,
595
603
  title: t,
596
604
  monotone: r,
597
605
  ...o
598
- }) => /* @__PURE__ */ k(
606
+ }) => /* @__PURE__ */ y(
599
607
  z,
600
608
  {
601
609
  defaultViewBox: "0 0 576 512",
@@ -605,31 +613,31 @@ const oe = ({
605
613
  title: t || "Sort Up",
606
614
  ...o,
607
615
  children: [
608
- /* @__PURE__ */ l(
616
+ /* @__PURE__ */ s(
609
617
  "path",
610
618
  {
611
619
  opacity: r ? "1" : "0.4",
612
620
  d: "M288 64c0-17.7 14.3-32 32-32h32c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32zm0 128c0-17.7 14.3-32 32-32H544c17.7 0 32 14.3 32 32s-14.3 32-32 32H320c-17.7 0-32-14.3-32-32z"
613
621
  }
614
622
  ),
615
- /* @__PURE__ */ l("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.3L63.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32z" })
623
+ /* @__PURE__ */ s("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.3L63.6 181.6c-11.9 13-32.2 13.9-45.2 2s-13.9-32.2-2-45.2l88-96C110.5 35.8 119 32 128 32z" })
616
624
  ]
617
625
  }
618
626
  );
619
627
  /*!
620
- @versini/ui-icons v3.1.1
628
+ @versini/ui-icons v4.0.0
621
629
  © 2025 gizmette.com
622
630
  */
623
631
  try {
624
632
  window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
625
- version: "3.1.1",
626
- buildTime: "01/02/2025 05:13 PM EST",
633
+ version: "4.0.0",
634
+ buildTime: "01/03/2025 10:45 AM EST",
627
635
  homepage: "https://github.com/aversini/ui-components",
628
636
  license: "MIT"
629
637
  });
630
638
  } catch {
631
639
  }
632
- const y = T.createContext({
640
+ const k = T.createContext({
633
641
  mode: "light",
634
642
  cellWrapper: "thead",
635
643
  stickyHeader: !1,
@@ -641,33 +649,33 @@ const y = T.createContext({
641
649
  caption: t,
642
650
  compact: r,
643
651
  summary: o,
644
- className: d,
645
- wrapperClassName: c,
646
- maxHeight: s,
652
+ className: l,
653
+ wrapperClassName: d,
654
+ maxHeight: c,
647
655
  stickyHeader: g,
648
656
  stickyFooter: n,
649
657
  ...b
650
658
  }) => {
651
659
  const m = W({
652
660
  mode: a,
653
- className: d,
654
- wrapperClassName: c,
661
+ className: l,
662
+ wrapperClassName: d,
655
663
  stickyHeader: g,
656
664
  stickyFooter: n
657
665
  });
658
- return /* @__PURE__ */ l(
659
- y.Provider,
666
+ return /* @__PURE__ */ s(
667
+ k.Provider,
660
668
  {
661
669
  value: { mode: a, stickyHeader: g, stickyFooter: n, compact: r },
662
- children: /* @__PURE__ */ l(
670
+ children: /* @__PURE__ */ s(
663
671
  "div",
664
672
  {
665
673
  className: m.wrapper,
666
- ...s && {
667
- style: { maxHeight: s }
674
+ ...c && {
675
+ style: { maxHeight: c }
668
676
  },
669
- children: /* @__PURE__ */ k("table", { className: m.table, summary: o, ...b, children: [
670
- t && /* @__PURE__ */ l("caption", { className: m.caption, children: t }),
677
+ children: /* @__PURE__ */ y("table", { className: m.table, summary: o, ...b, children: [
678
+ t && /* @__PURE__ */ s("caption", { className: m.caption, children: t }),
671
679
  e
672
680
  ] })
673
681
  }
@@ -679,90 +687,92 @@ const y = T.createContext({
679
687
  className: a,
680
688
  ...t
681
689
  }) => {
682
- const r = v(y);
683
- r.cellWrapper = f;
684
- const o = j({
690
+ const r = v(k);
691
+ r.cellWrapper = _;
692
+ const o = P({
685
693
  className: a,
686
694
  mode: r.mode,
687
695
  stickyHeader: r.stickyHeader
688
696
  });
689
- return /* @__PURE__ */ l("thead", { className: o, ...t, children: e });
697
+ return /* @__PURE__ */ s("thead", { className: o, ...t, children: e });
690
698
  }, be = ({
691
699
  children: e,
692
700
  className: a,
693
701
  ...t
694
702
  }) => {
695
- const r = v(y);
703
+ const r = v(k);
696
704
  r.cellWrapper = B;
697
705
  const o = D({
698
706
  className: a,
699
707
  mode: r.mode,
700
708
  stickyFooter: r.stickyFooter
701
709
  });
702
- return /* @__PURE__ */ l("tfoot", { className: o, ...t, children: e });
710
+ return /* @__PURE__ */ s("tfoot", { className: o, ...t, children: e });
703
711
  }, me = ({ children: e, ...a }) => {
704
- const t = v(y);
705
- return t.cellWrapper = u, /* @__PURE__ */ l("tbody", { ...a, children: e });
712
+ const t = v(k);
713
+ return t.cellWrapper = u, /* @__PURE__ */ s("tbody", { ...a, children: e });
706
714
  }, ue = ({
707
715
  children: e,
708
716
  className: a,
709
717
  ...t
710
718
  }) => {
711
- const r = v(y), o = F({
719
+ const r = v(k), o = F({
712
720
  mode: r.mode,
713
721
  cellWrapper: r.cellWrapper,
714
722
  className: a
715
723
  });
716
- return /* @__PURE__ */ l("tr", { className: o, ...t, children: e });
717
- }, de = ({
724
+ return /* @__PURE__ */ s("tr", { className: o, ...t, children: e });
725
+ }, le = ({
718
726
  children: e,
719
727
  component: a,
720
728
  className: t,
721
- ...r
729
+ align: r,
730
+ ...o
722
731
  }) => {
723
- const o = v(y), d = a || (o.cellWrapper === f ? "th" : "td"), c = G({
724
- cellWrapper: o.cellWrapper,
732
+ const l = v(k), d = a || (l.cellWrapper === _ ? "th" : "td"), c = G({
733
+ cellWrapper: l.cellWrapper,
725
734
  className: t,
726
- mode: o.mode,
727
- compact: o.compact
735
+ mode: l.mode,
736
+ compact: l.compact,
737
+ align: r
728
738
  });
729
- return /* @__PURE__ */ l(d, { className: c, ...r, children: e });
730
- }, ke = ({
739
+ return /* @__PURE__ */ s(d, { className: c, ...o, children: e });
740
+ }, ye = ({
731
741
  align: e,
732
742
  children: a,
733
743
  buttonClassName: t,
734
744
  className: r,
735
745
  component: o,
736
- focusMode: d = "alt-system",
737
- mode: c = "alt-system",
738
- onClick: s,
746
+ focusMode: l = "alt-system",
747
+ mode: d = "alt-system",
748
+ onClick: c,
739
749
  sortDirection: g,
740
750
  sortedCell: n,
741
751
  cellId: b,
742
752
  ...m
743
753
  }) => {
744
754
  const h = Y({ buttonClassName: t });
745
- return /* @__PURE__ */ l(
746
- de,
755
+ return /* @__PURE__ */ s(
756
+ le,
747
757
  {
748
758
  component: o,
749
759
  className: r,
750
760
  role: "columnheader",
751
- "aria-sort": g === _.ASC && n === b ? "ascending" : g === _.DESC && n === b ? "descending" : "other",
761
+ "aria-sort": g === f.ASC && n === b ? "ascending" : g === f.DESC && n === b ? "descending" : "other",
752
762
  ...m,
753
- children: /* @__PURE__ */ l(
763
+ children: /* @__PURE__ */ s(
754
764
  R,
755
765
  {
756
766
  active: n === b,
757
767
  className: h,
758
- onClick: s,
768
+ onClick: c,
759
769
  align: e,
760
770
  noBorder: !0,
761
- focusMode: d,
762
- mode: c,
771
+ focusMode: l,
772
+ mode: d,
763
773
  fullWidth: !0,
764
774
  labelRight: a,
765
- children: g === _.ASC && n === b ? /* @__PURE__ */ l(le, { className: "size-4", monotone: !0 }) : g === _.DESC && n === b ? /* @__PURE__ */ l(ie, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ l(oe, { className: "size-4", monotone: !0 })
775
+ children: g === f.ASC && n === b ? /* @__PURE__ */ s(se, { className: "size-4", monotone: !0 }) : g === f.DESC && n === b ? /* @__PURE__ */ s(ie, { className: "size-4", monotone: !0 }) : /* @__PURE__ */ s(oe, { className: "size-4", monotone: !0 })
766
776
  }
767
777
  )
768
778
  }
@@ -771,9 +781,9 @@ const y = T.createContext({
771
781
  export {
772
782
  ge as Table,
773
783
  me as TableBody,
774
- de as TableCell,
775
- ke as TableCellSort,
776
- _ as TableCellSortDirections,
784
+ le as TableCell,
785
+ ye as TableCellSort,
786
+ f as TableCellSortDirections,
777
787
  be as TableFooter,
778
788
  he as TableHead,
779
789
  ue as TableRow
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-table",
3
- "version": "2.0.10",
3
+ "version": "3.0.0",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -39,14 +39,14 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@tailwindcss/typography": "0.5.15",
42
- "@versini/ui-button": "3.2.2",
43
- "@versini/ui-icons": "3.1.1",
44
- "@versini/ui-types": "3.0.3",
42
+ "@versini/ui-button": "4.0.0",
43
+ "@versini/ui-icons": "4.0.0",
44
+ "@versini/ui-types": "4.0.0",
45
45
  "clsx": "2.1.1",
46
46
  "tailwindcss": "3.4.17"
47
47
  },
48
48
  "sideEffects": [
49
49
  "**/*.css"
50
50
  ],
51
- "gitHead": "c43b9e0ea4ad97fde6cc3d088c32374ff34c6495"
51
+ "gitHead": "406bf426c5b3186ef7197e0b51d83ec0de689cde"
52
52
  }