@adoptai/genui-components 0.1.33 → 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 (113) 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/balance-sheet/resolver.cjs +1 -1
  21. package/dist/composites/balance-sheet/resolver.cjs.map +1 -1
  22. package/dist/composites/balance-sheet/resolver.js +1 -1
  23. package/dist/composites/balance-sheet/resolver.js.map +1 -1
  24. package/dist/composites/connect-integration/resolver.cjs +465 -0
  25. package/dist/composites/connect-integration/resolver.cjs.map +1 -0
  26. package/dist/composites/connect-integration/resolver.js +463 -0
  27. package/dist/composites/connect-integration/resolver.js.map +1 -0
  28. package/dist/composites/entity-card-grid/resolver.cjs +2 -2
  29. package/dist/composites/entity-card-grid/resolver.cjs.map +1 -1
  30. package/dist/composites/entity-card-grid/resolver.js +2 -2
  31. package/dist/composites/entity-card-grid/resolver.js.map +1 -1
  32. package/dist/composites/general-ledger/resolver.cjs +1 -0
  33. package/dist/composites/general-ledger/resolver.cjs.map +1 -1
  34. package/dist/composites/general-ledger/resolver.d.ts.map +1 -1
  35. package/dist/composites/general-ledger/resolver.js +1 -0
  36. package/dist/composites/general-ledger/resolver.js.map +1 -1
  37. package/dist/composites/income-statement/resolver.cjs +1 -1
  38. package/dist/composites/income-statement/resolver.cjs.map +1 -1
  39. package/dist/composites/income-statement/resolver.js +1 -1
  40. package/dist/composites/income-statement/resolver.js.map +1 -1
  41. package/dist/composites/integrations-list/resolver.cjs +511 -0
  42. package/dist/composites/integrations-list/resolver.cjs.map +1 -0
  43. package/dist/composites/integrations-list/resolver.js +509 -0
  44. package/dist/composites/integrations-list/resolver.js.map +1 -0
  45. package/dist/composites/key-value-list/resolver.cjs +28 -3
  46. package/dist/composites/key-value-list/resolver.cjs.map +1 -1
  47. package/dist/composites/key-value-list/resolver.d.ts.map +1 -1
  48. package/dist/composites/key-value-list/resolver.js +28 -3
  49. package/dist/composites/key-value-list/resolver.js.map +1 -1
  50. package/dist/composites/pipeline-preview/resolver.cjs +926 -0
  51. package/dist/composites/pipeline-preview/resolver.cjs.map +1 -0
  52. package/dist/composites/pipeline-preview/resolver.js +924 -0
  53. package/dist/composites/pipeline-preview/resolver.js.map +1 -0
  54. package/dist/composites/reconciliation-view/resolver.cjs +90 -32
  55. package/dist/composites/reconciliation-view/resolver.cjs.map +1 -1
  56. package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -1
  57. package/dist/composites/reconciliation-view/resolver.js +91 -33
  58. package/dist/composites/reconciliation-view/resolver.js.map +1 -1
  59. package/dist/composites/stacked-breakdown/resolver.cjs +13 -2
  60. package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -1
  61. package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -1
  62. package/dist/composites/stacked-breakdown/resolver.js +13 -2
  63. package/dist/composites/stacked-breakdown/resolver.js.map +1 -1
  64. package/dist/composites/stat-grid/resolver.cjs +83 -5
  65. package/dist/composites/stat-grid/resolver.cjs.map +1 -1
  66. package/dist/composites/stat-grid/resolver.d.ts.map +1 -1
  67. package/dist/composites/stat-grid/resolver.js +84 -6
  68. package/dist/composites/stat-grid/resolver.js.map +1 -1
  69. package/dist/composites/trial-balance/resolver.cjs +1 -1
  70. package/dist/composites/trial-balance/resolver.cjs.map +1 -1
  71. package/dist/composites/trial-balance/resolver.js +1 -1
  72. package/dist/composites/trial-balance/resolver.js.map +1 -1
  73. package/dist/composites/variance-analysis/resolver.cjs +1 -1
  74. package/dist/composites/variance-analysis/resolver.cjs.map +1 -1
  75. package/dist/composites/variance-analysis/resolver.js +1 -1
  76. package/dist/composites/variance-analysis/resolver.js.map +1 -1
  77. package/dist/composites/workflow-stepper/resolver.cjs +976 -0
  78. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -0
  79. package/dist/composites/workflow-stepper/resolver.d.ts +20 -0
  80. package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -0
  81. package/dist/composites/workflow-stepper/resolver.js +969 -0
  82. package/dist/composites/workflow-stepper/resolver.js.map +1 -0
  83. package/dist/index.cjs +1182 -275
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.d.ts +7 -0
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js +1019 -120
  88. package/dist/index.js.map +1 -1
  89. package/dist/renderer.cjs +1067 -211
  90. package/dist/renderer.cjs.map +1 -1
  91. package/dist/renderer.js +929 -73
  92. package/dist/renderer.js.map +1 -1
  93. package/dist/resolver.cjs +1066 -210
  94. package/dist/resolver.cjs.map +1 -1
  95. package/dist/resolver.d.ts.map +1 -1
  96. package/dist/resolver.js +929 -73
  97. package/dist/resolver.js.map +1 -1
  98. package/dist/schemas/index.cjs +75 -1
  99. package/dist/schemas/index.cjs.map +1 -1
  100. package/dist/schemas/index.d.ts +122 -0
  101. package/dist/schemas/index.d.ts.map +1 -1
  102. package/dist/schemas/index.js +75 -1
  103. package/dist/schemas/index.js.map +1 -1
  104. package/dist/schemas/workflow-stepper.d.ts +122 -0
  105. package/dist/schemas/workflow-stepper.d.ts.map +1 -0
  106. package/dist/shared/FitText.d.ts +22 -0
  107. package/dist/shared/FitText.d.ts.map +1 -0
  108. package/dist/shared/InteractionContext.d.ts +20 -0
  109. package/dist/shared/InteractionContext.d.ts.map +1 -0
  110. package/dist/shared/styles.d.ts +14 -0
  111. package/dist/shared/styles.d.ts.map +1 -0
  112. package/dist/tool-definitions.json +114 -3
  113. 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';
