@lssm/example.learning-journey-registry 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217073102

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 (112) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +410 -64
  2. package/.turbo/turbo-build.log +55 -65
  3. package/CHANGELOG.md +14 -12
  4. package/dist/api.js +170 -1
  5. package/dist/docs/index.js +1 -1
  6. package/dist/docs/learning-journey-registry.docblock.js +38 -1
  7. package/dist/example.js +34 -1
  8. package/dist/examples/learning-journey-ambient-coach/src/track.js +41 -0
  9. package/dist/examples/learning-journey-crm-onboarding/dist/track.js +98 -0
  10. package/dist/examples/learning-journey-duo-drills/src/track.js +65 -0
  11. package/dist/examples/learning-journey-platform-tour/dist/track.js +105 -0
  12. package/dist/examples/learning-journey-quest-challenges/src/track.js +35 -0
  13. package/dist/examples/learning-journey-studio-onboarding/dist/track.js +90 -0
  14. package/dist/examples/learning-journey-ui-coaching/src/CoachingMiniApp.js +64 -0
  15. package/dist/examples/learning-journey-ui-coaching/src/components/EngagementMeter.js +107 -0
  16. package/dist/examples/learning-journey-ui-coaching/src/components/TipCard.js +75 -0
  17. package/dist/examples/learning-journey-ui-coaching/src/components/TipFeed.js +65 -0
  18. package/dist/examples/learning-journey-ui-coaching/src/components/index.js +3 -0
  19. package/dist/examples/learning-journey-ui-coaching/src/docs/index.js +1 -0
  20. package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js +20 -0
  21. package/dist/examples/learning-journey-ui-coaching/src/index.js +11 -0
  22. package/dist/examples/learning-journey-ui-coaching/src/views/Overview.js +152 -0
  23. package/dist/examples/learning-journey-ui-coaching/src/views/Progress.js +117 -0
  24. package/dist/examples/learning-journey-ui-coaching/src/views/Steps.js +68 -0
  25. package/dist/examples/learning-journey-ui-coaching/src/views/Timeline.js +112 -0
  26. package/dist/examples/learning-journey-ui-coaching/src/views/index.js +4 -0
  27. package/dist/examples/learning-journey-ui-gamified/src/GamifiedMiniApp.js +64 -0
  28. package/dist/examples/learning-journey-ui-gamified/src/components/DayCalendar.js +32 -0
  29. package/dist/examples/learning-journey-ui-gamified/src/components/FlashCard.js +79 -0
  30. package/dist/examples/learning-journey-ui-gamified/src/components/MasteryRing.js +81 -0
  31. package/dist/examples/learning-journey-ui-gamified/src/components/index.js +3 -0
  32. package/dist/examples/learning-journey-ui-gamified/src/docs/index.js +1 -0
  33. package/dist/examples/learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.js +20 -0
  34. package/dist/examples/learning-journey-ui-gamified/src/index.js +11 -0
  35. package/dist/examples/learning-journey-ui-gamified/src/views/Overview.js +163 -0
  36. package/dist/examples/learning-journey-ui-gamified/src/views/Progress.js +144 -0
  37. package/dist/examples/learning-journey-ui-gamified/src/views/Steps.js +55 -0
  38. package/dist/examples/learning-journey-ui-gamified/src/views/Timeline.js +132 -0
  39. package/dist/examples/learning-journey-ui-gamified/src/views/index.js +4 -0
  40. package/dist/examples/learning-journey-ui-onboarding/src/OnboardingMiniApp.js +64 -0
  41. package/dist/examples/learning-journey-ui-onboarding/src/components/CodeSnippet.js +4 -0
  42. package/dist/examples/learning-journey-ui-onboarding/src/components/JourneyMap.js +48 -0
  43. package/dist/examples/learning-journey-ui-onboarding/src/components/StepChecklist.js +79 -0
  44. package/dist/examples/learning-journey-ui-onboarding/src/components/index.js +3 -0
  45. package/dist/examples/learning-journey-ui-onboarding/src/docs/index.js +1 -0
  46. package/dist/examples/learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.js +20 -0
  47. package/dist/examples/learning-journey-ui-onboarding/src/index.js +10 -0
  48. package/dist/examples/learning-journey-ui-onboarding/src/views/Overview.js +180 -0
  49. package/dist/examples/learning-journey-ui-onboarding/src/views/Progress.js +162 -0
  50. package/dist/examples/learning-journey-ui-onboarding/src/views/Steps.js +91 -0
  51. package/dist/examples/learning-journey-ui-onboarding/src/views/Timeline.js +97 -0
  52. package/dist/examples/learning-journey-ui-onboarding/src/views/index.js +4 -0
  53. package/dist/examples/learning-journey-ui-shared/src/components/BadgeDisplay.js +44 -0
  54. package/dist/examples/learning-journey-ui-shared/src/components/StreakCounter.js +45 -0
  55. package/dist/examples/learning-journey-ui-shared/src/components/ViewTabs.js +48 -0
  56. package/dist/examples/learning-journey-ui-shared/src/components/XpBar.js +46 -0
  57. package/dist/examples/learning-journey-ui-shared/src/components/index.js +4 -0
  58. package/dist/examples/learning-journey-ui-shared/src/docs/index.js +1 -0
  59. package/dist/examples/learning-journey-ui-shared/src/docs/learning-journey-ui-shared.docblock.js +20 -0
  60. package/dist/examples/learning-journey-ui-shared/src/hooks/index.js +1 -0
  61. package/dist/examples/learning-journey-ui-shared/src/hooks/useLearningProgress.js +73 -0
  62. package/dist/examples/learning-journey-ui-shared/src/index.js +8 -0
  63. package/dist/index.js +13 -1
  64. package/dist/learning-journey-registry.feature.js +66 -1
  65. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -76
  66. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -350
  67. package/dist/libs/contracts/dist/docs/index.js +29 -1
  68. package/dist/libs/contracts/dist/docs/presentations.js +71 -1
  69. package/dist/libs/contracts/dist/docs/registry.js +44 -1
  70. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -383
  71. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -68
  72. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -140
  73. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -86
  74. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -1
  75. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +24 -2
  76. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +21 -2
  77. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -213
  78. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +73 -5
  79. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -1
  80. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -1
  81. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -262
  82. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -1
  83. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +24 -2
  84. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +23 -2
  85. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +25 -16
  86. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -1
  87. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +22 -2
  88. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +40 -36
  89. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -1
  90. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +23 -2
  91. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +36 -3
  92. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -1
  93. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +36 -3
  94. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -1
  95. package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
  96. package/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
  97. package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
  98. package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
  99. package/dist/libs/ui-kit-core/dist/utils.js +10 -0
  100. package/dist/libs/ui-kit-web/dist/ui/card.js +36 -0
  101. package/dist/libs/ui-kit-web/dist/ui/progress.js +23 -0
  102. package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
  103. package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
  104. package/dist/presentations/index.js +64 -1
  105. package/dist/progress-store.js +30 -1
  106. package/dist/tracks.d.ts +1 -1
  107. package/dist/tracks.js +47 -1
  108. package/dist/ui/LearningMiniApp.d.ts +0 -1
  109. package/dist/ui/LearningMiniApp.js +82 -1
  110. package/dist/ui/index.js +3 -1
  111. package/package.json +16 -14
  112. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,81 @@
