@contractspec/example.learning-journey-ui-onboarding 3.7.6 → 3.7.7
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 +3 -3
- package/AGENTS.md +50 -24
- package/README.md +66 -26
- package/dist/OnboardingMiniApp.js +280 -280
- package/dist/browser/OnboardingMiniApp.js +280 -280
- package/dist/browser/components/CodeSnippet.js +4 -4
- package/dist/browser/components/JourneyMap.js +1 -1
- package/dist/browser/components/StepChecklist.js +6 -6
- package/dist/browser/components/index.js +11 -11
- package/dist/browser/index.js +285 -284
- package/dist/browser/views/Overview.js +14 -14
- package/dist/browser/views/Progress.js +9 -9
- package/dist/browser/views/Steps.js +8 -8
- package/dist/browser/views/Timeline.js +6 -6
- package/dist/browser/views/index.js +276 -276
- package/dist/components/CodeSnippet.js +4 -4
- package/dist/components/JourneyMap.js +1 -1
- package/dist/components/StepChecklist.js +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +11 -11
- package/dist/index.d.ts +4 -4
- package/dist/index.js +285 -284
- package/dist/node/OnboardingMiniApp.js +280 -280
- package/dist/node/components/CodeSnippet.js +4 -4
- package/dist/node/components/JourneyMap.js +1 -1
- package/dist/node/components/StepChecklist.js +6 -6
- package/dist/node/components/index.js +11 -11
- package/dist/node/index.js +285 -284
- package/dist/node/views/Overview.js +14 -14
- package/dist/node/views/Progress.js +9 -9
- package/dist/node/views/Steps.js +8 -8
- package/dist/node/views/Timeline.js +6 -6
- package/dist/node/views/index.js +276 -276
- package/dist/views/Overview.js +14 -14
- package/dist/views/Progress.js +9 -9
- package/dist/views/Steps.js +8 -8
- package/dist/views/Timeline.js +6 -6
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +276 -276
- package/package.json +10 -10
- package/src/OnboardingMiniApp.tsx +70 -70
- package/src/components/CodeSnippet.tsx +43 -43
- package/src/components/JourneyMap.tsx +70 -70
- package/src/components/StepChecklist.tsx +118 -118
- package/src/components/index.ts +1 -1
- package/src/docs/learning-journey-ui-onboarding.docblock.ts +11 -11
- package/src/example.ts +25 -25
- package/src/index.ts +5 -6
- package/src/learning-journey-ui-onboarding.feature.ts +12 -12
- package/src/views/Overview.tsx +182 -182
- package/src/views/Progress.tsx +167 -167
- package/src/views/Steps.tsx +79 -79
- package/src/views/Timeline.tsx +126 -126
- package/src/views/index.ts +1 -1
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -13
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/views/Overview.tsx
|
|
3
|
+
import { XpBar } from "@contractspec/example.learning-journey-ui-shared";
|
|
3
4
|
import { Button } from "@contractspec/lib.design-system";
|
|
4
5
|
import {
|
|
5
6
|
Card,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
CardTitle
|
|
9
10
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
10
11
|
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
11
|
-
import { XpBar } from "@contractspec/example.learning-journey-ui-shared";
|
|
12
12
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
13
13
|
"use client";
|
|
14
14
|
function Overview({
|
|
@@ -41,15 +41,15 @@ function Overview({
|
|
|
41
41
|
className: "flex-1",
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ jsxDEV("h1", {
|
|
44
|
-
className: "text-2xl
|
|
44
|
+
className: "font-bold text-2xl",
|
|
45
45
|
children: track.name
|
|
46
46
|
}, undefined, false, undefined, this),
|
|
47
47
|
/* @__PURE__ */ jsxDEV("p", {
|
|
48
|
-
className: "
|
|
48
|
+
className: "mt-1 max-w-2xl text-muted-foreground",
|
|
49
49
|
children: track.description
|
|
50
50
|
}, undefined, false, undefined, this),
|
|
51
51
|
!isComplete && /* @__PURE__ */ jsxDEV("p", {
|
|
52
|
-
className: "text-muted-foreground
|
|
52
|
+
className: "mt-3 text-muted-foreground text-sm",
|
|
53
53
|
children: [
|
|
54
54
|
"\u23F1\uFE0F Estimated time:",
|
|
55
55
|
" ",
|
|
@@ -75,14 +75,14 @@ function Overview({
|
|
|
75
75
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
76
76
|
className: "pb-2",
|
|
77
77
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
78
|
-
className: "text-muted-foreground text-sm
|
|
78
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
79
79
|
children: "Progress"
|
|
80
80
|
}, undefined, false, undefined, this)
|
|
81
81
|
}, undefined, false, undefined, this),
|
|
82
82
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ jsxDEV("div", {
|
|
85
|
-
className: "text-3xl
|
|
85
|
+
className: "font-bold text-3xl",
|
|
86
86
|
children: [
|
|
87
87
|
Math.round(percentComplete),
|
|
88
88
|
"%"
|
|
@@ -93,7 +93,7 @@ function Overview({
|
|
|
93
93
|
className: "mt-2 h-2"
|
|
94
94
|
}, undefined, false, undefined, this),
|
|
95
95
|
/* @__PURE__ */ jsxDEV("p", {
|
|
96
|
-
className: "text-muted-foreground
|
|
96
|
+
className: "mt-2 text-muted-foreground text-sm",
|
|
97
97
|
children: [
|
|
98
98
|
completedSteps,
|
|
99
99
|
" of ",
|
|
@@ -110,14 +110,14 @@ function Overview({
|
|
|
110
110
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
111
111
|
className: "pb-2",
|
|
112
112
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
113
|
-
className: "text-muted-foreground text-sm
|
|
113
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
114
114
|
children: "XP Earned"
|
|
115
115
|
}, undefined, false, undefined, this)
|
|
116
116
|
}, undefined, false, undefined, this),
|
|
117
117
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ jsxDEV("div", {
|
|
120
|
-
className: "
|
|
120
|
+
className: "font-bold text-3xl text-blue-500",
|
|
121
121
|
children: progress.xpEarned
|
|
122
122
|
}, undefined, false, undefined, this),
|
|
123
123
|
/* @__PURE__ */ jsxDEV(XpBar, {
|
|
@@ -135,18 +135,18 @@ function Overview({
|
|
|
135
135
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
136
136
|
className: "pb-2",
|
|
137
137
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
138
|
-
className: "text-muted-foreground text-sm
|
|
138
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
139
139
|
children: "Time Remaining"
|
|
140
140
|
}, undefined, false, undefined, this)
|
|
141
141
|
}, undefined, false, undefined, this),
|
|
142
142
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
143
143
|
children: [
|
|
144
144
|
/* @__PURE__ */ jsxDEV("div", {
|
|
145
|
-
className: "text-3xl
|
|
145
|
+
className: "font-bold text-3xl",
|
|
146
146
|
children: isComplete ? "\u2713" : `~${estimatedMinutes}m`
|
|
147
147
|
}, undefined, false, undefined, this),
|
|
148
148
|
/* @__PURE__ */ jsxDEV("p", {
|
|
149
|
-
className: "text-muted-foreground
|
|
149
|
+
className: "mt-2 text-muted-foreground text-sm",
|
|
150
150
|
children: isComplete ? "All done!" : `${remainingSteps} steps to go`
|
|
151
151
|
}, undefined, false, undefined, this)
|
|
152
152
|
]
|
|
@@ -180,7 +180,7 @@ function Overview({
|
|
|
180
180
|
className: "flex items-center gap-4 rounded-lg border p-3",
|
|
181
181
|
children: [
|
|
182
182
|
/* @__PURE__ */ jsxDEV("div", {
|
|
183
|
-
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm
|
|
183
|
+
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"}`,
|
|
184
184
|
children: isStepCompleted ? "\u2713" : index + 1
|
|
185
185
|
}, undefined, false, undefined, this),
|
|
186
186
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -217,7 +217,7 @@ function Overview({
|
|
|
217
217
|
/* @__PURE__ */ jsxDEV("div", {
|
|
218
218
|
children: [
|
|
219
219
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
220
|
-
className: "
|
|
220
|
+
className: "font-semibold text-green-500 text-lg",
|
|
221
221
|
children: "Onboarding Complete!"
|
|
222
222
|
}, undefined, false, undefined, this),
|
|
223
223
|
/* @__PURE__ */ jsxDEV("p", {
|
|
@@ -237,209 +237,19 @@ function Overview({
|
|
|
237
237
|
}, undefined, true, undefined, this);
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
// src/components/StepChecklist.tsx
|
|
241
|
-
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
242
|
-
import { cn } from "@contractspec/lib.ui-kit-core";
|
|
243
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
244
|
-
"use client";
|
|
245
|
-
function StepChecklist({
|
|
246
|
-
step,
|
|
247
|
-
stepNumber,
|
|
248
|
-
isCompleted,
|
|
249
|
-
isCurrent,
|
|
250
|
-
isExpanded,
|
|
251
|
-
onToggle,
|
|
252
|
-
onComplete
|
|
253
|
-
}) {
|
|
254
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
255
|
-
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"),
|
|
256
|
-
children: [
|
|
257
|
-
/* @__PURE__ */ jsxDEV2("button", {
|
|
258
|
-
type: "button",
|
|
259
|
-
className: "flex w-full items-center gap-4 p-4 text-left",
|
|
260
|
-
onClick: onToggle,
|
|
261
|
-
children: [
|
|
262
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
263
|
-
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"),
|
|
264
|
-
children: isCompleted ? "\u2713" : stepNumber
|
|
265
|
-
}, undefined, false, undefined, this),
|
|
266
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
267
|
-
className: "min-w-0 flex-1",
|
|
268
|
-
children: [
|
|
269
|
-
/* @__PURE__ */ jsxDEV2("h4", {
|
|
270
|
-
className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
271
|
-
children: step.title
|
|
272
|
-
}, undefined, false, undefined, this),
|
|
273
|
-
!isExpanded && step.description && /* @__PURE__ */ jsxDEV2("p", {
|
|
274
|
-
className: "text-muted-foreground truncate text-sm",
|
|
275
|
-
children: step.description
|
|
276
|
-
}, undefined, false, undefined, this)
|
|
277
|
-
]
|
|
278
|
-
}, undefined, true, undefined, this),
|
|
279
|
-
step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
|
|
280
|
-
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"),
|
|
281
|
-
children: [
|
|
282
|
-
"+",
|
|
283
|
-
step.xpReward,
|
|
284
|
-
" XP"
|
|
285
|
-
]
|
|
286
|
-
}, undefined, true, undefined, this),
|
|
287
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
288
|
-
className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
|
|
289
|
-
children: "\u25BC"
|
|
290
|
-
}, undefined, false, undefined, this)
|
|
291
|
-
]
|
|
292
|
-
}, undefined, true, undefined, this),
|
|
293
|
-
isExpanded && /* @__PURE__ */ jsxDEV2("div", {
|
|
294
|
-
className: "border-t px-4 py-4",
|
|
295
|
-
children: [
|
|
296
|
-
step.description && /* @__PURE__ */ jsxDEV2("p", {
|
|
297
|
-
className: "text-muted-foreground mb-4",
|
|
298
|
-
children: step.description
|
|
299
|
-
}, undefined, false, undefined, this),
|
|
300
|
-
step.instructions && /* @__PURE__ */ jsxDEV2("div", {
|
|
301
|
-
className: "bg-muted mb-4 rounded-lg p-4",
|
|
302
|
-
children: [
|
|
303
|
-
/* @__PURE__ */ jsxDEV2("p", {
|
|
304
|
-
className: "mb-2 text-sm font-medium",
|
|
305
|
-
children: "Instructions:"
|
|
306
|
-
}, undefined, false, undefined, this),
|
|
307
|
-
/* @__PURE__ */ jsxDEV2("p", {
|
|
308
|
-
className: "text-muted-foreground text-sm",
|
|
309
|
-
children: step.instructions
|
|
310
|
-
}, undefined, false, undefined, this)
|
|
311
|
-
]
|
|
312
|
-
}, undefined, true, undefined, this),
|
|
313
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
314
|
-
className: "flex flex-wrap gap-2",
|
|
315
|
-
children: [
|
|
316
|
-
step.actionUrl && /* @__PURE__ */ jsxDEV2(Button2, {
|
|
317
|
-
variant: "outline",
|
|
318
|
-
size: "sm",
|
|
319
|
-
onClick: () => window.open(step.actionUrl, "_blank"),
|
|
320
|
-
children: step.actionLabel ?? "Try it"
|
|
321
|
-
}, undefined, false, undefined, this),
|
|
322
|
-
!isCompleted && /* @__PURE__ */ jsxDEV2(Button2, {
|
|
323
|
-
size: "sm",
|
|
324
|
-
onClick: onComplete,
|
|
325
|
-
children: "Mark as Complete"
|
|
326
|
-
}, undefined, false, undefined, this)
|
|
327
|
-
]
|
|
328
|
-
}, undefined, true, undefined, this)
|
|
329
|
-
]
|
|
330
|
-
}, undefined, true, undefined, this)
|
|
331
|
-
]
|
|
332
|
-
}, undefined, true, undefined, this);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// src/views/Steps.tsx
|
|
336
|
-
import { useState } from "react";
|
|
337
|
-
import { Progress as Progress2 } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
338
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
339
|
-
"use client";
|
|
340
|
-
function Steps({ track, progress, onStepComplete }) {
|
|
341
|
-
const [expandedStepId, setExpandedStepId] = useState(() => {
|
|
342
|
-
const firstIncomplete = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
|
|
343
|
-
return firstIncomplete?.id ?? null;
|
|
344
|
-
});
|
|
345
|
-
const completedSteps = progress.completedStepIds.length;
|
|
346
|
-
const totalSteps = track.steps.length;
|
|
347
|
-
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
348
|
-
const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
|
|
349
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
350
|
-
className: "space-y-6",
|
|
351
|
-
children: [
|
|
352
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
353
|
-
className: "space-y-2",
|
|
354
|
-
children: [
|
|
355
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
356
|
-
className: "flex items-center justify-between",
|
|
357
|
-
children: [
|
|
358
|
-
/* @__PURE__ */ jsxDEV3("h2", {
|
|
359
|
-
className: "text-xl font-bold",
|
|
360
|
-
children: "Complete Each Step"
|
|
361
|
-
}, undefined, false, undefined, this),
|
|
362
|
-
/* @__PURE__ */ jsxDEV3("span", {
|
|
363
|
-
className: "text-muted-foreground text-sm",
|
|
364
|
-
children: [
|
|
365
|
-
completedSteps,
|
|
366
|
-
" / ",
|
|
367
|
-
totalSteps,
|
|
368
|
-
" completed"
|
|
369
|
-
]
|
|
370
|
-
}, undefined, true, undefined, this)
|
|
371
|
-
]
|
|
372
|
-
}, undefined, true, undefined, this),
|
|
373
|
-
/* @__PURE__ */ jsxDEV3(Progress2, {
|
|
374
|
-
value: percentComplete,
|
|
375
|
-
className: "h-2"
|
|
376
|
-
}, undefined, false, undefined, this)
|
|
377
|
-
]
|
|
378
|
-
}, undefined, true, undefined, this),
|
|
379
|
-
/* @__PURE__ */ jsxDEV3("div", {
|
|
380
|
-
className: "space-y-3",
|
|
381
|
-
children: track.steps.map((step, index) => {
|
|
382
|
-
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
383
|
-
const isCurrent = index === currentStepIndex;
|
|
384
|
-
return /* @__PURE__ */ jsxDEV3(StepChecklist, {
|
|
385
|
-
step,
|
|
386
|
-
stepNumber: index + 1,
|
|
387
|
-
isCompleted,
|
|
388
|
-
isCurrent,
|
|
389
|
-
isExpanded: expandedStepId === step.id,
|
|
390
|
-
onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
|
|
391
|
-
onComplete: () => {
|
|
392
|
-
onStepComplete?.(step.id);
|
|
393
|
-
const nextStep = track.steps[index + 1];
|
|
394
|
-
if (nextStep && !progress.completedStepIds.includes(nextStep.id)) {
|
|
395
|
-
setExpandedStepId(nextStep.id);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}, step.id, false, undefined, this);
|
|
399
|
-
})
|
|
400
|
-
}, undefined, false, undefined, this),
|
|
401
|
-
track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsxDEV3("div", {
|
|
402
|
-
className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
|
|
403
|
-
children: /* @__PURE__ */ jsxDEV3("p", {
|
|
404
|
-
className: "text-sm",
|
|
405
|
-
children: [
|
|
406
|
-
"\uD83C\uDF81 Complete all steps to unlock:",
|
|
407
|
-
track.completionRewards.xpBonus && /* @__PURE__ */ jsxDEV3("span", {
|
|
408
|
-
className: "ml-2 font-semibold text-blue-500",
|
|
409
|
-
children: [
|
|
410
|
-
"+",
|
|
411
|
-
track.completionRewards.xpBonus,
|
|
412
|
-
" XP bonus"
|
|
413
|
-
]
|
|
414
|
-
}, undefined, true, undefined, this),
|
|
415
|
-
track.completionRewards.badgeKey && /* @__PURE__ */ jsxDEV3("span", {
|
|
416
|
-
className: "ml-2 font-semibold text-amber-500",
|
|
417
|
-
children: [
|
|
418
|
-
'+ "',
|
|
419
|
-
track.completionRewards.badgeKey,
|
|
420
|
-
'" badge'
|
|
421
|
-
]
|
|
422
|
-
}, undefined, true, undefined, this)
|
|
423
|
-
]
|
|
424
|
-
}, undefined, true, undefined, this)
|
|
425
|
-
}, undefined, false, undefined, this)
|
|
426
|
-
]
|
|
427
|
-
}, undefined, true, undefined, this);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
240
|
// src/views/Progress.tsx
|
|
241
|
+
import {
|
|
242
|
+
BadgeDisplay,
|
|
243
|
+
XpBar as XpBar2
|
|
244
|
+
} from "@contractspec/example.learning-journey-ui-shared";
|
|
431
245
|
import {
|
|
432
246
|
Card as Card2,
|
|
433
247
|
CardContent as CardContent2,
|
|
434
248
|
CardHeader as CardHeader2,
|
|
435
249
|
CardTitle as CardTitle2
|
|
436
250
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
437
|
-
import { Progress as
|
|
438
|
-
import {
|
|
439
|
-
XpBar as XpBar2,
|
|
440
|
-
BadgeDisplay
|
|
441
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
442
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
251
|
+
import { Progress as Progress2 } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
252
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
443
253
|
"use client";
|
|
444
254
|
function ProgressView({ track, progress }) {
|
|
445
255
|
const totalSteps = track.steps.length;
|
|
@@ -448,37 +258,37 @@ function ProgressView({ track, progress }) {
|
|
|
448
258
|
const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
|
|
449
259
|
const remainingSteps = totalSteps - completedSteps;
|
|
450
260
|
const estimatedMinutes = remainingSteps * 5;
|
|
451
|
-
return /* @__PURE__ */
|
|
261
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
452
262
|
className: "space-y-6",
|
|
453
263
|
children: [
|
|
454
|
-
/* @__PURE__ */
|
|
264
|
+
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
455
265
|
children: [
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
children: /* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
267
|
+
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
458
268
|
className: "flex items-center gap-2",
|
|
459
269
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
461
271
|
children: "\uD83D\uDCC8"
|
|
462
272
|
}, undefined, false, undefined, this),
|
|
463
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
464
274
|
children: "Your Progress"
|
|
465
275
|
}, undefined, false, undefined, this)
|
|
466
276
|
]
|
|
467
277
|
}, undefined, true, undefined, this)
|
|
468
278
|
}, undefined, false, undefined, this),
|
|
469
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
470
280
|
className: "space-y-6",
|
|
471
281
|
children: [
|
|
472
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
473
283
|
className: "flex items-center justify-center",
|
|
474
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
475
285
|
className: "relative flex h-40 w-40 items-center justify-center",
|
|
476
286
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ jsxDEV2("svg", {
|
|
478
288
|
className: "absolute h-full w-full -rotate-90",
|
|
479
289
|
viewBox: "0 0 100 100",
|
|
480
290
|
children: [
|
|
481
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ jsxDEV2("circle", {
|
|
482
292
|
cx: "50",
|
|
483
293
|
cy: "50",
|
|
484
294
|
r: "45",
|
|
@@ -486,7 +296,7 @@ function ProgressView({ track, progress }) {
|
|
|
486
296
|
strokeWidth: "8",
|
|
487
297
|
className: "stroke-muted"
|
|
488
298
|
}, undefined, false, undefined, this),
|
|
489
|
-
/* @__PURE__ */
|
|
299
|
+
/* @__PURE__ */ jsxDEV2("circle", {
|
|
490
300
|
cx: "50",
|
|
491
301
|
cy: "50",
|
|
492
302
|
r: "45",
|
|
@@ -498,17 +308,17 @@ function ProgressView({ track, progress }) {
|
|
|
498
308
|
}, undefined, false, undefined, this)
|
|
499
309
|
]
|
|
500
310
|
}, undefined, true, undefined, this),
|
|
501
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
502
312
|
className: "text-center",
|
|
503
313
|
children: [
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
-
className: "text-3xl
|
|
314
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
315
|
+
className: "font-bold text-3xl",
|
|
506
316
|
children: [
|
|
507
317
|
Math.round(percentComplete),
|
|
508
318
|
"%"
|
|
509
319
|
]
|
|
510
320
|
}, undefined, true, undefined, this),
|
|
511
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
512
322
|
className: "text-muted-foreground text-sm",
|
|
513
323
|
children: "Complete"
|
|
514
324
|
}, undefined, false, undefined, this)
|
|
@@ -517,43 +327,43 @@ function ProgressView({ track, progress }) {
|
|
|
517
327
|
]
|
|
518
328
|
}, undefined, true, undefined, this)
|
|
519
329
|
}, undefined, false, undefined, this),
|
|
520
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
521
331
|
className: "grid grid-cols-3 gap-4 text-center",
|
|
522
332
|
children: [
|
|
523
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
524
334
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
526
|
-
className: "
|
|
335
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
336
|
+
className: "font-bold text-2xl text-green-500",
|
|
527
337
|
children: completedSteps
|
|
528
338
|
}, undefined, false, undefined, this),
|
|
529
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
530
340
|
className: "text-muted-foreground text-sm",
|
|
531
341
|
children: "Completed"
|
|
532
342
|
}, undefined, false, undefined, this)
|
|
533
343
|
]
|
|
534
344
|
}, undefined, true, undefined, this),
|
|
535
|
-
/* @__PURE__ */
|
|
345
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
536
346
|
children: [
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
className: "
|
|
347
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
348
|
+
className: "font-bold text-2xl text-orange-500",
|
|
539
349
|
children: remainingSteps
|
|
540
350
|
}, undefined, false, undefined, this),
|
|
541
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
542
352
|
className: "text-muted-foreground text-sm",
|
|
543
353
|
children: "Remaining"
|
|
544
354
|
}, undefined, false, undefined, this)
|
|
545
355
|
]
|
|
546
356
|
}, undefined, true, undefined, this),
|
|
547
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
548
358
|
children: [
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
className: "text-2xl
|
|
359
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
360
|
+
className: "font-bold text-2xl",
|
|
551
361
|
children: [
|
|
552
362
|
estimatedMinutes,
|
|
553
363
|
"m"
|
|
554
364
|
]
|
|
555
365
|
}, undefined, true, undefined, this),
|
|
556
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
557
367
|
className: "text-muted-foreground text-sm",
|
|
558
368
|
children: "Est. Time"
|
|
559
369
|
}, undefined, false, undefined, this)
|
|
@@ -565,32 +375,32 @@ function ProgressView({ track, progress }) {
|
|
|
565
375
|
}, undefined, true, undefined, this)
|
|
566
376
|
]
|
|
567
377
|
}, undefined, true, undefined, this),
|
|
568
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
569
379
|
children: [
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
-
children: /* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
381
|
+
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
572
382
|
className: "flex items-center gap-2",
|
|
573
383
|
children: [
|
|
574
|
-
/* @__PURE__ */
|
|
384
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
575
385
|
children: "\u26A1"
|
|
576
386
|
}, undefined, false, undefined, this),
|
|
577
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
578
388
|
children: "Experience Points"
|
|
579
389
|
}, undefined, false, undefined, this)
|
|
580
390
|
]
|
|
581
391
|
}, undefined, true, undefined, this)
|
|
582
392
|
}, undefined, false, undefined, this),
|
|
583
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
584
394
|
className: "space-y-4",
|
|
585
395
|
children: [
|
|
586
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
587
397
|
className: "flex items-baseline gap-2",
|
|
588
398
|
children: [
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
className: "
|
|
399
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
400
|
+
className: "font-bold text-3xl text-blue-500",
|
|
591
401
|
children: progress.xpEarned
|
|
592
402
|
}, undefined, false, undefined, this),
|
|
593
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
594
404
|
className: "text-muted-foreground",
|
|
595
405
|
children: [
|
|
596
406
|
"/ ",
|
|
@@ -600,7 +410,7 @@ function ProgressView({ track, progress }) {
|
|
|
600
410
|
}, undefined, true, undefined, this)
|
|
601
411
|
]
|
|
602
412
|
}, undefined, true, undefined, this),
|
|
603
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ jsxDEV2(XpBar2, {
|
|
604
414
|
current: progress.xpEarned,
|
|
605
415
|
max: totalXp,
|
|
606
416
|
showLabel: false,
|
|
@@ -610,28 +420,28 @@ function ProgressView({ track, progress }) {
|
|
|
610
420
|
}, undefined, true, undefined, this)
|
|
611
421
|
]
|
|
612
422
|
}, undefined, true, undefined, this),
|
|
613
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
614
424
|
children: [
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
-
children: /* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
426
|
+
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
617
427
|
className: "flex items-center gap-2",
|
|
618
428
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
620
430
|
children: "\uD83C\uDFC5"
|
|
621
431
|
}, undefined, false, undefined, this),
|
|
622
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
623
433
|
children: "Achievements"
|
|
624
434
|
}, undefined, false, undefined, this)
|
|
625
435
|
]
|
|
626
436
|
}, undefined, true, undefined, this)
|
|
627
437
|
}, undefined, false, undefined, this),
|
|
628
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
629
439
|
children: [
|
|
630
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ jsxDEV2(BadgeDisplay, {
|
|
631
441
|
badges: progress.badges,
|
|
632
442
|
size: "lg"
|
|
633
443
|
}, undefined, false, undefined, this),
|
|
634
|
-
progress.badges.length === 0 && track.completionRewards?.badgeKey && /* @__PURE__ */
|
|
444
|
+
progress.badges.length === 0 && track.completionRewards?.badgeKey && /* @__PURE__ */ jsxDEV2("p", {
|
|
635
445
|
className: "text-muted-foreground text-sm",
|
|
636
446
|
children: [
|
|
637
447
|
'Complete all steps to earn the "',
|
|
@@ -643,34 +453,34 @@ function ProgressView({ track, progress }) {
|
|
|
643
453
|
}, undefined, true, undefined, this)
|
|
644
454
|
]
|
|
645
455
|
}, undefined, true, undefined, this),
|
|
646
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ jsxDEV2(Card2, {
|
|
647
457
|
children: [
|
|
648
|
-
/* @__PURE__ */
|
|
649
|
-
children: /* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ jsxDEV2(CardHeader2, {
|
|
459
|
+
children: /* @__PURE__ */ jsxDEV2(CardTitle2, {
|
|
650
460
|
className: "flex items-center gap-2",
|
|
651
461
|
children: [
|
|
652
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
653
463
|
children: "\uD83D\uDCCB"
|
|
654
464
|
}, undefined, false, undefined, this),
|
|
655
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
656
466
|
children: "Step Details"
|
|
657
467
|
}, undefined, false, undefined, this)
|
|
658
468
|
]
|
|
659
469
|
}, undefined, true, undefined, this)
|
|
660
470
|
}, undefined, false, undefined, this),
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
children: /* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsxDEV2(CardContent2, {
|
|
472
|
+
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
663
473
|
className: "space-y-3",
|
|
664
474
|
children: track.steps.map((step, index) => {
|
|
665
475
|
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
666
476
|
const stepProgress = isCompleted ? 100 : 0;
|
|
667
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
668
478
|
className: "space-y-1",
|
|
669
479
|
children: [
|
|
670
|
-
/* @__PURE__ */
|
|
480
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
671
481
|
className: "flex items-center justify-between text-sm",
|
|
672
482
|
children: [
|
|
673
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
674
484
|
className: isCompleted ? "text-green-500" : "text-foreground",
|
|
675
485
|
children: [
|
|
676
486
|
index + 1,
|
|
@@ -678,13 +488,13 @@ function ProgressView({ track, progress }) {
|
|
|
678
488
|
step.title
|
|
679
489
|
]
|
|
680
490
|
}, undefined, true, undefined, this),
|
|
681
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ jsxDEV2("span", {
|
|
682
492
|
className: isCompleted ? "text-green-500" : "text-muted-foreground",
|
|
683
493
|
children: isCompleted ? "\u2713" : "Pending"
|
|
684
494
|
}, undefined, false, undefined, this)
|
|
685
495
|
]
|
|
686
496
|
}, undefined, true, undefined, this),
|
|
687
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ jsxDEV2(Progress2, {
|
|
688
498
|
value: stepProgress,
|
|
689
499
|
className: "h-1"
|
|
690
500
|
}, undefined, false, undefined, this)
|
|
@@ -698,6 +508,196 @@ function ProgressView({ track, progress }) {
|
|
|
698
508
|
]
|
|
699
509
|
}, undefined, true, undefined, this);
|
|
700
510
|
}
|
|
511
|
+
// src/components/StepChecklist.tsx
|
|
512
|
+
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
513
|
+
import { cn } from "@contractspec/lib.ui-kit-core";
|
|
514
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
515
|
+
"use client";
|
|
516
|
+
function StepChecklist({
|
|
517
|
+
step,
|
|
518
|
+
stepNumber,
|
|
519
|
+
isCompleted,
|
|
520
|
+
isCurrent,
|
|
521
|
+
isExpanded,
|
|
522
|
+
onToggle,
|
|
523
|
+
onComplete
|
|
524
|
+
}) {
|
|
525
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
526
|
+
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"),
|
|
527
|
+
children: [
|
|
528
|
+
/* @__PURE__ */ jsxDEV3("button", {
|
|
529
|
+
type: "button",
|
|
530
|
+
className: "flex w-full items-center gap-4 p-4 text-left",
|
|
531
|
+
onClick: onToggle,
|
|
532
|
+
children: [
|
|
533
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
534
|
+
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"),
|
|
535
|
+
children: isCompleted ? "\u2713" : stepNumber
|
|
536
|
+
}, undefined, false, undefined, this),
|
|
537
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
538
|
+
className: "min-w-0 flex-1",
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ jsxDEV3("h4", {
|
|
541
|
+
className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
542
|
+
children: step.title
|
|
543
|
+
}, undefined, false, undefined, this),
|
|
544
|
+
!isExpanded && step.description && /* @__PURE__ */ jsxDEV3("p", {
|
|
545
|
+
className: "truncate text-muted-foreground text-sm",
|
|
546
|
+
children: step.description
|
|
547
|
+
}, undefined, false, undefined, this)
|
|
548
|
+
]
|
|
549
|
+
}, undefined, true, undefined, this),
|
|
550
|
+
step.xpReward && /* @__PURE__ */ jsxDEV3("span", {
|
|
551
|
+
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"),
|
|
552
|
+
children: [
|
|
553
|
+
"+",
|
|
554
|
+
step.xpReward,
|
|
555
|
+
" XP"
|
|
556
|
+
]
|
|
557
|
+
}, undefined, true, undefined, this),
|
|
558
|
+
/* @__PURE__ */ jsxDEV3("span", {
|
|
559
|
+
className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
|
|
560
|
+
children: "\u25BC"
|
|
561
|
+
}, undefined, false, undefined, this)
|
|
562
|
+
]
|
|
563
|
+
}, undefined, true, undefined, this),
|
|
564
|
+
isExpanded && /* @__PURE__ */ jsxDEV3("div", {
|
|
565
|
+
className: "border-t px-4 py-4",
|
|
566
|
+
children: [
|
|
567
|
+
step.description && /* @__PURE__ */ jsxDEV3("p", {
|
|
568
|
+
className: "mb-4 text-muted-foreground",
|
|
569
|
+
children: step.description
|
|
570
|
+
}, undefined, false, undefined, this),
|
|
571
|
+
step.instructions && /* @__PURE__ */ jsxDEV3("div", {
|
|
572
|
+
className: "mb-4 rounded-lg bg-muted p-4",
|
|
573
|
+
children: [
|
|
574
|
+
/* @__PURE__ */ jsxDEV3("p", {
|
|
575
|
+
className: "mb-2 font-medium text-sm",
|
|
576
|
+
children: "Instructions:"
|
|
577
|
+
}, undefined, false, undefined, this),
|
|
578
|
+
/* @__PURE__ */ jsxDEV3("p", {
|
|
579
|
+
className: "text-muted-foreground text-sm",
|
|
580
|
+
children: step.instructions
|
|
581
|
+
}, undefined, false, undefined, this)
|
|
582
|
+
]
|
|
583
|
+
}, undefined, true, undefined, this),
|
|
584
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
585
|
+
className: "flex flex-wrap gap-2",
|
|
586
|
+
children: [
|
|
587
|
+
step.actionUrl && /* @__PURE__ */ jsxDEV3(Button2, {
|
|
588
|
+
variant: "outline",
|
|
589
|
+
size: "sm",
|
|
590
|
+
onClick: () => window.open(step.actionUrl, "_blank"),
|
|
591
|
+
children: step.actionLabel ?? "Try it"
|
|
592
|
+
}, undefined, false, undefined, this),
|
|
593
|
+
!isCompleted && /* @__PURE__ */ jsxDEV3(Button2, {
|
|
594
|
+
size: "sm",
|
|
595
|
+
onClick: onComplete,
|
|
596
|
+
children: "Mark as Complete"
|
|
597
|
+
}, undefined, false, undefined, this)
|
|
598
|
+
]
|
|
599
|
+
}, undefined, true, undefined, this)
|
|
600
|
+
]
|
|
601
|
+
}, undefined, true, undefined, this)
|
|
602
|
+
]
|
|
603
|
+
}, undefined, true, undefined, this);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// src/views/Steps.tsx
|
|
607
|
+
import { Progress as Progress3 } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
608
|
+
import { useState } from "react";
|
|
609
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
610
|
+
"use client";
|
|
611
|
+
function Steps({ track, progress, onStepComplete }) {
|
|
612
|
+
const [expandedStepId, setExpandedStepId] = useState(() => {
|
|
613
|
+
const firstIncomplete = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
|
|
614
|
+
return firstIncomplete?.id ?? null;
|
|
615
|
+
});
|
|
616
|
+
const completedSteps = progress.completedStepIds.length;
|
|
617
|
+
const totalSteps = track.steps.length;
|
|
618
|
+
const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
|
|
619
|
+
const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
|
|
620
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
621
|
+
className: "space-y-6",
|
|
622
|
+
children: [
|
|
623
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
624
|
+
className: "space-y-2",
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
627
|
+
className: "flex items-center justify-between",
|
|
628
|
+
children: [
|
|
629
|
+
/* @__PURE__ */ jsxDEV4("h2", {
|
|
630
|
+
className: "font-bold text-xl",
|
|
631
|
+
children: "Complete Each Step"
|
|
632
|
+
}, undefined, false, undefined, this),
|
|
633
|
+
/* @__PURE__ */ jsxDEV4("span", {
|
|
634
|
+
className: "text-muted-foreground text-sm",
|
|
635
|
+
children: [
|
|
636
|
+
completedSteps,
|
|
637
|
+
" / ",
|
|
638
|
+
totalSteps,
|
|
639
|
+
" completed"
|
|
640
|
+
]
|
|
641
|
+
}, undefined, true, undefined, this)
|
|
642
|
+
]
|
|
643
|
+
}, undefined, true, undefined, this),
|
|
644
|
+
/* @__PURE__ */ jsxDEV4(Progress3, {
|
|
645
|
+
value: percentComplete,
|
|
646
|
+
className: "h-2"
|
|
647
|
+
}, undefined, false, undefined, this)
|
|
648
|
+
]
|
|
649
|
+
}, undefined, true, undefined, this),
|
|
650
|
+
/* @__PURE__ */ jsxDEV4("div", {
|
|
651
|
+
className: "space-y-3",
|
|
652
|
+
children: track.steps.map((step, index) => {
|
|
653
|
+
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
654
|
+
const isCurrent = index === currentStepIndex;
|
|
655
|
+
return /* @__PURE__ */ jsxDEV4(StepChecklist, {
|
|
656
|
+
step,
|
|
657
|
+
stepNumber: index + 1,
|
|
658
|
+
isCompleted,
|
|
659
|
+
isCurrent,
|
|
660
|
+
isExpanded: expandedStepId === step.id,
|
|
661
|
+
onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
|
|
662
|
+
onComplete: () => {
|
|
663
|
+
onStepComplete?.(step.id);
|
|
664
|
+
const nextStep = track.steps[index + 1];
|
|
665
|
+
if (nextStep && !progress.completedStepIds.includes(nextStep.id)) {
|
|
666
|
+
setExpandedStepId(nextStep.id);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}, step.id, false, undefined, this);
|
|
670
|
+
})
|
|
671
|
+
}, undefined, false, undefined, this),
|
|
672
|
+
track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsxDEV4("div", {
|
|
673
|
+
className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
|
|
674
|
+
children: /* @__PURE__ */ jsxDEV4("p", {
|
|
675
|
+
className: "text-sm",
|
|
676
|
+
children: [
|
|
677
|
+
"\uD83C\uDF81 Complete all steps to unlock:",
|
|
678
|
+
track.completionRewards.xpBonus && /* @__PURE__ */ jsxDEV4("span", {
|
|
679
|
+
className: "ml-2 font-semibold text-blue-500",
|
|
680
|
+
children: [
|
|
681
|
+
"+",
|
|
682
|
+
track.completionRewards.xpBonus,
|
|
683
|
+
" XP bonus"
|
|
684
|
+
]
|
|
685
|
+
}, undefined, true, undefined, this),
|
|
686
|
+
track.completionRewards.badgeKey && /* @__PURE__ */ jsxDEV4("span", {
|
|
687
|
+
className: "ml-2 font-semibold text-amber-500",
|
|
688
|
+
children: [
|
|
689
|
+
'+ "',
|
|
690
|
+
track.completionRewards.badgeKey,
|
|
691
|
+
'" badge'
|
|
692
|
+
]
|
|
693
|
+
}, undefined, true, undefined, this)
|
|
694
|
+
]
|
|
695
|
+
}, undefined, true, undefined, this)
|
|
696
|
+
}, undefined, false, undefined, this)
|
|
697
|
+
]
|
|
698
|
+
}, undefined, true, undefined, this);
|
|
699
|
+
}
|
|
700
|
+
|
|
701
701
|
// src/components/JourneyMap.tsx
|
|
702
702
|
import { cn as cn2 } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
703
703
|
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
@@ -739,7 +739,7 @@ function JourneyMap({
|
|
|
739
739
|
/* @__PURE__ */ jsxDEV5("div", {
|
|
740
740
|
className: "text-center",
|
|
741
741
|
children: /* @__PURE__ */ jsxDEV5("p", {
|
|
742
|
-
className: cn2("max-w-[100px] truncate text-xs
|
|
742
|
+
className: cn2("max-w-[100px] truncate font-medium text-xs", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
743
743
|
children: step.title
|
|
744
744
|
}, undefined, false, undefined, this)
|
|
745
745
|
}, undefined, false, undefined, this)
|
|
@@ -773,7 +773,7 @@ function Timeline({ track, progress }) {
|
|
|
773
773
|
className: "text-center",
|
|
774
774
|
children: [
|
|
775
775
|
/* @__PURE__ */ jsxDEV6("h2", {
|
|
776
|
-
className: "text-xl
|
|
776
|
+
className: "font-bold text-xl",
|
|
777
777
|
children: "Your Learning Journey"
|
|
778
778
|
}, undefined, false, undefined, this),
|
|
779
779
|
/* @__PURE__ */ jsxDEV6("p", {
|
|
@@ -826,7 +826,7 @@ function Timeline({ track, progress }) {
|
|
|
826
826
|
className: "relative",
|
|
827
827
|
children: [
|
|
828
828
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
829
|
-
className: "
|
|
829
|
+
className: "absolute top-0 left-4 h-full w-0.5 bg-border"
|
|
830
830
|
}, undefined, false, undefined, this),
|
|
831
831
|
/* @__PURE__ */ jsxDEV6("div", {
|
|
832
832
|
className: "space-y-6",
|
|
@@ -859,19 +859,19 @@ function Timeline({ track, progress }) {
|
|
|
859
859
|
children: step.title
|
|
860
860
|
}, undefined, false, undefined, this),
|
|
861
861
|
/* @__PURE__ */ jsxDEV6("span", {
|
|
862
|
-
className: "bg-muted
|
|
862
|
+
className: "rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",
|
|
863
863
|
children: surface
|
|
864
864
|
}, undefined, false, undefined, this)
|
|
865
865
|
]
|
|
866
866
|
}, undefined, true, undefined, this),
|
|
867
867
|
/* @__PURE__ */ jsxDEV6("p", {
|
|
868
|
-
className: "text-muted-foreground
|
|
868
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
869
869
|
children: step.description
|
|
870
870
|
}, undefined, false, undefined, this)
|
|
871
871
|
]
|
|
872
872
|
}, undefined, true, undefined, this),
|
|
873
873
|
step.xpReward && /* @__PURE__ */ jsxDEV6("span", {
|
|
874
|
-
className: `shrink-0 rounded-full px-2 py-1 text-xs
|
|
874
|
+
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"}`,
|
|
875
875
|
children: [
|
|
876
876
|
"+",
|
|
877
877
|
step.xpReward,
|
|
@@ -910,12 +910,12 @@ function Timeline({ track, progress }) {
|
|
|
910
910
|
}
|
|
911
911
|
|
|
912
912
|
// src/OnboardingMiniApp.tsx
|
|
913
|
-
import { useState as useState2, useCallback } from "react";
|
|
914
|
-
import { Card as Card4, CardContent as CardContent4 } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
915
913
|
import {
|
|
916
|
-
|
|
917
|
-
|
|
914
|
+
useLearningProgress,
|
|
915
|
+
ViewTabs
|
|
918
916
|
} from "@contractspec/example.learning-journey-ui-shared";
|
|
917
|
+
import { Card as Card4, CardContent as CardContent4 } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
918
|
+
import { useCallback, useState as useState2 } from "react";
|
|
919
919
|
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
920
920
|
"use client";
|
|
921
921
|
function OnboardingMiniApp({
|