@lumerahq/ui 0.12.0-dev.2 → 0.12.0-dev.4

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.
package/README.md CHANGED
@@ -63,6 +63,10 @@ import { AuditLog } from '@lumerahq/ui';
63
63
  finance__invoices: 'Invoices',
64
64
  finance__payments: 'Payments',
65
65
  }}
66
+ activityNouns={{
67
+ finance__invoices: 'invoice',
68
+ finance__payments: 'payment',
69
+ }}
66
70
  fieldLabels={{ customer_id: 'Customer' }}
67
71
  showSystemFields={false}
68
72
  exportFilename="finance-activity.csv"
@@ -70,13 +74,17 @@ import { AuditLog } from '@lumerahq/ui';
70
74
  ```
71
75
 
72
76
  The component includes collection, date/time, event, and actor filters with
73
- visible active-filter chips; lazy before/after details; pagination; and CSV
74
- export with filename/count/truncation feedback. It also supports controlled
75
- filters, column and density options, record navigation callbacks, and custom
76
- loading, empty, and error states. Friendly collection labels are used in both
77
- the collection column and activity text. If a selected collection has auditing
78
- turned off, existing history remains visible and the component shows a warning
79
- that future changes will not be recorded.
77
+ visible active-filter chips, quick date presets, lazy before/after details,
78
+ pagination, and CSV export with filename/count/truncation feedback. It also
79
+ supports controlled filters, column and density options, record navigation
80
+ callbacks, and custom loading, empty, and error states. Friendly collection
81
+ labels are used in the collection column and CSV export. Pass
82
+ `activityNouns` when the collection label is plural, so activity text can read
83
+ naturally, for example "Updated invoice" instead of "Updated Invoices". If an
84
+ activity noun is not provided, the component falls back to the friendly
85
+ collection label. If a selected collection has auditing turned off, existing
86
+ history remains visible and the component shows a warning that future changes
87
+ will not be recorded.
80
88
 
81
89
  ### Assistant Chat
82
90
 
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import React__default, { useContext, createContext, forwardRef, createElement, memo, useId as useId$1, useTransition, useMemo, useRef, useEffect, useState, cloneElement, isValidElement, useCallback, Suspense, lazy, Fragment as Fragment$1, useLayoutEffect } from "react";
4
- import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogSummaryWithCollectionLabel, e as auditLogDetailValue, f as auditLogActorLabel, n as normalizeRecordAuditCollections, h as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, i as fetchRecordAuditLogCsv, j as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-DmMpzFCS.js";
4
+ import { u as useAgentChat, a as useAgentChatSessions, g as getRecordAuditLogSnapshot, d as auditLogSummaryWithCollectionLabel, e as auditLogDetailValue, f as auditLogActorLabel, n as normalizeRecordAuditCollections, h as normalizeAuditLogFilterState, A as AUDIT_LOG_MAX_COLLECTIONS, b as useAuditLog, i as fetchRecordAuditLogCsv, j as normalizeAuditLogExportLimit, c as useAutomationRun } from "./use-automation-run-B2iPUXiG.js";
5
5
  import { t as twMerge, p as clsx, o as cn$2, a as formatCellValue$2 } from "./formatters-D4T821Dv.js";
6
6
  import { f as getDownloadUrl, t as pbSql, p as parentApiRequest, d as parentApiStream, B as BridgeError, z as automationStatuses, L as getAutomationRunFileDownloadUrl, R as listAutomationRunFiles } from "./automations-EgDXJ43_.js";
7
7
  import * as ReactDOM from "react-dom";
@@ -86,24 +86,24 @@ const createLucideIcon = (iconName, iconNode) => {
86
86
  Component.displayName = toPascalCase(iconName);
87
87
  return Component;
88
88
  };
89
- const __iconNode$K = [
89
+ const __iconNode$L = [
90
90
  ["path", { d: "M12 5v14", key: "s699le" }],
91
91
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
92
92
  ];
93
- const ArrowDown = createLucideIcon("arrow-down", __iconNode$K);
94
- const __iconNode$J = [
93
+ const ArrowDown = createLucideIcon("arrow-down", __iconNode$L);
94
+ const __iconNode$K = [
95
95
  ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
96
96
  ["path", { d: "M17 20V4", key: "1ejh1v" }],
97
97
  ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
98
98
  ["path", { d: "M7 4v16", key: "1glfcx" }]
99
99
  ];
100
- const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$J);
101
- const __iconNode$I = [
100
+ const ArrowUpDown = createLucideIcon("arrow-up-down", __iconNode$K);
101
+ const __iconNode$J = [
102
102
  ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
103
103
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
104
104
  ];
105
- const ArrowUp = createLucideIcon("arrow-up", __iconNode$I);
106
- const __iconNode$H = [
105
+ const ArrowUp = createLucideIcon("arrow-up", __iconNode$J);
106
+ const __iconNode$I = [
107
107
  ["path", { d: "M12 8V4H8", key: "hb8ula" }],
108
108
  ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
109
109
  ["path", { d: "M2 14h2", key: "vft8re" }],
@@ -111,8 +111,8 @@ const __iconNode$H = [
111
111
  ["path", { d: "M15 13v2", key: "1xurst" }],
112
112
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
113
113
  ];
114
- const Bot = createLucideIcon("bot", __iconNode$H);
115
- const __iconNode$G = [
114
+ const Bot = createLucideIcon("bot", __iconNode$I);
115
+ const __iconNode$H = [
116
116
  ["path", { d: "M12 18V5", key: "adv99a" }],
117
117
  ["path", { d: "M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4", key: "1e3is1" }],
118
118
  ["path", { d: "M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5", key: "1gqd8o" }],
@@ -122,7 +122,16 @@ const __iconNode$G = [
122
122
  ["path", { d: "M6 18a4 4 0 0 1-2-7.464", key: "k1g0md" }],
123
123
  ["path", { d: "M6.003 5.125a4 4 0 0 0-2.526 5.77", key: "q97ue3" }]
124
124
  ];
125
- const Brain = createLucideIcon("brain", __iconNode$G);
125
+ const Brain = createLucideIcon("brain", __iconNode$H);
126
+ const __iconNode$G = [
127
+ ["path", { d: "M16 14v2.2l1.6 1", key: "fo4ql5" }],
128
+ ["path", { d: "M16 2v4", key: "4m81vk" }],
129
+ ["path", { d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5", key: "1osxxc" }],
130
+ ["path", { d: "M3 10h5", key: "r794hk" }],
131
+ ["path", { d: "M8 2v4", key: "1cmpym" }],
132
+ ["circle", { cx: "16", cy: "16", r: "6", key: "qoo3c4" }]
133
+ ];
134
+ const CalendarClock = createLucideIcon("calendar-clock", __iconNode$G);
126
135
  const __iconNode$F = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
127
136
  const Check = createLucideIcon("check", __iconNode$F);
128
137
  const __iconNode$E = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
@@ -24041,7 +24050,7 @@ var lr = (e) => {
24041
24050
  for (; t > 0 && e[t - 1] === `