1
+ 'use client';
2
+
3
+ import { cn } from "../../../../libs/ui-kit-web/dist/ui/utils.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+
6
+ //#region ../learning-journey-ui-gamified/src/components/MasteryRing.tsx
7
+ const sizeStyles = {
8
+ sm: {
9
+ container: "h-16 w-16",
10
+ text: "text-xs",
11
+ ring: 48,
12
+ stroke: 4
13
+ },
14
+ md: {
15
+ container: "h-24 w-24",
16
+ text: "text-sm",
17
+ ring: 72,
18
+ stroke: 6
19
+ },
20
+ lg: {
21
+ container: "h-32 w-32",
22
+ text: "text-base",
23
+ ring: 96,
24
+ stroke: 8
25
+ }
26
+ };
27
+ const colorStyles = {
28
+ green: "stroke-green-500",
29
+ blue: "stroke-blue-500",
30
+ violet: "stroke-violet-500",
31
+ orange: "stroke-orange-500"
32
+ };
33
+ function MasteryRing({ label, percentage, size = "md", color = "violet" }) {
34
+ const styles = sizeStyles[size];
35
+ const radius = (styles.ring - styles.stroke) / 2;
36
+ const circumference = 2 * Math.PI * radius;
37
+ const strokeDashoffset = circumference - percentage / 100 * circumference;
38
+ return /* @__PURE__ */ jsxs("div", {
39
+ className: cn("relative flex flex-col items-center gap-1", styles.container),
40
+ children: [
41
+ /* @__PURE__ */ jsxs("svg", {
42
+ className: "absolute -rotate-90",
43
+ width: styles.ring,
44
+ height: styles.ring,
45
+ viewBox: `0 0 ${styles.ring} ${styles.ring}`,
46
+ children: [/* @__PURE__ */ jsx("circle", {
47
+ cx: styles.ring / 2,
48
+ cy: styles.ring / 2,
49
+ r: radius,
50
+ fill: "none",
51
+ strokeWidth: styles.stroke,
52
+ className: "stroke-muted"
53
+ }), /* @__PURE__ */ jsx("circle", {
54
+ cx: styles.ring / 2,
55
+ cy: styles.ring / 2,
56
+ r: radius,
57
+ fill: "none",
58
+ strokeWidth: styles.stroke,
59
+ strokeLinecap: "round",
60
+ strokeDasharray: circumference,
61
+ strokeDashoffset,
62
+ className: cn("transition-all duration-500", colorStyles[color])
63
+ })]
64
+ }),
65
+ /* @__PURE__ */ jsx("div", {
66
+ className: "flex h-full flex-col items-center justify-center",
67
+ children: /* @__PURE__ */ jsxs("span", {
68
+ className: cn("font-bold", styles.text),
69
+ children: [Math.round(percentage), "%"]
70
+ })
71
+ }),
72
+ /* @__PURE__ */ jsx("span", {
73
+ className: cn("text-muted-foreground mt-1 truncate", styles.text),
74
+ children: label
75
+ })
76
+ ]
77
+ });
78
+ }
79
+
80
+ //#endregion
81
+ export { MasteryRing };
@@ -0,0 +1,3 @@
1
+ import { FlashCard } from "./FlashCard.js";
2
+ import { MasteryRing } from "./MasteryRing.js";
3
+ import { DayCalendar } from "./DayCalendar.js";
@@ -0,0 +1 @@
1
+ import "./learning-journey-ui-gamified.docblock.js";
@@ -0,0 +1,20 @@
1
+ import { registerDocBlocks } from "../../../../libs/contracts/dist/docs/registry.js";
2
+ import "../../../../libs/contracts/dist/docs/index.js";
3
+
4
+ //#region ../learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.ts
5
+ registerDocBlocks([{
6
+ id: "docs.examples.learning-journey-ui-gamified",
7
+ title: "Learning Journey UI — Gamified",
8
+ summary: "UI mini-app components for gamified learning: flashcards, mastery, streak/calendar.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/examples/learning-journey-ui-gamified",
12
+ tags: [
13
+ "learning",
14
+ "ui",
15
+ "gamified"
16
+ ],
17
+ body: `## Includes\n- Gamified mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: flash card, mastery ring, day calendar\n\n## Notes\n- Compose with design system components.\n- Respect prefers-reduced-motion; keep tap targets large.`
18
+ }]);
19
+
20
+ //#endregion
@@ -0,0 +1,11 @@
1
+ import { Overview } from "./views/Overview.js";
2
+ import { FlashCard } from "./components/FlashCard.js";
3
+ import { Steps } from "./views/Steps.js";
4
+ import { MasteryRing } from "./components/MasteryRing.js";
5
+ import { Progress } from "./views/Progress.js";
6
+ import { DayCalendar } from "./components/DayCalendar.js";
7
+ import { Timeline } from "./views/Timeline.js";
8
+ import { GamifiedMiniApp } from "./GamifiedMiniApp.js";
9
+ import "./views/index.js";
10
+ import "./components/index.js";
11
+ import "./docs/index.js";
@@ -0,0 +1,163 @@
1
+ 'use client';
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { XpBar } from "../../../learning-journey-ui-shared/src/components/XpBar.js";
5
+ import { StreakCounter } from "../../../learning-journey-ui-shared/src/components/StreakCounter.js";
6
+ import { BadgeDisplay } from "../../../learning-journey-ui-shared/src/components/BadgeDisplay.js";
7
+ import { Button$1 } from "../../../../libs/design-system/dist/components/atoms/Button.js";
8
+ import "../../../learning-journey-ui-shared/src/index.js";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+
11
+ //#region ../learning-journey-ui-gamified/src/views/Overview.tsx
12
+ function Overview({ track, progress, onStart }) {
13
+ const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
14
+ const completedSteps = progress.completedStepIds.length;
15
+ const totalSteps = track.steps.length;
16
+ const isComplete = completedSteps === totalSteps;
17
+ return /* @__PURE__ */ jsxs("div", {
18
+ className: "space-y-6",
19
+ children: [
20
+ /* @__PURE__ */ jsx(Card, {
21
+ className: "overflow-hidden bg-gradient-to-br from-violet-500/10 via-purple-500/10 to-fuchsia-500/10",
22
+ children: /* @__PURE__ */ jsx(CardContent, {
23
+ className: "p-6",
24
+ children: /* @__PURE__ */ jsxs("div", {
25
+ className: "flex flex-col items-center gap-4 text-center md:flex-row md:text-left",
26
+ children: [
27
+ /* @__PURE__ */ jsx("div", {
28
+ className: "flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-violet-500 to-purple-600 text-4xl shadow-lg",
29
+ children: isComplete ? "🏆" : "🎯"
30
+ }),
31
+ /* @__PURE__ */ jsxs("div", {
32
+ className: "flex-1",
33
+ children: [/* @__PURE__ */ jsx("h1", {
34
+ className: "text-2xl font-bold",
35
+ children: track.name
36
+ }), /* @__PURE__ */ jsx("p", {
37
+ className: "text-muted-foreground mt-1",
38
+ children: track.description
39
+ })]
40
+ }),
41
+ /* @__PURE__ */ jsx("div", {
42
+ className: "flex items-center gap-3",
43
+ children: /* @__PURE__ */ jsx(StreakCounter, {
44
+ days: progress.streakDays,
45
+ size: "lg"
46
+ })
47
+ })
48
+ ]
49
+ })
50
+ })
51
+ }),
52
+ /* @__PURE__ */ jsxs("div", {
53
+ className: "grid gap-4 md:grid-cols-3",
54
+ children: [
55
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
56
+ className: "pb-2",
57
+ children: /* @__PURE__ */ jsx(CardTitle, {
58
+ className: "text-muted-foreground text-sm font-medium",
59
+ children: "XP Progress"
60
+ })
61
+ }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
62
+ className: "text-3xl font-bold text-violet-500",
63
+ children: progress.xpEarned.toLocaleString()
64
+ }), /* @__PURE__ */ jsx(XpBar, {
65
+ current: progress.xpEarned,
66
+ max: totalXp,
67
+ showLabel: false,
68
+ size: "sm"
69
+ })] })] }),
70
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
71
+ className: "pb-2",
72
+ children: /* @__PURE__ */ jsx(CardTitle, {
73
+ className: "text-muted-foreground text-sm font-medium",
74
+ children: "Steps Completed"
75
+ })
76
+ }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsxs("div", {
77
+ className: "text-3xl font-bold",
78
+ children: [
79
+ completedSteps,
80
+ " ",
81
+ /* @__PURE__ */ jsxs("span", {
82
+ className: "text-muted-foreground text-lg",
83
+ children: ["/ ", totalSteps]
84
+ })
85
+ ]
86
+ }), /* @__PURE__ */ jsx("div", {
87
+ className: "bg-muted mt-2 h-2 w-full overflow-hidden rounded-full",
88
+ children: /* @__PURE__ */ jsx("div", {
89
+ className: "h-full bg-green-500 transition-all duration-500",
90
+ style: { width: `${completedSteps / totalSteps * 100}%` }
91
+ })
92
+ })] })] }),
93
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
94
+ className: "pb-2",
95
+ children: /* @__PURE__ */ jsx(CardTitle, {
96
+ className: "text-muted-foreground text-sm font-medium",
97
+ children: "Badges Earned"
98
+ })
99
+ }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(BadgeDisplay, {
100
+ badges: progress.badges,
101
+ size: "lg"
102
+ }) })] })
103
+ ]
104
+ }),
105
+ !isComplete && /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
106
+ className: "flex items-center gap-2",
107
+ children: [/* @__PURE__ */ jsx("span", { children: "🎯" }), /* @__PURE__ */ jsx("span", { children: "Next Challenge" })]
108
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: (() => {
109
+ const nextStep = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
110
+ if (!nextStep) return null;
111
+ return /* @__PURE__ */ jsxs("div", {
112
+ className: "flex items-center justify-between gap-4",
113
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
114
+ className: "font-semibold",
115
+ children: nextStep.title
116
+ }), /* @__PURE__ */ jsx("p", {
117
+ className: "text-muted-foreground text-sm",
118
+ children: nextStep.description
119
+ })] }), /* @__PURE__ */ jsxs("div", {
120
+ className: "flex items-center gap-3",
121
+ children: [nextStep.xpReward && /* @__PURE__ */ jsxs("span", {
122
+ className: "rounded-full bg-green-500/10 px-3 py-1 text-sm font-semibold text-green-500",
123
+ children: [
124
+ "+",
125
+ nextStep.xpReward,
126
+ " XP"
127
+ ]
128
+ }), /* @__PURE__ */ jsx(Button$1, {
129
+ onClick: onStart,
130
+ children: "Start"
131
+ })]
132
+ })]
133
+ });
134
+ })() })] }),
135
+ isComplete && /* @__PURE__ */ jsx(Card, {
136
+ className: "border-green-500/50 bg-green-500/5",
137
+ children: /* @__PURE__ */ jsxs(CardContent, {
138
+ className: "flex items-center gap-4 p-6",
139
+ children: [/* @__PURE__ */ jsx("div", {
140
+ className: "text-4xl",
141
+ children: "🎉"
142
+ }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
143
+ className: "text-lg font-semibold text-green-500",
144
+ children: "Track Complete!"
145
+ }), /* @__PURE__ */ jsxs("p", {
146
+ className: "text-muted-foreground",
147
+ children: [
148
+ "You've mastered all ",
149
+ totalSteps,
150
+ " challenges and earned",
151
+ " ",
152
+ progress.xpEarned,
153
+ " XP."
154
+ ]
155
+ })] })]
156
+ })
157
+ })
158
+ ]
159
+ });
160
+ }
161
+
162
+ //#endregion
163
+ export { Overview };
@@ -0,0 +1,144 @@
1
+ 'use client';
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { XpBar } from "../../../learning-journey-ui-shared/src/components/XpBar.js";
5
+ import { BadgeDisplay } from "../../../learning-journey-ui-shared/src/components/BadgeDisplay.js";
6
+ import "../../../learning-journey-ui-shared/src/index.js";
7
+ import { MasteryRing } from "../components/MasteryRing.js";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region ../learning-journey-ui-gamified/src/views/Progress.tsx
11
+ function Progress({ track, progress }) {
12
+ const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
13
+ const completedSteps = progress.completedStepIds.length;
14
+ const totalSteps = track.steps.length;
15
+ const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
16
+ const surfaces = /* @__PURE__ */ new Map();
17
+ track.steps.forEach((step) => {
18
+ const surface = step.metadata?.surface ?? "general";
19
+ const current = surfaces.get(surface) ?? {
20
+ total: 0,
21
+ completed: 0
22
+ };
23
+ surfaces.set(surface, {
24
+ total: current.total + 1,
25
+ completed: current.completed + (progress.completedStepIds.includes(step.id) ? 1 : 0)
26
+ });
27
+ });
28
+ const surfaceColors = [
29
+ "green",
30
+ "blue",
31
+ "violet",
32
+ "orange"
33
+ ];
34
+ return /* @__PURE__ */ jsxs("div", {
35
+ className: "space-y-6",
36
+ children: [
37
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
38
+ className: "flex items-center gap-2",
39
+ children: [/* @__PURE__ */ jsx("span", { children: "⚡" }), /* @__PURE__ */ jsx("span", { children: "Experience Points" })]
40
+ }) }), /* @__PURE__ */ jsxs(CardContent, {
41
+ className: "space-y-4",
42
+ children: [
43
+ /* @__PURE__ */ jsxs("div", {
44
+ className: "flex items-baseline gap-2",
45
+ children: [/* @__PURE__ */ jsx("span", {
46
+ className: "text-4xl font-bold text-violet-500",
47
+ children: progress.xpEarned.toLocaleString()
48
+ }), /* @__PURE__ */ jsxs("span", {
49
+ className: "text-muted-foreground",
50
+ children: [
51
+ "/ ",
52
+ totalXp.toLocaleString(),
53
+ " XP"
54
+ ]
55
+ })]
56
+ }),
57
+ /* @__PURE__ */ jsx(XpBar, {
58
+ current: progress.xpEarned,
59
+ max: totalXp,
60
+ showLabel: false,
61
+ size: "lg"
62
+ }),
63
+ track.completionRewards?.xpBonus && percentComplete < 100 && /* @__PURE__ */ jsxs("p", {
64
+ className: "text-muted-foreground text-sm",
65
+ children: [
66
+ "🎁 Complete all steps for a",
67
+ " ",
68
+ /* @__PURE__ */ jsxs("span", {
69
+ className: "font-semibold text-green-500",
70
+ children: [
71
+ "+",
72
+ track.completionRewards.xpBonus,
73
+ " XP"
74
+ ]
75
+ }),
76
+ " ",
77
+ "bonus!"
78
+ ]
79
+ })
80
+ ]
81
+ })] }),
82
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
83
+ className: "flex items-center gap-2",
84
+ children: [/* @__PURE__ */ jsx("span", { children: "🎯" }), /* @__PURE__ */ jsx("span", { children: "Skill Mastery" })]
85
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", {
86
+ className: "flex flex-wrap justify-center gap-6",
87
+ children: [Array.from(surfaces.entries()).map(([surface, data], index) => /* @__PURE__ */ jsx(MasteryRing, {
88
+ label: surface.charAt(0).toUpperCase() + surface.slice(1),
89
+ percentage: data.completed / data.total * 100,
90
+ color: surfaceColors[index % surfaceColors.length],
91
+ size: "lg"
92
+ }, surface)), /* @__PURE__ */ jsx(MasteryRing, {
93
+ label: "Overall",
94
+ percentage: percentComplete,
95
+ color: "violet",
96
+ size: "lg"
97
+ })]
98
+ }) })] }),
99
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
100
+ className: "flex items-center gap-2",
101
+ children: [/* @__PURE__ */ jsx("span", { children: "🏅" }), /* @__PURE__ */ jsx("span", { children: "Badges Earned" })]
102
+ }) }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx(BadgeDisplay, {
103
+ badges: progress.badges,
104
+ size: "lg",
105
+ maxVisible: 10
106
+ }), progress.badges.length === 0 && /* @__PURE__ */ jsx("p", {
107
+ className: "text-muted-foreground text-sm",
108
+ children: "Complete the track to earn your first badge!"
109
+ })] })] }),
110
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
111
+ className: "flex items-center gap-2",
112
+ children: [/* @__PURE__ */ jsx("span", { children: "📊" }), /* @__PURE__ */ jsx("span", { children: "Step Breakdown" })]
113
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
114
+ className: "space-y-2",
115
+ children: track.steps.map((step) => {
116
+ const isCompleted = progress.completedStepIds.includes(step.id);
117
+ return /* @__PURE__ */ jsxs("div", {
118
+ className: "flex items-center justify-between rounded-lg border p-3",
119
+ children: [/* @__PURE__ */ jsxs("div", {
120
+ className: "flex items-center gap-3",
121
+ children: [/* @__PURE__ */ jsx("span", {
122
+ className: isCompleted ? "text-green-500" : "text-muted-foreground",
123
+ children: isCompleted ? "✓" : "○"
124
+ }), /* @__PURE__ */ jsx("span", {
125
+ className: isCompleted ? "text-foreground" : "text-muted-foreground",
126
+ children: step.title
127
+ })]
128
+ }), step.xpReward && /* @__PURE__ */ jsxs("span", {
129
+ className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
130
+ children: [
131
+ isCompleted ? "+" : "",
132
+ step.xpReward,
133
+ " XP"
134
+ ]
135
+ })]
136
+ }, step.id);
137
+ })
138
+ }) })] })
139
+ ]
140
+ });
141
+ }
142
+
143
+ //#endregion
144
+ export { Progress };
@@ -0,0 +1,55 @@
1
+ 'use client';
2
+
3
+ import { FlashCard } from "../components/FlashCard.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+
6
+ //#region ../learning-journey-ui-gamified/src/views/Steps.tsx
7
+ function Steps({ track, progress, onStepComplete }) {
8
+ const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "space-y-6",
11
+ children: [
12
+ /* @__PURE__ */ jsxs("div", {
13
+ className: "text-center",
14
+ children: [/* @__PURE__ */ jsx("h2", {
15
+ className: "text-xl font-bold",
16
+ children: "Complete Your Challenges"
17
+ }), /* @__PURE__ */ jsx("p", {
18
+ className: "text-muted-foreground",
19
+ children: "Tap each card to reveal the action, then mark as complete"
20
+ })]
21
+ }),
22
+ /* @__PURE__ */ jsx("div", {
23
+ className: "grid gap-4 md:grid-cols-2",
24
+ children: track.steps.map((step, index) => {
25
+ return /* @__PURE__ */ jsx(FlashCard, {
26
+ step,
27
+ isCompleted: progress.completedStepIds.includes(step.id),
28
+ isCurrent: index === currentStepIndex,
29
+ onComplete: () => onStepComplete?.(step.id)
30
+ }, step.id);
31
+ })
32
+ }),
33
+ /* @__PURE__ */ jsxs("div", {
34
+ className: "text-muted-foreground text-center text-sm",
35
+ children: [
36
+ progress.completedStepIds.length,
37
+ " of ",
38
+ track.steps.length,
39
+ " completed",
40
+ track.completionRewards?.xpBonus && /* @__PURE__ */ jsxs("span", {
41
+ className: "ml-2 text-green-500",
42
+ children: [
43
+ "(+",
44
+ track.completionRewards.xpBonus,
45
+ " XP bonus on completion)"
46
+ ]
47
+ })
48
+ ]
49
+ })
50
+ ]
51
+ });
52
+ }
53
+
54
+ //#endregion
55
+ export { Steps };
@@ -0,0 +1,132 @@
1
+ 'use client';
2
+
3
+ import { Card, CardContent, CardHeader, CardTitle } from "../../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { DayCalendar } from "../components/DayCalendar.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region ../learning-journey-ui-gamified/src/views/Timeline.tsx
8
+ function Timeline({ track, progress }) {
9
+ if (track.steps.some((s) => s.availability?.unlockOnDay !== void 0)) {
10
+ const totalDays = Math.max(...track.steps.map((s) => s.availability?.unlockOnDay ?? 1), 7);
11
+ const completedDays = track.steps.filter((s) => progress.completedStepIds.includes(s.id)).map((s) => s.availability?.unlockOnDay ?? 1);
12
+ const currentDay = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.availability?.unlockOnDay ?? 1;
13
+ return /* @__PURE__ */ jsxs("div", {
14
+ className: "space-y-6",
15
+ children: [
16
+ /* @__PURE__ */ jsxs("div", {
17
+ className: "text-center",
18
+ children: [/* @__PURE__ */ jsx("h2", {
19
+ className: "text-xl font-bold",
20
+ children: track.name
21
+ }), /* @__PURE__ */ jsx("p", {
22
+ className: "text-muted-foreground",
23
+ children: "Complete each day's challenge to progress"
24
+ })]
25
+ }),
26
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
27
+ className: "flex items-center gap-2",
28
+ children: [/* @__PURE__ */ jsx("span", { children: "📅" }), /* @__PURE__ */ jsx("span", { children: "Your Journey" })]
29
+ }) }), /* @__PURE__ */ jsx(CardContent, {
30
+ className: "flex justify-center",
31
+ children: /* @__PURE__ */ jsx(DayCalendar, {
32
+ totalDays,
33
+ currentDay,
34
+ completedDays
35
+ })
36
+ })] }),
37
+ /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
38
+ className: "flex items-center gap-2",
39
+ children: [/* @__PURE__ */ jsx("span", { children: "📝" }), /* @__PURE__ */ jsx("span", { children: "Daily Challenges" })]
40
+ }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
41
+ className: "space-y-3",
42
+ children: track.steps.map((step) => {
43
+ const day = step.availability?.unlockOnDay ?? 1;
44
+ const isCompleted = progress.completedStepIds.includes(step.id);
45
+ const isLocked = day > currentDay;
46
+ return /* @__PURE__ */ jsxs("div", {
47
+ className: `flex items-start gap-4 rounded-lg border p-4 ${isLocked ? "opacity-50" : ""}`,
48
+ children: [
49
+ /* @__PURE__ */ jsx("div", {
50
+ className: "bg-muted flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold",
51
+ children: isCompleted ? "✓" : isLocked ? "🔒" : day
52
+ }),
53
+ /* @__PURE__ */ jsxs("div", {
54
+ className: "flex-1",
55
+ children: [/* @__PURE__ */ jsx("h4", {
56
+ className: "font-semibold",
57
+ children: step.title
58
+ }), /* @__PURE__ */ jsx("p", {
59
+ className: "text-muted-foreground text-sm",
60
+ children: step.description
61
+ })]
62
+ }),
63
+ step.xpReward && /* @__PURE__ */ jsxs("span", {
64
+ className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
65
+ children: [
66
+ "+",
67
+ step.xpReward,
68
+ " XP"
69
+ ]
70
+ })
71
+ ]
72
+ }, step.id);
73
+ })
74
+ }) })] })
75
+ ]
76
+ });
77
+ }
78
+ return /* @__PURE__ */ jsxs("div", {
79
+ className: "space-y-6",
80
+ children: [/* @__PURE__ */ jsxs("div", {
81
+ className: "text-center",
82
+ children: [/* @__PURE__ */ jsx("h2", {
83
+ className: "text-xl font-bold",
84
+ children: "Learning Path"
85
+ }), /* @__PURE__ */ jsx("p", {
86
+ className: "text-muted-foreground",
87
+ children: "Follow the steps to master this skill"
88
+ })]
89
+ }), /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
90
+ className: "p-6",
91
+ children: /* @__PURE__ */ jsxs("div", {
92
+ className: "relative",
93
+ children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 left-5 h-full w-0.5" }), /* @__PURE__ */ jsx("div", {
94
+ className: "space-y-6",
95
+ children: track.steps.map((step, index) => {
96
+ const isCompleted = progress.completedStepIds.includes(step.id);
97
+ const isCurrent = !isCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
98
+ return /* @__PURE__ */ jsxs("div", {
99
+ className: "relative flex gap-4 pl-2",
100
+ children: [/* @__PURE__ */ jsx("div", {
101
+ className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-violet-500 bg-violet-500 text-white" : "border-border bg-background"}`,
102
+ children: isCompleted ? "✓" : index + 1
103
+ }), /* @__PURE__ */ jsx("div", {
104
+ className: "flex-1 pb-4",
105
+ children: /* @__PURE__ */ jsxs("div", {
106
+ className: "flex items-start justify-between gap-2",
107
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
108
+ className: `font-semibold ${isCompleted ? "text-foreground" : isCurrent ? "text-violet-500" : "text-muted-foreground"}`,
109
+ children: step.title
110
+ }), /* @__PURE__ */ jsx("p", {
111
+ className: "text-muted-foreground mt-1 text-sm",
112
+ children: step.description
113
+ })] }), step.xpReward && /* @__PURE__ */ jsxs("span", {
114
+ 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"}`,
115
+ children: [
116
+ "+",
117
+ step.xpReward,
118
+ " XP"
119
+ ]
120
+ })]
121
+ })
122
+ })]
123
+ }, step.id);
124
+ })
125
+ })]
126
+ })
127
+ }) })]
128
+ });
129
+ }
130
+
131
+ //#endregion
132
+ export { Timeline };
@@ -0,0 +1,4 @@
1
+ import { Overview } from "./Overview.js";
2
+ import { Steps } from "./Steps.js";
3
+ import { Progress } from "./Progress.js";
4
+ import { Timeline } from "./Timeline.js";