@@ -5214,6 +5214,79 @@ var pipelinePreviewTool = {
5214
5214
  required: ["type", "name", "steps"]
5215
5215
  }
5216
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
+ };
5217
5290
 
5218
5291
  // src/schemas/buildRenderUITool.ts
5219
5292
  function buildRenderUITool(selectedSchemas) {
@@ -5331,7 +5404,8 @@ var schemaRegistry = {
5331
5404
  "scatter-chart": { schema: scatterChartSchema, tool: scatterChartTool },
5332
5405
  "connect-integration": { schema: connectIntegrationSchema, tool: connectIntegrationTool },
5333
5406
  "integrations-list": { schema: integrationsListSchema, tool: integrationsListTool },
5334
- "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool }
5407
+ "pipeline-preview": { schema: pipelinePreviewSchema, tool: pipelinePreviewTool },
5408
+ "workflow-stepper": { schema: workflowStepperSchema, tool: workflowStepperTool }
5335
5409
  };
5336
5410
 
5337
5411
  // src/shared/ColumnSettingsPanel.tsx
@@ -5791,6 +5865,61 @@ function AlertResolver(p) {
5791
5865
 
5792
5866
  // src/composites/stat-grid/resolver.tsx
5793
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
5794
5923
  init_ThemeContext();
5795
5924
  var changeColor = (type) => {
5796
5925
  if (type === "positive") return "#15803d";
@@ -5801,15 +5930,28 @@ var cardStyle = {
5801
5930
  border: "1px solid #dedede",
5802
5931
  borderRadius: "0.75rem",
5803
5932
  background: "white",
5804
- 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"
5805
5938
  };
5806
5939
  function StatGridResolver(p) {
5807
5940
  var _a;
5808
5941
  const { MUTED: MUTED2 } = useTheme();
5809
- 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: [
5810
- /* @__PURE__ */ jsx("p", { style: { fontSize: "11.5px", color: MUTED2, letterSpacing: "0.02em", textTransform: "uppercase", margin: 0 }, children: stat.label }),
5811
- /* @__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 }),
5812
- 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 }),
5813
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 }) })
5814
5956
  ] }) }, i)) }) });
5815
5957
  }
@@ -5976,17 +6118,17 @@ function SparklineTableResolver(p) {
5976
6118
  // src/composites/heatmap-table/resolver.tsx
5977
6119
  init_theme();
5978
6120
  init_ThemeContext();
5979
- function heatColor(z58) {
5980
- const clamped = Math.max(-3, Math.min(3, z58));
6121
+ function heatColor(z59) {
6122
+ const clamped = Math.max(-3, Math.min(3, z59));
5981
6123
  const abs = Math.abs(clamped);
5982
6124
  const lightness = 95 - abs * 8;
5983
6125
  const hue = clamped >= 0 ? 142 : 0;
5984
6126
  return `hsl(${hue} 60% ${lightness}%)`;
5985
6127
  }
5986
- function heatTextColor(z58) {
5987
- const abs = Math.abs(z58);
5988
- if (abs > 2) return z58 >= 0 ? "#14532d" : "#7f1d1d";
5989
- 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";
5990
6132
  return "var(--foreground)";
5991
6133
  }
5992
6134
  var th2 = {
@@ -6606,7 +6748,7 @@ function WaterfallChartResolver(p) {
6606
6748
  ] }) });
6607
6749
  }
6608
6750
  init_ThemeContext();
6609
- var FlowGraph2 = React33.lazy(
6751
+ var FlowGraph2 = React41.lazy(
6610
6752
  () => Promise.resolve().then(() => (init_FlowGraph(), FlowGraph_exports)).then((m) => ({ default: m.FlowGraph }))
6611
6753
  );
6612
6754
  function FlowCanvasRenderer({
@@ -6859,7 +7001,7 @@ function TrialBalanceResolver(p) {
6859
7001
  color: balanced ? "#15803d" : "#dc2626"
6860
7002
  }, children: balanced ? "\u2713 Balanced" : "\u2717 Unbalanced" })
6861
7003
  ] }),
6862
- /* @__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: [
6863
7005
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: ["Code", "Account", "Debit", "Credit"].map((h, i) => /* @__PURE__ */ jsx("th", { style: {
6864
7006
  fontSize: "11px",
6865
7007
  fontWeight: 500,
@@ -6880,7 +7022,7 @@ function TrialBalanceResolver(p) {
6880
7022
  gDebit += a.debit;
6881
7023
  gCredit += a.credit;
6882
7024
  });
6883
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
7025
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
6884
7026
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 4, style: {
6885
7027
  padding: "8px 12px",
6886
7028
  fontSize: "12px",
@@ -7037,7 +7179,7 @@ function AgingReportResolver(p) {
7037
7179
  p.asOfDate
7038
7180
  ] })
7039
7181
  ] }),
7040
- /* @__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: [
7041
7183
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
7042
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" }),
7043
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)),
@@ -7094,7 +7236,7 @@ function VarianceAnalysisResolver(p) {
7094
7236
  p.title && /* @__PURE__ */ jsx("p", { style: { fontFamily: "var(--font-serif)", fontSize: "15px", fontWeight: 600, color: "var(--foreground)", letterSpacing: "-0.005em" }, children: p.title }),
7095
7237
  p.period && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: p.period })
7096
7238
  ] }),