24042
24051
  `; ) t--;
24043
24052
  return e.slice(0, t);
24044
- }, cr = lazy(() => import("./highlighted-body-OFNGDK62-DzatZiEq.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24053
+ }, cr = lazy(() => import("./highlighted-body-OFNGDK62-DkOFnnd1.js").then((e) => ({ default: e.HighlightedCodeBlockBody }))), st = ({ code: e, language: t, className: o, children: n, isIncomplete: r = false, startLine: s2, lineNumbers: a, ...l }) => {
24045
24054
  let i = y2(), d2 = useMemo(() => lr(e), [e]), c2 = useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: d2.split(`
24046
24055
  `).map((p2) => [{ content: p2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [d2]);
24047
24056
  return jsx(nt.Provider, { value: { code: e }, children: jsxs(ot, { isIncomplete: r, language: t, children: [jsx(rt, { language: t }), n ? jsx("div", { className: i("pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end"), children: jsx("div", { className: i("pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur"), "data-streamdown": "code-block-actions", children: n }) }) : null, jsx(Suspense, { fallback: jsx(At, { className: o, language: t, lineNumbers: a, result: c2, startLine: s2, ...l }), children: jsx(cr, { className: o, code: d2, language: t, lineNumbers: a, raw: c2, startLine: s2, ...l }) })] }) });
@@ -24403,7 +24412,7 @@ var vo = ({ children: e, className: t, showControls: o, showCopy: n = true, show
24403
24412
  let l = y2(), i = o && n, d2 = o && r, c2 = o && s2, p2 = i || d2 || c2;
24404
24413
  return jsxs("div", { className: l("my-4 flex flex-col gap-2 rounded-lg border border-border bg-sidebar p-2"), "data-streamdown": "table-wrapper", children: [p2 ? jsxs("div", { className: l("flex items-center justify-end gap-1"), children: [i ? jsx(Te, {}) : null, d2 ? jsx(Pe, {}) : null, c2 ? jsx(Co, { showCopy: i, showDownload: d2, children: e }) : null] }) : null, jsx("div", { className: l("border-collapse overflow-x-auto overflow-y-auto rounded-md border border-border bg-background"), children: jsx("table", { className: l("w-full divide-y divide-border", t), "data-streamdown": "table", ...a, children: e }) })] });
24405
24414
  };
24406
- var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-BPtfcw6Y.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24415
+ var es = /startLine=(\d+)/, ts = /\bnoLineNumbers\b/, os = lazy(() => import("./mermaid-GHXKKRXX-Dcx-81a_.js").then((e) => ({ default: e.Mermaid }))), ns = /language-([^\s]+)/;
24407
24416
  function qe(e, t) {
24408
24417
  if (!(e != null && e.position || t != null && t.position)) return true;
24409
24418
  if (!(e != null && e.position && (t != null && t.position))) return false;
@@ -29552,20 +29561,35 @@ const systemFieldKeys = /* @__PURE__ */ new Set([
29552
29561
  ]);
29553
29562
  const identityFieldKeys = /* @__PURE__ */ new Set(["collection", "collection_id", "record_id"]);
29554
29563
  const fieldKey = (field) => field.key?.trim().toLowerCase() || field.label.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
29555
- const displayFields = (fields, fieldLabels, showSystemFields) => {
29564
+ const displayFields = (fields, fieldLabels, showSystemFields, options = {}) => {
29556
29565
  if (!fields) return null;
29557
29566
  return fields.filter((field) => showSystemFields || !systemFieldKeys.has(fieldKey(field))).map((field) => {
29558
- const label = field.key && fieldLabels?.[field.key] || fieldLabels?.[field.label] || fieldLabels?.[fieldKey(field)];
29559
- return label?.trim() ? { ...field, label: label.trim() } : field;
29567
+ const key = fieldKey(field);
29568
+ const friendlyCollection = key === "collection" && options.collectionLabel?.trim() && options.collectionApiName?.trim() ? {
29569
+ ...field,
29570
+ value: options.collectionLabel.trim(),
29571
+ secondary: options.collectionLabel.trim() === options.collectionApiName.trim() ? field.secondary : options.collectionApiName.trim(),
29572
+ secondaryLabel: options.collectionLabel.trim() === options.collectionApiName.trim() ? field.secondaryLabel : "API name",
29573
+ mono: false
29574
+ } : field;
29575
+ const label = field.key && fieldLabels?.[field.key] || fieldLabels?.[field.label] || fieldLabels?.[key];
29576
+ return label?.trim() ? { ...friendlyCollection, label: label.trim() } : friendlyCollection;
29560
29577
  });
29561
29578
  };
29562
29579
  function FieldValue({ field }) {
29563
29580
  if (field.json !== void 0) {
29564
29581
  return /* @__PURE__ */ jsx("pre", { className: "max-h-48 overflow-auto rounded-lg bg-background p-3 text-xs", children: JSON.stringify(field.json, null, 2) });
29565
29582
  }
29583
+ const value = field.value || "—";
29584
+ const secondary = field.secondary?.trim();
29585
+ const secondaryText = secondary ? `${field.secondaryLabel?.trim() ? `${field.secondaryLabel.trim()}: ` : ""}${secondary}` : "";
29566
29586
  return /* @__PURE__ */ jsxs("div", { className: cn$2("break-words text-sm", field.mono && "font-mono text-xs"), children: [
29567
- field.value || "—",
29568
- field.secondary ? /* @__PURE__ */ jsx("span", { className: "ml-2 text-muted-foreground", children: field.secondary }) : null
29587
+ secondary ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: `${value}; ${secondaryText}` }) : null,
29588
+ /* @__PURE__ */ jsx("span", { "aria-hidden": secondary ? true : void 0, children: value }),
29589
+ secondary ? /* @__PURE__ */ jsxs(Fragment, { children: [
29590
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mx-1.5 text-muted-foreground", children: "·" }),
29591
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-muted-foreground", children: secondary })
29592
+ ] }) : null
29569
29593
  ] });
29570
29594
  }
29571
29595
  function FieldList({ fields }) {
@@ -29608,6 +29632,7 @@ function SnapshotSide({ label, fields }) {
29608
29632
  }
29609
29633
  function AuditLogEntry({
29610
29634
  entry,
29635
+ collectionApiName,
29611
29636
  collectionLabel,
29612
29637
  activityCollectionLabel,
29613
29638
  density,
@@ -29628,7 +29653,7 @@ function AuditLogEntry({
29628
29653
  staleTime: Number.POSITIVE_INFINITY,
29629
29654
  retry: false
29630
29655
  });
29631
- const detailFields = displayFields(entry.details, fieldLabels, showSystemFields) ?? [];
29656
+ const detailFields = displayFields(entry.details, fieldLabels, showSystemFields, { collectionApiName, collectionLabel }) ?? [];
29632
29657
  const recordHref = getRecordHref?.(entry)?.trim();
29633
29658
  const rowPadding = density === "comfortable" ? "py-4" : void 0;
29634
29659
  const summary = activityCollectionLabel ? auditLogSummaryWithCollectionLabel(entry, activityCollectionLabel) : entry.summary;
@@ -42229,6 +42254,7 @@ const errorCopyFor = (status) => {
42229
42254
  function AuditLog({
42230
42255
  collections,
42231
42256
  collectionLabels,
42257
+ activityNouns,
42232
42258
  filters: controlledFilters,
42233
42259
  defaultFilters,
42234
42260
  onFiltersChange,
@@ -42267,7 +42293,7 @@ function AuditLog({
42267
42293
  const fromDateTime = dateTimeInputValue(filterState.since);
42268
42294
  const untilDateTime = dateTimeInputValue(filterState.until);
42269
42295
  const [isExporting, setIsExporting] = useState(false);
42270
- const [exportStatus, setExportStatus] = useState({ key: "", message: "" });
42296
+ const [exportStatus, setExportStatus] = useState({ key: "", message: "", tone: "success" });
42271
42297
  const requestFilters = useMemo(
42272
42298
  () => ({
42273
42299
  event: filterState.event,
@@ -42282,6 +42308,7 @@ function AuditLog({
42282
42308
  const auditLog = useAuditLog(selectedCollections, requestFilters, { pageSize, enabled: !configurationError });
42283
42309
  const columnCount = 3 + Number(showCollectionColumn) + Number(showActorColumn);
42284
42310
  const labelForCollection = (collection) => collectionLabels?.[collection]?.trim() || collection;
42311
+ const activityLabelForCollection = (collection) => activityNouns?.[collection]?.trim() || collectionLabels?.[collection]?.trim();
42285
42312
  const actorOptions = useMemo(() => {
42286
42313
  const actors = /* @__PURE__ */ new Map();
42287
42314
  for (const entry of auditLog.entries) {
@@ -42296,7 +42323,7 @@ function AuditLog({
42296
42323
  const hasDateFilter = Boolean(filterState.since || filterState.until);
42297
42324
  const status = auditLog.error?.status;
42298
42325
  const errorCopy = errorCopyFor(status);
42299
- const exportMessage = exportStatus.key === filterKey ? exportStatus.message : "";
42326
+ const exportStatusForFilters = exportStatus.key === filterKey && exportStatus.message ? exportStatus : null;
42300
42327
  const selectedActor = actorOptions.find(([actorID2]) => actorID2 === actor)?.[1];
42301
42328
  const selectedActorLabel = actor === "all" ? "All actors" : selectedActor ? auditLogActorLabel(selectedActor) : "Selected actor";
42302
42329
  const disabledCollections = auditLog.collectionStatus.filter((collection) => !collection.audit_enabled).map((collection) => labelForCollection(collection.name));
@@ -42318,6 +42345,24 @@ function AuditLog({
42318
42345
  };
42319
42346
  const resetFilters = () => setFilters(normalizeAuditLogFilterState(availableCollections));
42320
42347
  const resetFiltersFromPointer = () => resetFilters();
42348
+ const applyDatePreset = (preset) => {
42349
+ if (preset === "clear") {
42350
+ setFilters({ ...filterState, since: void 0, until: void 0 });
42351
+ return;
42352
+ }
42353
+ const now = /* @__PURE__ */ new Date();
42354
+ if (preset === "today") {
42355
+ const start = new Date(now);
42356
+ start.setHours(0, 0, 0, 0);
42357
+ const end = new Date(now);
42358
+ end.setHours(23, 59, 59, 999);
42359
+ setFilters({ ...filterState, since: start.toISOString(), until: end.toISOString() });
42360
+ return;
42361
+ }
42362
+ const hours = preset === "last-24-hours" ? 24 : 24 * 7;
42363
+ const since = new Date(now.getTime() - hours * 60 * 60 * 1e3);
42364
+ setFilters({ ...filterState, since: since.toISOString(), until: void 0 });
42365
+ };
42321
42366
  const filterChips = [];
42322
42367
  if (selectedCollections.length !== availableCollections.length) {
42323
42368
  const labels = selectedCollections.map(labelForCollection);
@@ -42359,20 +42404,22 @@ function AuditLog({
42359
42404
  const handleExport = async () => {
42360
42405
  const limit = normalizeAuditLogExportLimit(exportMaxRows);
42361
42406
  setIsExporting(true);
42362
- setExportStatus({ key: filterKey, message: "" });
42407
+ setExportStatus({ key: filterKey, message: "", tone: "success" });
42363
42408
  try {
42364
42409
  const result = await fetchRecordAuditLogCsv({ collections: selectedCollections, ...requestFilters }, limit, {
42365
- collectionLabels
42410
+ collectionLabels,
42411
+ activityNouns
42366
42412
  });
42367
42413
  const filename = exportFilename?.trim() || filenameFor(selectedCollections);
42368
42414
  downloadCsv(filename, result.csv);
42369
42415
  const rowText = `${result.count.toLocaleString()} ${result.count === 1 ? "row" : "rows"}`;
42370
42416
  setExportStatus({
42371
42417
  key: filterKey,
42418
+ tone: "success",
42372
42419
  message: `${filename}: exported ${rowText}; ${result.truncated ? `truncated to first ${limit.toLocaleString()} rows` : "not truncated"}; ${hasFilters ? `filters: ${filterSummary}` : "no filters applied"}.`
42373
42420
  });
42374
42421
  } catch {
42375
- setExportStatus({ key: filterKey, message: "Could not export the activity. Try again." });
42422
+ setExportStatus({ key: filterKey, message: "Could not export the activity. Try again.", tone: "error" });
42376
42423
  } finally {
42377
42424
  setIsExporting(false);
42378
42425
  }
@@ -42413,6 +42460,21 @@ function AuditLog({
42413
42460
  )
42414
42461
  ] })
42415
42462
  ] }),
42463
+ exportStatusForFilters ? /* @__PURE__ */ jsxs(
42464
+ "div",
42465
+ {
42466
+ className: cn$2(
42467
+ "flex gap-2 border-b px-5 py-2.5 text-xs",
42468
+ exportStatusForFilters.tone === "success" ? "bg-emerald-50 text-emerald-950" : "bg-rose-50 text-rose-950"
42469
+ ),
42470
+ role: "status",
42471
+ "aria-live": "polite",
42472
+ children: [
42473
+ exportStatusForFilters.tone === "success" ? /* @__PURE__ */ jsx(CircleCheck, { className: "mt-0.5 size-4 shrink-0" }) : /* @__PURE__ */ jsx(CircleAlert, { className: "mt-0.5 size-4 shrink-0" }),
42474
+ /* @__PURE__ */ jsx("p", { children: exportStatusForFilters.message })
42475
+ ]
42476
+ }
42477
+ ) : null,
42416
42478
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-end gap-2 border-b bg-muted/20 px-5 py-3", children: [
42417
42479
  availableCollections.length > 1 ? /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
42418
42480
  /* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Collections" }),
@@ -42486,6 +42548,28 @@ function AuditLog({
42486
42548
  }
42487
42549
  )
42488
42550
  ] }),
42551
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
42552
+ /* @__PURE__ */ jsx(Label, { className: "text-xs text-muted-foreground", children: "Date presets" }),
42553
+ /* @__PURE__ */ jsxs(DropdownMenu, { children: [
42554
+ /* @__PURE__ */ jsxs(
42555
+ DropdownMenuTrigger,
42556
+ {
42557
+ render: /* @__PURE__ */ jsx(Button2, { type: "button", variant: "outline", size: "sm", className: "w-[10rem] justify-start" }),
42558
+ children: [
42559
+ /* @__PURE__ */ jsx(CalendarClock, {}),
42560
+ "Quick range"
42561
+ ]
42562
+ }
42563
+ ),
42564
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
42565
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-24-hours"), children: "Last 24 hours" }),
42566
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("last-7-days"), children: "Last 7 days" }),
42567
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("today"), children: "Today" }),
42568
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
42569
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => applyDatePreset("clear"), children: "Clear date range" })
42570
+ ] })
42571
+ ] })
42572
+ ] }),
42489
42573
  /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
42490
42574
  /* @__PURE__ */ jsx(Label, { htmlFor: eventID, className: "text-xs text-muted-foreground", children: "Event" }),
42491
42575
  /* @__PURE__ */ jsxs(
@@ -42606,23 +42690,27 @@ function AuditLog({
42606
42690
  /* @__PURE__ */ jsx(FunnelX, {}),
42607
42691
  " Reset filters"
42608
42692
  ] }) : void 0
42609
- ) }) }) : auditLog.entries.map((entry) => /* @__PURE__ */ jsx(
42610
- AuditLogEntry,
42611
- {
42612
- entry,
42613
- collectionLabel: labelForCollection(auditLogDetailValue(entry, "Collection")),
42614
- activityCollectionLabel: collectionLabels?.[auditLogDetailValue(entry, "Collection")]?.trim(),
42615
- density,
42616
- showCollectionColumn,
42617
- showActorColumn,
42618
- showSystemFields,
42619
- fieldLabels,
42620
- columnCount,
42621
- getRecordHref,
42622
- onRecordClick
42623
- },
42624
- entry.id
42625
- )) })
42693
+ ) }) }) : auditLog.entries.map((entry) => {
42694
+ const collectionApiName = auditLogDetailValue(entry, "Collection");
42695
+ return /* @__PURE__ */ jsx(
42696
+ AuditLogEntry,
42697
+ {
42698
+ entry,
42699
+ collectionApiName,
42700
+ collectionLabel: labelForCollection(collectionApiName),
42701
+ activityCollectionLabel: activityLabelForCollection(collectionApiName),
42702
+ density,
42703
+ showCollectionColumn,
42704
+ showActorColumn,
42705
+ showSystemFields,
42706
+ fieldLabels,
42707
+ columnCount,
42708
+ getRecordHref,
42709
+ onRecordClick
42710
+ },
42711
+ entry.id
42712
+ );
42713
+ }) })
42626
42714
  ] }),
42627
42715
  auditLog.hasMore ? /* @__PURE__ */ jsx("div", { className: "flex justify-center border-t p-4", children: /* @__PURE__ */ jsxs(
42628
42716
  Button2,
@@ -42637,8 +42725,7 @@ function AuditLog({
42637
42725
  "Load more"
42638
42726
  ]
42639
42727
  }
42640
- ) }) : null,
42641
- /* @__PURE__ */ jsx("p", { className: "min-h-7 px-5 py-1 text-right text-[11px] text-muted-foreground", "aria-live": "polite", children: exportMessage })
42728
+ ) }) : null
42642
42729
  ] });
42643
42730
  }
42644
42731
  function RunDownloadAction({ run }) {
@@ -8,6 +8,8 @@ export type AuditLogProps = {
8
8
  collections: readonly string[];
9
9
  /** Friendly display names keyed by collection API name. */
10
10
  collectionLabels?: Readonly<Record<string, string>>;
11
+ /** Singular activity nouns keyed by collection API name, e.g. "invoice" or "payment". */
12
+ activityNouns?: Readonly<Record<string, string>>;
11
13
  /** Controlled filter state. */
12
14
  filters?: AuditLogFilterState;
13
15
  /** Initial filters when the component manages its own state. */
@@ -45,5 +47,5 @@ export type AuditLogProps = {
45
47
  /** Optional classes for the outer container. */
46
48
  className?: string;
47
49
  };
48
- export declare function AuditLog({ collections, collectionLabels, filters: controlledFilters, defaultFilters, onFiltersChange, pageSize, exportMaxRows, exportFilename, title, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, getRecordHref, onRecordClick, loadingState, emptyState, errorState, className, }: AuditLogProps): import("react/jsx-runtime").JSX.Element;
50
+ export declare function AuditLog({ collections, collectionLabels, activityNouns, filters: controlledFilters, defaultFilters, onFiltersChange, pageSize, exportMaxRows, exportFilename, title, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, getRecordHref, onRecordClick, loadingState, emptyState, errorState, className, }: AuditLogProps): import("react/jsx-runtime").JSX.Element;
49
51
  //# sourceMappingURL=AuditLog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuditLog.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLog.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAA4B,MAAM,OAAO,C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KAAK,SAAS,CAAC;IACzC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA4FF,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,OAAO,EAAE,iBAAiB,EAC1B,cAAc,EACd,eAAe,EACf,QAAa,EACb,aAAa,EACb,cAAc,EACd,KAAkB,EAClB,OAAmB,EACnB,oBAA2B,EAC3B,eAAsB,EACtB,gBAAuB,EACvB,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,SAAS,GACV,EAAE,aAAa,2CAyiBf"}
@@ -2,6 +2,7 @@ import { AuditLogDensity } from './AuditLog';
2
2
  import { AuditLogEntry as AuditLogEntryData } from '../../lib/audit-log';
3
3
  type AuditLogEntryProps = {
4
4
  entry: AuditLogEntryData;
5
+ collectionApiName: string;
5
6
  collectionLabel: string;
6
7
  activityCollectionLabel?: string;
7
8
  density: AuditLogDensity;
@@ -13,6 +14,6 @@ type AuditLogEntryProps = {
13
14
  getRecordHref?: (entry: AuditLogEntryData) => string | undefined;
14
15
  onRecordClick?: (entry: AuditLogEntryData) => void;
15
16
  };
16
- export declare function AuditLogEntry({ entry, collectionLabel, activityCollectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
17
+ export declare function AuditLogEntry({ entry, collectionApiName, collectionLabel, activityCollectionLabel, density, showCollectionColumn, showActorColumn, showSystemFields, fieldLabels, columnCount, getRecordHref, onRecordClick, }: AuditLogEntryProps): import("react/jsx-runtime").JSX.Element;
17
18
  export {};
18
19
  //# sourceMappingURL=AuditLogEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuditLogEntry.d.ts","sourceRoot":"","sources":["../../../src/components/audit-log/AuditLogEntry.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EA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CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,MAAM,GAAG,SAAS,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACpD,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,OAAO,EACP,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,GACd,EAAE,kBAAkB,2CA6HpB"}
@@ -1,4 +1,4 @@
1
- import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "../RecordSheet-B0IaPMZs.js";
1
+ import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "../RecordSheet-BuB-d3iw.js";
2
2
  export {
3
3
  A as AgentChat,
4
4
  a as ArtifactCard,
@@ -1,4 +1,4 @@
1
- import { t as R$1, L as Li, v as At } from "./RecordSheet-B0IaPMZs.js";
1
+ import { t as R$1, L as Li, v as At } from "./RecordSheet-BuB-d3iw.js";
2
2
  import { useContext, useState, useEffect } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  var R = ({ code: s, language: e, raw: t, className: h, startLine: d, lineNumbers: m, ...p }) => {
@@ -1,4 +1,4 @@
1
- import { u, a, b, c } from "../use-automation-run-DmMpzFCS.js";
1
+ import { u, a, b, c } from "../use-automation-run-B2iPUXiG.js";
2
2
  import { u as u2, a as a2, b as b2, c as c2, d, e } from "../use-sql-table-DWHMqSIq.js";
3
3
  export {
4
4
  u as useAgentChat,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "./RecordSheet-B0IaPMZs.js";
2
- import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-DmMpzFCS.js";
1
+ import { A, a, e, j, k, n, o, p, D, q, r, R, T, b, c, d, f, g, h, i, l, u, w, m } from "./RecordSheet-BuB-d3iw.js";
2
+ import { u as u2, a as a2, b as b2, c as c2 } from "./use-automation-run-B2iPUXiG.js";
3
3
  import { u as u3, a as a3, b as b3, c as c3, d as d2, e as e2 } from "./use-sql-table-DWHMqSIq.js";
4
4
  import { B, E, z, b as b4, A as A2, C, D as D2, c as c4, F, G, H, I, g as g2, J, K, L, f as f2, M, O, N, a as a4, h as h2, P, i as i2, Q, R as R2, S, T as T2, U, o as o2, p as p2, d as d3, j as j2, k as k2, l as l2, m as m2, n as n2, q as q2, r as r2, t, u as u4, v, w as w2, V, W, e as e3, x, s, y } from "./automations-EgDXJ43_.js";
5
5
  import { o as o3, f as f3, a as a5, b as b5, c as c5, d as d4, e as e4, g as g3, h as h3, i as i3, j as j3, k as k3, l as l3, m as m3, n as n3, s as s2 } from "./formatters-D4T821Dv.js";
@@ -17,6 +17,7 @@ export type AuditLogField = {
17
17
  label: string;
18
18
  value: string;
19
19
  secondary?: string;
20
+ secondaryLabel?: string;
20
21
  mono?: boolean;
21
22
  code?: boolean;
22
23
  key?: string;
@@ -77,6 +78,7 @@ export type RecordAuditLogCsvResult = {
77
78
  };
78
79
  export type AuditLogCsvOptions = {
79
80
  collectionLabels?: Readonly<Record<string, string>>;
81
+ activityNouns?: Readonly<Record<string, string>>;
80
82
  };
81
83
  export declare const normalizeAuditLogPageSize: (value?: number) => number;
82
84
  export declare const normalizeAuditLogExportLimit: (value?: number) => number;
@@ -1 +1 @@
1
- {"version":3,"file":"audit-log-core.d.ts","sourceRoot":"","sources":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AAU,KAAG,MAA6D,CAAC;AAErH,eAAO,MAAM,4BAA4B,GAAI,cAA8B,KAAG,MACc,CAAC;AAE7F,eAAO,MAAM,kBAAkB,GAAI,OAAO,aAAa,KAAG,MACK,CAAC;AAEhE,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAUxF;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,OAAO,GAAE,OAAO,CAAC,mBAAmB,CAAM,GACzC,mBAAmB,CAcrB;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,wBAAwB,GAAG,MAAM,CAqBhF;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa,EAAE,OAAO,MAAM,KAAG,MACP,CAAC;AAEpE,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,aAAa,EACpB,eAAe,EAAE,MAAM,GACtB,sBAAsB,EAAE,CAe1B;AAmBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,OAAO,GAAE,kBAAuB,GAAG,MAAM,CAsBnG"}
@@ -0,0 +1,4 @@
1
+ import { s } from "./RecordSheet-BuB-d3iw.js";
2
+ export {
3
+ s as Mermaid
4
+ };
package/dist/ui.css CHANGED
@@ -112,13 +112,16 @@
112
112
  --color-emerald-500: oklch(69.6% .17 162.48);
113
113
  --color-emerald-600: oklch(59.6% .145 163.225);
114
114
  --color-emerald-800: oklch(43.2% .095 166.913);
115
+ --color-emerald-950: oklch(26.2% .051 172.552);
115
116
  --color-sky-500: oklch(68.5% .169 237.323);
116
117
  --color-blue-50: oklch(97% .014 254.604);
117
118
  --color-blue-200: oklch(88.2% .059 254.128);
118
119
  --color-blue-600: oklch(54.6% .245 262.881);
119
120
  --color-blue-800: oklch(42.4% .199 265.638);
121
+ --color-rose-50: oklch(96.9% .015 12.422);
120
122
  --color-rose-100: oklch(94.1% .03 12.58);
121
123
  --color-rose-500: oklch(64.5% .246 16.439);
124
+ --color-rose-950: oklch(27.1% .105 12.094);
122
125
  --color-slate-500: oklch(55.4% .046 257.417);
123
126
  --color-slate-800: oklch(27.9% .041 260.031);
124
127
  --color-black: #000;
@@ -612,6 +615,10 @@
612
615
  margin-inline: calc(var(--spacing) * .5);
613
616
  }
614
617
 
618
+ .mx-1\.5 {
619
+ margin-inline: calc(var(--spacing) * 1.5);
620
+ }
621
+
615
622
  .mx-2 {
616
623
  margin-inline: calc(var(--spacing) * 2);
617
624
  }
@@ -991,10 +998,6 @@
991
998
  min-height: calc(var(--spacing) * 0);
992
999
  }
993
1000
 
994
- .min-h-7 {
995
- min-height: calc(var(--spacing) * 7);
996
- }
997
-
998
1001
  .min-h-9 {
999
1002
  min-height: calc(var(--spacing) * 9);
1000
1003
  }
@@ -1111,6 +1114,10 @@
1111
1114
  width: 8.5rem;
1112
1115
  }
1113
1116
 
1117
+ .w-\[10rem\] {
1118
+ width: 10rem;
1119
+ }
1120
+
1114
1121
  .w-\[11rem\] {
1115
1122
  width: 11rem;
1116
1123
  }
@@ -1920,6 +1927,10 @@
1920
1927
  background-color: var(--color-red-50);
1921
1928
  }
1922
1929
 
1930
+ .bg-rose-50 {
1931
+ background-color: var(--color-rose-50);
1932
+ }
1933
+
1923
1934
  .bg-rose-500 {
1924
1935
  background-color: var(--color-rose-500);
1925
1936
  }
@@ -2343,6 +2354,10 @@
2343
2354
  color: var(--color-emerald-800);
2344
2355
  }
2345
2356
 
2357
+ .text-emerald-950 {
2358
+ color: var(--color-emerald-950);
2359
+ }
2360
+
2346
2361
  .text-foreground, .text-foreground\/80 {
2347
2362
  color: var(--foreground);
2348
2363
  }
@@ -2437,6 +2452,10 @@
2437
2452
  color: var(--color-rose-100);
2438
2453
  }
2439
2454
 
2455
+ .text-rose-950 {
2456
+ color: var(--color-rose-950);
2457
+ }
2458
+
2440
2459
  .text-secondary-foreground {
2441
2460
  color: var(--secondary-foreground);
2442
2461
  }
@@ -1019,28 +1019,32 @@ function auditLogSummaryWithCollectionLabel(entry, collectionLabel) {
1019
1019
  ...suffixSegments
1020
1020
  ];
1021
1021
  }
1022
+ const collectionLabelFor = (collection, options = {}) => options.collectionLabels?.[collection]?.trim() || collection;
1023
+ const activityLabelFor = (collection, options = {}) => options.activityNouns?.[collection]?.trim() || options.collectionLabels?.[collection]?.trim() || "";
1022
1024
  const summaryText = (entry, options = {}) => {
1023
1025
  const collection = auditLogDetailValue(entry, "Collection");
1024
- const collectionLabel = collection ? options.collectionLabels?.[collection]?.trim() : "";
1026
+ const collectionLabel = collection ? activityLabelFor(collection, options) : "";
1025
1027
  const summary = collectionLabel ? auditLogSummaryWithCollectionLabel(entry, collectionLabel) : entry.summary;
1026
1028
  return summary.map((segment) => segment.text).join(" ");
1027
1029
  };
1028
1030
  const protectSpreadsheetCell = (value) => /^[\t\r ]*[=+\-@]/.test(value) ? `'${value}` : value;
