@adoptai/genui-components 0.1.32 → 0.1.45

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 (175) hide show
  1. package/README.md +5 -0
  2. package/dist/builders/BuilderForm.d.ts +16 -1
  3. package/dist/builders/BuilderForm.d.ts.map +1 -1
  4. package/dist/builders/EscalationCard.d.ts +6 -1
  5. package/dist/builders/EscalationCard.d.ts.map +1 -1
  6. package/dist/builders/FieldRenderer.d.ts +5 -1
  7. package/dist/builders/FieldRenderer.d.ts.map +1 -1
  8. package/dist/builders/FormBuilder.d.ts +7 -1
  9. package/dist/builders/FormBuilder.d.ts.map +1 -1
  10. package/dist/builders/StepperBuilder.d.ts +6 -1
  11. package/dist/builders/StepperBuilder.d.ts.map +1 -1
  12. package/dist/builders/fields.d.ts +5 -1
  13. package/dist/builders/fields.d.ts.map +1 -1
  14. package/dist/builders/resolver.d.ts +11 -0
  15. package/dist/builders/resolver.d.ts.map +1 -1
  16. package/dist/composites/aging-report/resolver.cjs +1 -1
  17. package/dist/composites/aging-report/resolver.cjs.map +1 -1
  18. package/dist/composites/aging-report/resolver.js +1 -1
  19. package/dist/composites/aging-report/resolver.js.map +1 -1
  20. package/dist/composites/alert/resolver.cjs +87 -0
  21. package/dist/composites/alert/resolver.cjs.map +1 -1
  22. package/dist/composites/alert/resolver.js +87 -0
  23. package/dist/composites/alert/resolver.js.map +1 -1
  24. package/dist/composites/audit-trail/resolver.cjs +86 -0
  25. package/dist/composites/audit-trail/resolver.cjs.map +1 -1
  26. package/dist/composites/audit-trail/resolver.js +86 -0
  27. package/dist/composites/audit-trail/resolver.js.map +1 -1
  28. package/dist/composites/balance-sheet/resolver.cjs +1 -1
  29. package/dist/composites/balance-sheet/resolver.cjs.map +1 -1
  30. package/dist/composites/balance-sheet/resolver.js +1 -1
  31. package/dist/composites/balance-sheet/resolver.js.map +1 -1
  32. package/dist/composites/cited-answer/resolver.cjs +86 -0
  33. package/dist/composites/cited-answer/resolver.cjs.map +1 -1
  34. package/dist/composites/cited-answer/resolver.js +86 -0
  35. package/dist/composites/cited-answer/resolver.js.map +1 -1
  36. package/dist/composites/compliance-checklist/resolver.cjs +86 -0
  37. package/dist/composites/compliance-checklist/resolver.cjs.map +1 -1
  38. package/dist/composites/compliance-checklist/resolver.js +86 -0
  39. package/dist/composites/compliance-checklist/resolver.js.map +1 -1
  40. package/dist/composites/connect-integration/resolver.cjs +465 -0
  41. package/dist/composites/connect-integration/resolver.cjs.map +1 -0
  42. package/dist/composites/connect-integration/resolver.js +463 -0
  43. package/dist/composites/connect-integration/resolver.js.map +1 -0
  44. package/dist/composites/document-preview/resolver.cjs +86 -0
  45. package/dist/composites/document-preview/resolver.cjs.map +1 -1
  46. package/dist/composites/document-preview/resolver.js +86 -0
  47. package/dist/composites/document-preview/resolver.js.map +1 -1
  48. package/dist/composites/download-card/resolver.cjs +86 -0
  49. package/dist/composites/download-card/resolver.cjs.map +1 -1
  50. package/dist/composites/download-card/resolver.js +86 -0
  51. package/dist/composites/download-card/resolver.js.map +1 -1
  52. package/dist/composites/engagement-pipeline/resolver.cjs +86 -0
  53. package/dist/composites/engagement-pipeline/resolver.cjs.map +1 -1
  54. package/dist/composites/engagement-pipeline/resolver.js +86 -0
  55. package/dist/composites/engagement-pipeline/resolver.js.map +1 -1
  56. package/dist/composites/entity-card-grid/resolver.cjs +2 -2
  57. package/dist/composites/entity-card-grid/resolver.cjs.map +1 -1
  58. package/dist/composites/entity-card-grid/resolver.js +2 -2
  59. package/dist/composites/entity-card-grid/resolver.js.map +1 -1
  60. package/dist/composites/general-ledger/resolver.cjs +1 -0
  61. package/dist/composites/general-ledger/resolver.cjs.map +1 -1
  62. package/dist/composites/general-ledger/resolver.d.ts.map +1 -1
  63. package/dist/composites/general-ledger/resolver.js +1 -0
  64. package/dist/composites/general-ledger/resolver.js.map +1 -1
  65. package/dist/composites/income-statement/resolver.cjs +1 -1
  66. package/dist/composites/income-statement/resolver.cjs.map +1 -1
  67. package/dist/composites/income-statement/resolver.js +1 -1
  68. package/dist/composites/income-statement/resolver.js.map +1 -1
  69. package/dist/composites/integrations-list/resolver.cjs +511 -0
  70. package/dist/composites/integrations-list/resolver.cjs.map +1 -0
  71. package/dist/composites/integrations-list/resolver.js +509 -0
  72. package/dist/composites/integrations-list/resolver.js.map +1 -0
  73. package/dist/composites/invoice-detail/resolver.cjs +86 -0
  74. package/dist/composites/invoice-detail/resolver.cjs.map +1 -1
  75. package/dist/composites/invoice-detail/resolver.js +86 -0
  76. package/dist/composites/invoice-detail/resolver.js.map +1 -1
  77. package/dist/composites/job-tracker/resolver.cjs +86 -0
  78. package/dist/composites/job-tracker/resolver.cjs.map +1 -1
  79. package/dist/composites/job-tracker/resolver.js +86 -0
  80. package/dist/composites/job-tracker/resolver.js.map +1 -1
  81. package/dist/composites/key-value-list/resolver.cjs +114 -3
  82. package/dist/composites/key-value-list/resolver.cjs.map +1 -1
  83. package/dist/composites/key-value-list/resolver.d.ts.map +1 -1
  84. package/dist/composites/key-value-list/resolver.js +114 -3
  85. package/dist/composites/key-value-list/resolver.js.map +1 -1
  86. package/dist/composites/legal-test-result/resolver.cjs +86 -0
  87. package/dist/composites/legal-test-result/resolver.cjs.map +1 -1
  88. package/dist/composites/legal-test-result/resolver.js +86 -0
  89. package/dist/composites/legal-test-result/resolver.js.map +1 -1
  90. package/dist/composites/news-feed/resolver.cjs +86 -0
  91. package/dist/composites/news-feed/resolver.cjs.map +1 -1
  92. package/dist/composites/news-feed/resolver.js +86 -0
  93. package/dist/composites/news-feed/resolver.js.map +1 -1
  94. package/dist/composites/pipeline-preview/resolver.cjs +926 -0
  95. package/dist/composites/pipeline-preview/resolver.cjs.map +1 -0
  96. package/dist/composites/pipeline-preview/resolver.js +924 -0
  97. package/dist/composites/pipeline-preview/resolver.js.map +1 -0
  98. package/dist/composites/provenance-chain/resolver.cjs +86 -0
  99. package/dist/composites/provenance-chain/resolver.cjs.map +1 -1
  100. package/dist/composites/provenance-chain/resolver.js +86 -0
  101. package/dist/composites/provenance-chain/resolver.js.map +1 -1
  102. package/dist/composites/reconciliation-view/resolver.cjs +90 -32
  103. package/dist/composites/reconciliation-view/resolver.cjs.map +1 -1
  104. package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -1
  105. package/dist/composites/reconciliation-view/resolver.js +91 -33
  106. package/dist/composites/reconciliation-view/resolver.js.map +1 -1
  107. package/dist/composites/stacked-breakdown/resolver.cjs +13 -2
  108. package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -1
  109. package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -1
  110. package/dist/composites/stacked-breakdown/resolver.js +13 -2
  111. package/dist/composites/stacked-breakdown/resolver.js.map +1 -1
  112. package/dist/composites/stat-grid/resolver.cjs +169 -5
  113. package/dist/composites/stat-grid/resolver.cjs.map +1 -1
  114. package/dist/composites/stat-grid/resolver.d.ts.map +1 -1
  115. package/dist/composites/stat-grid/resolver.js +170 -6
  116. package/dist/composites/stat-grid/resolver.js.map +1 -1
  117. package/dist/composites/status-card/resolver.cjs +86 -0
  118. package/dist/composites/status-card/resolver.cjs.map +1 -1
  119. package/dist/composites/status-card/resolver.js +86 -0
  120. package/dist/composites/status-card/resolver.js.map +1 -1
  121. package/dist/composites/tabs-panel/resolver.cjs +86 -0
  122. package/dist/composites/tabs-panel/resolver.cjs.map +1 -1
  123. package/dist/composites/tabs-panel/resolver.js +86 -0
  124. package/dist/composites/tabs-panel/resolver.js.map +1 -1
  125. package/dist/composites/transaction-feed/resolver.cjs +86 -0
  126. package/dist/composites/transaction-feed/resolver.cjs.map +1 -1
  127. package/dist/composites/transaction-feed/resolver.js +86 -0
  128. package/dist/composites/transaction-feed/resolver.js.map +1 -1
  129. package/dist/composites/trial-balance/resolver.cjs +1 -1
  130. package/dist/composites/trial-balance/resolver.cjs.map +1 -1
  131. package/dist/composites/trial-balance/resolver.js +1 -1
  132. package/dist/composites/trial-balance/resolver.js.map +1 -1
  133. package/dist/composites/variance-analysis/resolver.cjs +1 -1
  134. package/dist/composites/variance-analysis/resolver.cjs.map +1 -1
  135. package/dist/composites/variance-analysis/resolver.js +1 -1
  136. package/dist/composites/variance-analysis/resolver.js.map +1 -1
  137. package/dist/composites/workflow-stepper/resolver.cjs +976 -0
  138. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -0
  139. package/dist/composites/workflow-stepper/resolver.d.ts +20 -0
  140. package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -0
  141. package/dist/composites/workflow-stepper/resolver.js +969 -0
  142. package/dist/composites/workflow-stepper/resolver.js.map +1 -0
  143. package/dist/index.cjs +1268 -275
  144. package/dist/index.cjs.map +1 -1
  145. package/dist/index.d.ts +7 -0
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +1105 -120
  148. package/dist/index.js.map +1 -1
  149. package/dist/renderer.cjs +1153 -211
  150. package/dist/renderer.cjs.map +1 -1
  151. package/dist/renderer.js +1015 -73
  152. package/dist/renderer.js.map +1 -1
  153. package/dist/resolver.cjs +1152 -210
  154. package/dist/resolver.cjs.map +1 -1
  155. package/dist/resolver.d.ts.map +1 -1
  156. package/dist/resolver.js +1015 -73
  157. package/dist/resolver.js.map +1 -1
  158. package/dist/schemas/index.cjs +75 -1
  159. package/dist/schemas/index.cjs.map +1 -1
  160. package/dist/schemas/index.d.ts +122 -0
  161. package/dist/schemas/index.d.ts.map +1 -1
  162. package/dist/schemas/index.js +75 -1
  163. package/dist/schemas/index.js.map +1 -1
  164. package/dist/schemas/workflow-stepper.d.ts +122 -0
  165. package/dist/schemas/workflow-stepper.d.ts.map +1 -0
  166. package/dist/shared/FitText.d.ts +22 -0
  167. package/dist/shared/FitText.d.ts.map +1 -0
  168. package/dist/shared/InteractionContext.d.ts +20 -0
  169. package/dist/shared/InteractionContext.d.ts.map +1 -0
  170. package/dist/shared/Markdown.d.ts +2 -1
  171. package/dist/shared/Markdown.d.ts.map +1 -1
  172. package/dist/shared/styles.d.ts +14 -0
  173. package/dist/shared/styles.d.ts.map +1 -0
  174. package/dist/tool-definitions.json +114 -3
  175. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React33, { lazy, useMemo, useContext, createContext, useState, useCallback, useEffect, useRef, Suspense } from 'react';
2
+ import React41, { lazy, createContext, useMemo, useContext, useState, useCallback, useEffect, useRef, useLayoutEffect, Suspense } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import dagre from '@dagrejs/dagre';
5
5
  import { createPortal } from 'react-dom';
@@ -207,6 +207,24 @@ function renderInline(text) {
207
207
  }
208
208
  return parts;
209
209
  }