7097
- /* @__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: [
7098
7240
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: ["Line Item", "Budget", "Actual", "Variance $", "Variance %", ""].map((h, i) => /* @__PURE__ */ jsx("th", { style: {
7099
7241
  fontSize: "11px",
7100
7242
  fontWeight: 500,
@@ -7212,6 +7354,8 @@ function StackedBreakdownResolver(p) {
7212
7354
  alignItems: "center",
7213
7355
  gap: "6px",
7214
7356
  fontSize: "12px",
7357
+ maxWidth: "100%",
7358
+ minWidth: 0,
7215
7359
  color: isVisible(cat.name) ? MUTED2 : "#b3b3b3",
7216
7360
  cursor: "pointer",
7217
7361
  userSelect: "none",
@@ -7223,12 +7367,13 @@ function StackedBreakdownResolver(p) {
7223
7367
  width: "10px",
7224
7368
  height: "10px",
7225
7369
  borderRadius: "2px",
7370
+ flexShrink: 0,
7226
7371
  background: (_a2 = cat.color) != null ? _a2 : PALETTE2[ci % PALETTE2.length],
7227
7372
  display: "inline-block",
7228
7373
  opacity: isVisible(cat.name) ? 1 : 0.3,
7229
7374
  transition: "opacity 0.15s"
7230
7375
  } }),
7231
- cat.name
7376
+ /* @__PURE__ */ jsx("span", { style: TRUNCATE, title: cat.name, children: cat.name })
7232
7377
  ]
7233
7378
  },
7234
7379
  cat.name
@@ -7250,7 +7395,7 @@ function StackedBreakdownResolver(p) {
7250
7395
  ((_b2 = p.periods) != null ? _b2 : []).map((_, pi) => {
7251
7396
  var _a3, _b3;
7252
7397
  const v = pi < ((_a3 = cat.values) != null ? _a3 : []).length ? ((_b3 = cat.values) != null ? _b3 : [])[pi] : 0;
7253
- 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);
7254
7399
  })
7255
7400
  ] }, cat.name);
7256
7401
  }),
