@contractspec/example.learning-journey-ui-gamified 3.7.5 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/AGENTS.md +50 -25
- package/CHANGELOG.md +14 -0
- package/README.md +63 -20
- package/dist/GamifiedMiniApp.js +246 -246
- package/dist/browser/GamifiedMiniApp.js +246 -246
- package/dist/browser/components/DayCalendar.js +1 -1
- package/dist/browser/components/FlashCard.js +6 -6
- package/dist/browser/components/MasteryRing.js +1 -1
- package/dist/browser/components/index.js +100 -100
- package/dist/browser/index.js +247 -246
- package/dist/browser/views/Overview.js +16 -16
- package/dist/browser/views/Progress.js +7 -7
- package/dist/browser/views/Steps.js +8 -8
- package/dist/browser/views/Timeline.js +8 -8
- package/dist/browser/views/index.js +242 -242
- package/dist/components/DayCalendar.js +1 -1
- package/dist/components/FlashCard.js +6 -6
- package/dist/components/MasteryRing.js +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +100 -100
- package/dist/index.d.ts +3 -3
- package/dist/index.js +247 -246
- package/dist/node/GamifiedMiniApp.js +246 -246
- package/dist/node/components/DayCalendar.js +1 -1
- package/dist/node/components/FlashCard.js +6 -6
- package/dist/node/components/MasteryRing.js +1 -1
- package/dist/node/components/index.js +100 -100
- package/dist/node/index.js +247 -246
- package/dist/node/views/Overview.js +16 -16
- package/dist/node/views/Progress.js +7 -7
- package/dist/node/views/Steps.js +8 -8
- package/dist/node/views/Timeline.js +8 -8
- package/dist/node/views/index.js +242 -242
- package/dist/views/Overview.js +16 -16
- package/dist/views/Progress.js +7 -7
- package/dist/views/Steps.js +8 -8
- package/dist/views/Timeline.js +8 -8
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +242 -242
- package/package.json +12 -12
- package/src/GamifiedMiniApp.tsx +70 -70
- package/src/components/DayCalendar.tsx +41 -41
- package/src/components/FlashCard.tsx +83 -83
- package/src/components/MasteryRing.tsx +64 -64
- package/src/components/index.ts +1 -1
- package/src/docs/learning-journey-ui-gamified.docblock.ts +11 -11
- package/src/example.ts +25 -25
- package/src/index.ts +5 -6
- package/src/learning-journey-ui-gamified.feature.ts +12 -12
- package/src/views/Overview.tsx +145 -145
- package/src/views/Progress.tsx +167 -167
- package/src/views/Steps.tsx +40 -40
- package/src/views/Timeline.tsx +177 -177
- package/src/views/index.ts +1 -1
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -13
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
// src/views/Overview.tsx
|
|
2
|
+
import {
|
|
3
|
+
BadgeDisplay,
|
|
4
|
+
StreakCounter,
|
|
5
|
+
XpBar
|
|
6
|
+
} from "@contractspec/example.learning-journey-ui-shared";
|
|
2
7
|
import { Button } from "@contractspec/lib.design-system";
|
|
3
8
|
import {
|
|
4
9
|
Card,
|
|
@@ -6,11 +11,6 @@ import {
|
|
|
6
11
|
CardHeader,
|
|
7
12
|
CardTitle
|
|
8
13
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
9
|
-
import {
|
|
10
|
-
XpBar,
|
|
11
|
-
StreakCounter,
|
|
12
|
-
BadgeDisplay
|
|
13
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
14
14
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
15
15
|
"use client";
|
|
16
16
|
function Overview({ track, progress, onStart }) {
|
|
@@ -36,11 +36,11 @@ function Overview({ track, progress, onStart }) {
|
|
|
36
36
|
className: "flex-1",
|
|
37
37
|
children: [
|
|
38
38
|
/* @__PURE__ */ jsxDEV("h1", {
|
|
39
|
-
className: "text-2xl
|
|
39
|
+
className: "font-bold text-2xl",
|
|
40
40
|
children: track.name
|
|
41
41
|
}, undefined, false, undefined, this),
|
|
42
42
|
/* @__PURE__ */ jsxDEV("p", {
|
|
43
|
-
className: "text-muted-foreground
|
|
43
|
+
className: "mt-1 text-muted-foreground",
|
|
44
44
|
children: track.description
|
|
45
45
|
}, undefined, false, undefined, this)
|
|
46
46
|
]
|
|
@@ -64,14 +64,14 @@ function Overview({ track, progress, onStart }) {
|
|
|
64
64
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
65
65
|
className: "pb-2",
|
|
66
66
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
67
|
-
className: "text-muted-foreground text-sm
|
|
67
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
68
68
|
children: "XP Progress"
|
|
69
69
|
}, undefined, false, undefined, this)
|
|
70
70
|
}, undefined, false, undefined, this),
|
|
71
71
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ jsxDEV("div", {
|
|
74
|
-
className: "
|
|
74
|
+
className: "font-bold text-3xl text-violet-500",
|
|
75
75
|
children: progress.xpEarned.toLocaleString()
|
|
76
76
|
}, undefined, false, undefined, this),
|
|
77
77
|
/* @__PURE__ */ jsxDEV(XpBar, {
|
|
@@ -89,19 +89,19 @@ function Overview({ track, progress, onStart }) {
|
|
|
89
89
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
90
90
|
className: "pb-2",
|
|
91
91
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
92
|
-
className: "text-muted-foreground text-sm
|
|
92
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
93
93
|
children: "Steps Completed"
|
|
94
94
|
}, undefined, false, undefined, this)
|
|
95
95
|
}, undefined, false, undefined, this),
|
|
96
96
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
97
97
|
children: [
|
|
98
98
|
/* @__PURE__ */ jsxDEV("div", {
|
|
99
|
-
className: "text-3xl
|
|
99
|
+
className: "font-bold text-3xl",
|
|
100
100
|
children: [
|
|
101
101
|
completedSteps,
|
|
102
102
|
" ",
|
|
103
103
|
/* @__PURE__ */ jsxDEV("span", {
|
|
104
|
-
className: "text-muted-foreground
|
|
104
|
+
className: "text-lg text-muted-foreground",
|
|
105
105
|
children: [
|
|
106
106
|
"/ ",
|
|
107
107
|
totalSteps
|
|
@@ -110,7 +110,7 @@ function Overview({ track, progress, onStart }) {
|
|
|
110
110
|
]
|
|
111
111
|
}, undefined, true, undefined, this),
|
|
112
112
|
/* @__PURE__ */ jsxDEV("div", {
|
|
113
|
-
className: "
|
|
113
|
+
className: "mt-2 h-2 w-full overflow-hidden rounded-full bg-muted",
|
|
114
114
|
children: /* @__PURE__ */ jsxDEV("div", {
|
|
115
115
|
className: "h-full bg-green-500 transition-all duration-500",
|
|
116
116
|
style: { width: `${completedSteps / totalSteps * 100}%` }
|
|
@@ -125,7 +125,7 @@ function Overview({ track, progress, onStart }) {
|
|
|
125
125
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
126
126
|
className: "pb-2",
|
|
127
127
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
128
|
-
className: "text-muted-foreground text-sm
|
|
128
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
129
129
|
children: "Badges Earned"
|
|
130
130
|
}, undefined, false, undefined, this)
|
|
131
131
|
}, undefined, false, undefined, this),
|
|
@@ -178,7 +178,7 @@ function Overview({ track, progress, onStart }) {
|
|
|
178
178
|
className: "flex items-center gap-3",
|
|
179
179
|
children: [
|
|
180
180
|
nextStep.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
181
|
-
className: "rounded-full bg-green-500/10 px-3 py-1
|
|
181
|
+
className: "rounded-full bg-green-500/10 px-3 py-1 font-semibold text-green-500 text-sm",
|
|
182
182
|
children: [
|
|
183
183
|
"+",
|
|
184
184
|
nextStep.xpReward,
|
|
@@ -209,7 +209,7 @@ function Overview({ track, progress, onStart }) {
|
|
|
209
209
|
/* @__PURE__ */ jsxDEV("div", {
|
|
210
210
|
children: [
|
|
211
211
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
212
|
-
className: "
|
|
212
|
+
className: "font-semibold text-green-500 text-lg",
|
|
213
213
|
children: "Track Complete!"
|
|
214
214
|
}, undefined, false, undefined, this),
|
|
215
215
|
/* @__PURE__ */ jsxDEV("p", {
|
|
@@ -64,7 +64,7 @@ function MasteryRing({
|
|
|
64
64
|
}, undefined, true, undefined, this)
|
|
65
65
|
}, undefined, false, undefined, this),
|
|
66
66
|
/* @__PURE__ */ jsxDEV("span", {
|
|
67
|
-
className: cn("text-muted-foreground
|
|
67
|
+
className: cn("mt-1 truncate text-muted-foreground", styles.text),
|
|
68
68
|
children: label
|
|
69
69
|
}, undefined, false, undefined, this)
|
|
70
70
|
]
|
|
@@ -72,16 +72,16 @@ function MasteryRing({
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/views/Progress.tsx
|
|
75
|
+
import {
|
|
76
|
+
BadgeDisplay,
|
|
77
|
+
XpBar
|
|
78
|
+
} from "@contractspec/example.learning-journey-ui-shared";
|
|
75
79
|
import {
|
|
76
80
|
Card,
|
|
77
81
|
CardContent,
|
|
78
82
|
CardHeader,
|
|
79
83
|
CardTitle
|
|
80
84
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
81
|
-
import {
|
|
82
|
-
XpBar,
|
|
83
|
-
BadgeDisplay
|
|
84
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
85
85
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
86
86
|
"use client";
|
|
87
87
|
function Progress({ track, progress }) {
|
|
@@ -129,7 +129,7 @@ function Progress({ track, progress }) {
|
|
|
129
129
|
className: "flex items-baseline gap-2",
|
|
130
130
|
children: [
|
|
131
131
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
132
|
-
className: "
|
|
132
|
+
className: "font-bold text-4xl text-violet-500",
|
|
133
133
|
children: progress.xpEarned.toLocaleString()
|
|
134
134
|
}, undefined, false, undefined, this),
|
|
135
135
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
@@ -272,7 +272,7 @@ function Progress({ track, progress }) {
|
|
|
272
272
|
]
|
|
273
273
|
}, undefined, true, undefined, this),
|
|
274
274
|
step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
|
|
275
|
-
className: `text-sm
|
|
275
|
+
className: `font-medium text-sm ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
|
|
276
276
|
children: [
|
|
277
277
|
isCompleted ? "+" : "",
|
|
278
278
|
step.xpReward,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/components/FlashCard.tsx
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Button } from "@contractspec/lib.design-system";
|
|
4
3
|
import { Card, CardContent } from "@contractspec/lib.ui-kit-web/ui/card";
|
|
5
4
|
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
5
|
+
import { useState } from "react";
|
|
6
6
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
7
7
|
"use client";
|
|
8
8
|
function FlashCard({
|
|
@@ -13,7 +13,7 @@ function FlashCard({
|
|
|
13
13
|
}) {
|
|
14
14
|
const [isFlipped, setIsFlipped] = useState(false);
|
|
15
15
|
return /* @__PURE__ */ jsxDEV(Card, {
|
|
16
|
-
className: cn("relative cursor-pointer overflow-hidden transition-all duration-300", isCurrent && "ring-
|
|
16
|
+
className: cn("relative cursor-pointer overflow-hidden transition-all duration-300", isCurrent && "ring-2 ring-primary", isCompleted && "opacity-60"),
|
|
17
17
|
onClick: () => !isCompleted && setIsFlipped(!isFlipped),
|
|
18
18
|
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
19
19
|
className: "p-6",
|
|
@@ -28,17 +28,17 @@ function FlashCard({
|
|
|
28
28
|
className: "flex-1",
|
|
29
29
|
children: [
|
|
30
30
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
31
|
-
className: "text-lg
|
|
31
|
+
className: "font-semibold text-lg",
|
|
32
32
|
children: step.title
|
|
33
33
|
}, undefined, false, undefined, this),
|
|
34
34
|
step.description && /* @__PURE__ */ jsxDEV("p", {
|
|
35
|
-
className: "text-muted-foreground
|
|
35
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
36
36
|
children: step.description
|
|
37
37
|
}, undefined, false, undefined, this)
|
|
38
38
|
]
|
|
39
39
|
}, undefined, true, undefined, this),
|
|
40
40
|
step.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
41
|
-
className: "rounded-full bg-green-500/10 px-2 py-1
|
|
41
|
+
className: "rounded-full bg-green-500/10 px-2 py-1 font-semibold text-green-500 text-xs",
|
|
42
42
|
children: [
|
|
43
43
|
"+",
|
|
44
44
|
step.xpReward,
|
|
@@ -54,7 +54,7 @@ function FlashCard({
|
|
|
54
54
|
children: "✓"
|
|
55
55
|
}, undefined, false, undefined, this),
|
|
56
56
|
/* @__PURE__ */ jsxDEV("span", {
|
|
57
|
-
className: "text-sm
|
|
57
|
+
className: "font-medium text-sm",
|
|
58
58
|
children: "Completed"
|
|
59
59
|
}, undefined, false, undefined, this)
|
|
60
60
|
]
|
|
@@ -110,7 +110,7 @@ function Steps({ track, progress, onStepComplete }) {
|
|
|
110
110
|
className: "text-center",
|
|
111
111
|
children: [
|
|
112
112
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
113
|
-
className: "text-xl
|
|
113
|
+
className: "font-bold text-xl",
|
|
114
114
|
children: "Complete Your Challenges"
|
|
115
115
|
}, undefined, false, undefined, this),
|
|
116
116
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -133,7 +133,7 @@ function Steps({ track, progress, onStepComplete }) {
|
|
|
133
133
|
})
|
|
134
134
|
}, undefined, false, undefined, this),
|
|
135
135
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
136
|
-
className: "text-muted-foreground text-
|
|
136
|
+
className: "text-center text-muted-foreground text-sm",
|
|
137
137
|
children: [
|
|
138
138
|
progress.completedStepIds.length,
|
|
139
139
|
" of ",
|
|
@@ -15,7 +15,7 @@ function DayCalendar({
|
|
|
15
15
|
const isCurrent = day === currentDay;
|
|
16
16
|
const isLocked = day > currentDay;
|
|
17
17
|
return /* @__PURE__ */ jsxDEV("div", {
|
|
18
|
-
className: cn("flex h-12 w-12 flex-col items-center justify-center rounded-lg border text-sm
|
|
18
|
+
className: cn("flex h-12 w-12 flex-col items-center justify-center rounded-lg border font-medium text-sm transition-all", isCompleted && "border-green-500 bg-green-500/10 text-green-500", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/10 text-violet-500 ring-2 ring-violet-500/50", isLocked && "border-muted bg-muted/50 text-muted-foreground", !isCompleted && !isCurrent && !isLocked && "border-border bg-card"),
|
|
19
19
|
children: isCompleted ? /* @__PURE__ */ jsxDEV("span", {
|
|
20
20
|
className: "text-lg",
|
|
21
21
|
children: "✓"
|
|
@@ -60,7 +60,7 @@ function Timeline({ track, progress }) {
|
|
|
60
60
|
className: "text-center",
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
63
|
-
className: "text-xl
|
|
63
|
+
className: "font-bold text-xl",
|
|
64
64
|
children: track.name
|
|
65
65
|
}, undefined, false, undefined, this),
|
|
66
66
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -120,7 +120,7 @@ function Timeline({ track, progress }) {
|
|
|
120
120
|
className: `flex items-start gap-4 rounded-lg border p-4 ${isLocked ? "opacity-50" : ""}`,
|
|
121
121
|
children: [
|
|
122
122
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
123
|
-
className: "
|
|
123
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-muted font-semibold",
|
|
124
124
|
children: isCompleted ? "✓" : isLocked ? "\uD83D\uDD12" : day
|
|
125
125
|
}, undefined, false, undefined, this),
|
|
126
126
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -137,7 +137,7 @@ function Timeline({ track, progress }) {
|
|
|
137
137
|
]
|
|
138
138
|
}, undefined, true, undefined, this),
|
|
139
139
|
step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
|
|
140
|
-
className: `text-sm
|
|
140
|
+
className: `font-medium text-sm ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
|
|
141
141
|
children: [
|
|
142
142
|
"+",
|
|
143
143
|
step.xpReward,
|
|
@@ -161,7 +161,7 @@ function Timeline({ track, progress }) {
|
|
|
161
161
|
className: "text-center",
|
|
162
162
|
children: [
|
|
163
163
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
164
|
-
className: "text-xl
|
|
164
|
+
className: "font-bold text-xl",
|
|
165
165
|
children: "Learning Path"
|
|
166
166
|
}, undefined, false, undefined, this),
|
|
167
167
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -177,7 +177,7 @@ function Timeline({ track, progress }) {
|
|
|
177
177
|
className: "relative",
|
|
178
178
|
children: [
|
|
179
179
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
180
|
-
className: "
|
|
180
|
+
className: "absolute top-0 left-5 h-full w-0.5 bg-border"
|
|
181
181
|
}, undefined, false, undefined, this),
|
|
182
182
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
183
183
|
className: "space-y-6",
|
|
@@ -203,13 +203,13 @@ function Timeline({ track, progress }) {
|
|
|
203
203
|
children: step.title
|
|
204
204
|
}, undefined, false, undefined, this),
|
|
205
205
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
206
|
-
className: "text-muted-foreground
|
|
206
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
207
207
|
children: step.description
|
|
208
208
|
}, undefined, false, undefined, this)
|
|
209
209
|
]
|
|
210
210
|
}, undefined, true, undefined, this),
|
|
211
211
|
step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
|
|
212
|
-
className: `shrink-0 rounded-full px-2 py-1 text-xs
|
|
212
|
+
className: `shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"}`,
|
|
213
213
|
children: [
|
|
214
214
|
"+",
|
|
215
215
|
step.xpReward,
|