@ai-matrx/design-system 0.21.5 → 0.21.6

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.
@@ -85,6 +85,8 @@ var Search = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Icon, { ...p, c
85
85
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m16 16 4 4" })
86
86
  ] });
87
87
  var Plus = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { ...p, children: path });
88
+ var Star = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m12 2 3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" }) });
89
+ var Pin = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 17v5M9 3h6l1 7 3 3v2H5v-2l3-3 1-7z" }) });
88
90
  var Eraser = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { ...p, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m16 3 5 5-11 11H5l-3-3L13 5l3-2Z M8 10l6 6 M10 19h12" }) });
89
91
  var GripVertical = (p) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Icon, { ...p, children: [
90
92
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "9", cy: "6", r: "1" }),
@@ -11664,6 +11666,28 @@ function DefaultJsonCell({ value }) {
11664
11666
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DataRowWindow, { isOpen: open, onClose: () => setOpen(false), title: "JSON value", row: value, viewContent: Viewer ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Viewer, { data: value }) : /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("pre", { className: "overflow-auto whitespace-pre-wrap p-3 text-xs", children: text }) })
11665
11667
  ] });
11666
11668
  }
11669
+ function DefaultMarkerCell({
11670
+ marker,
11671
+ value
11672
+ }) {
11673
+ const label = marker === "favorite" ? value ? "Favorite" : "Not favorite" : value ? "Pinned" : "Not pinned";
11674
+ const Icon3 = marker === "favorite" ? Star : Pin;
11675
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(Tooltip, { children: [
11676
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11677
+ "span",
11678
+ {
11679
+ role: "img",
11680
+ "aria-label": label,
11681
+ className: cn(
11682
+ "inline-flex size-5 items-center justify-center",
11683
+ value ? "text-amber-500" : "text-muted-foreground/45"
11684
+ ),
11685
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon3, { className: "size-4", ...value ? { fill: "currentColor" } : {} })
11686
+ }
11687
+ ) }),
11688
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TooltipContent, { children: label })
11689
+ ] });
11690
+ }
11667
11691
  function renderCell(row, col, index) {
11668
11692
  if (col.cell) return col.cell(row, index);
11669
11693
  const raw = getCellValue(row, col);
@@ -11686,6 +11710,8 @@ function renderCell(row, col, index) {
11686
11710
  }
11687
11711
  if (raw !== null && typeof raw === "object" && !(raw instanceof Date)) return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DefaultJsonCell, { value: raw });
11688
11712
  if (typeof raw === "boolean") {
11713
+ const marker = resolveColumnMarker(col);
11714
+ if (marker) return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DefaultMarkerCell, { marker, value: raw });
11689
11715
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: raw ? "rounded bg-emerald-500/10 px-1.5 py-0.5 text-xs text-emerald-600" : "rounded bg-slate-500/10 px-1.5 py-0.5 text-xs text-muted-foreground", children: raw ? "Yes" : "No" });
11690
11716
  }
11691
11717
  const formatted = formatTableDisplayValue(raw);