@contractspec/example.learning-journey-ui-onboarding 3.7.17 → 3.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.turbo/turbo-build.log +48 -48
  2. package/CHANGELOG.md +18 -0
  3. package/dist/OnboardingMiniApp.js +1 -994
  4. package/dist/browser/OnboardingMiniApp.js +1 -994
  5. package/dist/browser/components/CodeSnippet.js +1 -65
  6. package/dist/browser/components/JourneyMap.js +1 -59
  7. package/dist/browser/components/StepChecklist.js +1 -97
  8. package/dist/browser/components/index.js +1 -219
  9. package/dist/browser/docs/index.js +2 -16
  10. package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +2 -16
  11. package/dist/browser/example.js +1 -32
  12. package/dist/browser/index.js +2 -1127
  13. package/dist/browser/learning-journey-ui-onboarding.feature.js +1 -18
  14. package/dist/browser/views/Overview.js +1 -240
  15. package/dist/browser/views/Progress.js +1 -275
  16. package/dist/browser/views/Steps.js +1 -192
  17. package/dist/browser/views/Timeline.js +1 -213
  18. package/dist/browser/views/index.js +1 -915
  19. package/dist/components/CodeSnippet.js +1 -65
  20. package/dist/components/JourneyMap.js +1 -59
  21. package/dist/components/StepChecklist.js +1 -97
  22. package/dist/components/index.js +1 -219
  23. package/dist/docs/index.js +2 -16
  24. package/dist/docs/learning-journey-ui-onboarding.docblock.js +2 -16
  25. package/dist/example.js +1 -32
  26. package/dist/index.js +2 -1127
  27. package/dist/learning-journey-ui-onboarding.feature.js +1 -18
  28. package/dist/node/OnboardingMiniApp.js +1 -994
  29. package/dist/node/components/CodeSnippet.js +1 -65
  30. package/dist/node/components/JourneyMap.js +1 -59
  31. package/dist/node/components/StepChecklist.js +1 -97
  32. package/dist/node/components/index.js +1 -219
  33. package/dist/node/docs/index.js +2 -16
  34. package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +2 -16
  35. package/dist/node/example.js +1 -32
  36. package/dist/node/index.js +2 -1127
  37. package/dist/node/learning-journey-ui-onboarding.feature.js +1 -18
  38. package/dist/node/views/Overview.js +1 -240
  39. package/dist/node/views/Progress.js +1 -275
  40. package/dist/node/views/Steps.js +1 -192
  41. package/dist/node/views/Timeline.js +1 -213
  42. package/dist/node/views/index.js +1 -915
  43. package/dist/views/Overview.js +1 -240
  44. package/dist/views/Progress.js +1 -275
  45. package/dist/views/Steps.js +1 -192
  46. package/dist/views/Timeline.js +1 -213
  47. package/dist/views/index.js +1 -915
  48. package/package.json +11 -11
@@ -1,241 +1,2 @@
1
1
  // @bun