210
+ function parseTableRow(line) {
211
+ let s = line.trim();
212
+ if (s.startsWith("|")) s = s.slice(1);
213
+ if (s.endsWith("|") && !s.endsWith("\\|")) s = s.slice(0, -1);
214
+ return s.split(new RegExp("(?<!\\\\)\\|")).map((c) => c.trim().replace(/\\\|/g, "|"));
215
+ }
216
+ function isTableSeparator(line) {
217
+ if (!line.includes("-")) return false;
218
+ const cells = parseTableRow(line);
219
+ return cells.length > 0 && cells.every((c) => /^:?-{1,}:?$/.test(c));
220
+ }
221
+ function alignFromSeparator(cell) {
222
+ const left = cell.startsWith(":");
223
+ const right = cell.endsWith(":");
224
+ if (left && right) return "center";
225
+ if (right) return "right";
226
+ return "left";
227
+ }
210
228
  function MarkdownBlock({ content }) {
211
229
  var _a;
212
230
  const lines = content.split("\n");
@@ -337,6 +355,74 @@ function MarkdownBlock({ content }) {
337
355
  );
338
356
  continue;
339
357
  }
358
+ if (trimmed.includes("|") && i + 1 < lines.length && isTableSeparator(lines[i + 1])) {
359
+ const headers = parseTableRow(trimmed);
360
+ const aligns = parseTableRow(lines[i + 1]).map(alignFromSeparator);
361
+ i += 2;
362
+ const rows = [];
363
+ while (i < lines.length) {
364
+ const li = lines[i].trim();
365
+ if (!li || !li.includes("|")) break;
366
+ rows.push(parseTableRow(li));
367
+ i++;
368
+ }
369
+ const colAlign = (idx) => {
370
+ var _a2;
371
+ return (_a2 = aligns[idx]) != null ? _a2 : "left";
372
+ };
373
+ elements.push(
374
+ /* @__PURE__ */ jsx("div", { style: { margin: "6px 0 10px 0", overflowX: "auto" }, children: /* @__PURE__ */ jsxs(
375
+ "table",
376
+ {
377
+ style: {
378
+ borderCollapse: "collapse",
379
+ width: "100%",
380
+ fontSize: "12px",
381
+ lineHeight: 1.4
382
+ },
383
+ children: [
384
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: headers.map((h, idx) => /* @__PURE__ */ jsx(
385
+ "th",
386
+ {
387
+ style: {
388
+ textAlign: colAlign(idx),
389
+ padding: "6px 10px",
390
+ borderBottom: `1px solid ${BORDER}`,
391
+ background: PAPER,
392
+ fontWeight: 600,
393
+ color: MUTED,
394
+ fontSize: "10px",
395
+ textTransform: "uppercase",
396
+ letterSpacing: "0.04em",
397
+ whiteSpace: "nowrap"
398
+ },
399
+ children: renderInline(h)
400
+ },
401
+ idx
402
+ )) }) }),
403
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((cells, rIdx) => /* @__PURE__ */ jsx("tr", { children: headers.map((_, cIdx) => {
404
+ var _a2;
405
+ return /* @__PURE__ */ jsx(
406
+ "td",
407
+ {
408
+ style: {
409
+ textAlign: colAlign(cIdx),
410
+ padding: "6px 10px",
411
+ borderBottom: `1px solid ${BORDER}`,
412
+ color: "var(--foreground)",
413
+ verticalAlign: "top"
414
+ },
415
+ children: renderInline((_a2 = cells[cIdx]) != null ? _a2 : "")
416
+ },
417
+ cIdx
418
+ );
419
+ }) }, rIdx)) })
420
+ ]
421
+ }
422
+ ) }, key++)
423
+ );
424
+ continue;
425
+ }
340
426
  elements.push(
341
427
  /* @__PURE__ */ jsx("p", { style: { margin: "0 0 8px 0", lineHeight: 1.65 }, children: renderInline(trimmed) }, key++)
342
428
  );
@@ -5128,6 +5214,79 @@ var pipelinePreviewTool = {
5128
5214
  required: ["type", "name", "steps"]
5129
5215
  }
5130
5216
  };
5217
+ var workflowStepperSchema = z.object({
5218
+ type: z.literal("workflow-stepper"),
5219
+ id: z.string().optional(),
5220
+ title: z.string(),
5221
+ period: z.string().optional(),
5222
+ badge: z.string().optional(),
5223
+ active_step: z.string().optional(),
5224
+ steps: z.array(
5225
+ z.object({
5226
+ id: z.string(),
5227
+ n: z.number().int().positive().optional(),
5228
+ title: z.string(),
5229
+ sub: z.string().optional(),
5230
+ status: z.enum(["done", "active", "review", "pending", "failed"]),
5231
+ assignees: z.array(
5232
+ z.object({
5233
+ name: z.string(),
5234
+ kind: z.enum(["agent", "human"]),
5235
+ initials: z.string().max(3).optional(),
5236
+ color: z.string().optional(),
5237
+ role: z.string().optional()
5238
+ })
5239
+ ).max(6).optional()
5240
+ })
5241
+ ).min(2).max(12)
5242
+ });
5243
+ var workflowStepperTool = {
5244
+ name: "render_workflow_stepper",
5245
+ description: "Render a recurring-process workflow stepper \u2014 a horizontal strip of sequential step cards (e.g. a monthly close pipeline) with per-step status (done/active/review/pending/failed) and human + agent assignee avatars. Use for org processes with named steps and owners, NOT for generic progress bars or project phase summaries.",
5246
+ input_schema: {
5247
+ type: "object",
5248
+ properties: {
5249
+ type: { type: "string", enum: ["workflow-stepper"] },
5250
+ id: { type: "string", description: "Stable id for update-in-place rendering" },
5251
+ title: { type: "string", description: "Process name, e.g. 'Monthly Close'" },
5252
+ period: { type: "string", description: "Period label, e.g. 'Period 04 \xB7 FY2026'" },
5253
+ badge: { type: "string", description: "Framework/compliance badge, e.g. 'SOX controlled'" },
5254
+ active_step: { type: "string", description: "Id of the currently active step" },
5255
+ steps: {
5256
+ type: "array",
5257
+ minItems: 2,
5258
+ maxItems: 12,
5259
+ items: {
5260
+ type: "object",
5261
+ properties: {
5262
+ id: { type: "string" },
5263
+ n: { type: "number", description: "Step number; defaults to index + 1" },
5264
+ title: { type: "string" },
5265
+ sub: { type: "string", description: "Short status caption, e.g. '7 accounts \xB7 2 exceptions'" },
5266
+ status: { type: "string", enum: ["done", "active", "review", "pending", "failed"] },
5267
+ assignees: {
5268
+ type: "array",
5269
+ maxItems: 6,
5270
+ items: {
5271
+ type: "object",
5272
+ properties: {
5273
+ name: { type: "string" },
5274
+ kind: { type: "string", enum: ["agent", "human"] },
5275
+ initials: { type: "string" },
5276
+ color: { type: "string" },
5277
+ role: { type: "string" }
5278
+ },
5279
+ required: ["name", "kind"]
5280
+ }
5281
+ }
5282
+ },
5283
+ required: ["id", "title", "status"]
5284
+ }
5285
+ }
5286
+ },
5287
+ required: ["type", "title", "steps"]
5288
+ }
5289
+ };
5131
5290
 
5132
5291
  // src/schemas/buildRenderUITool.ts
5133
5292
  function buildRenderUITool(selectedSchemas) {
@@ -5245,7 +5404,8 @@ var schemaRegistry = {
5245
5404
  "scatter-chart": { schema: scatterChartSchema, tool: scatterChartTool },
5246
5405
  "connect-integration": { schema: connectIntegrationSchema, tool: connectIntegrationTool },
5247
5406
  "integrations-list": { schema: integrationsListSchema, tool: integrationsListTool },
5248
- "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool }
5407
+ "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool },
5408
+ "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool }
5249
5409
  };
5250
5410
 
5251
5411
  // src/shared/ColumnSettingsPanel.tsx
@@ -5705,6 +5865,61 @@ function AlertResolver(p) {
5705
5865
 
5706
5866
  // src/composites/stat-grid/resolver.tsx
5707
5867
  init_Markdown();
5868
+ function FitText({ children, max = 22, min = 13, title, className, style }) {
5869
+ const ref = useRef(null);
5870
+ const [size, setSize] = useState(max);
5871
+ useLayoutEffect(() => {
5872
+ const el = ref.current;
5873
+ if (!el) return void 0;
5874
+ const fit = () => {
5875
+ let s = max;
5876
+ el.style.fontSize = `${s}px`;
5877
+ while (s > min && el.scrollWidth > el.clientWidth + 1) {
5878
+ s -= 1;
5879
+ el.style.fontSize = `${s}px`;
5880
+ }
5881
+ setSize(s);
5882
+ };
5883
+ fit();
5884
+ if (typeof ResizeObserver === "undefined") return void 0;
5885
+ const ro = new ResizeObserver(fit);
5886
+ ro.observe(el);
5887
+ return () => ro.disconnect();
5888
+ }, [children, max, min]);
5889
+ return /* @__PURE__ */ jsx(
5890
+ "span",
5891
+ {
5892
+ ref,
5893
+ title,
5894
+ className,
5895
+ style: __spreadValues({
5896
+ display: "block",
5897
+ minWidth: 0,
5898
+ maxWidth: "100%",
5899
+ whiteSpace: "nowrap",
5900
+ overflow: "hidden",
5901
+ textOverflow: "ellipsis",
5902
+ fontSize: `${size}px`
5903
+ }, style),
5904
+ children
5905
+ }
5906
+ );
5907
+ }
5908
+
5909
+ // src/shared/styles.ts
5910
+ var TRUNCATE = {
5911
+ minWidth: 0,
5912
+ overflow: "hidden",
5913
+ textOverflow: "ellipsis",
5914
+ whiteSpace: "nowrap"
5915
+ };
5916
+ var NUMERIC_CELL = {
5917
+ fontVariantNumeric: "tabular-nums",
5918
+ whiteSpace: "nowrap",
5919
+ textAlign: "right"
5920
+ };
5921
+
5922
+ // src/composites/stat-grid/resolver.tsx
5708
5923
  init_ThemeContext();
5709
5924
  var changeColor = (type) => {
5710
5925
  if (type === "positive") return "#15803d";
@@ -5715,15 +5930,28 @@ var cardStyle = {
5715
5930
  border: "1px solid #dedede",
5716
5931
  borderRadius: "0.75rem",
5717
5932
  background: "white",
5718
- padding: "14px"
5933
+ padding: "14px",
5934
+ // Let the card shrink inside the grid track so big values can't push it
5935
+ // wider than its column.
5936
+ minWidth: 0,
5937
+ overflow: "hidden"
5719
5938
  };
5720
5939
  function StatGridResolver(p) {
5721
5940
  var _a;
5722
5941
  const { MUTED: MUTED2 } = useTheme();
5723
- return /* @__PURE__ */ jsx(ComponentActions, { filename: "stat-grid", children: /* @__PURE__ */ jsx("div", { style: { width: "100%", display: "grid", gap: "10px", gridTemplateColumns: "repeat(auto-fill, minmax(140px, 1fr))" }, children: ((_a = p.stats) != null ? _a : []).map((stat, i) => /* @__PURE__ */ jsx("div", { style: cardStyle, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px", padding: "4px 0" }, children: [
5724
- /* @__PURE__ */ jsx("p", { style: { fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, children: stat.label }),
5725
- /* @__PURE__ */ jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "22px", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.01em", lineHeight: 1.1, fontVariantNumeric: "tabular-nums", margin: 0 }, children: stat.value }),
5726
- stat.change && /* @__PURE__ */ jsx("p", { style: { fontSize: "12px", fontWeight: 500, color: changeColor(stat.changeType), fontVariantNumeric: "tabular-nums", margin: 0 }, children: stat.change }),
5942
+ return /* @__PURE__ */ jsx(ComponentActions, { filename: "stat-grid", children: /* @__PURE__ */ jsx("div", { style: { width: "100%", display: "grid", gap: "10px", gridTemplateColumns: "repeat(auto-fill, minmax(min(140px, 100%), 1fr))" }, children: ((_a = p.stats) != null ? _a : []).map((stat, i) => /* @__PURE__ */ jsx("div", { style: cardStyle, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px", padding: "4px 0", minWidth: 0 }, children: [
5943
+ /* @__PURE__ */ jsx("p", { style: __spreadValues({ fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, TRUNCATE), children: stat.label }),
5944
+ /* @__PURE__ */ jsx(
5945
+ FitText,
5946
+ {
5947
+ max: 22,
5948
+ min: 13,
5949
+ title: typeof stat.value === "string" ? stat.value : void 0,
5950
+ style: { fontFamily: "var(--font-serif)", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.01em", lineHeight: 1.1, fontVariantNumeric: "tabular-nums" },
5951
+ children: stat.value
5952
+ }
5953
+ ),
5954
+ stat.change && /* @__PURE__ */ jsx("p", { style: __spreadValues({ fontSize: "12px", fontWeight: 500, color: changeColor(stat.changeType), fontVariantNumeric: "tabular-nums", margin: 0 }, TRUNCATE), children: stat.change }),
5727
5955
  stat.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "11.5px", color: "#888888", lineHeight: 1.4, margin: 0 }, children: /* @__PURE__ */ jsx(Markdown, { inline: true, content: stat.description }) })
5728
5956
  ] }) }, i)) }) });
5729
5957
  }
@@ -5890,17 +6118,17 @@ function SparklineTableResolver(p) {
5890
6118
  // src/composites/heatmap-table/resolver.tsx
5891
6119
  init_theme();
5892
6120
  init_ThemeContext();
5893
- function heatColor(z58) {
5894
- const clamped = Math.max(-3, Math.min(3, z58));
6121
+ function heatColor(z59) {
6122
+ const clamped = Math.max(-3, Math.min(3, z59));
5895
6123
  const abs = Math.abs(clamped);
5896
6124
  const lightness = 95 - abs * 8;
5897
6125
  const hue = clamped >= 0 ? 142 : 0;
5898
6126
  return `hsl(${hue} 60% ${lightness}%)`;
5899
6127
  }
5900
- function heatTextColor(z58) {
5901
- const abs = Math.abs(z58);
5902
- if (abs > 2) return z58 >= 0 ? "#14532d" : "#7f1d1d";
5903
- if (abs > 1) return z58 >= 0 ? "#166534" : "#991b1b";
6128
+ function heatTextColor(z59) {
6129
+ const abs = Math.abs(z59);
6130
+ if (abs > 2) return z59 >= 0 ? "#14532d" : "#7f1d1d";
6131
+ if (abs > 1) return z59 >= 0 ? "#166534" : "#991b1b";
5904
6132
  return "var(--foreground)";
5905
6133
  }
5906
6134
  var th2 = {
@@ -6520,7 +6748,7 @@ function WaterfallChartResolver(p) {
6520
6748
  ] }) });
6521
6749
  }
6522
6750
  init_ThemeContext();
6523
- var FlowGraph2 = React33.lazy(
6751
+ var FlowGraph2 = React41.lazy(
6524
6752
  () => Promise.resolve().then(() => (init_FlowGraph(), FlowGraph_exports)).then((m) => ({ default: m.FlowGraph }))
6525
6753
  );
6526
6754
  function FlowCanvasRenderer({
@@ -6773,7 +7001,7 @@ function TrialBalanceResolver(p) {
6773
7001
  color: balanced ? "#15803d" : "#dc2626"
6774
7002
  }, children: balanced ? "\u2713 Balanced" : "\u2717 Unbalanced" })
6775
7003
  ] }),
6776
- /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
7004
+ /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
6777
7005
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: ["Code", "Account", "Debit", "Credit"].map((h, i) => /* @__PURE__ */ jsx("th", { style: {
6778
7006
  fontSize: "11px",
6779
7007
  fontWeight: 500,
@@ -6794,7 +7022,7 @@ function TrialBalanceResolver(p) {
6794
7022
  gDebit += a.debit;
6795
7023
  gCredit += a.credit;
6796
7024
  });
6797
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
7025
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
6798
7026
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 4, style: {
6799
7027
  padding: "8px 12px",
6800
7028
  fontSize: "12px",
@@ -6951,7 +7179,7 @@ function AgingReportResolver(p) {
6951
7179
  p.asOfDate
6952
7180
  ] })
6953
7181
  ] }),
6954
- /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
7182
+ /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
6955
7183
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
6956
7184
  /* @__PURE__ */ jsx("th", { style: { fontSize: "11px", fontWeight: 500, color: MUTED2, padding: "8px 12px", textAlign: "left", borderBottom: `1px solid ${BORDER4}`, background: PAPER2, textTransform: "uppercase", letterSpacing: "0.02em" }, children: "Entity" }),
6957
7185
  buckets.map((b, i) => /* @__PURE__ */ jsx("th", { style: { fontSize: "11px", fontWeight: 500, color: MUTED2, padding: "8px 12px", textAlign: "right", borderBottom: `1px solid ${BORDER4}`, background: PAPER2, textTransform: "uppercase", letterSpacing: "0.02em", whiteSpace: "nowrap" }, children: b }, i)),
@@ -7008,7 +7236,7 @@ function VarianceAnalysisResolver(p) {
7008
7236
  p.title && /* @__PURE__ */ jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "15px", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.005em" }, children: p.title }),
7009
7237
  p.period && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: p.period })
7010
7238
  ] }),
