@contractspec/example.learning-journey-ui-onboarding 3.7.17 → 3.7.18
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 +48 -48
- package/CHANGELOG.md +18 -0
- package/dist/OnboardingMiniApp.js +1 -994
- package/dist/browser/OnboardingMiniApp.js +1 -994
- package/dist/browser/components/CodeSnippet.js +1 -65
- package/dist/browser/components/JourneyMap.js +1 -59
- package/dist/browser/components/StepChecklist.js +1 -97
- package/dist/browser/components/index.js +1 -219
- package/dist/browser/docs/index.js +2 -16
- package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +2 -16
- package/dist/browser/example.js +1 -32
- package/dist/browser/index.js +2 -1127
- package/dist/browser/learning-journey-ui-onboarding.feature.js +1 -18
- package/dist/browser/views/Overview.js +1 -240
- package/dist/browser/views/Progress.js +1 -275
- package/dist/browser/views/Steps.js +1 -192
- package/dist/browser/views/Timeline.js +1 -213
- package/dist/browser/views/index.js +1 -915
- package/dist/components/CodeSnippet.js +1 -65
- package/dist/components/JourneyMap.js +1 -59
- package/dist/components/StepChecklist.js +1 -97
- package/dist/components/index.js +1 -219
- package/dist/docs/index.js +2 -16
- package/dist/docs/learning-journey-ui-onboarding.docblock.js +2 -16
- package/dist/example.js +1 -32
- package/dist/index.js +2 -1127
- package/dist/learning-journey-ui-onboarding.feature.js +1 -18
- package/dist/node/OnboardingMiniApp.js +1 -994
- package/dist/node/components/CodeSnippet.js +1 -65
- package/dist/node/components/JourneyMap.js +1 -59
- package/dist/node/components/StepChecklist.js +1 -97
- package/dist/node/components/index.js +1 -219
- package/dist/node/docs/index.js +2 -16
- package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +2 -16
- package/dist/node/example.js +1 -32
- package/dist/node/index.js +2 -1127
- package/dist/node/learning-journey-ui-onboarding.feature.js +1 -18
- package/dist/node/views/Overview.js +1 -240
- package/dist/node/views/Progress.js +1 -275
- package/dist/node/views/Steps.js +1 -192
- package/dist/node/views/Timeline.js +1 -213
- package/dist/node/views/index.js +1 -915
- package/dist/views/Overview.js +1 -240
- package/dist/views/Progress.js +1 -275
- package/dist/views/Steps.js +1 -192
- package/dist/views/Timeline.js +1 -213
- package/dist/views/index.js +1 -915
- package/package.json +11 -11
|
@@ -1,915 +1 @@
|
|
|
1
|
-
// src/views/Overview.tsx
|
|
2
|
-
import { XpBar } from "@contractspec/example.learning-journey-ui-shared";
|
|
3
|
-
import { Button } from "@contractspec/lib.design-system";
|
|
4
|
-
import {
|
|
5
|
-
Card,
|
|
6
|
-
CardContent,
|
|
7
|
-
CardHeader,
|
|
8
|
-
CardTitle
|
|
9
|
-
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
10
|
-
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
11
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
12
|
-
"use client";
|
|
13
|
-
function Overview({
|
|
14
|
-
track,
|
|
15
|
-
progress,
|
|
16
|
-
onStart
|
|
17
|
-
}) {
|
|
18
|
-
const totalSteps = track.steps.length;
|
|
19
|
-
const completedSteps = progress.completedStepIds.length;
|
|
20
|
-
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
21
|
-
const isComplete = completedSteps === totalSteps;
|
|
22
|
-
const remainingSteps = totalSteps - completedSteps;
|
|
23
|
-
const estimatedMinutes = remainingSteps * 5;
|
|
24
|
-
const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
|
|
25
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
26
|
-
className: "space-y-6",
|
|
27
|
-
children: [
|
|
28
|
-
/* @__PURE__ */ jsxDEV(Card, {
|
|
29
|
-
className: "overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",
|
|
30
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
31
|
-
className: "p-8",
|
|
32
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
33
|
-
className: "flex flex-col items-center gap-6 text-center md:flex-row md:text-left",
|
|
34
|
-
children: [
|
|
35
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
36
|
-
className: "flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",
|
|
37
|
-
children: isComplete ? "\uD83C\uDF89" : "\uD83D\uDE80"
|
|
38
|
-
}, undefined, false, undefined, this),
|
|
39
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
40
|
-
className: "flex-1",
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ jsxDEV("h1", {
|
|
43
|
-
className: "font-bold text-2xl",
|
|
44
|
-
children: track.name
|
|
45
|
-
}, undefined, false, undefined, this),
|
|
46
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
47
|
-
className: "mt-1 max-w-2xl text-muted-foreground",
|
|
48
|
-
children: track.description
|
|
49
|
-
}, undefined, false, undefined, this),
|
|
50
|
-
!isComplete && /* @__PURE__ */ jsxDEV("p", {
|
|
51
|
-
className: "mt-3 text-muted-foreground text-sm",
|
|
52
|
-
children: [
|
|
53
|
-
"⏱️ Estimated time:",
|
|
54
|
-
" ",
|
|
55
|
-
estimatedMinutes > 0 ? `~${estimatedMinutes} minutes` : "Less than a minute"
|
|
56
|
-
]
|
|
57
|
-
}, undefined, true, undefined, this)
|
|
58
|
-
]
|
|
59
|
-
}, undefined, true, undefined, this),
|
|
60
|
-
!isComplete && /* @__PURE__ */ jsxDEV(Button, {
|
|
61
|
-
size: "lg",
|
|
62
|
-
onClick: onStart,
|
|
63
|
-
children: completedSteps > 0 ? "Continue" : "Get Started"
|
|
64
|
-
}, undefined, false, undefined, this)
|
|
65
|
-
]
|
|
66
|
-
}, undefined, true, undefined, this)
|
|
67
|
-
}, undefined, false, undefined, this)
|
|
68
|
-
}, undefined, false, undefined, this),
|
|
69
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
70
|
-
className: "grid gap-4 md:grid-cols-3",
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ jsxDEV(Card, {
|
|
73
|
-
children: [
|
|
74
|
-
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
75
|
-
className: "pb-2",
|
|
76
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
77
|
-
className: "font-medium text-muted-foreground text-sm",
|
|
78
|
-
children: "Progress"
|
|
79
|
-
}, undefined, false, undefined, this)
|
|
80
|
-
}, undefined, false, undefined, this),
|
|
81
|
-
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
82
|
-
children: [
|
|
83
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
84
|
-
className: "font-bold text-3xl",
|
|
85
|
-
children: [
|
|
86
|
-
Math.round(percentComplete),
|
|
87
|
-
"%"
|
|
88
|
-
]
|
|
89
|
-
}, undefined, true, undefined, this),
|
|
90
|
-
/* @__PURE__ */ jsxDEV(Progress, {
|
|
91
|
-
value: percentComplete,
|
|
92
|
-
className: "mt-2 h-2"
|
|
93
|
-
}, undefined, false, undefined, this),
|
|
94
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
95
|
-
className: "mt-2 text-muted-foreground text-sm",
|
|
96
|
-
children: [
|
|
97
|
-
completedSteps,
|
|
98
|
-
" of ",
|
|
99
|
-
totalSteps,
|
|
100
|
-
" steps completed"
|
|
101
|
-
]
|
|
102
|
-
}, undefined, true, undefined, this)
|
|
103
|
-
]
|
|
104
|
-
}, undefined, true, undefined, this)
|
|
105
|
-
]
|
|
106
|
-
}, undefined, true, undefined, this),
|
|
107
|
-
/* @__PURE__ */ jsxDEV(Card, {
|
|
108
|
-
children: [
|
|
109
|
-
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
110
|
-
className: "pb-2",
|
|
111
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
112
|
-
className: "font-medium text-muted-foreground text-sm",
|
|
113
|
-
children: "XP Earned"
|
|
114
|
-
}, undefined, false, undefined, this)
|
|
115
|
-
}, undefined, false, undefined, this),
|
|
116
|
-
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
117
|
-
children: [
|
|
118
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
119
|
-
className: "font-bold text-3xl text-blue-500",
|
|
120
|
-
children: progress.xpEarned
|
|
121
|
-
}, undefined, false, undefined, this),
|
|
122
|
-
/* @__PURE__ */ jsxDEV(XpBar, {
|
|
123
|
-
current: progress.xpEarned,
|
|
124
|
-
max: totalXp,
|
|
125
|
-
showLabel: false,
|
|
126
|
-
size: "sm"
|
|
127
|
-
}, undefined, false, undefined, this)
|
|
128
|
-
]
|
|
129
|
-
}, undefined, true, undefined, this)
|
|
130
|
-
]
|
|
131
|
-
}, undefined, true, undefined, this),
|
|
132
|
-
/* @__PURE__ */ jsxDEV(Card, {
|
|
133
|
-
children: [
|
|
134
|
-
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
135
|
-
className: "pb-2",
|
|
136
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
137
|
-
className: "font-medium text-muted-foreground text-sm",
|
|
138
|
-
children: "Time Remaining"
|
|
139
|
-
}, undefined, false, undefined, this)
|
|
140
|
-
}, undefined, false, undefined, this),
|
|
141
|
-
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
142
|
-
children: [
|
|
143
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
144
|
-
className: "font-bold text-3xl",
|
|
145
|
-
children: isComplete ? "✓" : `~${estimatedMinutes}m`
|
|
146
|
-
}, undefined, false, undefined, this),
|
|
147
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
148
|
-
className: "mt-2 text-muted-foreground text-sm",
|
|
149
|
-
children: isComplete ? "All done!" : `${remainingSteps} steps to go`
|
|
150
|
-
}, undefined, false, undefined, this)
|
|
151
|
-
]
|
|
152
|
-
}, undefined, true, undefined, this)
|
|
153
|
-
]
|
|
154
|
-
}, undefined, true, undefined, this)
|
|
155
|
-
]
|
|
156
|
-
}, undefined, true, undefined, this),
|
|
157
|
-
/* @__PURE__ */ jsxDEV(Card, {
|
|
158
|
-
children: [
|
|
159
|
-
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
160
|
-
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
161
|
-
className: "flex items-center gap-2",
|
|
162
|
-
children: [
|
|
163
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
164
|
-
children: "\uD83D\uDCCB"
|
|
165
|
-
}, undefined, false, undefined, this),
|
|
166
|
-
/* @__PURE__ */ jsxDEV("span", {
|
|
167
|
-
children: "Your Journey"
|
|
168
|
-
}, undefined, false, undefined, this)
|
|
169
|
-
]
|
|
170
|
-
}, undefined, true, undefined, this)
|
|
171
|
-
}, undefined, false, undefined, this),
|
|
172
|
-
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
173
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
174
|
-
className: "space-y-3",
|
|
175
|
-
children: track.steps.map((step, index) => {
|
|
176
|
-
const isStepCompleted = progress.completedStepIds.includes(step.id);
|
|
177
|
-
const isCurrent = !isStepCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
|
|
178
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
179
|
-
className: "flex items-center gap-4 rounded-lg border p-3",
|
|
180
|
-
children: [
|
|
181
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
182
|
-
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${isStepCompleted ? "bg-green-500 text-white" : isCurrent ? "bg-blue-500 text-white" : "bg-muted text-muted-foreground"}`,
|
|
183
|
-
children: isStepCompleted ? "✓" : index + 1
|
|
184
|
-
}, undefined, false, undefined, this),
|
|
185
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
186
|
-
className: "min-w-0 flex-1",
|
|
187
|
-
children: /* @__PURE__ */ jsxDEV("p", {
|
|
188
|
-
className: `font-medium ${isStepCompleted ? "text-green-500" : isCurrent ? "text-foreground" : "text-muted-foreground"}`,
|
|
189
|
-
children: step.title
|
|
190
|
-
}, undefined, false, undefined, this)
|
|
191
|
-
}, undefined, false, undefined, this),
|
|
192
|
-
step.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
193
|
-
className: "text-muted-foreground text-sm",
|
|
194
|
-
children: [
|
|
195
|
-
"+",
|
|
196
|
-
step.xpReward,
|
|
197
|
-
" XP"
|
|
198
|
-
]
|
|
199
|
-
}, undefined, true, undefined, this)
|
|
200
|
-
]
|
|
201
|
-
}, step.id, true, undefined, this);
|
|
202
|
-
})
|
|
203
|
-
}, undefined, false, undefined, this)
|
|
204
|
-
}, undefined, false, undefined, this)
|
|
205
|
-
]
|
|
206
|
-
}, undefined, true, undefined, this),
|
|
207
|
-
isComplete && /* @__PURE__ */ jsxDEV(Card, {
|
|
208
|
-
className: "border-green-500/50 bg-green-500/5",
|
|
209
|
-
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
210
|
-
className: "flex items-center gap-4 p-6",
|
|
211
|
-
children: [
|
|
212
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
213
|
-
className: "text-4xl",
|
|
214
|
-
children: "\uD83C\uDF89"
|
|
215
|
-
}, undefined, false, undefined, this),
|
|
216
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
217
|
-
children: [
|
|
218
|
-
/* @__PURE__ */ jsxDEV("h3", {
|
|
219
|
-
className: "font-semibold text-green-500 text-lg",
|
|
220
|
-
children: "Onboarding Complete!"
|
|
221
|
-
}, undefined, false, undefined, this),
|
|
222
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
223
|
-
className: "text-muted-foreground",
|
|
224
|
-
children: [
|
|
225
|
-
"You've completed all ",
|
|
226
|
-
totalSteps,
|
|
227
|
-
" steps. Welcome aboard!"
|
|
228
|
-
]
|
|
229
|
-
}, undefined, true, undefined, this)
|
|
230
|
-
]
|
|
231
|
-
}, undefined, true, undefined, this)
|
|
232
|
-
]
|
|
233
|
-
}, undefined, true, undefined, this)
|
|
234
|
-
}, undefined, false, undefined, this)
|
|
235
|
-
]
|
|
236
|
-
}, undefined, true, undefined, this);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// src/views/Progress.tsx
|
|
240
|
-
import {
|
|
241
|
-
BadgeDisplay,
|
|
242
|
-
XpBar as XpBar2
|
|
243
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
244
|
-
import {
|
|
245
|
-
Card as Card2,
|
|
246
|
-
CardContent as CardContent2,
|
|
247
|
-
CardHeader as CardHeader2,
|
|
248
|
-
CardTitle as CardTitle2
|
|
249
|
-
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
250
|
-
import { Progress as Progress2 } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
251
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
252
|
-
"use client";
|
|
253
|
-
function ProgressView({ track, progress }) {
|
|
254
|
-
const totalSteps = track.steps.length;
|
|
255
|
-
const completedSteps = progress.completedStepIds.length;
|
|
256
|
-
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
257
|
-
const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
|
|
258
|
-
const remainingSteps = totalSteps - completedSteps;
|
|
259
|
-
const estimatedMinutes = remainingSteps * 5;
|
|
260
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
261
|
-
className: "space-y-6",
|
|
262
|
-
children: [
|
|
263
|
-
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
264
|
-
children: [
|
|
265
|
-
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
266
|
-
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
267
|
-
className: "flex items-center gap-2",
|
|
268
|
-
children: [
|
|
269
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
270
|
-
children: "\uD83D\uDCC8"
|
|
271
|
-
}, undefined, false, undefined, this),
|
|
272
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
273
|
-
children: "Your Progress"
|
|
274
|
-
}, undefined, false, undefined, this)
|
|
275
|
-
]
|
|
276
|
-
}, undefined, true, undefined, this)
|
|
277
|
-
}, undefined, false, undefined, this),
|
|
278
|
-
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
279
|
-
className: "space-y-6",
|
|
280
|
-
children: [
|
|
281
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
282
|
-
className: "flex items-center justify-center",
|
|
283
|
-
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
284
|
-
className: "relative flex h-40 w-40 items-center justify-center",
|
|
285
|
-
children: [
|
|
286
|
-
/* @__PURE__ */ jsxDEV2("svg", {
|
|
287
|
-
className: "absolute h-full w-full -rotate-90",
|
|
288
|
-
viewBox: "0 0 100 100",
|
|
289
|
-
children: [
|
|
290
|
-
/* @__PURE__ */ jsxDEV2("circle", {
|
|
291
|
-
cx: "50",
|
|
292
|
-
cy: "50",
|
|
293
|
-
r: "45",
|
|
294
|
-
fill: "none",
|
|
295
|
-
strokeWidth: "8",
|
|
296
|
-
className: "stroke-muted"
|
|
297
|
-
}, undefined, false, undefined, this),
|
|
298
|
-
/* @__PURE__ */ jsxDEV2("circle", {
|
|
299
|
-
cx: "50",
|
|
300
|
-
cy: "50",
|
|
301
|
-
r: "45",
|
|
302
|
-
fill: "none",
|
|
303
|
-
strokeWidth: "8",
|
|
304
|
-
strokeLinecap: "round",
|
|
305
|
-
strokeDasharray: `${percentComplete * 2.83} 283`,
|
|
306
|
-
className: "stroke-blue-500 transition-all duration-500"
|
|
307
|
-
}, undefined, false, undefined, this)
|
|
308
|
-
]
|
|
309
|
-
}, undefined, true, undefined, this),
|
|
310
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
311
|
-
className: "text-center",
|
|
312
|
-
children: [
|
|
313
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
314
|
-
className: "font-bold text-3xl",
|
|
315
|
-
children: [
|
|
316
|
-
Math.round(percentComplete),
|
|
317
|
-
"%"
|
|
318
|
-
]
|
|
319
|
-
}, undefined, true, undefined, this),
|
|
320
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
321
|
-
className: "text-muted-foreground text-sm",
|
|
322
|
-
children: "Complete"
|
|
323
|
-
}, undefined, false, undefined, this)
|
|
324
|
-
]
|
|
325
|
-
}, undefined, true, undefined, this)
|
|
326
|
-
]
|
|
327
|
-
}, undefined, true, undefined, this)
|
|
328
|
-
}, undefined, false, undefined, this),
|
|
329
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
330
|
-
className: "grid grid-cols-3 gap-4 text-center",
|
|
331
|
-
children: [
|
|
332
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
333
|
-
children: [
|
|
334
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
335
|
-
className: "font-bold text-2xl text-green-500",
|
|
336
|
-
children: completedSteps
|
|
337
|
-
}, undefined, false, undefined, this),
|
|
338
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
339
|
-
className: "text-muted-foreground text-sm",
|
|
340
|
-
children: "Completed"
|
|
341
|
-
}, undefined, false, undefined, this)
|
|
342
|
-
]
|
|
343
|
-
}, undefined, true, undefined, this),
|
|
344
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
345
|
-
children: [
|
|
346
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
347
|
-
className: "font-bold text-2xl text-orange-500",
|
|
348
|
-
children: remainingSteps
|
|
349
|
-
}, undefined, false, undefined, this),
|
|
350
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
351
|
-
className: "text-muted-foreground text-sm",
|
|
352
|
-
children: "Remaining"
|
|
353
|
-
}, undefined, false, undefined, this)
|
|
354
|
-
]
|
|
355
|
-
}, undefined, true, undefined, this),
|
|
356
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
357
|
-
children: [
|
|
358
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
359
|
-
className: "font-bold text-2xl",
|
|
360
|
-
children: [
|
|
361
|
-
estimatedMinutes,
|
|
362
|
-
"m"
|
|
363
|
-
]
|
|
364
|
-
}, undefined, true, undefined, this),
|
|
365
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
366
|
-
className: "text-muted-foreground text-sm",
|
|
367
|
-
children: "Est. Time"
|
|
368
|
-
}, undefined, false, undefined, this)
|
|
369
|
-
]
|
|
370
|
-
}, undefined, true, undefined, this)
|
|
371
|
-
]
|
|
372
|
-
}, undefined, true, undefined, this)
|
|
373
|
-
]
|
|
374
|
-
}, undefined, true, undefined, this)
|
|
375
|
-
]
|
|
376
|
-
}, undefined, true, undefined, this),
|
|
377
|
-
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
378
|
-
children: [
|
|
379
|
-
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
380
|
-
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
381
|
-
className: "flex items-center gap-2",
|
|
382
|
-
children: [
|
|
383
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
384
|
-
children: "⚡"
|
|
385
|
-
}, undefined, false, undefined, this),
|
|
386
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
387
|
-
children: "Experience Points"
|
|
388
|
-
}, undefined, false, undefined, this)
|
|
389
|
-
]
|
|
390
|
-
}, undefined, true, undefined, this)
|
|
391
|
-
}, undefined, false, undefined, this),
|
|
392
|
-
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
393
|
-
className: "space-y-4",
|
|
394
|
-
children: [
|
|
395
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
396
|
-
className: "flex items-baseline gap-2",
|
|
397
|
-
children: [
|
|
398
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
399
|
-
className: "font-bold text-3xl text-blue-500",
|
|
400
|
-
children: progress.xpEarned
|
|
401
|
-
}, undefined, false, undefined, this),
|
|
402
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
403
|
-
className: "text-muted-foreground",
|
|
404
|
-
children: [
|
|
405
|
-
"/ ",
|
|
406
|
-
totalXp,
|
|
407
|
-
" XP"
|
|
408
|
-
]
|
|
409
|
-
}, undefined, true, undefined, this)
|
|
410
|
-
]
|
|
411
|
-
}, undefined, true, undefined, this),
|
|
412
|
-
/* @__PURE__ */ jsxDEV2(XpBar2, {
|
|
413
|
-
current: progress.xpEarned,
|
|
414
|
-
max: totalXp,
|
|
415
|
-
showLabel: false,
|
|
416
|
-
size: "lg"
|
|
417
|
-
}, undefined, false, undefined, this)
|
|
418
|
-
]
|
|
419
|
-
}, undefined, true, undefined, this)
|
|
420
|
-
]
|
|
421
|
-
}, undefined, true, undefined, this),
|
|
422
|
-
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
423
|
-
children: [
|
|
424
|
-
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
425
|
-
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
426
|
-
className: "flex items-center gap-2",
|
|
427
|
-
children: [
|
|
428
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
429
|
-
children: "\uD83C\uDFC5"
|
|
430
|
-
}, undefined, false, undefined, this),
|
|
431
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
432
|
-
children: "Achievements"
|
|
433
|
-
}, undefined, false, undefined, this)
|
|
434
|
-
]
|
|
435
|
-
}, undefined, true, undefined, this)
|
|
436
|
-
}, undefined, false, undefined, this),
|
|
437
|
-
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
438
|
-
children: [
|
|
439
|
-
/* @__PURE__ */ jsxDEV2(BadgeDisplay, {
|
|
440
|
-
badges: progress.badges,
|
|
441
|
-
size: "lg"
|
|
442
|
-
}, undefined, false, undefined, this),
|
|
443
|
-
progress.badges.length === 0 && track.completionRewards?.badgeKey && /* @__PURE__ */ jsxDEV2("p", {
|
|
444
|
-
className: "text-muted-foreground text-sm",
|
|
445
|
-
children: [
|
|
446
|
-
'Complete all steps to earn the "',
|
|
447
|
-
track.completionRewards.badgeKey,
|
|
448
|
-
'" badge!'
|
|
449
|
-
]
|
|
450
|
-
}, undefined, true, undefined, this)
|
|
451
|
-
]
|
|
452
|
-
}, undefined, true, undefined, this)
|
|
453
|
-
]
|
|
454
|
-
}, undefined, true, undefined, this),
|
|
455
|
-
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
456
|
-
children: [
|
|
457
|
-
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
458
|
-
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
459
|
-
className: "flex items-center gap-2",
|
|
460
|
-
children: [
|
|
461
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
462
|
-
children: "\uD83D\uDCCB"
|
|
463
|
-
}, undefined, false, undefined, this),
|
|
464
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
465
|
-
children: "Step Details"
|
|
466
|
-
}, undefined, false, undefined, this)
|
|
467
|
-
]
|
|
468
|
-
}, undefined, true, undefined, this)
|
|
469
|
-
}, undefined, false, undefined, this),
|
|
470
|
-
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
471
|
-
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
472
|
-
className: "space-y-3",
|
|
473
|
-
children: track.steps.map((step, index) => {
|
|
474
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
475
|
-
const stepProgress = isCompleted ? 100 : 0;
|
|
476
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
477
|
-
className: "space-y-1",
|
|
478
|
-
children: [
|
|
479
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
480
|
-
className: "flex items-center justify-between text-sm",
|
|
481
|
-
children: [
|
|
482
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
483
|
-
className: isCompleted ? "text-green-500" : "text-foreground",
|
|
484
|
-
children: [
|
|
485
|
-
index + 1,
|
|
486
|
-
". ",
|
|
487
|
-
step.title
|
|
488
|
-
]
|
|
489
|
-
}, undefined, true, undefined, this),
|
|
490
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
491
|
-
className: isCompleted ? "text-green-500" : "text-muted-foreground",
|
|
492
|
-
children: isCompleted ? "✓" : "Pending"
|
|
493
|
-
}, undefined, false, undefined, this)
|
|
494
|
-
]
|
|
495
|
-
}, undefined, true, undefined, this),
|
|
496
|
-
/* @__PURE__ */ jsxDEV2(Progress2, {
|
|
497
|
-
value: stepProgress,
|
|
498
|
-
className: "h-1"
|
|
499
|
-
}, undefined, false, undefined, this)
|
|
500
|
-
]
|
|
501
|
-
}, step.id, true, undefined, this);
|
|
502
|
-
})
|
|
503
|
-
}, undefined, false, undefined, this)
|
|
504
|
-
}, undefined, false, undefined, this)
|
|
505
|
-
]
|
|
506
|
-
}, undefined, true, undefined, this)
|
|
507
|
-
]
|
|
508
|
-
}, undefined, true, undefined, this);
|
|
509
|
-
}
|
|
510
|
-
// src/components/StepChecklist.tsx
|
|
511
|
-
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
512
|
-
import { cn } from "@contractspec/lib.ui-kit-core";
|
|
513
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
514
|
-
"use client";
|
|
515
|
-
function StepChecklist({
|
|
516
|
-
step,
|
|
517
|
-
stepNumber,
|
|
518
|
-
isCompleted,
|
|
519
|
-
isCurrent,
|
|
520
|
-
isExpanded,
|
|
521
|
-
onToggle,
|
|
522
|
-
onComplete
|
|
523
|
-
}) {
|
|
524
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
525
|
-
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"),
|
|
526
|
-
children: [
|
|
527
|
-
/* @__PURE__ */ jsxDEV3("button", {
|
|
528
|
-
type: "button",
|
|
529
|
-
className: "flex w-full items-center gap-4 p-4 text-left",
|
|
530
|
-
onClick: onToggle,
|
|
531
|
-
children: [
|
|
532
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
533
|
-
className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm 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"),
|
|
534
|
-
children: isCompleted ? "✓" : stepNumber
|
|
535
|
-
}, undefined, false, undefined, this),
|
|
536
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
537
|
-
className: "min-w-0 flex-1",
|
|
538
|
-
children: [
|
|
539
|
-
/* @__PURE__ */ jsxDEV3("h4", {
|
|
540
|
-
className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
541
|
-
children: step.title
|
|
542
|
-
}, undefined, false, undefined, this),
|
|
543
|
-
!isExpanded && step.description && /* @__PURE__ */ jsxDEV3("p", {
|
|
544
|
-
className: "truncate text-muted-foreground text-sm",
|
|
545
|
-
children: step.description
|
|
546
|
-
}, undefined, false, undefined, this)
|
|
547
|
-
]
|
|
548
|
-
}, undefined, true, undefined, this),
|
|
549
|
-
step.xpReward && /* @__PURE__ */ jsxDEV3("span", {
|
|
550
|
-
className: cn("shrink-0 rounded-full px-2 py-1 font-semibold text-xs", isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"),
|
|
551
|
-
children: [
|
|
552
|
-
"+",
|
|
553
|
-
step.xpReward,
|
|
554
|
-
" XP"
|
|
555
|
-
]
|
|
556
|
-
}, undefined, true, undefined, this),
|
|
557
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
558
|
-
className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
|
|
559
|
-
children: "▼"
|
|
560
|
-
}, undefined, false, undefined, this)
|
|
561
|
-
]
|
|
562
|
-
}, undefined, true, undefined, this),
|
|
563
|
-
isExpanded && /* @__PURE__ */ jsxDEV3("div", {
|
|
564
|
-
className: "border-t px-4 py-4",
|
|
565
|
-
children: [
|
|
566
|
-
step.description && /* @__PURE__ */ jsxDEV3("p", {
|
|
567
|
-
className: "mb-4 text-muted-foreground",
|
|
568
|
-
children: step.description
|
|
569
|
-
}, undefined, false, undefined, this),
|
|
570
|
-
step.instructions && /* @__PURE__ */ jsxDEV3("div", {
|
|
571
|
-
className: "mb-4 rounded-lg bg-muted p-4",
|
|
572
|
-
children: [
|
|
573
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
574
|
-
className: "mb-2 font-medium text-sm",
|
|
575
|
-
children: "Instructions:"
|
|
576
|
-
}, undefined, false, undefined, this),
|
|
577
|
-
/* @__PURE__ */ jsxDEV3("p", {
|
|
578
|
-
className: "text-muted-foreground text-sm",
|
|
579
|
-
children: step.instructions
|
|
580
|
-
}, undefined, false, undefined, this)
|
|
581
|
-
]
|
|
582
|
-
}, undefined, true, undefined, this),
|
|
583
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
584
|
-
className: "flex flex-wrap gap-2",
|
|
585
|
-
children: [
|
|
586
|
-
step.actionUrl && /* @__PURE__ */ jsxDEV3(Button2, {
|
|
587
|
-
variant: "outline",
|
|
588
|
-
size: "sm",
|
|
589
|
-
onClick: () => window.open(step.actionUrl, "_blank"),
|
|
590
|
-
children: step.actionLabel ?? "Try it"
|
|
591
|
-
}, undefined, false, undefined, this),
|
|
592
|
-
!isCompleted && /* @__PURE__ */ jsxDEV3(Button2, {
|
|
593
|
-
size: "sm",
|
|
594
|
-
onClick: onComplete,
|
|
595
|
-
children: "Mark as Complete"
|
|
596
|
-
}, undefined, false, undefined, this)
|
|
597
|
-
]
|
|
598
|
-
}, undefined, true, undefined, this)
|
|
599
|
-
]
|
|
600
|
-
}, undefined, true, undefined, this)
|
|
601
|
-
]
|
|
602
|
-
}, undefined, true, undefined, this);
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// src/views/Steps.tsx
|
|
606
|
-
import { Progress as Progress3 } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
607
|
-
import { useState } from "react";
|
|
608
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
609
|
-
"use client";
|
|
610
|
-
function Steps({ track, progress, onStepComplete }) {
|
|
611
|
-
const [expandedStepId, setExpandedStepId] = useState(() => {
|
|
612
|
-
const firstIncomplete = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
|
|
613
|
-
return firstIncomplete?.id ?? null;
|
|
614
|
-
});
|
|
615
|
-
const completedSteps = progress.completedStepIds.length;
|
|
616
|
-
const totalSteps = track.steps.length;
|
|
617
|
-
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
618
|
-
const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
|
|
619
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
620
|
-
className: "space-y-6",
|
|
621
|
-
children: [
|
|
622
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
623
|
-
className: "space-y-2",
|
|
624
|
-
children: [
|
|
625
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
626
|
-
className: "flex items-center justify-between",
|
|
627
|
-
children: [
|
|
628
|
-
/* @__PURE__ */ jsxDEV4("h2", {
|
|
629
|
-
className: "font-bold text-xl",
|
|
630
|
-
children: "Complete Each Step"
|
|
631
|
-
}, undefined, false, undefined, this),
|
|
632
|
-
/* @__PURE__ */ jsxDEV4("span", {
|
|
633
|
-
className: "text-muted-foreground text-sm",
|
|
634
|
-
children: [
|
|
635
|
-
completedSteps,
|
|
636
|
-
" / ",
|
|
637
|
-
totalSteps,
|
|
638
|
-
" completed"
|
|
639
|
-
]
|
|
640
|
-
}, undefined, true, undefined, this)
|
|
641
|
-
]
|
|
642
|
-
}, undefined, true, undefined, this),
|
|
643
|
-
/* @__PURE__ */ jsxDEV4(Progress3, {
|
|
644
|
-
value: percentComplete,
|
|
645
|
-
className: "h-2"
|
|
646
|
-
}, undefined, false, undefined, this)
|
|
647
|
-
]
|
|
648
|
-
}, undefined, true, undefined, this),
|
|
649
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
650
|
-
className: "space-y-3",
|
|
651
|
-
children: track.steps.map((step, index) => {
|
|
652
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
653
|
-
const isCurrent = index === currentStepIndex;
|
|
654
|
-
return /* @__PURE__ */ jsxDEV4(StepChecklist, {
|
|
655
|
-
step,
|
|
656
|
-
stepNumber: index + 1,
|
|
657
|
-
isCompleted,
|
|
658
|
-
isCurrent,
|
|
659
|
-
isExpanded: expandedStepId === step.id,
|
|
660
|
-
onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
|
|
661
|
-
onComplete: () => {
|
|
662
|
-
onStepComplete?.(step.id);
|
|
663
|
-
const nextStep = track.steps[index + 1];
|
|
664
|
-
if (nextStep && !progress.completedStepIds.includes(nextStep.id)) {
|
|
665
|
-
setExpandedStepId(nextStep.id);
|
|
666
|
-
}
|
|
667
|
-
}
|
|
668
|
-
}, step.id, false, undefined, this);
|
|
669
|
-
})
|
|
670
|
-
}, undefined, false, undefined, this),
|
|
671
|
-
track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsxDEV4("div", {
|
|
672
|
-
className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
|
|
673
|
-
children: /* @__PURE__ */ jsxDEV4("p", {
|
|
674
|
-
className: "text-sm",
|
|
675
|
-
children: [
|
|
676
|
-
"\uD83C\uDF81 Complete all steps to unlock:",
|
|
677
|
-
track.completionRewards.xpBonus && /* @__PURE__ */ jsxDEV4("span", {
|
|
678
|
-
className: "ml-2 font-semibold text-blue-500",
|
|
679
|
-
children: [
|
|
680
|
-
"+",
|
|
681
|
-
track.completionRewards.xpBonus,
|
|
682
|
-
" XP bonus"
|
|
683
|
-
]
|
|
684
|
-
}, undefined, true, undefined, this),
|
|
685
|
-
track.completionRewards.badgeKey && /* @__PURE__ */ jsxDEV4("span", {
|
|
686
|
-
className: "ml-2 font-semibold text-amber-500",
|
|
687
|
-
children: [
|
|
688
|
-
'+ "',
|
|
689
|
-
track.completionRewards.badgeKey,
|
|
690
|
-
'" badge'
|
|
691
|
-
]
|
|
692
|
-
}, undefined, true, undefined, this)
|
|
693
|
-
]
|
|
694
|
-
}, undefined, true, undefined, this)
|
|
695
|
-
}, undefined, false, undefined, this)
|
|
696
|
-
]
|
|
697
|
-
}, undefined, true, undefined, this);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
// src/components/JourneyMap.tsx
|
|
701
|
-
import { cn as cn2 } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
702
|
-
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
703
|
-
"use client";
|
|
704
|
-
var SURFACE_ICONS = {
|
|
705
|
-
templates: "\uD83D\uDCCB",
|
|
706
|
-
"spec-editor": "✏️",
|
|
707
|
-
regenerator: "\uD83D\uDD04",
|
|
708
|
-
playground: "\uD83C\uDFAE",
|
|
709
|
-
evolution: "\uD83E\uDD16",
|
|
710
|
-
dashboard: "\uD83D\uDCCA",
|
|
711
|
-
settings: "⚙️",
|
|
712
|
-
default: "\uD83D\uDCCD"
|
|
713
|
-
};
|
|
714
|
-
function JourneyMap({
|
|
715
|
-
steps,
|
|
716
|
-
completedStepIds,
|
|
717
|
-
currentStepId
|
|
718
|
-
}) {
|
|
719
|
-
return /* @__PURE__ */ jsxDEV5("div", {
|
|
720
|
-
className: "relative overflow-x-auto pb-4",
|
|
721
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
722
|
-
className: "flex min-w-max items-center gap-2",
|
|
723
|
-
children: steps.map((step, index) => {
|
|
724
|
-
const isCompleted = completedStepIds.includes(step.id);
|
|
725
|
-
const isCurrent = step.id === currentStepId;
|
|
726
|
-
const surface = step.metadata?.surface ?? "default";
|
|
727
|
-
const icon = SURFACE_ICONS[surface] ?? SURFACE_ICONS.default;
|
|
728
|
-
return /* @__PURE__ */ jsxDEV5("div", {
|
|
729
|
-
className: "flex items-center",
|
|
730
|
-
children: [
|
|
731
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
732
|
-
className: "flex flex-col items-center gap-2",
|
|
733
|
-
children: [
|
|
734
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
735
|
-
className: cn2("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"),
|
|
736
|
-
children: isCompleted ? "✓" : icon
|
|
737
|
-
}, undefined, false, undefined, this),
|
|
738
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
739
|
-
className: "text-center",
|
|
740
|
-
children: /* @__PURE__ */ jsxDEV5("p", {
|
|
741
|
-
className: cn2("max-w-[100px] truncate font-medium text-xs", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
742
|
-
children: step.title
|
|
743
|
-
}, undefined, false, undefined, this)
|
|
744
|
-
}, undefined, false, undefined, this)
|
|
745
|
-
]
|
|
746
|
-
}, undefined, true, undefined, this),
|
|
747
|
-
index < steps.length - 1 && /* @__PURE__ */ jsxDEV5("div", {
|
|
748
|
-
className: cn2("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")
|
|
749
|
-
}, undefined, false, undefined, this)
|
|
750
|
-
]
|
|
751
|
-
}, step.id, true, undefined, this);
|
|
752
|
-
})
|
|
753
|
-
}, undefined, false, undefined, this)
|
|
754
|
-
}, undefined, false, undefined, this);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// src/views/Timeline.tsx
|
|
758
|
-
import {
|
|
759
|
-
Card as Card3,
|
|
760
|
-
CardContent as CardContent3,
|
|
761
|
-
CardHeader as CardHeader3,
|
|
762
|
-
CardTitle as CardTitle3
|
|
763
|
-
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
764
|
-
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
765
|
-
"use client";
|
|
766
|
-
function Timeline({ track, progress }) {
|
|
767
|
-
const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
|
|
768
|
-
return /* @__PURE__ */ jsxDEV6("div", {
|
|
769
|
-
className: "space-y-6",
|
|
770
|
-
children: [
|
|
771
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
772
|
-
className: "text-center",
|
|
773
|
-
children: [
|
|
774
|
-
/* @__PURE__ */ jsxDEV6("h2", {
|
|
775
|
-
className: "font-bold text-xl",
|
|
776
|
-
children: "Your Learning Journey"
|
|
777
|
-
}, undefined, false, undefined, this),
|
|
778
|
-
/* @__PURE__ */ jsxDEV6("p", {
|
|
779
|
-
className: "text-muted-foreground",
|
|
780
|
-
children: "Follow the path through each surface and feature"
|
|
781
|
-
}, undefined, false, undefined, this)
|
|
782
|
-
]
|
|
783
|
-
}, undefined, true, undefined, this),
|
|
784
|
-
/* @__PURE__ */ jsxDEV6(Card3, {
|
|
785
|
-
children: [
|
|
786
|
-
/* @__PURE__ */ jsxDEV6(CardHeader3, {
|
|
787
|
-
children: /* @__PURE__ */ jsxDEV6(CardTitle3, {
|
|
788
|
-
className: "flex items-center gap-2",
|
|
789
|
-
children: [
|
|
790
|
-
/* @__PURE__ */ jsxDEV6("span", {
|
|
791
|
-
children: "\uD83D\uDDFA️"
|
|
792
|
-
}, undefined, false, undefined, this),
|
|
793
|
-
/* @__PURE__ */ jsxDEV6("span", {
|
|
794
|
-
children: "Journey Map"
|
|
795
|
-
}, undefined, false, undefined, this)
|
|
796
|
-
]
|
|
797
|
-
}, undefined, true, undefined, this)
|
|
798
|
-
}, undefined, false, undefined, this),
|
|
799
|
-
/* @__PURE__ */ jsxDEV6(CardContent3, {
|
|
800
|
-
children: /* @__PURE__ */ jsxDEV6(JourneyMap, {
|
|
801
|
-
steps: track.steps,
|
|
802
|
-
completedStepIds: progress.completedStepIds,
|
|
803
|
-
currentStepId
|
|
804
|
-
}, undefined, false, undefined, this)
|
|
805
|
-
}, undefined, false, undefined, this)
|
|
806
|
-
]
|
|
807
|
-
}, undefined, true, undefined, this),
|
|
808
|
-
/* @__PURE__ */ jsxDEV6(Card3, {
|
|
809
|
-
children: [
|
|
810
|
-
/* @__PURE__ */ jsxDEV6(CardHeader3, {
|
|
811
|
-
children: /* @__PURE__ */ jsxDEV6(CardTitle3, {
|
|
812
|
-
className: "flex items-center gap-2",
|
|
813
|
-
children: [
|
|
814
|
-
/* @__PURE__ */ jsxDEV6("span", {
|
|
815
|
-
children: "\uD83D\uDCCD"
|
|
816
|
-
}, undefined, false, undefined, this),
|
|
817
|
-
/* @__PURE__ */ jsxDEV6("span", {
|
|
818
|
-
children: "Step by Step"
|
|
819
|
-
}, undefined, false, undefined, this)
|
|
820
|
-
]
|
|
821
|
-
}, undefined, true, undefined, this)
|
|
822
|
-
}, undefined, false, undefined, this),
|
|
823
|
-
/* @__PURE__ */ jsxDEV6(CardContent3, {
|
|
824
|
-
children: /* @__PURE__ */ jsxDEV6("div", {
|
|
825
|
-
className: "relative",
|
|
826
|
-
children: [
|
|
827
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
828
|
-
className: "absolute top-0 left-4 h-full w-0.5 bg-border"
|
|
829
|
-
}, undefined, false, undefined, this),
|
|
830
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
831
|
-
className: "space-y-6",
|
|
832
|
-
children: track.steps.map((step, index) => {
|
|
833
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
834
|
-
const isCurrent = step.id === currentStepId;
|
|
835
|
-
const surface = step.metadata?.surface ?? "general";
|
|
836
|
-
return /* @__PURE__ */ jsxDEV6("div", {
|
|
837
|
-
className: "relative flex gap-4 pl-2",
|
|
838
|
-
children: [
|
|
839
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
840
|
-
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"}`,
|
|
841
|
-
children: isCompleted ? "✓" : index + 1
|
|
842
|
-
}, undefined, false, undefined, this),
|
|
843
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
844
|
-
className: "flex-1 pb-2",
|
|
845
|
-
children: /* @__PURE__ */ jsxDEV6("div", {
|
|
846
|
-
className: "rounded-lg border p-4",
|
|
847
|
-
children: [
|
|
848
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
849
|
-
className: "flex items-start justify-between gap-2",
|
|
850
|
-
children: [
|
|
851
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
852
|
-
children: [
|
|
853
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
854
|
-
className: "flex items-center gap-2",
|
|
855
|
-
children: [
|
|
856
|
-
/* @__PURE__ */ jsxDEV6("h4", {
|
|
857
|
-
className: `font-semibold ${isCompleted ? "text-green-500" : isCurrent ? "text-blue-500" : "text-foreground"}`,
|
|
858
|
-
children: step.title
|
|
859
|
-
}, undefined, false, undefined, this),
|
|
860
|
-
/* @__PURE__ */ jsxDEV6("span", {
|
|
861
|
-
className: "rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",
|
|
862
|
-
children: surface
|
|
863
|
-
}, undefined, false, undefined, this)
|
|
864
|
-
]
|
|
865
|
-
}, undefined, true, undefined, this),
|
|
866
|
-
/* @__PURE__ */ jsxDEV6("p", {
|
|
867
|
-
className: "mt-1 text-muted-foreground text-sm",
|
|
868
|
-
children: step.description
|
|
869
|
-
}, undefined, false, undefined, this)
|
|
870
|
-
]
|
|
871
|
-
}, undefined, true, undefined, this),
|
|
872
|
-
step.xpReward && /* @__PURE__ */ jsxDEV6("span", {
|
|
873
|
-
className: `shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"}`,
|
|
874
|
-
children: [
|
|
875
|
-
"+",
|
|
876
|
-
step.xpReward,
|
|
877
|
-
" XP"
|
|
878
|
-
]
|
|
879
|
-
}, undefined, true, undefined, this)
|
|
880
|
-
]
|
|
881
|
-
}, undefined, true, undefined, this),
|
|
882
|
-
/* @__PURE__ */ jsxDEV6("div", {
|
|
883
|
-
className: "mt-3 text-xs",
|
|
884
|
-
children: isCompleted ? /* @__PURE__ */ jsxDEV6("span", {
|
|
885
|
-
className: "text-green-500",
|
|
886
|
-
children: "✓ Completed"
|
|
887
|
-
}, undefined, false, undefined, this) : isCurrent ? /* @__PURE__ */ jsxDEV6("span", {
|
|
888
|
-
className: "text-blue-500",
|
|
889
|
-
children: "→ In Progress"
|
|
890
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV6("span", {
|
|
891
|
-
className: "text-muted-foreground",
|
|
892
|
-
children: "○ Not Started"
|
|
893
|
-
}, undefined, false, undefined, this)
|
|
894
|
-
}, undefined, false, undefined, this)
|
|
895
|
-
]
|
|
896
|
-
}, undefined, true, undefined, this)
|
|
897
|
-
}, undefined, false, undefined, this)
|
|
898
|
-
]
|
|
899
|
-
}, step.id, true, undefined, this);
|
|
900
|
-
})
|
|
901
|
-
}, undefined, false, undefined, this)
|
|
902
|
-
]
|
|
903
|
-
}, undefined, true, undefined, this)
|
|
904
|
-
}, undefined, false, undefined, this)
|
|
905
|
-
]
|
|
906
|
-
}, undefined, true, undefined, this)
|
|
907
|
-
]
|
|
908
|
-
}, undefined, true, undefined, this);
|
|
909
|
-
}
|
|
910
|
-
export {
|
|
911
|
-
Timeline,
|
|
912
|
-
Steps,
|
|
913
|
-
ProgressView as Progress,
|
|
914
|
-
Overview
|
|
915
|
-
};
|
|
1
|
+
import{XpBar as a}from"@contractspec/example.learning-journey-ui-shared";import{Button as C}from"@contractspec/lib.design-system";import{Card as P,CardContent as V,CardHeader as u,CardTitle as X}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as r}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as v,jsxs as J}from"react/jsx-runtime";function x({track:f,progress:h,onStart:w}){let b=f.steps.length,G=h.completedStepIds.length,L=b>0?G/b*100:0,z=G===b,W=b-G,R=W*5,Q=f.totalXp??f.steps.reduce((K,Z)=>K+(Z.xpReward??0),0)+(f.completionRewards?.xpBonus??0);return J("div",{className:"space-y-6",children:[v(P,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:v(V,{className:"p-8",children:J("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[v("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:z?"\uD83C\uDF89":"\uD83D\uDE80"}),J("div",{className:"flex-1",children:[v("h1",{className:"font-bold text-2xl",children:f.name}),v("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:f.description}),!z&&J("p",{className:"mt-3 text-muted-foreground text-sm",children:["⏱️ Estimated time:"," ",R>0?`~${R} minutes`:"Less than a minute"]})]}),!z&&v(C,{size:"lg",onClick:w,children:G>0?"Continue":"Get Started"})]})})}),J("div",{className:"grid gap-4 md:grid-cols-3",children:[J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),J(V,{children:[J("div",{className:"font-bold text-3xl",children:[Math.round(L),"%"]}),v(r,{value:L,className:"mt-2 h-2"}),J("p",{className:"mt-2 text-muted-foreground text-sm",children:[G," of ",b," steps completed"]})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),J(V,{children:[v("div",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),v(a,{current:h.xpEarned,max:Q,showLabel:!1,size:"sm"})]})]}),J(P,{children:[v(u,{className:"pb-2",children:v(X,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),J(V,{children:[v("div",{className:"font-bold text-3xl",children:z?"✓":`~${R}m`}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:z?"All done!":`${W} steps to go`})]})]})]}),J(P,{children:[v(u,{children:J(X,{className:"flex items-center gap-2",children:[v("span",{children:"\uD83D\uDCCB"}),v("span",{children:"Your Journey"})]})}),v(V,{children:v("div",{className:"space-y-3",children:f.steps.map((K,Z)=>{let D=h.completedStepIds.includes(K.id),O=!D&&f.steps.slice(0,Z).every((d)=>h.completedStepIds.includes(d.id));return J("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[v("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${D?"bg-green-500 text-white":O?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:D?"✓":Z+1}),v("div",{className:"min-w-0 flex-1",children:v("p",{className:`font-medium ${D?"text-green-500":O?"text-foreground":"text-muted-foreground"}`,children:K.title})}),K.xpReward&&J("span",{className:"text-muted-foreground text-sm",children:["+",K.xpReward," XP"]})]},K.id)})})})]}),z&&v(P,{className:"border-green-500/50 bg-green-500/5",children:J(V,{className:"flex items-center gap-4 p-6",children:[v("div",{className:"text-4xl",children:"\uD83C\uDF89"}),J("div",{children:[v("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),J("p",{className:"text-muted-foreground",children:["You've completed all ",b," steps. Welcome aboard!"]})]})]})})]})}import{BadgeDisplay as j,XpBar as p}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as M,CardHeader as T,CardTitle as H}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as t}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as N,jsxs as y}from"react/jsx-runtime";function e({track:f,progress:h}){let w=f.steps.length,b=h.completedStepIds.length,G=w>0?b/w*100:0,L=f.totalXp??f.steps.reduce((R,Q)=>R+(Q.xpReward??0),0)+(f.completionRewards?.xpBonus??0),z=w-b,W=z*5;return y("div",{className:"space-y-6",children:[y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCC8"}),N("span",{children:"Your Progress"})]})}),y(M,{className:"space-y-6",children:[N("div",{className:"flex items-center justify-center",children:y("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[y("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),N("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${G*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),y("div",{className:"text-center",children:[y("div",{className:"font-bold text-3xl",children:[Math.round(G),"%"]}),N("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),y("div",{className:"grid grid-cols-3 gap-4 text-center",children:[y("div",{children:[N("div",{className:"font-bold text-2xl text-green-500",children:b}),N("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),y("div",{children:[N("div",{className:"font-bold text-2xl text-orange-500",children:z}),N("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),y("div",{children:[y("div",{className:"font-bold text-2xl",children:[W,"m"]}),N("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"⚡"}),N("span",{children:"Experience Points"})]})}),y(M,{className:"space-y-4",children:[y("div",{className:"flex items-baseline gap-2",children:[N("span",{className:"font-bold text-3xl text-blue-500",children:h.xpEarned}),y("span",{className:"text-muted-foreground",children:["/ ",L," XP"]})]}),N(p,{current:h.xpEarned,max:L,showLabel:!1,size:"lg"})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83C\uDFC5"}),N("span",{children:"Achievements"})]})}),y(M,{children:[N(j,{badges:h.badges,size:"lg"}),h.badges.length===0&&f.completionRewards?.badgeKey&&y("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',f.completionRewards.badgeKey,'" badge!']})]})]}),y(E,{children:[N(T,{children:y(H,{className:"flex items-center gap-2",children:[N("span",{children:"\uD83D\uDCCB"}),N("span",{children:"Step Details"})]})}),N(M,{children:N("div",{className:"space-y-3",children:f.steps.map((R,Q)=>{let K=h.completedStepIds.includes(R.id),Z=K?100:0;return y("div",{className:"space-y-1",children:[y("div",{className:"flex items-center justify-between text-sm",children:[y("span",{className:K?"text-green-500":"text-foreground",children:[Q+1,". ",R.title]}),N("span",{className:K?"text-green-500":"text-muted-foreground",children:K?"✓":"Pending"})]}),N(t,{value:Z,className:"h-1"})]},R.id)})})})]})]})}import{Button as g}from"@contractspec/lib.design-system";import{cn as A}from"@contractspec/lib.ui-kit-core";import{jsx as Y,jsxs as $}from"react/jsx-runtime";function n({step:f,stepNumber:h,isCompleted:w,isCurrent:b,isExpanded:G,onToggle:L,onComplete:z}){return $("div",{className:A("rounded-xl border transition-all",w&&"border-green-500/50 bg-green-500/5",b&&!w&&"border-violet-500 bg-violet-500/5",!w&&!b&&"border-border"),children:[$("button",{type:"button",className:"flex w-full items-center gap-4 p-4 text-left",onClick:L,children:[Y("div",{className:A("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors",w&&"border-green-500 bg-green-500 text-white",b&&!w&&"border-violet-500 text-violet-500",!w&&!b&&"border-muted-foreground text-muted-foreground"),children:w?"✓":h}),$("div",{className:"min-w-0 flex-1",children:[Y("h4",{className:A("font-semibold",w&&"text-green-500",b&&!w&&"text-foreground",!w&&!b&&"text-muted-foreground"),children:f.title}),!G&&f.description&&Y("p",{className:"truncate text-muted-foreground text-sm",children:f.description})]}),f.xpReward&&$("span",{className:A("shrink-0 rounded-full px-2 py-1 font-semibold text-xs",w?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"),children:["+",f.xpReward," XP"]}),Y("span",{className:A("shrink-0 transition-transform",G&&"rotate-180"),children:"▼"})]}),G&&$("div",{className:"border-t px-4 py-4",children:[f.description&&Y("p",{className:"mb-4 text-muted-foreground",children:f.description}),f.instructions&&$("div",{className:"mb-4 rounded-lg bg-muted p-4",children:[Y("p",{className:"mb-2 font-medium text-sm",children:"Instructions:"}),Y("p",{className:"text-muted-foreground text-sm",children:f.instructions})]}),$("div",{className:"flex flex-wrap gap-2",children:[f.actionUrl&&Y(g,{variant:"outline",size:"sm",onClick:()=>window.open(f.actionUrl,"_blank"),children:f.actionLabel??"Try it"}),!w&&Y(g,{size:"sm",onClick:z,children:"Mark as Complete"})]})]})]})}import{Progress as s}from"@contractspec/lib.ui-kit-web/ui/progress";import{useState as ff}from"react";import{jsx as F,jsxs as B}from"react/jsx-runtime";function bf({track:f,progress:h,onStepComplete:w}){let[b,G]=ff(()=>{return f.steps.find((K)=>!h.completedStepIds.includes(K.id))?.id??null}),L=h.completedStepIds.length,z=f.steps.length,W=z>0?L/z*100:0,R=f.steps.findIndex((Q)=>!h.completedStepIds.includes(Q.id));return B("div",{className:"space-y-6",children:[B("div",{className:"space-y-2",children:[B("div",{className:"flex items-center justify-between",children:[F("h2",{className:"font-bold text-xl",children:"Complete Each Step"}),B("span",{className:"text-muted-foreground text-sm",children:[L," / ",z," completed"]})]}),F(s,{value:W,className:"h-2"})]}),F("div",{className:"space-y-3",children:f.steps.map((Q,K)=>{let Z=h.completedStepIds.includes(Q.id),D=K===R;return F(n,{step:Q,stepNumber:K+1,isCompleted:Z,isCurrent:D,isExpanded:b===Q.id,onToggle:()=>G(b===Q.id?null:Q.id),onComplete:()=>{w?.(Q.id);let O=f.steps[K+1];if(O&&!h.completedStepIds.includes(O.id))G(O.id)}},Q.id)})}),f.completionRewards&&W<100&&F("div",{className:"rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",children:B("p",{className:"text-sm",children:["\uD83C\uDF81 Complete all steps to unlock:",f.completionRewards.xpBonus&&B("span",{className:"ml-2 font-semibold text-blue-500",children:["+",f.completionRewards.xpBonus," XP bonus"]}),f.completionRewards.badgeKey&&B("span",{className:"ml-2 font-semibold text-amber-500",children:['+ "',f.completionRewards.badgeKey,'" badge']})]})})]})}import{cn as I}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as _,jsxs as l}from"react/jsx-runtime";var m={templates:"\uD83D\uDCCB","spec-editor":"✏️",regenerator:"\uD83D\uDD04",playground:"\uD83C\uDFAE",evolution:"\uD83E\uDD16",dashboard:"\uD83D\uDCCA",settings:"⚙️",default:"\uD83D\uDCCD"};function o({steps:f,completedStepIds:h,currentStepId:w}){return _("div",{className:"relative overflow-x-auto pb-4",children:_("div",{className:"flex min-w-max items-center gap-2",children:f.map((b,G)=>{let L=h.includes(b.id),z=b.id===w,W=b.metadata?.surface??"default",R=m[W]??m.default;return l("div",{className:"flex items-center",children:[l("div",{className:"flex flex-col items-center gap-2",children:[_("div",{className:I("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all",L&&"border-green-500 bg-green-500/10",z&&!L&&"border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20",!L&&!z&&"border-muted bg-muted/50"),children:L?"✓":R}),_("div",{className:"text-center",children:_("p",{className:I("max-w-[100px] truncate font-medium text-xs",L&&"text-green-500",z&&!L&&"text-violet-500",!L&&!z&&"text-muted-foreground"),children:b.title})})]}),G<f.length-1&&_("div",{className:I("mx-2 h-1 w-8 rounded-full transition-colors",h.includes(f[G+1]?.id??"")?"bg-green-500":L?"bg-green-500/50":"bg-muted")})]},b.id)})})})}import{Card as S,CardContent as k,CardHeader as i,CardTitle as c}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as q,jsxs as U}from"react/jsx-runtime";function vf({track:f,progress:h}){let w=f.steps.find((b)=>!h.completedStepIds.includes(b.id))?.id??null;return U("div",{className:"space-y-6",children:[U("div",{className:"text-center",children:[q("h2",{className:"font-bold text-xl",children:"Your Learning Journey"}),q("p",{className:"text-muted-foreground",children:"Follow the path through each surface and feature"})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDDFA️"}),q("span",{children:"Journey Map"})]})}),q(k,{children:q(o,{steps:f.steps,completedStepIds:h.completedStepIds,currentStepId:w})})]}),U(S,{children:[q(i,{children:U(c,{className:"flex items-center gap-2",children:[q("span",{children:"\uD83D\uDCCD"}),q("span",{children:"Step by Step"})]})}),q(k,{children:U("div",{className:"relative",children:[q("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),q("div",{className:"space-y-6",children:f.steps.map((b,G)=>{let L=h.completedStepIds.includes(b.id),z=b.id===w,W=b.metadata?.surface??"general";return U("div",{className:"relative flex gap-4 pl-2",children:[q("div",{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${L?"border-green-500 bg-green-500 text-white":z?"border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20":"border-border bg-background text-muted-foreground"}`,children:L?"✓":G+1}),q("div",{className:"flex-1 pb-2",children:U("div",{className:"rounded-lg border p-4",children:[U("div",{className:"flex items-start justify-between gap-2",children:[U("div",{children:[U("div",{className:"flex items-center gap-2",children:[q("h4",{className:`font-semibold ${L?"text-green-500":z?"text-blue-500":"text-foreground"}`,children:b.title}),q("span",{className:"rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",children:W})]}),q("p",{className:"mt-1 text-muted-foreground text-sm",children:b.description})]}),b.xpReward&&U("span",{className:`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${L?"bg-green-500/10 text-green-500":"bg-muted text-muted-foreground"}`,children:["+",b.xpReward," XP"]})]}),q("div",{className:"mt-3 text-xs",children:L?q("span",{className:"text-green-500",children:"✓ Completed"}):z?q("span",{className:"text-blue-500",children:"→ In Progress"}):q("span",{className:"text-muted-foreground",children:"○ Not Started"})})]})})]},b.id)})})]})})]})]})}export{vf as Timeline,bf as Steps,e as Progress,x as Overview};
|