@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/resolver.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import React33, { lazy, createContext, useState, useCallback, useEffect, useRef, useMemo, useContext, Suspense } from 'react';
2
+ import React41, { lazy, createContext, useState, useCallback, useEffect, useRef, useMemo, useContext, Suspense, useLayoutEffect } 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';
@@ -200,6 +200,24 @@ function renderInline(text) {
200
200
  }
201
201
  return parts;
202
202
  }
203
+ function parseTableRow(line) {
204
+ let s = line.trim();
205
+ if (s.startsWith("|")) s = s.slice(1);
206
+ if (s.endsWith("|") && !s.endsWith("\\|")) s = s.slice(0, -1);
207
+ return s.split(new RegExp("(?<!\\\\)\\|")).map((c) => c.trim().replace(/\\\|/g, "|"));
208
+ }
209
+ function isTableSeparator(line) {
210
+ if (!line.includes("-")) return false;
211
+ const cells = parseTableRow(line);
212
+ return cells.length > 0 && cells.every((c) => /^:?-{1,}:?$/.test(c));
213
+ }
214
+ function alignFromSeparator(cell) {
215
+ const left = cell.startsWith(":");
216
+ const right = cell.endsWith(":");
217
+ if (left && right) return "center";
218
+ if (right) return "right";
219
+ return "left";
220
+ }
203
221
  function MarkdownBlock({ content }) {
204
222
  var _a;
205
223
  const lines = content.split("\n");
@@ -330,6 +348,74 @@ function MarkdownBlock({ content }) {
330
348
  );
331
349
  continue;
332
350
  }
351
+ if (trimmed.includes("|") && i + 1 < lines.length && isTableSeparator(lines[i + 1])) {
352
+ const headers = parseTableRow(trimmed);
353
+ const aligns = parseTableRow(lines[i + 1]).map(alignFromSeparator);
354
+ i += 2;
355
+ const rows = [];
356
+ while (i < lines.length) {
357
+ const li = lines[i].trim();
358
+ if (!li || !li.includes("|")) break;
359
+ rows.push(parseTableRow(li));
360
+ i++;
361
+ }
362
+ const colAlign = (idx) => {
363
+ var _a2;
364
+ return (_a2 = aligns[idx]) != null ? _a2 : "left";
365
+ };
366
+ elements.push(
367
+ /* @__PURE__ */ jsx("div", { style: { margin: "6px 0 10px 0", overflowX: "auto" }, children: /* @__PURE__ */ jsxs(
368
+ "table",
369
+ {
370
+ style: {
371
+ borderCollapse: "collapse",
372
+ width: "100%",
373
+ fontSize: "12px",
374
+ lineHeight: 1.4
375
+ },
376
+ children: [
377
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: headers.map((h, idx) => /* @__PURE__ */ jsx(
378
+ "th",
379
+ {
380
+ style: {
381
+ textAlign: colAlign(idx),
382
+ padding: "6px 10px",
383
+ borderBottom: `1px solid ${BORDER}`,
384
+ background: PAPER,
385
+ fontWeight: 600,
386
+ color: MUTED,
387
+ fontSize: "10px",
388
+ textTransform: "uppercase",
389
+ letterSpacing: "0.04em",
390
+ whiteSpace: "nowrap"
391
+ },
392
+ children: renderInline(h)
393
+ },
394
+ idx
395
+ )) }) }),
396
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((cells, rIdx) => /* @__PURE__ */ jsx("tr", { children: headers.map((_, cIdx) => {
397
+ var _a2;
398
+ return /* @__PURE__ */ jsx(
399
+ "td",
400
+ {
401
+ style: {
402
+ textAlign: colAlign(cIdx),
403
+ padding: "6px 10px",
404
+ borderBottom: `1px solid ${BORDER}`,
405
+ color: "var(--foreground)",
406
+ verticalAlign: "top"
407
+ },
408
+ children: renderInline((_a2 = cells[cIdx]) != null ? _a2 : "")
409
+ },
410
+ cIdx
411
+ );
412
+ }) }, rIdx)) })
413
+ ]
414
+ }
415
+ ) }, key++)
416
+ );
417
+ continue;
418
+ }
333
419
  elements.push(
334
420
  /* @__PURE__ */ jsx("p", { style: { margin: "0 0 8px 0", lineHeight: 1.65 }, children: renderInline(trimmed) }, key++)
335
421
  );
@@ -5118,6 +5204,79 @@ var pipelinePreviewTool = {
5118
5204
  required: ["type", "name", "steps"]
5119
5205
  }
5120
5206
  };
5207
+ var workflowStepperSchema = z.object({
5208
+ type: z.literal("workflow-stepper"),
5209
+ id: z.string().optional(),
5210
+ title: z.string(),
5211
+ period: z.string().optional(),
5212
+ badge: z.string().optional(),
5213
+ active_step: z.string().optional(),
5214
+ steps: z.array(
5215
+ z.object({
5216
+ id: z.string(),
5217
+ n: z.number().int().positive().optional(),
5218
+ title: z.string(),
5219
+ sub: z.string().optional(),
5220
+ status: z.enum(["done", "active", "review", "pending", "failed"]),
5221
+ assignees: z.array(
5222
+ z.object({
5223
+ name: z.string(),
5224
+ kind: z.enum(["agent", "human"]),
5225
+ initials: z.string().max(3).optional(),
5226
+ color: z.string().optional(),
5227
+ role: z.string().optional()
5228
+ })
5229
+ ).max(6).optional()
5230
+ })
5231
+ ).min(2).max(12)
5232
+ });
5233
+ var workflowStepperTool = {
5234
+ name: "render_workflow_stepper",
5235
+ 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.",
5236
+ input_schema: {
5237
+ type: "object",
5238
+ properties: {
5239
+ type: { type: "string", enum: ["workflow-stepper"] },
5240
+ id: { type: "string", description: "Stable id for update-in-place rendering" },
5241
+ title: { type: "string", description: "Process name, e.g. 'Monthly Close'" },
5242
+ period: { type: "string", description: "Period label, e.g. 'Period 04 \xB7 FY2026'" },
5243
+ badge: { type: "string", description: "Framework/compliance badge, e.g. 'SOX controlled'" },
5244
+ active_step: { type: "string", description: "Id of the currently active step" },
5245
+ steps: {
5246
+ type: "array",
5247
+ minItems: 2,
5248
+ maxItems: 12,
5249
+ items: {
5250
+ type: "object",
5251
+ properties: {
5252
+ id: { type: "string" },
5253
+ n: { type: "number", description: "Step number; defaults to index + 1" },
5254
+ title: { type: "string" },
5255
+ sub: { type: "string", description: "Short status caption, e.g. '7 accounts \xB7 2 exceptions'" },
5256
+ status: { type: "string", enum: ["done", "active", "review", "pending", "failed"] },
5257
+ assignees: {
5258
+ type: "array",
5259
+ maxItems: 6,
5260
+ items: {
5261
+ type: "object",
5262
+ properties: {
5263
+ name: { type: "string" },
5264
+ kind: { type: "string", enum: ["agent", "human"] },
5265
+ initials: { type: "string" },
5266
+ color: { type: "string" },
5267
+ role: { type: "string" }
5268
+ },
5269
+ required: ["name", "kind"]
5270
+ }
5271
+ }
5272
+ },
5273
+ required: ["id", "title", "status"]
5274
+ }
5275
+ }
5276
+ },
5277
+ required: ["type", "title", "steps"]
5278
+ }
5279
+ };
5121
5280
 
5122
5281
  // src/schemas/index.ts