7011
- /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "480px" }, children: [
7239
+ /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "480px" }, children: [
7012
7240
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: ["Line Item", "Budget", "Actual", "Variance $", "Variance %", ""].map((h, i) => /* @__PURE__ */ jsx("th", { style: {
7013
7241
  fontSize: "11px",
7014
7242
  fontWeight: 500,
@@ -7126,6 +7354,8 @@ function StackedBreakdownResolver(p) {
7126
7354
  alignItems: "center",
7127
7355
  gap: "6px",
7128
7356
  fontSize: "12px",
7357
+ maxWidth: "100%",
7358
+ minWidth: 0,
7129
7359
  color: isVisible(cat.name) ? MUTED2 : "#b3b3b3",
7130
7360
  cursor: "pointer",
7131
7361
  userSelect: "none",
@@ -7137,12 +7367,13 @@ function StackedBreakdownResolver(p) {
7137
7367
  width: "10px",
7138
7368
  height: "10px",
7139
7369
  borderRadius: "2px",
7370
+ flexShrink: 0,
7140
7371
  background: (_a2 = cat.color) != null ? _a2 : PALETTE2[ci % PALETTE2.length],
7141
7372
  display: "inline-block",
7142
7373
  opacity: isVisible(cat.name) ? 1 : 0.3,
7143
7374
  transition: "opacity 0.15s"
7144
7375
  } }),
7145
- cat.name
7376
+ /* @__PURE__ */ jsx("span", { style: TRUNCATE, title: cat.name, children: cat.name })
7146
7377
  ]
7147
7378
  },
7148
7379
  cat.name
@@ -7164,7 +7395,7 @@ function StackedBreakdownResolver(p) {
7164
7395
  ((_b2 = p.periods) != null ? _b2 : []).map((_, pi) => {
7165
7396
  var _a3, _b3;
7166
7397
  const v = pi < ((_a3 = cat.values) != null ? _a3 : []).length ? ((_b3 = cat.values) != null ? _b3 : [])[pi] : 0;
7167
- return /* @__PURE__ */ jsx("td", { style: { padding: "6px 12px", fontSize: "13px", textAlign: "right", fontVariantNumeric: "tabular-nums", borderBottom: `1px solid #f2f2f2`, color: v < 0 ? "#dc2626" : void 0 }, children: v < 0 ? `(${fmt5(Math.abs(v), p.currency)})` : fmt5(v, p.currency) }, pi);
7398
+ return /* @__PURE__ */ jsx("td", { style: { padding: "6px 12px", fontSize: "13px", textAlign: "right", fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap", borderBottom: `1px solid #f2f2f2`, color: v < 0 ? "#dc2626" : void 0 }, children: v < 0 ? `(${fmt5(Math.abs(v), p.currency)})` : fmt5(v, p.currency) }, pi);
7168
7399
  })
7169
7400
  ] }, cat.name);
7170
7401
  }),
@@ -7537,7 +7768,7 @@ function ReconciliationViewResolver(p) {
7537
7768
  {
7538
7769
  style: {
7539
7770
  display: "grid",
7540
- gridTemplateColumns: "repeat(auto-fit, minmax(90px, 1fr))",
7771
+ gridTemplateColumns: "repeat(auto-fit, minmax(min(120px, 100%), 1fr))",
7541
7772
  gap: "0",
7542
7773
  marginBottom: "14px",
7543
7774
  borderRadius: "10px",
@@ -7545,31 +7776,28 @@ function ReconciliationViewResolver(p) {
7545
7776
  overflow: "hidden"
7546
7777
  },
7547
7778
  children: [
7548
- /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px", background: PAPER2 }, children: [
7779
+ /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px", background: PAPER2, minWidth: 0 }, children: [
7549
7780
  /* @__PURE__ */ jsx(
7550
7781
  "div",
7551
7782
  {
7552
- style: {
7783
+ style: __spreadValues({
7553
7784
  fontSize: "10px",
7554
7785
  fontWeight: 500,
7555
7786
  color: MUTED2,
7556
7787
  textTransform: "uppercase",
7557
7788
  letterSpacing: "0.04em",
7558
7789
  marginBottom: "4px"
7559
- },
7790
+ }, TRUNCATE),
7560
7791
  children: sourceA.label
7561
7792
  }
7562
7793
  ),
7563
7794
  /* @__PURE__ */ jsx(
7564
- "div",
7795
+ FitText,
7565
7796
  {
7566
- style: {
7567
- fontSize: "15px",
7568
- fontWeight: 600,
7569
- color: "var(--foreground)",
7570
- fontVariantNumeric: "tabular-nums",
7571
- letterSpacing: "-0.01em"
7572
- },
7797
+ max: 15,
7798
+ min: 11,
7799
+ title: fmt6(balanceA, p.currency),
7800
+ style: { fontWeight: 600, color: "var(--foreground)", fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7573
7801
  children: fmt6(balanceA, p.currency)
7574
7802
  }
7575
7803
  )
@@ -7581,33 +7809,31 @@ function ReconciliationViewResolver(p) {
7581
7809
  padding: "10px 12px",
7582
7810
  background: PAPER2,
7583
7811
  borderLeft: `1px solid ${BORDER4}`,
7584
- borderRight: `1px solid ${BORDER4}`
7812
+ borderRight: `1px solid ${BORDER4}`,
7813
+ minWidth: 0
7585
7814
  },
7586
7815
  children: [
7587
7816
  /* @__PURE__ */ jsx(
7588
7817
  "div",
7589
7818
  {
7590
- style: {
7819
+ style: __spreadValues({
7591
7820
  fontSize: "10px",
7592
7821
  fontWeight: 500,
7593
7822
  color: MUTED2,
7594
7823
  textTransform: "uppercase",
7595
7824
  letterSpacing: "0.04em",
7596
7825
  marginBottom: "4px"
7597
- },
7826
+ }, TRUNCATE),
7598
7827
  children: sourceB.label
7599
7828
  }
7600
7829
  ),
7601
7830
  /* @__PURE__ */ jsx(
7602
- "div",
7831
+ FitText,
7603
7832
  {
7604
- style: {
7605
- fontSize: "15px",
7606
- fontWeight: 600,
7607
- color: "var(--foreground)",
7608
- fontVariantNumeric: "tabular-nums",
7609
- letterSpacing: "-0.01em"
7610
- },
7833
+ max: 15,
7834
+ min: 11,
7835
+ title: fmt6(balanceB, p.currency),
7836
+ style: { fontWeight: 600, color: "var(--foreground)", fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7611
7837
  children: fmt6(balanceB, p.currency)
7612
7838
  }
7613
7839
  )
@@ -7619,7 +7845,8 @@ function ReconciliationViewResolver(p) {
7619
7845
  {
7620
7846
  style: {
7621
7847
  padding: "10px 12px",
7622
- background: difference === 0 ? "#f0fdf4" : "#fef2f2"
7848
+ background: difference === 0 ? "#f0fdf4" : "#fef2f2",
7849
+ minWidth: 0
7623
7850
  },
7624
7851
  children: [
7625
7852
  /* @__PURE__ */ jsxs(
@@ -7659,15 +7886,12 @@ function ReconciliationViewResolver(p) {
7659
7886
  }
7660
7887
  ),
7661
7888
  /* @__PURE__ */ jsx(
7662
- "div",
7889
+ FitText,
7663
7890
  {
7664
- style: {
7665
- fontSize: "15px",
7666
- fontWeight: 700,
7667
- color: difference === 0 ? MATCH_GREEN : DIFF_RED,
7668
- fontVariantNumeric: "tabular-nums",
7669
- letterSpacing: "-0.01em"
7670
- },
7891
+ max: 15,
7892
+ min: 11,
7893
+ title: fmt6(difference, p.currency),
7894
+ style: { fontWeight: 700, color: difference === 0 ? MATCH_GREEN : DIFF_RED, fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7671
7895
  children: fmt6(difference, p.currency)
7672
7896
  }
7673
7897
  )
@@ -8184,10 +8408,10 @@ function useFullscreen(ref) {
8184
8408
  // src/composites/document-preview/resolver.tsx
8185
8409
  init_theme();
8186
8410
  init_ThemeContext();
8187
- var PdfViewer2 = React33.lazy(
8411
+ var PdfViewer2 = React41.lazy(
8188
8412
  () => Promise.resolve().then(() => (init_PdfViewer(), PdfViewer_exports)).then((m) => ({ default: m.PdfViewer }))
8189
8413
  );
8190
- var ExcelViewer2 = React33.lazy(
8414
+ var ExcelViewer2 = React41.lazy(
8191
8415
  () => Promise.resolve().then(() => (init_ExcelViewer(), ExcelViewer_exports)).then((m) => ({ default: m.ExcelViewer }))
8192
8416
  );
8193
8417
  var highlightColors = {
@@ -9143,7 +9367,7 @@ function EngagementPipelineResolver(p) {
9143
9367
  const color = (_a2 = statusColor2[phase.status]) != null ? _a2 : "#d6d3d1";
9144
9368
  const isCurrent = i === activeIdx;
9145
9369
  const size = isCurrent ? 28 : 20;
9146
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
9370
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
9147
9371
  i > 0 && /* @__PURE__ */ jsx(
9148
9372
  "div",
9149
9373
  {
@@ -9471,7 +9695,7 @@ function EntityCardGridResolver(p) {
9471
9695
  {
9472
9696
  style: {
9473
9697
  display: "grid",
9474
- gridTemplateColumns: `repeat(auto-fit, minmax(220px, 1fr))`,
9698
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(220px, 100%), 1fr))`,
9475
9699
  gap: "12px",
9476
9700
  width: "100%"
9477
9701
  },
@@ -9562,7 +9786,7 @@ function EntityCardGridResolver(p) {
9562
9786
  {
9563
9787
  style: {
9564
9788
  display: "grid",
9565
- gridTemplateColumns: item.fields.length > 2 ? "repeat(auto-fit, minmax(90px, 1fr))" : "1fr",
9789
+ gridTemplateColumns: item.fields.length > 2 ? "repeat(auto-fit, minmax(min(90px, 100%), 1fr))" : "1fr",
9566
9790
  gap: "6px 12px",
9567
9791
  borderTop: `1px solid ${BORDER4}`,
9568
9792
  paddingTop: "8px"
@@ -11309,7 +11533,7 @@ function FileCard({
11309
11533
  whiteSpace: "nowrap"
11310
11534
  },
11311
11535
  children: [
11312
- metaTokens.map((t, i) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
11536
+ metaTokens.map((t, i) => /* @__PURE__ */ jsxs(React41.Fragment, { children: [
11313
11537
  i > 0 && /* @__PURE__ */ jsx("span", { style: { color: "#c4c4c4" }, children: "\xB7" }),
11314
11538
  /* @__PURE__ */ jsx("span", { children: t })
11315
11539
  ] }, i)),
@@ -11793,9 +12017,9 @@ function ValueCell({ item }) {
11793
12017
  )
11794
12018
  ] });
11795
12019
  case "currency":
11796
- return /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", fontWeight: 600, fontVariantNumeric: "tabular-nums", marginLeft: "auto" }, children: item.value });
12020
+ return /* @__PURE__ */ jsx("span", { title: item.value, style: __spreadValues({ fontSize: "13px", fontWeight: 600, fontVariantNumeric: "tabular-nums", marginLeft: "auto" }, TRUNCATE), children: item.value });
11797
12021
  default:
11798
- return /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", color: "var(--foreground)" }, children: /* @__PURE__ */ jsx(Markdown, { inline: true, content: item.value }) });
12022
+ return /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", color: "var(--foreground)", minWidth: 0, overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsx(Markdown, { inline: true, content: item.value }) });
11799
12023
  }
11800
12024
  }
11801
12025
  function KVRow({ item, isLast, index }) {
@@ -11828,7 +12052,7 @@ function KVRow({ item, isLast, index }) {
11828
12052
  children: item.key
11829
12053
  }
11830
12054
  ),
11831
- /* @__PURE__ */ jsx("span", { style: { flex: 1, display: "flex", alignItems: "center", gap: "6px" }, children: /* @__PURE__ */ jsx(ValueCell, { item }) }),
12055
+ /* @__PURE__ */ jsx("span", { style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: "6px" }, children: /* @__PURE__ */ jsx(ValueCell, { item }) }),
11832
12056
  item.copyable && /* @__PURE__ */ jsx(CopyButton, { value: item.value, rowHovered: hovered })
11833
12057
  ]
11834
12058
  }
@@ -11884,7 +12108,7 @@ function KeyValueListResolver(p) {
11884
12108
  var _a3;
11885
12109
  return sum + ((_a3 = g.items) != null ? _a3 : []).length;
11886
12110
  }, 0);
11887
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12111
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
11888
12112
  /* @__PURE__ */ jsxs(
11889
12113
  "div",
11890
12114
  {
@@ -12020,7 +12244,7 @@ function BalanceSheetResolver(p) {
12020
12244
  color: balanced ? "#15803d" : "#dc2626"
12021
12245
  }, children: balanced ? "\u2713 A = L + E" : "\u2717 Out of Balance" })
12022
12246
  ] }),
12023
- /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12247
+ /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12024
12248
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
12025
12249
  /* @__PURE__ */ jsx("th", { style: {
12026
12250
  fontSize: "11px",
@@ -12062,7 +12286,7 @@ function BalanceSheetResolver(p) {
12062
12286
  /* @__PURE__ */ jsxs("tbody", { children: [
12063
12287
  ((_p = p.sections) != null ? _p : []).map((section) => {
12064
12288
  var _a2;
12065
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12289
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12066
12290
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, style: {
12067
12291
  padding: "8px 12px",
12068
12292
  fontSize: "12px",
@@ -12075,7 +12299,7 @@ function BalanceSheetResolver(p) {
12075
12299
  }, children: (_a2 = categoryLabels2[section.category]) != null ? _a2 : section.category }) }),
12076
12300
  section.subsections.map((sub, si) => {
12077
12301
  var _a3;
12078
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12302
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12079
12303
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, style: {
12080
12304
  padding: "6px 10px 6px 24px",
12081
12305
  fontSize: "12px",
@@ -12237,7 +12461,7 @@ function IncomeStatementResolver(p) {
12237
12461
  ].filter(Boolean).join(" \xB7 ") })
12238
12462
  ] }),
12239
12463
  p.title && /* @__PURE__ */ jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "15px", fontWeight: 400, color: "var(--foreground)", letterSpacing: "-0.01em", margin: 0 }, children: p.title }),
12240
- /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12464
+ /* @__PURE__ */ jsx("div", { style: { overflowX: "auto", minWidth: 0, borderRadius: "0.75rem", border: `1px solid ${BORDER4}`, boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ jsxs("table", { style: { width: "100%", borderCollapse: "collapse", minWidth: "380px" }, children: [
12241
12465
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
12242
12466
  /* @__PURE__ */ jsx("th", { style: {
12243
12467
  fontSize: "11px",
@@ -12251,7 +12475,7 @@ function IncomeStatementResolver(p) {
12251
12475
  textAlign: "left",
12252
12476
  whiteSpace: "nowrap"
12253
12477
  }, children: "\xA0" }),
12254
- periods.map((period) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12478
+ periods.map((period) => /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12255
12479
  /* @__PURE__ */ jsx("th", { style: {
12256
12480
  fontSize: "11px",
12257
12481
  fontWeight: 500,
@@ -12282,7 +12506,7 @@ function IncomeStatementResolver(p) {
12282
12506
  sections.map((section, si) => {
12283
12507
  var _a2;
12284
12508
  const isSubtotal = section.sectionType === "subtotal";
12285
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12509
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12286
12510
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: colCount, style: {
12287
12511
  padding: "8px 12px",
12288
12512
  fontSize: "12px",
@@ -12313,7 +12537,7 @@ function IncomeStatementResolver(p) {
12313
12537
  var _a4;
12314
12538
  const val = (_a4 = amounts[pi]) != null ? _a4 : 0;
12315
12539
  const isNeg = val < 0;
12316
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12540
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12317
12541
  /* @__PURE__ */ jsx("td", { style: {
12318
12542
  padding: "6px 10px",
12319
12543
  fontSize: "13px",
@@ -12348,7 +12572,7 @@ function IncomeStatementResolver(p) {
12348
12572
  var _a2;
12349
12573
  const val = (_a2 = grossProfit[pi]) != null ? _a2 : 0;
12350
12574
  const isNeg = val < 0;
12351
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12575
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12352
12576
  /* @__PURE__ */ jsx("td", { style: {
12353
12577
  padding: "8px 10px",
12354
12578
  fontSize: "12px",
@@ -12383,7 +12607,7 @@ function IncomeStatementResolver(p) {
12383
12607
  var _a2;
12384
12608
  const val = (_a2 = operatingIncome[pi]) != null ? _a2 : 0;
12385
12609
  const isNeg = val < 0;
12386
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12610
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12387
12611
  /* @__PURE__ */ jsx("td", { style: {
12388
12612
  padding: "8px 10px",
12389
12613
  fontSize: "12px",
@@ -12417,7 +12641,7 @@ function IncomeStatementResolver(p) {
12417
12641
  var _a2;
12418
12642
  const val = (_a2 = netIncome[pi]) != null ? _a2 : 0;
12419
12643
  const isNeg = val < 0;
12420
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12644
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12421
12645
  /* @__PURE__ */ jsx("td", { style: {
12422
12646
  padding: "10px 10px",
12423
12647
  fontSize: "13px",
@@ -12637,7 +12861,7 @@ function CashFlowStatementResolver(p) {
12637
12861
  /* @__PURE__ */ jsxs("tbody", { children: [
12638
12862
  activities.map((activity, ai) => {
12639
12863
  var _a2, _b2, _c2;
12640
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12864
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12641
12865
  ai > 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
12642
12866
  "td",
12643
12867
  {
@@ -13020,6 +13244,7 @@ function GeneralLedgerResolver(p) {
13020
13244
  {
13021
13245
  style: {
13022
13246
  overflowX: "auto",
13247
+ minWidth: 0,
13023
13248
  borderRadius: "0.75rem",
13024
13249
  border: `1px solid ${BORDER4}`,
13025
13250
  boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)"
@@ -16934,6 +17159,729 @@ function PipelinePreviewResolver(p) {
16934
17159
  )
16935
17160
  ] }) });
16936
17161
  }
17162
+ init_ThemeContext();
17163
+ var DEFAULT_INTERACTION = {
17164
+ selectedStepId: null,
17165
+ onStepSelect: void 0
17166
+ };
17167
+ var GenUIInteractionContext = createContext(DEFAULT_INTERACTION);
17168
+ function GenUIInteractionProvider({ value, children }) {
17169
+ return /* @__PURE__ */ jsx(GenUIInteractionContext.Provider, { value, children });
17170
+ }
17171
+ function useGenUIInteraction() {
17172
+ return useContext(GenUIInteractionContext);
17173
+ }
17174
+ var STATUS_COLORS3 = {
17175
+ done: "#15803d",
17176
+ active: "",
17177
+ // filled from theme ACCENT at render time
17178
+ review: "#f59e0b",
17179
+ pending: "#9ca3af",
17180
+ failed: "#dc2626"
17181
+ };
17182
+ var STATUS_LABELS = {
17183
+ done: "Complete",
17184
+ active: "In progress",
17185
+ review: "In review",
17186
+ pending: "Pending",
17187
+ failed: "Failed"
17188
+ };
17189
+ var HUMAN_PALETTE = ["#2563eb", "#0f766e", "#7c3aed", "#b45309", "#be185d", "#4d7c0f"];
17190
+ function hashColor(name) {
17191
+ let h = 0;
17192
+ for (let i = 0; i < name.length; i++) h = h * 31 + name.charCodeAt(i) | 0;
17193
+ return HUMAN_PALETTE[Math.abs(h) % HUMAN_PALETTE.length];
17194
+ }
17195
+ function initialsOf(a) {
17196
+ var _a, _b, _c, _d;
17197
+ if (a.initials) return a.initials.slice(0, 2).toUpperCase();
17198
+ const parts = a.name.trim().split(/\s+/);
17199
+ return (((_b = (_a = parts[0]) == null ? void 0 : _a[0]) != null ? _b : "") + ((_d = (_c = parts[1]) == null ? void 0 : _c[0]) != null ? _d : "")).toUpperCase() || "?";
17200
+ }
17201
+ function SparkMark({ size, color }) {
17202
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
17203
+ "path",
17204
+ {
17205
+ d: "M12 2C12 2 12.8 6.5 14.5 9.5C16.2 12.5 20 13 20 13C20 13 16.2 13.5 14.5 16.5C12.8 19.5 12 24 12 24C12 24 11.2 19.5 9.5 16.5C7.8 13.5 4 13 4 13C4 13 7.8 12.5 9.5 9.5C11.2 6.5 12 2 12 2Z",
17206
+ fill: color
17207
+ }
17208
+ ) });
17209
+ }
17210
+ function AvatarStack({ assignees, accent }) {
17211
+ const shown = assignees.slice(0, 4);
17212
+ const overflow = assignees.length - shown.length;
17213
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
17214
+ shown.map((a, i) => {
17215
+ const isAgent = a.kind === "agent";
17216
+ const bg = isAgent ? `${accent}1f` : a.color || hashColor(a.name);
17217
+ return /* @__PURE__ */ jsx(
17218
+ "div",
17219
+ {
17220
+ title: `${a.name}${a.role ? ` \xB7 ${a.role}` : isAgent ? " \xB7 agent" : ""}`,
17221
+ style: {
17222
+ width: 20,
17223
+ height: 20,
17224
+ borderRadius: "50%",
17225
+ flexShrink: 0,
17226
+ marginLeft: i === 0 ? 0 : -7,
17227
+ zIndex: shown.length - i,
17228
+ display: "flex",
17229
+ alignItems: "center",
17230
+ justifyContent: "center",
17231
+ background: bg,
17232
+ border: "1.5px solid white",
17233
+ boxShadow: isAgent ? `inset 0 0 0 1px ${accent}59` : "none"
17234
+ },
17235
+ children: isAgent ? /* @__PURE__ */ jsx(SparkMark, { size: 11, color: accent }) : /* @__PURE__ */ jsx("span", { style: { fontSize: 8, fontWeight: 700, color: "white", letterSpacing: "0.02em" }, children: initialsOf(a) })
17236
+ },
17237
+ `${a.name}-${i}`
17238
+ );
17239
+ }),
17240
+ overflow > 0 && /* @__PURE__ */ jsxs(
17241
+ "span",
17242
+ {
17243
+ style: {
17244
+ marginLeft: -7,
17245
+ zIndex: 0,
17246
+ width: 20,
17247
+ height: 20,
17248
+ borderRadius: "50%",
17249
+ background: "#f2f2f2",
17250
+ border: "1.5px solid white",
17251
+ display: "flex",
17252
+ alignItems: "center",
17253
+ justifyContent: "center",
17254
+ fontSize: 8,
17255
+ fontWeight: 700,
17256
+ color: "#777777"
17257
+ },
17258
+ children: [
17259
+ "+",
17260
+ overflow
17261
+ ]
17262
+ }
17263
+ )
17264
+ ] });
17265
+ }
17266
+ function IndexDot({ step, index, accent }) {
17267
+ var _a;
17268
+ const n = (_a = step.n) != null ? _a : index + 1;
17269
+ const base = {
17270
+ width: 18,
17271
+ height: 18,
17272
+ borderRadius: "50%",
17273
+ flexShrink: 0,
17274
+ display: "flex",
17275
+ alignItems: "center",
17276
+ justifyContent: "center",
17277
+ fontSize: 10,
17278
+ fontWeight: 700,
17279
+ lineHeight: 1
17280
+ };
17281
+ if (step.status === "done") {
17282
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#15803d", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "\u2713" }) });
17283
+ }
17284
+ if (step.status === "failed") {
17285
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#dc2626", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "!" }) });
17286
+ }
17287
+ if (step.status === "active") {
17288
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: accent, color: "white" }), children: n });
17289
+ }
17290
+ if (step.status === "review") {
17291
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "white", border: "1.5px solid #f59e0b", color: "#b45309" }), children: n });
17292
+ }
17293
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#f2f2f2", color: "#9ca3af" }), children: n });
17294
+ }
17295
+ var CARD_MIN = 132;
17296
+ var CARD_GAP = 16;
17297
+ var AUTO_COMPACT_BELOW = 360;
17298
+ function useContainerWidth(ref) {
17299
+ const [w, setW] = React41.useState(0);
17300
+ React41.useLayoutEffect(() => {
17301
+ const el = ref.current;
17302
+ if (!el || typeof ResizeObserver === "undefined") return;
17303
+ const ro = new ResizeObserver((entries) => {
17304
+ var _a;
17305
+ const cr = (_a = entries[0]) == null ? void 0 : _a.contentRect;
17306
+ if (cr) setW(cr.width);
17307
+ });
17308
+ ro.observe(el);
17309
+ setW(el.getBoundingClientRect().width);
17310
+ return () => ro.disconnect();
17311
+ }, [ref]);
17312
+ return w;
17313
+ }
17314
+ var KEYFRAMES = `
17315
+ @keyframes wfsPulse{0%,100%{opacity:1}50%{opacity:.35}}
17316
+ @keyframes wfsLampPulse{0%,100%{box-shadow:0 0 0 0 var(--wfs-accent,#6366f1)73}50%{box-shadow:0 0 0 4px transparent}}
17317
+ @keyframes wfsRise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
17318
+ @keyframes wfsShimmer{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}
17319
+ .wfs-rise{animation:wfsRise 0.32s cubic-bezier(0.22,1,0.36,1) both}
17320
+ @media (prefers-reduced-motion: reduce){
17321
+ .wfs-anim,.wfs-rise,.wfs-shim{animation:none !important}
17322
+ .wfs-rise{opacity:1 !important;transform:none !important}
17323
+ }`;
17324
+ function ProgressMeter({
17325
+ done,
17326
+ total,
17327
+ accent,
17328
+ muted,
17329
+ loading
17330
+ }) {
17331
+ const pct = total > 0 ? Math.round(done / total * 100) : 0;
17332
+ return /* @__PURE__ */ jsxs(
17333
+ "div",
17334
+ {
17335
+ "data-testid": "workflow-stepper-progress",
17336
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "0 2px 6px" },
17337
+ children: [
17338
+ /* @__PURE__ */ jsx(
17339
+ "span",
17340
+ {
17341
+ style: {
17342
+ fontSize: 10.5,
17343
+ fontWeight: 600,
17344
+ color: muted,
17345
+ fontVariantNumeric: "tabular-nums",
17346
+ letterSpacing: "0.01em",
17347
+ whiteSpace: "nowrap"
17348
+ },
17349
+ children: loading ? "\u2014" : `${done} / ${total} \xB7 ${pct}%`
17350
+ }
17351
+ ),
17352
+ /* @__PURE__ */ jsx(
17353
+ "span",
17354
+ {
17355
+ style: {
17356
+ flex: 1,
17357
+ height: 3,
17358
+ borderRadius: 3,
17359
+ background: "#eceff4",
17360
+ overflow: "hidden",
17361
+ minWidth: 40
17362
+ },
17363
+ children: /* @__PURE__ */ jsx(
17364
+ "span",
17365
+ {
17366
+ className: loading ? "wfs-shim" : void 0,
17367
+ style: {
17368
+ display: "block",
17369
+ height: "100%",
17370
+ width: loading ? "100%" : `${pct}%`,
17371
+ borderRadius: 3,
17372
+ background: loading ? `linear-gradient(90deg, #eceff4, ${accent}55, #eceff4)` : accent,
17373
+ backgroundSize: loading ? "200px 100%" : void 0,
17374
+ animation: loading ? "wfsShimmer 1.1s linear infinite" : void 0,
17375
+ transition: "width 0.45s cubic-bezier(0.22,1,0.36,1)"
17376
+ }
17377
+ }
17378
+ )
17379
+ }
17380
+ )
17381
+ ]
17382
+ }
17383
+ );
17384
+ }
17385
+ function WorkflowStepperRenderer({
17386
+ data,
17387
+ selectedStep = null,
17388
+ onSelectStep,
17389
+ density = "auto",
17390
+ loading = false,
17391
+ loadingSteps = 6,
17392
+ showProgress = true
17393
+ }) {
17394
+ var _a, _b, _c, _d, _e, _f;
17395
+ const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
17396
+ const steps = (_a = data.steps) != null ? _a : [];
17397
+ const activeStepId = (_d = (_c = data.active_step) != null ? _c : (_b = steps.find((s) => s.status === "active")) == null ? void 0 : _b.id) != null ? _d : null;
17398
+ const interactive = typeof onSelectStep === "function";
17399
+ const statusColor3 = (s) => s === "active" ? ACCENT2 : STATUS_COLORS3[s];
17400
+ const doneCount = steps.filter((s) => s.status === "done").length;
17401
+ const rootRef = React41.useRef(null);
17402
+ const containerW = useContainerWidth(rootRef);
17403
+ let resolved = density === "auto" ? "full" : density;
17404
+ if (density === "auto" && containerW > 0) {
17405
+ const needed = steps.length * CARD_MIN + Math.max(0, steps.length - 1) * CARD_GAP;
17406
+ resolved = containerW < AUTO_COMPACT_BELOW || needed > containerW * 1.6 ? "compact" : "full";
17407
+ }
17408
+ const scrollerRef = React41.useRef(null);
17409
+ React41.useEffect(() => {
17410
+ if (resolved !== "full" || loading) return;
17411
+ const sc = scrollerRef.current;
17412
+ if (!sc) return;
17413
+ const el = sc.querySelector(
17414
+ `[data-testid="workflow-stepper-step-${selectedStep != null ? selectedStep : activeStepId}"]`
17415
+ );
17416
+ if (el && sc.scrollWidth > sc.clientWidth) {
17417
+ el.scrollIntoView({ inline: "center", block: "nearest", behavior: "smooth" });
17418
+ }
17419
+ }, [resolved, loading, selectedStep, activeStepId]);
17420
+ const [edges, setEdges] = React41.useState({
17421
+ left: false,
17422
+ right: false
17423
+ });
17424
+ const updateEdges = React41.useCallback(() => {
17425
+ const sc = scrollerRef.current;
17426
+ if (!sc) return;
17427
+ const max = sc.scrollWidth - sc.clientWidth;
17428
+ const sl = sc.scrollLeft;
17429
+ const left = sl > 1;
17430
+ const right = sl < max - 1;
17431
+ setEdges((prev) => prev.left === left && prev.right === right ? prev : { left, right });
17432
+ }, []);
17433
+ React41.useLayoutEffect(() => {
17434
+ if (resolved !== "full" || loading) return;
17435
+ updateEdges();
17436
+ const sc = scrollerRef.current;
17437
+ if (!sc || typeof ResizeObserver === "undefined") return;
17438
+ const ro = new ResizeObserver(updateEdges);
17439
+ ro.observe(sc);
17440
+ return () => ro.disconnect();
17441
+ }, [resolved, loading, steps.length, updateEdges]);
17442
+ const edgeMask = edges.left || edges.right ? `linear-gradient(90deg, ${edges.left ? "transparent 0, #000 14px" : "#000 0"}, ${edges.right ? "#000 calc(100% - 14px), transparent 100%" : "#000 100%"})` : void 0;
17443
+ const themeStyle = { ["--wfs-accent"]: ACCENT2 };
17444
+ if (loading) {
17445
+ const ghosts = Array.from({ length: Math.max(2, loadingSteps) });
17446
+ return /* @__PURE__ */ jsxs("div", { "data-testid": "workflow-stepper-loading", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
17447
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
17448
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: 0, total: 0, accent: ACCENT2, muted: MUTED2, loading: true }),
17449
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "stretch", gap: CARD_GAP, padding: "2px 2px 6px", overflow: "hidden" }, children: ghosts.map((_, i) => /* @__PURE__ */ jsx(
17450
+ "div",
17451
+ {
17452
+ className: "wfs-shim",
17453
+ "aria-hidden": "true",
17454
+ style: {
17455
+ flex: "0 1 168px",
17456
+ minWidth: CARD_MIN,
17457
+ height: 84,
17458
+ borderRadius: 10,
17459
+ border: `1px solid ${BORDER4}`,
17460
+ background: `linear-gradient(90deg, #f4f6f9, #eceff4 40%, #f4f6f9 80%)`,
17461
+ backgroundSize: "200px 100%",
17462
+ animation: "wfsShimmer 1.1s linear infinite",
17463
+ animationDelay: `${i * 0.08}s`
17464
+ }
17465
+ },
17466
+ i
17467
+ )) })
17468
+ ] });
17469
+ }
17470
+ if (resolved === "compact") {
17471
+ const activeStep = (_e = steps.find((s) => s.id === activeStepId)) != null ? _e : null;
17472
+ return /* @__PURE__ */ jsxs(
17473
+ "div",
17474
+ {
17475
+ ref: rootRef,
17476
+ "data-testid": "workflow-stepper-compact",
17477
+ style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle),
17478
+ children: [
17479
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
17480
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
17481
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
17482
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", flexShrink: 0 }, children: steps.map((s, i) => {
17483
+ const sel = selectedStep === s.id;
17484
+ const act = s.status === "active";
17485
+ const done = s.status === "done";
17486
+ const reached = s.status !== "pending";
17487
+ const clickable = interactive && reached;
17488
+ const size = act ? 11 : done ? 9 : 8;
17489
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
17490
+ i > 0 && /* @__PURE__ */ jsx(
17491
+ "span",
17492
+ {
17493
+ "aria-hidden": "true",
17494
+ style: {
17495
+ width: 14,
17496
+ height: 1.5,
17497
+ borderRadius: 1,
17498
+ background: steps[i - 1].status === "done" ? "#15803d" : "#e5e7eb",
17499
+ transition: "background 0.36s ease-out"
17500
+ }
17501
+ }
17502
+ ),
17503
+ /* @__PURE__ */ jsx(
17504
+ "button",
17505
+ {
17506
+ type: "button",
17507
+ disabled: interactive && !reached,
17508
+ "aria-disabled": interactive && !reached ? true : void 0,
17509
+ title: `${s.title} \xB7 ${STATUS_LABELS[s.status]}`,
17510
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(sel ? null : s.id) : void 0,
17511
+ "data-testid": `workflow-stepper-step-${s.id}`,
17512
+ "data-status": s.status,
17513
+ "data-reached": reached || void 0,
17514
+ className: act ? "wfs-anim" : void 0,
17515
+ style: {
17516
+ position: "relative",
17517
+ width: size,
17518
+ height: size,
17519
+ padding: 0,
17520
+ borderRadius: "50%",
17521
+ background: statusColor3(s.status),
17522
+ flexShrink: 0,
17523
+ // border-box so the selected 2px border can't grow the dot
17524
+ // and reflow the rail.
17525
+ boxSizing: "border-box",
17526
+ opacity: reached ? 1 : 0.55,
17527
+ border: sel ? `2px solid ${ACCENT2}` : done ? "none" : "1px solid rgba(255,255,255,0.6)",
17528
+ boxShadow: sel ? "0 0 0 2px #fff" : "none",
17529
+ cursor: clickable ? "pointer" : "default",
17530
+ transition: "width 0.15s, height 0.15s",
17531
+ animation: act ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17532
+ }
17533
+ }
17534
+ )
17535
+ ] }, s.id);
17536
+ }) }),
17537
+ activeStep && /* @__PURE__ */ jsxs(Fragment, { children: [
17538
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { width: 1, height: 16, background: "#e6eaf1", flexShrink: 0 } }),
17539
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: 7, minWidth: 0 }, children: [
17540
+ /* @__PURE__ */ jsx(
17541
+ "span",
17542
+ {
17543
+ "aria-hidden": "true",
17544
+ style: {
17545
+ width: 17,
17546
+ height: 17,
17547
+ borderRadius: "50%",
17548
+ flexShrink: 0,
17549
+ display: "flex",
17550
+ alignItems: "center",
17551
+ justifyContent: "center",
17552
+ fontSize: 9.5,
17553
+ fontWeight: 700,
17554
+ lineHeight: 1,
17555
+ background: activeStep.status === "done" ? "#15803d" : activeStep.status === "review" ? "#fff" : activeStep.status === "failed" ? "#dc2626" : ACCENT2,
17556
+ color: activeStep.status === "review" ? "#b45309" : "#fff",
17557
+ border: activeStep.status === "review" ? "1.5px solid #f59e0b" : "none"
17558
+ },
17559
+ children: activeStep.status === "done" ? "\u2713" : activeStep.status === "failed" ? "!" : (_f = activeStep.n) != null ? _f : steps.findIndex((x) => x.id === activeStep.id) + 1
17560
+ }
17561
+ ),
17562
+ /* @__PURE__ */ jsxs(
17563
+ "span",
17564
+ {
17565
+ style: {
17566
+ fontSize: 12.5,
17567
+ fontWeight: 650,
17568
+ color: "var(--foreground)",
17569
+ letterSpacing: "-0.01em",
17570
+ whiteSpace: "nowrap",
17571
+ overflow: "hidden",
17572
+ textOverflow: "ellipsis",
17573
+ minWidth: 0
17574
+ },
17575
+ children: [
17576
+ activeStep.title,
17577
+ activeStep.sub ? /* @__PURE__ */ jsxs("span", { style: { fontWeight: 400, color: MUTED2 }, children: [
17578
+ " \xB7 ",
17579
+ activeStep.sub
17580
+ ] }) : null
17581
+ ]
17582
+ }
17583
+ )
17584
+ ] })
17585
+ ] })
17586
+ ] })
17587
+ ]
17588
+ }
17589
+ );
17590
+ }
17591
+ return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-testid": "workflow-stepper", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
17592
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
17593
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
17594
+ /* @__PURE__ */ jsxs(
17595
+ "div",
17596
+ {
17597
+ ref: scrollerRef,
17598
+ className: "wfs-scroller",
17599
+ onScroll: updateEdges,
17600
+ style: {
17601
+ display: "flex",
17602
+ alignItems: "stretch",
17603
+ overflowX: "auto",
17604
+ scrollSnapType: "x proximity",
17605
+ padding: "2px 2px 4px",
17606
+ // Thin, always-styled scrollbar (Firefox + Windows/desktop WebKit
17607
+ // where overlay scrollbars aren't available). macOS/mobile show
17608
+ // overlay scrollbars on scroll; harmless either way.
17609
+ scrollbarWidth: "thin",
17610
+ scrollbarColor: "#c2c9d6 transparent",
17611
+ // Edge fade ONLY on the side(s) with hidden content — never when the
17612
+ // row isn't scrollable, so the last card's right edge stays crisp.
17613
+ maskImage: edgeMask,
17614
+ WebkitMaskImage: edgeMask
17615
+ },
17616
+ children: [
17617
+ /* @__PURE__ */ jsx("style", { children: `
17618
+ .wfs-scroller::-webkit-scrollbar{height:8px}
17619
+ .wfs-scroller::-webkit-scrollbar-track{background:transparent}
17620
+ .wfs-scroller::-webkit-scrollbar-thumb{background:#c2c9d6;border-radius:8px;border:2px solid transparent;background-clip:padding-box}
17621
+ .wfs-scroller:hover::-webkit-scrollbar-thumb{background:#aab2c2;background-clip:padding-box}
17622
+ ` }),
17623
+ steps.map((step, i) => {
17624
+ var _a2;
17625
+ const isSelected = selectedStep === step.id;
17626
+ const isActive = step.status === "active";
17627
+ const reached = step.status !== "pending";
17628
+ const clickable = interactive && reached;
17629
+ const color = statusColor3(step.status);
17630
+ const humans = ((_a2 = step.assignees) != null ? _a2 : []).filter((a) => a.kind === "human");
17631
+ const roleCaption = humans.map((h) => h.role).filter(Boolean).slice(0, 2).join(" \xB7 ");
17632
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
17633
+ i > 0 && /* @__PURE__ */ jsx(
17634
+ "div",
17635
+ {
17636
+ style: {
17637
+ width: CARD_GAP,
17638
+ flexShrink: 0,
17639
+ display: "flex",
17640
+ alignItems: "center"
17641
+ },
17642
+ "aria-hidden": "true",
17643
+ children: /* @__PURE__ */ jsx(
17644
+ "div",
17645
+ {
17646
+ style: {
17647
+ width: "100%",
17648
+ height: 1.5,
17649
+ borderRadius: 1,
17650
+ // Fill sweep: completed rails wash green left→right.
17651
+ background: steps[i - 1].status === "done" ? "linear-gradient(90deg, #15803d, #15803d)" : "#e5e7eb",
17652
+ backgroundSize: "100% 100%",
17653
+ transition: "background 0.36s ease-out"
17654
+ }
17655
+ }
17656
+ )
17657
+ }
17658
+ ),
17659
+ /* @__PURE__ */ jsxs(
17660
+ "div",
17661
+ {
17662
+ role: clickable ? "button" : void 0,
17663
+ tabIndex: clickable ? 0 : void 0,
17664
+ "aria-disabled": interactive && !reached ? true : void 0,
17665
+ className: "wfs-rise",
17666
+ "data-testid": `workflow-stepper-step-${step.id}`,
17667
+ "data-status": step.status,
17668
+ "data-selected": isSelected || void 0,
17669
+ "data-reached": reached || void 0,
17670
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id) : void 0,
17671
+ onKeyDown: clickable ? (e) => {
17672
+ if (e.key === "Enter" || e.key === " ") {
17673
+ e.preventDefault();
17674
+ onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id);
17675
+ }
17676
+ } : void 0,
17677
+ onMouseEnter: clickable ? (e) => {
17678
+ e.currentTarget.style.transform = "translateY(-1px)";
17679
+ e.currentTarget.style.boxShadow = "0 3px 10px rgba(15,23,42,0.08)";
17680
+ } : void 0,
17681
+ onMouseLeave: clickable ? (e) => {
17682
+ e.currentTarget.style.transform = "none";
17683
+ e.currentTarget.style.boxShadow = "0 1px 2px rgba(0,0,0,0.04)";
17684
+ } : void 0,
17685
+ style: {
17686
+ position: "relative",
17687
+ flex: "0 1 168px",
17688
+ minWidth: CARD_MIN,
17689
+ maxWidth: 208,
17690
+ scrollSnapAlign: "center",
17691
+ borderRadius: 10,
17692
+ boxSizing: "border-box",
17693
+ // Selection changes border COLOR only (constant 1px width) so
17694
+ // the card never reflows the row on click.
17695
+ border: `1px solid ${isSelected ? ACCENT2 : BORDER4}`,
17696
+ background: isSelected ? `${ACCENT2}0d` : "white",
17697
+ boxShadow: "0 1px 2px rgba(0,0,0,0.04)",
17698
+ padding: "10px 11px",
17699
+ display: "flex",
17700
+ flexDirection: "column",
17701
+ gap: 7,
17702
+ cursor: clickable ? "pointer" : "default",
17703
+ opacity: reached ? 1 : 0.62,
17704
+ transition: "border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s",
17705
+ animationDelay: `${Math.min(i, 10) * 0.04}s`,
17706
+ overflow: "hidden"
17707
+ },
17708
+ children: [
17709
+ isActive && !isSelected && /* @__PURE__ */ jsx(
17710
+ "span",
17711
+ {
17712
+ style: {
17713
+ position: "absolute",
17714
+ left: 0,
17715
+ top: 6,
17716
+ bottom: 6,
17717
+ width: 2,
17718
+ borderRadius: 2,
17719
+ background: ACCENT2
17720
+ }
17721
+ }
17722
+ ),
17723
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
17724
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
17725
+ /* @__PURE__ */ jsx(IndexDot, { step, index: i, accent: ACCENT2 }),
17726
+ /* @__PURE__ */ jsx(
17727
+ "span",
17728
+ {
17729
+ className: isActive ? "wfs-anim" : void 0,
17730
+ style: {
17731
+ width: 6,
17732
+ height: 6,
17733
+ borderRadius: "50%",
17734
+ background: color,
17735
+ animation: isActive ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17736
+ }
17737
+ }
17738
+ )
17739
+ ] }),
17740
+ /* @__PURE__ */ jsx(
17741
+ "span",
17742
+ {
17743
+ style: {
17744
+ fontSize: 9,
17745
+ fontWeight: 600,
17746
+ letterSpacing: "0.05em",
17747
+ textTransform: "uppercase",
17748
+ color
17749
+ },
17750
+ children: STATUS_LABELS[step.status]
17751
+ }
17752
+ )
17753
+ ] }),
17754
+ /* @__PURE__ */ jsxs("div", { style: { minWidth: 0 }, children: [
17755
+ /* @__PURE__ */ jsx(
17756
+ "div",
17757
+ {
17758
+ style: {
17759
+ fontSize: 12.5,
17760
+ fontWeight: 600,
17761
+ color: "var(--foreground)",
17762
+ lineHeight: 1.25,
17763
+ letterSpacing: "-0.01em",
17764
+ overflow: "hidden",
17765
+ textOverflow: "ellipsis",
17766
+ whiteSpace: "nowrap"
17767
+ },
17768
+ children: step.title
17769
+ }
17770
+ ),
17771
+ step.sub && /* @__PURE__ */ jsx(
17772
+ "div",
17773
+ {
17774
+ style: {
17775
+ fontSize: 10.5,
17776
+ color: MUTED2,
17777
+ marginTop: 2,
17778
+ overflow: "hidden",
17779
+ textOverflow: "ellipsis",
17780
+ whiteSpace: "nowrap"
17781
+ },
17782
+ children: step.sub
17783
+ }
17784
+ )
17785
+ ] }),
17786
+ /* @__PURE__ */ jsxs(
17787
+ "div",
17788
+ {
17789
+ style: {
17790
+ display: "flex",
17791
+ alignItems: "center",
17792
+ justifyContent: "space-between",
17793
+ marginTop: "auto",
17794
+ minHeight: 20
17795
+ },
17796
+ children: [
17797
+ step.assignees && step.assignees.length > 0 ? /* @__PURE__ */ jsx(AvatarStack, { assignees: step.assignees, accent: ACCENT2 }) : /* @__PURE__ */ jsx("span", {}),
17798
+ roleCaption && /* @__PURE__ */ jsx(
17799
+ "span",
17800
+ {
17801
+ style: {
17802
+ fontSize: 9,
17803
+ color: "#9ca3af",
17804
+ fontWeight: 500,
17805
+ textAlign: "right",
17806
+ maxWidth: 76,
17807
+ lineHeight: 1.2,
17808
+ overflow: "hidden"
17809
+ },
17810
+ children: roleCaption
17811
+ }
17812
+ )
17813
+ ]
17814
+ }
17815
+ )
17816
+ ]
17817
+ }
17818
+ )
17819
+ ] }, step.id);
17820
+ })
17821
+ ]
17822
+ }
17823
+ )
17824
+ ] });
17825
+ }
17826
+ function WorkflowStepperResolver(p) {
17827
+ var _a;
17828
+ const { selectedStepId, onStepSelect } = useGenUIInteraction();
17829
+ return /* @__PURE__ */ jsx(ComponentActions, { filename: (_a = p.title) != null ? _a : "workflow-stepper", children: /* @__PURE__ */ jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column", gap: 10 }, children: [
17830
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
17831
+ /* @__PURE__ */ jsx(
17832
+ "p",
17833
+ {
17834
+ style: {
17835
+ fontFamily: "var(--font-serif)",
17836
+ fontSize: "15px",
17837
+ fontWeight: 400,
17838
+ color: "var(--foreground)",
17839
+ letterSpacing: "-0.01em",
17840
+ margin: 0
17841
+ },
17842
+ children: p.title
17843
+ }
17844
+ ),
17845
+ p.period && /* @__PURE__ */ jsx(
17846
+ "span",
17847
+ {
17848
+ style: {
17849
+ fontSize: 11,
17850
+ fontWeight: 600,
17851
+ padding: "2px 8px",
17852
+ borderRadius: 9999,
17853
+ background: "#f2f2f2",
17854
+ color: "#777777",
17855
+ fontVariantNumeric: "tabular-nums"
17856
+ },
17857
+ children: p.period
17858
+ }
17859
+ ),
17860
+ p.badge && /* @__PURE__ */ jsx(
17861
+ "span",
17862
+ {
17863
+ style: {
17864
+ fontSize: 11,
17865
+ fontWeight: 600,
17866
+ padding: "2px 8px",
17867
+ borderRadius: 9999,
17868
+ border: "1px solid #dedede",
17869
+ color: "#777777"
17870
+ },
17871
+ children: p.badge
17872
+ }
17873
+ )
17874
+ ] }),
17875
+ /* @__PURE__ */ jsx(
17876
+ WorkflowStepperRenderer,
17877
+ {
17878
+ data: p,
17879
+ selectedStep: selectedStepId,
17880
+ onSelectStep: onStepSelect
17881
+ }
17882
+ )
17883
+ ] }) });
17884
+ }
16937
17885
  function resolveUI(rawPayload) {
16938
17886
  const payload = coercePayload(rawPayload);
16939
17887
  switch (payload.type) {
@@ -17049,6 +17997,8 @@ function resolveUI(rawPayload) {
17049
17997
  return /* @__PURE__ */ jsx(IntegrationsListResolver, __spreadValues({}, payload));
17050
17998
  case "pipeline-preview":
17051
17999
  return /* @__PURE__ */ jsx(PipelinePreviewResolver, __spreadValues({}, payload));
18000
+ case "workflow-stepper":
18001
+ return /* @__PURE__ */ jsx(WorkflowStepperResolver, __spreadValues({}, payload));
17052
18002
  default: {
17053
18003
  return /* @__PURE__ */ jsx(
17054
18004
  "div",
@@ -17372,9 +18322,9 @@ function DocGlyph({ color }) {
17372
18322
  /* @__PURE__ */ jsx("path", { d: "M14 2v6h6" })
17373
18323
  ] });
17374
18324
  }
17375
- function FileUploadField({ field, value, onChange, disabled, onFileUpload, error }) {
18325
+ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error, dense }) {
17376
18326
  const { MUTED: MUTED2, ACCENT: ACCENT2, BORDER: BORDER4, PAPER: PAPER2 } = useTheme();
17377
- const keyRef = React33.useRef(0);
18327
+ const keyRef = React41.useRef(0);
17378
18328
  const [entries, setEntries] = useState(() => {
17379
18329
  const arr = Array.isArray(value) ? value : value && typeof value === "object" ? [value] : [];
17380
18330
  return arr.map((item) => {
@@ -17383,11 +18333,11 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17383
18333
  return { key: keyRef.current += 1, name: (_b = (_a = r.filename) != null ? _a : r.name) != null ? _b : "file", size: r.size, status: "done", result: r };
17384
18334
  });
17385
18335
  });
17386
- const entriesRef = React33.useRef(entries);
18336
+ const entriesRef = React41.useRef(entries);
17387
18337
  entriesRef.current = entries;
17388
18338
  const [dragOver, setDragOver] = useState(false);
17389
- const inputRef = React33.useRef(null);
17390
- React33.useEffect(() => {
18339
+ const inputRef = React41.useRef(null);
18340
+ React41.useEffect(() => {
17391
18341
  ensureFileUploadKeyframes();
17392
18342
  }, []);
17393
18343
  const interactive = !disabled;
@@ -17431,6 +18381,7 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17431
18381
  const removeEntry = (key) => commit(entriesRef.current.filter((e) => e.key !== key));
17432
18382
  const borderColor = dragOver ? ACCENT2 : error ? "#dc2626" : BORDER4;
17433
18383
  const hasFiles = entries.length > 0;
18384
+ const denseRow = !!dense && !hasFiles;
17434
18385
  return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
17435
18386
  /* @__PURE__ */ jsxs(
17436
18387
  "div",
@@ -17452,12 +18403,12 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17452
18403
  onDrop: handleDrop,
17453
18404
  style: {
17454
18405
  display: "flex",
17455
- flexDirection: "column",
18406
+ flexDirection: denseRow ? "row" : "column",
17456
18407
  alignItems: "center",
17457
- justifyContent: "center",
17458
- gap: hasFiles ? "4px" : "7px",
17459
- padding: hasFiles ? "12px 14px" : "18px 14px",
17460
- textAlign: "center",
18408
+ justifyContent: denseRow ? "flex-start" : "center",
18409
+ gap: denseRow ? "9px" : hasFiles ? "4px" : "7px",
18410
+ padding: denseRow ? "9px 12px" : hasFiles ? "12px 14px" : "18px 14px",
18411
+ textAlign: denseRow ? "left" : "center",
17461
18412
  border: `1.5px dashed ${borderColor}`,
17462
18413
  borderRadius: "0.75rem",
17463
18414
  background: dragOver ? `${ACCENT2}0d` : PAPER2,
@@ -17470,11 +18421,11 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17470
18421
  },
17471
18422
  children: [
17472
18423
  /* @__PURE__ */ jsx(UploadGlyph, { color: dragOver ? ACCENT2 : MUTED2 }),
17473
- /* @__PURE__ */ jsxs("span", { style: { fontSize: "12.5px", color: "var(--foreground)" }, children: [
18424
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: denseRow ? "12px" : "12.5px", color: "var(--foreground)" }, children: [
17474
18425
  /* @__PURE__ */ jsx("span", { style: { color: ACCENT2, fontWeight: 600 }, children: hasFiles ? "Add more files" : "Click to upload" }),
17475
18426
  /* @__PURE__ */ jsx("span", { style: { color: MUTED2 }, children: " or drag and drop" })
17476
18427
  ] }),
17477
- !hasFiles && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: hint }),
18428
+ !hasFiles && !denseRow && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: hint }),
17478
18429
  /* @__PURE__ */ jsx("input", { ref: inputRef, type: "file", multiple: true, accept, onChange: handleInput, disabled: !interactive, style: { display: "none" }, tabIndex: -1 })
17479
18430
  ]
17480
18431
  }