2
- // src/views/Overview.tsx
3
- import { XpBar } from "@contractspec/example.learning-journey-ui-shared";
4
- import { Button } from "@contractspec/lib.design-system";
5
- import {
6
- Card,
7
- CardContent,
8
- CardHeader,
9
- CardTitle
10
- } from "@contractspec/lib.ui-kit-web/ui/card";
11
- import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
12
- import { jsxDEV } from "react/jsx-dev-runtime";
13
- "use client";
14
- function Overview({
15
- track,
16
- progress,
17
- onStart
18
- }) {
19
- const totalSteps = track.steps.length;
20
- const completedSteps = progress.completedStepIds.length;
21
- const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
22
- const isComplete = completedSteps === totalSteps;
23
- const remainingSteps = totalSteps - completedSteps;
24
- const estimatedMinutes = remainingSteps * 5;
25
- const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
26
- return /* @__PURE__ */ jsxDEV("div", {
27
- className: "space-y-6",
28
- children: [
29
- /* @__PURE__ */ jsxDEV(Card, {
30
- className: "overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",
31
- children: /* @__PURE__ */ jsxDEV(CardContent, {
32
- className: "p-8",
33
- children: /* @__PURE__ */ jsxDEV("div", {
34
- className: "flex flex-col items-center gap-6 text-center md:flex-row md:text-left",
35
- children: [
36
- /* @__PURE__ */ jsxDEV("div", {
37
- className: "flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",
38
- children: isComplete ? "\uD83C\uDF89" : "\uD83D\uDE80"
39
- }, undefined, false, undefined, this),
40
- /* @__PURE__ */ jsxDEV("div", {
41
- className: "flex-1",
42
- children: [
43
- /* @__PURE__ */ jsxDEV("h1", {
44
- className: "font-bold text-2xl",
45
- children: track.name
46
- }, undefined, false, undefined, this),
47
- /* @__PURE__ */ jsxDEV("p", {
48
- className: "mt-1 max-w-2xl text-muted-foreground",
49
- children: track.description
50
- }, undefined, false, undefined, this),
51
- !isComplete && /* @__PURE__ */ jsxDEV("p", {
52
- className: "mt-3 text-muted-foreground text-sm",
53
- children: [
54
- "\u23F1\uFE0F Estimated time:",
55
- " ",
56
- estimatedMinutes > 0 ? `~${estimatedMinutes} minutes` : "Less than a minute"
57
- ]
58
- }, undefined, true, undefined, this)
59
- ]
60
- }, undefined, true, undefined, this),
61
- !isComplete && /* @__PURE__ */ jsxDEV(Button, {
62
- size: "lg",
63
- onClick: onStart,
64
- children: completedSteps > 0 ? "Continue" : "Get Started"
65
- }, undefined, false, undefined, this)
66
- ]
67
- }, undefined, true, undefined, this)
68
- }, undefined, false, undefined, this)
69
- }, undefined, false, undefined, this),
70
- /* @__PURE__ */ jsxDEV("div", {
71
- className: "grid gap-4 md:grid-cols-3",
72
- children: [
73
- /* @__PURE__ */ jsxDEV(Card, {
74
- children: [
75
- /* @__PURE__ */ jsxDEV(CardHeader, {
76
- className: "pb-2",
77
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
78
- className: "font-medium text-muted-foreground text-sm",
79
- children: "Progress"
80
- }, undefined, false, undefined, this)
81
- }, undefined, false, undefined, this),
82
- /* @__PURE__ */ jsxDEV(CardContent, {
83
- children: [
84
- /* @__PURE__ */ jsxDEV("div", {
85
- className: "font-bold text-3xl",
86
- children: [
87
- Math.round(percentComplete),
88
- "%"
89
- ]
90
- }, undefined, true, undefined, this),
91
- /* @__PURE__ */ jsxDEV(Progress, {
92
- value: percentComplete,
93
- className: "mt-2 h-2"
94
- }, undefined, false, undefined, this),
95
- /* @__PURE__ */ jsxDEV("p", {
96
- className: "mt-2 text-muted-foreground text-sm",
97
- children: [
98
- completedSteps,
99
- " of ",
100
- totalSteps,
101
- " steps completed"
102
- ]
103
- }, undefined, true, undefined, this)
104
- ]
105
- }, undefined, true, undefined, this)
106
- ]
107
- }, undefined, true, undefined, this),
108
- /* @__PURE__ */ jsxDEV(Card, {
109
- children: [
110
- /* @__PURE__ */ jsxDEV(CardHeader, {
111
- className: "pb-2",
112
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
113
- className: "font-medium text-muted-foreground text-sm",
114
- children: "XP Earned"
115
- }, undefined, false, undefined, this)
116
- }, undefined, false, undefined, this),
117
- /* @__PURE__ */ jsxDEV(CardContent, {
118
- children: [
119
- /* @__PURE__ */ jsxDEV("div", {
120
- className: "font-bold text-3xl text-blue-500",
121
- children: progress.xpEarned
122
- }, undefined, false, undefined, this),
123
- /* @__PURE__ */ jsxDEV(XpBar, {
124
- current: progress.xpEarned,
125
- max: totalXp,
126
- showLabel: false,
127
- size: "sm"
128
- }, undefined, false, undefined, this)
129
- ]
130
- }, undefined, true, undefined, this)
131
- ]
132
- }, undefined, true, undefined, this),
133
- /* @__PURE__ */ jsxDEV(Card, {
134
- children: [
135
- /* @__PURE__ */ jsxDEV(CardHeader, {
136
- className: "pb-2",
137
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
138
- className: "font-medium text-muted-foreground text-sm",
139
- children: "Time Remaining"
140
- }, undefined, false, undefined, this)
141
- }, undefined, false, undefined, this),
142
- /* @__PURE__ */ jsxDEV(CardContent, {
143
- children: [
144
- /* @__PURE__ */ jsxDEV("div", {
145
- className: "font-bold text-3xl",
146
- children: isComplete ? "\u2713" : `~${estimatedMinutes}m`
147
- }, undefined, false, undefined, this),
148
- /* @__PURE__ */ jsxDEV("p", {
149
- className: "mt-2 text-muted-foreground text-sm",
150
- children: isComplete ? "All done!" : `${remainingSteps} steps to go`
151
- }, undefined, false, undefined, this)
152
- ]
153
- }, undefined, true, undefined, this)
154
- ]
155
- }, undefined, true, undefined, this)
156
- ]
157
- }, undefined, true, undefined, this),
158
- /* @__PURE__ */ jsxDEV(Card, {
159
- children: [
160
- /* @__PURE__ */ jsxDEV(CardHeader, {
161
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
162
- className: "flex items-center gap-2",
163
- children: [
164
- /* @__PURE__ */ jsxDEV("span", {
165
- children: "\uD83D\uDCCB"
166
- }, undefined, false, undefined, this),
167
- /* @__PURE__ */ jsxDEV("span", {
168
- children: "Your Journey"
169
- }, undefined, false, undefined, this)
170
- ]
171
- }, undefined, true, undefined, this)
172
- }, undefined, false, undefined, this),
173
- /* @__PURE__ */ jsxDEV(CardContent, {
174
- children: /* @__PURE__ */ jsxDEV("div", {
175
- className: "space-y-3",
176
- children: track.steps.map((step, index) => {
177
- const isStepCompleted = progress.completedStepIds.includes(step.id);
178
- const isCurrent = !isStepCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
179
- return /* @__PURE__ */ jsxDEV("div", {
180
- className: "flex items-center gap-4 rounded-lg border p-3",
181
- children: [
182
- /* @__PURE__ */ jsxDEV("div", {
183
- className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${isStepCompleted ? "bg-green-500 text-white" : isCurrent ? "bg-blue-500 text-white" : "bg-muted text-muted-foreground"}`,
184
- children: isStepCompleted ? "\u2713" : index + 1
185
- }, undefined, false, undefined, this),
186
- /* @__PURE__ */ jsxDEV("div", {
187
- className: "min-w-0 flex-1",
188
- children: /* @__PURE__ */ jsxDEV("p", {
189
- className: `font-medium ${isStepCompleted ? "text-green-500" : isCurrent ? "text-foreground" : "text-muted-foreground"}`,
190
- children: step.title
191
- }, undefined, false, undefined, this)
192
- }, undefined, false, undefined, this),
193
- step.xpReward && /* @__PURE__ */ jsxDEV("span", {
194
- className: "text-muted-foreground text-sm",
195
- children: [
196
- "+",
197
- step.xpReward,
198
- " XP"
199
- ]
200
- }, undefined, true, undefined, this)
201
- ]
202
- }, step.id, true, undefined, this);
203
- })
204
- }, undefined, false, undefined, this)
205
- }, undefined, false, undefined, this)
206
- ]
207
- }, undefined, true, undefined, this),
208
- isComplete && /* @__PURE__ */ jsxDEV(Card, {
209
- className: "border-green-500/50 bg-green-500/5",
210
- children: /* @__PURE__ */ jsxDEV(CardContent, {
211
- className: "flex items-center gap-4 p-6",
212
- children: [
213
- /* @__PURE__ */ jsxDEV("div", {
214
- className: "text-4xl",
215
- children: "\uD83C\uDF89"
216
- }, undefined, false, undefined, this),
217
- /* @__PURE__ */ jsxDEV("div", {
218
- children: [
219
- /* @__PURE__ */ jsxDEV("h3", {
220
- className: "font-semibold text-green-500 text-lg",
221
- children: "Onboarding Complete!"
222
- }, undefined, false, undefined, this),
223
- /* @__PURE__ */ jsxDEV("p", {
224
- className: "text-muted-foreground",
225
- children: [
226
- "You've completed all ",
227
- totalSteps,
228
- " steps. Welcome aboard!"
229
- ]
230
- }, undefined, true, undefined, this)
231
- ]
232
- }, undefined, true, undefined, this)
233
- ]
234
- }, undefined, true, undefined, this)
235
- }, undefined, false, undefined, this)
236
- ]
237
- }, undefined, true, undefined, this);
238
- }
239
- export {
240
- Overview
241
- };
2
+ import{XpBar as W}from"@contractspec/example.learning-journey-ui-shared";import{Button as Y}from"@contractspec/lib.design-system";import{Card as A,CardContent as D,CardHeader as J,CardTitle as K}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as Z}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as f,jsxs as h}from"react/jsx-runtime";function b({track:q,progress:E,onStart:R}){let y=q.steps.length,F=E.completedStepIds.length,N=y>0?F/y*100:0,z=F===y,O=y-F,L=O*5,U=q.totalXp??q.steps.reduce((v,G)=>v+(G.xpReward??0),0)+(q.completionRewards?.xpBonus??0);return h("div",{className:"space-y-6",children:[f(A,{className:"overflow-hidden bg-gradient-to-r from-blue-500/10 via-violet-500/10 to-purple-500/10",children:f(D,{className:"p-8",children:h("div",{className:"flex flex-col items-center gap-6 text-center md:flex-row md:text-left",children:[f("div",{className:"flex h-20 w-20 items-center justify-center rounded-2xl bg-gradient-to-br from-blue-500 to-violet-600 text-4xl shadow-lg",children:z?"\uD83C\uDF89":"\uD83D\uDE80"}),h("div",{className:"flex-1",children:[f("h1",{className:"font-bold text-2xl",children:q.name}),f("p",{className:"mt-1 max-w-2xl text-muted-foreground",children:q.description}),!z&&h("p",{className:"mt-3 text-muted-foreground text-sm",children:["\u23F1\uFE0F Estimated time:"," ",L>0?`~${L} minutes`:"Less than a minute"]})]}),!z&&f(Y,{size:"lg",onClick:R,children:F>0?"Continue":"Get Started"})]})})}),h("div",{className:"grid gap-4 md:grid-cols-3",children:[h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"Progress"})}),h(D,{children:[h("div",{className:"font-bold text-3xl",children:[Math.round(N),"%"]}),f(Z,{value:N,className:"mt-2 h-2"}),h("p",{className:"mt-2 text-muted-foreground text-sm",children:[F," of ",y," steps completed"]})]})]}),h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"XP Earned"})}),h(D,{children:[f("div",{className:"font-bold text-3xl text-blue-500",children:E.xpEarned}),f(W,{current:E.xpEarned,max:U,showLabel:!1,size:"sm"})]})]}),h(A,{children:[f(J,{className:"pb-2",children:f(K,{className:"font-medium text-muted-foreground text-sm",children:"Time Remaining"})}),h(D,{children:[f("div",{className:"font-bold text-3xl",children:z?"\u2713":`~${L}m`}),f("p",{className:"mt-2 text-muted-foreground text-sm",children:z?"All done!":`${O} steps to go`})]})]})]}),h(A,{children:[f(J,{children:h(K,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCCB"}),f("span",{children:"Your Journey"})]})}),f(D,{children:f("div",{className:"space-y-3",children:q.steps.map((v,G)=>{let I=E.completedStepIds.includes(v.id),Q=!I&&q.steps.slice(0,G).every((V)=>E.completedStepIds.includes(V.id));return h("div",{className:"flex items-center gap-4 rounded-lg border p-3",children:[f("div",{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${I?"bg-green-500 text-white":Q?"bg-blue-500 text-white":"bg-muted text-muted-foreground"}`,children:I?"\u2713":G+1}),f("div",{className:"min-w-0 flex-1",children:f("p",{className:`font-medium ${I?"text-green-500":Q?"text-foreground":"text-muted-foreground"}`,children:v.title})}),v.xpReward&&h("span",{className:"text-muted-foreground text-sm",children:["+",v.xpReward," XP"]})]},v.id)})})})]}),z&&f(A,{className:"border-green-500/50 bg-green-500/5",children:h(D,{className:"flex items-center gap-4 p-6",children:[f("div",{className:"text-4xl",children:"\uD83C\uDF89"}),h("div",{children:[f("h3",{className:"font-semibold text-green-500 text-lg",children:"Onboarding Complete!"}),h("p",{className:"text-muted-foreground",children:["You've completed all ",y," steps. Welcome aboard!"]})]})]})})]})}export{b as Overview};
@@ -1,276 +1,2 @@
1
1
  // @bun
