@stackone/malachite 2.123.1 → 2.124.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.
Files changed (32) hide show
  1. package/COMPONENTS.md +4 -3
  2. package/dist/components/ActionMenu.js +4 -3
  3. package/dist/components/ActionMenu.js.map +1 -1
  4. package/dist/components/Card.js +88 -78
  5. package/dist/components/Card.js.map +1 -1
  6. package/dist/components/Flex.js +10 -8
  7. package/dist/components/Flex.js.map +1 -1
  8. package/dist/components/FrameHeader.js +26 -19
  9. package/dist/components/FrameHeader.js.map +1 -1
  10. package/dist/components/PageLayout/index.js +8 -7
  11. package/dist/components/PageLayout/index.js.map +1 -1
  12. package/dist/components/PageLayout/pageColumns.js +23 -0
  13. package/dist/components/PageLayout/pageColumns.js.map +1 -0
  14. package/dist/components/Table/Table.js +491 -472
  15. package/dist/components/Table/Table.js.map +1 -1
  16. package/dist/components/ToastProvider.js +32 -42
  17. package/dist/components/ToastProvider.js.map +1 -1
  18. package/dist/components/Typography/PathText.js +48 -55
  19. package/dist/components/Typography/PathText.js.map +1 -1
  20. package/dist/components/VisuallyHidden.js +8 -0
  21. package/dist/components/VisuallyHidden.js.map +1 -0
  22. package/dist/components/actionMenuStyles.js +33 -42
  23. package/dist/components/actionMenuStyles.js.map +1 -1
  24. package/dist/components/flexTypes.js +1 -1
  25. package/dist/components/flexTypes.js.map +1 -1
  26. package/dist/components/visuallyHiddenStyle.js +16 -0
  27. package/dist/components/visuallyHiddenStyle.js.map +1 -0
  28. package/dist/index.d.ts +32 -0
  29. package/dist/index.js +394 -392
  30. package/dist/index.js.map +1 -1
  31. package/dist/tailwind.css.js +1 -1
  32. package/package.json +1 -1