@@ -17512,7 +18463,7 @@ var FIELD_REGISTRY = {
17512
18463
  checkbox: CheckboxField,
17513
18464
  file_upload: FileUploadField
17514
18465
  };
17515
- function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload }) {
18466
+ function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload, dense }) {
17516
18467
  const { MUTED: MUTED2 } = useTheme();
17517
18468
  const FieldComp = FIELD_REGISTRY[field.field_type] || FIELD_REGISTRY.text;
17518
18469
  return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "3px" }, children: [
@@ -17520,12 +18471,12 @@ function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload }
17520
18471
  field.label,
17521
18472
  field.required && /* @__PURE__ */ jsx("span", { style: { color: "#dc2626", marginLeft: "2px" }, children: "*" })
17522
18473
  ] }),
17523
- field.description && /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: MUTED2, lineHeight: 1.4 }, children: field.description }),
17524
- /* @__PURE__ */ jsx(FieldComp, { field, value, onChange, disabled, error, onFileUpload: field.field_type === "file_upload" ? onFileUpload : void 0 }),
18474
+ field.description && !dense && /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: MUTED2, lineHeight: 1.4 }, children: field.description }),
18475
+ /* @__PURE__ */ jsx(FieldComp, { field, value, onChange, disabled, error, dense, onFileUpload: field.field_type === "file_upload" ? onFileUpload : void 0 }),
17525
18476
  error && /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: "#dc2626", fontWeight: 500, marginTop: "1px" }, children: error })
