chordia-ui 4.0.7 → 4.0.9

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.
@@ -42,18 +42,18 @@ function wr({
42
42
  direction: S = "top",
43
43
  align: u = "center",
44
44
  styling: F,
45
- indicatorColor: L
45
+ indicatorColor: M
46
46
  }) {
47
- const _ = typeof a == "string" ? a : a != null ? String(a) : "", z = typeof L == "string" && (L.startsWith("#") || L.startsWith("rgb") || L.startsWith("hsl") || L.startsWith("var(")) ? L : "var(--Grey-Strong, #2E3236)", [A, Y] = m(!1), [H, he] = m(!1), [O, h] = m({ top: 0, left: 0, arrowLeft: 0, placement: "top" }), g = E(null), M = E(null);
47
+ const _ = typeof a == "string" ? a : a != null ? String(a) : "", z = typeof M == "string" && (M.startsWith("#") || M.startsWith("rgb") || M.startsWith("hsl") || M.startsWith("var(")) ? M : "var(--Grey-Strong, #2E3236)", [A, Y] = m(!1), [H, he] = m(!1), [O, h] = m({ top: 0, left: 0, arrowLeft: 0, placement: "top" }), g = E(null), N = E(null);
48
48
  if (!_)
49
49
  return p;
50
50
  T(() => {
51
51
  he(!0);
52
52
  }, []);
53
53
  const b = D(() => {
54
- if (!g.current || !M.current || typeof window > "u")
54
+ if (!g.current || !N.current || typeof window > "u")
55
55
  return;
56
- const x = g.current.getBoundingClientRect(), N = M.current.getBoundingClientRect(), Ae = window.innerWidth, le = window.innerHeight, V = 8, K = 10, q = N.width, R = N.height, ee = x.top, $ = le - x.bottom, te = S === "bottom" ? "bottom" : "top";
56
+ const x = g.current.getBoundingClientRect(), L = N.current.getBoundingClientRect(), Ae = window.innerWidth, le = window.innerHeight, V = 8, K = 10, q = L.width, R = L.height, ee = x.top, $ = le - x.bottom, te = S === "bottom" ? "bottom" : "top";
57
57
  let ae = te;
58
58
  te === "top" && ee < R + K + V && $ > ee ? ae = "bottom" : te === "bottom" && $ < R + K + V && ee > $ && (ae = "top");
59
59
  let k = x.left + x.width / 2;
@@ -84,7 +84,7 @@ function wr({
84
84
  /* @__PURE__ */ d(
85
85
  "span",
86
86
  {
87
- ref: M,
87
+ ref: N,
88
88
  style: {
89
89
  position: "fixed",
90
90
  top: `${O.top}px`,
@@ -144,7 +144,7 @@ function Ar({
144
144
  // Server-side pagination props (optional)
145
145
  totalCount: F = null,
146
146
  // Total count from server (null = use client-side pagination)
147
- page: L = null,
147
+ page: M = null,
148
148
  // Controlled page (null = use internal state)
149
149
  pageSize: _ = null,
150
150
  // Controlled pageSize (null = use internal state)
@@ -165,14 +165,14 @@ function Ar({
165
165
  // Array of [field, direction] tuples from parent (null = use internal state)
166
166
  tableId: g = null,
167
167
  // Optional unique identifier for localStorage persistence (e.g., "history", "agents")
168
- isLoading: M = !1,
168
+ isLoading: N = !1,
169
169
  // Loading state to show overlay inside table
170
170
  // Filter props (optional)
171
171
  filtersConfig: b = null,
172
172
  // Top toolbar filter config (chips/date/export). Note: this is different from `columnFilters` for inline header inputs.
173
173
  // Column resize (optional) — min/max in px; columns may override with column.minWidth / column.maxWidth
174
174
  columnResizeMinWidth: x = 100,
175
- columnResizeMaxWidth: N = 280,
175
+ columnResizeMaxWidth: L = 280,
176
176
  // Mobile card view (optional) — on phones the table is swapped for a stacked
177
177
  // card list that only shows the currently visible (checked) columns.
178
178
  enableMobileCards: Ae = !0,
@@ -225,7 +225,7 @@ function Ar({
225
225
  ) : s;
226
226
  });
227
227
  ve.displayName = "TruncatedCell";
228
- const we = F !== null && z !== null, me = Y !== null, de = O !== null, [Ft, Re] = m(1), [zt, Nt] = m(S), Pe = L !== null ? L : Ft, Se = _ !== null ? _ : zt, ke = (e) => {
228
+ const we = F !== null && z !== null, me = Y !== null, de = O !== null, [Ft, Re] = m(1), [zt, Nt] = m(S), Pe = M !== null ? M : Ft, Se = _ !== null ? _ : zt, ke = (e) => {
229
229
  z ? z(e) : Re(e);
230
230
  }, Qe = (e) => {
231
231
  A ? A(e) : Nt(e);
@@ -313,9 +313,9 @@ function Ar({
313
313
  }, [Ne]), At = D((e, t, o) => {
314
314
  var J;
315
315
  e.preventDefault(), e.stopPropagation();
316
- const i = t.id || t.key, n = ze(t.minWidth) ?? x, l = ze(t.maxWidth) ?? N, s = Math.min(n, l), c = Math.max(n, l), W = ((J = e.currentTarget.closest("th")) == null ? void 0 : J.getBoundingClientRect().width) || 0, B = ze(o), be = B ?? Math.max(s, Math.round(W) || s), ge = Math.min(c, Math.max(s, be));
316
+ const i = t.id || t.key, n = ze(t.minWidth) ?? x, l = ze(t.maxWidth) ?? L, s = Math.min(n, l), c = Math.max(n, l), W = ((J = e.currentTarget.closest("th")) == null ? void 0 : J.getBoundingClientRect().width) || 0, B = ze(o), be = B ?? Math.max(s, Math.round(W) || s), ge = Math.min(c, Math.max(s, be));
317
317
  Fe.current = { columnId: i, startX: e.clientX, startWidth: ge, minWidth: s, maxWidth: c }, document.body.style.cursor = "col-resize", document.body.style.userSelect = "none", document.addEventListener("mousemove", Ne), document.addEventListener("mouseup", ye);
318
- }, [N, x, Ne, ye, ze]);
318
+ }, [L, x, Ne, ye, ze]);
319
319
  T(() => () => ye(), [ye]);
320
320
  const Rt = tr(
321
321
  bt(dr),
@@ -522,12 +522,12 @@ function Ar({
522
522
  const t = new IntersectionObserver(
523
523
  (o) => {
524
524
  var i;
525
- (i = o[0]) != null && i.isIntersecting && !M && le();
525
+ (i = o[0]) != null && i.isIntersecting && !N && le();
526
526
  },
527
527
  { root: null, rootMargin: "120px" }
528
528
  );
529
529
  return t.observe(e), () => t.disconnect();
530
- }, [k, Ue, M, le, p == null ? void 0 : p.length]), T(() => {
530
+ }, [k, Ue, N, le, p == null ? void 0 : p.length]), T(() => {
531
531
  if (!j || !pe.current)
532
532
  return;
533
533
  const e = () => {
@@ -930,7 +930,7 @@ function Ar({
930
930
  /* @__PURE__ */ r("span", { style: { fontSize: "12px", color: "rgba(30, 33, 37, 0.5)", fontFamily: "var(--font-sans)" }, children: "Loading..." })
931
931
  ]
932
932
  }
933
- ) : !M && Q.length === 0 ? /* @__PURE__ */ r(
933
+ ) : !N && Q.length === 0 ? /* @__PURE__ */ r(
934
934
  "div",
935
935
  {
936
936
  style: {
@@ -1032,7 +1032,7 @@ function Ar({
1032
1032
  );
1033
1033
  }),
1034
1034
  !q && Ue && /* @__PURE__ */ r("div", { ref: mt, style: { height: "1px" } }),
1035
- !q && M && /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", padding: "16px" }, children: /* @__PURE__ */ r(Ye, { src: "/BrandLoading.gif", alt: "Loading", width: 36, height: 36, unoptimized: !0 }) })
1035
+ !q && N && /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", padding: "16px" }, children: /* @__PURE__ */ r(Ye, { src: "/BrandLoading.gif", alt: "Loading", width: 36, height: 36, unoptimized: !0 }) })
1036
1036
  ]
1037
1037
  }
1038
1038
  ),
@@ -1052,7 +1052,7 @@ function Ar({
1052
1052
  position: "relative",
1053
1053
  top: "0.5rem"
1054
1054
  }, children: [
1055
- M && /* @__PURE__ */ r("div", { style: {
1055
+ N && /* @__PURE__ */ r("div", { style: {
1056
1056
  position: "absolute",
1057
1057
  inset: 0,
1058
1058
  background: "rgba(255, 255, 255, 0.9)",
@@ -1086,7 +1086,7 @@ function Ar({
1086
1086
  }
1087
1087
  )
1088
1088
  ] }) }),
1089
- /* @__PURE__ */ r("div", { className: "overflow-x-auto custom-thin-scrollbar-hidden", ref: Tt, style: { maxHeight: "500px", overflowY: "auto", position: "relative", zIndex: 1 }, children: /* @__PURE__ */ d("table", { style: {
1089
+ /* @__PURE__ */ r("div", { className: "overflow-x-auto custom-thin-scrollbar-hidden", ref: Tt, style: { maxHeight: "500px", overflowY: "auto", position: "relative", zIndex: 1, minHeight: N ? "220px" : void 0 }, children: /* @__PURE__ */ d("table", { style: {
1090
1090
  width: "100%",
1091
1091
  borderCollapse: "collapse",
1092
1092
  fontSize: "13px",
@@ -1199,7 +1199,7 @@ function Ar({
1199
1199
  );
1200
1200
  }) })
1201
1201
  ] }),
1202
- /* @__PURE__ */ r("tbody", { children: !M && Q.length === 0 ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
1202
+ /* @__PURE__ */ r("tbody", { children: !N && Q.length === 0 ? /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r(
1203
1203
  "td",
1204
1204
  {
1205
1205
  colSpan: I.length + (R ? 1 : 0),
@@ -1212,7 +1212,7 @@ function Ar({
1212
1212
  },
1213
1213
  children: "No results found"
1214
1214
  }
1215
- ) }) : !M && Q.length > 0 ? Q.map((e, t) => {
1215
+ ) }) : !N && Q.length > 0 ? Q.map((e, t) => {
1216
1216
  const o = We(e, t), i = R && Z.has(o);
1217
1217
  return /* @__PURE__ */ d(
1218
1218
  "tr",
@@ -1317,16 +1317,16 @@ function Rr({
1317
1317
  trailingActions: F
1318
1318
  // Optional extra actions rendered after Export (e.g., Add Users button)
1319
1319
  }) {
1320
- const [L, _] = m(!1), z = E(null), A = E(null);
1320
+ const [M, _] = m(!1), z = E(null), A = E(null);
1321
1321
  T(() => {
1322
1322
  const h = (g) => {
1323
1323
  A.current && !A.current.contains(g.target) && z.current && !z.current.contains(g.target) && _(!1);
1324
1324
  };
1325
- if (L)
1325
+ if (M)
1326
1326
  return document.addEventListener("mousedown", h), () => {
1327
1327
  document.removeEventListener("mousedown", h);
1328
1328
  };
1329
- }, [L]);
1329
+ }, [M]);
1330
1330
  const Y = () => {
1331
1331
  _((h) => !h);
1332
1332
  }, H = (h) => {
@@ -1334,8 +1334,8 @@ function Rr({
1334
1334
  }, O = (() => {
1335
1335
  if (!(u != null && u.filters))
1336
1336
  return !1;
1337
- const h = u.filters, g = u.customFilters || [], M = Object.entries(h).some(([x, N]) => !!(Array.isArray(N) && N.length || typeof N == "string" && N.trim() !== "" || N && typeof N == "object" && (N.min != null || N.max != null))), b = g.some((x) => x.active);
1338
- return M || b;
1337
+ const h = u.filters, g = u.customFilters || [], N = Object.entries(h).some(([x, L]) => !!(Array.isArray(L) && L.length || typeof L == "string" && L.trim() !== "" || L && typeof L == "object" && (L.min != null || L.max != null))), b = g.some((x) => x.active);
1338
+ return N || b;
1339
1339
  })();
1340
1340
  return /* @__PURE__ */ d("div", { className: "flex items-center gap-3 flex-wrap", children: [
1341
1341
  a && /* @__PURE__ */ d(
@@ -1378,7 +1378,7 @@ function Rr({
1378
1378
  ]
1379
1379
  }
1380
1380
  ),
1381
- L && /* @__PURE__ */ r(
1381
+ M && /* @__PURE__ */ r(
1382
1382
  "div",
1383
1383
  {
1384
1384
  ref: A,