@@ -1,141 +1,153 @@
1
- import { jsx as r, jsxs as S } from "react/jsx-runtime";
2
- import { useVirtualizer as Qt } from "@tanstack/react-virtual";
3
- import $e, { useState as Q, useRef as H, useCallback as je, useId as Vt, useEffect as re, useMemo as bt, useLayoutEffect as Et } from "react";
4
- import wt from "../CustomIcons/CaretDownIcon.js";
5
- import Zt from "../CustomIcons/CaretUpIcon.js";
6
- import Xt from "../CustomIcons/InfoIcon.js";
7
- import Kt from "../CustomIcons/WarningTriangleIcon.js";
8
- import en from "../FrameHeader.js";
9
- import tn from "../PinnedCornerCap.js";
10
- import nn from "../Tooltip.js";
11
- import rn from "../TruncatedTooltip.js";
12
- import { devWarning as ln } from "../devWarning.js";
13
- import { FOCUS_RING_INSET as mt, FOCUS_RING_INSET_OVERLAY as an } from "../focusRing.js";
14
- import { FRAME_CLASS as on, FRAME_PADDING as se, FRAME_SECTION_RADIUS as de, FRAME_SECTION_BORDER as sn, FRAME_RADIUS as dn } from "../frameStyles.js";
15
- import { hasHeaderContent as xt } from "../headerContent.js";
16
- import { isFromInteractiveDescendant as yt, activateOnEnterOrSpace as cn } from "../keyboardActivation.js";
17
- import { FOREGROUND_RESET as Ye, SELECTED_ROW_ACCENT as Rt, SELECTED_TEXT_CONTEXT as Ct, SELECTED_ROW_FOREGROUND as _t, SELECTED_ROW_BACKGROUND as Qe } from "../selectedRow.js";
18
- import fn from "./TablePagination.js";
19
- import { paginationPlacement as hn } from "./paginationPlacement.js";
20
- import { useFillHeight as un } from "./useFillHeight.js";
21
- const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a === n[h]), St = "\0", pn = (e, n, a) => {
1
+ import { jsx as r, jsxs as k } from "react/jsx-runtime";
2
+ import { useVirtualizer as Kt } from "@tanstack/react-virtual";
3
+ import Ne, { useState as Q, useRef as U, useCallback as qe, useId as en, useEffect as ne, useMemo as yt, useLayoutEffect as Ct } from "react";
4
+ import _t from "../CustomIcons/CaretDownIcon.js";
5
+ import tn from "../CustomIcons/CaretUpIcon.js";
6
+ import nn from "../CustomIcons/InfoIcon.js";
7
+ import rn from "../CustomIcons/WarningTriangleIcon.js";
8
+ import ln from "../FrameHeader.js";
9
+ import on from "../PinnedCornerCap.js";
10
+ import an from "../Tooltip.js";
11
+ import sn from "../TruncatedTooltip.js";
12
+ import { devWarning as dn } from "../devWarning.js";
13
+ import { FOCUS_RING_INSET as St, FOCUS_RING_INSET_OVERLAY as cn } from "../focusRing.js";
14
+ import { FRAME_CLASS as fn, FRAME_PADDING as se, FRAME_SECTION_RADIUS as de, FRAME_SECTION_BORDER as hn, FRAME_RADIUS as un } from "../frameStyles.js";
15
+ import { hasHeaderContent as kt } from "../headerContent.js";
16
+ import { isFromInteractiveDescendant as $t, activateOnEnterOrSpace as pn } from "../keyboardActivation.js";
17
+ import { FOREGROUND_RESET as Je, SELECTED_ROW_ACCENT as It, SELECTED_TEXT_CONTEXT as Ot, SELECTED_ROW_FOREGROUND as Tt, SELECTED_ROW_BACKGROUND as Ze } from "../selectedRow.js";
18
+ import gn from "./TablePagination.js";
19
+ import { paginationPlacement as vn } from "./paginationPlacement.js";
20
+ import { useFillHeight as bn } from "./useFillHeight.js";
21
+ const Dt = 160, mn = (e, n) => e.length === n.length && e.every((o, f) => o === n[f]), Nt = "\0", xn = (e, n, o) => {
22
22
  if (typeof e != "object" || e === null)
23
- return `${St}i${a}`;
24
- const h = n.ids.get(e);
25
- if (h !== void 0)
26
- return h;
27
- const x = `${St}${n.next++}`;
28
- return n.ids.set(e, x), x;
29
- }, vn = (e, n, a) => typeof n == "function" ? e.map((h) => n(h)) : e.map((h, x) => {
30
- const N = h[n];
31
- return N == null ? pn(h, a, x) : String(N);
32
- }), Ee = (e) => {
23
+ return `${Nt}i${o}`;
24
+ const f = n.ids.get(e);
25
+ if (f !== void 0)
26
+ return f;
27
+ const b = `${Nt}${n.next++}`;
28
+ return n.ids.set(e, b), b;
29
+ }, yn = (e, n, o) => typeof n == "function" ? e.map((f) => n(f)) : e.map((f, b) => {
30
+ const y = f[n];
31
+ return y == null ? xn(f, o, b) : String(y);
32
+ }), ue = (e) => {
33
33
  if (typeof e == "number")
34
34
  return e;
35
35
  if (typeof e == "string") {
36
- const n = e.trim().match(/^(\d+(?:\.\d+)?)px$/);
36
+ const n = e.trim().match(/^(\d+(?:\.\d+)?|\.\d+)px$/i);
37
37
  if (n)
38
38
  return Number(n[1]);
39
39
  }
40
- }, Xe = (e) => {
41
- const n = Ee(e.width);
40
+ }, et = (e) => {
41
+ const n = ue(e.width);
42
42
  return !(e.title === "" || e.title == null) && n !== void 0 && typeof e.minWidth == "number" && e.minWidth < n ? e.minWidth : void 0;
43
- }, bn = (e) => e.reduce((n, a) => {
44
- const h = Xe(a) ?? Ee(a.width);
45
- return h !== void 0 ? n + h : typeof a.minWidth == "number" ? n + a.minWidth : n + It;
46
- }, 0), mn = (e) => (e.title === "" || e.title == null) && Ee(e.width) !== void 0, xn = (e) => {
47
- const n = [...e].reverse().findIndex((N) => !mn(N)), a = n === -1 ? 0 : e.length - n, h = /* @__PURE__ */ new Map(), x = e.reduceRight(
48
- (N, u, y) => {
49
- const g = Xe(u) ?? Ee(u.width);
50
- return !(u.fixed === "right" || y >= a) || g === void 0 ? N : (h.set(u.key, N.right), { right: N.right + g, edge: u.key });
43
+ }, Sn = (e) => e.reduce((n, o) => {
44
+ const f = et(o) ?? ue(o.width);
45
+ return f !== void 0 ? n + f : typeof o.minWidth == "number" ? n + o.minWidth : n + Dt;
46
+ }, 0), kn = (e) => {
47
+ const n = typeof e == "string" ? e.trim().toLowerCase() : e;
48
+ return !n || n === "auto" || n === "0" ? 0 : ue(e);
49
+ }, $n = (e) => {
50
+ let n = 0, o = 0, f = 0;
51
+ for (const { width: b, minWidth: y } of e) {
52
+ const h = kn(b);
53
+ if (h === void 0)
54
+ return;
55
+ h === 0 ? (n += 1, o = Math.max(o, y ?? 0)) : f += h;
56
+ }
57
+ return o === 0 ? void 0 : f + n * o;
58
+ }, Nn = (e) => (e.title === "" || e.title == null) && ue(e.width) !== void 0, En = (e) => {
59
+ const n = [...e].reverse().findIndex((y) => !Nn(y)), o = n === -1 ? 0 : e.length - n, f = /* @__PURE__ */ new Map(), b = e.reduceRight(
60
+ (y, h, S) => {
61
+ const p = et(h) ?? ue(h.width);
62
+ return !(h.fixed === "right" || S >= o) || p === void 0 ? y : (f.set(h.key, y.right), { right: y.right + p, edge: h.key });
51
63
  },
52
64
  { right: 0, edge: void 0 }
53
65
  );
54
- return { offsets: h, edgeKey: x.edge, extent: x.right };
55
- }, yn = { overflowX: "auto", scrollbarWidth: "none" }, Sn = {
66
+ return { offsets: f, edgeKey: b.edge, extent: b.right };
67
+ }, wn = { overflowX: "auto", scrollbarWidth: "none" }, Rn = {
56
68
  position: "sticky",
57
69
  left: 0,
58
70
  width: "100%"
59
- }, kn = { offsets: /* @__PURE__ */ new Map(), edgeKey: void 0, extent: 0 }, qe = (e) => `color-mix(in srgb, var(--malachite-card-shadow, rgba(0, 0, 0, 0.1)) ${e}%, transparent)`, $n = {
71
+ }, Cn = { offsets: /* @__PURE__ */ new Map(), edgeKey: void 0, extent: 0 }, Qe = (e) => `color-mix(in srgb, var(--malachite-card-shadow, rgba(0, 0, 0, 0.1)) ${e}%, transparent)`, _n = {
60
72
  position: "absolute",
61
73
  top: 0,
62
74
  bottom: 0,
63
75
  right: 0,
64
76
  width: 24,
65
77
  pointerEvents: "none",
66
- backgroundImage: `linear-gradient(to left, ${qe(45)}, ${qe(18)} 30%, ${qe(5)} 65%, transparent)`
67
- }, Nn = (e, n) => e === void 0 ? {} : {
78
+ backgroundImage: `linear-gradient(to left, ${Qe(45)}, ${Qe(18)} 30%, ${Qe(5)} 65%, transparent)`
79
+ }, In = (e, n) => e === void 0 ? {} : {
68
80
  position: "sticky",
69
81
  right: e,
70
82
  zIndex: 1,
71
83
  height: "auto",
72
84
  ...n === "row" ? { backgroundColor: "inherit", backgroundImage: "inherit" } : { backgroundColor: n }
73
- }, kt = (e) => `linear-gradient(${e}, ${e})`, En = (e, n) => {
85
+ }, Et = (e) => `linear-gradient(${e}, ${e})`, On = (e, n) => {
74
86
  if (!e && !n)
75
87
  return {};
76
- const a = [
77
- n ? kt(Qe) : void 0,
78
- e ? kt(`var(--malachite-table-row-variant-${e}-background)`) : void 0
79
- ].filter(Ke);
88
+ const o = [
89
+ n ? Et(Ze) : void 0,
90
+ e ? Et(`var(--malachite-table-row-variant-${e}-background)`) : void 0
91
+ ].filter(tt);
80
92
  return {
81
93
  backgroundColor: e ? "var(--malachite-table-background, #f7f7f7)" : "var(--malachite-table-row-background, #fff)",
82
- backgroundImage: a.join(", ")
94
+ backgroundImage: o.join(", ")
83
95
  };
84
- }, Ke = (e) => typeof e == "string", wn = {
96
+ }, tt = (e) => typeof e == "string", Tn = {
85
97
  default: 40,
86
98
  compact: 30,
87
99
  snug: 38
88
- }, Rn = {
100
+ }, Dn = {
89
101
  default: 40,
90
102
  compact: 40,
91
103
  snug: 34
92
- }, Cn = {
104
+ }, Mn = {
93
105
  default: "px-4 py-3",
94
106
  compact: "px-4 py-1",
95
107
  snug: "px-3 py-0"
96
- }, _n = {
108
+ }, Wn = {
97
109
  default: "px-4 py-3",
98
110
  compact: "px-4 py-3",
99
111
  snug: "px-3 py-[9px]"
100
- }, Ve = "text-[var(--malachite-text-primary,#0a0a0a)]", Ze = "text-[var(--malachite-text-dimmed,#a1a1a1)]", ce = (e) => ({
112
+ }, Xe = "text-[var(--malachite-text-primary,#0a0a0a)]", Ke = "text-[var(--malachite-text-dimmed,#a1a1a1)]", ce = (e) => ({
101
113
  small: "text-[length:var(--malachite-font-size-small)]",
102
114
  medium: "text-[length:var(--malachite-font-size-medium)]",
103
115
  large: "text-[length:var(--malachite-font-size-large)]"
104
- })[e], $t = {
116
+ })[e], wt = {
105
117
  borderBottom: "1px solid var(--malachite-card-border, #e8e8e8)"
106
- }, Nt = (e, n) => {
118
+ }, Rt = (e, n) => {
107
119
  e && n && n.scrollLeft !== e.scrollLeft && (n.scrollLeft = e.scrollLeft);
108
- }, In = 56, On = 44, Tn = 8, Dn = 10, Mn = "--malachite-ctx-table-surround", Je = "var(--malachite-table-header-background, #f7f7f7)", Ln = () => /* @__PURE__ */ r(
109
- tn,
120
+ }, Ln = 56, zn = 44, Fn = 8, An = 10, Bn = "--malachite-ctx-table-surround", Ve = "var(--malachite-table-header-background, #f7f7f7)", Hn = () => /* @__PURE__ */ r(
121
+ on,
110
122
  {
111
- radius: dn,
112
- surround: `var(${Mn}, var(--malachite-card-background, #ffffff))`
123
+ radius: un,
124
+ surround: `var(${Bn}, var(--malachite-card-background, #ffffff))`
113
125
  }
114
- ), Wn = ({
126
+ ), Pn = ({
115
127
  records: e,
116
128
  startIndex: n,
117
- scrollElement: a,
118
- estimateRowHeight: h,
119
- style: x,
120
- renderRow: N,
121
- registerHandle: u,
122
- cardKey: y,
123
- rovingIndex: g
129
+ scrollElement: o,
130
+ estimateRowHeight: f,
131
+ style: b,
132
+ renderRow: y,
133
+ registerHandle: h,
134
+ cardKey: S,
135
+ rovingIndex: p
124
136
  }) => {
125
- const I = H(null), [T, L] = Q(0);
126
- Et(() => {
137
+ const I = U(null), [T, L] = Q(0);
138
+ Ct(() => {
127
139
  const C = I.current;
128
- if (!C || !a)
140
+ if (!C || !o)
129
141
  return;
130
142
  const G = () => {
131
- const w = C.getBoundingClientRect().top - a.getBoundingClientRect().top + a.scrollTop;
143
+ const w = C.getBoundingClientRect().top - o.getBoundingClientRect().top + o.scrollTop;
132
144
  L((q) => Math.abs(q - w) < 1 ? q : w);
133
145
  };
134
146
  if (G(), typeof ResizeObserver > "u")
135
147
  return;
136
148
  const j = new ResizeObserver(G);
137
149
  let M = C;
138
- for (; M && M !== a; ) {
150
+ for (; M && M !== o; ) {
139
151
  let w = M.previousElementSibling;
140
152
  for (; w; )
141
153
  j.observe(w), w = w.previousElementSibling;
@@ -148,32 +160,32 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
148
160
  }
149
161
  }
150
162
  return () => j.disconnect();
151
- }, [a, e.length, n]);
152
- const D = Qt({
163
+ }, [o, e.length, n]);
164
+ const D = Kt({
153
165
  count: e.length,
154
166
  // State, not a ref: an ancestor's ref is not attached when this child's layout effects
155
167
  // run, so a ref would leave the virtualizer without a scroll element.
156
- getScrollElement: () => a,
157
- estimateSize: () => h,
158
- overscan: Tn,
168
+ getScrollElement: () => o,
169
+ estimateSize: () => f,
170
+ overscan: Fn,
159
171
  scrollMargin: T
160
172
  });
161
- re(() => {
162
- if (u)
163
- return u(y, {
173
+ ne(() => {
174
+ if (h)
175
+ return h(S, {
164
176
  startIndex: n,
165
177
  count: e.length,
166
178
  scrollToIndex: (C) => D.scrollToIndex(C, { align: "center" })
167
- }), () => u(y, null);
168
- }, [u, y, n, e.length, D]);
169
- const b = D.getVirtualItems(), P = D.getTotalSize(), V = g >= n && g < n + e.length && b.length > 0 ? Math.min(
170
- Math.max(g, n + b[0].index),
171
- n + b[b.length - 1].index
172
- ) : g, ee = b.length > 0 ? b[0].start - T : 0, te = b.length > 0 ? P - (b[b.length - 1].end - T) : 0;
173
- return /* @__PURE__ */ S("div", { ref: I, className: "flex flex-col w-full", style: x, children: [
174
- ee > 0 && /* @__PURE__ */ r("div", { "aria-hidden": "true", style: { height: ee, flexShrink: 0 } }),
175
- b.map(
176
- (C) => N(
179
+ }), () => h(S, null);
180
+ }, [h, S, n, e.length, D]);
181
+ const m = D.getVirtualItems(), re = D.getTotalSize(), V = p >= n && p < n + e.length && m.length > 0 ? Math.min(
182
+ Math.max(p, n + m[0].index),
183
+ n + m[m.length - 1].index
184
+ ) : p, Y = m.length > 0 ? m[0].start - T : 0, ee = m.length > 0 ? re - (m[m.length - 1].end - T) : 0;
185
+ return /* @__PURE__ */ k("div", { ref: I, className: "flex flex-col w-full", style: b, children: [
186
+ Y > 0 && /* @__PURE__ */ r("div", { "aria-hidden": "true", style: { height: Y, flexShrink: 0 } }),
187
+ m.map(
188
+ (C) => y(
177
189
  e[C.index],
178
190
  n + C.index,
179
191
  C.index === e.length - 1,
@@ -182,133 +194,135 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
182
194
  V
183
195
  )
184
196
  ),
185
- te > 0 && /* @__PURE__ */ r("div", { "aria-hidden": "true", style: { height: te, flexShrink: 0 } })
197
+ ee > 0 && /* @__PURE__ */ r("div", { "aria-hidden": "true", style: { height: ee, flexShrink: 0 } })
186
198
  ] });
187
- }, zn = (e, n) => {
188
- const a = n ? In : 0;
189
- return typeof e == "number" ? `${Math.max(0, e - a)}px` : `calc(${e} - ${a}px)`;
199
+ }, Un = (e, n) => {
200
+ const o = n ? Ln : 0;
201
+ return typeof e == "number" ? `${Math.max(0, e - o)}px` : `calc(${e} - ${o}px)`;
190
202
  }, fe = (e) => {
191
203
  const n = e.width;
192
204
  if (n == null)
193
205
  return {};
194
- const a = typeof n == "number" ? `${n}px` : n, h = Xe(e);
195
- return h === void 0 ? { flexBasis: a, maxWidth: a } : { flexBasis: a, maxWidth: a, minWidth: h, flexShrink: 1 };
196
- }, et = (e) => {
206
+ const o = typeof n == "number" ? `${n}px` : n, f = et(e);
207
+ return f === void 0 ? { flexBasis: o, maxWidth: o } : { flexBasis: o, maxWidth: o, minWidth: f, flexShrink: 1 };
208
+ }, nt = (e) => {
197
209
  const n = e.width;
198
210
  if (n == null)
199
211
  return {};
200
- const a = typeof n == "number" ? `${n}px` : n;
201
- return { width: a, flexBasis: a };
202
- }, Fn = (e) => e === "asc" ? "ascending" : e === "desc" ? "descending" : "none", K = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-start", An = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-between", he = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", Ot = (e) => e ? K(e) : "justify-end", Ne = ({ info: e }) => /* @__PURE__ */ r(nn, { text: e, placement: "top", children: /* @__PURE__ */ r(Xt, { size: 13, className: "shrink-0 text-[var(--malachite-text-secondary,#bbb)]" }) }), Bn = { ascend: "asc", descend: "desc" }, Hn = (e) => {
203
- const n = e.find((a) => a.sorter && a.defaultSortOrder);
204
- return n != null && n.defaultSortOrder ? { key: n.key, direction: Bn[n.defaultSortOrder] } : null;
205
- }, Tt = (e, n) => ({
212
+ const o = typeof n == "number" ? `${n}px` : n;
213
+ return { width: o, flexBasis: o };
214
+ }, Gn = (e) => e === "asc" ? "ascending" : e === "desc" ? "descending" : "none", K = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-start", jn = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-between", he = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", Mt = (e) => e ? K(e) : "justify-end", Ee = ({ info: e }) => /* @__PURE__ */ r(an, { text: e, placement: "top", children: /* @__PURE__ */ r(nn, { size: 13, className: "shrink-0 text-[var(--malachite-text-secondary,#bbb)]" }) }), Yn = { ascend: "asc", descend: "desc" }, qn = (e) => {
215
+ const n = e.find((o) => o.sorter && o.defaultSortOrder);
216
+ return n != null && n.defaultSortOrder ? { key: n.key, direction: Yn[n.defaultSortOrder] } : null;
217
+ }, Wt = (e, n) => ({
206
218
  type: "button",
207
219
  onClick: n,
208
220
  "aria-label": typeof e == "string" ? `Sort by ${e}` : "Sort column"
209
- }), Pn = ({
221
+ }), Jn = ({
210
222
  column: e,
211
223
  record: n,
212
- index: a,
213
- size: h,
214
- paddingClass: x,
215
- height: N,
216
- bordered: u,
217
- isFirstRow: y,
218
- isLastRow: g,
224
+ index: o,
225
+ size: f,
226
+ paddingClass: b,
227
+ height: y,
228
+ bordered: h,
229
+ isFirstRow: S,
230
+ isLastRow: p,
219
231
  isFirstColumn: I,
220
232
  isLastColumn: T,
221
233
  variantBackground: L,
222
234
  showSelectedAccent: D,
223
- isSelected: b
235
+ isSelected: m,
236
+ minWidth: re
224
237
  }) => {
225
- const P = n[e.dataIndex], U = e.render ? e.render(P, n, a) : P == null ? "" : String(P), V = e.ellipsis && Ke(P) ? P : void 0;
238
+ const F = n[e.dataIndex], V = e.render ? e.render(F, n, o) : F == null ? "" : String(F), Y = e.ellipsis && tt(F) ? F : void 0;
226
239
  return /* @__PURE__ */ r(
227
240
  "td",
228
241
  {
229
242
  className: `
230
- table-cell ${x} ${ce(h)}
243
+ table-cell ${b} ${ce(f)}
231
244
  ${e.ellipsis ? "truncate overflow-hidden whitespace-nowrap" : ""}
232
- ${u ? "table-cell-bordered" : ""}
233
- ${u && y ? "table-cell-bordered-top" : ""}
234
- ${u && I ? "table-cell-bordered-left" : ""}
235
- ${u && T ? "table-cell-bordered-right" : ""}
236
- ${u && I && y ? "rounded-tl-lg" : ""}
237
- ${u && T && y ? "rounded-tr-lg" : ""}
238
- ${u && I && g ? "rounded-bl-lg" : ""}
239
- ${u && T && g ? "rounded-br-lg" : ""}
245
+ ${h ? "table-cell-bordered" : ""}
246
+ ${h && S ? "table-cell-bordered-top" : ""}
247
+ ${h && I ? "table-cell-bordered-left" : ""}
248
+ ${h && T ? "table-cell-bordered-right" : ""}
249
+ ${h && I && S ? "rounded-tl-lg" : ""}
250
+ ${h && T && S ? "rounded-tr-lg" : ""}
251
+ ${h && I && p ? "rounded-bl-lg" : ""}
252
+ ${h && T && p ? "rounded-br-lg" : ""}
240
253
  ${he(e.align)}
241
254
  `,
242
255
  style: {
243
256
  width: e.width,
244
- height: N,
257
+ minWidth: re,
258
+ height: y,
245
259
  backgroundColor: L ?? // Mirror the row's background, or the tint composites over the wrong opaque
246
260
  // base — they differ in dark mode.
247
- (b ? u ? "var(--malachite-table-borderedRow-background, #fff)" : "var(--malachite-table-row-background, #fff)" : void 0),
261
+ (m ? h ? "var(--malachite-table-borderedRow-background, #fff)" : "var(--malachite-table-row-background, #fff)" : void 0),
248
262
  // Its own layer, so the tint composites over the cell instead of replacing it.
249
- backgroundImage: b ? `linear-gradient(${Qe}, ${Qe})` : void 0,
263
+ backgroundImage: m ? `linear-gradient(${Ze}, ${Ze})` : void 0,
250
264
  // Content pinning its own colour follows via the channel below.
251
- color: b ? _t : "var(--malachite-table-row-foreground)",
252
- ...b ? Ct : {},
265
+ color: m ? Tt : "var(--malachite-table-row-foreground)",
266
+ ...m ? Ot : {},
253
267
  // Inset box-shadow, not `ring-*`: --tw-ring-* silently doesn't paint in a shadow root.
254
- boxShadow: D ? `inset 2px 0 0 ${Rt}` : void 0,
255
- borderBottom: u ? void 0 : g ? "none" : "1px solid var(--malachite-table-row-border)"
268
+ boxShadow: D ? `inset 2px 0 0 ${It}` : void 0,
269
+ borderBottom: h ? void 0 : p ? "none" : "1px solid var(--malachite-table-row-border)"
256
270
  },
257
- title: V,
258
- children: U
271
+ title: Y,
272
+ children: V
259
273
  }
260
274
  );
261
- }, Un = ({
275
+ }, Qn = ({
262
276
  column: e,
263
277
  paddingClass: n,
264
- sortDirection: a,
265
- onSort: h,
266
- cellStyle: x
278
+ sortDirection: o,
279
+ onSort: f,
280
+ cellStyle: b
267
281
  }) => {
268
- const N = !!e.sorter, u = e.title === "" || e.title == null;
269
- if (u && e.width !== void 0)
282
+ const y = !!e.sorter, h = e.title === "" || e.title == null;
283
+ if (h && e.width !== void 0)
270
284
  return /* @__PURE__ */ r(
271
285
  "div",
272
286
  {
273
287
  className: "h-full shrink-0",
274
288
  style: {
275
- ...et(e),
276
- ...x
289
+ ...nt(e),
290
+ ...b
277
291
  }
278
292
  }
279
293
  );
280
- if (u)
294
+ if (h)
281
295
  return /* @__PURE__ */ r(
282
296
  "div",
283
297
  {
284
298
  className: "flex flex-[1_0_0] h-full min-w-0",
285
299
  style: {
286
300
  ...fe(e),
287
- ...x
301
+ ...b
288
302
  }
289
303
  }
290
304
  );
291
- const g = typeof e.title == "string" ? /* @__PURE__ */ r("p", { className: "font-medium text-[13px] text-[var(--malachite-text-primary,#0a0a0a)] tracking-[0.13px] whitespace-nowrap truncate", children: e.title }) : e.title, I = /* @__PURE__ */ r(
292
- wt,
305
+ const p = typeof e.title == "string" ? /* @__PURE__ */ r("p", { className: "font-medium text-[13px] text-[var(--malachite-text-primary,#0a0a0a)] tracking-[0.13px] whitespace-nowrap truncate", children: e.title }) : e.title, I = /* @__PURE__ */ r(
306
+ _t,
293
307
  {
294
308
  size: 13,
295
- className: `shrink-0 transition-transform ${a ? Ve : Ze} ${a === "asc" ? "rotate-180" : ""}`
309
+ className: `shrink-0 transition-transform ${o ? Xe : Ke} ${o === "asc" ? "rotate-180" : ""}`
296
310
  }
297
311
  );
298
- return N ? /* @__PURE__ */ r(
312
+ return y ? /* @__PURE__ */ r(
299
313
  "div",
300
314
  {
301
315
  className: "flex flex-[1_0_0] min-w-0 overflow-hidden",
302
- style: { ...fe(e), ...x },
303
- children: /* @__PURE__ */ S(
316
+ style: { ...fe(e), ...b },
317
+ children: /* @__PURE__ */ k(
304
318
  "button",
305
319
  {
306
- ...Tt(e.title, h),
307
- className: `flex flex-1 items-center ${An(e.align)} gap-1 min-w-0 ${n} cursor-pointer appearance-none bg-transparent border-0 ${he(e.align)}`,
320
+ ...Wt(e.title, f),
321
+ className: `flex flex-1 items-center ${jn(e.align)} gap-1 min-w-0 ${n} cursor-pointer appearance-none bg-transparent border-0 ${he(e.align)}`,
308
322
  children: [
309
- /* @__PURE__ */ S("div", { className: "flex items-center gap-1 min-w-0", children: [
310
- g,
311
- e.info && /* @__PURE__ */ r(Ne, { info: e.info })
323
+ /* @__PURE__ */ k("div", { className: "flex items-center gap-1 min-w-0", children: [
324
+ p,
325
+ e.info && /* @__PURE__ */ r(Ee, { info: e.info })
312
326
  ] }),
313
327
  I
314
328
  ]
@@ -321,73 +335,73 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
321
335
  className: `flex flex-[1_0_0] items-center ${K(e.align)} min-w-0 overflow-hidden ${n}`,
322
336
  style: {
323
337
  ...fe(e),
324
- ...x
338
+ ...b
325
339
  },
326
- children: /* @__PURE__ */ S("div", { className: "flex items-center gap-1 min-w-0", children: [
327
- g,
328
- e.info && /* @__PURE__ */ r(Ne, { info: e.info })
340
+ children: /* @__PURE__ */ k("div", { className: "flex items-center gap-1 min-w-0", children: [
341
+ p,
342
+ e.info && /* @__PURE__ */ r(Ee, { info: e.info })
329
343
  ] })
330
344
  }
331
345
  );
332
- }, Gn = ({
346
+ }, Vn = ({
333
347
  column: e,
334
348
  record: n,
335
- index: a,
336
- size: h,
337
- paddingClass: x,
338
- isSelected: N = !1,
339
- cellStyle: u
349
+ index: o,
350
+ size: f,
351
+ paddingClass: b,
352
+ isSelected: y = !1,
353
+ cellStyle: h
340
354
  }) => {
341
- const y = n[e.dataIndex], g = e.render ? e.render(y, n, a) : y == null ? "" : String(y), T = (e.title === "" || e.title == null) && e.width !== void 0, L = Ke(y) && y.length > 0, D = N ? {
342
- color: _t,
343
- ...Ct
355
+ const S = n[e.dataIndex], p = e.render ? e.render(S, n, o) : S == null ? "" : String(S), T = (e.title === "" || e.title == null) && e.width !== void 0, L = tt(S) && S.length > 0, D = y ? {
356
+ color: Tt,
357
+ ...Ot
344
358
  } : {};
345
359
  if (T)
346
360
  return /* @__PURE__ */ r(
347
361
  "div",
348
362
  {
349
- className: `flex items-center ${Ot(e.align)} shrink-0 overflow-hidden ${x}`,
363
+ className: `flex items-center ${Mt(e.align)} shrink-0 overflow-hidden ${b}`,
350
364
  style: {
351
- ...et(e),
365
+ ...nt(e),
352
366
  ...D,
353
- ...u
367
+ ...h
354
368
  },
355
- children: g
369
+ children: p
356
370
  }
357
371
  );
358
- const b = !e.render && L ? /* @__PURE__ */ r(rn, { text: y, children: g }) : g;
372
+ const m = !e.render && L ? /* @__PURE__ */ r(sn, { text: S, children: p }) : p;
359
373
  return /* @__PURE__ */ r(
360
374
  "div",
361
375
  {
362
- className: `flex flex-[1_0_0] items-center min-w-0 overflow-hidden ${x} ${ce(h)} ${K(e.align)}`,
376
+ className: `flex flex-[1_0_0] items-center min-w-0 overflow-hidden ${b} ${ce(f)} ${K(e.align)}`,
363
377
  style: {
364
378
  ...fe(e),
365
379
  ...D,
366
- ...u
380
+ ...h
367
381
  },
368
- children: b
382
+ children: m
369
383
  }
370
384
  );
371
- }, fr = ({
385
+ }, br = ({
372
386
  columns: e,
373
387
  data: n,
374
- loading: a = !1,
375
- error: h = !1,
376
- errorTitle: x = "Data unavailable",
377
- errorSubTitle: N = "There was an issue retrieving the data. Please try again.",
378
- emptyTitle: u = "No data",
379
- emptySubTitle: y = "",
380
- bordered: g = !1,
388
+ loading: o = !1,
389
+ error: f = !1,
390
+ errorTitle: b = "Data unavailable",
391
+ errorSubTitle: y = "There was an issue retrieving the data. Please try again.",
392
+ emptyTitle: h = "No data",
393
+ emptySubTitle: S = "",
394
+ bordered: p = !1,
381
395
  showHeader: I = !0,
382
396
  rowKey: T = "key",
383
397
  scrollHeight: L,
384
398
  size: D = "small",
385
- rowDensity: b = "default",
386
- layout: P = "auto",
387
- headerVariant: U = "inline",
399
+ rowDensity: m = "default",
400
+ layout: re = "auto",
401
+ headerVariant: F = "inline",
388
402
  title: V,
389
- subtitle: ee,
390
- extra: te,
403
+ subtitle: Y,
404
+ extra: ee,
391
405
  rowClassName: C,
392
406
  rowVariant: G,
393
407
  onRow: j,
@@ -396,73 +410,73 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
396
410
  scrollSelectedIntoView: q = !0,
397
411
  rowSelection: ie,
398
412
  pagination: R,
399
- className: tt = "",
413
+ className: rt = "",
400
414
  style: we,
401
415
  stickyHeaderTop: Re,
402
- scrollX: Y = !1,
416
+ scrollX: B = !1,
403
417
  rowSection: Ce,
404
418
  renderSectionDivider: _e,
405
419
  onVisibleOrderChange: Ie,
406
- virtual: Dt = !1,
407
- virtualRowHeightEstimate: Mt,
408
- virtualScrollElement: ue = null
420
+ virtual: Lt = !1,
421
+ virtualRowHeightEstimate: zt,
422
+ virtualScrollElement: pe = null
409
423
  }) => {
410
- const le = Cn[b], Oe = _n[b], Te = wn[b], nt = b === "snug" ? Te : void 0, [O, Lt] = Q(() => Hn(e)), rt = H(null), De = H(null), ae = H(null), Me = H(null), Le = H(/* @__PURE__ */ new Map()), Wt = je(
424
+ const le = Mn[m], Oe = Wn[m], Te = Tn[m], it = m === "snug" ? Te : void 0, [O, Ft] = Q(() => qn(e)), lt = U(null), De = U(null), oe = U(null), Me = U(null), We = U(/* @__PURE__ */ new Map()), At = qe(
411
425
  (t, i) => {
412
- i ? Le.current.set(t, i) : Le.current.delete(t);
426
+ i ? We.current.set(t, i) : We.current.delete(t);
413
427
  },
414
428
  []
415
- ), Z = Vt(), [zt, We] = Q(0), J = Dt && U === "detached", Ft = Mt ?? On, [oe, At] = Q(null), Bt = je((t) => {
416
- ae.current = t, t && At((i) => i === t ? i : t);
417
- }, []), ze = J ? ue ?? oe : null, [Ht, it] = Q(null), ge = L === "fill", lt = un(
418
- U === "detached" ? oe : Ht,
429
+ ), Z = en(), [Bt, Le] = Q(0), J = Lt && F === "detached", Ht = zt ?? zn, [ae, Pt] = Q(null), Ut = qe((t) => {
430
+ oe.current = t, t && Pt((i) => i === t ? i : t);
431
+ }, []), ze = J ? pe ?? ae : null, [Gt, ot] = Q(null), ge = L === "fill", at = bn(
432
+ F === "detached" ? ae : Gt,
419
433
  ge,
420
434
  // The pager is only drawn once loaded, and takes its height out of the room.
421
- !!R && !a
422
- ), Fe = lt === void 0 ? void 0 : `${lt}px`, at = Y ? bn(e) : 0, pe = Y && U === "detached" ? xn(e) : kn, ve = pe.edgeKey !== void 0, [Pt, ot] = Q(!1), [Ut, st] = Q(0), be = je(() => {
423
- const t = ae.current;
424
- ot(
435
+ !!R && !o
436
+ ), Fe = at === void 0 ? void 0 : `${at}px`, st = B ? Sn(e) : 0, ve = B && F === "detached" ? En(e) : Cn, be = ve.edgeKey !== void 0, [jt, dt] = Q(!1), [Yt, ct] = Q(0), me = qe(() => {
437
+ const t = oe.current;
438
+ dt(
425
439
  t !== null && t.scrollLeft + t.clientWidth < t.scrollWidth - 1
426
- ), st(t === null ? 0 : t.offsetWidth - t.clientWidth);
440
+ ), ct(t === null ? 0 : t.offsetWidth - t.clientWidth);
427
441
  }, []);
428
- re(() => {
429
- if (!ve || !oe) {
430
- ot(!1), st(0);
442
+ ne(() => {
443
+ if (!be || !ae) {
444
+ dt(!1), ct(0);
431
445
  return;
432
446
  }
433
- if (be(), typeof ResizeObserver > "u")
447
+ if (me(), typeof ResizeObserver > "u")
434
448
  return;
435
- const t = new ResizeObserver(be);
436
- return t.observe(oe), () => t.disconnect();
437
- }, [ve, oe, at, be]);
438
- const Ae = !(J && ue), A = U === "detached" && Re !== void 0 && I && !L && (!J || !Ae), dt = w != null, [Be, ct] = Q(0);
439
- re(() => {
440
- const t = rt.current;
441
- if (!t || !A || !dt || typeof ResizeObserver > "u") {
442
- ct(0);
449
+ const t = new ResizeObserver(me);
450
+ return t.observe(ae), () => t.disconnect();
451
+ }, [be, ae, st, me]);
452
+ const Ae = !(J && pe), H = F === "detached" && Re !== void 0 && I && !L && (!J || !Ae), ft = w != null, [Be, ht] = Q(0);
453
+ ne(() => {
454
+ const t = lt.current;
455
+ if (!t || !H || !ft || typeof ResizeObserver > "u") {
456
+ ht(0);
443
457
  return;
444
458
  }
445
459
  const i = new ResizeObserver((c) => {
446
- var f, v;
447
- const o = c[0], p = ((v = (f = o == null ? void 0 : o.borderBoxSize) == null ? void 0 : f[0]) == null ? void 0 : v.blockSize) ?? (o == null ? void 0 : o.contentRect.height) ?? 0;
448
- ct(
449
- (k) => Math.abs(k - p) < 1 ? k : p
460
+ var u, v;
461
+ const a = c[0], g = ((v = (u = a == null ? void 0 : a.borderBoxSize) == null ? void 0 : u[0]) == null ? void 0 : v.blockSize) ?? (a == null ? void 0 : a.contentRect.height) ?? 0;
462
+ ht(
463
+ ($) => Math.abs($ - g) < 1 ? $ : g
450
464
  );
451
465
  });
452
466
  return i.observe(t), () => i.disconnect();
453
- }, [A, dt]);
454
- const Gt = A ? (Re ?? 0) + Be : void 0, { sortedData: W, sectionDividers: He } = bt(() => {
455
- const t = (f) => {
456
- if (!O) return f;
457
- const v = e.find((F) => F.key === O.key);
458
- if (!v || v.sorter === "server") return f;
467
+ }, [H, ft]);
468
+ const qt = H ? (Re ?? 0) + Be : void 0, { sortedData: W, sectionDividers: He } = yt(() => {
469
+ const t = (u) => {
470
+ if (!O) return u;
471
+ const v = e.find((A) => A.key === O.key);
472
+ if (!v || v.sorter === "server") return u;
459
473
  if (typeof v.sorter == "function") {
460
- const F = [...f].sort(v.sorter);
461
- return O.direction === "asc" ? F : F.reverse();
474
+ const A = [...u].sort(v.sorter);
475
+ return O.direction === "asc" ? A : A.reverse();
462
476
  }
463
- const k = v.dataIndex ?? O.key;
464
- return [...f].sort((F, s) => {
465
- const l = F[k], d = s[k];
477
+ const $ = v.dataIndex ?? O.key;
478
+ return [...u].sort((A, s) => {
479
+ const l = A[$], d = s[$];
466
480
  return l < d ? O.direction === "asc" ? -1 : 1 : l > d ? O.direction === "asc" ? 1 : -1 : 0;
467
481
  });
468
482
  };
@@ -472,41 +486,41 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
472
486
  sectionDividers: /* @__PURE__ */ new Map()
473
487
  };
474
488
  const i = [], c = /* @__PURE__ */ new Map();
475
- for (const f of n) {
476
- const v = Ce(f);
477
- let k = c.get(v);
478
- k === void 0 && (k = i.length, c.set(v, k), i.push({ key: v, records: [] })), i[k].records.push(f);
489
+ for (const u of n) {
490
+ const v = Ce(u);
491
+ let $ = c.get(v);
492
+ $ === void 0 && ($ = i.length, c.set(v, $), i.push({ key: v, records: [] })), i[$].records.push(u);
479
493
  }
480
- const o = [], p = /* @__PURE__ */ new Map();
481
- for (const f of i) {
482
- const v = t(f.records);
483
- p.set(o.length, { key: f.key, records: v }), o.push(...v);
494
+ const a = [], g = /* @__PURE__ */ new Map();
495
+ for (const u of i) {
496
+ const v = t(u.records);
497
+ g.set(a.length, { key: u.key, records: v }), a.push(...v);
484
498
  }
485
- return { sortedData: o, sectionDividers: p };
486
- }, [n, O, e, Ce]), jt = (t) => {
487
- Lt((i) => (i == null ? void 0 : i.key) === t ? i.direction === "asc" ? { key: t, direction: "desc" } : null : { key: t, direction: "asc" });
488
- }, ft = (t, i) => (c) => {
489
- var o, p, f;
490
- jt(t.key), (f = (p = (o = t.onHeaderCell) == null ? void 0 : o.call(t, t, i)) == null ? void 0 : p.onClick) == null || f.call(p, c);
491
- }, Pe = (t, i) => typeof T == "function" ? T(t) : String(t[T] ?? i), ht = typeof T == "function" ? null : T, ut = H(void 0), me = H(void 0);
492
- re(() => {
499
+ return { sortedData: a, sectionDividers: g };
500
+ }, [n, O, e, Ce]), Jt = (t) => {
501
+ Ft((i) => (i == null ? void 0 : i.key) === t ? i.direction === "asc" ? { key: t, direction: "desc" } : null : { key: t, direction: "asc" });
502
+ }, ut = (t, i) => (c) => {
503
+ var a, g, u;
504
+ Jt(t.key), (u = (g = (a = t.onHeaderCell) == null ? void 0 : a.call(t, t, i)) == null ? void 0 : g.onClick) == null || u.call(g, c);
505
+ }, Pe = (t, i) => typeof T == "function" ? T(t) : String(t[T] ?? i), pt = typeof T == "function" ? null : T, gt = U(void 0), xe = U(void 0);
506
+ ne(() => {
493
507
  if (!Ie)
494
508
  return;
495
- me.current ?? (me.current = { ids: /* @__PURE__ */ new WeakMap(), next: 0 });
496
- const t = vn(W, T, me.current), i = ut.current;
497
- i && gn(i, t) || (ut.current = t, Ie(W));
498
- }, [W, ht, Ie]);
499
- const ne = Math.min(zt, Math.max(0, W.length - 1)), z = bt(() => {
509
+ xe.current ?? (xe.current = { ids: /* @__PURE__ */ new WeakMap(), next: 0 });
510
+ const t = yn(W, T, xe.current), i = gt.current;
511
+ i && mn(i, t) || (gt.current = t, Ie(W));
512
+ }, [W, pt, Ie]);
513
+ const te = Math.min(Bt, Math.max(0, W.length - 1)), z = yt(() => {
500
514
  if (w == null)
501
515
  return -1;
502
516
  const t = String(w);
503
517
  return W.findIndex((i, c) => Pe(i, c) === t);
504
- }, [w, W, ht]);
505
- re(() => {
506
- z >= 0 && We(z);
518
+ }, [w, W, pt]);
519
+ ne(() => {
520
+ z >= 0 && Le(z);
507
521
  }, [z]);
508
- const Ue = H(void 0);
509
- re(() => {
522
+ const Ue = U(void 0);
523
+ ne(() => {
510
524
  if (w == null) {
511
525
  Ue.current = void 0;
512
526
  return;
@@ -514,90 +528,90 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
514
528
  if (!q || z < 0)
515
529
  return;
516
530
  const t = Ue.current;
517
- if (t && t.key === w && t.index === z || a || h || J && !ze)
531
+ if (t && t.key === w && t.index === z || o || f || J && !ze)
518
532
  return;
519
533
  const i = Me.current;
520
534
  if (!i)
521
535
  return;
522
- const c = A && Be === 0, o = (l) => i.querySelector(
536
+ const c = H && Be === 0, a = (l) => i.querySelector(
523
537
  `[data-table-id="${Z}"][data-row-index="${l}"]`
524
- ), p = (l) => {
525
- const d = ae.current, _ = ue, E = d == null ? void 0 : d.scrollLeft, B = _ == null ? void 0 : _.scrollLeft;
526
- l.scrollIntoView({ block: "nearest", inline: "nearest" }), d && E !== void 0 && (d.scrollLeft = E), _ && B !== void 0 && (_.scrollLeft = B), c || (Ue.current = { key: w, index: z });
527
- }, f = o(z);
528
- if (f) {
529
- p(f);
538
+ ), g = (l) => {
539
+ const d = oe.current, _ = pe, E = d == null ? void 0 : d.scrollLeft, P = _ == null ? void 0 : _.scrollLeft;
540
+ l.scrollIntoView({ block: "nearest", inline: "nearest" }), d && E !== void 0 && (d.scrollLeft = E), _ && P !== void 0 && (_.scrollLeft = P), c || (Ue.current = { key: w, index: z });
541
+ }, u = a(z);
542
+ if (u) {
543
+ g(u);
530
544
  return;
531
545
  }
532
546
  if (!J)
533
547
  return;
534
- const v = [...Le.current.values()].find(
548
+ const v = [...We.current.values()].find(
535
549
  (l) => z >= l.startIndex && z < l.startIndex + l.count
536
550
  );
537
551
  if (!v)
538
552
  return;
539
553
  v.scrollToIndex(z - v.startIndex);
540
- let k = 0, F = 0;
554
+ let $ = 0, A = 0;
541
555
  const s = () => {
542
- const l = o(z);
556
+ const l = a(z);
543
557
  if (l) {
544
- p(l);
558
+ g(l);
545
559
  return;
546
560
  }
547
- ++F < Dn && (k = requestAnimationFrame(s));
561
+ ++A < An && ($ = requestAnimationFrame(s));
548
562
  };
549
- return k = requestAnimationFrame(s), () => cancelAnimationFrame(k);
563
+ return $ = requestAnimationFrame(s), () => cancelAnimationFrame($);
550
564
  }, [
551
565
  w,
552
566
  z,
553
567
  J,
554
568
  ze,
555
- ue,
556
- A,
569
+ pe,
570
+ H,
557
571
  Be,
558
- a,
559
- h,
572
+ o,
573
+ f,
560
574
  Z,
561
575
  q
562
576
  ]);
563
- const Ge = H(null), gt = (t, i) => {
564
- Ge.current = t, We(Math.min(Math.max(0, i), W.length - 1));
577
+ const Ge = U(null), vt = (t, i) => {
578
+ Ge.current = t, Le(Math.min(Math.max(0, i), W.length - 1));
565
579
  };
566
- Et(() => {
580
+ Ct(() => {
567
581
  const t = Ge.current;
568
582
  if (!t)
569
583
  return;
570
584
  Ge.current = null;
571
- const i = t.getRootNode(), o = ((v) => i.querySelector(
585
+ const i = t.getRootNode(), a = ((v) => i.querySelector(
572
586
  `[data-table-id="${Z}"][data-row-index="${v}"]`
573
- ))(ne);
574
- if (o) {
575
- o.focus();
587
+ ))(te);
588
+ if (a) {
589
+ a.focus();
576
590
  return;
577
591
  }
578
- const p = i.querySelectorAll(
592
+ const g = i.querySelectorAll(
579
593
  `[data-table-id="${Z}"][data-row-index]`
580
- ), f = ne > 0 ? p[p.length - 1] : p[0];
581
- f && (We(Number(f.dataset.rowIndex)), f.focus());
582
- }, [ne, Z]);
583
- const pt = (t, i) => (c) => {
584
- const o = { ArrowDown: 1, ArrowUp: -1 }[c.key];
585
- if (o !== void 0) {
586
- c.preventDefault(), gt(c.currentTarget, t + o);
594
+ ), u = te > 0 ? g[g.length - 1] : g[0];
595
+ u && (Le(Number(u.dataset.rowIndex)), u.focus());
596
+ }, [te, Z]);
597
+ const bt = (t, i) => (c) => {
598
+ const a = { ArrowDown: 1, ArrowUp: -1 }[c.key];
599
+ if (a !== void 0) {
600
+ c.preventDefault(), vt(c.currentTarget, t + a);
587
601
  return;
588
602
  }
589
603
  if (!J && (c.key === "Home" || c.key === "End")) {
590
- c.preventDefault(), gt(c.currentTarget, c.key === "Home" ? 0 : W.length - 1);
604
+ c.preventDefault(), vt(c.currentTarget, c.key === "Home" ? 0 : W.length - 1);
591
605
  return;
592
606
  }
593
- i && cn(c, i, "enter");
607
+ i && pn(c, i, "enter");
594
608
  };
595
- U !== "detached" && xt({ title: V, subtitle: ee, extra: te }) && ln(
609
+ F !== "detached" && kt({ title: V, subtitle: Y, extra: ee }) && dn(
596
610
  "table-title-inline",
597
611
  'Table `title`, `subtitle` and `extra` draw only on the detached header. Pass `headerVariant="detached"` or leave them out.'
598
612
  );
599
- const vt = hn(R == null ? void 0 : R.position), xe = (t) => R && !a && vt[t] ? /* @__PURE__ */ r(
600
- fn,
613
+ const mt = vn(R == null ? void 0 : R.position), ye = (t) => R && !o && mt[t] ? /* @__PURE__ */ r(
614
+ gn,
601
615
  {
602
616
  current: R.current ?? 1,
603
617
  pageSize: R.pageSize ?? 10,
@@ -609,56 +623,56 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
609
623
  onChange: R.onChange,
610
624
  onShowSizeChange: R.onShowSizeChange,
611
625
  edge: t,
612
- align: vt[t]
626
+ align: mt[t]
613
627
  }
614
628
  ) : null;
615
- if (U === "detached") {
616
- const t = Y ? { minWidth: at } : {}, i = (s, l) => ({
617
- ...Y && s.width === void 0 ? { minWidth: s.minWidth ?? It } : {},
618
- ...Nn(pe.offsets.get(s.key), l)
619
- }), c = (s) => s.key === pe.edgeKey && Pt ? /* @__PURE__ */ r(
629
+ if (F === "detached") {
630
+ const t = B ? { minWidth: st } : {}, i = (s, l) => ({
631
+ ...B && s.width === void 0 ? { minWidth: s.minWidth ?? Dt } : {},
632
+ ...In(ve.offsets.get(s.key), l)
633
+ }), c = (s) => s.key === ve.edgeKey && jt ? /* @__PURE__ */ r(
620
634
  "span",
621
635
  {
622
636
  "aria-hidden": "true",
623
637
  className: "shrink-0",
624
638
  style: {
625
639
  position: "sticky",
626
- right: pe.extent,
640
+ right: ve.extent,
627
641
  zIndex: 1
628
642
  },
629
- children: /* @__PURE__ */ r("span", { style: $n })
643
+ children: /* @__PURE__ */ r("span", { style: _n })
630
644
  }
631
- ) : null, o = xt({ title: V, subtitle: ee, extra: te }) ? /* @__PURE__ */ r(en, { title: V, subtitle: ee, extra: te }) : null, p = A ? Je : "var(--malachite-table-background, #f7f7f7)", f = {
632
- border: sn,
645
+ ) : null, a = kt({ title: V, subtitle: Y, extra: ee }) ? /* @__PURE__ */ r(ln, { title: V, subtitle: Y, extra: ee }) : null, g = H ? Ve : "var(--malachite-table-background, #f7f7f7)", u = {
646
+ border: hn,
633
647
  borderRadius: de,
634
648
  overflow: "clip",
635
649
  flexShrink: 0,
636
650
  ...t
637
- }, v = (s, l, d = !1, _ = !1, E, B = ne) => {
638
- const X = Pe(s, l), m = (j == null ? void 0 : j(s, l)) || {}, qt = G == null ? void 0 : G(s, l), ye = l === z, Se = M || m.onClick ? () => {
639
- var $;
640
- M == null || M(s, l), ($ = m.onClick) == null || $.call(m, s, l);
641
- } : void 0, ke = !!Se, Jt = d ? {} : $t;
642
- return /* @__PURE__ */ S(
651
+ }, v = (s, l, d = !1, _ = !1, E, P = te) => {
652
+ const X = Pe(s, l), x = (j == null ? void 0 : j(s, l)) || {}, Zt = G == null ? void 0 : G(s, l), Se = l === z, ke = M || x.onClick ? () => {
653
+ var N;
654
+ M == null || M(s, l), (N = x.onClick) == null || N.call(x, s, l);
655
+ } : void 0, $e = !!ke, Xt = d ? {} : wt;
656
+ return /* @__PURE__ */ k(
643
657
  "div",
644
658
  {
645
659
  ref: E == null ? void 0 : E.measureRef,
646
660
  "data-index": E == null ? void 0 : E.index,
647
661
  "data-table-id": Z,
648
662
  "data-row-index": l,
649
- "aria-current": ye ? "true" : void 0,
650
- tabIndex: ke ? l === B ? 0 : -1 : void 0,
651
- onKeyDown: ke ? pt(l, Se) : void 0,
663
+ "aria-current": Se ? "true" : void 0,
664
+ tabIndex: $e ? l === P ? 0 : -1 : void 0,
665
+ onKeyDown: $e ? bt(l, ke) : void 0,
652
666
  className: `
653
667
  group bg-[var(--malachite-table-row-background,#fff)] flex items-stretch relative w-full
654
- ${ke ? `cursor-pointer hover:bg-[var(--malachite-table-row-hover-background,#fafafa)] ${mt}` : ""}
668
+ ${$e ? `cursor-pointer hover:bg-[var(--malachite-table-row-hover-background,#fafafa)] ${St}` : ""}
655
669
  ${(C == null ? void 0 : C(s, l)) || ""}
656
670
  `,
657
671
  style: {
658
- ...Jt,
672
+ ...Xt,
659
673
  ...t,
660
674
  minHeight: Te,
661
- scrollMarginTop: Gt,
675
+ scrollMarginTop: qt,
662
676
  // Echo the card's clip, or it cuts the accent bar's end into a stub.
663
677
  ..._ ? {
664
678
  borderTopLeftRadius: de,
@@ -669,68 +683,68 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
669
683
  borderBottomRightRadius: de
670
684
  } : {},
671
685
  // Set unconditionally it would beat `hover:bg-*` on every row.
672
- ...En(qt, ye),
673
- ...ye ? {
686
+ ...On(Zt, Se),
687
+ ...Se ? {
674
688
  // Inset box-shadow, not `ring-*` — see the classic cell.
675
- boxShadow: `inset 2px 0 0 ${Rt}`
689
+ boxShadow: `inset 2px 0 0 ${It}`
676
690
  } : {}
677
691
  },
678
- onClick: Se ? ($) => {
679
- yt($) || Se();
692
+ onClick: ke ? (N) => {
693
+ $t(N) || ke();
680
694
  } : void 0,
681
- onDoubleClick: m.onDoubleClick ? () => {
682
- var $;
683
- return ($ = m.onDoubleClick) == null ? void 0 : $.call(m, s, l);
695
+ onDoubleClick: x.onDoubleClick ? () => {
696
+ var N;
697
+ return (N = x.onDoubleClick) == null ? void 0 : N.call(x, s, l);
684
698
  } : void 0,
685
- onContextMenu: m.onContextMenu ? () => {
686
- var $;
687
- return ($ = m.onContextMenu) == null ? void 0 : $.call(m, s, l);
699
+ onContextMenu: x.onContextMenu ? () => {
700
+ var N;
701
+ return (N = x.onContextMenu) == null ? void 0 : N.call(x, s, l);
688
702
  } : void 0,
689
- onMouseEnter: m.onMouseEnter ? () => {
690
- var $;
691
- return ($ = m.onMouseEnter) == null ? void 0 : $.call(m, s, l);
703
+ onMouseEnter: x.onMouseEnter ? () => {
704
+ var N;
705
+ return (N = x.onMouseEnter) == null ? void 0 : N.call(x, s, l);
692
706
  } : void 0,
693
- onMouseLeave: m.onMouseLeave ? () => {
694
- var $;
695
- return ($ = m.onMouseLeave) == null ? void 0 : $.call(m, s, l);
707
+ onMouseLeave: x.onMouseLeave ? () => {
708
+ var N;
709
+ return (N = x.onMouseLeave) == null ? void 0 : N.call(x, s, l);
696
710
  } : void 0,
697
711
  children: [
698
- e.map(($) => /* @__PURE__ */ S($e.Fragment, { children: [
699
- c($),
712
+ e.map((N) => /* @__PURE__ */ k(Ne.Fragment, { children: [
713
+ c(N),
700
714
  /* @__PURE__ */ r(
701
- Gn,
715
+ Vn,
702
716
  {
703
- column: $,
717
+ column: N,
704
718
  record: s,
705
719
  paddingClass: le,
706
720
  index: l,
707
721
  size: D,
708
- isSelected: ye,
709
- cellStyle: i($, "row")
722
+ isSelected: Se,
723
+ cellStyle: i(N, "row")
710
724
  }
711
725
  )
712
- ] }, $.key)),
713
- ke && ve ? /* @__PURE__ */ r("span", { "aria-hidden": "true", className: an }) : null
726
+ ] }, N.key)),
727
+ $e && be ? /* @__PURE__ */ r("span", { "aria-hidden": "true", className: cn }) : null
714
728
  ]
715
729
  },
716
730
  X
717
731
  );
718
- }, k = (s, l = !1) => /* @__PURE__ */ r(
732
+ }, $ = (s, l = !1) => /* @__PURE__ */ r(
719
733
  "div",
720
734
  {
721
735
  className: "bg-[var(--malachite-table-row-background,#fff)] flex items-stretch w-full",
722
736
  style: {
723
- ...l ? {} : $t,
737
+ ...l ? {} : wt,
724
738
  ...t,
725
739
  minHeight: Te
726
740
  },
727
741
  children: e.map((d) => {
728
- const B = (d.title === "" || d.title == null) && d.width !== void 0 ? /* @__PURE__ */ r(
742
+ const P = (d.title === "" || d.title == null) && d.width !== void 0 ? /* @__PURE__ */ r(
729
743
  "div",
730
744
  {
731
- className: `flex items-center ${Ot(d.align)} shrink-0 overflow-clip ${le}`,
745
+ className: `flex items-center ${Mt(d.align)} shrink-0 overflow-clip ${le}`,
732
746
  style: {
733
- ...et(d),
747
+ ...nt(d),
734
748
  ...i(d, "row")
735
749
  },
736
750
  children: /* @__PURE__ */ r("div", { className: "table-skeleton-bar h-3 rounded animate-pulse w-2/5" })
@@ -746,60 +760,60 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
746
760
  children: /* @__PURE__ */ r("div", { className: "table-skeleton-bar h-3 rounded animate-pulse w-3/5" })
747
761
  }
748
762
  );
749
- return /* @__PURE__ */ S($e.Fragment, { children: [
763
+ return /* @__PURE__ */ k(Ne.Fragment, { children: [
750
764
  c(d),
751
- B
765
+ P
752
766
  ] }, d.key);
753
767
  })
754
768
  },
755
769
  `skeleton-${s}`
756
- ), F = I ? /* @__PURE__ */ r(
770
+ ), A = I ? /* @__PURE__ */ r(
757
771
  "div",
758
772
  {
759
773
  className: "flex items-stretch w-full",
760
- style: { ...t, minHeight: Rn[b] },
761
- children: e.map((s, l) => /* @__PURE__ */ S($e.Fragment, { children: [
774
+ style: { ...t, minHeight: Dn[m] },
775
+ children: e.map((s, l) => /* @__PURE__ */ k(Ne.Fragment, { children: [
762
776
  c(s),
763
777
  /* @__PURE__ */ r(
764
- Un,
778
+ Qn,
765
779
  {
766
780
  column: s,
767
781
  paddingClass: Oe,
768
782
  sortDirection: (O == null ? void 0 : O.key) === s.key ? O.direction : null,
769
- onSort: s.sorter ? ft(s, l) : void 0,
770
- cellStyle: i(s, p)
783
+ onSort: s.sorter ? ut(s, l) : void 0,
784
+ cellStyle: i(s, g)
771
785
  }
772
786
  )
773
787
  ] }, s.key))
774
788
  }
775
789
  ) : null;
776
- return /* @__PURE__ */ S(
790
+ return /* @__PURE__ */ k(
777
791
  "div",
778
792
  {
779
793
  ref: Me,
780
- className: `w-full ${tt}`,
781
- style: { ...Ye, ...we },
794
+ className: `w-full ${rt}`,
795
+ style: { ...Je, ...we },
782
796
  children: [
783
- xe("top"),
784
- /* @__PURE__ */ S(
797
+ ye("top"),
798
+ /* @__PURE__ */ k(
785
799
  "div",
786
800
  {
787
- className: `${on} flex flex-col items-start ${A ? "" : "overflow-clip"} relative w-full`,
801
+ className: `${fn} flex flex-col items-start ${H ? "" : "overflow-clip"} relative w-full`,
788
802
  children: [
789
- !I && o,
790
- I && /* @__PURE__ */ S(
803
+ !I && a,
804
+ I && /* @__PURE__ */ k(
791
805
  "div",
792
806
  {
793
- ref: rt,
807
+ ref: lt,
794
808
  style: {
795
- ...A ? {
809
+ ...H ? {
796
810
  position: "sticky",
797
811
  top: Re,
798
812
  zIndex: 8,
799
813
  // A title row sits on the frame, as a framed Card's
800
814
  // does; the header colour goes behind the column
801
815
  // headers alone.
802
- backgroundColor: o ? "var(--malachite-table-background, #f7f7f7)" : Je,
816
+ backgroundColor: a ? "var(--malachite-table-background, #f7f7f7)" : Ve,
803
817
  marginInline: -se,
804
818
  width: `calc(100% + ${se * 2}px)`,
805
819
  paddingInline: se,
@@ -810,24 +824,24 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
810
824
  } : { width: "100%" }
811
825
  },
812
826
  children: [
813
- A && /* @__PURE__ */ r(Ln, {}),
814
- o,
827
+ H && /* @__PURE__ */ r(Hn, {}),
828
+ a,
815
829
  /* @__PURE__ */ r(
816
830
  "div",
817
831
  {
818
832
  ref: De,
819
- onScroll: Y ? () => Nt(
833
+ onScroll: B ? () => Rt(
820
834
  De.current,
821
- ae.current
835
+ oe.current
822
836
  ) : void 0,
823
837
  style: {
824
- ...Y ? {
825
- ...yn,
826
- paddingRight: Ut
838
+ ...B ? {
839
+ ...wn,
840
+ paddingRight: Yt
827
841
  } : {},
828
- ...A && o ? { backgroundColor: Je } : {}
842
+ ...H && a ? { backgroundColor: Ve } : {}
829
843
  },
830
- children: F
844
+ children: A
831
845
  }
832
846
  )
833
847
  ]
@@ -836,11 +850,11 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
836
850
  /* @__PURE__ */ r(
837
851
  "div",
838
852
  {
839
- ref: Bt,
840
- onScroll: Y ? () => {
841
- Nt(ae.current, De.current), ve && be();
853
+ ref: Ut,
854
+ onScroll: B ? () => {
855
+ Rt(oe.current, De.current), be && me();
842
856
  } : void 0,
843
- className: `flex flex-col items-start ${Y ? "overflow-x-auto" : "overflow-x-clip"} ${Ae ? "overflow-y-auto" : "overflow-y-visible"} w-full`,
857
+ className: `flex flex-col items-start ${B ? "overflow-x-auto" : "overflow-x-clip"} ${Ae ? "overflow-y-auto" : "overflow-y-visible"} w-full`,
844
858
  style: {
845
859
  // Firefox + modern Chromium only; older Webkit keeps its default.
846
860
  scrollbarWidth: "thin",
@@ -848,43 +862,43 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
848
862
  // With an external virtual scroller the body is overflow-visible and
849
863
  // a bounded box would overlap content below it.
850
864
  ...L && Ae ? {
851
- maxHeight: ge ? Fe : zn(L, !!R)
865
+ maxHeight: ge ? Fe : Un(L, !!R)
852
866
  } : {}
853
867
  },
854
- children: h ? /* @__PURE__ */ r("div", { className: "flex flex-col w-full", style: f, children: /* @__PURE__ */ S("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
855
- /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium mb-1", children: x }),
856
- /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[13px]", children: N })
857
- ] }) }) : a ? /* @__PURE__ */ r("div", { className: "flex flex-col w-full", style: f, children: (() => {
868
+ children: f ? /* @__PURE__ */ r("div", { className: "flex flex-col w-full", style: u, children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
869
+ /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium mb-1", children: b }),
870
+ /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[13px]", children: y })
871
+ ] }) }) : o ? /* @__PURE__ */ r("div", { className: "flex flex-col w-full", style: u, children: (() => {
858
872
  const s = R != null && R.pageSize ? Math.min(R.pageSize, 10) : 5;
859
873
  return Array.from({ length: s }).map(
860
- (l, d) => k(d, d === s - 1)
874
+ (l, d) => $(d, d === s - 1)
861
875
  );
862
- })() }) : W.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col w-full", style: f, children: /* @__PURE__ */ S("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
863
- /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: u }),
864
- y && /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: y })
876
+ })() }) : W.length === 0 ? /* @__PURE__ */ r("div", { className: "flex flex-col w-full", style: u, children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
877
+ /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: h }),
878
+ S && /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: S })
865
879
  ] }) }) : (() => {
866
880
  const s = (d, _, E) => J ? /* @__PURE__ */ r(
867
- Wn,
881
+ Pn,
868
882
  {
869
883
  cardKey: E,
870
884
  records: d,
871
885
  startIndex: _,
872
886
  scrollElement: ze,
873
- estimateRowHeight: Ft,
874
- style: f,
887
+ estimateRowHeight: Ht,
888
+ style: u,
875
889
  renderRow: v,
876
- registerHandle: Wt,
877
- rovingIndex: ne
890
+ registerHandle: At,
891
+ rovingIndex: te
878
892
  },
879
893
  `section-card-${E}`
880
894
  ) : /* @__PURE__ */ r(
881
895
  "div",
882
896
  {
883
897
  className: "flex flex-col w-full",
884
- style: f,
898
+ style: u,
885
899
  children: d.map(
886
- (B, X) => v(
887
- B,
900
+ (P, X) => v(
901
+ P,
888
902
  _ + X,
889
903
  X === d.length - 1,
890
904
  X === 0
@@ -900,17 +914,17 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
900
914
  const E = He.get(d);
901
915
  if (!E)
902
916
  return null;
903
- const B = _ + 1 < l.length ? l[_ + 1] : W.length, X = W.slice(d, B), m = _e == null ? void 0 : _e(
917
+ const P = _ + 1 < l.length ? l[_ + 1] : W.length, X = W.slice(d, P), x = _e == null ? void 0 : _e(
904
918
  E.key,
905
919
  E.records
906
920
  );
907
- return /* @__PURE__ */ S($e.Fragment, { children: [
908
- m != null ? /* @__PURE__ */ r(
921
+ return /* @__PURE__ */ k(Ne.Fragment, { children: [
922
+ x != null ? /* @__PURE__ */ r(
909
923
  "div",
910
924
  {
911
925
  className: "table-section-divider",
912
- style: Y ? Sn : void 0,
913
- children: m
926
+ style: B ? Rn : void 0,
927
+ children: x
914
928
  }
915
929
  ) : null,
916
930
  s(X, d, E.key)
@@ -922,28 +936,28 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
922
936
  ]
923
937
  }
924
938
  ),
925
- xe("bottom")
939
+ ye("bottom")
926
940
  ]
927
941
  }
928
942
  );
929
943
  }
930
- const Yt = (t, i) => {
931
- const c = t.sorter, p = (O == null ? void 0 : O.key) === t.key ? O == null ? void 0 : O.direction : null, f = /* @__PURE__ */ S("div", { className: `flex items-center gap-2 ${K(t.align)}`, children: [
944
+ const je = re === "fixed" || e.some((t) => t.width), xt = B && (o || W.length > 0), Qt = xt && je ? $n(e) : void 0, Ye = (t) => xt && !je ? t.minWidth : void 0, Vt = (t, i) => {
945
+ const c = t.sorter, g = (O == null ? void 0 : O.key) === t.key ? O == null ? void 0 : O.direction : null, u = /* @__PURE__ */ k("div", { className: `flex items-center gap-2 ${K(t.align)}`, children: [
932
946
  /* @__PURE__ */ r("span", { children: t.title }),
933
- t.info && /* @__PURE__ */ r(Ne, { info: t.info }),
934
- c && /* @__PURE__ */ S("div", { className: "flex flex-col", children: [
947
+ t.info && /* @__PURE__ */ r(Ee, { info: t.info }),
948
+ c && /* @__PURE__ */ k("div", { className: "flex flex-col", children: [
935
949
  /* @__PURE__ */ r(
936
- Zt,
950
+ tn,
937
951
  {
938
952
  size: 12,
939
- className: p === "asc" ? Ve : Ze
953
+ className: g === "asc" ? Xe : Ke
940
954
  }
941
955
  ),
942
956
  /* @__PURE__ */ r(
943
- wt,
957
+ _t,
944
958
  {
945
959
  size: 12,
946
- className: `-mt-1 ${p === "desc" ? Ve : Ze}`
960
+ className: `-mt-1 ${g === "desc" ? Xe : Ke}`
947
961
  }
948
962
  )
949
963
  ] })
@@ -956,48 +970,48 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
956
970
  ${ce(D)}
957
971
  ${he(t.align)}
958
972
  `,
959
- style: { width: t.width },
960
- "aria-sort": c ? Fn(p) : void 0,
973
+ style: { width: t.width, minWidth: Ye(t) },
974
+ "aria-sort": c ? Gn(g) : void 0,
961
975
  children: c ? /* @__PURE__ */ r(
962
976
  "button",
963
977
  {
964
- ...Tt(t.title, ft(t, i)),
978
+ ...Wt(t.title, ut(t, i)),
965
979
  className: `flex w-full items-center ${K(t.align)} cursor-pointer hover:opacity-80 appearance-none bg-transparent border-0 p-0 font-semibold text-inherit ${he(t.align)}`,
966
- children: f
980
+ children: u
967
981
  }
968
- ) : f
982
+ ) : u
969
983
  },
970
984
  t.key
971
985
  );
972
986
  };
973
- return h ? /* @__PURE__ */ r("div", { className: "w-full", style: { ...Ye, ...we }, children: /* @__PURE__ */ r(
987
+ return f ? /* @__PURE__ */ r("div", { className: "w-full", style: { ...Je, ...we }, children: /* @__PURE__ */ r(
974
988
  "div",
975
989
  {
976
- ref: it,
990
+ ref: ot,
977
991
  className: "overflow-x-auto",
978
992
  style: {
979
993
  ...L ? { maxHeight: ge ? Fe : L } : {}
980
994
  },
981
- children: /* @__PURE__ */ S("table", { className: "w-full border-collapse rounded-lg overflow-hidden", children: [
995
+ children: /* @__PURE__ */ k("table", { className: "w-full border-collapse rounded-lg overflow-hidden", children: [
982
996
  I && /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: e.map((t) => /* @__PURE__ */ r(
983
997
  "th",
984
998
  {
985
999
  className: `
986
1000
  table-header table-cell ${Oe} font-semibold border-0 first:rounded-tl-lg last:rounded-tr-lg
987
- ${g ? "table-cell-bordered table-cell-bordered-top" : ""}
988
- ${g && t === e[0] ? "table-cell-bordered-left" : ""}
989
- ${g && t === e[e.length - 1] ? "table-cell-bordered-right" : ""}
1001
+ ${p ? "table-cell-bordered table-cell-bordered-top" : ""}
1002
+ ${p && t === e[0] ? "table-cell-bordered-left" : ""}
1003
+ ${p && t === e[e.length - 1] ? "table-cell-bordered-right" : ""}
990
1004
  ${ce(D)}
991
1005
  ${he(t.align)}
992
1006
  `,
993
1007
  style: { width: t.width },
994
- children: /* @__PURE__ */ S(
1008
+ children: /* @__PURE__ */ k(
995
1009
  "div",
996
1010
  {
997
1011
  className: `flex items-center gap-2 ${K(t.align)}`,
998
1012
  children: [
999
1013
  /* @__PURE__ */ r("span", { children: t.title }),
1000
- t.info && /* @__PURE__ */ r(Ne, { info: t.info })
1014
+ t.info && /* @__PURE__ */ r(Ee, { info: t.info })
1001
1015
  ]
1002
1016
  }
1003
1017
  )
@@ -1009,54 +1023,58 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
1009
1023
  {
1010
1024
  colSpan: e.length + (ie ? 1 : 0),
1011
1025
  className: "px-4 py-12 text-center",
1012
- children: /* @__PURE__ */ S("div", { className: "flex flex-col items-center justify-center", children: [
1013
- /* @__PURE__ */ r("div", { className: "table-error-icon w-12 h-12 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ r(Kt, { size: 24 }) }),
1014
- /* @__PURE__ */ r("div", { className: "table-error-title text-lg font-semibold mb-2", children: x }),
1015
- /* @__PURE__ */ r("div", { className: "table-error-subtitle text-sm", children: N })
1026
+ children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center", children: [
1027
+ /* @__PURE__ */ r("div", { className: "table-error-icon w-12 h-12 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ r(rn, { size: 24 }) }),
1028
+ /* @__PURE__ */ r("div", { className: "table-error-title text-lg font-semibold mb-2", children: b }),
1029
+ /* @__PURE__ */ r("div", { className: "table-error-subtitle text-sm", children: y })
1016
1030
  ] })
1017
1031
  }
1018
1032
  ) }) })
1019
1033
  ] })
1020
1034
  }
1021
- ) }) : /* @__PURE__ */ S(
1035
+ ) }) : /* @__PURE__ */ k(
1022
1036
  "div",
1023
1037
  {
1024
1038
  ref: Me,
1025
- className: `w-full ${tt}`,
1026
- style: { ...Ye, ...we },
1039
+ className: `w-full ${rt}`,
1040
+ style: { ...Je, ...we },
1027
1041
  children: [
1028
- xe("top"),
1042
+ ye("top"),
1029
1043
  /* @__PURE__ */ r(
1030
1044
  "div",
1031
1045
  {
1032
- className: `overflow-hidden rounded-lg ${g ? "table-bordered-container" : "table-container-border"}`,
1033
- "data-bordered": g ? "true" : "false",
1046
+ className: `overflow-hidden rounded-lg ${p ? "table-bordered-container" : "table-container-border"}`,
1047
+ "data-bordered": p ? "true" : "false",
1034
1048
  children: /* @__PURE__ */ r(
1035
1049
  "div",
1036
1050
  {
1037
- ref: it,
1051
+ ref: ot,
1038
1052
  className: "overflow-x-auto",
1039
1053
  style: {
1040
1054
  ...L ? { maxHeight: ge ? Fe : L } : {}
1041
1055
  },
1042
- children: /* @__PURE__ */ S(
1056
+ children: /* @__PURE__ */ k(
1043
1057
  "table",
1044
1058
  {
1045
- className: `w-full ${P === "fixed" || e.some((t) => t.width) ? "table-fixed" : "table-auto"} ${g ? "border-separate table-bordered" : "border-collapse"} rounded-lg overflow-hidden`,
1046
- style: { borderSpacing: "0" },
1059
+ className: `w-full ${je ? "table-fixed" : "table-auto"} ${p ? "border-separate table-bordered" : "border-collapse"} rounded-lg overflow-hidden`,
1060
+ style: {
1061
+ borderSpacing: "0",
1062
+ minWidth: Qt
1063
+ },
1047
1064
  children: [
1048
- I && /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: e.map((t, i) => Yt(t, i)) }) }),
1049
- /* @__PURE__ */ r("tbody", { children: a ? Array.from({ length: 5 }).map((t, i) => /* @__PURE__ */ r(
1065
+ I && /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ r("tr", { children: e.map((t, i) => Vt(t, i)) }) }),
1066
+ /* @__PURE__ */ r("tbody", { children: o ? Array.from({ length: 5 }).map((t, i) => /* @__PURE__ */ r(
1050
1067
  "tr",
1051
1068
  {
1052
- className: `table-row ${g ? "table-row-bordered" : ""}`,
1069
+ className: `table-row ${p ? "table-row-bordered" : ""}`,
1053
1070
  children: e.map((c) => /* @__PURE__ */ r(
1054
1071
  "td",
1055
1072
  {
1056
1073
  className: `table-cell ${le} text-left ${ce(D)}`,
1057
1074
  style: {
1058
1075
  width: c.width,
1059
- height: nt
1076
+ minWidth: Ye(c),
1077
+ height: it
1060
1078
  },
1061
1079
  children: /* @__PURE__ */ r("div", { className: "table-skeleton-bar h-4 rounded animate-pulse" })
1062
1080
  },
@@ -1069,15 +1087,15 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
1069
1087
  {
1070
1088
  colSpan: e.length + (ie ? 1 : 0),
1071
1089
  className: "px-4 py-12 text-center",
1072
- children: /* @__PURE__ */ S("div", { className: "flex flex-col items-center justify-center", children: [
1073
- /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: u }),
1074
- y && /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: y })
1090
+ children: /* @__PURE__ */ k("div", { className: "flex flex-col items-center justify-center", children: [
1091
+ /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: h }),
1092
+ S && /* @__PURE__ */ r("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: S })
1075
1093
  ] })
1076
1094
  }
1077
1095
  ) }) : W.map((t, i) => {
1078
- const c = Pe(t, i), o = (j == null ? void 0 : j(t, i)) || {}, p = G == null ? void 0 : G(t, i), f = i === 0, v = i === n.length - 1, k = i === z, F = p ? `var(--malachite-table-row-variant-${p}-background)` : void 0, s = M || o.onClick ? () => {
1096
+ const c = Pe(t, i), a = (j == null ? void 0 : j(t, i)) || {}, g = G == null ? void 0 : G(t, i), u = i === 0, v = i === n.length - 1, $ = i === z, A = g ? `var(--malachite-table-row-variant-${g}-background)` : void 0, s = M || a.onClick ? () => {
1079
1097
  var l;
1080
- M == null || M(t, i), (l = o.onClick) == null || l.call(o, t, i);
1098
+ M == null || M(t, i), (l = a.onClick) == null || l.call(a, t, i);
1081
1099
  } : void 0;
1082
1100
  return (
1083
1101
  // Keeps `row` semantics: `role="button"` would strip the table
@@ -1087,52 +1105,53 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
1087
1105
  {
1088
1106
  "data-table-id": Z,
1089
1107
  "data-row-index": i,
1090
- "aria-current": k ? "true" : void 0,
1091
- tabIndex: s ? i === ne ? 0 : -1 : void 0,
1092
- onKeyDown: s ? pt(i, s) : void 0,
1108
+ "aria-current": $ ? "true" : void 0,
1109
+ tabIndex: s ? i === te ? 0 : -1 : void 0,
1110
+ onKeyDown: s ? bt(i, s) : void 0,
1093
1111
  className: `
1094
- ${g ? "table-row-bordered" : `table-row ${k ? "" : "hover:opacity-80"}`}
1112
+ ${p ? "table-row-bordered" : `table-row ${$ ? "" : "hover:opacity-80"}`}
1095
1113
  ${(C == null ? void 0 : C(t, i)) || ""}
1096
- ${s ? `cursor-pointer ${mt}` : ""}
1114
+ ${s ? `cursor-pointer ${St}` : ""}
1097
1115
  `,
1098
1116
  onClick: s ? (l) => {
1099
- yt(l) || s();
1117
+ $t(l) || s();
1100
1118
  } : void 0,
1101
- onDoubleClick: o.onDoubleClick ? () => {
1119
+ onDoubleClick: a.onDoubleClick ? () => {
1102
1120
  var l;
1103
- return (l = o.onDoubleClick) == null ? void 0 : l.call(o, t, i);
1121
+ return (l = a.onDoubleClick) == null ? void 0 : l.call(a, t, i);
1104
1122
  } : void 0,
1105
- onContextMenu: o.onContextMenu ? () => {
1123
+ onContextMenu: a.onContextMenu ? () => {
1106
1124
  var l;
1107
- return (l = o.onContextMenu) == null ? void 0 : l.call(o, t, i);
1125
+ return (l = a.onContextMenu) == null ? void 0 : l.call(a, t, i);
1108
1126
  } : void 0,
1109
- onMouseEnter: o.onMouseEnter ? () => {
1127
+ onMouseEnter: a.onMouseEnter ? () => {
1110
1128
  var l;
1111
- return (l = o.onMouseEnter) == null ? void 0 : l.call(o, t, i);
1129
+ return (l = a.onMouseEnter) == null ? void 0 : l.call(a, t, i);
1112
1130
  } : void 0,
1113
- onMouseLeave: o.onMouseLeave ? () => {
1131
+ onMouseLeave: a.onMouseLeave ? () => {
1114
1132
  var l;
1115
- return (l = o.onMouseLeave) == null ? void 0 : l.call(o, t, i);
1133
+ return (l = a.onMouseLeave) == null ? void 0 : l.call(a, t, i);
1116
1134
  } : void 0,
1117
1135
  children: e.map((l) => {
1118
1136
  const d = l === e[0], _ = l === e[e.length - 1];
1119
1137
  return /* @__PURE__ */ r(
1120
- Pn,
1138
+ Jn,
1121
1139
  {
1122
1140
  column: l,
1123
1141
  record: t,
1124
1142
  index: i,
1125
1143
  size: D,
1126
1144
  paddingClass: le,
1127
- height: nt,
1128
- bordered: g,
1129
- isFirstRow: f,
1145
+ height: it,
1146
+ bordered: p,
1147
+ isFirstRow: u,
1130
1148
  isLastRow: v,
1131
1149
  isFirstColumn: d,
1132
1150
  isLastColumn: _,
1133
- variantBackground: F,
1134
- isSelected: k,
1135
- showSelectedAccent: k && d
1151
+ variantBackground: A,
1152
+ isSelected: $,
1153
+ showSelectedAccent: $ && d,
1154
+ minWidth: Ye(l)
1136
1155
  },
1137
1156
  l.key
1138
1157
  );
@@ -1149,12 +1168,12 @@ const It = 160, gn = (e, n) => e.length === n.length && e.every((a, h) => a ===
1149
1168
  )
1150
1169
  }
1151
1170
  ),
1152
- xe("bottom")
1171
+ ye("bottom")
1153
1172
  ]
1154
1173
  }
1155
1174
  );
1156
1175
  };
1157
1176
  export {
1158
- fr as default
1177
+ br as default
1159
1178
  };
1160
1179
  //# sourceMappingURL=Table.js.map