@adoptai/genui-components 0.1.33 → 0.1.54

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 (128) hide show
  1. package/README.md +5 -0
  2. package/dist/builders/BlockForm.d.ts +31 -0
  3. package/dist/builders/BlockForm.d.ts.map +1 -0
  4. package/dist/builders/BuilderForm.d.ts +25 -2
  5. package/dist/builders/BuilderForm.d.ts.map +1 -1
  6. package/dist/builders/BuilderRecap.d.ts.map +1 -1
  7. package/dist/builders/ContextSlot.d.ts +6 -0
  8. package/dist/builders/ContextSlot.d.ts.map +1 -1
  9. package/dist/builders/FieldRenderer.d.ts +9 -2
  10. package/dist/builders/FieldRenderer.d.ts.map +1 -1
  11. package/dist/builders/StepperBuilder.d.ts +9 -2
  12. package/dist/builders/StepperBuilder.d.ts.map +1 -1
  13. package/dist/builders/fields.d.ts +27 -2
  14. package/dist/builders/fields.d.ts.map +1 -1
  15. package/dist/builders/hooks.d.ts +17 -0
  16. package/dist/builders/hooks.d.ts.map +1 -1
  17. package/dist/builders/index.d.ts +5 -5
  18. package/dist/builders/index.d.ts.map +1 -1
  19. package/dist/builders/resolver.d.ts +14 -0
  20. package/dist/builders/resolver.d.ts.map +1 -1
  21. package/dist/builders/schemas.d.ts +196 -1
  22. package/dist/builders/schemas.d.ts.map +1 -1
  23. package/dist/composites/aging-report/resolver.cjs +1 -1
  24. package/dist/composites/aging-report/resolver.cjs.map +1 -1
  25. package/dist/composites/aging-report/resolver.js +1 -1
  26. package/dist/composites/aging-report/resolver.js.map +1 -1
  27. package/dist/composites/balance-sheet/resolver.cjs +1 -1
  28. package/dist/composites/balance-sheet/resolver.cjs.map +1 -1
  29. package/dist/composites/balance-sheet/resolver.js +1 -1
  30. package/dist/composites/balance-sheet/resolver.js.map +1 -1
  31. package/dist/composites/connect-integration/resolver.cjs +465 -0
  32. package/dist/composites/connect-integration/resolver.cjs.map +1 -0
  33. package/dist/composites/connect-integration/resolver.js +463 -0
  34. package/dist/composites/connect-integration/resolver.js.map +1 -0
  35. package/dist/composites/entity-card-grid/resolver.cjs +2 -2
  36. package/dist/composites/entity-card-grid/resolver.cjs.map +1 -1
  37. package/dist/composites/entity-card-grid/resolver.js +2 -2
  38. package/dist/composites/entity-card-grid/resolver.js.map +1 -1
  39. package/dist/composites/general-ledger/resolver.cjs +1 -0
  40. package/dist/composites/general-ledger/resolver.cjs.map +1 -1
  41. package/dist/composites/general-ledger/resolver.d.ts.map +1 -1
  42. package/dist/composites/general-ledger/resolver.js +1 -0
  43. package/dist/composites/general-ledger/resolver.js.map +1 -1
  44. package/dist/composites/income-statement/resolver.cjs +1 -1
  45. package/dist/composites/income-statement/resolver.cjs.map +1 -1
  46. package/dist/composites/income-statement/resolver.js +1 -1
  47. package/dist/composites/income-statement/resolver.js.map +1 -1
  48. package/dist/composites/integrations-list/resolver.cjs +511 -0
  49. package/dist/composites/integrations-list/resolver.cjs.map +1 -0
  50. package/dist/composites/integrations-list/resolver.js +509 -0
  51. package/dist/composites/integrations-list/resolver.js.map +1 -0
  52. package/dist/composites/journal-entry/resolver.cjs +2 -2
  53. package/dist/composites/journal-entry/resolver.cjs.map +1 -1
  54. package/dist/composites/journal-entry/resolver.js +2 -2
  55. package/dist/composites/journal-entry/resolver.js.map +1 -1
  56. package/dist/composites/key-value-list/resolver.cjs +28 -3
  57. package/dist/composites/key-value-list/resolver.cjs.map +1 -1
  58. package/dist/composites/key-value-list/resolver.d.ts.map +1 -1
  59. package/dist/composites/key-value-list/resolver.js +28 -3
  60. package/dist/composites/key-value-list/resolver.js.map +1 -1
  61. package/dist/composites/pipeline-preview/resolver.cjs +926 -0
  62. package/dist/composites/pipeline-preview/resolver.cjs.map +1 -0
  63. package/dist/composites/pipeline-preview/resolver.js +924 -0
  64. package/dist/composites/pipeline-preview/resolver.js.map +1 -0
  65. package/dist/composites/reconciliation-view/resolver.cjs +90 -32
  66. package/dist/composites/reconciliation-view/resolver.cjs.map +1 -1
  67. package/dist/composites/reconciliation-view/resolver.d.ts.map +1 -1
  68. package/dist/composites/reconciliation-view/resolver.js +91 -33
  69. package/dist/composites/reconciliation-view/resolver.js.map +1 -1
  70. package/dist/composites/stacked-breakdown/resolver.cjs +13 -2
  71. package/dist/composites/stacked-breakdown/resolver.cjs.map +1 -1
  72. package/dist/composites/stacked-breakdown/resolver.d.ts.map +1 -1
  73. package/dist/composites/stacked-breakdown/resolver.js +13 -2
  74. package/dist/composites/stacked-breakdown/resolver.js.map +1 -1
  75. package/dist/composites/stat-grid/resolver.cjs +83 -5
  76. package/dist/composites/stat-grid/resolver.cjs.map +1 -1
  77. package/dist/composites/stat-grid/resolver.d.ts.map +1 -1
  78. package/dist/composites/stat-grid/resolver.js +84 -6
  79. package/dist/composites/stat-grid/resolver.js.map +1 -1
  80. package/dist/composites/trial-balance/resolver.cjs +1 -1
  81. package/dist/composites/trial-balance/resolver.cjs.map +1 -1
  82. package/dist/composites/trial-balance/resolver.js +1 -1
  83. package/dist/composites/trial-balance/resolver.js.map +1 -1
  84. package/dist/composites/variance-analysis/resolver.cjs +1 -1
  85. package/dist/composites/variance-analysis/resolver.cjs.map +1 -1
  86. package/dist/composites/variance-analysis/resolver.js +1 -1
  87. package/dist/composites/variance-analysis/resolver.js.map +1 -1
  88. package/dist/composites/workflow-stepper/resolver.cjs +978 -0
  89. package/dist/composites/workflow-stepper/resolver.cjs.map +1 -0
  90. package/dist/composites/workflow-stepper/resolver.d.ts +20 -0
  91. package/dist/composites/workflow-stepper/resolver.d.ts.map +1 -0
  92. package/dist/composites/workflow-stepper/resolver.js +971 -0
  93. package/dist/composites/workflow-stepper/resolver.js.map +1 -0
  94. package/dist/index.cjs +2497 -972
  95. package/dist/index.cjs.map +1 -1
  96. package/dist/index.d.ts +7 -0
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +2344 -827
  99. package/dist/index.js.map +1 -1
  100. package/dist/renderer.cjs +1071 -213
  101. package/dist/renderer.cjs.map +1 -1
  102. package/dist/renderer.js +933 -75
  103. package/dist/renderer.js.map +1 -1
  104. package/dist/resolver.cjs +1070 -212
  105. package/dist/resolver.cjs.map +1 -1
  106. package/dist/resolver.d.ts.map +1 -1
  107. package/dist/resolver.js +933 -75
  108. package/dist/resolver.js.map +1 -1
  109. package/dist/schemas/index.cjs +75 -1
  110. package/dist/schemas/index.cjs.map +1 -1
  111. package/dist/schemas/index.d.ts +123 -0
  112. package/dist/schemas/index.d.ts.map +1 -1
  113. package/dist/schemas/index.js +75 -1
  114. package/dist/schemas/index.js.map +1 -1
  115. package/dist/schemas/workflow-stepper.d.ts +123 -0
  116. package/dist/schemas/workflow-stepper.d.ts.map +1 -0
  117. package/dist/shared/FitText.d.ts +22 -0
  118. package/dist/shared/FitText.d.ts.map +1 -0
  119. package/dist/shared/InteractionContext.d.ts +20 -0
  120. package/dist/shared/InteractionContext.d.ts.map +1 -0
  121. package/dist/shared/styles.d.ts +14 -0
  122. package/dist/shared/styles.d.ts.map +1 -0
  123. package/dist/tool-definitions.json +115 -3
  124. package/package.json +2 -2
  125. package/dist/builders/EscalationCard.d.ts +0 -12
  126. package/dist/builders/EscalationCard.d.ts.map +0 -1
  127. package/dist/builders/FormBuilder.d.ts +0 -13
  128. package/dist/builders/FormBuilder.d.ts.map +0 -1
