@dilipod/ui 0.4.19 → 0.4.21
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/scenarios-manager.d.ts.map +1 -1
- package/dist/index.js +30 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -35
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/scenarios-manager.tsx +65 -76
package/dist/index.mjs
CHANGED
|
@@ -4223,17 +4223,16 @@ 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: [
|
|
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 }) }),
|
|
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: [
|
|
4231
4230
|
/* @__PURE__ */ jsxs("p", { className: "text-sm text-[var(--black)]", children: [
|
|
4232
4231
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: "When:" }),
|
|
4233
4232
|
" ",
|
|
4234
4233
|
scenario.situation
|
|
4235
4234
|
] }),
|
|
4236
|
-
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-
|
|
4235
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground mt-0.5", children: [
|
|
4237
4236
|
/* @__PURE__ */ jsx("span", { className: "text-[var(--black)] font-medium", children: "Action:" }),
|
|
4238
4237
|
" ",
|
|
4239
4238
|
scenario.action
|
|
@@ -4246,9 +4245,9 @@ function ScenarioCard({
|
|
|
4246
4245
|
{
|
|
4247
4246
|
variant: "ghost",
|
|
4248
4247
|
size: "icon",
|
|
4249
|
-
className: "h-
|
|
4248
|
+
className: "h-7 w-7 text-muted-foreground hover:text-[var(--black)]",
|
|
4250
4249
|
onClick: onEdit,
|
|
4251
|
-
children: /* @__PURE__ */ jsx(PencilSimple, { size:
|
|
4250
|
+
children: /* @__PURE__ */ jsx(PencilSimple, { size: 14 })
|
|
4252
4251
|
}
|
|
4253
4252
|
),
|
|
4254
4253
|
/* @__PURE__ */ jsx(
|
|
@@ -4256,13 +4255,13 @@ function ScenarioCard({
|
|
|
4256
4255
|
{
|
|
4257
4256
|
variant: "ghost",
|
|
4258
4257
|
size: "icon",
|
|
4259
|
-
className: "h-
|
|
4258
|
+
className: "h-7 w-7 text-muted-foreground hover:text-red-600 hover:bg-red-50",
|
|
4260
4259
|
onClick: onDelete,
|
|
4261
|
-
children: /* @__PURE__ */ jsx(Trash, { size:
|
|
4260
|
+
children: /* @__PURE__ */ jsx(Trash, { size: 14 })
|
|
4262
4261
|
}
|
|
4263
4262
|
)
|
|
4264
4263
|
] })
|
|
4265
|
-
] })
|
|
4264
|
+
] });
|
|
4266
4265
|
}
|
|
4267
4266
|
function SuggestionChip({
|
|
4268
4267
|
suggestion,
|
|
@@ -4441,31 +4440,27 @@ function ScenariosManager({
|
|
|
4441
4440
|
{
|
|
4442
4441
|
type: "button",
|
|
4443
4442
|
onClick: () => setIsExpanded(!isExpanded),
|
|
4444
|
-
className: "w-full flex items-center justify-between
|
|
4443
|
+
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
4444
|
children: [
|
|
4446
4445
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
4447
|
-
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-
|
|
4446
|
+
/* @__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
4447
|
/* @__PURE__ */ jsxs("div", { className: "text-left", children: [
|
|
4449
|
-
/* @__PURE__ */
|
|
4450
|
-
|
|
4448
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4449
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-[var(--black)]", children: "Scenarios" }),
|
|
4450
|
+
isComplete && /* @__PURE__ */ jsxs(Badge, { variant: "primary", size: "sm", children: [
|
|
4451
|
+
/* @__PURE__ */ jsx(CheckCircle, { size: 12, weight: "fill" }),
|
|
4452
|
+
"Complete"
|
|
4453
|
+
] })
|
|
4454
|
+
] }),
|
|
4455
|
+
/* @__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` })
|
|
4451
4456
|
] })
|
|
4452
4457
|
] }),
|
|
4453
|
-
/* @__PURE__ */
|
|
4454
|
-
isComplete && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-[var(--cyan)]", children: [
|
|
4455
|
-
/* @__PURE__ */ jsx(CheckCircle, { size: 16, weight: "fill" }),
|
|
4456
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium", children: "Complete" })
|
|
4457
|
-
] }),
|
|
4458
|
-
isExpanded ? /* @__PURE__ */ jsx(CaretUp, { size: 20, className: "text-muted-foreground" }) : /* @__PURE__ */ jsx(CaretDown, { size: 20, className: "text-muted-foreground" })
|
|
4459
|
-
] })
|
|
4458
|
+
isExpanded ? /* @__PURE__ */ jsx(CaretUp, { size: 20, className: "text-muted-foreground" }) : /* @__PURE__ */ jsx(CaretDown, { size: 20, className: "text-muted-foreground" })
|
|
4460
4459
|
]
|
|
4461
4460
|
}
|
|
4462
4461
|
),
|
|
4463
4462
|
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(
|
|
4463
|
+
scenarios.length > 0 && /* @__PURE__ */ jsx("div", { className: "px-4", children: scenarios.map((scenario) => /* @__PURE__ */ jsx(
|
|
4469
4464
|
ScenarioCard,
|
|
4470
4465
|
{
|
|
4471
4466
|
scenario,
|
|
@@ -4474,15 +4469,18 @@ function ScenariosManager({
|
|
|
4474
4469
|
},
|
|
4475
4470
|
scenario.id
|
|
4476
4471
|
)) }),
|
|
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" }) }),
|
|
4472
|
+
scenarios.length === 0 && /* @__PURE__ */ jsxs("div", { className: "px-4 py-6 text-center", children: [
|
|
4479
4473
|
/* @__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
4474
|
/* @__PURE__ */ jsxs(Button, { variant: "outline", size: "sm", onClick: handleAddClick, children: [
|
|
4481
4475
|
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1.5" }),
|
|
4482
4476
|
"Add your first scenario"
|
|
4483
4477
|
] })
|
|
4484
4478
|
] }),
|
|
4485
|
-
|
|
4479
|
+
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: [
|
|
4480
|
+
/* @__PURE__ */ jsx(Plus, { size: 16, className: "mr-1.5" }),
|
|
4481
|
+
"Add scenario"
|
|
4482
|
+
] }) }),
|
|
4483
|
+
filteredSuggestions.length > 0 && !isComplete && /* @__PURE__ */ jsxs("div", { className: "px-4 pt-2", children: [
|
|
4486
4484
|
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mb-2", children: "Suggested scenarios:" }),
|
|
4487
4485
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: filteredSuggestions.map((suggestion, index) => /* @__PURE__ */ jsx(
|
|
4488
4486
|
SuggestionChip,
|
|
@@ -4494,11 +4492,8 @@ function ScenariosManager({
|
|
|
4494
4492
|
index
|
|
4495
4493
|
)) })
|
|
4496
4494
|
] }),
|
|
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
|
-
] }),
|
|
4495
|
+
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: [
|
|
4496
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Mark your scenarios as complete to continue." }),
|
|
4502
4497
|
/* @__PURE__ */ jsxs(
|
|
4503
4498
|
Button,
|
|
4504
4499
|
{
|
|
@@ -4514,7 +4509,7 @@ function ScenariosManager({
|
|
|
4514
4509
|
}
|
|
4515
4510
|
)
|
|
4516
4511
|
] }) }),
|
|
4517
|
-
isComplete && /* @__PURE__ */ jsx("div", { className: "
|
|
4512
|
+
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
4513
|
] }),
|
|
4519
4514
|
/* @__PURE__ */ jsx(
|
|
4520
4515
|
ScenarioDialog,
|