@@ -7623,7 +7768,7 @@ function ReconciliationViewResolver(p) {
7623
7768
  {
7624
7769
  style: {
7625
7770
  display: "grid",
7626
- gridTemplateColumns: "repeat(auto-fit, minmax(90px, 1fr))",
7771
+ gridTemplateColumns: "repeat(auto-fit, minmax(min(120px, 100%), 1fr))",
7627
7772
  gap: "0",
7628
7773
  marginBottom: "14px",
7629
7774
  borderRadius: "10px",
@@ -7631,31 +7776,28 @@ function ReconciliationViewResolver(p) {
7631
7776
  overflow: "hidden"
7632
7777
  },
7633
7778
  children: [
7634
- /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px", background: PAPER2 }, children: [
7779
+ /* @__PURE__ */ jsxs("div", { style: { padding: "10px 12px", background: PAPER2, minWidth: 0 }, children: [
7635
7780
  /* @__PURE__ */ jsx(
7636
7781
  "div",
7637
7782
  {
7638
- style: {
7783
+ style: __spreadValues({
7639
7784
  fontSize: "10px",
7640
7785
  fontWeight: 500,
7641
7786
  color: MUTED2,
7642
7787
  textTransform: "uppercase",
7643
7788
  letterSpacing: "0.04em",
7644
7789
  marginBottom: "4px"
7645
- },
7790
+ }, TRUNCATE),
7646
7791
  children: sourceA.label
7647
7792
  }
7648
7793
  ),
7649
7794
  /* @__PURE__ */ jsx(
7650
- "div",
7795
+ FitText,
7651
7796
  {
7652
- style: {
7653
- fontSize: "15px",
7654
- fontWeight: 600,
7655
- color: "var(--foreground)",
7656
- fontVariantNumeric: "tabular-nums",
7657
- letterSpacing: "-0.01em"
7658
- },
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" },
7659
7801
  children: fmt6(balanceA, p.currency)
7660
7802
  }
7661
7803
  )
@@ -7667,33 +7809,31 @@ function ReconciliationViewResolver(p) {
7667
7809
  padding: "10px 12px",
7668
7810
  background: PAPER2,
7669
7811
  borderLeft: `1px solid ${BORDER4}`,
7670
- borderRight: `1px solid ${BORDER4}`
7812
+ borderRight: `1px solid ${BORDER4}`,
7813
+ minWidth: 0
7671
7814
  },
7672
7815
  children: [
7673
7816
  /* @__PURE__ */ jsx(
7674
7817
  "div",
7675
7818
  {
7676
- style: {
7819
+ style: __spreadValues({
7677
7820
  fontSize: "10px",
7678
7821
  fontWeight: 500,
7679
7822
  color: MUTED2,
7680
7823
  textTransform: "uppercase",
7681
7824
  letterSpacing: "0.04em",
7682
7825
  marginBottom: "4px"
7683
- },
7826
+ }, TRUNCATE),
7684
7827
  children: sourceB.label
7685
7828
  }
7686
7829
  ),
7687
7830
  /* @__PURE__ */ jsx(
7688
- "div",
7831
+ FitText,
7689
7832
  {
7690
- style: {
7691
- fontSize: "15px",
7692
- fontWeight: 600,
7693
- color: "var(--foreground)",
7694
- fontVariantNumeric: "tabular-nums",
7695
- letterSpacing: "-0.01em"
7696
- },
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" },
7697
7837
  children: fmt6(balanceB, p.currency)
7698
7838
  }
7699
7839
  )
@@ -7705,7 +7845,8 @@ function ReconciliationViewResolver(p) {
7705
7845
  {
7706
7846
  style: {
7707
7847
  padding: "10px 12px",
7708
- background: difference === 0 ? "#f0fdf4" : "#fef2f2"
7848
+ background: difference === 0 ? "#f0fdf4" : "#fef2f2",
7849
+ minWidth: 0
7709
7850
  },
7710
7851
  children: [
7711
7852
  /* @__PURE__ */ jsxs(
@@ -7745,15 +7886,12 @@ function ReconciliationViewResolver(p) {
7745
7886
  }
7746
7887
  ),
7747
7888
  /* @__PURE__ */ jsx(
7748
- "div",
7889
+ FitText,
7749
7890
  {
7750
- style: {
7751
- fontSize: "15px",
7752
- fontWeight: 700,
7753
- color: difference === 0 ? MATCH_GREEN : DIFF_RED,
7754
- fontVariantNumeric: "tabular-nums",
7755
- letterSpacing: "-0.01em"
7756
- },
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" },
7757
7895
  children: fmt6(difference, p.currency)
7758
7896
  }
7759
7897
  )
@@ -8270,10 +8408,10 @@ function useFullscreen(ref) {
8270
8408
  // src/composites/document-preview/resolver.tsx
8271
8409
  init_theme();
8272
8410
  init_ThemeContext();
8273
- var PdfViewer2 = React33.lazy(
8411
+ var PdfViewer2 = React41.lazy(
8274
8412
  () => Promise.resolve().then(() => (init_PdfViewer(), PdfViewer_exports)).then((m) => ({ default: m.PdfViewer }))
8275
8413
  );
8276
- var ExcelViewer2 = React33.lazy(
8414
+ var ExcelViewer2 = React41.lazy(
8277
8415
  () => Promise.resolve().then(() => (init_ExcelViewer(), ExcelViewer_exports)).then((m) => ({ default: m.ExcelViewer }))
8278
8416
  );
8279
8417
  var highlightColors = {
@@ -9229,7 +9367,7 @@ function EngagementPipelineResolver(p) {
9229
9367
  const color = (_a2 = statusColor2[phase.status]) != null ? _a2 : "#d6d3d1";
9230
9368
  const isCurrent = i === activeIdx;
9231
9369
  const size = isCurrent ? 28 : 20;
9232
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
9370
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
9233
9371
  i > 0 && /* @__PURE__ */ jsx(
9234
9372
  "div",
9235
9373
  {
@@ -9557,7 +9695,7 @@ function EntityCardGridResolver(p) {
9557
9695
  {
9558
9696
  style: {
9559
9697
  display: "grid",
9560
- gridTemplateColumns: `repeat(auto-fit, minmax(220px, 1fr))`,
9698
+ gridTemplateColumns: `repeat(auto-fit, minmax(min(220px, 100%), 1fr))`,
9561
9699
  gap: "12px",
9562
9700
  width: "100%"
9563
9701
  },
@@ -9648,7 +9786,7 @@ function EntityCardGridResolver(p) {
9648
9786
  {
9649
9787
  style: {
9650
9788
  display: "grid",
9651
- 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",
9652
9790
  gap: "6px 12px",
9653
9791
  borderTop: `1px solid ${BORDER4}`,
9654
9792
  paddingTop: "8px"
@@ -11395,7 +11533,7 @@ function FileCard({
11395
11533
  whiteSpace: "nowrap"
11396
11534
  },
11397
11535
  children: [
11398
- metaTokens.map((t, i) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
11536
+ metaTokens.map((t, i) => /* @__PURE__ */ jsxs(React41.Fragment, { children: [
11399
11537
  i > 0 && /* @__PURE__ */ jsx("span", { style: { color: "#c4c4c4" }, children: "\xB7" }),
11400
11538
  /* @__PURE__ */ jsx("span", { children: t })
11401
11539
  ] }, i)),
@@ -11879,9 +12017,9 @@ function ValueCell({ item }) {
11879
12017
  )
11880
12018
  ] });
11881
12019
  case "currency":
11882
- 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 });
11883
12021
  default:
11884
- 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 }) });
11885
12023
  }
11886
12024
  }
11887
12025
  function KVRow({ item, isLast, index }) {
@@ -11914,7 +12052,7 @@ function KVRow({ item, isLast, index }) {
11914
12052
  children: item.key
11915
12053
  }
11916
12054
  ),
11917
- /* @__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 }) }),
11918
12056
  item.copyable && /* @__PURE__ */ jsx(CopyButton, { value: item.value, rowHovered: hovered })
11919
12057
  ]
11920
12058
  }
@@ -11970,7 +12108,7 @@ function KeyValueListResolver(p) {
11970
12108
  var _a3;
11971
12109
  return sum + ((_a3 = g.items) != null ? _a3 : []).length;
11972
12110
  }, 0);
11973
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12111
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
11974
12112
  /* @__PURE__ */ jsxs(
11975
12113
  "div",
11976
12114
  {
@@ -12106,7 +12244,7 @@ function BalanceSheetResolver(p) {
12106
12244
  color: balanced ? "#15803d" : "#dc2626"
12107
12245
  }, children: balanced ? "\u2713 A = L + E" : "\u2717 Out of Balance" })
12108
12246
  ] }),
12109
- /* @__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: [
12110
12248
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
12111
12249
  /* @__PURE__ */ jsx("th", { style: {
12112
12250
  fontSize: "11px",
@@ -12148,7 +12286,7 @@ function BalanceSheetResolver(p) {
12148
12286
  /* @__PURE__ */ jsxs("tbody", { children: [
12149
12287
  ((_p = p.sections) != null ? _p : []).map((section) => {
12150
12288
  var _a2;
12151
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12289
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12152
12290
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, style: {
12153
12291
  padding: "8px 12px",
12154
12292
  fontSize: "12px",
@@ -12161,7 +12299,7 @@ function BalanceSheetResolver(p) {
12161
12299
  }, children: (_a2 = categoryLabels2[section.category]) != null ? _a2 : section.category }) }),
12162
12300
  section.subsections.map((sub, si) => {
12163
12301
  var _a3;
12164
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12302
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12165
12303
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan, style: {
12166
12304
  padding: "6px 10px 6px 24px",
12167
12305
  fontSize: "12px",
@@ -12323,7 +12461,7 @@ function IncomeStatementResolver(p) {
12323
12461
  ].filter(Boolean).join(" \xB7 ") })
12324
12462
  ] }),
12325
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 }),
12326
- /* @__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: [
12327
12465
  /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
12328
12466
  /* @__PURE__ */ jsx("th", { style: {
12329
12467
  fontSize: "11px",
@@ -12337,7 +12475,7 @@ function IncomeStatementResolver(p) {
12337
12475
  textAlign: "left",
12338
12476
  whiteSpace: "nowrap"
12339
12477
  }, children: "\xA0" }),
12340
- periods.map((period) => /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12478
+ periods.map((period) => /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12341
12479
  /* @__PURE__ */ jsx("th", { style: {
12342
12480
  fontSize: "11px",
12343
12481
  fontWeight: 500,
@@ -12368,7 +12506,7 @@ function IncomeStatementResolver(p) {
12368
12506
  sections.map((section, si) => {
12369
12507
  var _a2;
12370
12508
  const isSubtotal = section.sectionType === "subtotal";
12371
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12509
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12372
12510
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: colCount, style: {
12373
12511
  padding: "8px 12px",
12374
12512
  fontSize: "12px",
@@ -12399,7 +12537,7 @@ function IncomeStatementResolver(p) {
12399
12537
  var _a4;
12400
12538
  const val = (_a4 = amounts[pi]) != null ? _a4 : 0;
12401
12539
  const isNeg = val < 0;
12402
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12540
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12403
12541
  /* @__PURE__ */ jsx("td", { style: {
12404
12542
  padding: "6px 10px",
12405
12543
  fontSize: "13px",
@@ -12434,7 +12572,7 @@ function IncomeStatementResolver(p) {
12434
12572
  var _a2;
12435
12573
  const val = (_a2 = grossProfit[pi]) != null ? _a2 : 0;
12436
12574
  const isNeg = val < 0;
12437
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12575
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12438
12576
  /* @__PURE__ */ jsx("td", { style: {
12439
12577
  padding: "8px 10px",
12440
12578
  fontSize: "12px",
@@ -12469,7 +12607,7 @@ function IncomeStatementResolver(p) {
12469
12607
  var _a2;
12470
12608
  const val = (_a2 = operatingIncome[pi]) != null ? _a2 : 0;
12471
12609
  const isNeg = val < 0;
12472
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12610
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12473
12611
  /* @__PURE__ */ jsx("td", { style: {
12474
12612
  padding: "8px 10px",
12475
12613
  fontSize: "12px",
@@ -12503,7 +12641,7 @@ function IncomeStatementResolver(p) {
12503
12641
  var _a2;
12504
12642
  const val = (_a2 = netIncome[pi]) != null ? _a2 : 0;
12505
12643
  const isNeg = val < 0;
12506
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12644
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12507
12645
  /* @__PURE__ */ jsx("td", { style: {
12508
12646
  padding: "10px 10px",
12509
12647
  fontSize: "13px",
@@ -12723,7 +12861,7 @@ function CashFlowStatementResolver(p) {
12723
12861
  /* @__PURE__ */ jsxs("tbody", { children: [
12724
12862
  activities.map((activity, ai) => {
12725
12863
  var _a2, _b2, _c2;
12726
- return /* @__PURE__ */ jsxs(React33.Fragment, { children: [
12864
+ return /* @__PURE__ */ jsxs(React41.Fragment, { children: [
12727
12865
  ai > 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
12728
12866
  "td",
12729
12867
  {
@@ -13106,6 +13244,7 @@ function GeneralLedgerResolver(p) {
13106
13244
  {
13107
13245
  style: {
13108
13246
  overflowX: "auto",
13247
+ minWidth: 0,
13109
13248
  borderRadius: "0.75rem",
13110
13249
  border: `1px solid ${BORDER4}`,
13111
13250
  boxShadow: "0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.04)"
@@ -17020,6 +17159,729 @@ function PipelinePreviewResolver(p) {
17020
17159
  )
17021
17160
  ] }) });
17022
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
+ }
17023
17885
  function resolveUI(rawPayload) {
17024
17886
  const payload = coercePayload(rawPayload);
17025
17887
  switch (payload.type) {
@@ -17135,6 +17997,8 @@ function resolveUI(rawPayload) {
17135
17997
  return /* @__PURE__ */ jsx(IntegrationsListResolver, __spreadValues({}, payload));
17136
17998
  case "pipeline-preview":
17137
17999
  return /* @__PURE__ */ jsx(PipelinePreviewResolver, __spreadValues({}, payload));
18000
+ case "workflow-stepper":
18001
+ return /* @__PURE__ */ jsx(WorkflowStepperResolver, __spreadValues({}, payload));
17138
18002
  default: {
17139
18003
  return /* @__PURE__ */ jsx(
17140
18004
  "div",
@@ -17458,9 +18322,9 @@ function DocGlyph({ color }) {
17458
18322
  /* @__PURE__ */ jsx("path", { d: "M14 2v6h6" })
17459
18323
  ] });
17460
18324
  }
17461
- function FileUploadField({ field, value, onChange, disabled, onFileUpload, error }) {
18325
+ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error, dense }) {
17462
18326
  const { MUTED: MUTED2, ACCENT: ACCENT2, BORDER: BORDER4, PAPER: PAPER2 } = useTheme();
17463
- const keyRef = React33.useRef(0);
18327
+ const keyRef = React41.useRef(0);
17464
18328
  const [entries, setEntries] = useState(() => {
17465
18329
  const arr = Array.isArray(value) ? value : value && typeof value === "object" ? [value] : [];
17466
18330
  return arr.map((item) => {
@@ -17469,11 +18333,11 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17469
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 };
17470
18334
  });
17471
18335
  });
17472
- const entriesRef = React33.useRef(entries);
18336
+ const entriesRef = React41.useRef(entries);
17473
18337
  entriesRef.current = entries;
17474
18338
  const [dragOver, setDragOver] = useState(false);
17475
- const inputRef = React33.useRef(null);
17476
- React33.useEffect(() => {
18339
+ const inputRef = React41.useRef(null);
18340
+ React41.useEffect(() => {
17477
18341
  ensureFileUploadKeyframes();
17478
18342
  }, []);
17479
18343
  const interactive = !disabled;
@@ -17517,6 +18381,7 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17517
18381
  const removeEntry = (key) => commit(entriesRef.current.filter((e) => e.key !== key));
17518
18382
  const borderColor = dragOver ? ACCENT2 : error ? "#dc2626" : BORDER4;
17519
18383
  const hasFiles = entries.length > 0;
18384
+ const denseRow = !!dense && !hasFiles;
17520
18385
  return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
17521
18386
  /* @__PURE__ */ jsxs(
17522
18387
  "div",
@@ -17538,12 +18403,12 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17538
18403
  onDrop: handleDrop,
17539
18404
  style: {
17540
18405
  display: "flex",
17541
- flexDirection: "column",
18406
+ flexDirection: denseRow ? "row" : "column",
17542
18407
  alignItems: "center",
17543
- justifyContent: "center",
17544
- gap: hasFiles ? "4px" : "7px",
17545
- padding: hasFiles ? "12px 14px" : "18px 14px",
17546
- 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",
17547
18412
  border: `1.5px dashed ${borderColor}`,
17548
18413
  borderRadius: "0.75rem",
17549
18414
  background: dragOver ? `${ACCENT2}0d` : PAPER2,
@@ -17556,11 +18421,11 @@ function FileUploadField({ field, value, onChange, disabled, onFileUpload, error
17556
18421
  },
17557
18422
  children: [
17558
18423
  /* @__PURE__ */ jsx(UploadGlyph, { color: dragOver ? ACCENT2 : MUTED2 }),
17559
- /* @__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: [
17560
18425
  /* @__PURE__ */ jsx("span", { style: { color: ACCENT2, fontWeight: 600 }, children: hasFiles ? "Add more files" : "Click to upload" }),
17561
18426
  /* @__PURE__ */ jsx("span", { style: { color: MUTED2 }, children: " or drag and drop" })
17562
18427
  ] }),
17563
- !hasFiles && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: hint }),
18428
+ !hasFiles && !denseRow && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: MUTED2 }, children: hint }),
17564
18429
  /* @__PURE__ */ jsx("input", { ref: inputRef, type: "file", multiple: true, accept, onChange: handleInput, disabled: !interactive, style: { display: "none" }, tabIndex: -1 })
17565
18430
  ]
17566
18431
  }
@@ -17598,7 +18463,7 @@ var FIELD_REGISTRY = {
17598
18463
  checkbox: CheckboxField,
17599
18464
  file_upload: FileUploadField
17600
18465
  };
17601
- function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload }) {
18466
+ function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload, dense }) {
17602
18467
  const { MUTED: MUTED2 } = useTheme();
17603
18468
  const FieldComp = FIELD_REGISTRY[field.field_type] || FIELD_REGISTRY.text;
17604
18469
  return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "3px" }, children: [
@@ -17606,12 +18471,12 @@ function FieldRenderer({ field, value, onChange, disabled, error, onFileUpload }
17606
18471
  field.label,
17607
18472
  field.required && /* @__PURE__ */ jsx("span", { style: { color: "#dc2626", marginLeft: "2px" }, children: "*" })
17608
18473
  ] }),
17609
- field.description && /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: MUTED2, lineHeight: 1.4 }, children: field.description }),
17610
- /* @__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 }),
17611
18476
  error && /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", color: "#dc2626", fontWeight: 500, marginTop: "1px" }, children: error })
17612
18477
  ] });
17613
18478
  }
17614
- var SlotErrorBoundary = class extends React33.Component {
18479
+ var SlotErrorBoundary = class extends React41.Component {
17615
18480
  constructor(props) {
17616
18481
  super(props);
17617
18482
  this.state = { hasError: false };
@@ -17790,20 +18655,21 @@ function S3(t) {
17790
18655
  }
17791
18656
  };
17792
18657
  }
17793
- function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload }) {
18658
+ function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload, dense, hideActions }) {
17794
18659
  var _a;
17795
18660
  const t = useTheme();
17796
18661
  const S4 = useMemo(() => makeStyles(t), [t]);
17797
18662
  const block = builder.blocks[0];
17798
18663
  if (!block) return null;
17799
18664
  if (disabled) return /* @__PURE__ */ jsx(BuilderRecap, { builder, state });
17800
- return /* @__PURE__ */ jsxs("div", { style: S4.card, children: [
17801
- /* @__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: [
17802
18668
  /* @__PURE__ */ jsx("p", { style: S4.title, children: builder.title }),
17803
18669
  builder.description && /* @__PURE__ */ jsx("p", { style: { fontSize: "12px", color: t.MUTED, lineHeight: 1.45, margin: 0 }, children: builder.description })
17804
18670
  ] }),
17805
18671
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsx(ContextSlot, { payload: block.context }),
17806
- /* @__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(
17807
18673
  FieldRenderer,
17808
18674
  {
17809
18675
  field,
@@ -17811,15 +18677,16 @@ function FormBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUploa
17811
18677
  onChange: (v) => state.setFieldValue(block.id, field.name, v),
17812
18678
  disabled,
17813
18679
  error: state.getError(block.id, field.name),
18680
+ dense,
17814
18681
  onFileUpload
17815
18682
  },
17816
18683
  `${block.id}:${field.name}`
17817
18684
  )) }),
17818
- !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: [
17819
18686
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
17820
18687
  onCancel && /* @__PURE__ */ jsx("button", { type: "button", onClick: onCancel, style: S4.cancelBtn, children: builder.cancel_label || "Cancel" }),
17821
18688
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSubmit, style: S4.submitBtn, children: builder.submit_label || "Submit" })
17822
- ] }) : /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "4px 0" }, children: "Submitted" })
18689
+ ] })
17823
18690
  ] });
17824
18691
  }
17825
18692
  function makeStyles(t) {
@@ -17876,7 +18743,7 @@ function makeStyles(t) {
17876
18743
 
17877
18744
  // src/builders/StepperBuilder.tsx
17878
18745
  init_ThemeContext();
17879
- function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload }) {
18746
+ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUpload, dense }) {
17880
18747
  var _a;
17881
18748
  const t = useTheme();
17882
18749
  const S4 = useMemo(() => makeStyles2(t), [t]);
@@ -17892,14 +18759,16 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17892
18759
  if (state.validateBlock(idx)) state.setCurrentBlock(idx + 1);
17893
18760
  };
17894
18761
  const handleBack = () => state.setCurrentBlock(Math.max(idx - 1, 0));
17895
- 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: [
17896
18765
  /* @__PURE__ */ jsx("style", { children: "@keyframes agStepFade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}" }),
17897
- /* @__PURE__ */ jsxs("div", { style: S4.header, children: [
17898
- /* @__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: [
17899
18768
  /* @__PURE__ */ jsx("p", { style: S4.title, children: builder.title }),
17900
18769
  builder.description && /* @__PURE__ */ jsx("p", { style: S4.subtitle, children: builder.description })
17901
18770
  ] }),
17902
- !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: [
17903
18772
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "baseline", justifyContent: "space-between", gap: "10px" }, children: [
17904
18773
  /* @__PURE__ */ jsx("span", { style: S4.currentTitle, children: (block == null ? void 0 : block.title) || `Step ${idx + 1}` }),
17905
18774
  /* @__PURE__ */ jsxs("span", { style: S4.stepCount, children: [
@@ -17912,7 +18781,7 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17912
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}%` }) }) })
17913
18782
  ] })
17914
18783
  ] }),
17915
- /* @__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: [
17916
18785
  block.description && /* @__PURE__ */ jsx("div", { style: S4.blockDesc, children: block.description }),
17917
18786
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsx(ContextSlot, { payload: block.context }),
17918
18787
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "12px" }, children: (block.fields || []).map((field) => /* @__PURE__ */ jsx(
@@ -17923,12 +18792,13 @@ function StepperBuilder({ builder, state, onSubmit, onCancel, disabled, onFileUp
17923
18792
  onChange: (v) => state.setFieldValue(block.id, field.name, v),
17924
18793
  disabled,
17925
18794
  error: state.getError(block.id, field.name),
18795
+ dense,
17926
18796
  onFileUpload
17927
18797
  },
17928
18798
  `${block.id}:${field.name}`
17929
18799
  )) })
17930
18800
  ] }, idx) }),
17931
- !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: [
17932
18802
  !isFirst && /* @__PURE__ */ jsx("button", { type: "button", onClick: handleBack, style: S4.cancelBtn, children: "Back" }),
17933
18803
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
17934
18804
  onCancel && /* @__PURE__ */ jsx("button", { type: "button", onClick: onCancel, style: S4.cancelBtn, children: builder.cancel_label || "Cancel" }),
@@ -18052,21 +18922,22 @@ function makeStyles2(t) {
18052
18922
 
18053
18923
  // src/builders/EscalationCard.tsx
18054
18924
  init_ThemeContext();
18055
- function EscalationCard({ builder, state, onSubmit, disabled, onFileUpload }) {
18925
+ function EscalationCard({ builder, state, onSubmit, disabled, onFileUpload, hideActions, dense }) {
18056
18926
  var _a;
18057
18927
  const t = useTheme();
18058
18928
  const S4 = useMemo(() => makeStyles3(t), [t]);
18059
18929
  const block = builder.blocks[0];
18060
18930
  if (!block) return null;
18061
18931
  if (disabled) return /* @__PURE__ */ jsx(BuilderRecap, { builder, state });
18062
- return /* @__PURE__ */ jsxs("div", { style: S4.card, children: [
18063
- 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 }),
18064
18935
  ((_a = block.context) == null ? void 0 : _a.type) && /* @__PURE__ */ jsx(ContextSlot, { payload: block.context }),
18065
- /* @__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}`)) }),
18066
- !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: [
18067
18938
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
18068
18939
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onSubmit, style: S4.continueBtn, children: builder.submit_label || "Continue" })
18069
- ] }) : /* @__PURE__ */ jsx("div", { style: { fontSize: "11px", fontWeight: 600, color: t.MUTED, textAlign: "center", padding: "2px 0" }, children: "Submitted" })
18940
+ ] })
18070
18941
  ] });
18071
18942
  }
18072
18943
  function makeStyles3(t) {
@@ -18200,24 +19071,47 @@ function useBuilderState(blocks) {
18200
19071
  isMultiBlock
18201
19072
  };
18202
19073
  }
18203
- 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
+ }) {
18204
19085
  const state = useBuilderState(builder.blocks);
18205
19086
  const kind = builder.builder_kind || "form";
18206
- const handleSubmit = useCallback(() => {
18207
- if (disabled) return;
18208
- if (!state.validateAll()) return;
19087
+ const buildSubmission = useCallback(() => {
18209
19088
  const blocks = (builder.blocks || []).map((b) => ({
18210
19089
  id: b.id,
18211
19090
  title: b.title,
18212
19091
  values: Object.fromEntries((b.fields || []).map((f) => [f.name, state.getValue(b.id, f.name)]))
18213
19092
  }));
18214
- const submission = __spreadValues({
19093
+ return __spreadValues({
18215
19094
  builder_id: builder.builder_id,
18216
19095
  builder_kind: kind,
18217
19096
  blocks
18218
19097
  }, blocks.length === 1 ? { values: blocks[0].values } : {});
18219
- onSubmit(submission);
18220
- }, [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]);
18221
19115
  switch (kind) {
18222
19116
  case "stepper":
18223
19117
  return /* @__PURE__ */ jsx(
@@ -18228,7 +19122,8 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18228
19122
  onSubmit: handleSubmit,
18229
19123
  onCancel,
18230
19124
  disabled,
18231
- onFileUpload
19125
+ onFileUpload,
19126
+ dense
18232
19127
  }
18233
19128
  );
18234
19129
  case "escalation":
@@ -18239,7 +19134,9 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18239
19134
  state,
18240
19135
  onSubmit: handleSubmit,
18241
19136
  disabled,
18242
- onFileUpload
19137
+ onFileUpload,
19138
+ hideActions,
19139
+ dense
18243
19140
  }
18244
19141
  );
18245
19142
  default:
@@ -18251,13 +19148,15 @@ function BuilderFormResolver({ builder, onSubmit, onCancel, disabled, onFileUplo
18251
19148
  onSubmit: handleSubmit,
18252
19149
  onCancel,
18253
19150
  disabled,
18254
- onFileUpload
19151
+ onFileUpload,
19152
+ dense,
19153
+ hideActions
18255
19154
  }
18256
19155
  );
18257
19156
  }
18258
19157
  }
18259
19158
  function resolveBuilder(payload, callbacks) {
18260
- return React33.createElement(BuilderFormResolver, __spreadValues({
19159
+ return React41.createElement(BuilderFormResolver, __spreadValues({
18261
19160
  builder: payload
18262
19161
  }, callbacks));
18263
19162
  }
@@ -18265,6 +19164,6 @@ function resolveBuilder(payload, callbacks) {
18265
19164
  // src/index.ts
18266
19165
  init_Markdown();
18267
19166
 
18268
- 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 };
18269
19168
  //# sourceMappingURL=index.js.map
18270
19169
  //# sourceMappingURL=index.js.map