@@ -0,0 +1,971 @@
1
+ "use client";
2
+ import React4, { createContext, useContext, useState, useRef, useCallback, useEffect } from 'react';
3
+ import { toPng } from 'html-to-image';
4
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
+
6
+ var __defProp = Object.defineProperty;
7
+ var __defProps = Object.defineProperties;
8
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+
26
+ // src/shared/theme.ts
27
+ var BORDER = "#dedede";
28
+ var MUTED = "#777777";
29
+ var PAPER = "#f6f6f6";
30
+ var ACCENT = "#ff5000";
31
+ var ACCENT_SOFT = "#cc4000";
32
+ var SECONDARY = "#0364ff";
33
+ var CHART_PALETTE = [
34
+ "#ff5000",
35
+ "#0364ff",
36
+ "#16a34a",
37
+ "#dc2626",
38
+ "#7c3aed",
39
+ "#0891b2",
40
+ "#f59e0b",
41
+ "#6366f1",
42
+ "#ec4899",
43
+ "#84cc16",
44
+ "#e11d48",
45
+ "#0ea5e9"
46
+ ];
47
+ function ColumnSettingsPanel({ columns, hidden, onToggle, onShowAll, onHideAll }) {
48
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "6px", minWidth: "180px" }, children: [
49
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", paddingBottom: "4px", borderBottom: `1px solid ${BORDER}` }, children: [
50
+ /* @__PURE__ */ jsx(
51
+ "button",
52
+ {
53
+ onClick: onShowAll,
54
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: ACCENT, fontWeight: 500, padding: 0 },
55
+ children: "Show all"
56
+ }
57
+ ),
58
+ /* @__PURE__ */ jsx(
59
+ "button",
60
+ {
61
+ onClick: onHideAll,
62
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, fontWeight: 500, padding: 0 },
63
+ children: "Hide all"
64
+ }
65
+ )
66
+ ] }),
67
+ columns.map((col) => /* @__PURE__ */ jsxs(
68
+ "label",
69
+ {
70
+ style: { display: "flex", alignItems: "center", gap: "8px", cursor: "pointer", fontSize: "12px", color: "var(--foreground)" },
71
+ children: [
72
+ /* @__PURE__ */ jsx(
73
+ "input",
74
+ {
75
+ type: "checkbox",
76
+ checked: !hidden.has(col.key),
77
+ onChange: () => onToggle(col.key),
78
+ style: { accentColor: ACCENT, width: "14px", height: "14px", margin: 0, cursor: "pointer" }
79
+ }
80
+ ),
81
+ col.label
82
+ ]
83
+ },
84
+ col.key
85
+ ))
86
+ ] });
87
+ }
88
+ var DOT_COLOR = "#aaaaaa";
89
+ var DOT_HOVER = "#555555";
90
+ function ComponentActions({ children, onDownloadCSV, columnConfig, filename = "component" }) {
91
+ const [open, setOpen] = useState(false);
92
+ const [view, setView] = useState("main");
93
+ const contentRef = useRef(null);
94
+ const menuRef = useRef(null);
95
+ const btnRef = useRef(null);
96
+ const close = useCallback(() => {
97
+ setOpen(false);
98
+ setView("main");
99
+ }, []);
100
+ useEffect(() => {
101
+ if (!open) return;
102
+ const handler = (e) => {
103
+ var _a, _b;
104
+ if ((_a = menuRef.current) == null ? void 0 : _a.contains(e.target)) return;
105
+ if ((_b = btnRef.current) == null ? void 0 : _b.contains(e.target)) return;
106
+ close();
107
+ };
108
+ document.addEventListener("mousedown", handler);
109
+ return () => document.removeEventListener("mousedown", handler);
110
+ }, [open, close]);
111
+ const handleDownloadPNG = useCallback(async () => {
112
+ if (!contentRef.current) return;
113
+ try {
114
+ const url = await toPng(contentRef.current, { backgroundColor: "white", pixelRatio: 2 });
115
+ const a = document.createElement("a");
116
+ a.href = url;
117
+ a.download = `${filename}.png`;
118
+ a.click();
119
+ } catch (e) {
120
+ }
121
+ close();
122
+ }, [filename, close]);
123
+ const handleCSV = useCallback(() => {
124
+ onDownloadCSV == null ? void 0 : onDownloadCSV();
125
+ close();
126
+ }, [onDownloadCSV, close]);
127
+ return /* @__PURE__ */ jsxs("div", { style: { width: "100%", display: "flex", flexDirection: "column" }, children: [
128
+ /* @__PURE__ */ jsx("div", { ref: contentRef, style: { width: "100%" }, children }),
129
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "flex-end", marginTop: "4px", position: "relative", zIndex: 10, flexShrink: 0 }, children: [
130
+ /* @__PURE__ */ jsx(
131
+ "button",
132
+ {
133
+ ref: btnRef,
134
+ onClick: () => {
135
+ setOpen((o) => !o);
136
+ setView("main");
137
+ },
138
+ "aria-label": "Component actions",
139
+ style: {
140
+ background: "none",
141
+ border: "none",
142
+ cursor: "pointer",
143
+ padding: "4px 8px",
144
+ display: "flex",
145
+ gap: "3px",
146
+ alignItems: "center",
147
+ borderRadius: "6px",
148
+ transition: "background 0.15s"
149
+ },
150
+ onMouseEnter: (e) => {
151
+ e.currentTarget.style.background = "#f2f2f2";
152
+ e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_HOVER);
153
+ },
154
+ onMouseLeave: (e) => {
155
+ e.currentTarget.style.background = "none";
156
+ e.currentTarget.querySelectorAll("circle").forEach((c) => c.style.fill = DOT_COLOR);
157
+ },
158
+ children: /* @__PURE__ */ jsxs("svg", { width: "20", height: "6", viewBox: "0 0 20 6", children: [
159
+ /* @__PURE__ */ jsx("circle", { cx: "3", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
160
+ /* @__PURE__ */ jsx("circle", { cx: "10", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } }),
161
+ /* @__PURE__ */ jsx("circle", { cx: "17", cy: "3", r: "2", style: { fill: DOT_COLOR, transition: "fill 0.15s" } })
162
+ ] })
163
+ }
164
+ ),
165
+ open && /* @__PURE__ */ jsx(
166
+ "div",
167
+ {
168
+ ref: menuRef,
169
+ style: {
170
+ position: "absolute",
171
+ bottom: "100%",
172
+ right: 0,
173
+ marginBottom: "4px",
174
+ background: "white",
175
+ border: `1px solid ${BORDER}`,
176
+ borderRadius: "0.75rem",
177
+ boxShadow: "0 4px 12px rgba(0,0,0,0.06)",
178
+ zIndex: 50,
179
+ padding: view === "columns" ? "10px" : "4px",
180
+ minWidth: view === "columns" ? "200px" : "160px"
181
+ },
182
+ children: view === "main" ? /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
183
+ columnConfig && /* @__PURE__ */ jsx(MenuButton, { label: "Customize columns", onClick: () => setView("columns") }),
184
+ onDownloadCSV && /* @__PURE__ */ jsx(MenuButton, { label: "Download CSV", onClick: handleCSV }),
185
+ /* @__PURE__ */ jsx(MenuButton, { label: "Download PNG", onClick: handleDownloadPNG })
186
+ ] }) : /* @__PURE__ */ jsxs("div", { children: [
187
+ /* @__PURE__ */ jsx(
188
+ "button",
189
+ {
190
+ onClick: () => setView("main"),
191
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "11px", color: MUTED, marginBottom: "6px", padding: 0 },
192
+ children: "\u2190 Back"
193
+ }
194
+ ),
195
+ /* @__PURE__ */ jsx(
196
+ ColumnSettingsPanel,
197
+ {
198
+ columns: columnConfig.columns,
199
+ hidden: columnConfig.hidden,
200
+ onToggle: columnConfig.onToggle,
201
+ onShowAll: columnConfig.onShowAll,
202
+ onHideAll: columnConfig.onHideAll
203
+ }
204
+ )
205
+ ] })
206
+ }
207
+ )
208
+ ] })
209
+ ] });
210
+ }
211
+ function MenuButton({ label, onClick }) {
212
+ return /* @__PURE__ */ jsx(
213
+ "button",
214
+ {
215
+ onClick,
216
+ style: {
217
+ background: "none",
218
+ border: "none",
219
+ cursor: "pointer",
220
+ padding: "8px 12px",
221
+ fontSize: "12.5px",
222
+ color: "var(--foreground)",
223
+ textAlign: "left",
224
+ borderRadius: "8px",
225
+ transition: "background 0.15s",
226
+ whiteSpace: "nowrap"
227
+ },
228
+ onMouseEnter: (e) => e.currentTarget.style.background = "#f2f2f2",
229
+ onMouseLeave: (e) => e.currentTarget.style.background = "none",
230
+ children: label
231
+ }
232
+ );
233
+ }
234
+ var DEFAULT_TOKENS = {
235
+ BORDER,
236
+ MUTED,
237
+ PAPER,
238
+ ACCENT,
239
+ ACCENT_SOFT,
240
+ SECONDARY,
241
+ CHART_PALETTE: [...CHART_PALETTE]
242
+ };
243
+ var GenUIThemeContext = createContext(DEFAULT_TOKENS);
244
+ function useTheme() {
245
+ return useContext(GenUIThemeContext);
246
+ }
247
+ var DEFAULT_INTERACTION = {
248
+ selectedStepId: null,
249
+ onStepSelect: void 0
250
+ };
251
+ var GenUIInteractionContext = createContext(DEFAULT_INTERACTION);
252
+ function useGenUIInteraction() {
253
+ return useContext(GenUIInteractionContext);
254
+ }
255
+ var STATUS_COLORS = {
256
+ done: "#15803d",
257
+ active: "",
258
+ // filled from theme ACCENT at render time
259
+ review: "#f59e0b",
260
+ pending: "#9ca3af",
261
+ blocked: "#b45309",
262
+ failed: "#dc2626"
263
+ };
264
+ var STATUS_LABELS = {
265
+ done: "Complete",
266
+ active: "In progress",
267
+ review: "In review",
268
+ pending: "Pending",
269
+ blocked: "Blocked",
270
+ failed: "Failed"
271
+ };
272
+ var HUMAN_PALETTE = ["#2563eb", "#0f766e", "#7c3aed", "#b45309", "#be185d", "#4d7c0f"];
273
+ function hashColor(name) {
274
+ let h = 0;
275
+ for (let i = 0; i < name.length; i++) h = h * 31 + name.charCodeAt(i) | 0;
276
+ return HUMAN_PALETTE[Math.abs(h) % HUMAN_PALETTE.length];
277
+ }
278
+ function initialsOf(a) {
279
+ var _a, _b, _c, _d;
280
+ if (a.initials) return a.initials.slice(0, 2).toUpperCase();
281
+ const parts = a.name.trim().split(/\s+/);
282
+ return (((_b = (_a = parts[0]) == null ? void 0 : _a[0]) != null ? _b : "") + ((_d = (_c = parts[1]) == null ? void 0 : _c[0]) != null ? _d : "")).toUpperCase() || "?";
283
+ }
284
+ function SparkMark({ size, color }) {
285
+ return /* @__PURE__ */ jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx(
286
+ "path",
287
+ {
288
+ 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",
289
+ fill: color
290
+ }
291
+ ) });
292
+ }
293
+ function AvatarStack({ assignees, accent }) {
294
+ const shown = assignees.slice(0, 4);
295
+ const overflow = assignees.length - shown.length;
296
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [
297
+ shown.map((a, i) => {
298
+ const isAgent = a.kind === "agent";
299
+ const bg = isAgent ? `${accent}1f` : a.color || hashColor(a.name);
300
+ return /* @__PURE__ */ jsx(
301
+ "div",
302
+ {
303
+ title: `${a.name}${a.role ? ` \xB7 ${a.role}` : isAgent ? " \xB7 agent" : ""}`,
304
+ style: {
305
+ width: 20,
306
+ height: 20,
307
+ borderRadius: "50%",
308
+ flexShrink: 0,
309
+ marginLeft: i === 0 ? 0 : -7,
310
+ zIndex: shown.length - i,
311
+ display: "flex",
312
+ alignItems: "center",
313
+ justifyContent: "center",
314
+ background: bg,
315
+ border: "1.5px solid white",
316
+ boxShadow: isAgent ? `inset 0 0 0 1px ${accent}59` : "none"
317
+ },
318
+ 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) })
319
+ },
320
+ `${a.name}-${i}`
321
+ );
322
+ }),
323
+ overflow > 0 && /* @__PURE__ */ jsxs(
324
+ "span",
325
+ {
326
+ style: {
327
+ marginLeft: -7,
328
+ zIndex: 0,
329
+ width: 20,
330
+ height: 20,
331
+ borderRadius: "50%",
332
+ background: "#f2f2f2",
333
+ border: "1.5px solid white",
334
+ display: "flex",
335
+ alignItems: "center",
336
+ justifyContent: "center",
337
+ fontSize: 8,
338
+ fontWeight: 700,
339
+ color: "#777777"
340
+ },
341
+ children: [
342
+ "+",
343
+ overflow
344
+ ]
345
+ }
346
+ )
347
+ ] });
348
+ }
349
+ function IndexDot({ step, index, accent }) {
350
+ var _a;
351
+ const n = (_a = step.n) != null ? _a : index + 1;
352
+ const base = {
353
+ width: 18,
354
+ height: 18,
355
+ borderRadius: "50%",
356
+ flexShrink: 0,
357
+ display: "flex",
358
+ alignItems: "center",
359
+ justifyContent: "center",
360
+ fontSize: 10,
361
+ fontWeight: 700,
362
+ lineHeight: 1
363
+ };
364
+ if (step.status === "done") {
365
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#15803d", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "\u2713" }) });
366
+ }
367
+ if (step.status === "failed") {
368
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#dc2626", color: "white" }), children: /* @__PURE__ */ jsx("span", { style: { fontSize: 10 }, children: "!" }) });
369
+ }
370
+ if (step.status === "active") {
371
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: accent, color: "white" }), children: n });
372
+ }
373
+ if (step.status === "review") {
374
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "white", border: "1.5px solid #f59e0b", color: "#b45309" }), children: n });
375
+ }
376
+ return /* @__PURE__ */ jsx("div", { style: __spreadProps(__spreadValues({}, base), { background: "#f2f2f2", color: "#9ca3af" }), children: n });
377
+ }
378
+ var CARD_MIN = 132;
379
+ var CARD_GAP = 16;
380
+ var AUTO_COMPACT_BELOW = 360;
381
+ function useContainerWidth(ref) {
382
+ const [w, setW] = React4.useState(0);
383
+ React4.useLayoutEffect(() => {
384
+ const el = ref.current;
385
+ if (!el || typeof ResizeObserver === "undefined") return;
386
+ const ro = new ResizeObserver((entries) => {
387
+ var _a;
388
+ const cr = (_a = entries[0]) == null ? void 0 : _a.contentRect;
389
+ if (cr) setW(cr.width);
390
+ });
391
+ ro.observe(el);
392
+ setW(el.getBoundingClientRect().width);
393
+ return () => ro.disconnect();
394
+ }, [ref]);
395
+ return w;
396
+ }
397
+ var KEYFRAMES = `
398
+ @keyframes wfsPulse{0%,100%{opacity:1}50%{opacity:.35}}
399
+ @keyframes wfsLampPulse{0%,100%{box-shadow:0 0 0 0 var(--wfs-accent,#6366f1)73}50%{box-shadow:0 0 0 4px transparent}}
400
+ @keyframes wfsRise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
401
+ @keyframes wfsShimmer{0%{background-position:-200px 0}100%{background-position:calc(200px + 100%) 0}}
402
+ .wfs-rise{animation:wfsRise 0.32s cubic-bezier(0.22,1,0.36,1) both}
403
+ @media (prefers-reduced-motion: reduce){
404
+ .wfs-anim,.wfs-rise,.wfs-shim{animation:none !important}
405
+ .wfs-rise{opacity:1 !important;transform:none !important}
406
+ }`;
407
+ function ProgressMeter({
408
+ done,
409
+ total,
410
+ accent,
411
+ muted,
412
+ loading
413
+ }) {
414
+ const pct = total > 0 ? Math.round(done / total * 100) : 0;
415
+ return /* @__PURE__ */ jsxs(
416
+ "div",
417
+ {
418
+ "data-testid": "workflow-stepper-progress",
419
+ style: { display: "flex", alignItems: "center", gap: 8, padding: "0 2px 6px" },
420
+ children: [
421
+ /* @__PURE__ */ jsx(
422
+ "span",
423
+ {
424
+ style: {
425
+ fontSize: 10.5,
426
+ fontWeight: 600,
427
+ color: muted,
428
+ fontVariantNumeric: "tabular-nums",
429
+ letterSpacing: "0.01em",
430
+ whiteSpace: "nowrap"
431
+ },
432
+ children: loading ? "\u2014" : `${done} / ${total} \xB7 ${pct}%`
433
+ }
434
+ ),
435
+ /* @__PURE__ */ jsx(
436
+ "span",
437
+ {
438
+ style: {
439
+ flex: 1,
440
+ height: 3,
441
+ borderRadius: 3,
442
+ background: "#eceff4",
443
+ overflow: "hidden",
444
+ minWidth: 40
445
+ },
446
+ children: /* @__PURE__ */ jsx(
447
+ "span",
448
+ {
449
+ className: loading ? "wfs-shim" : void 0,
450
+ style: {
451
+ display: "block",
452
+ height: "100%",
453
+ width: loading ? "100%" : `${pct}%`,
454
+ borderRadius: 3,
455
+ background: loading ? `linear-gradient(90deg, #eceff4, ${accent}55, #eceff4)` : accent,
456
+ backgroundSize: loading ? "200px 100%" : void 0,
457
+ animation: loading ? "wfsShimmer 1.1s linear infinite" : void 0,
458
+ transition: "width 0.45s cubic-bezier(0.22,1,0.36,1)"
459
+ }
460
+ }
461
+ )
462
+ }
463
+ )
464
+ ]
465
+ }
466
+ );
467
+ }
468
+ function WorkflowStepperRenderer({
469
+ data,
470
+ selectedStep = null,
471
+ onSelectStep,
472
+ density = "auto",
473
+ loading = false,
474
+ loadingSteps = 6,
475
+ showProgress = true
476
+ }) {
477
+ var _a, _b, _c, _d, _e, _f;
478
+ const { BORDER: BORDER2, MUTED: MUTED2, ACCENT: ACCENT2 } = useTheme();
479
+ const steps = (_a = data.steps) != null ? _a : [];
480
+ const activeStepId = (_d = (_c = data.active_step) != null ? _c : (_b = steps.find((s) => s.status === "active")) == null ? void 0 : _b.id) != null ? _d : null;
481
+ const interactive = typeof onSelectStep === "function";
482
+ const statusColor = (s) => s === "active" ? ACCENT2 : STATUS_COLORS[s];
483
+ const doneCount = steps.filter((s) => s.status === "done").length;
484
+ const rootRef = React4.useRef(null);
485
+ const containerW = useContainerWidth(rootRef);
486
+ let resolved = density === "auto" ? "full" : density;
487
+ if (density === "auto" && containerW > 0) {
488
+ const needed = steps.length * CARD_MIN + Math.max(0, steps.length - 1) * CARD_GAP;
489
+ resolved = containerW < AUTO_COMPACT_BELOW || needed > containerW * 1.6 ? "compact" : "full";
490
+ }
491
+ const scrollerRef = React4.useRef(null);
492
+ React4.useEffect(() => {
493
+ if (resolved !== "full" || loading) return;
494
+ const sc = scrollerRef.current;
495
+ if (!sc) return;
496
+ const el = sc.querySelector(
497
+ `[data-testid="workflow-stepper-step-${selectedStep != null ? selectedStep : activeStepId}"]`
498
+ );
499
+ if (el && sc.scrollWidth > sc.clientWidth) {
500
+ el.scrollIntoView({ inline: "center", block: "nearest", behavior: "smooth" });
501
+ }
502
+ }, [resolved, loading, selectedStep, activeStepId]);
503
+ const [edges, setEdges] = React4.useState({
504
+ left: false,
505
+ right: false
506
+ });
507
+ const updateEdges = React4.useCallback(() => {
508
+ const sc = scrollerRef.current;
509
+ if (!sc) return;
510
+ const max = sc.scrollWidth - sc.clientWidth;
511
+ const sl = sc.scrollLeft;
512
+ const left = sl > 1;
513
+ const right = sl < max - 1;
514
+ setEdges((prev) => prev.left === left && prev.right === right ? prev : { left, right });
515
+ }, []);
516
+ React4.useLayoutEffect(() => {
517
+ if (resolved !== "full" || loading) return;
518
+ updateEdges();
519
+ const sc = scrollerRef.current;
520
+ if (!sc || typeof ResizeObserver === "undefined") return;
521
+ const ro = new ResizeObserver(updateEdges);
522
+ ro.observe(sc);
523
+ return () => ro.disconnect();
524
+ }, [resolved, loading, steps.length, updateEdges]);
525
+ 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;
526
+ const themeStyle = { ["--wfs-accent"]: ACCENT2 };
527
+ if (loading) {
528
+ const ghosts = Array.from({ length: Math.max(2, loadingSteps) });
529
+ return /* @__PURE__ */ jsxs("div", { "data-testid": "workflow-stepper-loading", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
530
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
531
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: 0, total: 0, accent: ACCENT2, muted: MUTED2, loading: true }),
532
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "stretch", gap: CARD_GAP, padding: "2px 2px 6px", overflow: "hidden" }, children: ghosts.map((_, i) => /* @__PURE__ */ jsx(
533
+ "div",
534
+ {
535
+ className: "wfs-shim",
536
+ "aria-hidden": "true",
537
+ style: {
538
+ flex: "0 1 168px",
539
+ minWidth: CARD_MIN,
540
+ height: 84,
541
+ borderRadius: 10,
542
+ border: `1px solid ${BORDER2}`,
543
+ background: `linear-gradient(90deg, #f4f6f9, #eceff4 40%, #f4f6f9 80%)`,
544
+ backgroundSize: "200px 100%",
545
+ animation: "wfsShimmer 1.1s linear infinite",
546
+ animationDelay: `${i * 0.08}s`
547
+ }
548
+ },
549
+ i
550
+ )) })
551
+ ] });
552
+ }
553
+ if (resolved === "compact") {
554
+ const activeStep = (_e = steps.find((s) => s.id === activeStepId)) != null ? _e : null;
555
+ return /* @__PURE__ */ jsxs(
556
+ "div",
557
+ {
558
+ ref: rootRef,
559
+ "data-testid": "workflow-stepper-compact",
560
+ style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle),
561
+ children: [
562
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
563
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
564
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
565
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", flexShrink: 0 }, children: steps.map((s, i) => {
566
+ const sel = selectedStep === s.id;
567
+ const act = s.status === "active";
568
+ const done = s.status === "done";
569
+ const reached = s.status !== "pending";
570
+ const clickable = interactive && reached;
571
+ const size = act ? 11 : done ? 9 : 8;
572
+ return /* @__PURE__ */ jsxs(React4.Fragment, { children: [
573
+ i > 0 && /* @__PURE__ */ jsx(
574
+ "span",
575
+ {
576
+ "aria-hidden": "true",
577
+ style: {
578
+ width: 14,
579
+ height: 1.5,
580
+ borderRadius: 1,
581
+ background: steps[i - 1].status === "done" ? "#15803d" : "#e5e7eb",
582
+ transition: "background 0.36s ease-out"
583
+ }
584
+ }
585
+ ),
586
+ /* @__PURE__ */ jsx(
587
+ "button",
588
+ {
589
+ type: "button",
590
+ disabled: interactive && !reached,
591
+ "aria-disabled": interactive && !reached ? true : void 0,
592
+ title: `${s.title} \xB7 ${STATUS_LABELS[s.status]}`,
593
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(sel ? null : s.id) : void 0,
594
+ "data-testid": `workflow-stepper-step-${s.id}`,
595
+ "data-status": s.status,
596
+ "data-reached": reached || void 0,
597
+ className: act ? "wfs-anim" : void 0,
598
+ style: {
599
+ position: "relative",
600
+ width: size,
601
+ height: size,
602
+ padding: 0,
603
+ borderRadius: "50%",
604
+ background: statusColor(s.status),
605
+ flexShrink: 0,
606
+ // border-box so the selected 2px border can't grow the dot
607
+ // and reflow the rail.
608
+ boxSizing: "border-box",
609
+ opacity: reached ? 1 : 0.55,
610
+ border: sel ? `2px solid ${ACCENT2}` : done ? "none" : "1px solid rgba(255,255,255,0.6)",
611
+ boxShadow: sel ? "0 0 0 2px #fff" : "none",
612
+ cursor: clickable ? "pointer" : "default",
613
+ transition: "width 0.15s, height 0.15s",
614
+ animation: act ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
615
+ }
616
+ }
617
+ )
618
+ ] }, s.id);
619
+ }) }),
620
+ activeStep && /* @__PURE__ */ jsxs(Fragment, { children: [
621
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { width: 1, height: 16, background: "#e6eaf1", flexShrink: 0 } }),
622
+ /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: 7, minWidth: 0 }, children: [
623
+ /* @__PURE__ */ jsx(
624
+ "span",
625
+ {
626
+ "aria-hidden": "true",
627
+ style: {
628
+ width: 17,
629
+ height: 17,
630
+ borderRadius: "50%",
631
+ flexShrink: 0,
632
+ display: "flex",
633
+ alignItems: "center",
634
+ justifyContent: "center",
635
+ fontSize: 9.5,
636
+ fontWeight: 700,
637
+ lineHeight: 1,
638
+ background: activeStep.status === "done" ? "#15803d" : activeStep.status === "review" ? "#fff" : activeStep.status === "failed" ? "#dc2626" : ACCENT2,
639
+ color: activeStep.status === "review" ? "#b45309" : "#fff",
640
+ border: activeStep.status === "review" ? "1.5px solid #f59e0b" : "none"
641
+ },
642
+ children: activeStep.status === "done" ? "\u2713" : activeStep.status === "failed" ? "!" : (_f = activeStep.n) != null ? _f : steps.findIndex((x) => x.id === activeStep.id) + 1
643
+ }
644
+ ),
645
+ /* @__PURE__ */ jsxs(
646
+ "span",
647
+ {
648
+ style: {
649
+ fontSize: 12.5,
650
+ fontWeight: 650,
651
+ color: "var(--foreground)",
652
+ letterSpacing: "-0.01em",
653
+ whiteSpace: "nowrap",
654
+ overflow: "hidden",
655
+ textOverflow: "ellipsis",
656
+ minWidth: 0
657
+ },
658
+ children: [
659
+ activeStep.title,
660
+ activeStep.sub ? /* @__PURE__ */ jsxs("span", { style: { fontWeight: 400, color: MUTED2 }, children: [
661
+ " \xB7 ",
662
+ activeStep.sub
663
+ ] }) : null
664
+ ]
665
+ }
666
+ )
667
+ ] })
668
+ ] })
669
+ ] })
670
+ ]
671
+ }
672
+ );
673
+ }
674
+ return /* @__PURE__ */ jsxs("div", { ref: rootRef, "data-testid": "workflow-stepper", style: __spreadValues({ width: "100%", minWidth: 0 }, themeStyle), children: [
675
+ /* @__PURE__ */ jsx("style", { children: KEYFRAMES }),
676
+ showProgress && /* @__PURE__ */ jsx(ProgressMeter, { done: doneCount, total: steps.length, accent: ACCENT2, muted: MUTED2 }),
677
+ /* @__PURE__ */ jsxs(
678
+ "div",
679
+ {
680
+ ref: scrollerRef,
681
+ className: "wfs-scroller",
682
+ onScroll: updateEdges,
683
+ style: {
684
+ display: "flex",
685
+ alignItems: "stretch",
686
+ overflowX: "auto",
687
+ scrollSnapType: "x proximity",
688
+ padding: "2px 2px 4px",
689
+ // Thin, always-styled scrollbar (Firefox + Windows/desktop WebKit
690
+ // where overlay scrollbars aren't available). macOS/mobile show
691
+ // overlay scrollbars on scroll; harmless either way.
692
+ scrollbarWidth: "thin",
693
+ scrollbarColor: "#c2c9d6 transparent",
694
+ // Edge fade ONLY on the side(s) with hidden content — never when the
695
+ // row isn't scrollable, so the last card's right edge stays crisp.
696
+ maskImage: edgeMask,
697
+ WebkitMaskImage: edgeMask
698
+ },
699
+ children: [
700
+ /* @__PURE__ */ jsx("style", { children: `
701
+ .wfs-scroller::-webkit-scrollbar{height:8px}
702
+ .wfs-scroller::-webkit-scrollbar-track{background:transparent}
703
+ .wfs-scroller::-webkit-scrollbar-thumb{background:#c2c9d6;border-radius:8px;border:2px solid transparent;background-clip:padding-box}
704
+ .wfs-scroller:hover::-webkit-scrollbar-thumb{background:#aab2c2;background-clip:padding-box}
705
+ ` }),
706
+ steps.map((step, i) => {
707
+ var _a2;
708
+ const isSelected = selectedStep === step.id;
709
+ const isActive = step.status === "active";
710
+ const reached = step.status !== "pending";
711
+ const clickable = interactive && reached;
712
+ const color = statusColor(step.status);
713
+ const humans = ((_a2 = step.assignees) != null ? _a2 : []).filter((a) => a.kind === "human");
714
+ const roleCaption = humans.map((h) => h.role).filter(Boolean).slice(0, 2).join(" \xB7 ");
715
+ return /* @__PURE__ */ jsxs(React4.Fragment, { children: [
716
+ i > 0 && /* @__PURE__ */ jsx(
717
+ "div",
718
+ {
719
+ style: {
720
+ width: CARD_GAP,
721
+ flexShrink: 0,
722
+ display: "flex",
723
+ alignItems: "center"
724
+ },
725
+ "aria-hidden": "true",
726
+ children: /* @__PURE__ */ jsx(
727
+ "div",
728
+ {
729
+ style: {
730
+ width: "100%",
731
+ height: 1.5,
732
+ borderRadius: 1,
733
+ // Fill sweep: completed rails wash green left→right.
734
+ background: steps[i - 1].status === "done" ? "linear-gradient(90deg, #15803d, #15803d)" : "#e5e7eb",
735
+ backgroundSize: "100% 100%",
736
+ transition: "background 0.36s ease-out"
737
+ }
738
+ }
739
+ )
740
+ }
741
+ ),
742
+ /* @__PURE__ */ jsxs(
743
+ "div",
744
+ {
745
+ role: clickable ? "button" : void 0,
746
+ tabIndex: clickable ? 0 : void 0,
747
+ "aria-disabled": interactive && !reached ? true : void 0,
748
+ className: "wfs-rise",
749
+ "data-testid": `workflow-stepper-step-${step.id}`,
750
+ "data-status": step.status,
751
+ "data-selected": isSelected || void 0,
752
+ "data-reached": reached || void 0,
753
+ onClick: clickable ? () => onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id) : void 0,
754
+ onKeyDown: clickable ? (e) => {
755
+ if (e.key === "Enter" || e.key === " ") {
756
+ e.preventDefault();
757
+ onSelectStep == null ? void 0 : onSelectStep(isSelected ? null : step.id);
758
+ }
759
+ } : void 0,
760
+ onMouseEnter: clickable ? (e) => {
761
+ e.currentTarget.style.transform = "translateY(-1px)";
762
+ e.currentTarget.style.boxShadow = "0 3px 10px rgba(15,23,42,0.08)";
763
+ } : void 0,
764
+ onMouseLeave: clickable ? (e) => {
765
+ e.currentTarget.style.transform = "none";
766
+ e.currentTarget.style.boxShadow = "0 1px 2px rgba(0,0,0,0.04)";
767
+ } : void 0,
768
+ style: {
769
+ position: "relative",
770
+ flex: "0 1 168px",
771
+ minWidth: CARD_MIN,
772
+ maxWidth: 208,
773
+ scrollSnapAlign: "center",
774
+ borderRadius: 10,
775
+ boxSizing: "border-box",
776
+ // Selection changes border COLOR only (constant 1px width) so
777
+ // the card never reflows the row on click.
778
+ border: `1px solid ${isSelected ? ACCENT2 : BORDER2}`,
779
+ background: isSelected ? `${ACCENT2}0d` : "white",
780
+ boxShadow: "0 1px 2px rgba(0,0,0,0.04)",
781
+ padding: "10px 11px",
782
+ display: "flex",
783
+ flexDirection: "column",
784
+ gap: 7,
785
+ cursor: clickable ? "pointer" : "default",
786
+ opacity: reached ? 1 : 0.62,
787
+ transition: "border-color 0.15s, background 0.15s, transform 0.12s, box-shadow 0.12s",
788
+ animationDelay: `${Math.min(i, 10) * 0.04}s`,
789
+ overflow: "hidden"
790
+ },
791
+ children: [
792
+ isActive && !isSelected && /* @__PURE__ */ jsx(
793
+ "span",
794
+ {
795
+ style: {
796
+ position: "absolute",
797
+ left: 0,
798
+ top: 6,
799
+ bottom: 6,
800
+ width: 2,
801
+ borderRadius: 2,
802
+ background: ACCENT2
803
+ }
804
+ }
805
+ ),
806
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
807
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
808
+ /* @__PURE__ */ jsx(IndexDot, { step, index: i, accent: ACCENT2 }),
809
+ /* @__PURE__ */ jsx(
810
+ "span",
811
+ {
812
+ className: isActive ? "wfs-anim" : void 0,
813
+ style: {
814
+ width: 6,
815
+ height: 6,
816
+ borderRadius: "50%",
817
+ background: color,
818
+ animation: isActive ? "wfsLampPulse 1.8s ease-in-out infinite" : "none"
819
+ }
820
+ }
821
+ )
822
+ ] }),
823
+ /* @__PURE__ */ jsx(
824
+ "span",
825
+ {
826
+ style: {
827
+ fontSize: 9,
828
+ fontWeight: 600,
829
+ letterSpacing: "0.05em",
830
+ textTransform: "uppercase",
831
+ color
832
+ },
833
+ children: STATUS_LABELS[step.status]
834
+ }
835
+ )
836
+ ] }),
837
+ /* @__PURE__ */ jsxs("div", { style: { minWidth: 0 }, children: [
838
+ /* @__PURE__ */ jsx(
839
+ "div",
840
+ {
841
+ style: {
842
+ fontSize: 12.5,
843
+ fontWeight: 600,
844
+ color: "var(--foreground)",
845
+ lineHeight: 1.25,
846
+ letterSpacing: "-0.01em",
847
+ overflow: "hidden",
848
+ textOverflow: "ellipsis",
849
+ whiteSpace: "nowrap"
850
+ },
851
+ children: step.title
852
+ }
853
+ ),
854
+ step.sub && /* @__PURE__ */ jsx(
855
+ "div",
856
+ {
857
+ style: {
858
+ fontSize: 10.5,
859
+ color: MUTED2,
860
+ marginTop: 2,
861
+ overflow: "hidden",
862
+ textOverflow: "ellipsis",
863
+ whiteSpace: "nowrap"
864
+ },
865
+ children: step.sub
866
+ }
867
+ )
868
+ ] }),
869
+ /* @__PURE__ */ jsxs(
870
+ "div",
871
+ {
872
+ style: {
873
+ display: "flex",
874
+ alignItems: "center",
875
+ justifyContent: "space-between",
876
+ marginTop: "auto",
877
+ minHeight: 20
878
+ },
879
+ children: [
880
+ step.assignees && step.assignees.length > 0 ? /* @__PURE__ */ jsx(AvatarStack, { assignees: step.assignees, accent: ACCENT2 }) : /* @__PURE__ */ jsx("span", {}),
881
+ roleCaption && /* @__PURE__ */ jsx(
882
+ "span",
883
+ {
884
+ style: {
885
+ fontSize: 9,
886
+ color: "#9ca3af",
887
+ fontWeight: 500,
888
+ textAlign: "right",
889
+ maxWidth: 76,
890
+ lineHeight: 1.2,
891
+ overflow: "hidden"
892
+ },
893
+ children: roleCaption
894
+ }
895
+ )
896
+ ]
897
+ }
898
+ )
899
+ ]
900
+ }
901
+ )
902
+ ] }, step.id);
903
+ })
904
+ ]
905
+ }
906
+ )
907
+ ] });
908
+ }
909
+ function WorkflowStepperResolver(p) {
910
+ var _a;
911
+ const { selectedStepId, onStepSelect } = useGenUIInteraction();
912
+ 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: [
913
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, flexWrap: "wrap" }, children: [
914
+ /* @__PURE__ */ jsx(
915
+ "p",
916
+ {
917
+ style: {
918
+ fontFamily: "var(--font-serif)",
919
+ fontSize: "15px",
920
+ fontWeight: 400,
921
+ color: "var(--foreground)",
922
+ letterSpacing: "-0.01em",
923
+ margin: 0
924
+ },
925
+ children: p.title
926
+ }
927
+ ),
928
+ p.period && /* @__PURE__ */ jsx(
929
+ "span",
930
+ {
931
+ style: {
932
+ fontSize: 11,
933
+ fontWeight: 600,
934
+ padding: "2px 8px",
935
+ borderRadius: 9999,
936
+ background: "#f2f2f2",
937
+ color: "#777777",
938
+ fontVariantNumeric: "tabular-nums"
939
+ },
940
+ children: p.period
941
+ }
942
+ ),
943
+ p.badge && /* @__PURE__ */ jsx(
944
+ "span",
945
+ {
946
+ style: {
947
+ fontSize: 11,
948
+ fontWeight: 600,
949
+ padding: "2px 8px",
950
+ borderRadius: 9999,
951
+ border: "1px solid #dedede",
952
+ color: "#777777"
953
+ },
954
+ children: p.badge
955
+ }
956
+ )
957
+ ] }),
958
+ /* @__PURE__ */ jsx(
959
+ WorkflowStepperRenderer,
960
+ {
961
+ data: p,
962
+ selectedStep: selectedStepId,
963
+ onSelectStep: onStepSelect
964
+ }
965
+ )
966
+ ] }) });
967
+ }
968
+
969
+ export { WorkflowStepperRenderer, WorkflowStepperResolver };
970
+ //# sourceMappingURL=resolver.js.map
971
+ //# sourceMappingURL=resolver.js.map