@stackone/malachite 2.88.1 → 2.88.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,32 +1,32 @@
1
1
  import { jsx as n, jsxs as y } from "react/jsx-runtime";
2
- import { useVirtualizer as Bt } from "@tanstack/react-virtual";
3
- import Se, { useState as V, useRef as U, useCallback as Be, useId as Ut, useEffect as te, useMemo as ot, useLayoutEffect as bt } from "react";
4
- import xt from "../CustomIcons/CaretDownIcon.js";
2
+ import { useVirtualizer as Ht } from "@tanstack/react-virtual";
3
+ import Se, { useState as V, useRef as H, useCallback as Be, useId as Ut, useEffect as te, useMemo as dt, useLayoutEffect as xt } from "react";
4
+ import mt from "../CustomIcons/CaretDownIcon.js";
5
5
  import Pt from "../CustomIcons/CaretUpIcon.js";
6
6
  import jt from "../CustomIcons/InfoIcon.js";
7
- import Ht from "../CustomIcons/WarningTriangleIcon.js";
8
- import Gt from "../FrameHeader.js";
9
- import Yt from "../PinnedCornerCap.js";
10
- import Jt from "../Tooltip.js";
11
- import qt from "../TruncatedTooltip.js";
12
- import { devWarning as Qt } from "../devWarning.js";
13
- import { FOCUS_RING_INSET as dt, FOCUS_RING_INSET_OVERLAY as Vt } from "../focusRing.js";
14
- import { FRAME_CLASS as Zt, FRAME_PADDING as se, FRAME_SECTION_RADIUS as oe, FRAME_SECTION_BORDER as Xt, FRAME_RADIUS as Kt } from "../frameStyles.js";
15
- import { hasHeaderContent as ct } from "../headerContent.js";
16
- import { isFromInteractiveDescendant as ft, activateOnEnterOrSpace as er } from "../keyboardActivation.js";
17
- import { FOREGROUND_RESET as Ue, SELECTED_ROW_ACCENT as mt, SELECTED_TEXT_CONTEXT as yt, SELECTED_ROW_FOREGROUND as St, SELECTED_ROW_BACKGROUND as He } from "../selectedRow.js";
18
- import ht from "./TablePagination.js";
19
- const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l === r[c]), ut = "\0", rr = (e, r, l) => {
7
+ import Gt from "../CustomIcons/WarningTriangleIcon.js";
8
+ import Yt from "../FrameHeader.js";
9
+ import Jt from "../PinnedCornerCap.js";
10
+ import qt from "../Tooltip.js";
11
+ import Qt from "../TruncatedTooltip.js";
12
+ import { devWarning as Vt } from "../devWarning.js";
13
+ import { FOCUS_RING_INSET as ct, FOCUS_RING_INSET_OVERLAY as Zt } from "../focusRing.js";
14
+ import { FRAME_CLASS as Xt, FRAME_PADDING as se, FRAME_SECTION_RADIUS as oe, FRAME_SECTION_BORDER as Kt, FRAME_RADIUS as er } from "../frameStyles.js";
15
+ import { hasHeaderContent as ft } from "../headerContent.js";
16
+ import { isFromInteractiveDescendant as ht, activateOnEnterOrSpace as tr } from "../keyboardActivation.js";
17
+ import { FOREGROUND_RESET as He, SELECTED_ROW_ACCENT as yt, SELECTED_TEXT_CONTEXT as St, SELECTED_ROW_FOREGROUND as kt, SELECTED_ROW_BACKGROUND as je } from "../selectedRow.js";
18
+ import ut from "./TablePagination.js";
19
+ const wt = 160, rr = (e, r) => e.length === r.length && e.every((l, c) => l === r[c]), pt = "\0", nr = (e, r, l) => {
20
20
  if (typeof e != "object" || e === null)
21
- return `${ut}i${l}`;
21
+ return `${pt}i${l}`;
22
22
  const c = r.ids.get(e);
23
23
  if (c !== void 0)
24
24
  return c;
25
- const C = `${ut}${r.next++}`;
25
+ const C = `${pt}${r.next++}`;
26
26
  return r.ids.set(e, C), C;
27
- }, nr = (e, r, l) => typeof r == "function" ? e.map((c) => r(c)) : e.map((c, C) => {
27
+ }, ir = (e, r, l) => typeof r == "function" ? e.map((c) => r(c)) : e.map((c, C) => {
28
28
  const u = c[r];
29
- return u == null ? rr(c, l, C) : String(u);
29
+ return u == null ? nr(c, l, C) : String(u);
30
30
  }), we = (e) => {
31
31
  if (typeof e == "number")
32
32
  return e;
@@ -38,11 +38,11 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
38
38
  }, Je = (e) => {
39
39
  const r = we(e.width);
40
40
  return !(e.title === "" || e.title == null) && r !== void 0 && typeof e.minWidth == "number" && e.minWidth < r ? e.minWidth : void 0;
41
- }, ir = (e) => e.reduce((r, l) => {
41
+ }, ar = (e) => e.reduce((r, l) => {
42
42
  const c = Je(l) ?? we(l.width);
43
- return c !== void 0 ? r + c : typeof l.minWidth == "number" ? r + l.minWidth : r + kt;
44
- }, 0), ar = (e) => (e.title === "" || e.title == null) && we(e.width) !== void 0, lr = (e) => {
45
- const r = [...e].reverse().findIndex((u) => !ar(u)), l = r === -1 ? 0 : e.length - r, c = /* @__PURE__ */ new Map(), C = e.reduceRight(
43
+ return c !== void 0 ? r + c : typeof l.minWidth == "number" ? r + l.minWidth : r + wt;
44
+ }, 0), lr = (e) => (e.title === "" || e.title == null) && we(e.width) !== void 0, sr = (e) => {
45
+ const r = [...e].reverse().findIndex((u) => !lr(u)), l = r === -1 ? 0 : e.length - r, c = /* @__PURE__ */ new Map(), C = e.reduceRight(
46
46
  (u, S, x) => {
47
47
  const p = Je(S) ?? we(S.width);
48
48
  return !(S.fixed === "right" || x >= l) || p === void 0 ? u : (c.set(S.key, u.right), { right: u.right + p, edge: S.key });
@@ -50,50 +50,53 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
50
50
  { right: 0, edge: void 0 }
51
51
  );
52
52
  return { offsets: c, edgeKey: C.edge, extent: C.right };
53
- }, sr = { overflowX: "auto", scrollbarWidth: "none" }, or = {
53
+ }, or = { overflowX: "auto", scrollbarWidth: "none" }, dr = {
54
54
  position: "sticky",
55
55
  left: 0,
56
56
  width: "100%"
57
- }, dr = { offsets: /* @__PURE__ */ new Map(), edgeKey: void 0, extent: 0 }, Pe = (e) => `color-mix(in srgb, var(--malachite-card-shadow, rgba(0, 0, 0, 0.1)) ${e}%, transparent)`, cr = {
57
+ }, cr = { offsets: /* @__PURE__ */ new Map(), edgeKey: void 0, extent: 0 }, Ue = (e) => `color-mix(in srgb, var(--malachite-card-shadow, rgba(0, 0, 0, 0.1)) ${e}%, transparent)`, fr = {
58
58
  position: "absolute",
59
59
  top: 0,
60
60
  bottom: 0,
61
61
  right: 0,
62
62
  width: 24,
63
63
  pointerEvents: "none",
64
- backgroundImage: `linear-gradient(to left, ${Pe(45)}, ${Pe(18)} 30%, ${Pe(5)} 65%, transparent)`
65
- }, fr = (e, r) => e === void 0 ? {} : {
64
+ backgroundImage: `linear-gradient(to left, ${Ue(45)}, ${Ue(18)} 30%, ${Ue(5)} 65%, transparent)`
65
+ }, hr = (e, r) => e === void 0 ? {} : {
66
66
  position: "sticky",
67
67
  right: e,
68
68
  zIndex: 1,
69
69
  height: "auto",
70
70
  ...r === "row" ? { backgroundColor: "inherit", backgroundImage: "inherit" } : { backgroundColor: r }
71
- }, pt = (e) => `linear-gradient(${e}, ${e})`, hr = (e, r) => {
71
+ }, gt = (e) => `linear-gradient(${e}, ${e})`, ur = (e, r) => {
72
72
  if (!e && !r)
73
73
  return {};
74
74
  const l = [
75
- r ? pt(He) : void 0,
76
- e ? pt(`var(--malachite-table-row-variant-${e}-background)`) : void 0
75
+ r ? gt(je) : void 0,
76
+ e ? gt(`var(--malachite-table-row-variant-${e}-background)`) : void 0
77
77
  ].filter(qe);
78
78
  return {
79
79
  backgroundColor: e ? "var(--malachite-table-background, #f7f7f7)" : "var(--malachite-table-row-background, #fff)",
80
80
  backgroundImage: l.join(", ")
81
81
  };
82
- }, qe = (e) => typeof e == "string", Ge = "text-[var(--malachite-text-primary,#0a0a0a)]", Ye = "text-[var(--malachite-text-dimmed,#a1a1a1)]", de = (e) => ({
82
+ }, qe = (e) => typeof e == "string", pr = {
83
+ default: 40,
84
+ compact: 30
85
+ }, Ge = "text-[var(--malachite-text-primary,#0a0a0a)]", Ye = "text-[var(--malachite-text-dimmed,#a1a1a1)]", de = (e) => ({
83
86
  small: "text-[length:var(--malachite-font-size-small)]",
84
87
  medium: "text-[length:var(--malachite-font-size-medium)]",
85
88
  large: "text-[length:var(--malachite-font-size-large)]"
86
- })[e], gt = {
89
+ })[e], vt = {
87
90
  borderBottom: "1px solid var(--malachite-card-border, #e8e8e8)"
88
- }, vt = (e, r) => {
91
+ }, bt = (e, r) => {
89
92
  e && r && r.scrollLeft !== e.scrollLeft && (r.scrollLeft = e.scrollLeft);
90
- }, ur = 56, pr = 44, gr = 8, vr = 10, br = "--malachite-ctx-table-surround", je = "var(--malachite-table-header-background, #f7f7f7)", xr = () => /* @__PURE__ */ n(
91
- Yt,
93
+ }, gr = 56, vr = 44, br = 8, xr = 10, mr = "--malachite-ctx-table-surround", Pe = "var(--malachite-table-header-background, #f7f7f7)", yr = () => /* @__PURE__ */ n(
94
+ Jt,
92
95
  {
93
- radius: Kt,
94
- surround: `var(${br}, var(--malachite-card-background, #ffffff))`
96
+ radius: er,
97
+ surround: `var(${mr}, var(--malachite-card-background, #ffffff))`
95
98
  }
96
- ), mr = ({
99
+ ), Sr = ({
97
100
  records: e,
98
101
  startIndex: r,
99
102
  scrollElement: l,
@@ -104,23 +107,23 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
104
107
  cardKey: x,
105
108
  rovingIndex: p
106
109
  }) => {
107
- const D = U(null), [M, W] = V(0);
108
- bt(() => {
110
+ const D = H(null), [M, W] = V(0);
111
+ xt(() => {
109
112
  const _ = D.current;
110
113
  if (!_ || !l)
111
114
  return;
112
- const P = () => {
115
+ const U = () => {
113
116
  const R = _.getBoundingClientRect().top - l.getBoundingClientRect().top + l.scrollTop;
114
117
  W((Y) => Math.abs(Y - R) < 1 ? Y : R);
115
118
  };
116
- if (P(), typeof ResizeObserver > "u")
119
+ if (U(), typeof ResizeObserver > "u")
117
120
  return;
118
- const j = new ResizeObserver(P);
121
+ const P = new ResizeObserver(U);
119
122
  let T = _;
120
123
  for (; T && T !== l; ) {
121
124
  let R = T.previousElementSibling;
122
125
  for (; R; )
123
- j.observe(R), R = R.previousElementSibling;
126
+ P.observe(R), R = R.previousElementSibling;
124
127
  const Y = T.parentElement;
125
128
  if (Y)
126
129
  T = Y;
@@ -129,15 +132,15 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
129
132
  T = ie instanceof ShadowRoot ? ie.host : null;
130
133
  }
131
134
  }
132
- return () => j.disconnect();
135
+ return () => P.disconnect();
133
136
  }, [l, e.length, r]);
134
- const E = Bt({
137
+ const E = Ht({
135
138
  count: e.length,
136
139
  // State, not a ref: an ancestor's ref is not attached when this child's layout effects
137
140
  // run, so a ref would leave the virtualizer without a scroll element.
138
141
  getScrollElement: () => l,
139
142
  estimateSize: () => c,
140
- overscan: gr,
143
+ overscan: br,
141
144
  scrollMargin: M
142
145
  });
143
146
  te(() => {
@@ -148,13 +151,13 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
148
151
  scrollToIndex: (_) => E.scrollToIndex(_, { align: "center" })
149
152
  }), () => S(x, null);
150
153
  }, [S, x, r, e.length, E]);
151
- const $ = E.getVirtualItems(), re = E.getTotalSize(), ne = p >= r && p < r + e.length && $.length > 0 ? Math.min(
152
- Math.max(p, r + $[0].index),
153
- r + $[$.length - 1].index
154
- ) : p, X = $.length > 0 ? $[0].start - M : 0, K = $.length > 0 ? re - ($[$.length - 1].end - M) : 0;
154
+ const k = E.getVirtualItems(), re = E.getTotalSize(), ne = p >= r && p < r + e.length && k.length > 0 ? Math.min(
155
+ Math.max(p, r + k[0].index),
156
+ r + k[k.length - 1].index
157
+ ) : p, X = k.length > 0 ? k[0].start - M : 0, K = k.length > 0 ? re - (k[k.length - 1].end - M) : 0;
155
158
  return /* @__PURE__ */ y("div", { ref: D, className: "flex flex-col w-full", style: C, children: [
156
159
  X > 0 && /* @__PURE__ */ n("div", { "aria-hidden": "true", style: { height: X, flexShrink: 0 } }),
157
- $.map(
160
+ k.map(
158
161
  (_) => u(
159
162
  e[_.index],
160
163
  r + _.index,
@@ -166,8 +169,8 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
166
169
  ),
167
170
  K > 0 && /* @__PURE__ */ n("div", { "aria-hidden": "true", style: { height: K, flexShrink: 0 } })
168
171
  ] });
169
- }, yr = (e, r) => {
170
- const l = r ? ur : 0;
172
+ }, kr = (e, r) => {
173
+ const l = r ? gr : 0;
171
174
  return typeof e == "number" ? `${Math.max(0, e - l)}px` : `calc(${e} - ${l}px)`;
172
175
  }, ce = (e) => {
173
176
  const r = e.width;
@@ -181,14 +184,14 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
181
184
  return {};
182
185
  const l = typeof r == "number" ? `${r}px` : r;
183
186
  return { width: l, flexBasis: l };
184
- }, Sr = (e) => e === "asc" ? "ascending" : e === "desc" ? "descending" : "none", Z = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-start", kr = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-between", fe = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", wt = (e) => e ? Z(e) : "justify-end", ke = ({ info: e }) => /* @__PURE__ */ n(Jt, { text: e, placement: "top", children: /* @__PURE__ */ n(jt, { size: 13, className: "shrink-0 text-[var(--malachite-text-secondary,#bbb)]" }) }), wr = { ascend: "asc", descend: "desc" }, $r = (e) => {
187
+ }, wr = (e) => e === "asc" ? "ascending" : e === "desc" ? "descending" : "none", Z = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-start", $r = (e) => e === "center" ? "justify-center" : e === "right" ? "justify-end" : "justify-between", fe = (e) => e === "center" ? "text-center" : e === "right" ? "text-right" : "text-left", $t = (e) => e ? Z(e) : "justify-end", ke = ({ info: e }) => /* @__PURE__ */ n(qt, { text: e, placement: "top", children: /* @__PURE__ */ n(jt, { size: 13, className: "shrink-0 text-[var(--malachite-text-secondary,#bbb)]" }) }), Nr = { ascend: "asc", descend: "desc" }, Cr = (e) => {
185
188
  const r = e.find((l) => l.sorter && l.defaultSortOrder);
186
- return r != null && r.defaultSortOrder ? { key: r.key, direction: wr[r.defaultSortOrder] } : null;
187
- }, $t = (e, r) => ({
189
+ return r != null && r.defaultSortOrder ? { key: r.key, direction: Nr[r.defaultSortOrder] } : null;
190
+ }, Nt = (e, r) => ({
188
191
  type: "button",
189
192
  onClick: r,
190
193
  "aria-label": typeof e == "string" ? `Sort by ${e}` : "Sort column"
191
- }), Nr = ({
194
+ }), Er = ({
192
195
  column: e,
193
196
  record: r,
194
197
  index: l,
@@ -203,7 +206,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
203
206
  showSelectedAccent: W,
204
207
  isSelected: E
205
208
  }) => {
206
- const $ = r[e.dataIndex], re = e.render ? e.render($, r, l) : $ == null ? "" : String($), G = e.ellipsis && qe($) ? $ : void 0;
209
+ const k = r[e.dataIndex], re = e.render ? e.render(k, r, l) : k == null ? "" : String(k), G = e.ellipsis && qe(k) ? k : void 0;
207
210
  return /* @__PURE__ */ n(
208
211
  "td",
209
212
  {
@@ -226,19 +229,19 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
226
229
  // base — they differ in dark mode.
227
230
  (E ? u ? "var(--malachite-table-borderedRow-background, #fff)" : "var(--malachite-table-row-background, #fff)" : void 0),
228
231
  // Its own layer, so the tint composites over the cell instead of replacing it.
229
- backgroundImage: E ? `linear-gradient(${He}, ${He})` : void 0,
232
+ backgroundImage: E ? `linear-gradient(${je}, ${je})` : void 0,
230
233
  // Content pinning its own colour follows via the channel below.
231
- color: E ? St : "var(--malachite-table-row-foreground)",
232
- ...E ? yt : {},
234
+ color: E ? kt : "var(--malachite-table-row-foreground)",
235
+ ...E ? St : {},
233
236
  // Inset box-shadow, not `ring-*`: --tw-ring-* silently doesn't paint in a shadow root.
234
- boxShadow: W ? `inset 2px 0 0 ${mt}` : void 0,
237
+ boxShadow: W ? `inset 2px 0 0 ${yt}` : void 0,
235
238
  borderBottom: u ? void 0 : x ? "none" : "1px solid var(--malachite-table-row-border)"
236
239
  },
237
240
  title: G,
238
241
  children: re
239
242
  }
240
243
  );
241
- }, Cr = ({
244
+ }, Rr = ({
242
245
  column: e,
243
246
  sortDirection: r,
244
247
  onSort: l,
@@ -268,7 +271,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
268
271
  }
269
272
  );
270
273
  const x = typeof e.title == "string" ? /* @__PURE__ */ n("p", { className: "font-medium text-[13px] text-[var(--malachite-text-primary,#0a0a0a)] tracking-[0.13px] whitespace-nowrap truncate", children: e.title }) : e.title, p = /* @__PURE__ */ n(
271
- xt,
274
+ mt,
272
275
  {
273
276
  size: 13,
274
277
  className: `shrink-0 transition-transform ${r ? Ge : Ye} ${r === "asc" ? "rotate-180" : ""}`
@@ -282,8 +285,8 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
282
285
  children: /* @__PURE__ */ y(
283
286
  "button",
284
287
  {
285
- ...$t(e.title, l),
286
- className: `flex flex-1 items-center ${kr(e.align)} gap-1 min-w-0 px-4 py-3 cursor-pointer appearance-none bg-transparent border-0 ${fe(e.align)}`,
288
+ ...Nt(e.title, l),
289
+ className: `flex flex-1 items-center ${$r(e.align)} gap-1 min-w-0 px-4 py-3 cursor-pointer appearance-none bg-transparent border-0 ${fe(e.align)}`,
287
290
  children: [
288
291
  /* @__PURE__ */ y("div", { className: "flex items-center gap-1 min-w-0", children: [
289
292
  x,
@@ -308,7 +311,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
308
311
  ] })
309
312
  }
310
313
  );
311
- }, Er = ({
314
+ }, _r = ({
312
315
  column: e,
313
316
  record: r,
314
317
  index: l,
@@ -318,14 +321,14 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
318
321
  cellStyle: S
319
322
  }) => {
320
323
  const x = r[e.dataIndex], p = e.render ? e.render(x, r, l) : x == null ? "" : String(x), M = (e.title === "" || e.title == null) && e.width !== void 0, W = qe(x) && x.length > 0, E = u ? {
321
- color: St,
322
- ...yt
324
+ color: kt,
325
+ ...St
323
326
  } : {};
324
327
  if (M)
325
328
  return /* @__PURE__ */ n(
326
329
  "div",
327
330
  {
328
- className: `flex items-center ${wt(e.align)} shrink-0 overflow-hidden px-4 ${C}`,
331
+ className: `flex items-center ${$t(e.align)} shrink-0 overflow-hidden px-4 ${C}`,
329
332
  style: {
330
333
  ...Qe(e),
331
334
  ...E,
@@ -334,7 +337,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
334
337
  children: p
335
338
  }
336
339
  );
337
- const $ = !e.render && W ? /* @__PURE__ */ n(qt, { text: x, children: p }) : p;
340
+ const k = !e.render && W ? /* @__PURE__ */ n(Qt, { text: x, children: p }) : p;
338
341
  return /* @__PURE__ */ n(
339
342
  "div",
340
343
  {
@@ -344,10 +347,10 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
344
347
  ...E,
345
348
  ...S
346
349
  },
347
- children: $
350
+ children: k
348
351
  }
349
352
  );
350
- }, Yr = ({
353
+ }, qr = ({
351
354
  columns: e,
352
355
  data: r,
353
356
  loading: l = !1,
@@ -361,15 +364,15 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
361
364
  rowKey: M = "key",
362
365
  scrollHeight: W,
363
366
  size: E = "small",
364
- rowDensity: $ = "default",
367
+ rowDensity: k = "default",
365
368
  layout: re = "auto",
366
369
  headerVariant: G = "inline",
367
370
  title: ne,
368
371
  subtitle: X,
369
372
  extra: K,
370
373
  rowClassName: _,
371
- rowVariant: P,
372
- onRow: j,
374
+ rowVariant: U,
375
+ onRow: P,
373
376
  onClickRow: T,
374
377
  selectedRowKey: R,
375
378
  scrollSelectedIntoView: Y = !0,
@@ -378,54 +381,54 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
378
381
  className: Ve = "",
379
382
  style: $e,
380
383
  stickyHeaderTop: Ne,
381
- scrollX: H = !1,
384
+ scrollX: j = !1,
382
385
  rowSection: Ce,
383
386
  renderSectionDivider: Ee,
384
387
  onVisibleOrderChange: Re,
385
- virtual: Nt = !1,
386
- virtualRowHeightEstimate: Ct,
388
+ virtual: Ct = !1,
389
+ virtualRowHeightEstimate: Et,
387
390
  virtualScrollElement: he = null
388
391
  }) => {
389
- const ae = $ === "compact" ? "py-1.5" : "py-3", [O, Et] = V(() => $r(e)), Ze = U(null), _e = U(null), le = U(null), Ie = U(null), Oe = U(/* @__PURE__ */ new Map()), Rt = Be(
392
+ const ae = k === "compact" ? "py-1" : "py-3", Ze = pr[k], [O, Rt] = V(() => Cr(e)), Xe = H(null), _e = H(null), le = H(null), Ie = H(null), Oe = H(/* @__PURE__ */ new Map()), _t = Be(
390
393
  (t, i) => {
391
394
  i ? Oe.current.set(t, i) : Oe.current.delete(t);
392
395
  },
393
396
  []
394
- ), q = Ut(), [_t, Te] = V(0), J = Nt && G === "detached", It = Ct ?? pr, [ue, Ot] = V(null), Tt = Be((t) => {
395
- le.current = t, t && Ot((i) => i === t ? i : t);
396
- }, []), De = J ? he ?? ue : null, Xe = H ? ir(e) : 0, pe = H && G === "detached" ? lr(e) : dr, ge = pe.edgeKey !== void 0, [Dt, Ke] = V(!1), [Mt, et] = V(0), ve = Be(() => {
397
+ ), q = Ut(), [It, Te] = V(0), J = Ct && G === "detached", Ot = Et ?? vr, [ue, Tt] = V(null), Dt = Be((t) => {
398
+ le.current = t, t && Tt((i) => i === t ? i : t);
399
+ }, []), De = J ? he ?? ue : null, Ke = j ? ar(e) : 0, pe = j && G === "detached" ? sr(e) : cr, ge = pe.edgeKey !== void 0, [Mt, et] = V(!1), [zt, tt] = V(0), ve = Be(() => {
397
400
  const t = le.current;
398
- Ke(
401
+ et(
399
402
  t !== null && t.scrollLeft + t.clientWidth < t.scrollWidth - 1
400
- ), et(t === null ? 0 : t.offsetWidth - t.clientWidth);
403
+ ), tt(t === null ? 0 : t.offsetWidth - t.clientWidth);
401
404
  }, []);
402
405
  te(() => {
403
406
  if (!ge || !ue) {
404
- Ke(!1), et(0);
407
+ et(!1), tt(0);
405
408
  return;
406
409
  }
407
410
  if (ve(), typeof ResizeObserver > "u")
408
411
  return;
409
412
  const t = new ResizeObserver(ve);
410
413
  return t.observe(ue), () => t.disconnect();
411
- }, [ge, ue, Xe, ve]);
412
- const Me = !(J && he), A = G === "detached" && Ne !== void 0 && D && !W && (!J || !Me), tt = R != null, [ze, rt] = V(0);
414
+ }, [ge, ue, Ke, ve]);
415
+ const Me = !(J && he), A = G === "detached" && Ne !== void 0 && D && !W && (!J || !Me), rt = R != null, [ze, nt] = V(0);
413
416
  te(() => {
414
- const t = Ze.current;
415
- if (!t || !A || !tt || typeof ResizeObserver > "u") {
416
- rt(0);
417
+ const t = Xe.current;
418
+ if (!t || !A || !rt || typeof ResizeObserver > "u") {
419
+ nt(0);
417
420
  return;
418
421
  }
419
422
  const i = new ResizeObserver((f) => {
420
423
  var h, v;
421
424
  const s = f[0], g = ((v = (h = s == null ? void 0 : s.borderBoxSize) == null ? void 0 : h[0]) == null ? void 0 : v.blockSize) ?? (s == null ? void 0 : s.contentRect.height) ?? 0;
422
- rt(
423
- (k) => Math.abs(k - g) < 1 ? k : g
425
+ nt(
426
+ (w) => Math.abs(w - g) < 1 ? w : g
424
427
  );
425
428
  });
426
429
  return i.observe(t), () => i.disconnect();
427
- }, [A, tt]);
428
- const zt = A ? (Ne ?? 0) + ze : void 0, { sortedData: z, sectionDividers: Le } = ot(() => {
430
+ }, [A, rt]);
431
+ const Lt = A ? (Ne ?? 0) + ze : void 0, { sortedData: z, sectionDividers: Le } = dt(() => {
429
432
  const t = (h) => {
430
433
  if (!O) return h;
431
434
  const v = e.find((F) => F.key === O.key);
@@ -434,9 +437,9 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
434
437
  const F = [...h].sort(v.sorter);
435
438
  return O.direction === "asc" ? F : F.reverse();
436
439
  }
437
- const k = v.dataIndex ?? O.key;
440
+ const w = v.dataIndex ?? O.key;
438
441
  return [...h].sort((F, o) => {
439
- const a = F[k], d = o[k];
442
+ const a = F[w], d = o[w];
440
443
  return a < d ? O.direction === "asc" ? -1 : 1 : a > d ? O.direction === "asc" ? 1 : -1 : 0;
441
444
  });
442
445
  };
@@ -448,8 +451,8 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
448
451
  const i = [], f = /* @__PURE__ */ new Map();
449
452
  for (const h of r) {
450
453
  const v = Ce(h);
451
- let k = f.get(v);
452
- k === void 0 && (k = i.length, f.set(v, k), i.push({ key: v, records: [] })), i[k].records.push(h);
454
+ let w = f.get(v);
455
+ w === void 0 && (w = i.length, f.set(v, w), i.push({ key: v, records: [] })), i[w].records.push(h);
453
456
  }
454
457
  const s = [], g = /* @__PURE__ */ new Map();
455
458
  for (const h of i) {
@@ -457,29 +460,29 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
457
460
  g.set(s.length, { key: h.key, records: v }), s.push(...v);
458
461
  }
459
462
  return { sortedData: s, sectionDividers: g };
460
- }, [r, O, e, Ce]), Lt = (t) => {
461
- Et((i) => (i == null ? void 0 : i.key) === t ? i.direction === "asc" ? { key: t, direction: "desc" } : null : { key: t, direction: "asc" });
462
- }, nt = (t, i) => (f) => {
463
+ }, [r, O, e, Ce]), Wt = (t) => {
464
+ Rt((i) => (i == null ? void 0 : i.key) === t ? i.direction === "asc" ? { key: t, direction: "desc" } : null : { key: t, direction: "asc" });
465
+ }, it = (t, i) => (f) => {
463
466
  var s, g, h;
464
- Lt(t.key), (h = (g = (s = t.onHeaderCell) == null ? void 0 : s.call(t, t, i)) == null ? void 0 : g.onClick) == null || h.call(g, f);
465
- }, We = (t, i) => typeof M == "function" ? M(t) : String(t[M] ?? i), it = typeof M == "function" ? null : M, at = U(void 0), be = U(void 0);
467
+ Wt(t.key), (h = (g = (s = t.onHeaderCell) == null ? void 0 : s.call(t, t, i)) == null ? void 0 : g.onClick) == null || h.call(g, f);
468
+ }, We = (t, i) => typeof M == "function" ? M(t) : String(t[M] ?? i), at = typeof M == "function" ? null : M, lt = H(void 0), be = H(void 0);
466
469
  te(() => {
467
470
  if (!Re)
468
471
  return;
469
472
  be.current ?? (be.current = { ids: /* @__PURE__ */ new WeakMap(), next: 0 });
470
- const t = nr(z, M, be.current), i = at.current;
471
- i && tr(i, t) || (at.current = t, Re(z));
472
- }, [z, it, Re]);
473
- const ee = Math.min(_t, Math.max(0, z.length - 1)), L = ot(() => {
473
+ const t = ir(z, M, be.current), i = lt.current;
474
+ i && rr(i, t) || (lt.current = t, Re(z));
475
+ }, [z, at, Re]);
476
+ const ee = Math.min(It, Math.max(0, z.length - 1)), L = dt(() => {
474
477
  if (R == null)
475
478
  return -1;
476
479
  const t = String(R);
477
480
  return z.findIndex((i, f) => We(i, f) === t);
478
- }, [R, z, it]);
481
+ }, [R, z, at]);
479
482
  te(() => {
480
483
  L >= 0 && Te(L);
481
484
  }, [L]);
482
- const Fe = U(void 0);
485
+ const Fe = H(void 0);
483
486
  te(() => {
484
487
  if (R == null) {
485
488
  Fe.current = void 0;
@@ -511,16 +514,16 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
511
514
  if (!v)
512
515
  return;
513
516
  v.scrollToIndex(L - v.startIndex);
514
- let k = 0, F = 0;
517
+ let w = 0, F = 0;
515
518
  const o = () => {
516
519
  const a = s(L);
517
520
  if (a) {
518
521
  g(a);
519
522
  return;
520
523
  }
521
- ++F < vr && (k = requestAnimationFrame(o));
524
+ ++F < xr && (w = requestAnimationFrame(o));
522
525
  };
523
- return k = requestAnimationFrame(o), () => cancelAnimationFrame(k);
526
+ return w = requestAnimationFrame(o), () => cancelAnimationFrame(w);
524
527
  }, [
525
528
  R,
526
529
  L,
@@ -534,10 +537,10 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
534
537
  q,
535
538
  Y
536
539
  ]);
537
- const Ae = U(null), lt = (t, i) => {
540
+ const Ae = H(null), st = (t, i) => {
538
541
  Ae.current = t, Te(Math.min(Math.max(0, i), z.length - 1));
539
542
  };
540
- bt(() => {
543
+ xt(() => {
541
544
  const t = Ae.current;
542
545
  if (!t)
543
546
  return;
@@ -554,26 +557,26 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
554
557
  ), h = ee > 0 ? g[g.length - 1] : g[0];
555
558
  h && (Te(Number(h.dataset.rowIndex)), h.focus());
556
559
  }, [ee, q]);
557
- const st = (t, i) => (f) => {
560
+ const ot = (t, i) => (f) => {
558
561
  const s = { ArrowDown: 1, ArrowUp: -1 }[f.key];
559
562
  if (s !== void 0) {
560
- f.preventDefault(), lt(f.currentTarget, t + s);
563
+ f.preventDefault(), st(f.currentTarget, t + s);
561
564
  return;
562
565
  }
563
566
  if (!J && (f.key === "Home" || f.key === "End")) {
564
- f.preventDefault(), lt(f.currentTarget, f.key === "Home" ? 0 : z.length - 1);
567
+ f.preventDefault(), st(f.currentTarget, f.key === "Home" ? 0 : z.length - 1);
565
568
  return;
566
569
  }
567
- i && er(f, i, "enter");
570
+ i && tr(f, i, "enter");
568
571
  };
569
- if (G !== "detached" && ct({ title: ne, subtitle: X, extra: K }) && Qt(
572
+ if (G !== "detached" && ft({ title: ne, subtitle: X, extra: K }) && Vt(
570
573
  "table-title-inline",
571
574
  'Table `title`, `subtitle` and `extra` draw only on the detached header. Pass `headerVariant="detached"` or leave them out.'
572
575
  ), G === "detached") {
573
- const t = H ? { minWidth: Xe } : {}, i = (o, a) => ({
574
- ...H && o.width === void 0 ? { minWidth: o.minWidth ?? kt } : {},
575
- ...fr(pe.offsets.get(o.key), a)
576
- }), f = (o) => o.key === pe.edgeKey && Dt ? /* @__PURE__ */ n(
576
+ const t = j ? { minWidth: Ke } : {}, i = (o, a) => ({
577
+ ...j && o.width === void 0 ? { minWidth: o.minWidth ?? wt } : {},
578
+ ...hr(pe.offsets.get(o.key), a)
579
+ }), f = (o) => o.key === pe.edgeKey && Mt ? /* @__PURE__ */ n(
577
580
  "span",
578
581
  {
579
582
  "aria-hidden": "true",
@@ -583,19 +586,19 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
583
586
  right: pe.extent,
584
587
  zIndex: 1
585
588
  },
586
- children: /* @__PURE__ */ n("span", { style: cr })
589
+ children: /* @__PURE__ */ n("span", { style: fr })
587
590
  }
588
- ) : null, s = ct({ title: ne, subtitle: X, extra: K }) ? /* @__PURE__ */ n(Gt, { title: ne, subtitle: X, extra: K }) : null, g = A ? je : "var(--malachite-table-background, #f7f7f7)", h = {
589
- border: Xt,
591
+ ) : null, s = ft({ title: ne, subtitle: X, extra: K }) ? /* @__PURE__ */ n(Yt, { title: ne, subtitle: X, extra: K }) : null, g = A ? Pe : "var(--malachite-table-background, #f7f7f7)", h = {
592
+ border: Kt,
590
593
  borderRadius: oe,
591
594
  overflow: "clip",
592
595
  flexShrink: 0,
593
596
  ...t
594
597
  }, v = (o, a, d = !1, I = !1, N, B = ee) => {
595
- const Q = We(o, a), m = (j == null ? void 0 : j(o, a)) || {}, Ft = P == null ? void 0 : P(o, a), xe = a === L, me = T || m.onClick ? () => {
596
- var w;
597
- T == null || T(o, a), (w = m.onClick) == null || w.call(m, o, a);
598
- } : void 0, ye = !!me, At = d ? {} : gt;
598
+ const Q = We(o, a), m = (P == null ? void 0 : P(o, a)) || {}, At = U == null ? void 0 : U(o, a), xe = a === L, me = T || m.onClick ? () => {
599
+ var $;
600
+ T == null || T(o, a), ($ = m.onClick) == null || $.call(m, o, a);
601
+ } : void 0, ye = !!me, Bt = d ? {} : vt;
599
602
  return /* @__PURE__ */ y(
600
603
  "div",
601
604
  {
@@ -605,16 +608,17 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
605
608
  "data-row-index": a,
606
609
  "aria-current": xe ? "true" : void 0,
607
610
  tabIndex: ye ? a === B ? 0 : -1 : void 0,
608
- onKeyDown: ye ? st(a, me) : void 0,
611
+ onKeyDown: ye ? ot(a, me) : void 0,
609
612
  className: `
610
- group bg-[var(--malachite-table-row-background,#fff)] flex min-h-10 items-stretch relative w-full
611
- ${ye ? `cursor-pointer hover:bg-[var(--malachite-table-row-hover-background,#fafafa)] ${dt}` : ""}
613
+ group bg-[var(--malachite-table-row-background,#fff)] flex items-stretch relative w-full
614
+ ${ye ? `cursor-pointer hover:bg-[var(--malachite-table-row-hover-background,#fafafa)] ${ct}` : ""}
612
615
  ${(_ == null ? void 0 : _(o, a)) || ""}
613
616
  `,
614
617
  style: {
615
- ...At,
618
+ ...Bt,
616
619
  ...t,
617
- scrollMarginTop: zt,
620
+ minHeight: Ze,
621
+ scrollMarginTop: Lt,
618
622
  // Echo the card's clip, or it cuts the accent bar's end into a stub.
619
623
  ...I ? {
620
624
  borderTopLeftRadius: oe,
@@ -625,62 +629,66 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
625
629
  borderBottomRightRadius: oe
626
630
  } : {},
627
631
  // Set unconditionally it would beat `hover:bg-*` on every row.
628
- ...hr(Ft, xe),
632
+ ...ur(At, xe),
629
633
  ...xe ? {
630
634
  // Inset box-shadow, not `ring-*` — see the classic cell.
631
- boxShadow: `inset 2px 0 0 ${mt}`
635
+ boxShadow: `inset 2px 0 0 ${yt}`
632
636
  } : {}
633
637
  },
634
- onClick: me ? (w) => {
635
- ft(w) || me();
638
+ onClick: me ? ($) => {
639
+ ht($) || me();
636
640
  } : void 0,
637
641
  onDoubleClick: m.onDoubleClick ? () => {
638
- var w;
639
- return (w = m.onDoubleClick) == null ? void 0 : w.call(m, o, a);
642
+ var $;
643
+ return ($ = m.onDoubleClick) == null ? void 0 : $.call(m, o, a);
640
644
  } : void 0,
641
645
  onContextMenu: m.onContextMenu ? () => {
642
- var w;
643
- return (w = m.onContextMenu) == null ? void 0 : w.call(m, o, a);
646
+ var $;
647
+ return ($ = m.onContextMenu) == null ? void 0 : $.call(m, o, a);
644
648
  } : void 0,
645
649
  onMouseEnter: m.onMouseEnter ? () => {
646
- var w;
647
- return (w = m.onMouseEnter) == null ? void 0 : w.call(m, o, a);
650
+ var $;
651
+ return ($ = m.onMouseEnter) == null ? void 0 : $.call(m, o, a);
648
652
  } : void 0,
649
653
  onMouseLeave: m.onMouseLeave ? () => {
650
- var w;
651
- return (w = m.onMouseLeave) == null ? void 0 : w.call(m, o, a);
654
+ var $;
655
+ return ($ = m.onMouseLeave) == null ? void 0 : $.call(m, o, a);
652
656
  } : void 0,
653
657
  children: [
654
- e.map((w) => /* @__PURE__ */ y(Se.Fragment, { children: [
655
- f(w),
658
+ e.map(($) => /* @__PURE__ */ y(Se.Fragment, { children: [
659
+ f($),
656
660
  /* @__PURE__ */ n(
657
- Er,
661
+ _r,
658
662
  {
659
- column: w,
663
+ column: $,
660
664
  record: o,
661
665
  paddingYClass: ae,
662
666
  index: a,
663
667
  size: E,
664
668
  isSelected: xe,
665
- cellStyle: i(w, "row")
669
+ cellStyle: i($, "row")
666
670
  }
667
671
  )
668
- ] }, w.key)),
669
- ye && ge ? /* @__PURE__ */ n("span", { "aria-hidden": "true", className: Vt }) : null
672
+ ] }, $.key)),
673
+ ye && ge ? /* @__PURE__ */ n("span", { "aria-hidden": "true", className: Zt }) : null
670
674
  ]
671
675
  },
672
676
  Q
673
677
  );
674
- }, k = (o, a = !1) => /* @__PURE__ */ n(
678
+ }, w = (o, a = !1) => /* @__PURE__ */ n(
675
679
  "div",
676
680
  {
677
- className: "bg-[var(--malachite-table-row-background,#fff)] flex min-h-10 items-stretch w-full",
678
- style: { ...a ? {} : gt, ...t },
681
+ className: "bg-[var(--malachite-table-row-background,#fff)] flex items-stretch w-full",
682
+ style: {
683
+ ...a ? {} : vt,
684
+ ...t,
685
+ minHeight: Ze
686
+ },
679
687
  children: e.map((d) => {
680
688
  const B = (d.title === "" || d.title == null) && d.width !== void 0 ? /* @__PURE__ */ n(
681
689
  "div",
682
690
  {
683
- className: `flex items-center ${wt(d.align)} shrink-0 overflow-clip px-4 ${ae}`,
691
+ className: `flex items-center ${$t(d.align)} shrink-0 overflow-clip px-4 ${ae}`,
684
692
  style: {
685
693
  ...Qe(d),
686
694
  ...i(d, "row")
@@ -708,11 +716,11 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
708
716
  ), F = D ? /* @__PURE__ */ n("div", { className: "flex min-h-10 items-stretch w-full", style: t, children: e.map((o, a) => /* @__PURE__ */ y(Se.Fragment, { children: [
709
717
  f(o),
710
718
  /* @__PURE__ */ n(
711
- Cr,
719
+ Rr,
712
720
  {
713
721
  column: o,
714
722
  sortDirection: (O == null ? void 0 : O.key) === o.key ? O.direction : null,
715
- onSort: o.sorter ? nt(o, a) : void 0,
723
+ onSort: o.sorter ? it(o, a) : void 0,
716
724
  cellStyle: i(o, g)
717
725
  }
718
726
  )
@@ -722,18 +730,18 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
722
730
  {
723
731
  ref: Ie,
724
732
  className: `w-full ${Ve}`,
725
- style: { ...Ue, ...$e },
733
+ style: { ...He, ...$e },
726
734
  children: [
727
735
  /* @__PURE__ */ y(
728
736
  "div",
729
737
  {
730
- className: `${Zt} flex flex-col items-start ${A ? "" : "overflow-clip"} relative w-full`,
738
+ className: `${Xt} flex flex-col items-start ${A ? "" : "overflow-clip"} relative w-full`,
731
739
  children: [
732
740
  !D && s,
733
741
  D && /* @__PURE__ */ y(
734
742
  "div",
735
743
  {
736
- ref: Ze,
744
+ ref: Xe,
737
745
  style: {
738
746
  ...A ? {
739
747
  position: "sticky",
@@ -742,7 +750,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
742
750
  // A title row sits on the frame, as a framed Card's
743
751
  // does; the header colour goes behind the column
744
752
  // headers alone.
745
- backgroundColor: s ? "var(--malachite-table-background, #f7f7f7)" : je,
753
+ backgroundColor: s ? "var(--malachite-table-background, #f7f7f7)" : Pe,
746
754
  marginInline: -se,
747
755
  width: `calc(100% + ${se * 2}px)`,
748
756
  paddingInline: se,
@@ -753,22 +761,22 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
753
761
  } : { width: "100%" }
754
762
  },
755
763
  children: [
756
- A && /* @__PURE__ */ n(xr, {}),
764
+ A && /* @__PURE__ */ n(yr, {}),
757
765
  s,
758
766
  /* @__PURE__ */ n(
759
767
  "div",
760
768
  {
761
769
  ref: _e,
762
- onScroll: H ? () => vt(
770
+ onScroll: j ? () => bt(
763
771
  _e.current,
764
772
  le.current
765
773
  ) : void 0,
766
774
  style: {
767
- ...H ? {
768
- ...sr,
769
- paddingRight: Mt
775
+ ...j ? {
776
+ ...or,
777
+ paddingRight: zt
770
778
  } : {},
771
- ...A && s ? { backgroundColor: je } : {}
779
+ ...A && s ? { backgroundColor: Pe } : {}
772
780
  },
773
781
  children: F
774
782
  }
@@ -779,11 +787,11 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
779
787
  /* @__PURE__ */ n(
780
788
  "div",
781
789
  {
782
- ref: Tt,
783
- onScroll: H ? () => {
784
- vt(le.current, _e.current), ge && ve();
790
+ ref: Dt,
791
+ onScroll: j ? () => {
792
+ bt(le.current, _e.current), ge && ve();
785
793
  } : void 0,
786
- className: `flex flex-col items-start ${H ? "overflow-x-auto" : "overflow-x-clip"} ${Me ? "overflow-y-auto" : "overflow-y-visible"} w-full`,
794
+ className: `flex flex-col items-start ${j ? "overflow-x-auto" : "overflow-x-clip"} ${Me ? "overflow-y-auto" : "overflow-y-visible"} w-full`,
787
795
  style: {
788
796
  // Firefox + modern Chromium only; older Webkit keeps its default.
789
797
  scrollbarWidth: "thin",
@@ -791,7 +799,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
791
799
  // With an external virtual scroller the body is overflow-visible and
792
800
  // a bounded box would overlap content below it.
793
801
  ...W && Me ? {
794
- maxHeight: yr(
802
+ maxHeight: kr(
795
803
  W,
796
804
  !!b
797
805
  )
@@ -803,23 +811,23 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
803
811
  ] }) }) : l ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: h, children: (() => {
804
812
  const o = b != null && b.pageSize ? Math.min(b.pageSize, 10) : 5;
805
813
  return Array.from({ length: o }).map(
806
- (a, d) => k(d, d === o - 1)
814
+ (a, d) => w(d, d === o - 1)
807
815
  );
808
816
  })() }) : z.length === 0 ? /* @__PURE__ */ n("div", { className: "flex flex-col w-full", style: h, children: /* @__PURE__ */ y("div", { className: "flex flex-col items-center justify-center bg-[var(--malachite-table-row-background,#fff)] w-full py-12", children: [
809
817
  /* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[14px] font-medium", children: S }),
810
818
  x && /* @__PURE__ */ n("div", { className: "text-[var(--malachite-text-secondary)] text-[13px] mt-1", children: x })
811
819
  ] }) }) : (() => {
812
820
  const o = (d, I, N) => J ? /* @__PURE__ */ n(
813
- mr,
821
+ Sr,
814
822
  {
815
823
  cardKey: N,
816
824
  records: d,
817
825
  startIndex: I,
818
826
  scrollElement: De,
819
- estimateRowHeight: It,
827
+ estimateRowHeight: Ot,
820
828
  style: h,
821
829
  renderRow: v,
822
- registerHandle: Rt,
830
+ registerHandle: _t,
823
831
  rovingIndex: ee
824
832
  },
825
833
  `section-card-${N}`
@@ -855,7 +863,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
855
863
  "div",
856
864
  {
857
865
  className: "table-section-divider",
858
- style: H ? or : void 0,
866
+ style: j ? dr : void 0,
859
867
  children: m
860
868
  }
861
869
  ) : null,
@@ -869,7 +877,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
869
877
  }
870
878
  ),
871
879
  b && !l && /* @__PURE__ */ n(
872
- ht,
880
+ ut,
873
881
  {
874
882
  current: b.current ?? 1,
875
883
  pageSize: b.pageSize ?? 10,
@@ -886,7 +894,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
886
894
  }
887
895
  );
888
896
  }
889
- const Wt = (t, i) => {
897
+ const Ft = (t, i) => {
890
898
  const f = t.sorter, g = (O == null ? void 0 : O.key) === t.key ? O == null ? void 0 : O.direction : null, h = /* @__PURE__ */ y("div", { className: `flex items-center gap-2 ${Z(t.align)}`, children: [
891
899
  /* @__PURE__ */ n("span", { children: t.title }),
892
900
  t.info && /* @__PURE__ */ n(ke, { info: t.info }),
@@ -899,7 +907,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
899
907
  }
900
908
  ),
901
909
  /* @__PURE__ */ n(
902
- xt,
910
+ mt,
903
911
  {
904
912
  size: 12,
905
913
  className: `-mt-1 ${g === "desc" ? Ge : Ye}`
@@ -916,11 +924,11 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
916
924
  ${fe(t.align)}
917
925
  `,
918
926
  style: { width: t.width },
919
- "aria-sort": f ? Sr(g) : void 0,
927
+ "aria-sort": f ? wr(g) : void 0,
920
928
  children: f ? /* @__PURE__ */ n(
921
929
  "button",
922
930
  {
923
- ...$t(t.title, nt(t, i)),
931
+ ...Nt(t.title, it(t, i)),
924
932
  className: `flex w-full items-center ${Z(t.align)} cursor-pointer hover:opacity-80 appearance-none bg-transparent border-0 p-0 font-semibold text-inherit ${fe(t.align)}`,
925
933
  children: h
926
934
  }
@@ -929,7 +937,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
929
937
  t.key
930
938
  );
931
939
  };
932
- return c ? /* @__PURE__ */ n("div", { className: "w-full", style: { ...Ue, ...$e }, children: /* @__PURE__ */ n(
940
+ return c ? /* @__PURE__ */ n("div", { className: "w-full", style: { ...He, ...$e }, children: /* @__PURE__ */ n(
933
941
  "div",
934
942
  {
935
943
  className: "overflow-x-auto",
@@ -968,7 +976,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
968
976
  colSpan: e.length + (ie ? 1 : 0),
969
977
  className: "px-4 py-12 text-center",
970
978
  children: /* @__PURE__ */ y("div", { className: "flex flex-col items-center justify-center", children: [
971
- /* @__PURE__ */ n("div", { className: "table-error-icon w-12 h-12 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ n(Ht, { size: 24 }) }),
979
+ /* @__PURE__ */ n("div", { className: "table-error-icon w-12 h-12 rounded-full flex items-center justify-center mb-4", children: /* @__PURE__ */ n(Gt, { size: 24 }) }),
972
980
  /* @__PURE__ */ n("div", { className: "table-error-title text-lg font-semibold mb-2", children: C }),
973
981
  /* @__PURE__ */ n("div", { className: "table-error-subtitle text-sm", children: u })
974
982
  ] })
@@ -981,7 +989,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
981
989
  {
982
990
  ref: Ie,
983
991
  className: `w-full ${Ve}`,
984
- style: { ...Ue, ...$e },
992
+ style: { ...He, ...$e },
985
993
  children: [
986
994
  /* @__PURE__ */ n(
987
995
  "div",
@@ -1001,7 +1009,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1001
1009
  className: `w-full ${re === "fixed" || e.some((t) => t.width) ? "table-fixed" : "table-auto"} ${p ? "border-separate table-bordered" : "border-collapse"} rounded-lg overflow-hidden`,
1002
1010
  style: { borderSpacing: "0" },
1003
1011
  children: [
1004
- D && /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.map((t, i) => Wt(t, i)) }) }),
1012
+ D && /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ n("tr", { children: e.map((t, i) => Ft(t, i)) }) }),
1005
1013
  /* @__PURE__ */ n("tbody", { children: l ? Array.from({ length: 5 }).map((t, i) => /* @__PURE__ */ n(
1006
1014
  "tr",
1007
1015
  {
@@ -1028,7 +1036,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1028
1036
  ] })
1029
1037
  }
1030
1038
  ) }) : z.map((t, i) => {
1031
- const f = We(t, i), s = (j == null ? void 0 : j(t, i)) || {}, g = P == null ? void 0 : P(t, i), h = i === 0, v = i === r.length - 1, k = i === L, F = g ? `var(--malachite-table-row-variant-${g}-background)` : void 0, o = T || s.onClick ? () => {
1039
+ const f = We(t, i), s = (P == null ? void 0 : P(t, i)) || {}, g = U == null ? void 0 : U(t, i), h = i === 0, v = i === r.length - 1, w = i === L, F = g ? `var(--malachite-table-row-variant-${g}-background)` : void 0, o = T || s.onClick ? () => {
1032
1040
  var a;
1033
1041
  T == null || T(t, i), (a = s.onClick) == null || a.call(s, t, i);
1034
1042
  } : void 0;
@@ -1040,16 +1048,16 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1040
1048
  {
1041
1049
  "data-table-id": q,
1042
1050
  "data-row-index": i,
1043
- "aria-current": k ? "true" : void 0,
1051
+ "aria-current": w ? "true" : void 0,
1044
1052
  tabIndex: o ? i === ee ? 0 : -1 : void 0,
1045
- onKeyDown: o ? st(i, o) : void 0,
1053
+ onKeyDown: o ? ot(i, o) : void 0,
1046
1054
  className: `
1047
- ${p ? "table-row-bordered" : `table-row ${k ? "" : "hover:opacity-80"}`}
1055
+ ${p ? "table-row-bordered" : `table-row ${w ? "" : "hover:opacity-80"}`}
1048
1056
  ${(_ == null ? void 0 : _(t, i)) || ""}
1049
- ${o ? `cursor-pointer ${dt}` : ""}
1057
+ ${o ? `cursor-pointer ${ct}` : ""}
1050
1058
  `,
1051
1059
  onClick: o ? (a) => {
1052
- ft(a) || o();
1060
+ ht(a) || o();
1053
1061
  } : void 0,
1054
1062
  onDoubleClick: s.onDoubleClick ? () => {
1055
1063
  var a;
@@ -1070,7 +1078,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1070
1078
  children: e.map((a) => {
1071
1079
  const d = a === e[0], I = a === e[e.length - 1];
1072
1080
  return /* @__PURE__ */ n(
1073
- Nr,
1081
+ Er,
1074
1082
  {
1075
1083
  column: a,
1076
1084
  record: t,
@@ -1083,8 +1091,8 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1083
1091
  isFirstColumn: d,
1084
1092
  isLastColumn: I,
1085
1093
  variantBackground: F,
1086
- isSelected: k,
1087
- showSelectedAccent: k && d
1094
+ isSelected: w,
1095
+ showSelectedAccent: w && d
1088
1096
  },
1089
1097
  a.key
1090
1098
  );
@@ -1102,7 +1110,7 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1102
1110
  }
1103
1111
  ),
1104
1112
  b && !l && /* @__PURE__ */ n(
1105
- ht,
1113
+ ut,
1106
1114
  {
1107
1115
  current: b.current ?? 1,
1108
1116
  pageSize: b.pageSize ?? 10,
@@ -1120,6 +1128,6 @@ const kt = 160, tr = (e, r) => e.length === r.length && e.every((l, c) => l ===
1120
1128
  );
1121
1129
  };
1122
1130
  export {
1123
- Yr as default
1131
+ qr as default
1124
1132
  };
1125
1133
  //# sourceMappingURL=Table.js.map