1029
1031
  const csvCell = (value) => `"${protectSpreadsheetCell(value).replaceAll('"', '""')}"`;
1030
1032
  function buildAuditLogCsv(entries, options = {}) {
1031
- const rows = entries.map(
1032
- (entry) => [
1033
+ const rows = entries.map((entry) => {
1034
+ const collectionApiName = auditLogDetailValue(entry, "Collection");
1035
+ return [
1033
1036
  entry.occurred_at,
1034
- auditLogDetailValue(entry, "Collection"),
1037
+ collectionApiName ? collectionLabelFor(collectionApiName, options) : "",
1038
+ collectionApiName,
1035
1039
  auditLogActorLabel(entry.actor),
1036
1040
  entry.actor.type,
1037
1041
  entry.event,
1038
1042
  auditLogDetailValue(entry, "Record ID"),
1039
1043
  summaryText(entry, options)
1040
- ].map(csvCell).join(",")
1041
- );
1044
+ ].map(csvCell).join(",");
1045
+ });
1042
1046
  return [
1043
- ["time", "collection", "actor", "actor_type", "event", "record_id", "summary"].map(csvCell).join(","),
1047
+ ["time", "collection_label", "collection_api_name", "actor", "actor_type", "event", "record_id", "summary"].map(csvCell).join(","),
1044
1048
  ...rows
1045
1049
  ].join("\n");
1046
1050
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumerahq/ui",
3
- "version": "0.12.0-dev.2",
3
+ "version": "0.12.0-dev.4",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -1,4 +0,0 @@
1
- import { s } from "./RecordSheet-B0IaPMZs.js";
2
- export {
3
- s as Mermaid
4
- };