@dilipod/ui 0.4.20 → 0.4.22
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/impact-metrics-form.d.ts.map +1 -1
- package/dist/components/scenarios-manager.d.ts.map +1 -1
- package/dist/components/workflow-viewer.d.ts +1 -1
- package/dist/components/workflow-viewer.d.ts.map +1 -1
- package/dist/index.js +47 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +47 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/impact-metrics-form.tsx +17 -6
- package/src/components/scenarios-manager.tsx +61 -71
- package/src/components/workflow-viewer.tsx +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4223,17 +4223,17 @@ function ScenarioCard({
|
|
|
4223
4223
|
}) {
|
|
4224
4224
|
const config = typeConfig[scenario.type];
|
|
4225
4225
|
const Icon = config.icon;
|
|
4226
|
-
return /* @__PURE__ */
|
|
4226
|
+
return /* @__PURE__ */ jsxs("div", { className: "group relative flex items-start justify-between gap-3 py-3 border-b border-border/50 last:border-b-0", children: [
|
|
4227
4227
|
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 flex-1 min-w-0", children: [
|
|
4228
|
-
/* @__PURE__ */ jsx("div", { className: cn("w-
|
|
4229
|
-
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
4228
|
+
/* @__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
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0 pt-0.5", children: [
|
|
4230
4230
|
/* @__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 }) }),
|
|
4231
4231
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--black)]", children: [
|
|
4232
4232
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "When:" }),
|
|
4233
4233
|
" ",
|
|
4234
4234
|
scenario.situation
|
|
4235
4235
|
] }),
|
|
4236
|
-
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-
|
|
4236
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-0.5", children: [
|
|
4237
4237
|
/* @__PURE__ */ jsx("span", { className: "text-[var(--black)] font-medium", children: "Action:" }),
|
|
4238
4238
|
" ",
|
|
4239
4239
|
scenario.action
|
|
@@ -4246,9 +4246,9 @@ function ScenarioCard({
|
|
|
4246
4246
|
{
|
|
4247
4247
|
variant: "ghost",
|
|
4248
4248
|
size: "icon",
|
|
4249
|
-
className: "h-
|
|
4249
|
+
className: "h-7 w-7 text-muted-foreground hover:text-[var(--black)]",
|
|
4250
4250
|
onClick: onEdit,
|
|
4251
|
-
children: /* @__PURE__ */ jsx(PencilSimple, { size:
|
|
4251
|
+
children: /* @__PURE__ */ jsx(PencilSimple, { size: 14 })
|
|
4252
4252
|
}
|
|
4253
4253
|
),
|
|
4254
4254
|
/* @__PURE__ */ jsx(
|
|
@@ -4256,13 +4256,13 @@ function ScenarioCard({
|
|
|
4256
4256
|
{
|
|
4257
4257
|
variant: "ghost",
|
|
4258
4258
|
size: "icon",
|
|
4259
|
-
className: "h-
|
|
4259
|
+
className: "h-7 w-7 text-muted-foreground hover:text-red-600 hover:bg-red-50",
|
|
4260
4260
|
onClick: onDelete,
|
|
4261
|
-
children: /* @__PURE__ */ jsx(Trash, { size:
|
|
4261
|
+
children: /* @__PURE__ */ jsx(Trash, { size: 14 })
|
|
4262
4262
|
}
|
|
4263
4263
|
)
|
|
4264
4264
|
] })
|
|
4265
|
-
] })
|
|
4265
|
+
] });
|
|
4266
4266
|
}
|
|
4267
4267
|
function SuggestionChip({
|
|
4268
4268
|
suggestion,
|
|
@@ -4441,10 +4441,10 @@ function ScenariosManager({
|
|
|
4441
4441
|
{
|
|
4442
4442
|
type: "button",
|
|
4443
4443
|
onClick: () => setIsExpanded(!isExpanded),
|
|
4444
|
-
className: "w-full flex items-center justify-between
|
|
4444
|
+
className: "w-full flex items-center justify-between border border-border/50 px-4 py-3 rounded-lg hover:bg-muted/30 transition-colors",
|
|
4445
4445
|
children: [
|
|
4446
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-
|
|
4447
|
-
/* @__PURE__ */ jsx("div", { className: "w-
|
|
4446
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
4447
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-lg bg-[var(--cyan)]/10 flex items-center justify-center", children: /* @__PURE__ */ jsx(Lightning, { size: 20, weight: "fill", className: "text-[var(--cyan)]" }) }),
|
|
4448
4448
|
/* @__PURE__ */ jsxs("div", { className: "text-left", children: [
|
|
4449
4449
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4450
4450
|
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-[var(--black)]", children: "Scenarios" }),
|
|
@@ -4453,19 +4453,15 @@ function ScenariosManager({
|
|
|
4453
4453
|
"Complete"
|
|
4454
4454
|
] })
|
|
4455
4455
|
] }),
|
|
4456
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: scenarios.length === 0 ? "Define rules for edge cases
|
|
4456
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: scenarios.length === 0 ? "Define rules for edge cases" : `${scenarios.length} scenario${scenarios.length === 1 ? "" : "s"} defined` })
|
|
4457
4457
|
] })
|
|
4458
4458
|
] }),
|
|
4459
|
-
|
|
4459
|
+
isExpanded ? /* @__PURE__ */ jsx(CaretUp, { size: 20, className: "text-muted-foreground" }) : /* @__PURE__ */ jsx(CaretDown, { size: 20, className: "text-muted-foreground" })
|
|
4460
4460
|
]
|
|
4461
4461
|
}
|
|
4462
4462
|
),
|
|
4463
4463
|
isExpanded && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4464
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
4465
|
-
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1" }),
|
|
4466
|
-
"Add scenario"
|
|
4467
|
-
] }) }),
|
|
4468
|
-
scenarios.length > 0 && /* @__PURE__ */ jsx("div", { className: "grid gap-3", children: scenarios.map((scenario) => /* @__PURE__ */ jsx(
|
|
4464
|
+
scenarios.length > 0 && /* @__PURE__ */ jsx("div", { className: "px-4", children: scenarios.map((scenario) => /* @__PURE__ */ jsx(
|
|
4469
4465
|
ScenarioCard,
|
|
4470
4466
|
{
|
|
4471
4467
|
scenario,
|
|
@@ -4474,15 +4470,18 @@ function ScenariosManager({
|
|
|
4474
4470
|
},
|
|
4475
4471
|
scenario.id
|
|
4476
4472
|
)) }),
|
|
4477
|
-
scenarios.length === 0 && /* @__PURE__ */ jsxs("div", { className: "
|
|
4478
|
-
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-sm bg-muted flex items-center justify-center mx-auto mb-3", children: /* @__PURE__ */ jsx(Lightning, { size: 24, className: "text-muted-foreground" }) }),
|
|
4473
|
+
scenarios.length === 0 && /* @__PURE__ */ jsxs("div", { className: "px-4 py-6 text-center", children: [
|
|
4479
4474
|
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-4", children: "No scenarios yet. Add rules for how the worker should handle edge cases." }),
|
|
4480
4475
|
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: handleAddClick, children: [
|
|
4481
4476
|
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1.5" }),
|
|
4482
4477
|
"Add your first scenario"
|
|
4483
4478
|
] })
|
|
4484
4479
|
] }),
|
|
4485
|
-
|
|
4480
|
+
scenarios.length > 0 && /* @__PURE__ */ jsx("div", { className: "px-4 pt-2", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: handleAddClick, className: "text-muted-foreground hover:text-[var(--black)]", children: [
|
|
4481
|
+
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1.5" }),
|
|
4482
|
+
"Add scenario"
|
|
4483
|
+
] }) }),
|
|
4484
|
+
filteredSuggestions.length > 0 && !isComplete && /* @__PURE__ */ jsxs("div", { className: "px-4 pt-2", children: [
|
|
4486
4485
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-2", children: "Suggested scenarios:" }),
|
|
4487
4486
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: filteredSuggestions.map((suggestion, index) => /* @__PURE__ */ jsx(
|
|
4488
4487
|
SuggestionChip,
|
|
@@ -4494,11 +4493,8 @@ function ScenariosManager({
|
|
|
4494
4493
|
index
|
|
4495
4494
|
)) })
|
|
4496
4495
|
] }),
|
|
4497
|
-
canComplete && /* @__PURE__ */ jsx("div", { className: "pt-4 border-t border-border", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4
|
|
4498
|
-
/* @__PURE__ */
|
|
4499
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[var(--black)]", children: "Ready to proceed?" }),
|
|
4500
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5", children: "Mark your scenarios as complete to continue with the onboarding." })
|
|
4501
|
-
] }),
|
|
4496
|
+
canComplete && /* @__PURE__ */ jsx("div", { className: "px-4 pt-4 mt-2 border-t border-border/50", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
4497
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Mark your scenarios as complete to continue." }),
|
|
4502
4498
|
/* @__PURE__ */ jsxs(
|
|
4503
4499
|
Button,
|
|
4504
4500
|
{
|
|
@@ -4514,7 +4510,7 @@ function ScenariosManager({
|
|
|
4514
4510
|
}
|
|
4515
4511
|
)
|
|
4516
4512
|
] }) }),
|
|
4517
|
-
isComplete && /* @__PURE__ */ jsx("div", { className: "
|
|
4513
|
+
isComplete && /* @__PURE__ */ jsx("div", { className: "px-4 pt-3 mt-2 border-t border-border/50", children: /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "You can still add or edit scenarios while we build your worker." }) })
|
|
4518
4514
|
] }),
|
|
4519
4515
|
/* @__PURE__ */ jsx(
|
|
4520
4516
|
ScenarioDialog,
|
|
@@ -4612,6 +4608,7 @@ function ImpactMetricsForm({
|
|
|
4612
4608
|
const impliedFrequencyPerMonth = Math.round(impliedFrequencyPerYear / 12);
|
|
4613
4609
|
const laborSavingsPerYear = metrics.fte_equivalent * HOURS_PER_FTE_YEAR * metrics.hourly_rate_euros;
|
|
4614
4610
|
const netAnnualSavings = laborSavingsPerYear - workerCostPerYear;
|
|
4611
|
+
const roiPercentage = workerCostPerYear > 0 ? netAnnualSavings / workerCostPerYear * 100 : 0;
|
|
4615
4612
|
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: [
|
|
4616
4613
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4617
4614
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wide", children: "Impact Metrics (ROI)" }),
|
|
@@ -4729,17 +4726,32 @@ function ImpactMetricsForm({
|
|
|
4729
4726
|
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
|
|
4730
4727
|
"\u20AC",
|
|
4731
4728
|
laborSavingsPerYear.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4729
|
+
" ",
|
|
4730
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: "labor saved" }),
|
|
4732
4731
|
" \u2212 \u20AC",
|
|
4733
|
-
workerCostPerYear
|
|
4732
|
+
workerCostPerYear,
|
|
4733
|
+
" ",
|
|
4734
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: "worker cost" })
|
|
4734
4735
|
] })
|
|
4735
4736
|
] })
|
|
4736
4737
|
] }),
|
|
4737
|
-
|
|
4738
|
-
"
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4738
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 pt-3 border-t border-border/50 flex items-center justify-between", children: [
|
|
4739
|
+
/* @__PURE__ */ jsxs("p", { className: cn(
|
|
4740
|
+
"text-sm",
|
|
4741
|
+
roiPercentage > 0 ? "font-bold text-[var(--cyan)]" : "text-muted-foreground"
|
|
4742
|
+
), children: [
|
|
4743
|
+
"ROI: ",
|
|
4744
|
+
roiPercentage >= 0 ? "+" : "",
|
|
4745
|
+
roiPercentage.toLocaleString(void 0, { maximumFractionDigits: 0 }),
|
|
4746
|
+
"%"
|
|
4747
|
+
] }),
|
|
4748
|
+
impliedFrequencyPerYear > 0 && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
4749
|
+
"Implied: ~",
|
|
4750
|
+
impliedFrequencyPerMonth,
|
|
4751
|
+
"\xD7/month (",
|
|
4752
|
+
impliedFrequencyPerYear,
|
|
4753
|
+
"\xD7/year)"
|
|
4754
|
+
] })
|
|
4743
4755
|
] })
|
|
4744
4756
|
] }) });
|
|
4745
4757
|
}
|