@lssm/example.learning-journey-ui-onboarding 0.0.0-canary-20251216035145 → 0.0.0-canary-20251216062412

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.
@@ -1,120 +0,0 @@
1
- import { useState } from "react";
2
- import { Button } from "@lssm/lib.design-system";
3
- import { jsx, jsxs } from "react/jsx-runtime";
4
- import { cn } from "@lssm/lib.ui-kit-web/ui/utils";
5
-
6
- //#region src/components/StepChecklist.tsx
7
- function StepChecklist({ step, stepNumber, isCompleted, isCurrent, isExpanded, onToggle, onComplete }) {
8
- return /* @__PURE__ */ jsxs("div", {
9
- className: cn("rounded-xl border transition-all", isCompleted && "border-green-500/50 bg-green-500/5", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/5", !isCompleted && !isCurrent && "border-border"),
10
- children: [/* @__PURE__ */ jsxs("button", {
11
- type: "button",
12
- className: "flex w-full items-center gap-4 p-4 text-left",
13
- onClick: onToggle,
14
- children: [
15
- /* @__PURE__ */ jsx("div", {
16
- className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors", isCompleted && "border-green-500 bg-green-500 text-white", isCurrent && !isCompleted && "border-violet-500 text-violet-500", !isCompleted && !isCurrent && "border-muted-foreground text-muted-foreground"),
17
- children: isCompleted ? "✓" : stepNumber
18
- }),
19
- /* @__PURE__ */ jsxs("div", {
20
- className: "min-w-0 flex-1",
21
- children: [/* @__PURE__ */ jsx("h4", {
22
- className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
23
- children: step.title
24
- }), !isExpanded && step.description && /* @__PURE__ */ jsx("p", {
25
- className: "text-muted-foreground truncate text-sm",
26
- children: step.description
27
- })]
28
- }),
29
- step.xpReward && /* @__PURE__ */ jsxs("span", {
30
- className: cn("shrink-0 rounded-full px-2 py-1 text-xs font-semibold", isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"),
31
- children: [
32
- "+",
33
- step.xpReward,
34
- " XP"
35
- ]
36
- }),
37
- /* @__PURE__ */ jsx("span", {
38
- className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
39
- children: "▼"
40
- })
41
- ]
42
- }), isExpanded && /* @__PURE__ */ jsxs("div", {
43
- className: "border-t px-4 py-4",
44
- children: [
45
- step.description && /* @__PURE__ */ jsx("p", {
46
- className: "text-muted-foreground mb-4",
47
- children: step.description
48
- }),
49
- step.instructions && /* @__PURE__ */ jsxs("div", {
50
- className: "bg-muted mb-4 rounded-lg p-4",
51
- children: [/* @__PURE__ */ jsx("p", {
52
- className: "mb-2 text-sm font-medium",
53
- children: "Instructions:"
54
- }), /* @__PURE__ */ jsx("p", {
55
- className: "text-muted-foreground text-sm",
56
- children: step.instructions
57
- })]
58
- }),
59
- /* @__PURE__ */ jsxs("div", {
60
- className: "flex flex-wrap gap-2",
61
- children: [step.actionUrl && /* @__PURE__ */ jsx(Button, {
62
- variant: "outline",
63
- size: "sm",
64
- onClick: () => window.open(step.actionUrl, "_blank"),
65
- children: step.actionLabel ?? "Try it"
66
- }), !isCompleted && /* @__PURE__ */ jsx(Button, {
67
- size: "sm",
68
- onClick: onComplete,
69
- children: "Mark as Complete"
70
- })]
71
- })
72
- ]
73
- })]
74
- });
75
- }
76
-
77
- //#endregion
78
- //#region src/components/JourneyMap.tsx
79
- const SURFACE_ICONS = {
80
- templates: "📋",
81
- "spec-editor": "✏️",
82
- regenerator: "🔄",
83
- playground: "🎮",
84
- evolution: "🤖",
85
- dashboard: "📊",
86
- settings: "⚙️",
87
- default: "📍"
88
- };
89
- function JourneyMap({ steps, completedStepIds, currentStepId }) {
90
- return /* @__PURE__ */ jsx("div", {
91
- className: "relative overflow-x-auto pb-4",
92
- children: /* @__PURE__ */ jsx("div", {
93
- className: "flex min-w-max items-center gap-2",
94
- children: steps.map((step, index) => {
95
- const isCompleted = completedStepIds.includes(step.id);
96
- const isCurrent = step.id === currentStepId;
97
- const icon = SURFACE_ICONS[step.metadata?.surface ?? "default"] ?? SURFACE_ICONS.default;
98
- return /* @__PURE__ */ jsxs("div", {
99
- className: "flex items-center",
100
- children: [/* @__PURE__ */ jsxs("div", {
101
- className: "flex flex-col items-center gap-2",
102
- children: [/* @__PURE__ */ jsx("div", {
103
- className: cn("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all", isCompleted && "border-green-500 bg-green-500/10", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20", !isCompleted && !isCurrent && "border-muted bg-muted/50"),
104
- children: isCompleted ? "✓" : icon
105
- }), /* @__PURE__ */ jsx("div", {
106
- className: "text-center",
107
- children: /* @__PURE__ */ jsx("p", {
108
- className: cn("max-w-[100px] truncate text-xs font-medium", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
109
- children: step.title
110
- })
111
- })]
112
- }), index < steps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn("mx-2 h-1 w-8 rounded-full transition-colors", completedStepIds.includes(steps[index + 1]?.id ?? "") ? "bg-green-500" : isCompleted ? "bg-green-500/50" : "bg-muted") })]
113
- }, step.id);
114
- })
115
- })
116
- });
117
- }
118
-
119
- //#endregion
120
- export { StepChecklist as n, JourneyMap as t };