17526
18477
  ] });
17527
18478
  }
17528
- var SlotErrorBoundary = class extends React33.Component {
18479
+ var SlotErrorBoundary = class extends React41.Component {
17529
18480
  constructor(props) {
17530
18481
  super(props);
17531
18482
  this.state = { hasError: false };
@@ -17704,20 +18655,21 @@ function S3(t) {
17704
18655
  }
17705
18656
  };
17706
18657
  }
17707
- function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload }) {
18658
+ function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload, dense, hideActions }) {
17708
18659
  var _a;
17709
18660
  const t = useTheme();
17710
18661
  const S4 = useMemo(() => makeStyles(t), [t]);
17711
18662
  const block = builder.blocks[0];
17712
18663
  if (!block) return null;
17713
18664
  if (disabled) return /* @__PURE__ */ jsx(BuilderRecap, { builder, state });
17714
- return /* @__PURE__ */ jsxs("div", { style: S4.card, children: [
17715
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
18665
+ const containerStyle = dense ? { display: "flex", flexDirection: "column", gap: "12px" } : S4.card;
18666
+ return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
18667
+ dense ? builder.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "12px", color: t.MUTED, lineHeight: 1.45, margin: 0 }, children: builder.description }) : /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
17716
18668
  /* @__PURE__ */ jsx("p", { style: S4.title, children: builder.title }),
17717
18669
  builder.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "12px", color: t.MUTED, lineHeight: 1.45, margin: 0 }, children: builder.description })
