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

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