@contractspec/example.learning-journey-ui-onboarding 3.7.6 → 3.7.10

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