17718
18670
  ] }),
17719
18671
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsx(ContextSlot, { payload: block.context }),
17720
- /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsx(
18672
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: dense ? "8px" : "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsx(
17721
18673
  FieldRenderer,
17722
18674
  {
17723
18675
  field,
@@ -17725,15 +18677,16 @@ function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUploa
17725
18677
  onChange: (v) => state.setFieldValue(block.id, field.name, v),
17726
18678
  disabled,
17727
18679
  error: state.getError(block.id, field.name),
18680
+ dense,
17728
18681
  onFileUpload
17729
18682
  },
17730
18683
  `${block.id}:${field.name}`
17731
18684
  )) }),
17732
- !disabled ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "4px" }, children: [
18685
+ hideActions ? null : /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "4px" }, children: [
17733
18686
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
17734
18687
  onCancel && /* @__PURE__ */ jsx("button", { type: "button", onClick: onCancel, style: S4.cancelBtn, children: builder.cancel_label || "Cancel" }),
17735
18688
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSubmit, style: S4.submitBtn, children: builder.submit_label || "Submit" })
17736
- ] }) : /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "4px 0" }, children: "Submitted" })
18689
+ ] })
17737
18690
  ] });
17738
18691
  }
17739
18692
  function makeStyles(t) {
@@ -17790,7 +18743,7 @@ function makeStyles(t) {
17790
18743
 
17791
18744
  // src/builders/StepperBuilder.tsx
17792
18745
  init_ThemeContext();
17793
- function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload }) {
18746
+ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload, dense }) {
17794
18747
  var _a;
17795
18748
  const t = useTheme();
17796
18749
  const S4 = useMemo(() => makeStyles2(t), [t]);
@@ -17806,14 +18759,16 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17806
18759
  if (state.validateBlock(idx)) state.setCurrentBlock(idx + 1);
17807
18760
  };