2
- // src/views/Progress.tsx
3
- import {
4
- BadgeDisplay,
5
- XpBar
6
- } from "@contractspec/example.learning-journey-ui-shared";
7
- import {
8
- Card,
9
- CardContent,
10
- CardHeader,
11
- CardTitle
12
- } from "@contractspec/lib.ui-kit-web/ui/card";
13
- import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
14
- import { jsxDEV } from "react/jsx-dev-runtime";
15
- "use client";
16
- function ProgressView({ track, progress }) {
17
- const totalSteps = track.steps.length;
18
- const completedSteps = progress.completedStepIds.length;
19
- const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
20
- const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
21
- const remainingSteps = totalSteps - completedSteps;
22
- const estimatedMinutes = remainingSteps * 5;
23
- return /* @__PURE__ */ jsxDEV("div", {
24
- className: "space-y-6",
25
- children: [
26
- /* @__PURE__ */ jsxDEV(Card, {
27
- children: [
28
- /* @__PURE__ */ jsxDEV(CardHeader, {
29
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
30
- className: "flex items-center gap-2",
31
- children: [
32
- /* @__PURE__ */ jsxDEV("span", {
33
- children: "\uD83D\uDCC8"
34
- }, undefined, false, undefined, this),
35
- /* @__PURE__ */ jsxDEV("span", {
36
- children: "Your Progress"
37
- }, undefined, false, undefined, this)
38
- ]
39
- }, undefined, true, undefined, this)
40
- }, undefined, false, undefined, this),
41
- /* @__PURE__ */ jsxDEV(CardContent, {
42
- className: "space-y-6",
43
- children: [
44
- /* @__PURE__ */ jsxDEV("div", {
45
- className: "flex items-center justify-center",
46
- children: /* @__PURE__ */ jsxDEV("div", {
47
- className: "relative flex h-40 w-40 items-center justify-center",
48
- children: [
49
- /* @__PURE__ */ jsxDEV("svg", {
50
- className: "absolute h-full w-full -rotate-90",
51
- viewBox: "0 0 100 100",
52
- children: [
53
- /* @__PURE__ */ jsxDEV("circle", {
54
- cx: "50",
55
- cy: "50",
56
- r: "45",
57
- fill: "none",
58
- strokeWidth: "8",
59
- className: "stroke-muted"
60
- }, undefined, false, undefined, this),
61
- /* @__PURE__ */ jsxDEV("circle", {
62
- cx: "50",
63
- cy: "50",
64
- r: "45",
65
- fill: "none",
66
- strokeWidth: "8",
67
- strokeLinecap: "round",
68
- strokeDasharray: `${percentComplete * 2.83} 283`,
69
- className: "stroke-blue-500 transition-all duration-500"
70
- }, undefined, false, undefined, this)
71
- ]
72
- }, undefined, true, undefined, this),
73
- /* @__PURE__ */ jsxDEV("div", {
74
- className: "text-center",
75
- children: [
76
- /* @__PURE__ */ jsxDEV("div", {
77
- className: "font-bold text-3xl",
78
- children: [
79
- Math.round(percentComplete),
80
- "%"
81
- ]
82
- }, undefined, true, undefined, this),
83
- /* @__PURE__ */ jsxDEV("div", {
84
- className: "text-muted-foreground text-sm",
85
- children: "Complete"
86
- }, undefined, false, undefined, this)
87
- ]
88
- }, undefined, true, undefined, this)
89
- ]
90
- }, undefined, true, undefined, this)
91
- }, undefined, false, undefined, this),
92
- /* @__PURE__ */ jsxDEV("div", {
93
- className: "grid grid-cols-3 gap-4 text-center",
94
- children: [
95
- /* @__PURE__ */ jsxDEV("div", {
96
- children: [
97
- /* @__PURE__ */ jsxDEV("div", {
98
- className: "font-bold text-2xl text-green-500",
99
- children: completedSteps
100
- }, undefined, false, undefined, this),
101
- /* @__PURE__ */ jsxDEV("div", {
102
- className: "text-muted-foreground text-sm",
103
- children: "Completed"
104
- }, undefined, false, undefined, this)
105
- ]
106
- }, undefined, true, undefined, this),
107
- /* @__PURE__ */ jsxDEV("div", {
108
- children: [
109
- /* @__PURE__ */ jsxDEV("div", {
110
- className: "font-bold text-2xl text-orange-500",
111
- children: remainingSteps
112
- }, undefined, false, undefined, this),
113
- /* @__PURE__ */ jsxDEV("div", {
114
- className: "text-muted-foreground text-sm",
115
- children: "Remaining"
116
- }, undefined, false, undefined, this)
117
- ]
118
- }, undefined, true, undefined, this),
119
- /* @__PURE__ */ jsxDEV("div", {
120
- children: [
121
- /* @__PURE__ */ jsxDEV("div", {
122
- className: "font-bold text-2xl",
123
- children: [
124
- estimatedMinutes,
125
- "m"
126
- ]
127
- }, undefined, true, undefined, this),
128
- /* @__PURE__ */ jsxDEV("div", {
129
- className: "text-muted-foreground text-sm",
130
- children: "Est. Time"
131
- }, undefined, false, undefined, this)
132
- ]
133
- }, undefined, true, undefined, this)
134
- ]
135
- }, undefined, true, undefined, this)
136
- ]
137
- }, undefined, true, undefined, this)
138
- ]
139
- }, undefined, true, undefined, this),
140
- /* @__PURE__ */ jsxDEV(Card, {
141
- children: [
142
- /* @__PURE__ */ jsxDEV(CardHeader, {
143
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
144
- className: "flex items-center gap-2",
145
- children: [
146
- /* @__PURE__ */ jsxDEV("span", {
147
- children: "\u26A1"
148
- }, undefined, false, undefined, this),
149
- /* @__PURE__ */ jsxDEV("span", {
150
- children: "Experience Points"
151
- }, undefined, false, undefined, this)
152
- ]
153
- }, undefined, true, undefined, this)
154
- }, undefined, false, undefined, this),
155
- /* @__PURE__ */ jsxDEV(CardContent, {
156
- className: "space-y-4",
157
- children: [
158
- /* @__PURE__ */ jsxDEV("div", {
159
- className: "flex items-baseline gap-2",
160
- children: [
161
- /* @__PURE__ */ jsxDEV("span", {
162
- className: "font-bold text-3xl text-blue-500",
163
- children: progress.xpEarned
164
- }, undefined, false, undefined, this),
165
- /* @__PURE__ */ jsxDEV("span", {
166
- className: "text-muted-foreground",
167
- children: [
168
- "/ ",
169
- totalXp,
170
- " XP"
171
- ]
172
- }, undefined, true, undefined, this)
173
- ]
174
- }, undefined, true, undefined, this),
175
- /* @__PURE__ */ jsxDEV(XpBar, {
176
- current: progress.xpEarned,
177
- max: totalXp,
178
- showLabel: false,
179
- size: "lg"
180
- }, undefined, false, undefined, this)
181
- ]
182
- }, undefined, true, undefined, this)
183
- ]
184
- }, undefined, true, undefined, this),
185
- /* @__PURE__ */ jsxDEV(Card, {
186
- children: [
187
- /* @__PURE__ */ jsxDEV(CardHeader, {
188
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
189
- className: "flex items-center gap-2",
190
- children: [
191
- /* @__PURE__ */ jsxDEV("span", {
192
- children: "\uD83C\uDFC5"
193
- }, undefined, false, undefined, this),
194
- /* @__PURE__ */ jsxDEV("span", {
195
- children: "Achievements"
196
- }, undefined, false, undefined, this)
197
- ]
198
- }, undefined, true, undefined, this)
199
- }, undefined, false, undefined, this),
200
- /* @__PURE__ */ jsxDEV(CardContent, {
201
- children: [
202
- /* @__PURE__ */ jsxDEV(BadgeDisplay, {
203
- badges: progress.badges,
204
- size: "lg"
205
- }, undefined, false, undefined, this),
206
- progress.badges.length === 0 && track.completionRewards?.badgeKey && /* @__PURE__ */ jsxDEV("p", {
207
- className: "text-muted-foreground text-sm",
208
- children: [
209
- 'Complete all steps to earn the "',
210
- track.completionRewards.badgeKey,
211
- '" badge!'
212
- ]
213
- }, undefined, true, undefined, this)
214
- ]
215
- }, undefined, true, undefined, this)
216
- ]
217
- }, undefined, true, undefined, this),
218
- /* @__PURE__ */ jsxDEV(Card, {
219
- children: [
220
- /* @__PURE__ */ jsxDEV(CardHeader, {
221
- children: /* @__PURE__ */ jsxDEV(CardTitle, {
222
- className: "flex items-center gap-2",
223
- children: [
224
- /* @__PURE__ */ jsxDEV("span", {
225
- children: "\uD83D\uDCCB"
226
- }, undefined, false, undefined, this),
227
- /* @__PURE__ */ jsxDEV("span", {
228
- children: "Step Details"
229
- }, undefined, false, undefined, this)
230
- ]
231
- }, undefined, true, undefined, this)
232
- }, undefined, false, undefined, this),
233
- /* @__PURE__ */ jsxDEV(CardContent, {
234
- children: /* @__PURE__ */ jsxDEV("div", {
235
- className: "space-y-3",
236
- children: track.steps.map((step, index) => {
237
- const isCompleted = progress.completedStepIds.includes(step.id);
238
- const stepProgress = isCompleted ? 100 : 0;
239
- return /* @__PURE__ */ jsxDEV("div", {
240
- className: "space-y-1",
241
- children: [
242
- /* @__PURE__ */ jsxDEV("div", {
243
- className: "flex items-center justify-between text-sm",
244
- children: [
245
- /* @__PURE__ */ jsxDEV("span", {
246
- className: isCompleted ? "text-green-500" : "text-foreground",
247
- children: [
248
- index + 1,
249
- ". ",
250
- step.title
251
- ]
252
- }, undefined, true, undefined, this),
253
- /* @__PURE__ */ jsxDEV("span", {
254
- className: isCompleted ? "text-green-500" : "text-muted-foreground",
255
- children: isCompleted ? "\u2713" : "Pending"
256
- }, undefined, false, undefined, this)
257
- ]
258
- }, undefined, true, undefined, this),
259
- /* @__PURE__ */ jsxDEV(Progress, {
260
- value: stepProgress,
261
- className: "h-1"
262
- }, undefined, false, undefined, this)
263
- ]
264
- }, step.id, true, undefined, this);
265
- })
266
- }, undefined, false, undefined, this)
267
- }, undefined, false, undefined, this)
268
- ]
269
- }, undefined, true, undefined, this)
270
- ]
271
- }, undefined, true, undefined, this);
272
- }
273
- export {
274
- ProgressView,
275
- ProgressView as Progress
276
- };
2
+ import{BadgeDisplay as W,XpBar as Y}from"@contractspec/example.learning-journey-ui-shared";import{Card as E,CardContent as F,CardHeader as G,CardTitle as I}from"@contractspec/lib.ui-kit-web/ui/card";import{Progress as Z}from"@contractspec/lib.ui-kit-web/ui/progress";import{jsx as f,jsxs as h}from"react/jsx-runtime";function D({track:q,progress:v}){let J=q.steps.length,K=v.completedStepIds.length,N=J>0?K/J*100:0,O=q.totalXp??q.steps.reduce((z,L)=>z+(L.xpReward??0),0)+(q.completionRewards?.xpBonus??0),Q=J-K,R=Q*5;return h("div",{className:"space-y-6",children:[h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCC8"}),f("span",{children:"Your Progress"})]})}),h(F,{className:"space-y-6",children:[f("div",{className:"flex items-center justify-center",children:h("div",{className:"relative flex h-40 w-40 items-center justify-center",children:[h("svg",{className:"absolute h-full w-full -rotate-90",viewBox:"0 0 100 100",children:[f("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",className:"stroke-muted"}),f("circle",{cx:"50",cy:"50",r:"45",fill:"none",strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${N*2.83} 283`,className:"stroke-blue-500 transition-all duration-500"})]}),h("div",{className:"text-center",children:[h("div",{className:"font-bold text-3xl",children:[Math.round(N),"%"]}),f("div",{className:"text-muted-foreground text-sm",children:"Complete"})]})]})}),h("div",{className:"grid grid-cols-3 gap-4 text-center",children:[h("div",{children:[f("div",{className:"font-bold text-2xl text-green-500",children:K}),f("div",{className:"text-muted-foreground text-sm",children:"Completed"})]}),h("div",{children:[f("div",{className:"font-bold text-2xl text-orange-500",children:Q}),f("div",{className:"text-muted-foreground text-sm",children:"Remaining"})]}),h("div",{children:[h("div",{className:"font-bold text-2xl",children:[R,"m"]}),f("div",{className:"text-muted-foreground text-sm",children:"Est. Time"})]})]})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\u26A1"}),f("span",{children:"Experience Points"})]})}),h(F,{className:"space-y-4",children:[h("div",{className:"flex items-baseline gap-2",children:[f("span",{className:"font-bold text-3xl text-blue-500",children:v.xpEarned}),h("span",{className:"text-muted-foreground",children:["/ ",O," XP"]})]}),f(Y,{current:v.xpEarned,max:O,showLabel:!1,size:"lg"})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83C\uDFC5"}),f("span",{children:"Achievements"})]})}),h(F,{children:[f(W,{badges:v.badges,size:"lg"}),v.badges.length===0&&q.completionRewards?.badgeKey&&h("p",{className:"text-muted-foreground text-sm",children:['Complete all steps to earn the "',q.completionRewards.badgeKey,'" badge!']})]})]}),h(E,{children:[f(G,{children:h(I,{className:"flex items-center gap-2",children:[f("span",{children:"\uD83D\uDCCB"}),f("span",{children:"Step Details"})]})}),f(F,{children:f("div",{className:"space-y-3",children:q.steps.map((z,L)=>{let A=v.completedStepIds.includes(z.id),U=A?100:0;return h("div",{className:"space-y-1",children:[h("div",{className:"flex items-center justify-between text-sm",children:[h("span",{className:A?"text-green-500":"text-foreground",children:[L+1,". ",z.title]}),f("span",{className:A?"text-green-500":"text-muted-foreground",children:A?"\u2713":"Pending"})]}),f(Z,{value:U,className:"h-1"})]},z.id)})})})]})]})}export{D as ProgressView,D as Progress};