@pibit.ai/cure-design-system 0.3.45 → 0.3.50

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 (67) hide show
  1. package/dist/applications/loading-indicator/index.d.ts +2 -0
  2. package/dist/applications/loading-indicator/index.d.ts.map +1 -0
  3. package/dist/applications/loading-indicator/loading-indicator.d.ts +1 -2
  4. package/dist/applications/loading-indicator/loading-indicator.d.ts.map +1 -1
  5. package/dist/assets/icons/filtered-view.svg.js +4 -0
  6. package/dist/index.d.ts +4 -3
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +188 -168
  9. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  10. package/dist/patterns/table/TableWrapper.js +447 -447
  11. package/dist/patterns/table/TableZoomControl.d.ts +2 -2
  12. package/dist/patterns/table/TableZoomControl.d.ts.map +1 -1
  13. package/dist/patterns/table/TableZoomControl.js +124 -46
  14. package/dist/patterns/table/index.d.ts +2 -2
  15. package/dist/patterns/table/index.d.ts.map +1 -1
  16. package/dist/patterns/table/storyHelpers/mockTableViewsApi.d.ts +25 -0
  17. package/dist/patterns/table/storyHelpers/mockTableViewsApi.d.ts.map +1 -0
  18. package/dist/patterns/table/tableZoomLayout.d.ts +6 -0
  19. package/dist/patterns/table/tableZoomLayout.d.ts.map +1 -1
  20. package/dist/patterns/table/tableZoomLayout.js +39 -33
  21. package/dist/patterns/table/toolbar/SummaryFooter.d.ts +10 -3
  22. package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
  23. package/dist/patterns/table/toolbar/SummaryFooter.js +61 -71
  24. package/dist/patterns/table/toolbar/TableToolbar.d.ts +8 -0
  25. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
  26. package/dist/patterns/table/toolbar/TableToolbar.js +200 -159
  27. package/dist/patterns/table/toolbar/TableViewDirtyActions.d.ts +7 -0
  28. package/dist/patterns/table/toolbar/TableViewDirtyActions.d.ts.map +1 -0
  29. package/dist/patterns/table/toolbar/TableViewDirtyActions.js +39 -0
  30. package/dist/patterns/table/toolbar/TableViewsDropdown.d.ts +8 -0
  31. package/dist/patterns/table/toolbar/TableViewsDropdown.d.ts.map +1 -0
  32. package/dist/patterns/table/toolbar/TableViewsDropdown.js +171 -0
  33. package/dist/patterns/table/toolbar/index.d.ts +4 -0
  34. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  35. package/dist/patterns/table/toolbar/tableViewSnapshot.d.ts +18 -0
  36. package/dist/patterns/table/toolbar/tableViewSnapshot.d.ts.map +1 -0
  37. package/dist/patterns/table/toolbar/tableViewSnapshot.js +168 -0
  38. package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts +2 -0
  39. package/dist/patterns/table/toolbar/tableViewSnapshot.test.d.ts.map +1 -0
  40. package/dist/patterns/table/toolbar/tableViewTypes.d.ts +73 -0
  41. package/dist/patterns/table/toolbar/tableViewTypes.d.ts.map +1 -0
  42. package/dist/patterns/table/toolbar/tableViewTypes.js +4 -0
  43. package/dist/patterns/table/types.d.ts +24 -1
  44. package/dist/patterns/table/types.d.ts.map +1 -1
  45. package/dist/patterns/table/useFitTableToViewport.d.ts +15 -0
  46. package/dist/patterns/table/useFitTableToViewport.d.ts.map +1 -0
  47. package/dist/patterns/table/useFitTableToViewport.js +47 -0
  48. package/dist/patterns/table/useTableZoomState.d.ts +20 -0
  49. package/dist/patterns/table/useTableZoomState.d.ts.map +1 -0
  50. package/dist/patterns/table/useTableZoomState.js +30 -0
  51. package/dist/patterns/table-component/TableComponent.d.ts.map +1 -1
  52. package/dist/patterns/table-component/TableComponent.js +385 -384
  53. package/dist/patterns/table-component/types.d.ts +2 -0
  54. package/dist/patterns/table-component/types.d.ts.map +1 -1
  55. package/dist/primitives/input/hint-text.d.ts +1 -2
  56. package/dist/primitives/input/hint-text.d.ts.map +1 -1
  57. package/dist/primitives/input/index.d.ts +3 -1
  58. package/dist/primitives/input/index.d.ts.map +1 -1
  59. package/dist/primitives/input/input.js +7 -7
  60. package/dist/primitives/input/label.d.ts +1 -2
  61. package/dist/primitives/input/label.d.ts.map +1 -1
  62. package/dist/primitives/select/index.d.ts +1 -0
  63. package/dist/primitives/select/index.d.ts.map +1 -1
  64. package/dist/primitives/select/select-item.d.ts +1 -2
  65. package/dist/primitives/select/select-item.d.ts.map +1 -1
  66. package/dist/styles/components.css +1 -1
  67. package/package.json +5 -1
@@ -1,412 +1,412 @@
1
- import { jsx as i, jsxs as p, Fragment as rn } from "react/jsx-runtime";
2
- import { forwardRef as on, useMemo as y, useState as ne, useEffect as sn, useCallback as F, useRef as re, useLayoutEffect as ln, Fragment as an } from "react";
3
- import { functionalUpdate as Je, useTable as dn } from "@tanstack/react-table";
4
- import { ArrowDown as cn, ChevronSelectorVertical as un, ChevronRight as Ue } from "@untitledui/icons";
5
- import { Checkbox as $e } from "../../primitives/checkbox/checkbox.js";
6
- import { ShimmerLine as mn } from "../../primitives/shimmer/shimmer.js";
1
+ import { jsx as i, jsxs as m, Fragment as sn } from "react/jsx-runtime";
2
+ import { forwardRef as ln, useCallback as A, useMemo as v, useRef as oe, useState as Ne, useLayoutEffect as an, Fragment as dn } from "react";
3
+ import { functionalUpdate as Ye, useTable as cn } from "@tanstack/react-table";
4
+ import { ArrowDown as un, ChevronSelectorVertical as mn, ChevronRight as $e } from "@untitledui/icons";
5
+ import { Checkbox as Ue } from "../../primitives/checkbox/checkbox.js";
6
+ import { ShimmerLine as fn } from "../../primitives/shimmer/shimmer.js";
7
7
  import { cn as d } from "../../utils/cn.js";
8
- import { selectionFromSingleCell as fn, getCellRangeVisualState as pn, cellRangeEdgeBoxShadow as hn } from "../table/cellRangeSelection.js";
9
- import { useCellRangeSelection as bn } from "./useCellRangeSelection.js";
10
- import { useRowReorderDrag as gn } from "./useRowReorderDrag.js";
11
- import { GridNavProvider as xn } from "../table/useGridKeyboardNavigation.js";
12
- import { ROW_DRAG_SOURCE_STYLE as yn, ROW_SOURCE_INDEX_ATTR as wn, ROW_REORDER_ATTR as Cn, FloatingRowPreview as vn, DropIndicatorLine as Sn } from "../table/rowReorderDrag.js";
13
- import { buildTableComponentColumns as In } from "./buildTableColumns.js";
14
- import { HEADER_PADDING_CLASS as Nn, ROW_HEIGHT_CLASS as He, CELL_PADDING_CLASS as qe } from "./rowMetrics.js";
15
- import { tableComponentFeatures as En } from "./tableFeatures.js";
8
+ import { selectionFromSingleCell as pn, getCellRangeVisualState as bn, cellRangeEdgeBoxShadow as hn } from "../table/cellRangeSelection.js";
9
+ import { useCellRangeSelection as gn } from "./useCellRangeSelection.js";
10
+ import { useRowReorderDrag as xn } from "./useRowReorderDrag.js";
11
+ import { GridNavProvider as yn } from "../table/useGridKeyboardNavigation.js";
12
+ import { ROW_DRAG_SOURCE_STYLE as wn, ROW_SOURCE_INDEX_ATTR as vn, ROW_REORDER_ATTR as Cn, FloatingRowPreview as Sn, DropIndicatorLine as In } from "../table/rowReorderDrag.js";
13
+ import { buildTableComponentColumns as Nn } from "./buildTableColumns.js";
14
+ import { HEADER_PADDING_CLASS as En, ROW_HEIGHT_CLASS as Ze, CELL_PADDING_CLASS as He } from "./rowMetrics.js";
15
+ import { tableComponentFeatures as Tn } from "./tableFeatures.js";
16
16
  import { TableZoomControl as _n } from "../table/TableZoomControl.js";