5123
5282
  var schemaRegistry = {
@@ -5176,7 +5335,8 @@ var schemaRegistry = {
5176
5335
  "scatter-chart": { schema: scatterChartSchema, tool: scatterChartTool },
5177
5336
  "connect-integration": { schema: connectIntegrationSchema, tool: connectIntegrationTool },
5178
5337
  "integrations-list": { schema: integrationsListSchema, tool: integrationsListTool },
5179
- "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool }
5338
+ "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool },
5339
+ "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool }
5180
5340
  };
5181
5341
 
5182
5342
  // src/schemas/coercePayload.ts
@@ -5666,6 +5826,56 @@ function AlertResolver(p) {
5666
5826
 
5667
5827
  // src/composites/stat-grid/resolver.tsx
5668
5828
  init_Markdown();
5829
+ function FitText({ children, max = 22, min = 13, title, className, style }) {
5830
+ const ref = useRef(null);
5831
+ const [size, setSize] = useState(max);
5832
+ useLayoutEffect(() => {
5833
+ const el = ref.current;
5834
+ if (!el) return void 0;
5835
+ const fit = () => {
5836
+ let s = max;
5837
+ el.style.fontSize = `${s}px`;
5838
+ while (s > min && el.scrollWidth > el.clientWidth + 1) {
5839
+ s -= 1;
5840
+ el.style.fontSize = `${s}px`;
5841
+ }
5842
+ setSize(s);
5843
+ };
5844
+ fit();
5845
+ if (typeof ResizeObserver === "undefined") return void 0;
5846
+ const ro = new ResizeObserver(fit);
5847
+ ro.observe(el);
5848
+ return () => ro.disconnect();
5849
+ }, [children, max, min]);
5850
+ return /* @__PURE__ */ jsx(
5851
+ "span",
5852
+ {
5853
+ ref,
5854
+ title,
5855
+ className,
5856
+ style: __spreadValues({
5857
+ display: "block",
5858
+ minWidth: 0,
5859
+ maxWidth: "100%",
5860
+ whiteSpace: "nowrap",
5861
+ overflow: "hidden",
5862
+ textOverflow: "ellipsis",
5863
+ fontSize: `${size}px`
5864
+ }, style),
5865
+ children
5866
+ }
5867
+ );
5868
+ }
5869
+
5870
+ // src/shared/styles.ts
5871
+ var TRUNCATE = {
5872
+ minWidth: 0,
5873
+ overflow: "hidden",
5874
+ textOverflow: "ellipsis",
5875
+ whiteSpace: "nowrap"
5876
+ };
5877
+
5878
+ // src/composites/stat-grid/resolver.tsx
5669
5879
  init_ThemeContext();
5670
5880
  var changeColor = (type) => {
5671
5881
  if (type === "positive") return "#15803d";
@@ -5676,15 +5886,28 @@ var cardStyle = {
5676
5886
  border: "1px solid #dedede",
5677
5887
  borderRadius: "0.75rem",
5678
5888
  background: "white",
5679
- padding: "14px"
5889
+ padding: "14px",
5890
+ // Let the card shrink inside the grid track so big values can't push it
5891
+ // wider than its column.
5892
+ minWidth: 0,
5893
+ overflow: "hidden"
5680
5894
  };
5681
5895
  function StatGridResolver(p) {
5682
5896
  var _a;
5683
5897
  const { MUTED: MUTED2 } = useTheme();
5684
- 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: [
5685
- /* @__PURE__ */ jsx("p", { style: { fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, children: stat.label }),
5686
- /* @__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 }),
5687
- stat.change && /* @__PURE__ */ jsx("p", { style: { fontSize: "12px", fontWeight: 500, color: changeColor(stat.changeType), fontVariantNumeric: "tabular-nums", margin: 0 }, children: stat.change }),
5898
+ 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: [
5899
+ /* @__PURE__ */ jsx("p", { style: __spreadValues({ fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, TRUNCATE), children: stat.label }),
5900
+ /* @__PURE__ */ jsx(
5901
+ FitText,
5902
+ {
5903
+ max: 22,
5904
+ min: 13,
5905
+ title: typeof stat.value === "string" ? stat.value : void 0,
5906
+ style: { fontFamily: "var(--font-serif)", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.01em", lineHeight: 1.1, fontVariantNumeric: "tabular-nums" },
5907
+ children: stat.value
5908
+ }
5909
+ ),
5910
+ stat.change && /* @__PURE__ */ jsx("p", { style: __spreadValues({ fontSize: "12px", fontWeight: 500, color: changeColor(stat.changeType), fontVariantNumeric: "tabular-nums", margin: 0 }, TRUNCATE), children: stat.change }),
5688
5911
  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 }) })
5689
5912
  ] }) }, i)) }) });
5690
5913
  }
@@ -5851,17 +6074,17 @@ function SparklineTableResolver(p) {
5851
6074
  // src/composites/heatmap-table/resolver.tsx
5852
6075
  init_theme();
5853
6076
  init_ThemeContext();
5854
- function heatColor(z57) {
5855
- const clamped = Math.max(-3, Math.min(3, z57));
6077
+ function heatColor(z58) {
6078
+ const clamped = Math.max(-3, Math.min(3, z58));
5856
6079
  const abs = Math.abs(clamped);
5857
6080
  const lightness = 95 - abs * 8;
5858
6081
  const hue = clamped >= 0 ? 142 : 0;
5859
6082
  return `hsl(${hue} 60% ${lightness}%)`;
5860
6083
  }
5861
- function heatTextColor(z57) {
5862
- const abs = Math.abs(z57);
5863
- if (abs > 2) return z57 >= 0 ? "#14532d" : "#7f1d1d";
5864
- if (abs > 1) return z57 >= 0 ? "#166534" : "#991b1b";
6084
+ function heatTextColor(z58) {
6085
+ const abs = Math.abs(z58);
6086
+ if (abs > 2) return z58 >= 0 ? "#14532d" : "#7f1d1d";
6087
+ if (abs > 1) return z58 >= 0 ? "#166534" : "#991b1b";
5865
6088
  return "var(--foreground)";
5866
6089
  }
5867
6090
  var th2 = {
@@ -6481,7 +6704,7 @@ function WaterfallChartResolver(p) {
6481
6704
  ] }) });
6482
6705
  }
6483
6706
  init_ThemeContext();
6484
- var FlowGraph2 = React33.lazy(
6707
+ var FlowGraph2 = React41.lazy(
6485
6708
  () => Promise.resolve().then(() => (init_FlowGraph(), FlowGraph_exports)).then((m) => ({ default: m.FlowGraph }))
6486
6709
  );
6487
6710
  function FlowCanvasRenderer({
@@ -6734,7 +6957,7 @@ function TrialBalanceResolver(p) {
6734
6957
  color: balanced ? "#15803d" : "#dc2626"
6735
6958
  }, children: balanced ? "\u2713 Balanced" : "\u2717 Unbalanced" })
6736
6959
  ] }),
6737
- /* @__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: [
6960
+ /* @__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: [
6738
6961
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: ["Code", "Account", "Debit", "Credit"].map((h, i) => /* @__PURE__ */ jsx("th", { style: {
6739
6962
  fontSize: "11px",
6740
6963
  fontWeight: 500,
@@ -6755,7 +6978,7 @@ function TrialBalanceResolver(p) {
6755
6978
  gDebit += a.debit;
6756
6979
  gCredit += a.credit;
6757
6980
  });
6758
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
6981
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
6759
6982
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 4, style: {
6760
6983
  padding: "8px 12px",
6761
6984
  fontSize: "12px",
@@ -6912,7 +7135,7 @@ function AgingReportResolver(p) {
6912
7135
  p.asOfDate
6913
7136
  ] })
6914
7137
  ] }),
6915
- /* @__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: [
7138
+ /* @__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: [
6916
7139
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
6917
7140
  /* @__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" }),
6918
7141
  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)),
@@ -6969,7 +7192,7 @@ function VarianceAnalysisResolver(p) {
6969
7192
  p.title && /* @__PURE__ */ jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "15px", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.005em" }, children: p.title }),
6970
7193
  p.period && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: p.period })
6971
7194
  ] }),
