@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.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { clsx } from 'clsx';
|
|
|
10
10
|
import { twMerge } from 'tailwind-merge';
|
|
11
11
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
12
12
|
import * as react_star from '@phosphor-icons/react';
|
|
13
|
-
import { X, CaretDown, Circle, CaretLeft, DotsThree, CaretRight, Check, House, Info, WarningCircle, Play, Download, Folder, ArrowSquareOut, CircleNotch, File, FileVideo, Lightning, CheckCircle, CaretUp, Plus, PaperPlaneTilt, Eye, TreeStructure, Code, PencilSimple, WebhooksLogo, Copy, CloudArrowUp, CloudArrowDown, ArrowsClockwise, DownloadSimple, ClockCounterClockwise, ArrowsLeftRight, Minus, Pencil, FileImage, FilePdf, FileDoc, Question, Warning, Trash,
|
|
13
|
+
import { X, CaretDown, Circle, CaretLeft, DotsThree, CaretRight, Check, House, Info, WarningCircle, Play, Download, Folder, ArrowSquareOut, CircleNotch, File, FileVideo, Lightning, CheckCircle, CaretUp, Plus, PaperPlaneTilt, Eye, TreeStructure, Code, PencilSimple, WebhooksLogo, Copy, CloudArrowUp, CloudArrowDown, ArrowsClockwise, DownloadSimple, ClockCounterClockwise, ArrowsLeftRight, Minus, Pencil, Robot, Target, Crosshair, ListNumbers, Wrench, Clock, TrendUp, CurrencyEur, Sparkle, Plugs, ShieldCheck, FileImage, FilePdf, FileDoc, Question, Warning, Trash, Globe, GitBranch, Package, Timer } from '@phosphor-icons/react';
|
|
14
14
|
import 'react-dom';
|
|
15
15
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
16
16
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
@@ -392,6 +392,7 @@ __export(index_exports, {
|
|
|
392
392
|
EmptyState: () => EmptyState,
|
|
393
393
|
ErrorState: () => ErrorState,
|
|
394
394
|
FilePreview: () => FilePreview,
|
|
395
|
+
FlowchartDiagram: () => FlowchartDiagram,
|
|
395
396
|
FormField: () => FormField,
|
|
396
397
|
IconBox: () => IconBox,
|
|
397
398
|
ImpactMetricsForm: () => ImpactMetricsForm,
|
|
@@ -483,6 +484,7 @@ __export(index_exports, {
|
|
|
483
484
|
TooltipTrigger: () => TooltipTrigger,
|
|
484
485
|
UsageBar: () => UsageBar,
|
|
485
486
|
UsageChart: () => UsageChart,
|
|
487
|
+
WorkerSpec: () => WorkerSpec,
|
|
486
488
|
WorkflowFlow: () => WorkflowFlow,
|
|
487
489
|
WorkflowViewer: () => WorkflowViewer,
|
|
488
490
|
alertVariants: () => alertVariants,
|
|
@@ -4227,6 +4229,7 @@ function ScenarioCard({
|
|
|
4227
4229
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
|
|
4228
4230
|
/* @__PURE__ */ jsx("div", { className: cn("w-8 h-8 rounded-full flex items-center justify-center shrink-0", config.bgColor), children: /* @__PURE__ */ jsx(Icon, { size: 16, weight: "fill", className: config.color }) }),
|
|
4229
4231
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 pt-0.5", children: [
|
|
4232
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 mb-1.5", children: /* @__PURE__ */ jsx(Badge, { variant: "outline", size: "sm", className: "font-medium", children: config.label }) }),
|
|
4230
4233
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--black)]", children: [
|
|
4231
4234
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "When:" }),
|
|
4232
4235
|
" ",
|
|
@@ -4607,6 +4610,7 @@ function ImpactMetricsForm({
|
|
|
4607
4610
|
const impliedFrequencyPerMonth = Math.round(impliedFrequencyPerYear / 12);
|
|
4608
4611
|
const laborSavingsPerYear = metrics.fte_equivalent * HOURS_PER_FTE_YEAR * metrics.hourly_rate_euros;
|
|
4609
4612
|
const netAnnualSavings = laborSavingsPerYear - workerCostPerYear;
|
|
4613
|
+
const roiPercentage = workerCostPerYear > 0 ? netAnnualSavings / workerCostPerYear * 100 : 0;
|
|
4610
4614
|
return /* @__PURE__ */ jsx(Card, { className: cn("border-[var(--cyan)]/20 bg-gradient-to-br from-white to-[var(--cyan)]/5", className), children: /* @__PURE__ */ jsxs(CardContent, { className: "p-5", children: [
|
|
4611
4615
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4612
4616
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: "Impact Metrics (ROI)" }),
|
|
@@ -4724,17 +4728,32 @@ function ImpactMetricsForm({
|
|
|
4724
4728
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
|
|
4725
4729
|
"\u20AC",
|
|
4726
4730
|
laborSavingsPerYear.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4731
|
+
" ",
|
|
4732
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: "labor saved" }),
|
|
4727
4733
|
" \u2212 \u20AC",
|
|
4728
|
-
workerCostPerYear
|
|
4734
|
+
workerCostPerYear,
|
|
4735
|
+
" ",
|
|
4736
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: "worker cost" })
|
|
4729
4737
|
] })
|
|
4730
4738
|
] })
|
|
4731
4739
|
] }),
|
|
4732
|
-
|
|
4733
|
-
"
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4740
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 pt-3 border-t border-border/50 flex items-center justify-between", children: [
|
|
4741
|
+
/* @__PURE__ */ jsxs("p", { className: cn(
|
|
4742
|
+
"text-sm",
|
|
4743
|
+
roiPercentage > 0 ? "font-bold text-[var(--cyan)]" : "text-muted-foreground"
|
|
4744
|
+
), children: [
|
|
4745
|
+
"ROI: ",
|
|
4746
|
+
roiPercentage >= 0 ? "+" : "",
|
|
4747
|
+
roiPercentage.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4748
|
+
"%"
|
|
4749
|
+
] }),
|
|
4750
|
+
impliedFrequencyPerYear > 0 && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
4751
|
+
"Implied: ~",
|
|
4752
|
+
impliedFrequencyPerMonth,
|
|
4753
|
+
"\xD7/month (",
|
|
4754
|
+
impliedFrequencyPerYear,
|
|
4755
|
+
"\xD7/year)"
|
|
4756
|
+
] })
|
|
4738
4757
|
] })
|
|
4739
4758
|
] }) });
|
|
4740
4759
|
}
|
|
@@ -6090,10 +6109,426 @@ function WorkflowViewer({
|
|
|
6090
6109
|
] })
|
|
6091
6110
|
] });
|
|
6092
6111
|
}
|
|
6112
|
+
function parseMermaidFlowchart(mermaid) {
|
|
6113
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
6114
|
+
const edges = [];
|
|
6115
|
+
const lines = mermaid.split(/\\n|\n/).map((l) => l.trim()).filter((l) => l && !l.startsWith("flowchart") && !l.startsWith("graph"));
|
|
6116
|
+
function parseNodeDef(str) {
|
|
6117
|
+
const decisionMatch = str.match(/^([A-Za-z0-9_]+)\{(.+?)\}$/);
|
|
6118
|
+
if (decisionMatch) return { id: decisionMatch[1], label: decisionMatch[2], type: "decision" };
|
|
6119
|
+
const bracketMatch = str.match(/^([A-Za-z0-9_]+)\[?\(?\[?(.+?)\]?\)?\]?$/);
|
|
6120
|
+
if (bracketMatch) {
|
|
6121
|
+
const label = bracketMatch[2];
|
|
6122
|
+
const isTerminal = /^(start|end|begin|finish|done)$/i.test(label);
|
|
6123
|
+
return { id: bracketMatch[1], label, type: isTerminal ? "terminal" : "action" };
|
|
6124
|
+
}
|
|
6125
|
+
return { id: str.trim() };
|
|
6126
|
+
}
|
|
6127
|
+
for (const line of lines) {
|
|
6128
|
+
const edgeMatch = line.match(/^(.+?)\s*-->(?:\|(.+?)\|)?\s*(.+)$/);
|
|
6129
|
+
if (!edgeMatch) continue;
|
|
6130
|
+
const leftRaw = edgeMatch[1].trim();
|
|
6131
|
+
const edgeLabel = edgeMatch[2]?.trim();
|
|
6132
|
+
const rightRaw = edgeMatch[3].trim();
|
|
6133
|
+
const left = parseNodeDef(leftRaw);
|
|
6134
|
+
const right = parseNodeDef(rightRaw);
|
|
6135
|
+
if (left.label && !nodes.has(left.id)) {
|
|
6136
|
+
nodes.set(left.id, { id: left.id, label: left.label, type: left.type || "action" });
|
|
6137
|
+
}
|
|
6138
|
+
if (right.label && !nodes.has(right.id)) {
|
|
6139
|
+
nodes.set(right.id, { id: right.id, label: right.label, type: right.type || "action" });
|
|
6140
|
+
}
|
|
6141
|
+
if (!nodes.has(left.id)) {
|
|
6142
|
+
nodes.set(left.id, { id: left.id, label: left.id, type: "action" });
|
|
6143
|
+
}
|
|
6144
|
+
if (!nodes.has(right.id)) {
|
|
6145
|
+
nodes.set(right.id, { id: right.id, label: right.id, type: "action" });
|
|
6146
|
+
}
|
|
6147
|
+
edges.push({ from: left.id, to: right.id, label: edgeLabel });
|
|
6148
|
+
}
|
|
6149
|
+
return { nodes: Array.from(nodes.values()), edges };
|
|
6150
|
+
}
|
|
6151
|
+
function findMergePoint(branchStarts, outgoing) {
|
|
6152
|
+
const reachable = /* @__PURE__ */ new Map();
|
|
6153
|
+
for (const start of branchStarts) {
|
|
6154
|
+
const q2 = [start];
|
|
6155
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
6156
|
+
while (q2.length > 0) {
|
|
6157
|
+
const id = q2.shift();
|
|
6158
|
+
if (seen2.has(id)) continue;
|
|
6159
|
+
seen2.add(id);
|
|
6160
|
+
if (!reachable.has(id)) reachable.set(id, /* @__PURE__ */ new Set());
|
|
6161
|
+
reachable.get(id).add(start);
|
|
6162
|
+
const outs = outgoing.get(id) || [];
|
|
6163
|
+
for (const e of outs) q2.push(e.to);
|
|
6164
|
+
}
|
|
6165
|
+
}
|
|
6166
|
+
const allBranches = new Set(branchStarts);
|
|
6167
|
+
const q = [branchStarts[0]];
|
|
6168
|
+
const seen = /* @__PURE__ */ new Set();
|
|
6169
|
+
while (q.length > 0) {
|
|
6170
|
+
const id = q.shift();
|
|
6171
|
+
if (seen.has(id)) continue;
|
|
6172
|
+
seen.add(id);
|
|
6173
|
+
if (!allBranches.has(id) && reachable.get(id)?.size === branchStarts.length) {
|
|
6174
|
+
return id;
|
|
6175
|
+
}
|
|
6176
|
+
const outs = outgoing.get(id) || [];
|
|
6177
|
+
for (const e of outs) q.push(e.to);
|
|
6178
|
+
}
|
|
6179
|
+
return null;
|
|
6180
|
+
}
|
|
6181
|
+
function buildLayout(startId, outgoing, incoming, nodeMap, visited) {
|
|
6182
|
+
const items = [];
|
|
6183
|
+
let currentId = startId;
|
|
6184
|
+
while (currentId) {
|
|
6185
|
+
if (visited.has(currentId)) break;
|
|
6186
|
+
const node = nodeMap.get(currentId);
|
|
6187
|
+
if (!node) break;
|
|
6188
|
+
const outs = outgoing.get(currentId) || [];
|
|
6189
|
+
if (outs.length <= 1) {
|
|
6190
|
+
visited.add(currentId);
|
|
6191
|
+
items.push({ type: "node", nodeId: currentId });
|
|
6192
|
+
if (outs.length === 1) {
|
|
6193
|
+
const nextId = outs[0].to;
|
|
6194
|
+
if (visited.has(nextId)) break;
|
|
6195
|
+
items.push({ type: "arrow", label: outs[0].label });
|
|
6196
|
+
currentId = nextId;
|
|
6197
|
+
} else {
|
|
6198
|
+
currentId = null;
|
|
6199
|
+
}
|
|
6200
|
+
} else {
|
|
6201
|
+
visited.add(currentId);
|
|
6202
|
+
items.push({ type: "node", nodeId: currentId });
|
|
6203
|
+
const branchStarts = outs.map((e) => e.to);
|
|
6204
|
+
const mergeId = findMergePoint(branchStarts, outgoing);
|
|
6205
|
+
const branches = [];
|
|
6206
|
+
for (const edge of outs) {
|
|
6207
|
+
if (visited.has(edge.to) && edge.to !== mergeId) {
|
|
6208
|
+
branches.push({ label: edge.label, items: [] });
|
|
6209
|
+
continue;
|
|
6210
|
+
}
|
|
6211
|
+
const branchItems = buildLayout(edge.to, outgoing, incoming, nodeMap, visited);
|
|
6212
|
+
branches.push({ label: edge.label, items: branchItems });
|
|
6213
|
+
}
|
|
6214
|
+
items.push({ type: "branch", decision: currentId, branches, mergeId });
|
|
6215
|
+
if (mergeId && !visited.has(mergeId)) {
|
|
6216
|
+
items.push({ type: "arrow" });
|
|
6217
|
+
currentId = mergeId;
|
|
6218
|
+
} else {
|
|
6219
|
+
currentId = null;
|
|
6220
|
+
}
|
|
6221
|
+
}
|
|
6222
|
+
}
|
|
6223
|
+
return items;
|
|
6224
|
+
}
|
|
6225
|
+
function FlowArrow({ label }) {
|
|
6226
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
6227
|
+
label && /* @__PURE__ */ 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 }),
|
|
6228
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-4 bg-gray-300" }),
|
|
6229
|
+
/* @__PURE__ */ 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" })
|
|
6230
|
+
] });
|
|
6231
|
+
}
|
|
6232
|
+
function FlowNodeBox({ node }) {
|
|
6233
|
+
if (node.type === "decision") {
|
|
6234
|
+
return /* @__PURE__ */ jsxs(
|
|
6235
|
+
"div",
|
|
6236
|
+
{
|
|
6237
|
+
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",
|
|
6238
|
+
style: { minWidth: "120px" },
|
|
6239
|
+
children: [
|
|
6240
|
+
/* @__PURE__ */ jsx("span", { className: "text-amber-400 mr-1", children: "\u25C7" }),
|
|
6241
|
+
node.label
|
|
6242
|
+
]
|
|
6243
|
+
}
|
|
6244
|
+
);
|
|
6245
|
+
}
|
|
6246
|
+
if (node.type === "terminal") {
|
|
6247
|
+
return /* @__PURE__ */ 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 });
|
|
6248
|
+
}
|
|
6249
|
+
return /* @__PURE__ */ 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 });
|
|
6250
|
+
}
|
|
6251
|
+
function RenderLayoutItems({ items, nodeMap }) {
|
|
6252
|
+
return /* @__PURE__ */ jsx(Fragment, { children: items.map((item, i) => {
|
|
6253
|
+
if (item.type === "node") {
|
|
6254
|
+
const node = nodeMap.get(item.nodeId);
|
|
6255
|
+
if (!node) return null;
|
|
6256
|
+
return /* @__PURE__ */ jsx(FlowNodeBox, { node }, `node-${item.nodeId}`);
|
|
6257
|
+
}
|
|
6258
|
+
if (item.type === "arrow") {
|
|
6259
|
+
return /* @__PURE__ */ jsx(FlowArrow, { label: item.label }, `arrow-${i}`);
|
|
6260
|
+
}
|
|
6261
|
+
if (item.type === "branch") {
|
|
6262
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center w-full", children: [
|
|
6263
|
+
/* @__PURE__ */ jsx("div", { className: "w-px h-3 bg-gray-300" }),
|
|
6264
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-start justify-center gap-6 w-full", children: item.branches.map((branch, j) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center min-w-[100px]", children: [
|
|
6265
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
|
|
6266
|
+
branch.label && /* @__PURE__ */ 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 }),
|
|
6267
|
+
/* @__PURE__ */ 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" })
|
|
6268
|
+
] }),
|
|
6269
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col items-center", children: /* @__PURE__ */ jsx(RenderLayoutItems, { items: branch.items, nodeMap }) })
|
|
6270
|
+
] }, j)) }),
|
|
6271
|
+
item.mergeId && /* @__PURE__ */ jsx("div", { className: "w-px h-3 bg-gray-300" })
|
|
6272
|
+
] }, `branch-${item.decision}-${i}`);
|
|
6273
|
+
}
|
|
6274
|
+
return null;
|
|
6275
|
+
}) });
|
|
6276
|
+
}
|
|
6277
|
+
function FlowchartDiagram({ mermaid, className }) {
|
|
6278
|
+
const { nodes, edges } = parseMermaidFlowchart(mermaid);
|
|
6279
|
+
if (nodes.length === 0) {
|
|
6280
|
+
return /* @__PURE__ */ jsx("pre", { className: "text-xs bg-white border border-gray-100 rounded-sm p-3 overflow-x-auto whitespace-pre-wrap", children: mermaid });
|
|
6281
|
+
}
|
|
6282
|
+
const outgoing = /* @__PURE__ */ new Map();
|
|
6283
|
+
const incoming = /* @__PURE__ */ new Map();
|
|
6284
|
+
for (const edge of edges) {
|
|
6285
|
+
if (!outgoing.has(edge.from)) outgoing.set(edge.from, []);
|
|
6286
|
+
outgoing.get(edge.from).push(edge);
|
|
6287
|
+
if (!incoming.has(edge.to)) incoming.set(edge.to, []);
|
|
6288
|
+
incoming.get(edge.to).push(edge);
|
|
6289
|
+
}
|
|
6290
|
+
const nodeMap = new Map(nodes.map((n) => [n.id, n]));
|
|
6291
|
+
const roots = nodes.filter((n) => !incoming.has(n.id) || incoming.get(n.id).length === 0);
|
|
6292
|
+
const startId = roots.length > 0 ? roots[0].id : nodes[0].id;
|
|
6293
|
+
const visited = /* @__PURE__ */ new Set();
|
|
6294
|
+
const layout = buildLayout(startId, outgoing, incoming, nodeMap, visited);
|
|
6295
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center py-2", children: /* @__PURE__ */ jsx(RenderLayoutItems, { items: layout, nodeMap }) }) });
|
|
6296
|
+
}
|
|
6297
|
+
var frequencyLabels = {
|
|
6298
|
+
multiple_daily: "occurrence",
|
|
6299
|
+
daily: "day",
|
|
6300
|
+
weekly: "week",
|
|
6301
|
+
monthly: "month",
|
|
6302
|
+
quarterly: "quarter",
|
|
6303
|
+
yearly: "year"
|
|
6304
|
+
};
|
|
6305
|
+
function SectionHeader({
|
|
6306
|
+
icon,
|
|
6307
|
+
title,
|
|
6308
|
+
count: count2,
|
|
6309
|
+
expanded,
|
|
6310
|
+
onToggle,
|
|
6311
|
+
iconColor = "text-[var(--cyan)]"
|
|
6312
|
+
}) {
|
|
6313
|
+
return /* @__PURE__ */ jsxs(
|
|
6314
|
+
"button",
|
|
6315
|
+
{
|
|
6316
|
+
onClick: onToggle,
|
|
6317
|
+
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",
|
|
6318
|
+
children: [
|
|
6319
|
+
expanded ? /* @__PURE__ */ jsx(CaretDown, { size: 12 }) : /* @__PURE__ */ jsx(CaretRight, { size: 12 }),
|
|
6320
|
+
/* @__PURE__ */ jsx("span", { className: iconColor, children: icon }),
|
|
6321
|
+
title,
|
|
6322
|
+
count2 !== void 0 && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground font-normal", children: [
|
|
6323
|
+
"(",
|
|
6324
|
+
count2,
|
|
6325
|
+
")"
|
|
6326
|
+
] })
|
|
6327
|
+
]
|
|
6328
|
+
}
|
|
6329
|
+
);
|
|
6330
|
+
}
|
|
6331
|
+
function WorkerSpec({ documentation, className }) {
|
|
6332
|
+
const [expandedSections, setExpandedSections] = useState(
|
|
6333
|
+
/* @__PURE__ */ new Set(["goal", "scope", "steps", "diagram", "impact", "requirements", "edge_cases"])
|
|
6334
|
+
);
|
|
6335
|
+
const toggleSection = (section) => {
|
|
6336
|
+
setExpandedSections((prev) => {
|
|
6337
|
+
const next = new Set(prev);
|
|
6338
|
+
if (next.has(section)) {
|
|
6339
|
+
next.delete(section);
|
|
6340
|
+
} else {
|
|
6341
|
+
next.add(section);
|
|
6342
|
+
}
|
|
6343
|
+
return next;
|
|
6344
|
+
});
|
|
6345
|
+
};
|
|
6346
|
+
if (!documentation) {
|
|
6347
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 p-6 rounded-sm border border-dashed border-gray-300 bg-gray-50/50", children: [
|
|
6348
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-sm bg-gray-100 flex items-center justify-center", children: /* @__PURE__ */ jsx(Robot, { size: 20, className: "text-gray-400" }) }),
|
|
6349
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
6350
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-[var(--black)]", children: "Worker Spec Pending" }),
|
|
6351
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "The final specification will be generated automatically after the documentation is approved." })
|
|
6352
|
+
] })
|
|
6353
|
+
] }) });
|
|
6354
|
+
}
|
|
6355
|
+
const freqLabel = documentation.expected_impact?.frequency ? frequencyLabels[documentation.expected_impact.frequency] || documentation.expected_impact.frequency : "occurrence";
|
|
6356
|
+
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
|
|
6357
|
+
documentation.goal && /* @__PURE__ */ jsxs("div", { children: [
|
|
6358
|
+
/* @__PURE__ */ jsx(
|
|
6359
|
+
SectionHeader,
|
|
6360
|
+
{
|
|
6361
|
+
icon: /* @__PURE__ */ jsx(Target, { size: 12, weight: "fill" }),
|
|
6362
|
+
title: "Goal",
|
|
6363
|
+
expanded: expandedSections.has("goal"),
|
|
6364
|
+
onToggle: () => toggleSection("goal")
|
|
6365
|
+
}
|
|
6366
|
+
),
|
|
6367
|
+
expandedSections.has("goal") && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed pl-5 mt-2", children: documentation.goal })
|
|
6368
|
+
] }),
|
|
6369
|
+
documentation.scope && /* @__PURE__ */ jsxs("div", { children: [
|
|
6370
|
+
/* @__PURE__ */ jsx(
|
|
6371
|
+
SectionHeader,
|
|
6372
|
+
{
|
|
6373
|
+
icon: /* @__PURE__ */ jsx(Crosshair, { size: 12, weight: "fill" }),
|
|
6374
|
+
title: "Scope",
|
|
6375
|
+
expanded: expandedSections.has("scope"),
|
|
6376
|
+
onToggle: () => toggleSection("scope")
|
|
6377
|
+
}
|
|
6378
|
+
),
|
|
6379
|
+
expandedSections.has("scope") && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed pl-5 mt-2", children: documentation.scope })
|
|
6380
|
+
] }),
|
|
6381
|
+
documentation.steps && documentation.steps.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
6382
|
+
/* @__PURE__ */ jsx(
|
|
6383
|
+
SectionHeader,
|
|
6384
|
+
{
|
|
6385
|
+
icon: /* @__PURE__ */ jsx(ListNumbers, { size: 12, weight: "fill" }),
|
|
6386
|
+
title: "Steps",
|
|
6387
|
+
count: documentation.steps.length,
|
|
6388
|
+
expanded: expandedSections.has("steps"),
|
|
6389
|
+
onToggle: () => toggleSection("steps")
|
|
6390
|
+
}
|
|
6391
|
+
),
|
|
6392
|
+
expandedSections.has("steps") && /* @__PURE__ */ jsx("div", { className: "space-y-3 pl-5 mt-2", children: documentation.steps.map((step, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
|
|
6393
|
+
/* @__PURE__ */ 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 }),
|
|
6394
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
6395
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--black)]", children: step.title }),
|
|
6396
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: step.description }),
|
|
6397
|
+
step.tools_used && step.tools_used.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1 mt-1.5", children: step.tools_used.map((tool, j) => /* @__PURE__ */ 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: [
|
|
6398
|
+
/* @__PURE__ */ jsx(Wrench, { size: 10 }),
|
|
6399
|
+
tool
|
|
6400
|
+
] }, j)) })
|
|
6401
|
+
] })
|
|
6402
|
+
] }, i)) })
|
|
6403
|
+
] }),
|
|
6404
|
+
documentation.diagram && /* @__PURE__ */ jsxs("div", { children: [
|
|
6405
|
+
/* @__PURE__ */ jsx(
|
|
6406
|
+
SectionHeader,
|
|
6407
|
+
{
|
|
6408
|
+
icon: /* @__PURE__ */ jsx(TreeStructure, { size: 12, weight: "fill" }),
|
|
6409
|
+
title: "Workflow Diagram",
|
|
6410
|
+
expanded: expandedSections.has("diagram"),
|
|
6411
|
+
onToggle: () => toggleSection("diagram"),
|
|
6412
|
+
iconColor: "text-purple-500"
|
|
6413
|
+
}
|
|
6414
|
+
),
|
|
6415
|
+
expandedSections.has("diagram") && /* @__PURE__ */ jsx("div", { className: "pl-5 mt-2", children: /* @__PURE__ */ jsx("div", { className: "bg-white border border-gray-100 rounded-sm p-4 overflow-x-auto", children: /* @__PURE__ */ jsx(FlowchartDiagram, { mermaid: documentation.diagram }) }) })
|
|
6416
|
+
] }),
|
|
6417
|
+
documentation.expected_impact && /* @__PURE__ */ jsxs("div", { children: [
|
|
6418
|
+
/* @__PURE__ */ jsx(
|
|
6419
|
+
SectionHeader,
|
|
6420
|
+
{
|
|
6421
|
+
icon: /* @__PURE__ */ jsx(Lightning, { size: 12, weight: "fill" }),
|
|
6422
|
+
title: "Expected Impact",
|
|
6423
|
+
expanded: expandedSections.has("impact"),
|
|
6424
|
+
onToggle: () => toggleSection("impact"),
|
|
6425
|
+
iconColor: "text-purple-500"
|
|
6426
|
+
}
|
|
6427
|
+
),
|
|
6428
|
+
expandedSections.has("impact") && /* @__PURE__ */ jsx("div", { className: "pl-5 mt-2", children: /* @__PURE__ */ jsxs("div", { className: "bg-emerald-50/50 border border-emerald-100 rounded-sm p-4", children: [
|
|
6429
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-3 gap-3 mb-3", children: [
|
|
6430
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-white rounded-sm p-3 border border-emerald-100 text-center", children: [
|
|
6431
|
+
/* @__PURE__ */ jsx(Clock, { size: 18, className: "text-emerald-600 mx-auto mb-1" }),
|
|
6432
|
+
/* @__PURE__ */ jsxs("p", { className: "text-lg font-bold text-[var(--black)]", children: [
|
|
6433
|
+
documentation.expected_impact.time_saved_per_occurrence_minutes,
|
|
6434
|
+
" min"
|
|
6435
|
+
] }),
|
|
6436
|
+
/* @__PURE__ */ jsxs("p", { className: "text-[10px] text-muted-foreground", children: [
|
|
6437
|
+
"saved per ",
|
|
6438
|
+
freqLabel
|
|
6439
|
+
] })
|
|
6440
|
+
] }),
|
|
6441
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-white rounded-sm p-3 border border-emerald-100 text-center", children: [
|
|
6442
|
+
/* @__PURE__ */ jsx(TrendUp, { size: 18, className: "text-emerald-600 mx-auto mb-1" }),
|
|
6443
|
+
/* @__PURE__ */ jsxs("p", { className: "text-lg font-bold text-[var(--black)]", children: [
|
|
6444
|
+
documentation.expected_impact.yearly_hours_saved,
|
|
6445
|
+
"h"
|
|
6446
|
+
] }),
|
|
6447
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground", children: "saved per year" })
|
|
6448
|
+
] }),
|
|
6449
|
+
/* @__PURE__ */ jsxs("div", { className: "bg-white rounded-sm p-3 border border-emerald-100 text-center", children: [
|
|
6450
|
+
/* @__PURE__ */ jsx(CurrencyEur, { size: 18, className: "text-emerald-600 mx-auto mb-1" }),
|
|
6451
|
+
/* @__PURE__ */ jsxs("p", { className: "text-lg font-bold text-[var(--black)]", children: [
|
|
6452
|
+
"\u20AC",
|
|
6453
|
+
documentation.expected_impact.yearly_cost_savings_euros.toLocaleString()
|
|
6454
|
+
] }),
|
|
6455
|
+
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground", children: "estimated yearly savings" })
|
|
6456
|
+
] })
|
|
6457
|
+
] }),
|
|
6458
|
+
documentation.expected_impact.qualitative_benefits && documentation.expected_impact.qualitative_benefits.length > 0 && /* @__PURE__ */ jsx("div", { className: "space-y-1", children: documentation.expected_impact.qualitative_benefits.map((benefit, i) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 text-sm text-emerald-700", children: [
|
|
6459
|
+
/* @__PURE__ */ jsx(Sparkle, { size: 14, className: "text-emerald-500 shrink-0 mt-0.5", weight: "fill" }),
|
|
6460
|
+
benefit
|
|
6461
|
+
] }, i)) })
|
|
6462
|
+
] }) })
|
|
6463
|
+
] }),
|
|
6464
|
+
(documentation.technical_requirements && documentation.technical_requirements.length > 0 || documentation.integration_points && documentation.integration_points.length > 0) && /* @__PURE__ */ jsxs("div", { children: [
|
|
6465
|
+
/* @__PURE__ */ jsx(
|
|
6466
|
+
SectionHeader,
|
|
6467
|
+
{
|
|
6468
|
+
icon: /* @__PURE__ */ jsx(Plugs, { size: 12, weight: "fill" }),
|
|
6469
|
+
title: "Requirements & Integrations",
|
|
6470
|
+
expanded: expandedSections.has("requirements"),
|
|
6471
|
+
onToggle: () => toggleSection("requirements")
|
|
6472
|
+
}
|
|
6473
|
+
),
|
|
6474
|
+
expandedSections.has("requirements") && /* @__PURE__ */ jsxs("div", { className: "grid md:grid-cols-2 gap-4 pl-5 mt-2", children: [
|
|
6475
|
+
documentation.technical_requirements && documentation.technical_requirements.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
6476
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: "Technical Requirements" }),
|
|
6477
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-1.5", children: documentation.technical_requirements.map((req, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [
|
|
6478
|
+
/* @__PURE__ */ jsx(Wrench, { size: 12, className: "text-gray-400 shrink-0 mt-1" }),
|
|
6479
|
+
req
|
|
6480
|
+
] }, i)) })
|
|
6481
|
+
] }),
|
|
6482
|
+
documentation.integration_points && documentation.integration_points.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
6483
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2", children: "Integration Points" }),
|
|
6484
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-1.5", children: documentation.integration_points.map((point, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [
|
|
6485
|
+
/* @__PURE__ */ jsx(Plugs, { size: 12, className: "text-gray-400 shrink-0 mt-1" }),
|
|
6486
|
+
point
|
|
6487
|
+
] }, i)) })
|
|
6488
|
+
] })
|
|
6489
|
+
] })
|
|
6490
|
+
] }),
|
|
6491
|
+
documentation.edge_cases_handled && documentation.edge_cases_handled.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
6492
|
+
/* @__PURE__ */ jsx(
|
|
6493
|
+
SectionHeader,
|
|
6494
|
+
{
|
|
6495
|
+
icon: /* @__PURE__ */ jsx(ShieldCheck, { size: 12, weight: "fill" }),
|
|
6496
|
+
title: "Edge Cases Handled",
|
|
6497
|
+
count: documentation.edge_cases_handled.length,
|
|
6498
|
+
expanded: expandedSections.has("edge_cases"),
|
|
6499
|
+
onToggle: () => toggleSection("edge_cases"),
|
|
6500
|
+
iconColor: "text-amber-500"
|
|
6501
|
+
}
|
|
6502
|
+
),
|
|
6503
|
+
expandedSections.has("edge_cases") && /* @__PURE__ */ jsx("div", { className: "space-y-2 pl-5 mt-2", children: documentation.edge_cases_handled.map((ec, i) => /* @__PURE__ */ jsxs("div", { className: "text-sm p-3 bg-gray-50 rounded-sm border border-gray-100", children: [
|
|
6504
|
+
/* @__PURE__ */ jsx("p", { className: "font-medium text-[var(--black)]", children: ec.scenario }),
|
|
6505
|
+
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mt-1", children: [
|
|
6506
|
+
"\u2192 ",
|
|
6507
|
+
ec.handling
|
|
6508
|
+
] })
|
|
6509
|
+
] }, i)) })
|
|
6510
|
+
] }),
|
|
6511
|
+
/* @__PURE__ */ jsxs("div", { className: "pt-3 border-t border-gray-100 flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
6512
|
+
/* @__PURE__ */ jsxs(Badge, { variant: "outline", size: "sm", children: [
|
|
6513
|
+
"v",
|
|
6514
|
+
documentation.version
|
|
6515
|
+
] }),
|
|
6516
|
+
documentation.model_used && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6517
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
6518
|
+
/* @__PURE__ */ jsx("span", { children: documentation.model_used })
|
|
6519
|
+
] }),
|
|
6520
|
+
/* @__PURE__ */ jsx("span", { children: "\u2022" }),
|
|
6521
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
6522
|
+
"Updated ",
|
|
6523
|
+
new Date(documentation.updated_at).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" })
|
|
6524
|
+
] })
|
|
6525
|
+
] })
|
|
6526
|
+
] }) });
|
|
6527
|
+
}
|
|
6093
6528
|
|
|
6094
6529
|
// src/index.ts
|
|
6095
6530
|
__reExport(index_exports, icons_exports);
|
|
6096
6531
|
|
|
6097
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityTimeline, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbLink, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, ConfirmDialog, DateRangePicker, DateRangeSelect, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorState, FilePreview, FormField, IconBox, ImpactMetricsForm, Input, Label2 as Label, LabeledSlider, LabeledSwitch, Logo, Metric, MetricCard, MetricLabel, MetricSubtext, MetricValue, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupCard, RadioGroupItem, RadioGroupOption, ScenariosManager, Select, Separator2 as Separator, SettingsNav, SettingsNavLink, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimplePagination, SimpleTooltip, Skeleton, SkeletonCard, SkeletonText, Slider, Stat, StepDots, StepProgress, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsListUnderline, TabsTrigger, TabsTriggerUnderline, Tag, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastIcon, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, UsageBar, UsageChart, WorkflowFlow, WorkflowViewer, alertVariants, badgeVariants, buttonVariants, cn, getDateRangeFromPreset, iconBoxVariants, metricCardVariants, navigationMenuTriggerStyle, progressVariants, statVariants, tagVariants, toast, usageBarVariants, useToast, valueVariants };
|
|
6532
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActivityTimeline, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, BreadcrumbLink, Breadcrumbs, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, ConfirmDialog, DateRangePicker, DateRangeSelect, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ErrorState, FilePreview, FlowchartDiagram, FormField, IconBox, ImpactMetricsForm, Input, Label2 as Label, LabeledSlider, LabeledSwitch, Logo, Metric, MetricCard, MetricLabel, MetricSubtext, MetricValue, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupCard, RadioGroupItem, RadioGroupOption, ScenariosManager, Select, Separator2 as Separator, SettingsNav, SettingsNavLink, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SimplePagination, SimpleTooltip, Skeleton, SkeletonCard, SkeletonText, Slider, Stat, StepDots, StepProgress, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsListUnderline, TabsTrigger, TabsTriggerUnderline, Tag, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastIcon, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, UsageBar, UsageChart, WorkerSpec, WorkflowFlow, WorkflowViewer, alertVariants, badgeVariants, buttonVariants, cn, getDateRangeFromPreset, iconBoxVariants, metricCardVariants, navigationMenuTriggerStyle, progressVariants, statVariants, tagVariants, toast, usageBarVariants, useToast, valueVariants };
|
|
6098
6533
|
//# sourceMappingURL=index.mjs.map
|
|
6099
6534
|
//# sourceMappingURL=index.mjs.map
|