17
- import { normalizeZoomConfig as Ln, DEFAULT_TABLE_ZOOM as Rn, DEFAULT_TABLE_ZOOM_MIN as Tn, clamp as Wn, parsePxValue as Ee, DEFAULT_ZOOMABLE_COLUMN_MIN_WIDTH as Be, supportsCssZoom as Dn, computeFillBaseWidth as kn, computeEffectiveTableWidth as On, computeFlexColumnWidth as An, computeNeedsHorizontalScroll as Fn, DEFAULT_COLUMN_MAX_WIDTH as Pn } from "../table/tableZoomLayout.js";
18
- const Zn = 5, Mn = Dn(), Vn = (o) => o === "center" ? "text-center" : o === "right" ? "text-right" : "text-left", Ge = (o) => o === "center" ? "justify-center" : o === "right" ? "justify-end" : "justify-start", te = (o, l) => {
19
- const c = o.__sourceIndex;
17
+ import { useFitTableToViewport as Ln } from "../table/useFitTableToViewport.js";
18
+ import { useTableZoomState as Rn } from "../table/useTableZoomState.js";
19
+ import { DEFAULT_TABLE_ZOOM_MIN as Wn, parsePxValue as Ee, DEFAULT_ZOOMABLE_COLUMN_MIN_WIDTH as qe, supportsCssZoom as Dn, computeFillBaseWidth as kn, computeEffectiveTableWidth as On, computeFlexColumnWidth as zn, getTableZoomFontSize as An, computeNeedsHorizontalScroll as Fn, DEFAULT_COLUMN_MAX_WIDTH as Pn } from "../table/tableZoomLayout.js";
20
+ const Vn = 5, jn = Dn(), Mn = (r) => r === "center" ? "text-center" : r === "right" ? "text-right" : "text-left", Ge = (r) => r === "center" ? "justify-center" : r === "right" ? "justify-end" : "justify-start", ne = (r, l) => {
21
+ const c = r.__sourceIndex;
20
22
  return typeof c == "number" ? c : Number.isFinite(l) ? l : null;
21
- }, Xe = (o) => o instanceof HTMLElement && !!o.closest(
23
+ }, Be = (r) => r instanceof HTMLElement && !!r.closest(
22
24
  'button,a,input,textarea,select,[contenteditable]:not([contenteditable="false"]),[role="button"],[role="menuitem"]'
23
- ), A = (o, l, c) => {
24
- const [T, W] = ne(l), h = o ?? T, S = re(h), b = re(c);
25
- S.current = h, b.current = c;
26
- const ie = F(
27
- (w) => {
28
- var C;
29
- const E = Je(w, S.current);
30
- S.current = E, o === void 0 && W(E), (C = b.current) == null || C.call(b, E);
25
+ ), z = (r, l, c) => {
26
+ const [L, R] = Ne(l), f = r ?? L, C = oe(f), p = oe(c);
27
+ C.current = f, p.current = c;
28
+ const ie = A(
29
+ (g) => {
30
+ var x;
31
+ const I = Ye(g, C.current);
32
+ C.current = I, r === void 0 && R(I), (x = p.current) == null || x.call(p, I);
31
33
  },
32
- [o]
34
+ [r]
33
35
  );
34
- return [h, ie];
35
- }, jn = (o, l) => {
36
- if (!o) return;
37
- const c = o.sticky ? {
36
+ return [f, ie];
37
+ }, Kn = (r, l) => {
38
+ if (!r) return;
39
+ const c = r.sticky ? {
38
40
  position: "sticky",
39
- [o.sticky]: o.stickyOffset ?? 0,
41
+ [r.sticky]: r.stickyOffset ?? 0,
40
42
  zIndex: l ? 30 : 20,
41
43
  backgroundColor: l ? "var(--color-bg-secondary-subtle)" : "var(--color-bg-primary)",
42
- boxShadow: l || !o.sticky ? void 0 : o.sticky === "right" ? "inset 2px 0 0 0 var(--color-border-tertiary)" : "inset -2px 0 0 0 var(--color-border-tertiary)"
44
+ boxShadow: l || !r.sticky ? void 0 : r.sticky === "right" ? "inset 2px 0 0 0 var(--color-border-tertiary)" : "inset -2px 0 0 0 var(--color-border-tertiary)"
43
45
  } : {};
44
46
  return {
45
- width: o.width,
46
- minWidth: o.minWidth ?? o.width ?? `${oe}px`,
47
- maxWidth: o.maxWidth ?? Pn,
47
+ width: r.width,
48
+ minWidth: r.minWidth ?? r.width ?? `${re}px`,
49
+ maxWidth: r.maxWidth ?? Pn,
48
50
  ...c
49
51
  };
50
- }, oe = 120, Ne = (o) => !!(o.maxWidth && o.sticky === "right"), Kn = (o, l = oe) => Ee(o.minWidth) || l, Ye = (o, l, c, T) => {
51
- if (l === "multiple") return o;
52
- if (o === !0) return T ? { [T]: !0 } : {};
53
- const W = c && c !== !0 ? new Set(
54
- Object.keys(c).filter((b) => c[b])
55
- ) : /* @__PURE__ */ new Set(), h = Object.keys(o).filter((b) => o[b]), S = h.find((b) => !W.has(b)) ?? h[0];
56
- return S ? { [S]: !0 } : {};
52
+ }, re = 120, Ie = (r) => !!(r.maxWidth && r.sticky === "right"), $n = (r, l = re) => Ee(r.minWidth) || l, Xe = (r, l, c, L) => {
53
+ if (l === "multiple") return r;
54
+ if (r === !0) return L ? { [L]: !0 } : {};
55
+ const R = c && c !== !0 ? new Set(
56
+ Object.keys(c).filter((p) => c[p])
57
+ ) : /* @__PURE__ */ new Set(), f = Object.keys(r).filter((p) => r[p]), C = f.find((p) => !R.has(p)) ?? f[0];
58
+ return C ? { [C]: !0 } : {};
57
59
  };
58
60
  function Un({
59
- data: o,
61
+ data: r,
60
62
  columns: l,
61
63
  getRowId: c,
62
- ariaLabel: T,
63
- headerGroups: W,
64
- size: h = "xs",
65
- loading: S = !1,
66
- loadingRowCount: b = Zn,
64
+ ariaLabel: L,
65
+ headerGroups: R,
66
+ size: f = "xs",
67
+ loading: C = !1,
68
+ loadingRowCount: p = Vn,
67
69
  emptyState: ie = "No data found",
68
- showBorders: w = !1,
69
- removeRowBorders: E = !1,
70
- fillWidth: C = !1,
71
- zoom: m,
70
+ showBorders: g = !1,
71
+ removeRowBorders: I = !1,
72
+ fillWidth: x = !1,
73
+ zoom: Je,
72
74
  zoomDisabled: Qe = !1,
73
- className: _e,
74
- rootClassName: ze,
75
- tableClassName: et,
76
- headerClassName: tt,
75
+ className: Te,
76
+ rootClassName: et,
77
+ tableClassName: tt,
78
+ headerClassName: nt,
77
79
  getRowClassName: se,
78
80
  onRowClick: le,
79
- onRowHover: U,
80
- toolbar: nt,
81
+ onRowHover: $,
82
+ toolbar: ot,
81
83
  renderToolbar: ae,
82
- pagination: Le,
84
+ pagination: _e,
83
85
  summaryRow: rt,
84
- rowGroups: P,
86
+ rowGroups: F,
85
87
  renderGroupHeader: de,
86
- collapsedGroupIds: ot,
87
- defaultCollapsedGroupIds: it = [],
88
- onCollapsedGroupIdsChange: st,
89
- enableSorting: Re = !1,
90
- sorting: lt,
91
- defaultSorting: at = [],
92
- onSortingChange: dt,
93
- columnVisibility: ct,
94
- defaultColumnVisibility: ut = {},
95
- onColumnVisibilityChange: mt,
96
- columnOrder: ft,
97
- defaultColumnOrder: pt = [],
88
+ collapsedGroupIds: it,
89
+ defaultCollapsedGroupIds: st = [],
90
+ onCollapsedGroupIdsChange: lt,
91
+ enableSorting: Le = !1,
92
+ sorting: at,
93
+ defaultSorting: dt = [],
94
+ onSortingChange: ct,
95
+ columnVisibility: ut,
96
+ defaultColumnVisibility: mt = {},
97
+ onColumnVisibilityChange: ft,
98
+ columnOrder: pt,
99
+ defaultColumnOrder: bt = [],
98
100
  onColumnOrderChange: ht,
99
- selectionMode: $ = "none",
100
- rowSelection: bt,
101
- defaultRowSelection: gt = {},
102
- onRowSelectionChange: xt,
103
- expanded: yt,
104
- defaultExpanded: wt = {},
101
+ selectionMode: U = "none",
102
+ rowSelection: gt,
103
+ defaultRowSelection: xt = {},
104
+ onRowSelectionChange: yt,
105
+ expanded: wt,
106
+ defaultExpanded: vt = {},
105
107
  onExpandedChange: Ct,
106
108
  expansionMode: ce = "multiple",
107
109
  getRowCanExpand: ue,
108
- renderExpandedContent: H,
110
+ renderExpandedContent: Z,
109
111
  onCellClick: me,
110
112
  onCellDoubleClick: fe,
111
- onCellActivate: D,
112
- cellSelection: q,
113
- onCellSelectionChange: Z,
114
- onCopyCells: vt,
115
- onPasteCells: St,
116
- onClearCells: It,
117
- onReorderRows: Te,
118
- enableRowReorder: Nt,
119
- activateOnSingleClick: Et
120
- }, B) {
121
- var je;
122
- const u = y(
123
- () => m ? Ln(m) : null,
124
- [m == null ? void 0 : m.defaultZoom, m == null ? void 0 : m.minZoom, m == null ? void 0 : m.maxZoom, m == null ? void 0 : m.step]
125
- ), [pe, We] = ne(
126
- () => (u == null ? void 0 : u.defaultZoom) ?? Rn
127
- ), I = u !== null && Mn, M = I ? pe / 100 : 1, _t = (u == null ? void 0 : u.minZoom) ?? Tn;
128
- sn(() => {
129
- u && We(
130
- (e) => Wn(e, u.minZoom, u.maxZoom)
131
- );
132
- }, [u]);
133
- const [Lt, Rt] = A(
134
- lt,
113
+ onCellActivate: W,
114
+ cellSelection: H,
115
+ onCellSelectionChange: P,
116
+ onCopyCells: St,
117
+ onPasteCells: It,
118
+ onClearCells: Nt,
119
+ onReorderRows: Re,
120
+ enableRowReorder: Et,
121
+ activateOnSingleClick: Tt
122
+ }, q) {
123
+ var Me;
124
+ const { zoomConfig: N, zoomPercent: V, setZoomPercent: We } = Rn(Je), y = N !== null && jn, j = y ? V / 100 : 1, G = y ? An(V) : void 0, _t = (N == null ? void 0 : N.minZoom) ?? Wn, [Lt, Rt] = z(
135
125
  at,
136
- dt
137
- ), [Tt, Wt] = A(
138
- ct,
126
+ dt,
127
+ ct
128
+ ), [Wt, Dt] = z(
139
129
  ut,
140
- mt
141
- ), [Dt, kt] = A(
142
- ft,
130
+ mt,
131
+ ft
132
+ ), [kt, Ot] = z(
143
133
  pt,
144
- ht
145
- ), [Ot, At] = A(
146
134
  bt,
135
+ ht
136
+ ), [zt, At] = z(
147
137
  gt,
148
- xt
149
- ), [Ft, De] = A(
150
- yt,
138
+ xt,
139
+ yt
140
+ ), [Ft, De] = z(
151
141
  wt,
142
+ vt,
152
143
  Ct
153
- ), he = o.length > 0 ? c(o[0], 0) : void 0, Pt = Ye(
144
+ ), pe = r.length > 0 ? c(r[0], 0) : void 0, Pt = Xe(
154
145
  Ft,
155
146
  ce,
156
147
  void 0,
157
- he
158
- ), Zt = F(
148
+ pe
149
+ ), Vt = A(
159
150
  (e) => {
160
151
  De(
161
- (t) => Ye(
162
- Je(e, t),
152
+ (t) => Xe(
153
+ Ye(e, t),
163
154
  ce,
164
155
  t,
165
- he
156
+ pe
166
157
  )
167
158
  );
168
159
  },
169
- [ce, he, De]
170
- ), [ke, Oe] = A(
171
- ot,
160
+ [ce, pe, De]
161
+ ), [ke, Oe] = z(
172
162
  it,
173
- st
174
- ), be = y(
163
+ st,
164
+ lt
165
+ ), be = v(
175
166
  () => new Set(ke),
176
167
  [ke]
177
- ), Mt = F(
168
+ ), jt = A(
178
169
  (e) => Oe(
179
- (t) => t.includes(e) ? t.filter((r) => r !== e) : [...t, e]
170
+ (t) => t.includes(e) ? t.filter((o) => o !== e) : [...t, e]
180
171
  ),
181
172
  [Oe]
182
- ), V = re(null), [j, Ae] = ne(null);
183
- ln(() => {
184
- if (!C) {
185
- Ae(null);
173
+ ), D = oe(null), [M, ze] = Ne(null), Mt = Ln({
174
+ containerRef: D,
175
+ zoomConfig: N,
176
+ zoomPercent: V,
177
+ setZoomPercent: We
178
+ });
179
+ an(() => {
180
+ if (!x) {
181
+ ze(null);
186
182
  return;
187
183
  }
188
- const e = V.current;
184
+ const e = D.current;
189
185
  if (!e || typeof ResizeObserver > "u") return;
190
186
  const t = () => {
191
187
  const n = e.clientWidth;
192
- n > 0 && Ae(
188
+ n > 0 && ze(
193
189
  (s) => s === n ? s : n
194
190
  );
195
191
  };
196
192
  t();
197
- const r = new ResizeObserver(t);
198
- return r.observe(e), () => r.disconnect();
199
- }, [C, l.length, o.length, S]);
200
- const g = y(() => {
201
- if (!C) return null;
193
+ const o = new ResizeObserver(t);
194
+ return o.observe(e), () => o.disconnect();
195
+ }, [x, l.length, r.length, C]);
196
+ const b = v(() => {
197
+ if (!x) return null;
202
198
  const e = l.reduce(
203
- (n, s) => Ne(s) ? n + Ee(s.maxWidth) : n,
199
+ (n, s) => Ie(s) ? n + Ee(s.maxWidth) : n,
204
200
  0
205
- ), t = l.filter((n) => !Ne(n));
201
+ ), t = l.filter((n) => !Ie(n));
206
202
  return { minTableWidth: t.reduce(
207
- (n, s) => n + Kn(
203
+ (n, s) => n + $n(
208
204
  s,
209
- I ? Ee(Be) : oe
205
+ y ? Ee(qe) : re
210
206
  ),
211
207
  0
212
208
  ) + e, fixedTotal: e, flexibleCount: t.length };
213
- }, [C, l, I]), ge = y(
214
- () => g ? kn(j, g.minTableWidth) : null,
215
- [j, g]
216
- ), xe = Fn(
217
- ge,
218
- j,
219
- M
220
- ), G = y(
221
- () => On(ge, j, M),
222
- [ge, j, M]
223
- ), Fe = y(() => !g || g.flexibleCount === 0 ? null : An(
224
- G,
225
- g.fixedTotal,
226
- g.flexibleCount
227
- ), [g, G]), X = (e, t) => {
228
- const r = jn(e, t);
229
- return !C || !e ? r : Ne(e) ? {
230
- ...r,
209
+ }, [x, l, y]), he = v(
210
+ () => b ? kn(M, b.minTableWidth) : null,
211
+ [M, b]
212
+ ), ge = Fn(
213
+ he,
214
+ M,
215
+ j
216
+ ), B = v(
217
+ () => On(he, M, j),
218
+ [he, M, j]
219
+ ), Ae = v(() => !b || b.flexibleCount === 0 ? null : zn(
220
+ B,
221
+ b.fixedTotal,
222
+ b.flexibleCount
223
+ ), [b, B]), X = (e, t) => {
224
+ const o = Kn(e, t);
225
+ return !x || !e ? o : Ie(e) ? {
226
+ ...o,
231
227
  width: e.maxWidth,
232
228
  minWidth: e.maxWidth,
233
229
  maxWidth: e.maxWidth
234
- } : Fe == null ? r : {
235
- ...r,
236
- width: `${Fe}px`,
237
- minWidth: e.minWidth ?? (I ? Be : `${oe}px`)
230
+ } : Ae == null ? o : {
231
+ ...o,
232
+ width: `${Ae}px`,
233
+ minWidth: e.minWidth ?? (y ? qe : `${re}px`)
238
234
  };
239
- }, ye = y(
235
+ }, xe = v(
240
236
  () => new Map(l.map((e) => [e.id, e])),
241
237
  [l]
242
- ), Vt = y(
243
- () => In(l, W),
244
- [l, W]
245
- ), N = dn({
246
- features: En,
247
- data: o,
248
- columns: Vt,
238
+ ), Kt = v(
239
+ () => Nn(l, R),
240
+ [l, R]
241
+ ), S = cn({
242
+ features: Tn,
243
+ data: r,
244
+ columns: Kt,
249
245
  getRowId: c,
250
- enableSorting: Re,
246
+ enableSorting: Le,
251
247
  enableCellSpanning: !0,
252
- enableRowSelection: $ !== "none",
253
- enableMultiRowSelection: $ === "multiple",
254
- getRowCanExpand: ue && H ? (e) => ue(e.original) : () => !1,
248
+ enableRowSelection: U !== "none",
249
+ enableMultiRowSelection: U === "multiple",
250
+ getRowCanExpand: ue && Z ? (e) => ue(e.original) : () => !1,
255
251
  state: {
256
252
  sorting: Lt,
257
- columnVisibility: Tt,
258
- columnOrder: Dt,
259
- rowSelection: Ot,
253
+ columnVisibility: Wt,
254
+ columnOrder: kt,
255
+ rowSelection: zt,
260
256
  expanded: Pt
261
257
  },
262
258
  onSortingChange: Rt,
263
- onColumnVisibilityChange: Wt,
264
- onColumnOrderChange: kt,
259
+ onColumnVisibilityChange: Dt,
260
+ onColumnOrderChange: Ot,
265
261
  onRowSelectionChange: At,
266
- onExpandedChange: Zt
267
- }), Y = $ !== "none", jt = !!(ue && H), Kt = Y ? 1 : 0, Ut = N.getVisibleLeafColumns().length, J = Math.max(
268
- Ut + Kt,
262
+ onExpandedChange: Vt
263
+ }), Y = U !== "none", $t = !!(ue && Z), Ut = Y ? 1 : 0, Zt = S.getVisibleLeafColumns().length, J = Math.max(
264
+ Zt + Ut,
269
265
  1
270
- ), $t = Math.max(N.getHeaderGroups().length, 1), L = N.getRowModel().rows, we = I && u ? /* @__PURE__ */ i(
266
+ ), Ht = Math.max(S.getHeaderGroups().length, 1), T = S.getRowModel().rows, ye = y && N ? /* @__PURE__ */ i(
271
267
  _n,
272
268
  {
273
- value: pe,
274
- defaultValue: u.defaultZoom,
269
+ value: V,
275
270
  minValue: _t,
276
- maxValue: u.maxZoom,
277
- step: u.step,
271
+ maxValue: N.maxZoom,
272
+ step: N.step,
278
273
  onChange: We,
274
+ onFitToViewport: Mt,
279
275
  isDisabled: Qe
280
276
  }
281
- ) : null, Pe = ae ? ae({ zoomControl: we, zoomPercent: pe }) : nt, Ze = !ae && we ? /* @__PURE__ */ i("div", { className: "flex justify-end", children: we }) : null, Ht = !!(Pe || Ze || Le), qt = y(() => {
282
- const e = I ? { zoom: M } : void 0;
283
- return !C || !g ? I ? { ...e, width: "max-content", minWidth: "100%" } : void 0 : I ? {
277
+ ) : null, Fe = ae ? ae({ zoomControl: ye, zoomPercent: V }) : ot, Pe = !ae && ye ? /* @__PURE__ */ i("div", { className: "flex justify-end", children: ye }) : null, qt = !!(Fe || Pe || _e), Gt = v(() => {
278
+ const e = y ? {
279
+ zoom: j,
280
+ "--table-zoom-font-size": G ? `${G}px` : void 0
281
+ } : void 0;
282
+ return !x || !b ? y ? { ...e, width: "max-content", minWidth: "100%" } : void 0 : y ? {
284
283
  ...e,
285
284
  tableLayout: "fixed",
286
- width: `${G ?? g.minTableWidth}px`
285
+ width: `${B ?? b.minTableWidth}px`
287
286
  } : {
288
287
  tableLayout: "fixed",
289
- width: xe ? `${g.minTableWidth}px` : "100%"
288
+ width: ge ? `${b.minTableWidth}px` : "100%"
290
289
  };
291
290
  }, [
292
- G,
293
- C,
294
- g,
295
- xe,
296
- I,
297
- M
298
- ]), Bt = re(
291
+ B,
292
+ x,
293
+ b,
294
+ ge,
295
+ y,
296
+ j,
297
+ G
298
+ ]), Bt = oe(
299
299
  null
300
- ), [k, Gt] = ne(null), Xt = !!D, Yt = F(
301
- (e, t, r) => {
302
- if (Bt.current = { rowId: e, columnKey: t }, !Z) return;
303
- const n = q;
304
- n != null && n.anchor.rowId === e && n.anchor.columnKey === t && n.focus.rowId === e && n.focus.columnKey === t || Z(
305
- fn({
300
+ ), [k, Xt] = Ne(null), Yt = !!W, Jt = A(
301
+ (e, t, o) => {
302
+ if (Bt.current = { rowId: e, columnKey: t }, !P) return;
303
+ const n = H;
304
+ n != null && n.anchor.rowId === e && n.anchor.columnKey === t && n.focus.rowId === e && n.focus.columnKey === t || P(
305
+ pn({
306
306
  rowId: e,
307
307
  columnKey: t,
308
- sourceIndex: r ?? null
308
+ sourceIndex: o ?? null
309
309
  })
310
310
  );
311
311
  },
312
- [Z, q]
313
- ), Jt = F(
312
+ [P, H]
313
+ ), Qt = A(
314
314
  (e) => {
315
- Gt((t) => t === e || t && e && t.rowId === e.rowId && t.columnKey === e.columnKey ? t : e);
315
+ Xt((t) => t === e || t && e && t.rowId === e.rowId && t.columnKey === e.columnKey ? t : e);
316
316
  },
317
317
  []
318
- ), Q = !!Te && Nt !== !1, f = gn({
318
+ ), Q = !!Re && Et !== !1, u = xn({
319
319
  enabled: Q,
320
- onReorderRows: Te,
321
- containerRef: V
322
- }), Qt = F(
323
- (e, t, r) => {
320
+ onReorderRows: Re,
321
+ containerRef: D
322
+ }), en = A(
323
+ (e, t, o) => {
324
324
  var n;
325
325
  return {
326
326
  row: e.original,
327
327
  rowId: e.id,
328
328
  columnId: t,
329
- value: r,
329
+ value: o,
330
330
  rowIndex: e.index,
331
- sourceIndex: te(e.original, e.index),
332
- isRowDragging: ((n = f.session) == null ? void 0 : n.active) === !0 && f.session.rowId === e.id,
333
- startRowDrag: Q ? (s) => f.startDrag(
331
+ sourceIndex: ne(e.original, e.index),
332
+ isRowDragging: ((n = u.session) == null ? void 0 : n.active) === !0 && u.session.rowId === e.id,
333
+ startRowDrag: Q ? (s) => u.startDrag(
334
334
  s,
335
335
  e.id,
336
- te(e.original, e.index) ?? e.index,
336
+ ne(e.original, e.index) ?? e.index,
337
337
  e.original
338
338
  ) : void 0
339
339
  };
340
340
  },
341
341
  // eslint-disable-next-line react-hooks/exhaustive-deps
342
- [Q, f.startDrag, f.session]
343
- ), Ce = L.map((e) => e.id).join("\0"), ve = y(
342
+ [Q, u.startDrag, u.session]
343
+ ), we = T.map((e) => e.id).join("\0"), ve = v(
344
+ () => we ? we.split("\0") : [],
345
+ [we]
346
+ ), Ce = S.getVisibleLeafColumns().map((e) => e.id).join("\0"), Se = v(
344
347
  () => Ce ? Ce.split("\0") : [],
345
348
  [Ce]
346
- ), Se = N.getVisibleLeafColumns().map((e) => e.id).join("\0"), Ie = y(
347
- () => Se ? Se.split("\0") : [],
348
- [Se]
349
- ), O = typeof Z == "function", z = bn({
349
+ ), O = typeof P == "function", ee = gn({
350
350
  enabled: O,
351
- selection: q,
352
- onSelectionChange: Z,
353
- onCopyCells: vt,
354
- onPasteCells: St,
355
- onClearCells: It,
356
- onActivateCell: D ? (e) => {
357
- const t = L.find((r) => r.id === e.rowId);
358
- t && D({
351
+ selection: H,
352
+ onSelectionChange: P,
353
+ onCopyCells: St,
354
+ onPasteCells: It,
355
+ onClearCells: Nt,
356
+ onActivateCell: W ? (e) => {
357
+ const t = T.find((o) => o.id === e.rowId);
358
+ t && W({
359
359
  row: t.original,
360
360
  rowId: e.rowId,
361
361
  columnId: e.columnKey,
362
362
  value: void 0,
363
363
  rowIndex: t.index,
364
- sourceIndex: e.sourceIndex ?? te(t.original, t.index)
364
+ sourceIndex: e.sourceIndex ?? ne(t.original, t.index)
365
365
  });
366
366
  } : void 0,
367
- activateOnSingleClick: Et,
368
- containerRef: V,
367
+ activateOnSingleClick: Tt,
368
+ containerRef: D,
369
369
  rowIds: ve,
370
- columnKeys: Ie
371
- }), zt = y(() => {
372
- if (!(P != null && P.length)) return L.map((n) => ({ kind: "row", row: n }));
373
- const e = new Map(L.map((n) => [n.id, n])), t = /* @__PURE__ */ new Set(), r = [];
374
- for (const n of P) {
375
- const s = n.rowIds.map((x) => e.get(x)).filter((x) => x !== void 0);
376
- s.length !== 0 && (r.push({
370
+ columnKeys: Se
371
+ }), tn = v(() => {
372
+ if (!(F != null && F.length)) return T.map((n) => ({ kind: "row", row: n }));
373
+ const e = new Map(T.map((n) => [n.id, n])), t = /* @__PURE__ */ new Set(), o = [];
374
+ for (const n of F) {
375
+ const s = n.rowIds.map((h) => e.get(h)).filter((h) => h !== void 0);
376
+ s.length !== 0 && (o.push({
377
377
  kind: "group",
378
378
  group: { id: n.id, label: n.label, rowCount: s.length }
379
- }), s.forEach((x) => t.add(x.id)), !be.has(n.id) && s.forEach((x) => r.push({ kind: "row", row: x })));
379
+ }), s.forEach((h) => t.add(h.id)), !be.has(n.id) && s.forEach((h) => o.push({ kind: "row", row: h })));
380
380
  }
381
- for (const n of L)
382
- t.has(n.id) || r.push({ kind: "row", row: n });
383
- return r;
384
- }, [P, L, be]), en = (e) => {
385
- const t = be.has(e.id), r = () => Mt(e.id);
381
+ for (const n of T)
382
+ t.has(n.id) || o.push({ kind: "row", row: n });
383
+ return o;
384
+ }, [F, T, be]), nn = (e) => {
385
+ const t = be.has(e.id), o = () => jt(e.id);
386
386
  return /* @__PURE__ */ i("tr", { className: "bg-secondary_subtle", children: /* @__PURE__ */ i(
387
387
  "td",
388
388
  {
389
389
  colSpan: J,
390
390
  className: d(
391
391
  !de && "py-1.5",
392
- w && "border-r border-secondary last:border-r-0"
392
+ g && "border-r border-secondary last:border-r-0"
393
393
  ),
394
394
  children: de ? de({
395
395
  id: e.id,
396
396
  label: e.label,
397
397
  rowCount: e.rowCount,
398
398
  isCollapsed: t,
399
- toggle: r
400
- }) : /* @__PURE__ */ p(
399
+ toggle: o
400
+ }) : /* @__PURE__ */ m(
401
401
  "button",
402
402
  {
403
403
  type: "button",
404
404
  className: "flex w-full items-center gap-2 px-2 text-left text-xs font-medium text-secondary",
405
- onClick: r,
405
+ onClick: o,
406
406
  "aria-expanded": !t,
407
407
  children: [
408
408
  /* @__PURE__ */ i(
409
- Ue,
409
+ $e,
410
410
  {
411
411
  className: d(
412
412
  "size-4 shrink-0 text-fg-quaternary transition-transform",
@@ -415,7 +415,7 @@ function Un({
415
415
  }
416
416
  ),
417
417
  /* @__PURE__ */ i("span", { className: "truncate", children: e.label || "(Empty)" }),
418
- /* @__PURE__ */ p("span", { className: "text-tertiary", children: [
418
+ /* @__PURE__ */ m("span", { className: "text-tertiary", children: [
419
419
  "(",
420
420
  e.rowCount,
421
421
  ")"
@@ -425,60 +425,61 @@ function Un({
425
425
  )
426
426
  }
427
427
  ) }, `group-${e.id}`);
428
- }, Me = /* @__PURE__ */ p(
428
+ }, Ve = /* @__PURE__ */ m(
429
429
  "div",
430
430
  {
431
431
  ref: (e) => {
432
- V.current = e, typeof B == "function" ? B(e) : B && (B.current = e);
432
+ D.current = e, typeof q == "function" ? q(e) : q && (q.current = e);
433
433
  },
434
- onPointerDownCapture: O ? z.onPointerDownCapture : void 0,
435
- onKeyDownCapture: O ? z.onKeyDownCapture : void 0,
436
- onClickCapture: O ? z.onClickCapture : void 0,
437
- onDoubleClickCapture: O ? z.onDoubleClickCapture : void 0,
434
+ onPointerDownCapture: O ? ee.onPointerDownCapture : void 0,
435
+ onKeyDownCapture: O ? ee.onKeyDownCapture : void 0,
436
+ onClickCapture: O ? ee.onClickCapture : void 0,
437
+ onDoubleClickCapture: O ? ee.onDoubleClickCapture : void 0,
438
438
  className: d(
439
439
  "w-full rounded-lg bg-primary",
440
- I || !C || xe ? "overflow-x-auto" : "overflow-x-hidden",
441
- w && "rounded-xl border border-secondary",
442
- ze
440
+ y || !x || ge ? "overflow-x-auto" : "overflow-x-hidden",
441
+ g && "rounded-xl border border-secondary",
442
+ et
443
443
  ),
444
444
  children: [
445
- /* @__PURE__ */ p(
445
+ /* @__PURE__ */ m(
446
446
  "table",
447
447
  {
448
- "aria-label": T,
448
+ "aria-label": L,
449
+ "data-table-zoom-typography": G !== void 0 ? "" : void 0,
449
450
  className: d(
450
451
  "w-full border-separate border-spacing-0 overflow-x-hidden",
451
- et
452
+ tt
452
453
  ),
453
- style: qt,
454
+ style: Gt,
454
455
  children: [
455
456
  /* @__PURE__ */ i(
456
457
  "thead",
457
458
  {
458
459
  className: d(
459
460
  "sticky top-0 z-30 rounded-t-lg bg-secondary_subtle [&>tr>th]:h-9 [&>tr>th:first-child]:rounded-tl-lg [&>tr>th:last-child]:rounded-tr-lg",
460
- w && "[&>tr>th]:border-b [&>tr>th]:border-secondary [&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none",
461
- tt
461
+ g && "[&>tr>th]:border-b [&>tr>th]:border-secondary [&>tr>th:first-child]:rounded-bl-none [&>tr>th:last-child]:rounded-br-none",
462
+ nt
462
463
  ),
463
- children: N.getHeaderGroups().map((e, t) => /* @__PURE__ */ p("tr", { children: [
464
+ children: S.getHeaderGroups().map((e, t) => /* @__PURE__ */ m("tr", { children: [
464
465
  Y && t === 0 ? /* @__PURE__ */ i(
465
466
  "th",
466
467
  {
467
- rowSpan: $t,
468
+ rowSpan: Ht,
468
469
  className: d(
469
470
  "relative w-10 min-w-10 p-0 align-middle",
470
- w && "border-r border-secondary"
471
+ g && "border-r border-secondary"
471
472
  ),
472
- children: $ === "multiple" ? /* @__PURE__ */ i(
473
+ children: U === "multiple" ? /* @__PURE__ */ i(
473
474
  "div",
474
475
  {
475
476
  className: "flex items-center justify-center",
476
- onClick: (r) => r.stopPropagation(),
477
+ onClick: (o) => o.stopPropagation(),
477
478
  children: /* @__PURE__ */ i(
478
- $e,
479
+ Ue,
479
480
  {
480
- checked: N.getIsAllRowsSelected() ? !0 : N.getIsSomeRowsSelected() ? "indeterminate" : !1,
481
- onCheckedChange: (r) => N.toggleAllRowsSelected(r === !0),
481
+ checked: S.getIsAllRowsSelected() ? !0 : S.getIsSomeRowsSelected() ? "indeterminate" : !1,
482
+ onCheckedChange: (o) => S.toggleAllRowsSelected(o === !0),
482
483
  "aria-label": "Select all rows",
483
484
  className: "items-center justify-center"
484
485
  }
@@ -487,27 +488,27 @@ function Un({
487
488
  ) : null
488
489
  }
489
490
  ) : null,
490
- e.headers.map((r) => {
491
- if (r.rowSpan === 0) return null;
492
- const n = ye.get(r.column.id), s = r.column.getIsSorted(), x = Re && !r.isPlaceholder && r.column.getCanSort(), a = n != null && n.renderHeader ? n.renderHeader({
491
+ e.headers.map((o) => {
492
+ if (o.rowSpan === 0) return null;
493
+ const n = xe.get(o.column.id), s = o.column.getIsSorted(), h = Le && !o.isPlaceholder && o.column.getCanSort(), a = n != null && n.renderHeader ? n.renderHeader({
493
494
  columnId: n.id,
494
495
  label: n.header
495
- }) : r.isPlaceholder ? null : N.FlexRender({ header: r });
496
+ }) : o.isPlaceholder ? null : S.FlexRender({ header: o });
496
497
  return /* @__PURE__ */ i(
497
498
  "th",
498
499
  {
499
- colSpan: r.colSpan,
500
- rowSpan: r.rowSpan,
501
- scope: r.colSpan > 1 ? "colgroup" : "col",
500
+ colSpan: o.colSpan,
501
+ rowSpan: o.rowSpan,
502
+ scope: o.colSpan > 1 ? "colgroup" : "col",
502
503
  "aria-sort": s === "asc" ? "ascending" : s === "desc" ? "descending" : void 0,
503
504
  style: X(n, !0),
504
505
  className: d(
505
506
  "relative overflow-hidden p-0 outline-hidden focus-within:z-1 focus-within:ring-2 focus-within:ring-focus-ring focus-within:ring-inset",
506
- Nn[h],
507
- w && "border-r border-secondary last:border-r-0",
507
+ En[f],
508
+ g && "border-r border-secondary last:border-r-0",
508
509
  n == null ? void 0 : n.headerClassName
509
510
  ),
510
- children: x ? /* @__PURE__ */ p(
511
+ children: h ? /* @__PURE__ */ m(
511
512
  "button",
512
513
  {
513
514
  type: "button",
@@ -515,12 +516,12 @@ function Un({
515
516
  "flex w-full items-center gap-1 overflow-hidden rounded outline-none",
516
517
  Ge(n == null ? void 0 : n.align)
517
518
  ),
518
- onClick: r.column.getToggleSortingHandler(),
519
- "aria-label": `Sort by ${String((n == null ? void 0 : n.header) ?? r.column.id)}`,
519
+ onClick: o.column.getToggleSortingHandler(),
520
+ "aria-label": `Sort by ${String((n == null ? void 0 : n.header) ?? o.column.id)}`,
520
521
  children: [
521
522
  /* @__PURE__ */ i("span", { className: "overflow-hidden text-ellipsis whitespace-nowrap text-xs font-medium text-secondary", children: a }),
522
523
  s ? /* @__PURE__ */ i(
523
- cn,
524
+ un,
524
525
  {
525
526
  className: d(
526
527
  "size-3 shrink-0 stroke-[3px] text-fg-quaternary",
@@ -528,7 +529,7 @@ function Un({
528
529
  )
529
530
  }
530
531
  ) : /* @__PURE__ */ i(
531
- un,
532
+ mn,
532
533
  {
533
534
  size: 12,
534
535
  strokeWidth: 3,
@@ -548,17 +549,17 @@ function Un({
548
549
  }
549
550
  )
550
551
  },
551
- r.id
552
+ o.id
552
553
  );
553
554
  })
554
555
  ] }, e.id))
555
556
  }
556
557
  ),
557
- /* @__PURE__ */ p("tbody", { children: [
558
- S ? Array.from({ length: b }, (e, t) => /* @__PURE__ */ p(
558
+ /* @__PURE__ */ m("tbody", { children: [
559
+ C ? Array.from({ length: p }, (e, t) => /* @__PURE__ */ m(
559
560
  "tr",
560
561
  {
561
- className: He[h],
562
+ className: Ze[f],
562
563
  "aria-hidden": "true",
563
564
  children: [
564
565
  Y ? /* @__PURE__ */ i(
@@ -566,26 +567,26 @@ function Un({
566
567
  {
567
568
  className: d(
568
569
  "w-10 min-w-10",
569
- w && "border-r border-secondary",
570
- !E && "border-b border-tertiary"
570
+ g && "border-r border-secondary",
571
+ !I && "border-b border-tertiary"
571
572
  )
572
573
  }
573
574
  ) : null,
574
- N.getVisibleLeafColumns().map((r) => {
575
- const n = ye.get(r.id);
575
+ S.getVisibleLeafColumns().map((o) => {
576
+ const n = xe.get(o.id);
576
577
  return /* @__PURE__ */ i(
577
578
  "td",
578
579
  {
579
580
  style: X(n, !1),
580
581
  className: d(
581
582
  "relative overflow-hidden text-secondary",
582
- qe[h],
583
- w && "border-r border-secondary last:border-r-0",
584
- !E && "border-b border-tertiary",
583
+ He[f],
584
+ g && "border-r border-secondary last:border-r-0",
585
+ !I && "border-b border-tertiary",
585
586
  n == null ? void 0 : n.cellClassName
586
587
  ),
587
588
  children: /* @__PURE__ */ i(
588
- mn,
589
+ fn,
589
590
  {
590
591
  height: "14px",
591
592
  width: "75%",
@@ -593,60 +594,60 @@ function Un({
593
594
  }
594
595
  )
595
596
  },
596
- r.id
597
+ o.id
597
598
  );
598
599
  })
599
600
  ]
600
601
  },
601
602
  `loading-${t}`
602
- )) : L.length === 0 ? /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(
603
+ )) : T.length === 0 ? /* @__PURE__ */ i("tr", { children: /* @__PURE__ */ i(
603
604
  "td",
604
605
  {
605
606
  colSpan: J,
606
607
  className: "border-b border-secondary px-3 py-3 text-left text-xs text-placeholder_subtle",
607
608
  children: ie
608
609
  }
609
- ) }) : zt.map((e) => {
610
- var x;
610
+ ) }) : tn.map((e) => {
611
+ var h;
611
612
  if (e.kind === "group")
612
- return en(e.group);
613
- const t = e.row, r = jt && t.getCanExpand(), n = r && t.getIsExpanded(), s = t.getVisibleCells();
614
- return /* @__PURE__ */ p(an, { children: [
615
- /* @__PURE__ */ p(
613
+ return nn(e.group);
614
+ const t = e.row, o = $t && t.getCanExpand(), n = o && t.getIsExpanded(), s = t.getVisibleCells();
615
+ return /* @__PURE__ */ m(dn, { children: [
616
+ /* @__PURE__ */ m(
616
617
  "tr",
617
618
  {
618
619
  ...Q ? {
619
620
  [Cn]: t.id,
620
- [wn]: String(
621
- te(t.original, t.index) ?? t.index
621
+ [vn]: String(
622
+ ne(t.original, t.index) ?? t.index
622
623
  )
623
624
  } : {},
624
- style: (x = f.session) != null && x.active && f.session.rowId === t.id ? yn : void 0,
625
+ style: (h = u.session) != null && h.active && u.session.rowId === t.id ? wn : void 0,
625
626
  className: d(
626
627
  // `focus-visible`, not `focus-within`: the ring marks the row itself being keyboard-focused.
627
628
  // `focus-within` also fires for anything inside it, so an open cell
628
629
  // editor outlined the entire row.
629
630
  "relative outline-focus-ring transition-colors hover:bg-secondary_subtle focus-visible:outline-2 focus-visible:-outline-offset-2",
630
- He[h],
631
+ Ze[f],
631
632
  t.getIsSelected() && "bg-secondary",
632
633
  le && "cursor-pointer",
633
634
  se == null ? void 0 : se(t.original)
634
635
  ),
635
636
  onClick: (a) => {
636
- !le || Xe(a.target) || le(t.original);
637
+ !le || Be(a.target) || le(t.original);
637
638
  },
638
- onMouseEnter: U ? () => U(t.original, !0) : void 0,
639
- onMouseLeave: U ? () => U(t.original, !1) : void 0,
639
+ onMouseEnter: $ ? () => $(t.original, !0) : void 0,
640
+ onMouseLeave: $ ? () => $(t.original, !1) : void 0,
640
641
  children: [
641
642
  Y ? /* @__PURE__ */ i(
642
643
  "td",
643
644
  {
644
645
  className: d(
645
646
  "relative w-10 min-w-10 p-0 text-center",
646
- w && "border-r border-secondary",
647
+ g && "border-r border-secondary",
647
648
  // Matches the data cells, so the row separator
648
649
  // runs the full width of the table.
649
- !E && !n && "border-b border-tertiary"
650
+ !I && !n && "border-b border-tertiary"
650
651
  ),
651
652
  children: /* @__PURE__ */ i(
652
653
  "div",
@@ -655,7 +656,7 @@ function Un({
655
656
  onClick: (a) => a.stopPropagation(),
656
657
  onKeyDown: (a) => a.stopPropagation(),
657
658
  children: /* @__PURE__ */ i(
658
- $e,
659
+ Ue,
659
660
  {
660
661
  checked: t.getIsSelected(),
661
662
  onCheckedChange: (a) => t.toggleSelected(a === !0),
@@ -669,36 +670,36 @@ function Un({
669
670
  ) : null,
670
671
  s.map((a, Ke) => {
671
672
  if (a.getIsCovered()) return null;
672
- const v = ye.get(a.column.id);
673
- if (!v) return null;
674
- const K = Qt(
673
+ const w = xe.get(a.column.id);
674
+ if (!w) return null;
675
+ const K = en(
675
676
  t,
676
- v.id,
677
+ w.id,
677
678
  a.getValue()
678
- ), tn = v.renderCell ? v.renderCell(K) : String(a.getValue() ?? ""), _ = O ? pn(
679
- q,
679
+ ), on = w.renderCell ? w.renderCell(K) : String(a.getValue() ?? ""), E = O ? bn(
680
+ H,
680
681
  t.id,
681
- v.id,
682
+ w.id,
682
683
  ve,
683
- Ie
684
- ) : null, ee = !!(_ != null && _.inRange), nn = (k == null ? void 0 : k.rowId) === t.id && (k == null ? void 0 : k.columnKey) === v.id;
684
+ Se
685
+ ) : null, te = !!(E != null && E.inRange), rn = (k == null ? void 0 : k.rowId) === t.id && (k == null ? void 0 : k.columnKey) === w.id;
685
686
  return /* @__PURE__ */ i(
686
687
  "td",
687
688
  {
688
689
  colSpan: a.getColSpan(),
689
690
  rowSpan: a.getRowSpan(),
690
- style: ee && _ ? {
691
- ...X(v, !1),
691
+ style: te && E ? {
692
+ ...X(w, !1),
692
693
  boxShadow: hn(
693
- _.edges
694
+ E.edges
694
695
  )
695
- } : X(v, !1),
696
+ } : X(w, !1),
696
697
  "data-table-component-cell": "",
697
698
  "data-grid-cell": "",
698
699
  "data-grid-row-id": t.id,
699
- "data-grid-col-key": v.id,
700
+ "data-grid-col-key": w.id,
700
701
  "data-grid-source-index": K.sourceIndex ?? void 0,
701
- tabIndex: D ? 0 : void 0,
702
+ tabIndex: W ? 0 : void 0,
702
703
  className: d(
703
704
  // `overflow-hidden`, never `overflow-x-hidden`: when `overflow-x` is not
704
705
  // `visible` the browser computes `overflow-y` to `auto`, turning
@@ -708,24 +709,24 @@ function Un({
708
709
  // The cell holding an open editor must not clip it: a wrapped
709
710
  // multi-line value has to be visible, and the row only grows
710
711
  // around content the cell is allowed to show.
711
- nn ? "z-1 overflow-visible" : "overflow-hidden",
712
- qe[h],
713
- Vn(v.align),
714
- w && "border-r border-secondary last:border-r-0",
715
- !E && !n && !ee && "border-b border-tertiary",
716
- ee && "z-1 outline-hidden",
717
- ee && !(_ != null && _.isAnchor) && "bg-utility-brand-25",
718
- v.cellClassName
712
+ rn ? "z-1 overflow-visible" : "overflow-hidden",
713
+ He[f],
714
+ Mn(w.align),
715
+ g && "border-r border-secondary last:border-r-0",
716
+ !I && !n && !te && "border-b border-tertiary",
717
+ te && "z-1 outline-hidden",
718
+ te && !(E != null && E.isAnchor) && "bg-utility-brand-25",
719
+ w.cellClassName
719
720
  ),
720
- onClick: (R) => {
721
- me == null || me(K), Ke === 0 && r && Xe(R.target) && R.stopPropagation();
721
+ onClick: (_) => {
722
+ me == null || me(K), Ke === 0 && o && Be(_.target) && _.stopPropagation();
722
723
  },
723
724
  onDoubleClick: () => fe == null ? void 0 : fe(K),
724
- onKeyDown: (R) => {
725
- R.key !== "Enter" || !D || (R.preventDefault(), D(K));
725
+ onKeyDown: (_) => {
726
+ _.key !== "Enter" || !W || (_.preventDefault(), W(K));
726
727
  },
727
- children: /* @__PURE__ */ p("div", { className: "flex min-w-0 items-center gap-2", children: [
728
- Ke === 0 && r ? /* @__PURE__ */ i(
728
+ children: /* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-2", children: [
729
+ Ke === 0 && o ? /* @__PURE__ */ i(
729
730
  "button",
730
731
  {
731
732
  type: "button",
@@ -736,13 +737,13 @@ function Un({
736
737
  "aria-label": n ? "Collapse row" : "Expand row",
737
738
  "aria-expanded": n,
738
739
  "aria-controls": `${t.id}-detail`,
739
- onClick: (R) => {
740
- R.stopPropagation(), t.toggleExpanded();
740
+ onClick: (_) => {
741
+ _.stopPropagation(), t.toggleExpanded();
741
742
  },
742
- children: /* @__PURE__ */ i(Ue, { className: "size-4 text-fg-quaternary" })
743
+ children: /* @__PURE__ */ i($e, { className: "size-4 text-fg-quaternary" })
743
744
  }
744
745
  ) : null,
745
- /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: tn })
746
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: on })
746
747
  ] })
747
748
  },
748
749
  a.id
@@ -751,12 +752,12 @@ function Un({
751
752
  ]
752
753
  }
753
754
  ),
754
- n && H ? /* @__PURE__ */ i(
755
+ n && Z ? /* @__PURE__ */ i(
755
756
  "tr",
756
757
  {
757
758
  id: `${t.id}-detail`,
758
759
  className: "relative bg-secondary_subtle",
759
- children: /* @__PURE__ */ i("td", { colSpan: J, className: "p-0", children: H({
760
+ children: /* @__PURE__ */ i("td", { colSpan: J, className: "p-0", children: Z({
760
761
  row: t.original,
761
762
  rowId: t.id,
762
763
  colSpan: J,
@@ -766,44 +767,44 @@ function Un({
766
767
  ) : null
767
768
  ] }, t.id);
768
769
  }),
769
- !S && rt
770
+ !C && rt
770
771
  ] })
771
772
  ]
772
773
  }
773
774
  ),
774
- ((je = f.session) == null ? void 0 : je.active) && /* @__PURE__ */ p(rn, { children: [
775
- /* @__PURE__ */ i(vn, { session: f.session }),
776
- f.session.dropLineY !== null && /* @__PURE__ */ i(
777
- Sn,
775
+ ((Me = u.session) == null ? void 0 : Me.active) && /* @__PURE__ */ m(sn, { children: [
776
+ /* @__PURE__ */ i(Sn, { session: u.session }),
777
+ u.session.dropLineY !== null && /* @__PURE__ */ i(
778
+ In,
778
779
  {
779
- y: f.session.dropLineY,
780
- left: f.session.dropLineLeft,
781
- width: f.session.dropLineWidth
780
+ y: u.session.dropLineY,
781
+ left: u.session.dropLineLeft,
782
+ width: u.session.dropLineWidth
782
783
  }
783
784
  )
784
785
  ] })
785
786
  ]
786
787
  }
787
- ), Ve = Ht ? /* @__PURE__ */ p("div", { className: d("flex flex-col gap-3", _e), children: [
788
+ ), je = qt ? /* @__PURE__ */ m("div", { className: d("flex flex-col gap-3", Te), children: [
789
+ Fe,
788
790
  Pe,
789
- Ze,
790
- Me,
791
- Le
792
- ] }) : /* @__PURE__ */ i("div", { className: _e, children: Me });
793
- return Xt ? /* @__PURE__ */ i(
794
- xn,
791
+ Ve,
792
+ _e
793
+ ] }) : /* @__PURE__ */ i("div", { className: Te, children: Ve });
794
+ return Yt ? /* @__PURE__ */ i(
795
+ yn,
795
796
  {
796
797
  rowIds: ve,
797
- columnKeys: Ie,
798
- containerRef: V,
799
- onSelectCell: Yt,
800
- onEditingCellChange: Jt,
801
- children: Ve
798
+ columnKeys: Se,
799
+ containerRef: D,
800
+ onSelectCell: Jt,
801
+ onEditingCellChange: Qt,
802
+ children: je
802
803
  }
803
- ) : Ve;
804
+ ) : je;
804
805
  }
805
- const lr = on(Un);
806
+ const uo = ln(Un);
806
807
  export {
807
- lr as TableComponent,
808
- lr as default
808
+ uo as TableComponent,
809
+ uo as default
809
810
  };