6972
- /* @__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: [
7195
+ /* @__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: [
6973
7196
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: ["Line Item", "Budget", "Actual", "Variance $", "Variance %", ""].map((h, i) => /* @__PURE__ */ jsx("th", { style: {
6974
7197
  fontSize: "11px",
6975
7198
  fontWeight: 500,
@@ -7087,6 +7310,8 @@ function StackedBreakdownResolver(p) {
7087
7310
  alignItems: "center",
7088
7311
  gap: "6px",
7089
7312
  fontSize: "12px",
7313
+ maxWidth: "100%",
7314
+ minWidth: 0,
7090
7315
  color: isVisible(cat.name) ? MUTED2 : "#b3b3b3",
7091
7316
  cursor: "pointer",
7092
7317
  userSelect: "none",
@@ -7098,12 +7323,13 @@ function StackedBreakdownResolver(p) {
7098
7323
  width: "10px",
7099
7324
  height: "10px",
7100
7325
  borderRadius: "2px",
7326
+ flexShrink: 0,
7101
7327
  background: (_a2 = cat.color) != null ? _a2 : PALETTE2[ci % PALETTE2.length],
7102
7328
  display: "inline-block",
7103
7329
  opacity: isVisible(cat.name) ? 1 : 0.3,
7104
7330
  transition: "opacity 0.15s"
7105
7331
  } }),
7106
- cat.name
7332
+ /* @__PURE__ */ jsx("span", { style: TRUNCATE, title: cat.name, children: cat.name })
7107
7333
  ]
7108
7334
  },
7109
7335
  cat.name
@@ -7125,7 +7351,7 @@ function StackedBreakdownResolver(p) {
7125
7351
  ((_b2 = p.periods) != null ? _b2 : []).map((_, pi) => {
7126
7352
  var _a3, _b3;
7127
7353
  const v = pi < ((_a3 = cat.values) != null ? _a3 : []).length ? ((_b3 = cat.values) != null ? _b3 : [])[pi] : 0;
7128
- 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);
7354
+ 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);
7129
7355
  })
7130
7356
  ] }, cat.name);
7131
7357
  }),
