@contractspec/example.learning-journey-ui-onboarding 1.57.0 → 1.58.0
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/.turbo/turbo-build.log +58 -62
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +19 -0
- package/dist/OnboardingMiniApp.d.ts +4 -14
- package/dist/OnboardingMiniApp.d.ts.map +1 -1
- package/dist/OnboardingMiniApp.js +991 -59
- package/dist/browser/OnboardingMiniApp.js +994 -0
- package/dist/browser/components/CodeSnippet.js +65 -0
- package/dist/browser/components/JourneyMap.js +59 -0
- package/dist/browser/components/StepChecklist.js +97 -0
- package/dist/browser/components/index.js +219 -0
- package/dist/browser/docs/index.js +22 -0
- package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +22 -0
- package/dist/browser/example.js +32 -0
- package/dist/browser/index.js +1116 -0
- package/dist/browser/views/Overview.js +240 -0
- package/dist/browser/views/Progress.js +275 -0
- package/dist/browser/views/Steps.js +192 -0
- package/dist/browser/views/Timeline.js +213 -0
- package/dist/browser/views/index.js +915 -0
- package/dist/components/CodeSnippet.d.ts +5 -13
- package/dist/components/CodeSnippet.d.ts.map +1 -1
- package/dist/components/CodeSnippet.js +63 -47
- package/dist/components/JourneyMap.d.ts +6 -14
- package/dist/components/JourneyMap.d.ts.map +1 -1
- package/dist/components/JourneyMap.js +57 -46
- package/dist/components/StepChecklist.d.ts +10 -22
- package/dist/components/StepChecklist.d.ts.map +1 -1
- package/dist/components/StepChecklist.js +95 -77
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +219 -4
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +23 -1
- package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts +2 -1
- package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts.map +1 -0
- package/dist/docs/learning-journey-ui-onboarding.docblock.js +21 -18
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +31 -39
- package/dist/index.d.ts +6 -12
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1117 -14
- package/dist/node/OnboardingMiniApp.js +994 -0
- package/dist/node/components/CodeSnippet.js +65 -0
- package/dist/node/components/JourneyMap.js +59 -0
- package/dist/node/components/StepChecklist.js +97 -0
- package/dist/node/components/index.js +219 -0
- package/dist/node/docs/index.js +22 -0
- package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +22 -0
- package/dist/node/example.js +32 -0
- package/dist/node/index.js +1116 -0
- package/dist/node/views/Overview.js +240 -0
- package/dist/node/views/Progress.js +275 -0
- package/dist/node/views/Steps.js +192 -0
- package/dist/node/views/Timeline.js +213 -0
- package/dist/node/views/index.js +915 -0
- package/dist/views/Overview.d.ts +4 -12
- package/dist/views/Overview.d.ts.map +1 -1
- package/dist/views/Overview.js +238 -177
- package/dist/views/Progress.d.ts +3 -10
- package/dist/views/Progress.d.ts.map +1 -1
- package/dist/views/Progress.js +273 -158
- package/dist/views/Steps.d.ts +2 -11
- package/dist/views/Steps.d.ts.map +1 -1
- package/dist/views/Steps.js +188 -87
- package/dist/views/Timeline.d.ts +2 -10
- package/dist/views/Timeline.d.ts.map +1 -1
- package/dist/views/Timeline.js +211 -95
- package/dist/views/index.d.ts +5 -5
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/index.js +915 -5
- package/package.json +155 -39
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -59
- package/dist/OnboardingMiniApp.js.map +0 -1
- package/dist/components/CodeSnippet.js.map +0 -1
- package/dist/components/JourneyMap.js.map +0 -1
- package/dist/components/StepChecklist.js.map +0 -1
- package/dist/docs/learning-journey-ui-onboarding.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/views/Overview.js.map +0 -1
- package/dist/views/Progress.js.map +0 -1
- package/dist/views/Steps.js.map +0 -1
- package/dist/views/Timeline.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// src/components/StepChecklist.tsx
|
|
2
|
+
import { Button } from "@contractspec/lib.design-system";
|
|
3
|
+
import { cn } from "@contractspec/lib.ui-kit-core";
|
|
4
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
|
+
"use client";
|
|
6
|
+
function StepChecklist({
|
|
7
|
+
step,
|
|
8
|
+
stepNumber,
|
|
9
|
+
isCompleted,
|
|
10
|
+
isCurrent,
|
|
11
|
+
isExpanded,
|
|
12
|
+
onToggle,
|
|
13
|
+
onComplete
|
|
14
|
+
}) {
|
|
15
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
16
|
+
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"),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsxDEV("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
className: "flex w-full items-center gap-4 p-4 text-left",
|
|
21
|
+
onClick: onToggle,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
24
|
+
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"),
|
|
25
|
+
children: isCompleted ? "✓" : stepNumber
|
|
26
|
+
}, undefined, false, undefined, this),
|
|
27
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
28
|
+
className: "min-w-0 flex-1",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsxDEV("h4", {
|
|
31
|
+
className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
32
|
+
children: step.title
|
|
33
|
+
}, undefined, false, undefined, this),
|
|
34
|
+
!isExpanded && step.description && /* @__PURE__ */ jsxDEV("p", {
|
|
35
|
+
className: "text-muted-foreground truncate text-sm",
|
|
36
|
+
children: step.description
|
|
37
|
+
}, undefined, false, undefined, this)
|
|
38
|
+
]
|
|
39
|
+
}, undefined, true, undefined, this),
|
|
40
|
+
step.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
41
|
+
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"),
|
|
42
|
+
children: [
|
|
43
|
+
"+",
|
|
44
|
+
step.xpReward,
|
|
45
|
+
" XP"
|
|
46
|
+
]
|
|
47
|
+
}, undefined, true, undefined, this),
|
|
48
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
49
|
+
className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
|
|
50
|
+
children: "▼"
|
|
51
|
+
}, undefined, false, undefined, this)
|
|
52
|
+
]
|
|
53
|
+
}, undefined, true, undefined, this),
|
|
54
|
+
isExpanded && /* @__PURE__ */ jsxDEV("div", {
|
|
55
|
+
className: "border-t px-4 py-4",
|
|
56
|
+
children: [
|
|
57
|
+
step.description && /* @__PURE__ */ jsxDEV("p", {
|
|
58
|
+
className: "text-muted-foreground mb-4",
|
|
59
|
+
children: step.description
|
|
60
|
+
}, undefined, false, undefined, this),
|
|
61
|
+
step.instructions && /* @__PURE__ */ jsxDEV("div", {
|
|
62
|
+
className: "bg-muted mb-4 rounded-lg p-4",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
65
|
+
className: "mb-2 text-sm font-medium",
|
|
66
|
+
children: "Instructions:"
|
|
67
|
+
}, undefined, false, undefined, this),
|
|
68
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
69
|
+
className: "text-muted-foreground text-sm",
|
|
70
|
+
children: step.instructions
|
|
71
|
+
}, undefined, false, undefined, this)
|
|
72
|
+
]
|
|
73
|
+
}, undefined, true, undefined, this),
|
|
74
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
75
|
+
className: "flex flex-wrap gap-2",
|
|
76
|
+
children: [
|
|
77
|
+
step.actionUrl && /* @__PURE__ */ jsxDEV(Button, {
|
|
78
|
+
variant: "outline",
|
|
79
|
+
size: "sm",
|
|
80
|
+
onClick: () => window.open(step.actionUrl, "_blank"),
|
|
81
|
+
children: step.actionLabel ?? "Try it"
|
|
82
|
+
}, undefined, false, undefined, this),
|
|
83
|
+
!isCompleted && /* @__PURE__ */ jsxDEV(Button, {
|
|
84
|
+
size: "sm",
|
|
85
|
+
onClick: onComplete,
|
|
86
|
+
children: "Mark as Complete"
|
|
87
|
+
}, undefined, false, undefined, this)
|
|
88
|
+
]
|
|
89
|
+
}, undefined, true, undefined, this)
|
|
90
|
+
]
|
|
91
|
+
}, undefined, true, undefined, this)
|
|
92
|
+
]
|
|
93
|
+
}, undefined, true, undefined, this);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/views/Steps.tsx
|
|
97
|
+
import { useState } from "react";
|
|
98
|
+
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
99
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
100
|
+
"use client";
|
|
101
|
+
function Steps({ track, progress, onStepComplete }) {
|
|
102
|
+
const [expandedStepId, setExpandedStepId] = useState(() => {
|
|
103
|
+
const firstIncomplete = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
|
|
104
|
+
return firstIncomplete?.id ?? null;
|
|
105
|
+
});
|
|
106
|
+
const completedSteps = progress.completedStepIds.length;
|
|
107
|
+
const totalSteps = track.steps.length;
|
|
108
|
+
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
109
|
+
const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
|
|
110
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
111
|
+
className: "space-y-6",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
114
|
+
className: "space-y-2",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
117
|
+
className: "flex items-center justify-between",
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ jsxDEV2("h2", {
|
|
120
|
+
className: "text-xl font-bold",
|
|
121
|
+
children: "Complete Each Step"
|
|
122
|
+
}, undefined, false, undefined, this),
|
|
123
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
124
|
+
className: "text-muted-foreground text-sm",
|
|
125
|
+
children: [
|
|
126
|
+
completedSteps,
|
|
127
|
+
" / ",
|
|
128
|
+
totalSteps,
|
|
129
|
+
" completed"
|
|
130
|
+
]
|
|
131
|
+
}, undefined, true, undefined, this)
|
|
132
|
+
]
|
|
133
|
+
}, undefined, true, undefined, this),
|
|
134
|
+
/* @__PURE__ */ jsxDEV2(Progress, {
|
|
135
|
+
value: percentComplete,
|
|
136
|
+
className: "h-2"
|
|
137
|
+
}, undefined, false, undefined, this)
|
|
138
|
+
]
|
|
139
|
+
}, undefined, true, undefined, this),
|
|
140
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
141
|
+
className: "space-y-3",
|
|
142
|
+
children: track.steps.map((step, index) => {
|
|
143
|
+
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
144
|
+
const isCurrent = index === currentStepIndex;
|
|
145
|
+
return /* @__PURE__ */ jsxDEV2(StepChecklist, {
|
|
146
|
+
step,
|
|
147
|
+
stepNumber: index + 1,
|
|
148
|
+
isCompleted,
|
|
149
|
+
isCurrent,
|
|
150
|
+
isExpanded: expandedStepId === step.id,
|
|
151
|
+
onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
|
|
152
|
+
onComplete: () => {
|
|
153
|
+
onStepComplete?.(step.id);
|
|
154
|
+
const nextStep = track.steps[index + 1];
|
|
155
|
+
if (nextStep && !progress.completedStepIds.includes(nextStep.id)) {
|
|
156
|
+
setExpandedStepId(nextStep.id);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}, step.id, false, undefined, this);
|
|
160
|
+
})
|
|
161
|
+
}, undefined, false, undefined, this),
|
|
162
|
+
track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsxDEV2("div", {
|
|
163
|
+
className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
|
|
164
|
+
children: /* @__PURE__ */ jsxDEV2("p", {
|
|
165
|
+
className: "text-sm",
|
|
166
|
+
children: [
|
|
167
|
+
"\uD83C\uDF81 Complete all steps to unlock:",
|
|
168
|
+
track.completionRewards.xpBonus && /* @__PURE__ */ jsxDEV2("span", {
|
|
169
|
+
className: "ml-2 font-semibold text-blue-500",
|
|
170
|
+
children: [
|
|
171
|
+
"+",
|
|
172
|
+
track.completionRewards.xpBonus,
|
|
173
|
+
" XP bonus"
|
|
174
|
+
]
|
|
175
|
+
}, undefined, true, undefined, this),
|
|
176
|
+
track.completionRewards.badgeKey && /* @__PURE__ */ jsxDEV2("span", {
|
|
177
|
+
className: "ml-2 font-semibold text-amber-500",
|
|
178
|
+
children: [
|
|
179
|
+
'+ "',
|
|
180
|
+
track.completionRewards.badgeKey,
|
|
181
|
+
'" badge'
|
|
182
|
+
]
|
|
183
|
+
}, undefined, true, undefined, this)
|
|
184
|
+
]
|
|
185
|
+
}, undefined, true, undefined, this)
|
|
186
|
+
}, undefined, false, undefined, this)
|
|
187
|
+
]
|
|
188
|
+
}, undefined, true, undefined, this);
|
|
189
|
+
}
|
|
190
|
+
export {
|
|
191
|
+
Steps
|
|
192
|
+
};
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// src/components/JourneyMap.tsx
|
|
2
|
+
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
3
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
4
|
+
"use client";
|
|
5
|
+
var SURFACE_ICONS = {
|
|
6
|
+
templates: "\uD83D\uDCCB",
|
|
7
|
+
"spec-editor": "✏️",
|
|
8
|
+
regenerator: "\uD83D\uDD04",
|
|
9
|
+
playground: "\uD83C\uDFAE",
|
|
10
|
+
evolution: "\uD83E\uDD16",
|
|
11
|
+
dashboard: "\uD83D\uDCCA",
|
|
12
|
+
settings: "⚙️",
|
|
13
|
+
default: "\uD83D\uDCCD"
|
|
14
|
+
};
|
|
15
|
+
function JourneyMap({
|
|
16
|
+
steps,
|
|
17
|
+
completedStepIds,
|
|
18
|
+
currentStepId
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
21
|
+
className: "relative overflow-x-auto pb-4",
|
|
22
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
23
|
+
className: "flex min-w-max items-center gap-2",
|
|
24
|
+
children: steps.map((step, index) => {
|
|
25
|
+
const isCompleted = completedStepIds.includes(step.id);
|
|
26
|
+
const isCurrent = step.id === currentStepId;
|
|
27
|
+
const surface = step.metadata?.surface ?? "default";
|
|
28
|
+
const icon = SURFACE_ICONS[surface] ?? SURFACE_ICONS.default;
|
|
29
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
30
|
+
className: "flex items-center",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
33
|
+
className: "flex flex-col items-center gap-2",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
36
|
+
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"),
|
|
37
|
+
children: isCompleted ? "✓" : icon
|
|
38
|
+
}, undefined, false, undefined, this),
|
|
39
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
40
|
+
className: "text-center",
|
|
41
|
+
children: /* @__PURE__ */ jsxDEV("p", {
|
|
42
|
+
className: cn("max-w-[100px] truncate text-xs font-medium", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
43
|
+
children: step.title
|
|
44
|
+
}, undefined, false, undefined, this)
|
|
45
|
+
}, undefined, false, undefined, this)
|
|
46
|
+
]
|
|
47
|
+
}, undefined, true, undefined, this),
|
|
48
|
+
index < steps.length - 1 && /* @__PURE__ */ jsxDEV("div", {
|
|
49
|
+
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")
|
|
50
|
+
}, undefined, false, undefined, this)
|
|
51
|
+
]
|
|
52
|
+
}, step.id, true, undefined, this);
|
|
53
|
+
})
|
|
54
|
+
}, undefined, false, undefined, this)
|
|
55
|
+
}, undefined, false, undefined, this);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// src/views/Timeline.tsx
|
|
59
|
+
import {
|
|
60
|
+
Card,
|
|
61
|
+
CardContent,
|
|
62
|
+
CardHeader,
|
|
63
|
+
CardTitle
|
|
64
|
+
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
65
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
66
|
+
"use client";
|
|
67
|
+
function Timeline({ track, progress }) {
|
|
68
|
+
const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
|
|
69
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
70
|
+
className: "space-y-6",
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
73
|
+
className: "text-center",
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsxDEV2("h2", {
|
|
76
|
+
className: "text-xl font-bold",
|
|
77
|
+
children: "Your Learning Journey"
|
|
78
|
+
}, undefined, false, undefined, this),
|
|
79
|
+
/* @__PURE__ */ jsxDEV2("p", {
|
|
80
|
+
className: "text-muted-foreground",
|
|
81
|
+
children: "Follow the path through each surface and feature"
|
|
82
|
+
}, undefined, false, undefined, this)
|
|
83
|
+
]
|
|
84
|
+
}, undefined, true, undefined, this),
|
|
85
|
+
/* @__PURE__ */ jsxDEV2(Card, {
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
88
|
+
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
89
|
+
className: "flex items-center gap-2",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
92
|
+
children: "\uD83D\uDDFA️"
|
|
93
|
+
}, undefined, false, undefined, this),
|
|
94
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
95
|
+
children: "Journey Map"
|
|
96
|
+
}, undefined, false, undefined, this)
|
|
97
|
+
]
|
|
98
|
+
}, undefined, true, undefined, this)
|
|
99
|
+
}, undefined, false, undefined, this),
|
|
100
|
+
/* @__PURE__ */ jsxDEV2(CardContent, {
|
|
101
|
+
children: /* @__PURE__ */ jsxDEV2(JourneyMap, {
|
|
102
|
+
steps: track.steps,
|
|
103
|
+
completedStepIds: progress.completedStepIds,
|
|
104
|
+
currentStepId
|
|
105
|
+
}, undefined, false, undefined, this)
|
|
106
|
+
}, undefined, false, undefined, this)
|
|
107
|
+
]
|
|
108
|
+
}, undefined, true, undefined, this),
|
|
109
|
+
/* @__PURE__ */ jsxDEV2(Card, {
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
112
|
+
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
113
|
+
className: "flex items-center gap-2",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
116
|
+
children: "\uD83D\uDCCD"
|
|
117
|
+
}, undefined, false, undefined, this),
|
|
118
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
119
|
+
children: "Step by Step"
|
|
120
|
+
}, undefined, false, undefined, this)
|
|
121
|
+
]
|
|
122
|
+
}, undefined, true, undefined, this)
|
|
123
|
+
}, undefined, false, undefined, this),
|
|
124
|
+
/* @__PURE__ */ jsxDEV2(CardContent, {
|
|
125
|
+
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
126
|
+
className: "relative",
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
129
|
+
className: "bg-border absolute top-0 left-4 h-full w-0.5"
|
|
130
|
+
}, undefined, false, undefined, this),
|
|
131
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
132
|
+
className: "space-y-6",
|
|
133
|
+
children: track.steps.map((step, index) => {
|
|
134
|
+
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
135
|
+
const isCurrent = step.id === currentStepId;
|
|
136
|
+
const surface = step.metadata?.surface ?? "general";
|
|
137
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
138
|
+
className: "relative flex gap-4 pl-2",
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
141
|
+
className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20" : "border-border bg-background text-muted-foreground"}`,
|
|
142
|
+
children: isCompleted ? "✓" : index + 1
|
|
143
|
+
}, undefined, false, undefined, this),
|
|
144
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
145
|
+
className: "flex-1 pb-2",
|
|
146
|
+
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
147
|
+
className: "rounded-lg border p-4",
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
150
|
+
className: "flex items-start justify-between gap-2",
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
153
|
+
children: [
|
|
154
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
155
|
+
className: "flex items-center gap-2",
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsxDEV2("h4", {
|
|
158
|
+
className: `font-semibold ${isCompleted ? "text-green-500" : isCurrent ? "text-blue-500" : "text-foreground"}`,
|
|
159
|
+
children: step.title
|
|
160
|
+
}, undefined, false, undefined, this),
|
|
161
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
162
|
+
className: "bg-muted text-muted-foreground rounded px-2 py-0.5 text-xs",
|
|
163
|
+
children: surface
|
|
164
|
+
}, undefined, false, undefined, this)
|
|
165
|
+
]
|
|
166
|
+
}, undefined, true, undefined, this),
|
|
167
|
+
/* @__PURE__ */ jsxDEV2("p", {
|
|
168
|
+
className: "text-muted-foreground mt-1 text-sm",
|
|
169
|
+
children: step.description
|
|
170
|
+
}, undefined, false, undefined, this)
|
|
171
|
+
]
|
|
172
|
+
}, undefined, true, undefined, this),
|
|
173
|
+
step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
|
|
174
|
+
className: `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"}`,
|
|
175
|
+
children: [
|
|
176
|
+
"+",
|
|
177
|
+
step.xpReward,
|
|
178
|
+
" XP"
|
|
179
|
+
]
|
|
180
|
+
}, undefined, true, undefined, this)
|
|
181
|
+
]
|
|
182
|
+
}, undefined, true, undefined, this),
|
|
183
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
184
|
+
className: "mt-3 text-xs",
|
|
185
|
+
children: isCompleted ? /* @__PURE__ */ jsxDEV2("span", {
|
|
186
|
+
className: "text-green-500",
|
|
187
|
+
children: "✓ Completed"
|
|
188
|
+
}, undefined, false, undefined, this) : isCurrent ? /* @__PURE__ */ jsxDEV2("span", {
|
|
189
|
+
className: "text-blue-500",
|
|
190
|
+
children: "→ In Progress"
|
|
191
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV2("span", {
|
|
192
|
+
className: "text-muted-foreground",
|
|
193
|
+
children: "○ Not Started"
|
|
194
|
+
}, undefined, false, undefined, this)
|
|
195
|
+
}, undefined, false, undefined, this)
|
|
196
|
+
]
|
|
197
|
+
}, undefined, true, undefined, this)
|
|
198
|
+
}, undefined, false, undefined, this)
|
|
199
|
+
]
|
|
200
|
+
}, step.id, true, undefined, this);
|
|
201
|
+
})
|
|
202
|
+
}, undefined, false, undefined, this)
|
|
203
|
+
]
|
|
204
|
+
}, undefined, true, undefined, this)
|
|
205
|
+
}, undefined, false, undefined, this)
|
|
206
|
+
]
|
|
207
|
+
}, undefined, true, undefined, this)
|
|
208
|
+
]
|
|
209
|
+
}, undefined, true, undefined, this);
|
|
210
|
+
}
|
|
211
|
+
export {
|
|
212
|
+
Timeline
|
|
213
|
+
};
|