@dilipod/ui 0.4.21 → 0.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/flowchart-diagram.d.ts +8 -0
- package/dist/components/flowchart-diagram.d.ts.map +1 -0
- package/dist/components/impact-metrics-form.d.ts.map +1 -1
- package/dist/components/scenarios-manager.d.ts.map +1 -1
- package/dist/components/worker-spec.d.ts +35 -0
- package/dist/components/worker-spec.d.ts.map +1 -0
- package/dist/components/workflow-viewer.d.ts +1 -1
- package/dist/components/workflow-viewer.d.ts.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +444 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +444 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/flowchart-diagram.tsx +319 -0
- package/src/components/impact-metrics-form.tsx +17 -6
- package/src/components/scenarios-manager.tsx +3 -0
- package/src/components/worker-spec.tsx +389 -0
- package/src/components/workflow-viewer.tsx +1 -1
- package/src/index.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -426,6 +426,7 @@ __export(index_exports, {
|
|
|
426
426
|
EmptyState: () => EmptyState,
|
|
427
427
|
ErrorState: () => ErrorState,
|
|
428
428
|
FilePreview: () => FilePreview,
|
|
429
|
+
FlowchartDiagram: () => FlowchartDiagram,
|
|
429
430
|
FormField: () => FormField,
|
|
430
431
|
IconBox: () => IconBox,
|
|
431
432
|
ImpactMetricsForm: () => ImpactMetricsForm,
|
|
@@ -517,6 +518,7 @@ __export(index_exports, {
|
|
|
517
518
|
TooltipTrigger: () => TooltipTrigger,
|
|
518
519
|
UsageBar: () => UsageBar,
|
|
519
520
|
UsageChart: () => UsageChart,
|
|
521
|
+
WorkerSpec: () => WorkerSpec,
|
|
520
522
|
WorkflowFlow: () => WorkflowFlow,
|
|
521
523
|
WorkflowViewer: () => WorkflowViewer,
|
|
522
524
|
alertVariants: () => alertVariants,
|
|
@@ -4261,6 +4263,7 @@ function ScenarioCard({
|
|
|
4261
4263
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
|
|
4262
4264
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-8 h-8 rounded-full flex items-center justify-center shrink-0", config.bgColor), children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 16, weight: "fill", className: config.color }) }),
|
|
4263
4265
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0 pt-0.5", children: [
|
|
4266
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2 mb-1.5", children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", size: "sm", className: "font-medium", children: config.label }) }),
|
|
4264
4267
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-[var(--black)]", children: [
|
|
4265
4268
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "When:" }),
|
|
4266
4269
|
" ",
|
|
@@ -4641,6 +4644,7 @@ function ImpactMetricsForm({
|
|
|
4641
4644
|
const impliedFrequencyPerMonth = Math.round(impliedFrequencyPerYear / 12);
|
|
4642
4645
|
const laborSavingsPerYear = metrics.fte_equivalent * HOURS_PER_FTE_YEAR * metrics.hourly_rate_euros;
|
|
4643
4646
|
const netAnnualSavings = laborSavingsPerYear - workerCostPerYear;
|
|
4647
|
+
const roiPercentage = workerCostPerYear > 0 ? netAnnualSavings / workerCostPerYear * 100 : 0;
|
|
4644
4648
|
return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("border-[var(--cyan)]/20 bg-gradient-to-br from-white to-[var(--cyan)]/5", className), children: /* @__PURE__ */ jsxRuntime.jsxs(CardContent, { className: "p-5", children: [
|
|
4645
4649
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4646
4650
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: "Impact Metrics (ROI)" }),
|
|
@@ -4758,17 +4762,32 @@ function ImpactMetricsForm({
|
|
|
4758
4762
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
|
|
4759
4763
|
"\u20AC",
|
|
4760
4764
|
laborSavingsPerYear.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4765
|
+
" ",
|
|
4766
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: "labor saved" }),
|
|
4761
4767
|
" \u2212 \u20AC",
|
|
4762
|
-
workerCostPerYear
|
|
4768
|
+
workerCostPerYear,
|
|
4769
|
+
" ",
|
|
4770
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: "worker cost" })
|
|
4763
4771
|
] })
|
|
4764
4772
|
] })
|
|
4765
4773
|
] }),
|
|
4766
|
-
|
|
4767
|
-
"
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4774
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 pt-3 border-t border-border/50 flex items-center justify-between", children: [
|
|
4775
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn(
|
|
4776
|
+
"text-sm",
|
|
4777
|
+
roiPercentage > 0 ? "font-bold text-[var(--cyan)]" : "text-muted-foreground"
|
|
4778
|
+
), children: [
|
|
4779
|
+
"ROI: ",
|
|
4780
|
+
roiPercentage >= 0 ? "+" : "",
|
|
4781
|
+
roiPercentage.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4782
|
+
"%"
|
|
4783
|
+
] }),
|
|
4784
|
+
impliedFrequencyPerYear > 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
4785
|
+
"Implied: ~",
|
|
4786
|
+
impliedFrequencyPerMonth,
|
|
4787
|
+
"\xD7/month (",
|
|
4788
|
+
impliedFrequencyPerYear,
|
|
4789
|
+
"\xD7/year)"
|
|
4790
|
+
] })
|
|
4772
4791
|
] })
|
|
4773
4792
|
] }) });
|
|
4774
4793
|
}
|
|
@@ -6124,6 +6143,422 @@ function WorkflowViewer({
|
|
|
6124
6143
|
] })
|
|
6125
6144
|
] });
|
|
6126
6145
|
}
|
|
6146
|
+
function parseMermaidFlowchart(mermaid) {
|
|
6147
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
6148
|
+
const edges = [];
|
|
6149
|
+
const lines = mermaid.split(/\\n|\n/).map((l) => l.trim()).filter((l) => l && !l.startsWith("flowchart") && !l.startsWith("graph"));
|
|
6150
|
+
function parseNodeDef(str) {
|
|
6151
|
+
const decisionMatch = str.match(/^([A-Za-z0-9_]+)\{(.+?)\}$/);
|
|
6152
|
+
if (decisionMatch) return { id: decisionMatch[1], label: decisionMatch[2], type: "decision" };
|
|
6153
|
+
const bracketMatch = str.match(/^([A-Za-z0-9_]+)\[?\(?\[?(.+?)\]?\)?\]?$/);
|
|
6154
|
+
if (bracketMatch) {
|
|
6155
|
+
const label = bracketMatch[2];
|
|
6156
|
+
const isTerminal = /^(start|end|begin|finish|done)$/i.test(label);
|
|
6157
|
+
return { id: bracketMatch[1], label, type: isTerminal ? "terminal" : "action" };
|
|
6158
|
+
}
|
|
6159
|
+
return { id: str.trim() };
|
|
6160
|
+
}
|
|
6161
|
+
for (const line of lines) {
|
|
6162
|
+
const edgeMatch = line.match(/^(.+?)\s*-->(?:\|(.+?)\|)?\s*(.+)$/);
|
|
6163
|
+
if (!edgeMatch) continue;
|
|
6164
|
+
const leftRaw = edgeMatch[1].trim();
|
|
6165
|
+
const edgeLabel = edgeMatch[2]?.trim();
|
|
6166
|
+
const rightRaw = edgeMatch[3].trim();
|
|
6167
|
+
const left = parseNodeDef(leftRaw);
|
|
6168
|
+
const right = parseNodeDef(rightRaw);
|
|
6169
|
+
if (left.label && !nodes.has(left.id)) {
|
|
6170
|
+
nodes.set(left.id, { id: left.id, label: left.label, type: left.type || "action" });
|
|
6171
|
+
}
|
|
6172
|
+
if (right.label && !nodes.has(right.id)) {
|
|
6173
|
+
nodes.set(right.id, { id: right.id, label: right.label, type: right.type || "action" });
|
|
6174
|
+
}
|
|
6175
|
+
if (!nodes.has(left.id)) {
|
|
6176
|
+
nodes.set(left.id, { id: left.id, label: left.id, type: "action" });
|
|
6177
|
+
}
|
|
6178
|
+
if (!nodes.has(right.id)) {
|
|
6179
|
+
nodes.set(right.id, { id: right.id, label: right.id, type: "action" });
|
|
6180
|
+
}
|
|
6181
|
+
edges.push({ from: left.id, to: right.id, label: edgeLabel });
|
|
6182
|
+
}
|
|
6183
|
+
return { nodes: Array.from(nodes.values()), edges };
|
|
6184
|
+
}
|
|
6185
|
+
function findMergePoint(branchStarts, outgoing) {
|
|
6186
|
+
const reachable = /* @__PURE__ */ new Map();
|
|
6187
|
+
for (const start of branchStarts) {
|
|
6188
|
+
const q2 = [start];
|
|
6189
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
6190
|
+
while (q2.length > 0) {
|
|
6191
|
+
const id = q2.shift();
|
|
6192
|
+
if (seen2.has(id)) continue;
|
|
6193
|
+
seen2.add(id);
|
|
6194
|
+
if (!reachable.has(id)) reachable.set(id, /* @__PURE__ */ new Set());
|
|
6195
|
+
reachable.get(id).add(start);
|
|
6196
|
+
const outs = outgoing.get(id) || [];
|
|
6197
|
+
for (const e of outs) q2.push(e.to);
|
|
6198
|
+
}
|
|
6199
|
+
}
|
|
6200
|
+
const allBranches = new Set(branchStarts);
|
|
6201
|
+
const q = [branchStarts[0]];
|
|
6202
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6203
|
+
while (q.length > 0) {
|
|
6204
|
+
const id = q.shift();
|
|
6205
|
+
if (seen.has(id)) continue;
|
|
6206
|
+
seen.add(id);
|
|
6207
|
+
if (!allBranches.has(id) && reachable.get(id)?.size === branchStarts.length) {
|
|
6208
|
+
return id;
|
|
6209
|
+
}
|
|
6210
|
+
const outs = outgoing.get(id) || [];
|
|
6211
|
+
for (const e of outs) q.push(e.to);
|
|
6212
|
+
}
|
|
6213
|
+
return null;
|
|
6214
|
+
}
|
|
6215
|
+
function buildLayout(startId, outgoing, incoming, nodeMap, visited) {
|
|
6216
|
+
const items = [];
|
|
6217
|
+
let currentId = startId;
|
|
6218
|
+
while (currentId) {
|
|
6219
|
+
if (visited.has(currentId)) break;
|
|
6220
|
+
const node = nodeMap.get(currentId);
|
|
6221
|
+
if (!node) break;
|
|
6222
|
+
const outs = outgoing.get(currentId) || [];
|
|
6223
|
+
if (outs.length <= 1) {
|
|
6224
|
+
visited.add(currentId);
|
|
6225
|
+
items.push({ type: "node", nodeId: currentId });
|
|
6226
|
+
if (outs.length === 1) {
|
|
6227
|
+
const nextId = outs[0].to;
|
|
6228
|
+
if (visited.has(nextId)) break;
|
|
6229
|
+
items.push({ type: "arrow", label: outs[0].label });
|
|
6230
|
+
currentId = nextId;
|
|
6231
|
+
} else {
|
|
6232
|
+
currentId = null;
|
|
6233
|
+
}
|
|
6234
|
+
} else {
|
|
6235
|
+
visited.add(currentId);
|
|
6236
|
+
items.push({ type: "node", nodeId: currentId });
|
|
6237
|
+
const branchStarts = outs.map((e) => e.to);
|
|
6238
|
+
const mergeId = findMergePoint(branchStarts, outgoing);
|
|
6239
|
+
const branches = [];
|
|
6240
|
+
for (const edge of outs) {
|
|
6241
|
+
if (visited.has(edge.to) && edge.to !== mergeId) {
|
|
6242
|
+
branches.push({ label: edge.label, items: [] });
|
|
6243
|
+
continue;
|
|
6244
|
+
}
|
|
6245
|
+
const branchItems = buildLayout(edge.to, outgoing, incoming, nodeMap, visited);
|
|
6246
|
+
branches.push({ label: edge.label, items: branchItems });
|
|
6247
|
+
}
|
|
6248
|
+
items.push({ type: "branch", decision: currentId, branches, mergeId });
|
|
6249
|
+
if (mergeId && !visited.has(mergeId)) {
|
|
6250
|
+
items.push({ type: "arrow" });
|
|
6251
|
+
currentId = mergeId;
|
|
6252
|
+
} else {
|
|
6253
|
+
currentId = null;
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
return items;
|
|
6258
|
+
}
|
|
6259
|
+
function FlowArrow({ label }) {
|
|
6260
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
6261
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-purple-600 bg-purple-50 px-1.5 py-0.5 rounded mb-0.5", children: label }),
|
|
6262
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-gray-300" }),
|
|
6263
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-0 h-0 border-l-[4px] border-r-[4px] border-t-[5px] border-l-transparent border-r-transparent border-t-gray-300" })
|
|
6264
|
+
] });
|
|
6265
|
+
}
|
|
6266
|
+
function FlowNodeBox({ node }) {
|
|
6267
|
+
if (node.type === "decision") {
|
|
6268
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6269
|
+
"div",
|
|
6270
|
+
{
|
|
6271
|
+
className: "bg-amber-50 border-2 border-amber-300 rounded-lg px-4 py-2.5 text-xs font-medium text-amber-800 text-center my-1",
|
|
6272
|
+
style: { minWidth: "120px" },
|
|
6273
|
+
children: [
|
|
6274
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-amber-400 mr-1", children: "\u25C7" }),
|
|
6275
|
+
node.label
|
|
6276
|
+
]
|
|
6277
|
+
}
|
|
6278
|
+
);
|
|
6279
|
+
}
|
|
6280
|
+
if (node.type === "terminal") {
|
|
6281
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-gray-100 border border-gray-200 rounded-full px-5 py-1.5 text-xs font-medium text-gray-500 text-center my-1", children: node.label });
|
|
6282
|
+
}
|
|
6283
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white border border-gray-200 rounded-sm px-4 py-2 text-xs font-medium text-[var(--black)] text-center shadow-sm my-1 max-w-[220px]", children: node.label });
|
|
6284
|
+
}
|
|
6285
|
+
function RenderLayoutItems({ items, nodeMap }) {
|
|
6286
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.map((item, i) => {
|
|
6287
|
+
if (item.type === "node") {
|
|
6288
|
+
const node = nodeMap.get(item.nodeId);
|
|
6289
|
+
if (!node) return null;
|
|
6290
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FlowNodeBox, { node }, `node-${item.nodeId}`);
|
|
6291
|
+
}
|
|
6292
|
+
if (item.type === "arrow") {
|
|
6293
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FlowArrow, { label: item.label }, `arrow-${i}`);
|
|
6294
|
+
}
|
|
6295
|
+
if (item.type === "branch") {
|
|
6296
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center w-full", children: [
|
|
6297
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-3 bg-gray-300" }),
|
|
6298
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start justify-center gap-6 w-full", children: item.branches.map((branch, j) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center min-w-[100px]", children: [
|
|
6299
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
6300
|
+
branch.label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-medium text-purple-600 bg-purple-50 px-1.5 py-0.5 rounded mb-1", children: branch.label }),
|
|
6301
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-0 h-0 border-l-[4px] border-r-[4px] border-t-[5px] border-l-transparent border-r-transparent border-t-gray-300" })
|
|
6302
|
+
] }),
|
|
6303
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsxRuntime.jsx(RenderLayoutItems, { items: branch.items, nodeMap }) })
|
|
6304
|
+
] }, j)) }),
|
|
6305
|
+
item.mergeId && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-3 bg-gray-300" })
|
|
6306
|
+
] }, `branch-${item.decision}-${i}`);
|
|
6307
|
+
}
|
|
6308
|
+
return null;
|
|
6309
|
+
}) });
|
|
6310
|
+
}
|
|
6311
|
+
function FlowchartDiagram({ mermaid, className }) {
|
|
6312
|
+
const { nodes, edges } = parseMermaidFlowchart(mermaid);
|
|
6313
|
+
if (nodes.length === 0) {
|
|
6314
|
+
return /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "text-xs bg-white border border-gray-100 rounded-sm p-3 overflow-x-auto whitespace-pre-wrap", children: mermaid });
|
|
6315
|
+
}
|
|
6316
|
+
const outgoing = /* @__PURE__ */ new Map();
|
|
6317
|
+
const incoming = /* @__PURE__ */ new Map();
|
|
6318
|
+
for (const edge of edges) {
|
|
6319
|
+
if (!outgoing.has(edge.from)) outgoing.set(edge.from, []);
|
|
6320
|
+
outgoing.get(edge.from).push(edge);
|
|
6321
|
+
if (!incoming.has(edge.to)) incoming.set(edge.to, []);
|
|
6322
|
+
incoming.get(edge.to).push(edge);
|
|
6323
|
+
}
|
|
6324
|
+
const nodeMap = new Map(nodes.map((n) => [n.id, n]));
|
|
6325
|
+
const roots = nodes.filter((n) => !incoming.has(n.id) || incoming.get(n.id).length === 0);
|
|
6326
|
+
const startId = roots.length > 0 ? roots[0].id : nodes[0].id;
|
|
6327
|
+
const visited = /* @__PURE__ */ new Set();
|
|
6328
|
+
const layout = buildLayout(startId, outgoing, incoming, nodeMap, visited);
|
|
6329
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center py-2", children: /* @__PURE__ */ jsxRuntime.jsx(RenderLayoutItems, { items: layout, nodeMap }) }) });
|
|
6330
|
+
}
|
|
6331
|
+
var frequencyLabels = {
|
|
6332
|
+
multiple_daily: "occurrence",
|
|
6333
|
+
daily: "day",
|
|
6334
|
+
weekly: "week",
|
|
6335
|
+
monthly: "month",
|
|
6336
|
+
quarterly: "quarter",
|
|
6337
|
+
yearly: "year"
|
|
6338
|
+
};
|
|
6339
|
+
function SectionHeader({
|
|
6340
|
+
icon,
|
|
6341
|
+
title,
|
|
6342
|
+
count: count2,
|
|
6343
|
+
expanded,
|
|
6344
|
+
onToggle,
|
|
6345
|
+
iconColor = "text-[var(--cyan)]"
|
|
6346
|
+
}) {
|
|
6347
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6348
|
+
"button",
|
|
6349
|
+
{
|
|
6350
|
+
onClick: onToggle,
|
|
6351
|
+
className: "flex items-center gap-1.5 text-xs font-semibold text-muted-foreground uppercase tracking-wide hover:text-[var(--black)] transition-colors w-full",
|
|
6352
|
+
children: [
|
|
6353
|
+
expanded ? /* @__PURE__ */ jsxRuntime.jsx(react_star.CaretDown, { size: 12 }) : /* @__PURE__ */ jsxRuntime.jsx(react_star.CaretRight, { size: 12 }),
|
|
6354
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: iconColor, children: icon }),
|
|
6355
|
+
title,
|
|
6356
|
+
count2 !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground font-normal", children: [
|
|
6357
|
+
"(",
|
|
6358
|
+
count2,
|
|
6359
|
+
")"
|
|
6360
|
+
] })
|
|
6361
|
+
]
|
|
6362
|
+
}
|
|
6363
|
+
);
|
|
6364
|
+
}
|
|
6365
|
+
function WorkerSpec({ documentation, className }) {
|
|
6366
|
+
const [expandedSections, setExpandedSections] = React51.useState(
|
|
6367
|
+
/* @__PURE__ */ new Set(["goal", "scope", "steps", "diagram", "impact", "requirements", "edge_cases"])
|
|
6368
|
+
);
|
|
6369
|
+
const toggleSection = (section) => {
|
|
6370
|
+
setExpandedSections((prev) => {
|
|
6371
|
+
const next = new Set(prev);
|
|
6372
|
+
if (next.has(section)) {
|
|
6373
|
+
next.delete(section);
|
|
6374
|
+
} else {
|
|
6375
|
+
next.add(section);
|
|
6376
|
+
}
|
|
6377
|
+
return next;
|
|
6378
|
+
});
|
|
6379
|
+
};
|
|
6380
|
+
if (!documentation) {
|
|
6381
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 p-6 rounded-sm border border-dashed border-gray-300 bg-gray-50/50", children: [
|
|
6382
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-sm bg-gray-100 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(react_star.Robot, { size: 20, className: "text-gray-400" }) }),
|
|
6383
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6384
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-[var(--black)]", children: "Worker Spec Pending" }),
|
|
6385
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "The final specification will be generated automatically after the documentation is approved." })
|
|
6386
|
+
] })
|
|
6387
|
+
] }) });
|
|
6388
|
+
}
|
|
6389
|
+
const freqLabel = documentation.expected_impact?.frequency ? frequencyLabels[documentation.expected_impact.frequency] || documentation.expected_impact.frequency : "occurrence";
|
|
6390
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
6391
|
+
documentation.goal && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6392
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6393
|
+
SectionHeader,
|
|
6394
|
+
{
|
|
6395
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.Target, { size: 12, weight: "fill" }),
|
|
6396
|
+
title: "Goal",
|
|
6397
|
+
expanded: expandedSections.has("goal"),
|
|
6398
|
+
onToggle: () => toggleSection("goal")
|
|
6399
|
+
}
|
|
6400
|
+
),
|
|
6401
|
+
expandedSections.has("goal") && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground leading-relaxed pl-5 mt-2", children: documentation.goal })
|
|
6402
|
+
] }),
|
|
6403
|
+
documentation.scope && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6404
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6405
|
+
SectionHeader,
|
|
6406
|
+
{
|
|
6407
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.Crosshair, { size: 12, weight: "fill" }),
|
|
6408
|
+
title: "Scope",
|
|
6409
|
+
expanded: expandedSections.has("scope"),
|
|
6410
|
+
onToggle: () => toggleSection("scope")
|
|
6411
|
+
}
|
|
6412
|
+
),
|
|
6413
|
+
expandedSections.has("scope") && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground leading-relaxed pl-5 mt-2", children: documentation.scope })
|
|
6414
|
+
] }),
|
|
6415
|
+
documentation.steps && documentation.steps.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6416
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6417
|
+
SectionHeader,
|
|
6418
|
+
{
|
|
6419
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.ListNumbers, { size: 12, weight: "fill" }),
|
|
6420
|
+
title: "Steps",
|
|
6421
|
+
count: documentation.steps.length,
|
|
6422
|
+
expanded: expandedSections.has("steps"),
|
|
6423
|
+
onToggle: () => toggleSection("steps")
|
|
6424
|
+
}
|
|
6425
|
+
),
|
|
6426
|
+
expandedSections.has("steps") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3 pl-5 mt-2", children: documentation.steps.map((step, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
6427
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-6 h-6 rounded-sm bg-[var(--cyan)]/10 flex items-center justify-center text-xs font-bold text-[var(--cyan)] shrink-0 mt-0.5", children: step.step || i + 1 }),
|
|
6428
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
6429
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-[var(--black)]", children: step.title }),
|
|
6430
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: step.description }),
|
|
6431
|
+
step.tools_used && step.tools_used.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 mt-1.5", children: step.tools_used.map((tool, j) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-sm bg-gray-100 text-[10px] font-medium text-gray-600", children: [
|
|
6432
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.Wrench, { size: 10 }),
|
|
6433
|
+
tool
|
|
6434
|
+
] }, j)) })
|
|
6435
|
+
] })
|
|
6436
|
+
] }, i)) })
|
|
6437
|
+
] }),
|
|
6438
|
+
documentation.diagram && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6439
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6440
|
+
SectionHeader,
|
|
6441
|
+
{
|
|
6442
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.TreeStructure, { size: 12, weight: "fill" }),
|
|
6443
|
+
title: "Workflow Diagram",
|
|
6444
|
+
expanded: expandedSections.has("diagram"),
|
|
6445
|
+
onToggle: () => toggleSection("diagram"),
|
|
6446
|
+
iconColor: "text-purple-500"
|
|
6447
|
+
}
|
|
6448
|
+
),
|
|
6449
|
+
expandedSections.has("diagram") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-5 mt-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white border border-gray-100 rounded-sm p-4 overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsx(FlowchartDiagram, { mermaid: documentation.diagram }) }) })
|
|
6450
|
+
] }),
|
|
6451
|
+
documentation.expected_impact && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6452
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6453
|
+
SectionHeader,
|
|
6454
|
+
{
|
|
6455
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.Lightning, { size: 12, weight: "fill" }),
|
|
6456
|
+
title: "Expected Impact",
|
|
6457
|
+
expanded: expandedSections.has("impact"),
|
|
6458
|
+
onToggle: () => toggleSection("impact"),
|
|
6459
|
+
iconColor: "text-purple-500"
|
|
6460
|
+
}
|
|
6461
|
+
),
|
|
6462
|
+
expandedSections.has("impact") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pl-5 mt-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-emerald-50/50 border border-emerald-100 rounded-sm p-4", children: [
|
|
6463
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-3 mb-3", children: [
|
|
6464
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-sm p-3 border border-emerald-100 text-center", children: [
|
|
6465
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.Clock, { size: 18, className: "text-emerald-600 mx-auto mb-1" }),
|
|
6466
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-lg font-bold text-[var(--black)]", children: [
|
|
6467
|
+
documentation.expected_impact.time_saved_per_occurrence_minutes,
|
|
6468
|
+
" min"
|
|
6469
|
+
] }),
|
|
6470
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-[10px] text-muted-foreground", children: [
|
|
6471
|
+
"saved per ",
|
|
6472
|
+
freqLabel
|
|
6473
|
+
] })
|
|
6474
|
+
] }),
|
|
6475
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-sm p-3 border border-emerald-100 text-center", children: [
|
|
6476
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.TrendUp, { size: 18, className: "text-emerald-600 mx-auto mb-1" }),
|
|
6477
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-lg font-bold text-[var(--black)]", children: [
|
|
6478
|
+
documentation.expected_impact.yearly_hours_saved,
|
|
6479
|
+
"h"
|
|
6480
|
+
] }),
|
|
6481
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-muted-foreground", children: "saved per year" })
|
|
6482
|
+
] }),
|
|
6483
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-sm p-3 border border-emerald-100 text-center", children: [
|
|
6484
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.CurrencyEur, { size: 18, className: "text-emerald-600 mx-auto mb-1" }),
|
|
6485
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-lg font-bold text-[var(--black)]", children: [
|
|
6486
|
+
"\u20AC",
|
|
6487
|
+
documentation.expected_impact.yearly_cost_savings_euros.toLocaleString()
|
|
6488
|
+
] }),
|
|
6489
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[10px] text-muted-foreground", children: "estimated yearly savings" })
|
|
6490
|
+
] })
|
|
6491
|
+
] }),
|
|
6492
|
+
documentation.expected_impact.qualitative_benefits && documentation.expected_impact.qualitative_benefits.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: documentation.expected_impact.qualitative_benefits.map((benefit, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 text-sm text-emerald-700", children: [
|
|
6493
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.Sparkle, { size: 14, className: "text-emerald-500 shrink-0 mt-0.5", weight: "fill" }),
|
|
6494
|
+
benefit
|
|
6495
|
+
] }, i)) })
|
|
6496
|
+
] }) })
|
|
6497
|
+
] }),
|
|
6498
|
+
(documentation.technical_requirements && documentation.technical_requirements.length > 0 || documentation.integration_points && documentation.integration_points.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6499
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6500
|
+
SectionHeader,
|
|
6501
|
+
{
|
|
6502
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.Plugs, { size: 12, weight: "fill" }),
|
|
6503
|
+
title: "Requirements & Integrations",
|
|
6504
|
+
expanded: expandedSections.has("requirements"),
|
|
6505
|
+
onToggle: () => toggleSection("requirements")
|
|
6506
|
+
}
|
|
6507
|
+
),
|
|
6508
|
+
expandedSections.has("requirements") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid md:grid-cols-2 gap-4 pl-5 mt-2", children: [
|
|
6509
|
+
documentation.technical_requirements && documentation.technical_requirements.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6510
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: "Technical Requirements" }),
|
|
6511
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-1.5", children: documentation.technical_requirements.map((req, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [
|
|
6512
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.Wrench, { size: 12, className: "text-gray-400 shrink-0 mt-1" }),
|
|
6513
|
+
req
|
|
6514
|
+
] }, i)) })
|
|
6515
|
+
] }),
|
|
6516
|
+
documentation.integration_points && documentation.integration_points.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6517
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: "Integration Points" }),
|
|
6518
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-1.5", children: documentation.integration_points.map((point, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [
|
|
6519
|
+
/* @__PURE__ */ jsxRuntime.jsx(react_star.Plugs, { size: 12, className: "text-gray-400 shrink-0 mt-1" }),
|
|
6520
|
+
point
|
|
6521
|
+
] }, i)) })
|
|
6522
|
+
] })
|
|
6523
|
+
] })
|
|
6524
|
+
] }),
|
|
6525
|
+
documentation.edge_cases_handled && documentation.edge_cases_handled.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
6526
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6527
|
+
SectionHeader,
|
|
6528
|
+
{
|
|
6529
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(react_star.ShieldCheck, { size: 12, weight: "fill" }),
|
|
6530
|
+
title: "Edge Cases Handled",
|
|
6531
|
+
count: documentation.edge_cases_handled.length,
|
|
6532
|
+
expanded: expandedSections.has("edge_cases"),
|
|
6533
|
+
onToggle: () => toggleSection("edge_cases"),
|
|
6534
|
+
iconColor: "text-amber-500"
|
|
6535
|
+
}
|
|
6536
|
+
),
|
|
6537
|
+
expandedSections.has("edge_cases") && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2 pl-5 mt-2", children: documentation.edge_cases_handled.map((ec, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm p-3 bg-gray-50 rounded-sm border border-gray-100", children: [
|
|
6538
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-[var(--black)]", children: ec.scenario }),
|
|
6539
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground mt-1", children: [
|
|
6540
|
+
"\u2192 ",
|
|
6541
|
+
ec.handling
|
|
6542
|
+
] })
|
|
6543
|
+
] }, i)) })
|
|
6544
|
+
] }),
|
|
6545
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-gray-100 flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
6546
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", size: "sm", children: [
|
|
6547
|
+
"v",
|
|
6548
|
+
documentation.version
|
|
6549
|
+
] }),
|
|
6550
|
+
documentation.model_used && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6551
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u2022" }),
|
|
6552
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: documentation.model_used })
|
|
6553
|
+
] }),
|
|
6554
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\u2022" }),
|
|
6555
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
6556
|
+
"Updated ",
|
|
6557
|
+
new Date(documentation.updated_at).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
|
|
6558
|
+
] })
|
|
6559
|
+
] })
|
|
6560
|
+
] }) });
|
|
6561
|
+
}
|
|
6127
6562
|
|
|
6128
6563
|
// src/index.ts
|
|
6129
6564
|
__reExport(index_exports, icons_exports);
|
|
@@ -6192,6 +6627,7 @@ exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
|
6192
6627
|
exports.EmptyState = EmptyState;
|
|
6193
6628
|
exports.ErrorState = ErrorState;
|
|
6194
6629
|
exports.FilePreview = FilePreview;
|
|
6630
|
+
exports.FlowchartDiagram = FlowchartDiagram;
|
|
6195
6631
|
exports.FormField = FormField;
|
|
6196
6632
|
exports.IconBox = IconBox;
|
|
6197
6633
|
exports.ImpactMetricsForm = ImpactMetricsForm;
|
|
@@ -6283,6 +6719,7 @@ exports.TooltipProvider = TooltipProvider;
|
|
|
6283
6719
|
exports.TooltipTrigger = TooltipTrigger;
|
|
6284
6720
|
exports.UsageBar = UsageBar;
|
|
6285
6721
|
exports.UsageChart = UsageChart;
|
|
6722
|
+
exports.WorkerSpec = WorkerSpec;
|
|
6286
6723
|
exports.WorkflowFlow = WorkflowFlow;
|
|
6287
6724
|
exports.WorkflowViewer = WorkflowViewer;
|
|
6288
6725
|
exports.alertVariants = alertVariants;
|