17808
18761
  const handleBack = () => state.setCurrentBlock(Math.max(idx - 1, 0));
17809
- return /* @__PURE__ */ jsxs("div", { style: disabled ? __spreadValues(__spreadValues({}, S4.card), S4.inert) : S4.card, children: [
18762
+ const cardStyle2 = dense ? { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, width: "100%", minWidth: 0, boxSizing: "border-box", overflow: "hidden" } : S4.card;
18763
+ const headerStyle = dense ? { flexShrink: 0, padding: "0 0 10px" } : S4.header;
18764
+ return /* @__PURE__ */ jsxs("div", { style: cardStyle2, children: [
17810
18765
  /* @__PURE__ */ jsx("style", { children: "@keyframes agStepFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}" }),
17811
- /* @__PURE__ */ jsxs("div", { style: S4.header, children: [
17812
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
18766
+ /* @__PURE__ */ jsxs("div", { style: headerStyle, children: [
18767
+ !dense && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
17813
18768
  /* @__PURE__ */ jsx("p", { style: S4.title, children: builder.title }),
17814
18769
  builder.description && /* @__PURE__ */ jsx("p", { style: S4.subtitle, children: builder.description })
17815
18770
  ] }),
17816
- !disabled && total > 1 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginTop: "10px" }, children: [
18771
+ !disabled && total > 1 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginTop: dense ? 0 : "10px" }, children: [
17817
18772
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "baseline", justifyContent: "space-between", gap: "10px" }, children: [
17818
18773
  /* @__PURE__ */ jsx("span", { style: S4.currentTitle, children: (block == null ? void 0 : block.title) || `Step ${idx + 1}` }),
17819
18774
  /* @__PURE__ */ jsxs("span", { style: S4.stepCount, children: [
@@ -17826,7 +18781,7 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17826
18781
  /* @__PURE__ */ jsx("div", { style: S4.progressTrack, role: "progressbar", "aria-valuenow": pct, "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, S4.progressFill), { width: `${pct}%` }) }) })
17827
18782
  ] })
17828
18783
  ] }),
17829
- /* @__PURE__ */ jsx("div", { style: S4.body, children: block && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px", animation: "agStepFade 0.22s ease" }, children: [
18784
+ /* @__PURE__ */ jsx("div", { style: dense ? __spreadProps(__spreadValues({}, S4.body), { padding: "12px 0" }) : S4.body, children: block && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "12px", animation: "agStepFade 0.22s ease" }, children: [
17830
18785
  block.description && /* @__PURE__ */ jsx("div", { style: S4.blockDesc, children: block.description }),
17831
18786
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsx(ContextSlot, { payload: block.context }),
17832
18787
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsx(
@@ -17837,12 +18792,13 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17837
18792
  onChange: (v) => state.setFieldValue(block.id, field.name, v),
17838
18793
  disabled,
17839
18794
  error: state.getError(block.id, field.name),
18795
+ dense,
17840
18796
  onFileUpload
17841
18797
  },
17842
18798
  `${block.id}:${field.name}`
17843
18799
  )) })
17844
18800
  ] }, idx) }),
17845
- !disabled ? /* @__PURE__ */ jsxs("div", { style: S4.footer, children: [
18801
+ !disabled ? /* @__PURE__ */ jsxs("div", { style: dense ? __spreadProps(__spreadValues({}, S4.footer), { borderTop: "none", background: "transparent", padding: "10px 0 0" }) : S4.footer, children: [
17846
18802
  !isFirst && /* @__PURE__ */ jsx("button", { type: "button", onClick: handleBack, style: S4.cancelBtn, children: "Back" }),
17847
18803
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
17848
18804
  onCancel && /* @__PURE__ */ jsx("button", { type: "button", onClick: onCancel, style: S4.cancelBtn, children: builder.cancel_label || "Cancel" }),
@@ -17966,21 +18922,22 @@ function makeStyles2(t) {
17966
18922
 
17967
18923
  // src/builders/EscalationCard.tsx
17968
18924
  init_ThemeContext();
17969
- function EscalationCard({ builder, state, onSubmit, disabled, onFileUpload }) {
18925
+ function EscalationCard({ builder, state, onSubmit, disabled, onFileUpload, hideActions, dense }) {
17970
18926
  var _a;
17971
18927
  const t = useTheme();
17972
18928
  const S4 = useMemo(() => makeStyles3(t), [t]);
17973
18929
  const block = builder.blocks[0];
17974
18930
  if (!block) return null;
17975
18931
  if (disabled) return /* @__PURE__ */ jsx(BuilderRecap, { builder, state });
17976
- return /* @__PURE__ */ jsxs("div", { style: S4.card, children: [
17977
- builder.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "13px", color: "var(--foreground)", lineHeight: 1.45, margin: 0 }, children: builder.description }),
18932
+ const containerStyle = dense ? { display: "flex", flexDirection: "column", gap: "10px" } : S4.card;
18933
+ return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
18934
+ builder.description && /* @__PURE__ */ jsx("p", { style: { fontSize: dense ? "12px" : "13px", color: dense ? t.MUTED : "var(--foreground)", lineHeight: 1.45, margin: 0 }, children: builder.description }),
17978
18935
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsx(ContextSlot, { payload: block.context }),
17979
- /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsx(FieldRenderer, { field, value: state.getValue(block.id, field.name), onChange: (v) => state.setFieldValue(block.id, field.name, v), disabled, error: state.getError(block.id, field.name), onFileUpload }, `${block.id}:${field.name}`)) }),
17980
- !disabled ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "2px" }, children: [
18936
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: dense ? "8px" : "10px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsx(FieldRenderer, { field, value: state.getValue(block.id, field.name), onChange: (v) => state.setFieldValue(block.id, field.name, v), disabled, error: state.getError(block.id, field.name), onFileUpload, dense }, `${block.id}:${field.name}`)) }),
18937
+ disabled ? /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "2px 0" }, children: "Submitted" }) : hideActions ? null : /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", paddingTop: "2px" }, children: [
17981
18938
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
17982
18939
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSubmit, style: S4.continueBtn, children: builder.submit_label || "Continue" })
17983
- ] }) : /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "2px 0" }, children: "Submitted" })
18940
+ ] })
17984
18941
  ] });
