@lssm/example.learning-journey-registry 0.0.0-canary-20251217062139 → 0.0.0-canary-20251217072406

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 (110) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +409 -410
  2. package/.turbo/turbo-build.log +410 -55
  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 -1
  9. package/dist/examples/learning-journey-crm-onboarding/dist/track.js +98 -1
  10. package/dist/examples/learning-journey-duo-drills/src/track.js +65 -1
  11. package/dist/examples/learning-journey-platform-tour/dist/track.js +105 -1
  12. package/dist/examples/learning-journey-quest-challenges/src/track.js +35 -1
  13. package/dist/examples/learning-journey-studio-onboarding/dist/track.js +90 -1
  14. package/dist/examples/learning-journey-ui-coaching/src/CoachingMiniApp.js +64 -1
  15. package/dist/examples/learning-journey-ui-coaching/src/components/EngagementMeter.js +107 -1
  16. package/dist/examples/learning-journey-ui-coaching/src/components/TipCard.js +75 -1
  17. package/dist/examples/learning-journey-ui-coaching/src/components/TipFeed.js +65 -1
  18. package/dist/examples/learning-journey-ui-coaching/src/components/index.js +3 -1
  19. package/dist/examples/learning-journey-ui-coaching/src/docs/index.js +1 -1
  20. package/dist/examples/learning-journey-ui-coaching/src/docs/learning-journey-ui-coaching.docblock.js +19 -7
  21. package/dist/examples/learning-journey-ui-coaching/src/index.js +11 -1
  22. package/dist/examples/learning-journey-ui-coaching/src/views/Overview.js +152 -1
  23. package/dist/examples/learning-journey-ui-coaching/src/views/Progress.js +117 -1
  24. package/dist/examples/learning-journey-ui-coaching/src/views/Steps.js +68 -1
  25. package/dist/examples/learning-journey-ui-coaching/src/views/Timeline.js +112 -1
  26. package/dist/examples/learning-journey-ui-coaching/src/views/index.js +4 -1
  27. package/dist/examples/learning-journey-ui-gamified/src/GamifiedMiniApp.js +64 -1
  28. package/dist/examples/learning-journey-ui-gamified/src/components/DayCalendar.js +32 -1
  29. package/dist/examples/learning-journey-ui-gamified/src/components/FlashCard.js +79 -1
  30. package/dist/examples/learning-journey-ui-gamified/src/components/MasteryRing.js +81 -1
  31. package/dist/examples/learning-journey-ui-gamified/src/components/index.js +3 -1
  32. package/dist/examples/learning-journey-ui-gamified/src/docs/index.js +1 -1
  33. package/dist/examples/learning-journey-ui-gamified/src/docs/learning-journey-ui-gamified.docblock.js +19 -7
  34. package/dist/examples/learning-journey-ui-gamified/src/index.js +11 -1
  35. package/dist/examples/learning-journey-ui-gamified/src/views/Overview.js +163 -1
  36. package/dist/examples/learning-journey-ui-gamified/src/views/Progress.js +144 -1
  37. package/dist/examples/learning-journey-ui-gamified/src/views/Steps.js +55 -1
  38. package/dist/examples/learning-journey-ui-gamified/src/views/Timeline.js +132 -1
  39. package/dist/examples/learning-journey-ui-gamified/src/views/index.js +4 -1
  40. package/dist/examples/learning-journey-ui-onboarding/src/OnboardingMiniApp.js +64 -1
  41. package/dist/examples/learning-journey-ui-onboarding/src/components/CodeSnippet.js +4 -1
  42. package/dist/examples/learning-journey-ui-onboarding/src/components/JourneyMap.js +48 -1
  43. package/dist/examples/learning-journey-ui-onboarding/src/components/StepChecklist.js +79 -1
  44. package/dist/examples/learning-journey-ui-onboarding/src/components/index.js +3 -1
  45. package/dist/examples/learning-journey-ui-onboarding/src/docs/index.js +1 -1
  46. package/dist/examples/learning-journey-ui-onboarding/src/docs/learning-journey-ui-onboarding.docblock.js +19 -7
  47. package/dist/examples/learning-journey-ui-onboarding/src/index.js +10 -1
  48. package/dist/examples/learning-journey-ui-onboarding/src/views/Overview.js +180 -1
  49. package/dist/examples/learning-journey-ui-onboarding/src/views/Progress.js +162 -1
  50. package/dist/examples/learning-journey-ui-onboarding/src/views/Steps.js +91 -1
  51. package/dist/examples/learning-journey-ui-onboarding/src/views/Timeline.js +97 -1
  52. package/dist/examples/learning-journey-ui-onboarding/src/views/index.js +4 -1
  53. package/dist/examples/learning-journey-ui-shared/src/components/BadgeDisplay.js +44 -1
  54. package/dist/examples/learning-journey-ui-shared/src/components/StreakCounter.js +45 -1
  55. package/dist/examples/learning-journey-ui-shared/src/components/ViewTabs.js +48 -1
  56. package/dist/examples/learning-journey-ui-shared/src/components/XpBar.js +46 -1
  57. package/dist/examples/learning-journey-ui-shared/src/components/index.js +4 -1
  58. package/dist/examples/learning-journey-ui-shared/src/docs/index.js +1 -1
  59. package/dist/examples/learning-journey-ui-shared/src/docs/learning-journey-ui-shared.docblock.js +19 -6
  60. package/dist/examples/learning-journey-ui-shared/src/hooks/index.js +1 -1
  61. package/dist/examples/learning-journey-ui-shared/src/hooks/useLearningProgress.js +73 -1
  62. package/dist/examples/learning-journey-ui-shared/src/index.js +8 -1
  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 -1
  96. package/dist/libs/design-system/dist/components/atoms/Button.js +33 -1
  97. package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -1
  98. package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -1
  99. package/dist/libs/ui-kit-core/dist/utils.js +10 -1
  100. package/dist/libs/ui-kit-web/dist/ui/card.js +36 -1
  101. package/dist/libs/ui-kit-web/dist/ui/progress.js +23 -1
  102. package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -1
  103. package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -1
  104. package/dist/presentations/index.js +64 -1
  105. package/dist/progress-store.js +30 -1
  106. package/dist/tracks.js +47 -1
  107. package/dist/ui/LearningMiniApp.js +82 -1
  108. package/dist/ui/index.js +3 -1
  109. package/package.json +16 -14
  110. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1,163 @@