@@ -7498,7 +7724,7 @@ function ReconciliationViewResolver(p) {
7498
7724
  {
7499
7725
  style: {
7500
7726
  display: "grid",
7501
- gridTemplateColumns: "repeat(auto-fit, minmax(90px, 1fr))",
7727
+ gridTemplateColumns: "repeat(auto-fit, minmax(min(120px, 100%), 1fr))",
7502
7728
  gap: "0",
7503
7729
  marginBottom: "14px",
7504
7730
  borderRadius: "10px",
@@ -7506,31 +7732,28 @@ function ReconciliationViewResolver(p) {
7506
7732
  overflow: "hidden"
7507
7733
  },
7508
7734
  children: [
7509
- /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px", background: PAPER2 }, children: [
7735
+ /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px", background: PAPER2, minWidth: 0 }, children: [
7510
7736
  /* @__PURE__ */ jsx(
7511
7737
  "div",
7512
7738
  {
7513
- style: {
7739
+ style: __spreadValues({
7514
7740
  fontSize: "10px",
7515
7741
  fontWeight: 500,
7516
7742
  color: MUTED2,
7517
7743
  textTransform: "uppercase",
7518
7744
  letterSpacing: "0.04em",
7519
7745
  marginBottom: "4px"
7520
- },
7746
+ }, TRUNCATE),
7521
7747
  children: sourceA.label
7522
7748
  }
7523
7749
  ),
7524
7750
  /* @__PURE__ */ jsx(
7525
- "div",
7751
+ FitText,
7526
7752
  {
7527
- style: {
7528
- fontSize: "15px",
7529
- fontWeight: 600,
7530
- color: "var(--foreground)",
7531
- fontVariantNumeric: "tabular-nums",
7532
- letterSpacing: "-0.01em"
7533
- },
7753
+ max: 15,
7754
+ min: 11,
7755
+ title: fmt6(balanceA, p.currency),
7756
+ style: { fontWeight: 600, color: "var(--foreground)", fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7534
7757
  children: fmt6(balanceA, p.currency)
7535
7758
  }
7536
7759
  )
@@ -7542,33 +7765,31 @@ function ReconciliationViewResolver(p) {
7542
7765
  padding: "10px 12px",
7543
7766
  background: PAPER2,
7544
7767
  borderLeft: `1px solid ${BORDER4}`,
7545
- borderRight: `1px solid ${BORDER4}`
7768
+ borderRight: `1px solid ${BORDER4}`,
7769
+ minWidth: 0
7546
7770
  },
7547
7771
  children: [
7548
7772
  /* @__PURE__ */ jsx(
7549
7773
  "div",
7550
7774
  {
7551
- style: {
7775
+ style: __spreadValues({
7552
7776
  fontSize: "10px",
7553
7777
  fontWeight: 500,
7554
7778
  color: MUTED2,
7555
7779
  textTransform: "uppercase",
7556
7780
  letterSpacing: "0.04em",
7557
7781
  marginBottom: "4px"
7558
- },
7782
+ }, TRUNCATE),
7559
7783
  children: sourceB.label
7560
7784
  }
7561
7785
  ),
7562
7786
  /* @__PURE__ */ jsx(
7563
- "div",
7787
+ FitText,
7564
7788
  {
7565
- style: {
7566
- fontSize: "15px",
7567
- fontWeight: 600,
7568
- color: "var(--foreground)",
7569
- fontVariantNumeric: "tabular-nums",
7570
- letterSpacing: "-0.01em"
7571
- },
7789
+ max: 15,
7790
+ min: 11,
7791
+ title: fmt6(balanceB, p.currency),
7792
+ style: { fontWeight: 600, color: "var(--foreground)", fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7572
7793
  children: fmt6(balanceB, p.currency)
7573
7794
  }
7574
7795
  )
@@ -7580,7 +7801,8 @@ function ReconciliationViewResolver(p) {
7580
7801
  {
7581
7802
  style: {
7582
7803
  padding: "10px 12px",
7583
- background: difference === 0 ? "#f0fdf4" : "#fef2f2"
7804
+ background: difference === 0 ? "#f0fdf4" : "#fef2f2",
7805
+ minWidth: 0
7584
7806
  },
7585
7807
  children: [
7586
7808
  /* @__PURE__ */ jsxs(
@@ -7620,15 +7842,12 @@ function ReconciliationViewResolver(p) {
7620
7842
  }
7621
7843
  ),
7622
7844
  /* @__PURE__ */ jsx(
7623
- "div",
7845
+ FitText,
7624
7846
  {
7625
- style: {
7626
- fontSize: "15px",
7627
- fontWeight: 700,
7628
- color: difference === 0 ? MATCH_GREEN : DIFF_RED,
7629
- fontVariantNumeric: "tabular-nums",
7630
- letterSpacing: "-0.01em"
7631
- },
7847
+ max: 15,
7848
+ min: 11,
7849
+ title: fmt6(difference, p.currency),
7850
+ style: { fontWeight: 700, color: difference === 0 ? MATCH_GREEN : DIFF_RED, fontVariantNumeric: "tabular-nums", letterSpacing: "-0.01em" },
7632
7851
  children: fmt6(difference, p.currency)
7633
7852
  }
7634
7853
  )
@@ -8145,10 +8364,10 @@ function useFullscreen(ref) {
8145
8364
  // src/composites/document-preview/resolver.tsx
8146
8365
  init_theme();
8147
8366
  init_ThemeContext();
8148
- var PdfViewer2 = React33.lazy(
8367
+ var PdfViewer2 = React41.lazy(
8149
8368
  () => Promise.resolve().then(() => (init_PdfViewer(), PdfViewer_exports)).then((m) => ({ default: m.PdfViewer }))
8150
8369
  );
8151
- var ExcelViewer2 = React33.lazy(
8370
+ var ExcelViewer2 = React41.lazy(
8152
8371
  () => Promise.resolve().then(() => (init_ExcelViewer(), ExcelViewer_exports)).then((m) => ({ default: m.ExcelViewer }))
8153
8372
  );
8154
8373
  var highlightColors = {
@@ -9104,7 +9323,7 @@ function EngagementPipelineResolver(p) {
9104
9323
  const color = (_a2 = statusColor2[phase.status]) != null ? _a2 : "#d6d3d1";
9105
9324
  const isCurrent = i === activeIdx;
9106
9325
  const size = isCurrent ? 28 : 20;
9107
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
9326
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
9108
9327
  i > 0 && /* @__PURE__ */ jsx(
9109
9328
  "div",
9110
9329
  {
@@ -9432,7 +9651,7 @@ function EntityCardGridResolver(p) {
9432
9651
  {
9433
9652
  style: {
9434
9653
  display: "grid",
9435
- gridTemplateColumns: `repeat(auto-fit, minmax(220px, 1fr))`,
9654
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(220px, 100%), 1fr))`,
9436
9655
  gap: "12px",
9437
9656
  width: "100%"
9438
9657
  },
@@ -9523,7 +9742,7 @@ function EntityCardGridResolver(p) {
9523
9742
  {
9524
9743
  style: {
9525
9744
  display: "grid",
9526
- gridTemplateColumns: item.fields.length > 2 ? "repeat(auto-fit, minmax(90px, 1fr))" : "1fr",
9745
+ gridTemplateColumns: item.fields.length > 2 ? "repeat(auto-fit, minmax(min(90px, 100%), 1fr))" : "1fr",
9527
9746
  gap: "6px 12px",
9528
9747
  borderTop: `1px solid ${BORDER4}`,
9529
9748
  paddingTop: "8px"
@@ -11267,7 +11486,7 @@ function FileCard({
11267
11486
  whiteSpace: "nowrap"
11268
11487
  },
11269
11488
  children: [
11270
- metaTokens.map((t, i) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
11489
+ metaTokens.map((t, i) => /* @__PURE__ */ jsxs(React41.Fragment, { children: [
11271
11490
  i > 0 && /* @__PURE__ */ jsx("span", { style: { color: "#c4c4c4" }, children: "\xB7" }),
11272
11491
  /* @__PURE__ */ jsx("span", { children: t })
11273
11492
  ] }, i)),
@@ -11751,9 +11970,9 @@ function ValueCell({ item }) {
11751
11970
  )
11752
11971
  ] });
11753
11972
  case "currency":
11754
- return /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", fontWeight: 600, fontVariantNumeric: "tabular-nums", marginLeft: "auto" }, children: item.value });
11973
+ return /* @__PURE__ */ jsx("span", { title: item.value, style: __spreadValues({ fontSize: "13px", fontWeight: 600, fontVariantNumeric: "tabular-nums", marginLeft: "auto" }, TRUNCATE), children: item.value });
11755
11974
  default:
11756
- return /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", color: "var(--foreground)" }, children: /* @__PURE__ */ jsx(Markdown, { inline: true, content: item.value }) });
11975
+ return /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", color: "var(--foreground)", minWidth: 0, overflowWrap: "anywhere" }, children: /* @__PURE__ */ jsx(Markdown, { inline: true, content: item.value }) });
11757
11976
  }
11758
11977
  }
11759
11978
  function KVRow({ item, isLast, index }) {
@@ -11786,7 +12005,7 @@ function KVRow({ item, isLast, index }) {
11786
12005
  children: item.key
11787
12006
  }
11788
12007
  ),
11789
- /* @__PURE__ */ jsx("span", { style: { flex: 1, display: "flex", alignItems: "center", gap: "6px" }, children: /* @__PURE__ */ jsx(ValueCell, { item }) }),
12008
+ /* @__PURE__ */ jsx("span", { style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: "6px" }, children: /* @__PURE__ */ jsx(ValueCell, { item }) }),
11790
12009
  item.copyable && /* @__PURE__ */ jsx(CopyButton, { value: item.value, rowHovered: hovered })
11791
12010
  ]
11792
12011
  }
@@ -11842,7 +12061,7 @@ function KeyValueListResolver(p) {
11842
12061
  var _a3;
11843
12062
  return sum + ((_a3 = g.items) != null ? _a3 : []).length;
11844
12063
  }, 0);
11845
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12064
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
11846
12065
  /* @__PURE__ */ jsxs(
11847
12066
  "div",
11848
12067
  {
@@ -11978,7 +12197,7 @@ function BalanceSheetResolver(p) {
11978
12197
  color: balanced ? "#15803d" : "#dc2626"
11979
12198
  }, children: balanced ? "\u2713 A = L + E" : "\u2717 Out of Balance" })
11980
12199
  ] }),
11981
- /* @__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: [
12200
+ /* @__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: [
11982
12201
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
11983
12202
  /* @__PURE__ */ jsx("th", { style: {
11984
12203
  fontSize: "11px",
@@ -12020,7 +12239,7 @@ function BalanceSheetResolver(p) {
12020
12239
  /* @__PURE__ */ jsxs("tbody", { children: [
12021
12240
  ((_p = p.sections) != null ? _p : []).map((section) => {
12022
12241
  var _a2;
12023
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12242
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12024
12243
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, style: {
12025
12244
  padding: "8px 12px",
12026
12245
  fontSize: "12px",
@@ -12033,7 +12252,7 @@ function BalanceSheetResolver(p) {
12033
12252
  }, children: (_a2 = categoryLabels2[section.category]) != null ? _a2 : section.category }) }),
12034
12253
  section.subsections.map((sub, si) => {
12035
12254
  var _a3;
12036
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12255
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12037
12256
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, style: {
12038
12257
  padding: "6px 10px 6px 24px",
12039
12258
  fontSize: "12px",
@@ -12195,7 +12414,7 @@ function IncomeStatementResolver(p) {
12195
12414
  ].filter(Boolean).join(" \xB7 ") })
12196
12415
  ] }),
12197
12416
  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 }),
12198
- /* @__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: [
12417
+ /* @__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: [
12199
12418
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
12200
12419
  /* @__PURE__ */ jsx("th", { style: {
12201
12420
  fontSize: "11px",
@@ -12209,7 +12428,7 @@ function IncomeStatementResolver(p) {
12209
12428
  textAlign: "left",
12210
12429
  whiteSpace: "nowrap"
12211
12430
  }, children: "\xA0" }),
12212
- periods.map((period) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12431
+ periods.map((period) => /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12213
12432
  /* @__PURE__ */ jsx("th", { style: {
12214
12433
  fontSize: "11px",
12215
12434
  fontWeight: 500,
@@ -12240,7 +12459,7 @@ function IncomeStatementResolver(p) {
12240
12459
  sections.map((section, si) => {
12241
12460
  var _a2;
12242
12461
  const isSubtotal = section.sectionType === "subtotal";
12243
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12462
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12244
12463
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: colCount, style: {
12245
12464
  padding: "8px 12px",
12246
12465
  fontSize: "12px",
@@ -12271,7 +12490,7 @@ function IncomeStatementResolver(p) {
12271
12490
  var _a4;
12272
12491
  const val = (_a4 = amounts[pi]) != null ? _a4 : 0;
12273
12492
  const isNeg = val < 0;
12274
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12493
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12275
12494
  /* @__PURE__ */ jsx("td", { style: {
12276
12495
  padding: "6px 10px",
12277
12496
  fontSize: "13px",
@@ -12306,7 +12525,7 @@ function IncomeStatementResolver(p) {
12306
12525
  var _a2;
12307
12526
  const val = (_a2 = grossProfit[pi]) != null ? _a2 : 0;
12308
12527
  const isNeg = val < 0;
12309
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12528
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12310
12529
  /* @__PURE__ */ jsx("td", { style: {
12311
12530
  padding: "8px 10px",
12312
12531
  fontSize: "12px",
@@ -12341,7 +12560,7 @@ function IncomeStatementResolver(p) {
12341
12560
  var _a2;
12342
12561
  const val = (_a2 = operatingIncome[pi]) != null ? _a2 : 0;
12343
12562
  const isNeg = val < 0;
12344
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12563
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12345
12564
  /* @__PURE__ */ jsx("td", { style: {
12346
12565
  padding: "8px 10px",
12347
12566
  fontSize: "12px",
@@ -12375,7 +12594,7 @@ function IncomeStatementResolver(p) {
12375
12594
  var _a2;
12376
12595
  const val = (_a2 = netIncome[pi]) != null ? _a2 : 0;
12377
12596
  const isNeg = val < 0;
12378
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12597
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12379
12598
  /* @__PURE__ */ jsx("td", { style: {
12380
12599
  padding: "10px 10px",
12381
12600
  fontSize: "13px",
@@ -12595,7 +12814,7 @@ function CashFlowStatementResolver(p) {
12595
12814
  /* @__PURE__ */ jsxs("tbody", { children: [
12596
12815
  activities.map((activity, ai) => {
12597
12816
  var _a2, _b2, _c2;
12598
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12817
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12599
12818
  ai > 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
12600
12819
  "td",
12601
12820
  {
@@ -12978,6 +13197,7 @@ function GeneralLedgerResolver(p) {
12978
13197
  {
12979
13198
  style: {
12980
13199
  overflowX: "auto",
13200
+ minWidth: 0,
12981
13201
  borderRadius: "0.75rem",
12982
13202
  border: `1px solid ${BORDER4}`,
12983
13203
  boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)"
@@ -16892,6 +17112,726 @@ function PipelinePreviewResolver(p) {
16892
17112
  )
16893
17113
  ] }) });
16894
17114
  }
17115
+ init_ThemeContext();
17116
+ var DEFAULT_INTERACTION = {
17117
+ selectedStepId: null,
17118
+ onStepSelect: void 0
17119
+ };
17120
+ var GenUIInteractionContext = createContext(DEFAULT_INTERACTION);
17121
+ function useGenUIInteraction() {
17122
+ return useContext(GenUIInteractionContext);
17123
+ }
17124
+ var STATUS_COLORS3 = {
17125
+ done: "#15803d",
17126
+ active: "",
17127
+ // filled from theme ACCENT at render time
17128
+ review: "#f59e0b",
17129
+ pending: "#9ca3af",
17130
+ failed: "#dc2626"
17131
+ };
17132
+ var STATUS_LABELS = {
17133
+ done: "Complete",
17134
+ active: "In progress",
17135
+ review: "In review",
17136
+ pending: "Pending",
17137
+ failed: "Failed"
17138
+ };
17139
+ var HUMAN_PALETTE = ["#2563eb", "#0f766e", "#7c3aed", "#b45309", "#be185d", "#4d7c0f"];
17140
+ function hashColor(name) {
17141
+ let h = 0;
17142
+ for (let i = 0; i < name.length; i++) h = h * 31 + name.charCodeAt(i) | 0;
17143
+ return HUMAN_PALETTE[Math.abs(h) % HUMAN_PALETTE.length];
17144
+ }
17145
+ function initialsOf(a) {
17146
+ var _a, _b, _c, _d;
17147
+ if (a.initials) return a.initials.slice(0, 2).toUpperCase();
17148
+ const parts = a.name.trim().split(/\s+/);
17149
+ return (((_b = (_a = parts[0]) == null ? void 0 : _a[0]) != null ? _b : "") + ((_d = (_c = parts[1]) == null ? void 0 : _c[0]) != null ? _d : "")).toUpperCase() || "?";
17150
+ }
17151
+ function SparkMark({ size, color }) {
17152
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
17153
+ "path",
17154
+ {
17155
+ 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",
17156
+ fill: color
17157
+ }
17158
+ ) });
17159
+ }
17160
+ function AvatarStack({ assignees, accent }) {
17161
+ const shown = assignees.slice(0, 4);
17162
+ const overflow = assignees.length - shown.length;
17163
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
17164
+ shown.map((a, i) => {
17165
+ const isAgent = a.kind === "agent";
17166
+ const bg = isAgent ? `${accent}1f` : a.color || hashColor(a.name);
17167
+ return /* @__PURE__ */ jsx(
17168
+ "div",
17169
+ {
17170
+ title: `${a.name}${a.role ? ` \xB7 ${a.role}` : isAgent ? " \xB7 agent" : ""}`,
17171
+ style: {
17172
+ width: 20,
17173
+ height: 20,
17174
+ borderRadius: "50%",
17175
+ flexShrink: 0,
17176
+ marginLeft: i === 0 ? 0 : -7,
17177
+ zIndex: shown.length - i,
17178
+ display: "flex",
17179
+ alignItems: "center",
17180
+ justifyContent: "center",
17181
+ background: bg,
17182
+ border: "1.5px solid white",
17183
+ boxShadow: isAgent ? `inset 0 0 0 1px ${accent}59` : "none"
17184
+ },
17185
+ 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) })
17186
+ },
17187
+ `${a.name}-${i}`
17188
+ );
17189
+ }),
17190
+ overflow > 0 && /* @__PURE__ */ jsxs(
17191
+ "span",
17192
+ {
17193
+ style: {
17194
+ marginLeft: -7,
17195
+ zIndex: 0,
17196
+ width: 20,
17197
+ height: 20,
17198
+ borderRadius: "50%",
17199
+ background: "#f2f2f2",
17200
+ border: "1.5px solid white",
17201
+ display: "flex",
17202
+ alignItems: "center",
17203
+ justifyContent: "center",
17204
+ fontSize: 8,
17205
+ fontWeight: 700,
17206
+ color: "#777777"
17207
+ },
17208
+ children: [
17209
+ "+",
17210
+ overflow
17211
+ ]
17212
+ }
17213
+ )
17214
+ ] });
17215
+ }
17216
+ function IndexDot({ step, index, accent }) {
17217
+ var _a;
17218
+ const n = (_a = step.n) != null ? _a : index + 1;
17219
+ const base = {
17220
+ width: 18,
17221
+ height: 18,
17222
+ borderRadius: "50%",
17223
+ flexShrink: 0,
17224
+ display: "flex",
17225
+ alignItems: "center",
17226
+ justifyContent: "center",
17227
+ fontSize: 10,
17228
+ fontWeight: 700,
17229
+ lineHeight: 1
17230
+ };
17231
+ if (step.status === "done") {
17232
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#15803d", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "\u2713" }) });
17233
+ }
17234
+ if (step.status === "failed") {
17235
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#dc2626", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "!" }) });
17236
+ }
17237
+ if (step.status === "active") {
17238
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: accent, color: "white" }), children: n });
17239
+ }
17240
+ if (step.status === "review") {
17241
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "white", border: "1.5px solid #f59e0b", color: "#b45309" }), children: n });
17242
+ }
17243
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#f2f2f2", color: "#9ca3af" }), children: n });
17244
+ }
17245
+ var CARD_MIN = 132;
17246
+ var CARD_GAP = 16;
17247
+ var AUTO_COMPACT_BELOW = 360;
17248
+ function useContainerWidth(ref) {
17249
+ const [w, setW] = React41.useState(0);
17250
+ React41.useLayoutEffect(() => {
17251
+ const el = ref.current;
17252
+ if (!el || typeof ResizeObserver === "undefined") return;
17253
+ const ro = new ResizeObserver((entries) => {
17254
+ var _a;
17255
+ const cr = (_a = entries[0]) == null ? void 0 : _a.contentRect;
17256
+ if (cr) setW(cr.width);
17257
+ });
17258
+ ro.observe(el);
17259
+ setW(el.getBoundingClientRect().width);
17260
+ return () => ro.disconnect();
17261
+ }, [ref]);
17262
+ return w;
17263
+ }
17264
+ var KEYFRAMES = `
17265
+ @keyframes wfsPulse{0%,100%{opacity:1}50%{opacity:.35}}
17266
+ @keyframes wfsLampPulse{0%,100%{box-shadow:0 0 0 0 var(--wfs-accent,#6366f1)73}50%{box-shadow:0 0 0 4px transparent}}
17267
+ @keyframes wfsRise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
17268
+ @keyframes wfsShimmer{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}
17269
+ .wfs-rise{animation:wfsRise 0.32s cubic-bezier(0.22,1,0.36,1) both}
17270
+ @media (prefers-reduced-motion: reduce){
17271
+ .wfs-anim,.wfs-rise,.wfs-shim{animation:none !important}
17272
+ .wfs-rise{opacity:1 !important;transform:none !important}
17273
+ }`;
17274
+ function ProgressMeter({
17275
+ done,
17276
+ total,
17277
+ accent,
17278
+ muted,
17279
+ loading
17280
+ }) {
17281
+ const pct = total > 0 ? Math.round(done / total * 100) : 0;
17282
+ return /* @__PURE__ */ jsxs(
17283
+ "div",
17284
+ {
17285
+ "data-testid": "workflow-stepper-progress",
17286
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "0 2px 6px" },
17287
+ children: [
17288
+ /* @__PURE__ */ jsx(
17289
+ "span",
17290
+ {
17291
+ style: {
17292
+ fontSize: 10.5,
17293
+ fontWeight: 600,
17294
+ color: muted,
17295
+ fontVariantNumeric: "tabular-nums",
17296
+ letterSpacing: "0.01em",
17297
+ whiteSpace: "nowrap"
17298
+ },
17299
+ children: loading ? "\u2014" : `${done} / ${total} \xB7 ${pct}%`
17300
+ }
17301
+ ),
17302
+ /* @__PURE__ */ jsx(
17303
+ "span",
17304
+ {
17305
+ style: {
17306
+ flex: 1,
17307
+ height: 3,
17308
+ borderRadius: 3,
17309
+ background: "#eceff4",
17310
+ overflow: "hidden",
17311
+ minWidth: 40
17312
+ },
17313
+ children: /* @__PURE__ */ jsx(
17314
+ "span",
17315
+ {
17316
+ className: loading ? "wfs-shim" : void 0,
17317
+ style: {
17318
+ display: "block",
17319
+ height: "100%",
17320
+ width: loading ? "100%" : `${pct}%`,
17321
+ borderRadius: 3,
17322
+ background: loading ? `linear-gradient(90deg, #eceff4, ${accent}55, #eceff4)` : accent,
17323
+ backgroundSize: loading ? "200px 100%" : void 0,
17324
+ animation: loading ? "wfsShimmer 1.1s linear infinite" : void 0,
17325
+ transition: "width 0.45s cubic-bezier(0.22,1,0.36,1)"
17326
+ }
17327
+ }
17328
+ )
17329
+ }
17330
+ )
17331
+ ]
17332
+ }
17333
+ );
17334
+ }
17335
+ function WorkflowStepperRenderer({
17336
+ data,
17337
+ selectedStep = null,
17338
+ onSelectStep,
17339
+ density = "auto",
17340
+ loading = false,
17341
+ loadingSteps = 6,
17342
+ showProgress = true
17343
+ }) {
17344
+ var _a, _b, _c, _d, _e, _f;
17345
+ const { BORDER: BORDER4, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
17346
+ const steps = (_a = data.steps) != null ? _a : [];
17347
+ const activeStepId = (_d = (_c = data.active_step) != null ? _c : (_b = steps.find((s) => s.status === "active")) == null ? void 0 : _b.id) != null ? _d : null;
17348
+ const interactive = typeof onSelectStep === "function";
17349
+ const statusColor3 = (s) => s === "active" ? ACCENT2 : STATUS_COLORS3[s];
17350
+ const doneCount = steps.filter((s) => s.status === "done").length;
17351
+ const rootRef = React41.useRef(null);
17352
+ const containerW = useContainerWidth(rootRef);
17353
+ let resolved = density === "auto" ? "full" : density;
17354
+ if (density === "auto" && containerW > 0) {
17355
+ const needed = steps.length * CARD_MIN + Math.max(0, steps.length - 1) * CARD_GAP;
17356
+ resolved = containerW < AUTO_COMPACT_BELOW || needed > containerW * 1.6 ? "compact" : "full";
17357
+ }
17358
+ const scrollerRef = React41.useRef(null);
17359
+ React41.useEffect(() => {
17360
+ if (resolved !== "full" || loading) return;
17361
+ const sc = scrollerRef.current;
17362
+ if (!sc) return;
17363
+ const el = sc.querySelector(
17364
+ `[data-testid="workflow-stepper-step-${selectedStep != null ? selectedStep : activeStepId}"]`
17365
+ );
17366
+ if (el && sc.scrollWidth > sc.clientWidth) {
17367
+ el.scrollIntoView({ inline: "center", block: "nearest", behavior: "smooth" });
17368
+ }
17369
+ }, [resolved, loading, selectedStep, activeStepId]);
17370
+ const [edges, setEdges] = React41.useState({
17371
+ left: false,
17372
+ right: false
17373
+ });
17374
+ const updateEdges = React41.useCallback(() => {
17375
+ const sc = scrollerRef.current;
17376
+ if (!sc) return;
17377
+ const max = sc.scrollWidth - sc.clientWidth;
17378
+ const sl = sc.scrollLeft;
17379
+ const left = sl > 1;
17380
+ const right = sl < max - 1;
17381
+ setEdges((prev) => prev.left === left && prev.right === right ? prev : { left, right });
17382
+ }, []);
17383
+ React41.useLayoutEffect(() => {
17384
+ if (resolved !== "full" || loading) return;
17385
+ updateEdges();
17386
+ const sc = scrollerRef.current;
17387
+ if (!sc || typeof ResizeObserver === "undefined") return;
17388
+ const ro = new ResizeObserver(updateEdges);
17389
+ ro.observe(sc);
17390
+ return () => ro.disconnect();
17391
+ }, [resolved, loading, steps.length, updateEdges]);
17392
+ 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;
17393
+ const themeStyle = { ["--wfs-accent"]: ACCENT2 };
17394
+ if (loading) {
17395
+ const ghosts = Array.from({ length: Math.max(2, loadingSteps) });
17396
+ return /* @__PURE__ */ jsxs("div", { "data-testid": "workflow-stepper-loading", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
17397
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
17398
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: 0, total: 0, accent: ACCENT2, muted: MUTED2, loading: true }),
17399
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "stretch", gap: CARD_GAP, padding: "2px 2px 6px", overflow: "hidden" }, children: ghosts.map((_, i) => /* @__PURE__ */ jsx(
17400
+ "div",
17401
+ {
17402
+ className: "wfs-shim",
17403
+ "aria-hidden": "true",
17404
+ style: {
17405
+ flex: "0 1 168px",
17406
+ minWidth: CARD_MIN,
17407
+ height: 84,
17408
+ borderRadius: 10,
17409
+ border: `1px solid ${BORDER4}`,
17410
+ background: `linear-gradient(90deg, #f4f6f9, #eceff4 40%, #f4f6f9 80%)`,
17411
+ backgroundSize: "200px 100%",
17412
+ animation: "wfsShimmer 1.1s linear infinite",
17413
+ animationDelay: `${i * 0.08}s`
17414
+ }
17415
+ },
17416
+ i
17417
+ )) })
17418
+ ] });
17419
+ }
17420
+ if (resolved === "compact") {
17421
+ const activeStep = (_e = steps.find((s) => s.id === activeStepId)) != null ? _e : null;
17422
+ return /* @__PURE__ */ jsxs(
17423
+ "div",
17424
+ {
17425
+ ref: rootRef,
17426
+ "data-testid": "workflow-stepper-compact",
17427
+ style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle),
17428
+ children: [
17429
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
17430
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
17431
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
17432
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", flexShrink: 0 }, children: steps.map((s, i) => {
17433
+ const sel = selectedStep === s.id;
17434
+ const act = s.status === "active";
17435
+ const done = s.status === "done";
17436
+ const reached = s.status !== "pending";
17437
+ const clickable = interactive && reached;
17438
+ const size = act ? 11 : done ? 9 : 8;
17439
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
17440
+ i > 0 && /* @__PURE__ */ jsx(
17441
+ "span",
17442
+ {
17443
+ "aria-hidden": "true",
17444
+ style: {
17445
+ width: 14,
17446
+ height: 1.5,
17447
+ borderRadius: 1,
17448
+ background: steps[i - 1].status === "done" ? "#15803d" : "#e5e7eb",
17449
+ transition: "background 0.36s ease-out"
17450
+ }
17451
+ }
17452
+ ),
17453
+ /* @__PURE__ */ jsx(
17454
+ "button",
17455
+ {
17456
+ type: "button",
17457
+ disabled: interactive && !reached,
17458
+ "aria-disabled": interactive && !reached ? true : void 0,
17459
+ title: `${s.title} \xB7 ${STATUS_LABELS[s.status]}`,
17460
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(sel ? null : s.id) : void 0,
17461
+ "data-testid": `workflow-stepper-step-${s.id}`,
17462
+ "data-status": s.status,
17463
+ "data-reached": reached || void 0,
17464
+ className: act ? "wfs-anim" : void 0,
17465
+ style: {
17466
+ position: "relative",
17467
+ width: size,
17468
+ height: size,
17469
+ padding: 0,
17470
+ borderRadius: "50%",
17471
+ background: statusColor3(s.status),
17472
+ flexShrink: 0,
17473
+ // border-box so the selected 2px border can't grow the dot
17474
+ // and reflow the rail.
17475
+ boxSizing: "border-box",
17476
+ opacity: reached ? 1 : 0.55,
17477
+ border: sel ? `2px solid ${ACCENT2}` : done ? "none" : "1px solid rgba(255,255,255,0.6)",
17478
+ boxShadow: sel ? "0 0 0 2px #fff" : "none",
17479
+ cursor: clickable ? "pointer" : "default",
17480
+ transition: "width 0.15s, height 0.15s",
17481
+ animation: act ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17482
+ }
17483
+ }
17484
+ )
17485
+ ] }, s.id);
17486
+ }) }),
17487
+ activeStep && /* @__PURE__ */ jsxs(Fragment, { children: [
17488
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { width: 1, height: 16, background: "#e6eaf1", flexShrink: 0 } }),
17489
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: 7, minWidth: 0 }, children: [
17490
+ /* @__PURE__ */ jsx(
17491
+ "span",
17492
+ {
17493
+ "aria-hidden": "true",
17494
+ style: {
17495
+ width: 17,
17496
+ height: 17,
17497
+ borderRadius: "50%",
17498
+ flexShrink: 0,
17499
+ display: "flex",
17500
+ alignItems: "center",
17501
+ justifyContent: "center",
17502
+ fontSize: 9.5,
17503
+ fontWeight: 700,
17504
+ lineHeight: 1,
17505
+ background: activeStep.status === "done" ? "#15803d" : activeStep.status === "review" ? "#fff" : activeStep.status === "failed" ? "#dc2626" : ACCENT2,
17506
+ color: activeStep.status === "review" ? "#b45309" : "#fff",
17507
+ border: activeStep.status === "review" ? "1.5px solid #f59e0b" : "none"
17508
+ },
17509
+ children: activeStep.status === "done" ? "\u2713" : activeStep.status === "failed" ? "!" : (_f = activeStep.n) != null ? _f : steps.findIndex((x) => x.id === activeStep.id) + 1
17510
+ }
17511
+ ),
17512
+ /* @__PURE__ */ jsxs(
17513
+ "span",
17514
+ {
17515
+ style: {
17516
+ fontSize: 12.5,
17517
+ fontWeight: 650,
17518
+ color: "var(--foreground)",
17519
+ letterSpacing: "-0.01em",
17520
+ whiteSpace: "nowrap",
17521
+ overflow: "hidden",
17522
+ textOverflow: "ellipsis",
17523
+ minWidth: 0
17524
+ },
17525
+ children: [
17526
+ activeStep.title,
17527
+ activeStep.sub ? /* @__PURE__ */ jsxs("span", { style: { fontWeight: 400, color: MUTED2 }, children: [
17528
+ " \xB7 ",
17529
+ activeStep.sub
17530
+ ] }) : null
17531
+ ]
17532
+ }
17533
+ )
17534
+ ] })
17535
+ ] })
17536
+ ] })
17537
+ ]
17538
+ }
17539
+ );
17540
+ }
17541
+ return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-testid": "workflow-stepper", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
17542
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
17543
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
17544
+ /* @__PURE__ */ jsxs(
17545
+ "div",
17546
+ {
17547
+ ref: scrollerRef,
17548
+ className: "wfs-scroller",
17549
+ onScroll: updateEdges,
17550
+ style: {
17551
+ display: "flex",
17552
+ alignItems: "stretch",
17553
+ overflowX: "auto",
17554
+ scrollSnapType: "x proximity",
17555
+ padding: "2px 2px 4px",
17556
+ // Thin, always-styled scrollbar (Firefox + Windows/desktop WebKit
17557
+ // where overlay scrollbars aren't available). macOS/mobile show
17558
+ // overlay scrollbars on scroll; harmless either way.
17559
+ scrollbarWidth: "thin",
17560
+ scrollbarColor: "#c2c9d6 transparent",
17561
+ // Edge fade ONLY on the side(s) with hidden content — never when the
17562
+ // row isn't scrollable, so the last card's right edge stays crisp.
17563
+ maskImage: edgeMask,
17564
+ WebkitMaskImage: edgeMask
17565
+ },
17566
+ children: [
17567
+ /* @__PURE__ */ jsx("style", { children: `
17568
+ .wfs-scroller::-webkit-scrollbar{height:8px}
17569
+ .wfs-scroller::-webkit-scrollbar-track{background:transparent}
17570
+ .wfs-scroller::-webkit-scrollbar-thumb{background:#c2c9d6;border-radius:8px;border:2px solid transparent;background-clip:padding-box}
17571
+ .wfs-scroller:hover::-webkit-scrollbar-thumb{background:#aab2c2;background-clip:padding-box}
17572
+ ` }),
17573
+ steps.map((step, i) => {
17574
+ var _a2;
17575
+ const isSelected = selectedStep === step.id;
17576
+ const isActive = step.status === "active";
17577
+ const reached = step.status !== "pending";
17578
+ const clickable = interactive && reached;
17579
+ const color = statusColor3(step.status);
17580
+ const humans = ((_a2 = step.assignees) != null ? _a2 : []).filter((a) => a.kind === "human");
17581
+ const roleCaption = humans.map((h) => h.role).filter(Boolean).slice(0, 2).join(" \xB7 ");
17582
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
17583
+ i > 0 && /* @__PURE__ */ jsx(
17584
+ "div",
17585
+ {
17586
+ style: {
17587
+ width: CARD_GAP,
17588
+ flexShrink: 0,
17589
+ display: "flex",
17590
+ alignItems: "center"
17591
+ },
17592
+ "aria-hidden": "true",
17593
+ children: /* @__PURE__ */ jsx(
17594
+ "div",
17595
+ {
17596
+ style: {
17597
+ width: "100%",
17598
+ height: 1.5,
17599
+ borderRadius: 1,
17600
+ // Fill sweep: completed rails wash green left→right.
17601
+ background: steps[i - 1].status === "done" ? "linear-gradient(90deg, #15803d, #15803d)" : "#e5e7eb",
17602
+ backgroundSize: "100% 100%",
17603
+ transition: "background 0.36s ease-out"
17604
+ }
17605
+ }
17606
+ )
17607
+ }
17608
+ ),
17609
+ /* @__PURE__ */ jsxs(
17610
+ "div",
17611
+ {
17612
+ role: clickable ? "button" : void 0,
17613
+ tabIndex: clickable ? 0 : void 0,
17614
+ "aria-disabled": interactive && !reached ? true : void 0,
17615
+ className: "wfs-rise",
17616
+ "data-testid": `workflow-stepper-step-${step.id}`,
17617
+ "data-status": step.status,
17618
+ "data-selected": isSelected || void 0,
17619
+ "data-reached": reached || void 0,
17620
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id) : void 0,
17621
+ onKeyDown: clickable ? (e) => {
17622
+ if (e.key === "Enter" || e.key === " ") {
17623
+ e.preventDefault();
17624
+ onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id);
17625
+ }
17626
+ } : void 0,
17627
+ onMouseEnter: clickable ? (e) => {
17628
+ e.currentTarget.style.transform = "translateY(-1px)";
17629
+ e.currentTarget.style.boxShadow = "0 3px 10px rgba(15,23,42,0.08)";
17630
+ } : void 0,
17631
+ onMouseLeave: clickable ? (e) => {
17632
+ e.currentTarget.style.transform = "none";
17633
+ e.currentTarget.style.boxShadow = "0 1px 2px rgba(0,0,0,0.04)";
17634
+ } : void 0,
17635
+ style: {
17636
+ position: "relative",
17637
+ flex: "0 1 168px",
17638
+ minWidth: CARD_MIN,
17639
+ maxWidth: 208,
17640
+ scrollSnapAlign: "center",
17641
+ borderRadius: 10,
17642
+ boxSizing: "border-box",
17643
+ // Selection changes border COLOR only (constant 1px width) so
17644
+ // the card never reflows the row on click.
17645
+ border: `1px solid ${isSelected ? ACCENT2 : BORDER4}`,
17646
+ background: isSelected ? `${ACCENT2}0d` : "white",
17647
+ boxShadow: "0 1px 2px rgba(0,0,0,0.04)",
17648
+ padding: "10px 11px",
17649
+ display: "flex",
17650
+ flexDirection: "column",
17651
+ gap: 7,
17652
+ cursor: clickable ? "pointer" : "default",
17653
+ opacity: reached ? 1 : 0.62,
17654
+ transition: "border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s",
17655
+ animationDelay: `${Math.min(i, 10) * 0.04}s`,
17656
+ overflow: "hidden"
17657
+ },
17658
+ children: [
17659
+ isActive && !isSelected && /* @__PURE__ */ jsx(
17660
+ "span",
17661
+ {
17662
+ style: {
17663
+ position: "absolute",
17664
+ left: 0,
17665
+ top: 6,
17666
+ bottom: 6,
17667
+ width: 2,
17668
+ borderRadius: 2,
17669
+ background: ACCENT2
17670
+ }
17671
+ }
17672
+ ),
17673
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
17674
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
17675
+ /* @__PURE__ */ jsx(IndexDot, { step, index: i, accent: ACCENT2 }),
17676
+ /* @__PURE__ */ jsx(
17677
+ "span",
17678
+ {
17679
+ className: isActive ? "wfs-anim" : void 0,
17680
+ style: {
17681
+ width: 6,
17682
+ height: 6,
17683
+ borderRadius: "50%",
17684
+ background: color,
17685
+ animation: isActive ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
17686
+ }
17687
+ }
17688
+ )
17689
+ ] }),
17690
+ /* @__PURE__ */ jsx(
17691
+ "span",
17692
+ {
17693
+ style: {
17694
+ fontSize: 9,
17695
+ fontWeight: 600,
17696
+ letterSpacing: "0.05em",
17697
+ textTransform: "uppercase",
17698
+ color
17699
+ },
17700
+ children: STATUS_LABELS[step.status]
17701
+ }
17702
+ )
17703
+ ] }),
17704
+ /* @__PURE__ */ jsxs("div", { style: { minWidth: 0 }, children: [
17705
+ /* @__PURE__ */ jsx(
17706
+ "div",
17707
+ {
17708
+ style: {
17709
+ fontSize: 12.5,
17710
+ fontWeight: 600,
17711
+ color: "var(--foreground)",
17712
+ lineHeight: 1.25,
17713
+ letterSpacing: "-0.01em",
17714
+ overflow: "hidden",
17715
+ textOverflow: "ellipsis",
17716
+ whiteSpace: "nowrap"
17717
+ },
17718
+ children: step.title
17719
+ }
17720
+ ),
17721
+ step.sub && /* @__PURE__ */ jsx(
17722
+ "div",
17723
+ {
17724
+ style: {
17725
+ fontSize: 10.5,
17726
+ color: MUTED2,
17727
+ marginTop: 2,
17728
+ overflow: "hidden",
17729
+ textOverflow: "ellipsis",
17730
+ whiteSpace: "nowrap"
17731
+ },
17732
+ children: step.sub
17733
+ }
17734
+ )
17735
+ ] }),
17736
+ /* @__PURE__ */ jsxs(
17737
+ "div",
17738
+ {
17739
+ style: {
17740
+ display: "flex",
17741
+ alignItems: "center",
17742
+ justifyContent: "space-between",
17743
+ marginTop: "auto",
17744
+ minHeight: 20
17745
+ },
17746
+ children: [
17747
+ step.assignees && step.assignees.length > 0 ? /* @__PURE__ */ jsx(AvatarStack, { assignees: step.assignees, accent: ACCENT2 }) : /* @__PURE__ */ jsx("span", {}),
17748
+ roleCaption && /* @__PURE__ */ jsx(
17749
+ "span",
17750
+ {
17751
+ style: {
17752
+ fontSize: 9,
17753
+ color: "#9ca3af",
17754
+ fontWeight: 500,
17755
+ textAlign: "right",
17756
+ maxWidth: 76,
17757
+ lineHeight: 1.2,
17758
+ overflow: "hidden"
17759
+ },
17760
+ children: roleCaption
17761
+ }
17762
+ )
17763
+ ]
17764
+ }
17765
+ )
17766
+ ]
17767
+ }
17768
+ )
17769
+ ] }, step.id);
17770
+ })
17771
+ ]
17772
+ }
17773
+ )
17774
+ ] });
17775
+ }
17776
+ function WorkflowStepperResolver(p) {
17777
+ var _a;
17778
+ const { selectedStepId, onStepSelect } = useGenUIInteraction();
17779
+ 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: [
17780
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
17781
+ /* @__PURE__ */ jsx(
17782
+ "p",
17783
+ {
17784
+ style: {
17785
+ fontFamily: "var(--font-serif)",
17786
+ fontSize: "15px",
17787
+ fontWeight: 400,
17788
+ color: "var(--foreground)",
17789
+ letterSpacing: "-0.01em",
17790
+ margin: 0
17791
+ },
17792
+ children: p.title
17793
+ }
17794
+ ),
17795
+ p.period && /* @__PURE__ */ jsx(
17796
+ "span",
17797
+ {
17798
+ style: {
17799
+ fontSize: 11,
17800
+ fontWeight: 600,
17801
+ padding: "2px 8px",
17802
+ borderRadius: 9999,
17803
+ background: "#f2f2f2",
17804
+ color: "#777777",
17805
+ fontVariantNumeric: "tabular-nums"
17806
+ },
17807
+ children: p.period
17808
+ }
17809
+ ),
17810
+ p.badge && /* @__PURE__ */ jsx(
17811
+ "span",
17812
+ {
17813
+ style: {
17814
+ fontSize: 11,
17815
+ fontWeight: 600,
17816
+ padding: "2px 8px",
17817
+ borderRadius: 9999,
17818
+ border: "1px solid #dedede",
17819
+ color: "#777777"
17820
+ },
17821
+ children: p.badge
17822
+ }
17823
+ )
17824
+ ] }),
17825
+ /* @__PURE__ */ jsx(
17826
+ WorkflowStepperRenderer,
17827
+ {
17828
+ data: p,
17829
+ selectedStep: selectedStepId,
17830
+ onSelectStep: onStepSelect
17831
+ }
17832
+ )
17833
+ ] }) });
17834
+ }
16895
17835
  function resolveUI(rawPayload) {
16896
17836
  const payload = coercePayload(rawPayload);
16897
17837
  switch (payload.type) {
@@ -17007,6 +17947,8 @@ function resolveUI(rawPayload) {
17007
17947
  return /* @__PURE__ */ jsx(IntegrationsListResolver, __spreadValues({}, payload));
17008
17948
  case "pipeline-preview":
17009
17949
  return /* @__PURE__ */ jsx(PipelinePreviewResolver, __spreadValues({}, payload));
17950
+ case "workflow-stepper":
17951
+ return /* @__PURE__ */ jsx(WorkflowStepperResolver, __spreadValues({}, payload));
17010
17952
  default: {
17011
17953
  return /* @__PURE__ */ jsx(
17012
17954
  "div",