17985
18942
  }
17986
18943
  function makeStyles3(t) {
@@ -18114,24 +19071,47 @@ function useBuilderState(blocks) {
18114
19071
  isMultiBlock
18115
19072
  };
18116
19073
  }
18117
- function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUpload }) {
19074
+ function BuilderFormResolver({
19075
+ builder,
19076
+ onSubmit,
19077
+ onCancel,
19078
+ disabled,
19079
+ onFileUpload,
19080
+ onChange,
19081
+ submitRef,
19082
+ hideActions,
19083
+ dense
19084
+ }) {
18118
19085
  const state = useBuilderState(builder.blocks);
18119
19086
  const kind = builder.builder_kind || "form";
18120
- const handleSubmit = useCallback(() => {
18121
- if (disabled) return;
18122
- if (!state.validateAll()) return;
19087
+ const buildSubmission = useCallback(() => {
18123
19088
  const blocks = (builder.blocks || []).map((b) => ({
18124
19089
  id: b.id,
18125
19090
  title: b.title,
18126
19091
  values: Object.fromEntries((b.fields || []).map((f) => [f.name, state.getValue(b.id, f.name)]))
18127
19092
  }));
18128
- const submission = __spreadValues({
19093
+ return __spreadValues({
18129
19094
  builder_id: builder.builder_id,
18130
19095
  builder_kind: kind,
18131
19096
  blocks
18132
19097
  }, blocks.length === 1 ? { values: blocks[0].values } : {});
18133
- onSubmit(submission);
18134
- }, [disabled, state, onSubmit, builder, kind]);
19098
+ }, [builder, kind, state.getValue]);
19099
+ const handleSubmit = useCallback(() => {
19100
+ if (disabled) return;
19101
+ if (!state.validateAll()) return;
19102
+ onSubmit(buildSubmission());
19103
+ }, [disabled, state.validateAll, onSubmit, buildSubmission]);
19104
+ useEffect(() => {
19105
+ if (!onChange) return;
19106
+ onChange(buildSubmission());
19107
+ }, [onChange, state.values]);
19108
+ useEffect(() => {
19109
+ if (!submitRef) return;
19110
+ submitRef.current = handleSubmit;
19111
+ return () => {
19112
+ submitRef.current = null;
19113
+ };
19114
+ }, [submitRef, handleSubmit]);
18135
19115
  switch (kind) {
18136
19116
  case "stepper":
18137
19117
  return /* @__PURE__ */ jsx(
@@ -18142,7 +19122,8 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18142
19122
  onSubmit: handleSubmit,
18143
19123
  onCancel,
18144
19124
  disabled,
18145
- onFileUpload
19125
+ onFileUpload,
19126
+ dense
18146
19127
  }
18147
19128
  );
18148
19129
  case "escalation":
@@ -18153,7 +19134,9 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18153
19134
  state,
18154
19135
  onSubmit: handleSubmit,
18155
19136
  disabled,
18156
- onFileUpload
19137
+ onFileUpload,
19138
+ hideActions,
19139
+ dense
18157
19140
  }
18158
19141
  );
18159
19142
  default:
@@ -18165,13 +19148,15 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18165
19148
  onSubmit: handleSubmit,
18166
19149
  onCancel,
18167
19150
  disabled,
18168
- onFileUpload
19151
+ onFileUpload,
19152
+ dense,
19153
+ hideActions
18169
19154
  }
18170
19155
  );
18171
19156
  }
18172
19157
  }
18173
19158
  function resolveBuilder(payload, callbacks) {
18174
- return React33.createElement(BuilderFormResolver, __spreadValues({
19159
+ return React41.createElement(BuilderFormResolver, __spreadValues({
18175
19160
  builder: payload
18176
19161
  }, callbacks));
18177
19162
  }
@@ -18179,6 +19164,6 @@ function resolveBuilder(payload, callbacks) {
18179
19164
  // src/index.ts
18180
19165
  init_Markdown();
18181
19166
 
18182
- export { ACCENT, ACCENT_SOFT, AgingReportResolver, AlertResolver, AllocationDonutResolver, AreaChartResolver, AuditTrailResolver, BORDER, BUILDER_FIELD_TYPES, BuilderFormResolver, BuilderRecap, CHART_PALETTE, ComparativeBarChartResolver, ComplianceChecklistResolver, ComponentActions, ContextSlot, DEFAULT_TOKENS, DataTableResolver, DocumentPreviewResolver, EngagementPipelineResolver, FIELD_REGISTRY, FieldRenderer, FileCard, FlowCanvasRenderer, FlowCanvasResolver, GenUIRenderer, GenUIThemeProvider, GroupedTableResolver, HeatmapTableResolver, JournalEntryResolver, LegalTestResultResolver, MUTED, Markdown, NewsFeedResolver, PAPER, PreviewHost, PreviewModal, ProvenanceChainResolver, ReconciliationViewResolver, SECONDARY, ScreenerTableResolver, SearchResultsResolver, SparklineTableResolver, StackedBreakdownResolver, StatGridResolver, StatusCardResolver, TabsPanelResolver, TrialBalanceResolver, VarianceAnalysisResolver, WaterfallChartResolver, buildRenderUITool, builderBlockSchema, builderFieldSchema, builderSchema, coercePayload, downloadCSV, fileTypeMeta, formatExpiry, isExpirySoon, isPreviewable, previewKindFor, resolveBuilder, resolveUI, schemaRegistry, useBuilderState, useTheme, validateBuilderPayload, validatePayload };
19167
+ export { ACCENT, ACCENT_SOFT, AgingReportResolver, AlertResolver, AllocationDonutResolver, AreaChartResolver, AuditTrailResolver, BORDER, BUILDER_FIELD_TYPES, BuilderFormResolver, BuilderRecap, CHART_PALETTE, ComparativeBarChartResolver, ComplianceChecklistResolver, ComponentActions, ContextSlot, DEFAULT_INTERACTION, DEFAULT_TOKENS, DataTableResolver, DocumentPreviewResolver, EngagementPipelineResolver, FIELD_REGISTRY, FieldRenderer, FileCard, FitText, FlowCanvasRenderer, FlowCanvasResolver, GenUIInteractionProvider, GenUIRenderer, GenUIThemeProvider, GroupedTableResolver, HeatmapTableResolver, JournalEntryResolver, LegalTestResultResolver, MUTED, Markdown, NUMERIC_CELL, NewsFeedResolver, PAPER, PreviewHost, PreviewModal, ProvenanceChainResolver, ReconciliationViewResolver, SECONDARY, ScreenerTableResolver, SearchResultsResolver, SparklineTableResolver, StackedBreakdownResolver, StatGridResolver, StatusCardResolver, TRUNCATE, TabsPanelResolver, TrialBalanceResolver, VarianceAnalysisResolver, WaterfallChartResolver, WorkflowStepperRenderer, WorkflowStepperResolver, buildRenderUITool, builderBlockSchema, builderFieldSchema, builderSchema, coercePayload, downloadCSV, fileTypeMeta, formatExpiry, isExpirySoon, isPreviewable, previewKindFor, resolveBuilder, resolveUI, schemaRegistry, useBuilderState, useGenUIInteraction, useTheme, validateBuilderPayload, validatePayload };
18183
19168
  //# sourceMappingURL=index.js.map
18184
19169
  //# sourceMappingURL=index.js.map