1
- "use client";import{Card as e,CardContent as t,CardHeader as n,CardTitle as r}from"../../../../libs/ui-kit-web/dist/ui/card.js";import{XpBar as i}from"../../../learning-journey-ui-shared/src/components/XpBar.js";import{StreakCounter as a}from"../../../learning-journey-ui-shared/src/components/StreakCounter.js";import{BadgeDisplay as o}from"../../../learning-journey-ui-shared/src/components/BadgeDisplay.js";import{Button$1 as s}from"../../../../libs/design-system/dist/components/atoms/Button.js";import"../../../learning-journey-ui-shared/src/index.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({track:u,progress:d,onStart:f}){let p=u.totalXp??u.steps.reduce((e,t)=>e+(t.xpReward??0),0)+(u.completionRewards?.xpBonus??0),m=d.completedStepIds.length,h=u.steps.length,g=m===h;return l(`div`,{className:`space-y-6`,children:[c(e,{className:`overflow-hidden bg-gradient-to-br from-violet-500/10 via-purple-500/10 to-fuchsia-500/10`,children:c(t,{className:`p-6`,children:l(`div`,{className:`flex flex-col items-center gap-4 text-center md:flex-row md:text-left`,children:[c(`div`,{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`,children:g?`🏆`:`🎯`}),l(`div`,{className:`flex-1`,children:[c(`h1`,{className:`text-2xl font-bold`,children:u.name}),c(`p`,{className:`text-muted-foreground mt-1`,children:u.description})]}),c(`div`,{className:`flex items-center gap-3`,children:c(a,{days:d.streakDays,size:`lg`})})]})})}),l(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[l(e,{children:[c(n,{className:`pb-2`,children:c(r,{className:`text-muted-foreground text-sm font-medium`,children:`XP Progress`})}),l(t,{children:[c(`div`,{className:`text-3xl font-bold text-violet-500`,children:d.xpEarned.toLocaleString()}),c(i,{current:d.xpEarned,max:p,showLabel:!1,size:`sm`})]})]}),l(e,{children:[c(n,{className:`pb-2`,children:c(r,{className:`text-muted-foreground text-sm font-medium`,children:`Steps Completed`})}),l(t,{children:[l(`div`,{className:`text-3xl font-bold`,children:[m,` `,l(`span`,{className:`text-muted-foreground text-lg`,children:[`/ `,h]})]}),c(`div`,{className:`bg-muted mt-2 h-2 w-full overflow-hidden rounded-full`,children:c(`div`,{className:`h-full bg-green-500 transition-all duration-500`,style:{width:`${m/h*100}%`}})})]})]}),l(e,{children:[c(n,{className:`pb-2`,children:c(r,{className:`text-muted-foreground text-sm font-medium`,children:`Badges Earned`})}),c(t,{children:c(o,{badges:d.badges,size:`lg`})})]})]}),!g&&l(e,{children:[c(n,{children:l(r,{className:`flex items-center gap-2`,children:[c(`span`,{children:`🎯`}),c(`span`,{children:`Next Challenge`})]})}),c(t,{children:(()=>{let e=u.steps.find(e=>!d.completedStepIds.includes(e.id));return e?l(`div`,{className:`flex items-center justify-between gap-4`,children:[l(`div`,{children:[c(`h3`,{className:`font-semibold`,children:e.title}),c(`p`,{className:`text-muted-foreground text-sm`,children:e.description})]}),l(`div`,{className:`flex items-center gap-3`,children:[e.xpReward&&l(`span`,{className:`rounded-full bg-green-500/10 px-3 py-1 text-sm font-semibold text-green-500`,children:[`+`,e.xpReward,` XP`]}),c(s,{onClick:f,children:`Start`})]})]}):null})()})]}),g&&c(e,{className:`border-green-500/50 bg-green-500/5`,children:l(t,{className:`flex items-center gap-4 p-6`,children:[c(`div`,{className:`text-4xl`,children:`🎉`}),l(`div`,{children:[c(`h3`,{className:`text-lg font-semibold text-green-500`,children:`Track Complete!`}),l(`p`,{className:`text-muted-foreground`,children:[`You've mastered all `,h,` challenges and earned`,` `,d.xpEarned,` XP.`]})]})]})})]})}export{u as Overview};
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 };
@@ -1 +1,144 @@
1
- "use client";import{Card as e,CardContent as t,CardHeader as n,CardTitle as r}from"../../../../libs/ui-kit-web/dist/ui/card.js";import{XpBar as i}from"../../../learning-journey-ui-shared/src/components/XpBar.js";import{BadgeDisplay as a}from"../../../learning-journey-ui-shared/src/components/BadgeDisplay.js";import"../../../learning-journey-ui-shared/src/index.js";import{MasteryRing as o}from"../components/MasteryRing.js";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({track:l,progress:u}){let d=l.totalXp??l.steps.reduce((e,t)=>e+(t.xpReward??0),0)+(l.completionRewards?.xpBonus??0),f=u.completedStepIds.length,p=l.steps.length,m=p>0?f/p*100:0,h=new Map;l.steps.forEach(e=>{let t=e.metadata?.surface??`general`,n=h.get(t)??{total:0,completed:0};h.set(t,{total:n.total+1,completed:n.completed+(u.completedStepIds.includes(e.id)?1:0)})});let g=[`green`,`blue`,`violet`,`orange`];return c(`div`,{className:`space-y-6`,children:[c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`⚡`}),s(`span`,{children:`Experience Points`})]})}),c(t,{className:`space-y-4`,children:[c(`div`,{className:`flex items-baseline gap-2`,children:[s(`span`,{className:`text-4xl font-bold text-violet-500`,children:u.xpEarned.toLocaleString()}),c(`span`,{className:`text-muted-foreground`,children:[`/ `,d.toLocaleString(),` XP`]})]}),s(i,{current:u.xpEarned,max:d,showLabel:!1,size:`lg`}),l.completionRewards?.xpBonus&&m<100&&c(`p`,{className:`text-muted-foreground text-sm`,children:[`🎁 Complete all steps for a`,` `,c(`span`,{className:`font-semibold text-green-500`,children:[`+`,l.completionRewards.xpBonus,` XP`]}),` `,`bonus!`]})]})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`🎯`}),s(`span`,{children:`Skill Mastery`})]})}),s(t,{children:c(`div`,{className:`flex flex-wrap justify-center gap-6`,children:[Array.from(h.entries()).map(([e,t],n)=>s(o,{label:e.charAt(0).toUpperCase()+e.slice(1),percentage:t.completed/t.total*100,color:g[n%g.length],size:`lg`},e)),s(o,{label:`Overall`,percentage:m,color:`violet`,size:`lg`})]})})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`🏅`}),s(`span`,{children:`Badges Earned`})]})}),c(t,{children:[s(a,{badges:u.badges,size:`lg`,maxVisible:10}),u.badges.length===0&&s(`p`,{className:`text-muted-foreground text-sm`,children:`Complete the track to earn your first badge!`})]})]}),c(e,{children:[s(n,{children:c(r,{className:`flex items-center gap-2`,children:[s(`span`,{children:`📊`}),s(`span`,{children:`Step Breakdown`})]})}),s(t,{children:s(`div`,{className:`space-y-2`,children:l.steps.map(e=>{let t=u.completedStepIds.includes(e.id);return c(`div`,{className:`flex items-center justify-between rounded-lg border p-3`,children:[c(`div`,{className:`flex items-center gap-3`,children:[s(`span`,{className:t?`text-green-500`:`text-muted-foreground`,children:t?`✓`:`○`}),s(`span`,{className:t?`text-foreground`:`text-muted-foreground`,children:e.title})]}),e.xpReward&&c(`span`,{className:`text-sm font-medium ${t?`text-green-500`:`text-muted-foreground`}`,children:[t?`+`:``,e.xpReward,` XP`]})]},e.id)})})})]})]})}export{l as Progress};
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 };
@@ -1 +1,55 @@
1
- "use client";import{FlashCard as e}from"../components/FlashCard.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r({track:r,progress:i,onStepComplete:a}){let o=r.steps.findIndex(e=>!i.completedStepIds.includes(e.id));return n(`div`,{className:`space-y-6`,children:[n(`div`,{className:`text-center`,children:[t(`h2`,{className:`text-xl font-bold`,children:`Complete Your Challenges`}),t(`p`,{className:`text-muted-foreground`,children:`Tap each card to reveal the action, then mark as complete`})]}),t(`div`,{className:`grid gap-4 md:grid-cols-2`,children:r.steps.map((n,r)=>t(e,{step:n,isCompleted:i.completedStepIds.includes(n.id),isCurrent:r===o,onComplete:()=>a?.(n.id)},n.id))}),n(`div`,{className:`text-muted-foreground text-center text-sm`,children:[i.completedStepIds.length,` of `,r.steps.length,` completed`,r.completionRewards?.xpBonus&&n(`span`,{className:`ml-2 text-green-500`,children:[`(+`,r.completionRewards.xpBonus,` XP bonus on completion)`]})]})]})}export{r as Steps};
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 };
@@ -1 +1,132 @@
1
- "use client";import{Card as e,CardContent as t,CardHeader as n,CardTitle as r}from"../../../../libs/ui-kit-web/dist/ui/card.js";import{DayCalendar as i}from"../components/DayCalendar.js";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({track:s,progress:c}){if(s.steps.some(e=>e.availability?.unlockOnDay!==void 0)){let l=Math.max(...s.steps.map(e=>e.availability?.unlockOnDay??1),7),u=s.steps.filter(e=>c.completedStepIds.includes(e.id)).map(e=>e.availability?.unlockOnDay??1),d=s.steps.find(e=>!c.completedStepIds.includes(e.id))?.availability?.unlockOnDay??1;return o(`div`,{className:`space-y-6`,children:[o(`div`,{className:`text-center`,children:[a(`h2`,{className:`text-xl font-bold`,children:s.name}),a(`p`,{className:`text-muted-foreground`,children:`Complete each day's challenge to progress`})]}),o(e,{children:[a(n,{children:o(r,{className:`flex items-center gap-2`,children:[a(`span`,{children:`📅`}),a(`span`,{children:`Your Journey`})]})}),a(t,{className:`flex justify-center`,children:a(i,{totalDays:l,currentDay:d,completedDays:u})})]}),o(e,{children:[a(n,{children:o(r,{className:`flex items-center gap-2`,children:[a(`span`,{children:`📝`}),a(`span`,{children:`Daily Challenges`})]})}),a(t,{children:a(`div`,{className:`space-y-3`,children:s.steps.map(e=>{let t=e.availability?.unlockOnDay??1,n=c.completedStepIds.includes(e.id),r=t>d;return o(`div`,{className:`flex items-start gap-4 rounded-lg border p-4 ${r?`opacity-50`:``}`,children:[a(`div`,{className:`bg-muted flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold`,children:n?`✓`:r?`🔒`:t}),o(`div`,{className:`flex-1`,children:[a(`h4`,{className:`font-semibold`,children:e.title}),a(`p`,{className:`text-muted-foreground text-sm`,children:e.description})]}),e.xpReward&&o(`span`,{className:`text-sm font-medium ${n?`text-green-500`:`text-muted-foreground`}`,children:[`+`,e.xpReward,` XP`]})]},e.id)})})})]})]})}return o(`div`,{className:`space-y-6`,children:[o(`div`,{className:`text-center`,children:[a(`h2`,{className:`text-xl font-bold`,children:`Learning Path`}),a(`p`,{className:`text-muted-foreground`,children:`Follow the steps to master this skill`})]}),a(e,{children:a(t,{className:`p-6`,children:o(`div`,{className:`relative`,children:[a(`div`,{className:`bg-border absolute top-0 left-5 h-full w-0.5`}),a(`div`,{className:`space-y-6`,children:s.steps.map((e,t)=>{let n=c.completedStepIds.includes(e.id),r=!n&&s.steps.slice(0,t).every(e=>c.completedStepIds.includes(e.id));return o(`div`,{className:`relative flex gap-4 pl-2`,children:[a(`div`,{className:`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 ${n?`border-green-500 bg-green-500 text-white`:r?`border-violet-500 bg-violet-500 text-white`:`border-border bg-background`}`,children:n?`✓`:t+1}),a(`div`,{className:`flex-1 pb-4`,children:o(`div`,{className:`flex items-start justify-between gap-2`,children:[o(`div`,{children:[a(`h4`,{className:`font-semibold ${n?`text-foreground`:r?`text-violet-500`:`text-muted-foreground`}`,children:e.title}),a(`p`,{className:`text-muted-foreground mt-1 text-sm`,children:e.description})]}),e.xpReward&&o(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs font-semibold ${n?`bg-green-500/10 text-green-500`:`bg-muted text-muted-foreground`}`,children:[`+`,e.xpReward,` XP`]})]})})]},e.id)})})]})})})]})}export{s as Timeline};
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 };
@@ -1 +1,4 @@
1
- import{Overview as e}from"./Overview.js";import{Steps as t}from"./Steps.js";import{Progress as n}from"./Progress.js";import{Timeline as r}from"./Timeline.js";
1
+ import { Overview } from "./Overview.js";
2
+ import { Steps } from "./Steps.js";
3
+ import { Progress } from "./Progress.js";
4
+ import { Timeline } from "./Timeline.js";
@@ -1 +1,64 @@
1
- "use client";import{Card as e,CardContent as t}from"../../../libs/ui-kit-web/dist/ui/card.js";import{useLearningProgress as n}from"../../learning-journey-ui-shared/src/hooks/useLearningProgress.js";import{ViewTabs as r}from"../../learning-journey-ui-shared/src/components/ViewTabs.js";import"../../learning-journey-ui-shared/src/index.js";import{Overview as i}from"./views/Overview.js";import{Steps as a}from"./views/Steps.js";import{ProgressView as o}from"./views/Progress.js";import{Timeline as s}from"./views/Timeline.js";import{useCallback as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f({track:f,progress:p,onStepComplete:m,onViewChange:h,initialView:g=`overview`}){let[_,v]=l(g),{progress:y,completeStep:b}=n(f),x=p??y,S=c(e=>{v(e),h?.(e)},[h]),C=c(e=>{m?m(e):b(e)},[m,b]),w=c(()=>{v(`steps`),h?.(`steps`)},[h]);return d(`div`,{className:`space-y-6`,children:[u(e,{children:u(t,{className:`p-4`,children:u(r,{currentView:_,onViewChange:S})})}),(()=>{let e={track:f,progress:x,onStepComplete:C};switch(_){case`overview`:return u(i,{...e,onStart:w});case`steps`:return u(a,{...e});case`progress`:return u(o,{...e});case`timeline`:return u(s,{...e});default:return u(i,{...e,onStart:w})}})()]})}export{f as OnboardingMiniApp};
1
+ 'use client';
2
+
3
+ import { Card, CardContent } from "../../../libs/ui-kit-web/dist/ui/card.js";
4
+ import { useLearningProgress } from "../../learning-journey-ui-shared/src/hooks/useLearningProgress.js";
5
+ import { ViewTabs } from "../../learning-journey-ui-shared/src/components/ViewTabs.js";
6
+ import "../../learning-journey-ui-shared/src/index.js";
7
+ import { Overview } from "./views/Overview.js";
8
+ import { Steps } from "./views/Steps.js";
9
+ import { ProgressView } from "./views/Progress.js";
10
+ import { Timeline } from "./views/Timeline.js";
11
+ import { useCallback, useState } from "react";
12
+ import { jsx, jsxs } from "react/jsx-runtime";
13
+
14
+ //#region ../learning-journey-ui-onboarding/src/OnboardingMiniApp.tsx
15
+ function OnboardingMiniApp({ track, progress: externalProgress, onStepComplete: externalOnStepComplete, onViewChange, initialView = "overview" }) {
16
+ const [currentView, setCurrentView] = useState(initialView);
17
+ const { progress: internalProgress, completeStep: internalCompleteStep } = useLearningProgress(track);
18
+ const progress = externalProgress ?? internalProgress;
19
+ const handleViewChange = useCallback((view) => {
20
+ setCurrentView(view);
21
+ onViewChange?.(view);
22
+ }, [onViewChange]);
23
+ const handleStepComplete = useCallback((stepId) => {
24
+ if (externalOnStepComplete) externalOnStepComplete(stepId);
25
+ else internalCompleteStep(stepId);
26
+ }, [externalOnStepComplete, internalCompleteStep]);
27
+ const handleStartFromOverview = useCallback(() => {
28
+ setCurrentView("steps");
29
+ onViewChange?.("steps");
30
+ }, [onViewChange]);
31
+ const renderView = () => {
32
+ const viewProps = {
33
+ track,
34
+ progress,
35
+ onStepComplete: handleStepComplete
36
+ };
37
+ switch (currentView) {
38
+ case "overview": return /* @__PURE__ */ jsx(Overview, {
39
+ ...viewProps,
40
+ onStart: handleStartFromOverview
41
+ });
42
+ case "steps": return /* @__PURE__ */ jsx(Steps, { ...viewProps });
43
+ case "progress": return /* @__PURE__ */ jsx(ProgressView, { ...viewProps });
44
+ case "timeline": return /* @__PURE__ */ jsx(Timeline, { ...viewProps });
45
+ default: return /* @__PURE__ */ jsx(Overview, {
46
+ ...viewProps,
47
+ onStart: handleStartFromOverview
48
+ });
49
+ }
50
+ };
51
+ return /* @__PURE__ */ jsxs("div", {
52
+ className: "space-y-6",
53
+ children: [/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
54
+ className: "p-4",
55
+ children: /* @__PURE__ */ jsx(ViewTabs, {
56
+ currentView,
57
+ onViewChange: handleViewChange
58
+ })
59
+ }) }), renderView()]
60
+ });
61
+ }
62
+
63
+ //#endregion
64
+ export { OnboardingMiniApp };
@@ -1 +1,4 @@
1
- "use client";import{useState as e}from"react";import{Fragment as t,jsx as n,jsxs as r}from"react/jsx-runtime";
1
+ 'use client';
2
+
3
+ import { useState } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -1 +1,48 @@
1
- "use client";import{cn as e}from"../../../../libs/ui-kit-web/dist/ui/utils.js";import{jsx as t,jsxs as n}from"react/jsx-runtime";const r={templates:`📋`,"spec-editor":`✏️`,regenerator:`🔄`,playground:`🎮`,evolution:`🤖`,dashboard:`📊`,settings:`⚙️`,default:`📍`};function i({steps:i,completedStepIds:a,currentStepId:o}){return t(`div`,{className:`relative overflow-x-auto pb-4`,children:t(`div`,{className:`flex min-w-max items-center gap-2`,children:i.map((s,c)=>{let l=a.includes(s.id),u=s.id===o,d=r[s.metadata?.surface??`default`]??r.default;return n(`div`,{className:`flex items-center`,children:[n(`div`,{className:`flex flex-col items-center gap-2`,children:[t(`div`,{className:e(`flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all`,l&&`border-green-500 bg-green-500/10`,u&&!l&&`border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20`,!l&&!u&&`border-muted bg-muted/50`),children:l?`✓`:d}),t(`div`,{className:`text-center`,children:t(`p`,{className:e(`max-w-[100px] truncate text-xs font-medium`,l&&`text-green-500`,u&&!l&&`text-violet-500`,!l&&!u&&`text-muted-foreground`),children:s.title})})]}),c<i.length-1&&t(`div`,{className:e(`mx-2 h-1 w-8 rounded-full transition-colors`,a.includes(i[c+1]?.id??``)?`bg-green-500`:l?`bg-green-500/50`:`bg-muted`)})]},s.id)})})})}export{i as JourneyMap};
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-onboarding/src/components/JourneyMap.tsx
7
+ const SURFACE_ICONS = {
8
+ templates: "📋",
9
+ "spec-editor": "✏️",
10
+ regenerator: "🔄",
11
+ playground: "🎮",
12
+ evolution: "🤖",
13
+ dashboard: "📊",
14
+ settings: "⚙️",
15
+ default: "📍"
16
+ };
17
+ function JourneyMap({ steps, completedStepIds, currentStepId }) {
18
+ return /* @__PURE__ */ jsx("div", {
19
+ className: "relative overflow-x-auto pb-4",
20
+ children: /* @__PURE__ */ jsx("div", {
21
+ className: "flex min-w-max items-center gap-2",
22
+ children: steps.map((step, index) => {
23
+ const isCompleted = completedStepIds.includes(step.id);
24
+ const isCurrent = step.id === currentStepId;
25
+ const icon = SURFACE_ICONS[step.metadata?.surface ?? "default"] ?? SURFACE_ICONS.default;
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ className: "flex items-center",
28
+ children: [/* @__PURE__ */ jsxs("div", {
29
+ className: "flex flex-col items-center gap-2",
30
+ children: [/* @__PURE__ */ jsx("div", {
31
+ className: cn("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all", isCompleted && "border-green-500 bg-green-500/10", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20", !isCompleted && !isCurrent && "border-muted bg-muted/50"),
32
+ children: isCompleted ? "✓" : icon
33
+ }), /* @__PURE__ */ jsx("div", {
34
+ className: "text-center",
35
+ children: /* @__PURE__ */ jsx("p", {
36
+ className: cn("max-w-[100px] truncate text-xs font-medium", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
37
+ children: step.title
38
+ })
39
+ })]
40
+ }), index < steps.length - 1 && /* @__PURE__ */ jsx("div", { className: cn("mx-2 h-1 w-8 rounded-full transition-colors", completedStepIds.includes(steps[index + 1]?.id ?? "") ? "bg-green-500" : isCompleted ? "bg-green-500/50" : "bg-muted") })]
41
+ }, step.id);
42
+ })
43
+ })
44
+ });
45
+ }
46
+
47
+ //#endregion
48
+ export { JourneyMap };