@contractspec/example.learning-journey-ui-gamified 1.56.1 → 1.58.0

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 (87) hide show
  1. package/.turbo/turbo-build.log +59 -58
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +40 -0
  4. package/dist/GamifiedMiniApp.d.ts +4 -14
  5. package/dist/GamifiedMiniApp.d.ts.map +1 -1
  6. package/dist/GamifiedMiniApp.js +995 -59
  7. package/dist/browser/GamifiedMiniApp.js +998 -0
  8. package/dist/browser/components/DayCalendar.js +42 -0
  9. package/dist/browser/components/FlashCard.js +102 -0
  10. package/dist/browser/components/MasteryRing.js +75 -0
  11. package/dist/browser/components/index.js +217 -0
  12. package/dist/browser/docs/index.js +22 -0
  13. package/dist/browser/docs/learning-journey-ui-gamified.docblock.js +22 -0
  14. package/dist/browser/example.js +32 -0
  15. package/dist/browser/index.js +1057 -0
  16. package/dist/browser/views/Overview.js +236 -0
  17. package/dist/browser/views/Progress.js +294 -0
  18. package/dist/browser/views/Steps.js +157 -0
  19. package/dist/browser/views/Timeline.js +235 -0
  20. package/dist/browser/views/index.js +919 -0
  21. package/dist/components/DayCalendar.d.ts +5 -13
  22. package/dist/components/DayCalendar.d.ts.map +1 -1
  23. package/dist/components/DayCalendar.js +41 -31
  24. package/dist/components/FlashCard.d.ts +7 -16
  25. package/dist/components/FlashCard.d.ts.map +1 -1
  26. package/dist/components/FlashCard.js +99 -76
  27. package/dist/components/MasteryRing.d.ts +6 -15
  28. package/dist/components/MasteryRing.d.ts.map +1 -1
  29. package/dist/components/MasteryRing.js +72 -78
  30. package/dist/components/index.d.ts +4 -4
  31. package/dist/components/index.d.ts.map +1 -0
  32. package/dist/components/index.js +217 -4
  33. package/dist/docs/index.d.ts +2 -1
  34. package/dist/docs/index.d.ts.map +1 -0
  35. package/dist/docs/index.js +23 -1
  36. package/dist/docs/learning-journey-ui-gamified.docblock.d.ts +2 -1
  37. package/dist/docs/learning-journey-ui-gamified.docblock.d.ts.map +1 -0
  38. package/dist/docs/learning-journey-ui-gamified.docblock.js +21 -18
  39. package/dist/example.d.ts +2 -6
  40. package/dist/example.d.ts.map +1 -1
  41. package/dist/example.js +30 -39
  42. package/dist/index.d.ts +6 -12
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +1058 -14
  45. package/dist/node/GamifiedMiniApp.js +998 -0
  46. package/dist/node/components/DayCalendar.js +42 -0
  47. package/dist/node/components/FlashCard.js +102 -0
  48. package/dist/node/components/MasteryRing.js +75 -0
  49. package/dist/node/components/index.js +217 -0
  50. package/dist/node/docs/index.js +22 -0
  51. package/dist/node/docs/learning-journey-ui-gamified.docblock.js +22 -0
  52. package/dist/node/example.js +32 -0
  53. package/dist/node/index.js +1057 -0
  54. package/dist/node/views/Overview.js +236 -0
  55. package/dist/node/views/Progress.js +294 -0
  56. package/dist/node/views/Steps.js +157 -0
  57. package/dist/node/views/Timeline.js +235 -0
  58. package/dist/node/views/index.js +919 -0
  59. package/dist/views/Overview.d.ts +4 -12
  60. package/dist/views/Overview.d.ts.map +1 -1
  61. package/dist/views/Overview.js +234 -158
  62. package/dist/views/Progress.d.ts +2 -10
  63. package/dist/views/Progress.d.ts.map +1 -1
  64. package/dist/views/Progress.js +292 -140
  65. package/dist/views/Steps.d.ts +2 -11
  66. package/dist/views/Steps.d.ts.map +1 -1
  67. package/dist/views/Steps.js +155 -53
  68. package/dist/views/Timeline.d.ts +2 -10
  69. package/dist/views/Timeline.d.ts.map +1 -1
  70. package/dist/views/Timeline.js +233 -130
  71. package/dist/views/index.d.ts +5 -5
  72. package/dist/views/index.d.ts.map +1 -0
  73. package/dist/views/index.js +919 -5
  74. package/package.json +155 -39
  75. package/tsdown.config.js +1 -2
  76. package/.turbo/turbo-build$colon$bundle.log +0 -57
  77. package/dist/GamifiedMiniApp.js.map +0 -1
  78. package/dist/components/DayCalendar.js.map +0 -1
  79. package/dist/components/FlashCard.js.map +0 -1
  80. package/dist/components/MasteryRing.js.map +0 -1
  81. package/dist/docs/learning-journey-ui-gamified.docblock.js.map +0 -1
  82. package/dist/example.js.map +0 -1
  83. package/dist/views/Overview.js.map +0 -1
  84. package/dist/views/Progress.js.map +0 -1
  85. package/dist/views/Steps.js.map +0 -1
  86. package/dist/views/Timeline.js.map +0 -1
  87. package/tsconfig.tsbuildinfo +0 -1
@@ -1,56 +1,158 @@
1
- 'use client';
2
-
3
- import { FlashCard } from "../components/FlashCard.js";
4
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // @bun
2
+ // src/components/FlashCard.tsx
3
+ import { useState } from "react";
4
+ import { Button } from "@contractspec/lib.design-system";
5
+ import { Card, CardContent } from "@contractspec/lib.ui-kit-web/ui/card";
6
+ import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
7
+ import { jsxDEV } from "react/jsx-dev-runtime";
8
+ "use client";
9
+ function FlashCard({
10
+ step,
11
+ isCompleted,
12
+ isCurrent,
13
+ onComplete
14
+ }) {
15
+ const [isFlipped, setIsFlipped] = useState(false);
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"),
18
+ onClick: () => !isCompleted && setIsFlipped(!isFlipped),
19
+ children: /* @__PURE__ */ jsxDEV(CardContent, {
20
+ className: "p-6",
21
+ children: [
22
+ /* @__PURE__ */ jsxDEV("div", {
23
+ className: cn("space-y-4 transition-opacity duration-200", isFlipped ? "opacity-0" : "opacity-100"),
24
+ children: [
25
+ /* @__PURE__ */ jsxDEV("div", {
26
+ className: "flex items-start justify-between",
27
+ children: [
28
+ /* @__PURE__ */ jsxDEV("div", {
29
+ className: "flex-1",
30
+ children: [
31
+ /* @__PURE__ */ jsxDEV("h3", {
32
+ className: "text-lg font-semibold",
33
+ children: step.title
34
+ }, undefined, false, undefined, this),
35
+ step.description && /* @__PURE__ */ jsxDEV("p", {
36
+ className: "text-muted-foreground mt-1 text-sm",
37
+ children: step.description
38
+ }, undefined, false, undefined, this)
39
+ ]
40
+ }, undefined, true, undefined, this),
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",
43
+ children: [
44
+ "+",
45
+ step.xpReward,
46
+ " XP"
47
+ ]
48
+ }, undefined, true, undefined, this)
49
+ ]
50
+ }, undefined, true, undefined, this),
51
+ isCompleted && /* @__PURE__ */ jsxDEV("div", {
52
+ className: "flex items-center gap-2 text-green-500",
53
+ children: [
54
+ /* @__PURE__ */ jsxDEV("span", {
55
+ children: "\u2713"
56
+ }, undefined, false, undefined, this),
57
+ /* @__PURE__ */ jsxDEV("span", {
58
+ className: "text-sm font-medium",
59
+ children: "Completed"
60
+ }, undefined, false, undefined, this)
61
+ ]
62
+ }, undefined, true, undefined, this),
63
+ isCurrent && !isCompleted && /* @__PURE__ */ jsxDEV("p", {
64
+ className: "text-muted-foreground text-xs",
65
+ children: "Tap to reveal action"
66
+ }, undefined, false, undefined, this)
67
+ ]
68
+ }, undefined, true, undefined, this),
69
+ isFlipped && !isCompleted && /* @__PURE__ */ jsxDEV("div", {
70
+ className: "absolute inset-0 flex flex-col items-center justify-center gap-4 bg-gradient-to-br from-violet-500/10 to-violet-600/10 p-6",
71
+ children: [
72
+ /* @__PURE__ */ jsxDEV("p", {
73
+ className: "text-center text-sm",
74
+ children: step.instructions ?? "Complete this step to earn XP"
75
+ }, undefined, false, undefined, this),
76
+ /* @__PURE__ */ jsxDEV("div", {
77
+ className: "flex gap-2",
78
+ children: [
79
+ /* @__PURE__ */ jsxDEV(Button, {
80
+ variant: "outline",
81
+ size: "sm",
82
+ onClick: () => setIsFlipped(false),
83
+ children: "Back"
84
+ }, undefined, false, undefined, this),
85
+ /* @__PURE__ */ jsxDEV(Button, {
86
+ size: "sm",
87
+ onClick: (e) => {
88
+ e.stopPropagation();
89
+ onComplete?.();
90
+ },
91
+ children: "Mark Complete"
92
+ }, undefined, false, undefined, this)
93
+ ]
94
+ }, undefined, true, undefined, this)
95
+ ]
96
+ }, undefined, true, undefined, this)
97
+ ]
98
+ }, undefined, true, undefined, this)
99
+ }, undefined, false, undefined, this);
100
+ }
5
101
 
6
- //#region src/views/Steps.tsx
102
+ // src/views/Steps.tsx
103
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
104
+ "use client";
7
105
  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
- });
106
+ const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
107
+ return /* @__PURE__ */ jsxDEV2("div", {
108
+ className: "space-y-6",
109
+ children: [
110
+ /* @__PURE__ */ jsxDEV2("div", {
111
+ className: "text-center",
112
+ children: [
113
+ /* @__PURE__ */ jsxDEV2("h2", {
114
+ className: "text-xl font-bold",
115
+ children: "Complete Your Challenges"
116
+ }, undefined, false, undefined, this),
117
+ /* @__PURE__ */ jsxDEV2("p", {
118
+ className: "text-muted-foreground",
119
+ children: "Tap each card to reveal the action, then mark as complete"
120
+ }, undefined, false, undefined, this)
121
+ ]
122
+ }, undefined, true, undefined, this),
123
+ /* @__PURE__ */ jsxDEV2("div", {
124
+ className: "grid gap-4 md:grid-cols-2",
125
+ children: track.steps.map((step, index) => {
126
+ const isCompleted = progress.completedStepIds.includes(step.id);
127
+ const isCurrent = index === currentStepIndex;
128
+ return /* @__PURE__ */ jsxDEV2(FlashCard, {
129
+ step,
130
+ isCompleted,
131
+ isCurrent,
132
+ onComplete: () => onStepComplete?.(step.id)
133
+ }, step.id, false, undefined, this);
134
+ })
135
+ }, undefined, false, undefined, this),
136
+ /* @__PURE__ */ jsxDEV2("div", {
137
+ className: "text-muted-foreground text-center text-sm",
138
+ children: [
139
+ progress.completedStepIds.length,
140
+ " of ",
141
+ track.steps.length,
142
+ " completed",
143
+ track.completionRewards?.xpBonus && /* @__PURE__ */ jsxDEV2("span", {
144
+ className: "ml-2 text-green-500",
145
+ children: [
146
+ "(+",
147
+ track.completionRewards.xpBonus,
148
+ " XP bonus on completion)"
149
+ ]
150
+ }, undefined, true, undefined, this)
151
+ ]
152
+ }, undefined, true, undefined, this)
153
+ ]
154
+ }, undefined, true, undefined, this);
52
155
  }
53
-
54
- //#endregion
55
- export { Steps };
56
- //# sourceMappingURL=Steps.js.map
156
+ export {
157
+ Steps
158
+ };
@@ -1,11 +1,3 @@
1
- import { LearningViewProps } from "@contractspec/example.learning-journey-ui-shared";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
3
-
4
- //#region src/views/Timeline.d.ts
5
- declare function Timeline({
6
- track,
7
- progress
8
- }: LearningViewProps): react_jsx_runtime5.JSX.Element;
9
- //#endregion
10
- export { Timeline };
1
+ import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared';
2
+ export declare function Timeline({ track, progress }: LearningViewProps): import("react/jsx-runtime").JSX.Element;
11
3
  //# sourceMappingURL=Timeline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.d.ts","names":[],"sources":["../../src/views/Timeline.tsx"],"sourcesContent":[],"mappings":";;;;iBAWgB,QAAA;;;GAA8B,oBAAiB,kBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/views/Timeline.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AAE1F,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAyL9D"}
@@ -1,133 +1,236 @@
1
- 'use client';
2
-
3
- import { DayCalendar } from "../components/DayCalendar.js";
4
- import { Card, CardContent, CardHeader, CardTitle } from "@contractspec/lib.ui-kit-web/ui/card";
5
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ // @bun
2
+ // src/components/DayCalendar.tsx
3
+ import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
4
+ import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
5
+ "use client";
6
+ function DayCalendar({
7
+ totalDays,
8
+ currentDay,
9
+ completedDays
10
+ }) {
11
+ const days = Array.from({ length: totalDays }, (_, i) => i + 1);
12
+ return /* @__PURE__ */ jsxDEV("div", {
13
+ className: "grid grid-cols-7 gap-2",
14
+ children: days.map((day) => {
15
+ const isCompleted = completedDays.includes(day);
16
+ const isCurrent = day === currentDay;
17
+ const isLocked = day > currentDay;
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"),
20
+ children: isCompleted ? /* @__PURE__ */ jsxDEV("span", {
21
+ className: "text-lg",
22
+ children: "\u2713"
23
+ }, undefined, false, undefined, this) : isLocked ? /* @__PURE__ */ jsxDEV("span", {
24
+ className: "text-lg",
25
+ children: "\uD83D\uDD12"
26
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV(Fragment, {
27
+ children: [
28
+ /* @__PURE__ */ jsxDEV("span", {
29
+ className: "text-muted-foreground text-xs",
30
+ children: "Day"
31
+ }, undefined, false, undefined, this),
32
+ /* @__PURE__ */ jsxDEV("span", {
33
+ children: day
34
+ }, undefined, false, undefined, this)
35
+ ]
36
+ }, undefined, true, undefined, this)
37
+ }, day, false, undefined, this);
38
+ })
39
+ }, undefined, false, undefined, this);
40
+ }
6
41
 
7
- //#region src/views/Timeline.tsx
42
+ // src/views/Timeline.tsx
43
+ import {
44
+ Card,
45
+ CardContent,
46
+ CardHeader,
47
+ CardTitle
48
+ } from "@contractspec/lib.ui-kit-web/ui/card";
49
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
50
+ "use client";
8
51
  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
- });
52
+ const hasQuestDays = track.steps.some((s) => s.availability?.unlockOnDay !== undefined);
53
+ if (hasQuestDays) {
54
+ const totalDays = Math.max(...track.steps.map((s) => s.availability?.unlockOnDay ?? 1), 7);
55
+ const completedDays = track.steps.filter((s) => progress.completedStepIds.includes(s.id)).map((s) => s.availability?.unlockOnDay ?? 1);
56
+ const currentDay = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.availability?.unlockOnDay ?? 1;
57
+ return /* @__PURE__ */ jsxDEV2("div", {
58
+ className: "space-y-6",
59
+ children: [
60
+ /* @__PURE__ */ jsxDEV2("div", {
61
+ className: "text-center",
62
+ children: [
63
+ /* @__PURE__ */ jsxDEV2("h2", {
64
+ className: "text-xl font-bold",
65
+ children: track.name
66
+ }, undefined, false, undefined, this),
67
+ /* @__PURE__ */ jsxDEV2("p", {
68
+ className: "text-muted-foreground",
69
+ children: "Complete each day's challenge to progress"
70
+ }, undefined, false, undefined, this)
71
+ ]
72
+ }, undefined, true, undefined, this),
73
+ /* @__PURE__ */ jsxDEV2(Card, {
74
+ children: [
75
+ /* @__PURE__ */ jsxDEV2(CardHeader, {
76
+ children: /* @__PURE__ */ jsxDEV2(CardTitle, {
77
+ className: "flex items-center gap-2",
78
+ children: [
79
+ /* @__PURE__ */ jsxDEV2("span", {
80
+ children: "\uD83D\uDCC5"
81
+ }, undefined, false, undefined, this),
82
+ /* @__PURE__ */ jsxDEV2("span", {
83
+ children: "Your Journey"
84
+ }, undefined, false, undefined, this)
85
+ ]
86
+ }, undefined, true, undefined, this)
87
+ }, undefined, false, undefined, this),
88
+ /* @__PURE__ */ jsxDEV2(CardContent, {
89
+ className: "flex justify-center",
90
+ children: /* @__PURE__ */ jsxDEV2(DayCalendar, {
91
+ totalDays,
92
+ currentDay,
93
+ completedDays
94
+ }, undefined, false, undefined, this)
95
+ }, undefined, false, undefined, this)
96
+ ]
97
+ }, undefined, true, undefined, this),
98
+ /* @__PURE__ */ jsxDEV2(Card, {
99
+ children: [
100
+ /* @__PURE__ */ jsxDEV2(CardHeader, {
101
+ children: /* @__PURE__ */ jsxDEV2(CardTitle, {
102
+ className: "flex items-center gap-2",
103
+ children: [
104
+ /* @__PURE__ */ jsxDEV2("span", {
105
+ children: "\uD83D\uDCDD"
106
+ }, undefined, false, undefined, this),
107
+ /* @__PURE__ */ jsxDEV2("span", {
108
+ children: "Daily Challenges"
109
+ }, undefined, false, undefined, this)
110
+ ]
111
+ }, undefined, true, undefined, this)
112
+ }, undefined, false, undefined, this),
113
+ /* @__PURE__ */ jsxDEV2(CardContent, {
114
+ children: /* @__PURE__ */ jsxDEV2("div", {
115
+ className: "space-y-3",
116
+ children: track.steps.map((step) => {
117
+ const day = step.availability?.unlockOnDay ?? 1;
118
+ const isCompleted = progress.completedStepIds.includes(step.id);
119
+ const isLocked = day > currentDay;
120
+ return /* @__PURE__ */ jsxDEV2("div", {
121
+ className: `flex items-start gap-4 rounded-lg border p-4 ${isLocked ? "opacity-50" : ""}`,
122
+ children: [
123
+ /* @__PURE__ */ jsxDEV2("div", {
124
+ className: "bg-muted flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold",
125
+ children: isCompleted ? "\u2713" : isLocked ? "\uD83D\uDD12" : day
126
+ }, undefined, false, undefined, this),
127
+ /* @__PURE__ */ jsxDEV2("div", {
128
+ className: "flex-1",
129
+ children: [
130
+ /* @__PURE__ */ jsxDEV2("h4", {
131
+ className: "font-semibold",
132
+ children: step.title
133
+ }, undefined, false, undefined, this),
134
+ /* @__PURE__ */ jsxDEV2("p", {
135
+ className: "text-muted-foreground text-sm",
136
+ children: step.description
137
+ }, undefined, false, undefined, this)
138
+ ]
139
+ }, undefined, true, undefined, this),
140
+ step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
141
+ className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
142
+ children: [
143
+ "+",
144
+ step.xpReward,
145
+ " XP"
146
+ ]
147
+ }, undefined, true, undefined, this)
148
+ ]
149
+ }, step.id, true, undefined, this);
150
+ })
151
+ }, undefined, false, undefined, this)
152
+ }, undefined, false, undefined, this)
153
+ ]
154
+ }, undefined, true, undefined, this)
155
+ ]
156
+ }, undefined, true, undefined, this);
157
+ }
158
+ return /* @__PURE__ */ jsxDEV2("div", {
159
+ className: "space-y-6",
160
+ children: [
161
+ /* @__PURE__ */ jsxDEV2("div", {
162
+ className: "text-center",
163
+ children: [
164
+ /* @__PURE__ */ jsxDEV2("h2", {
165
+ className: "text-xl font-bold",
166
+ children: "Learning Path"
167
+ }, undefined, false, undefined, this),
168
+ /* @__PURE__ */ jsxDEV2("p", {
169
+ className: "text-muted-foreground",
170
+ children: "Follow the steps to master this skill"
171
+ }, undefined, false, undefined, this)
172
+ ]
173
+ }, undefined, true, undefined, this),
174
+ /* @__PURE__ */ jsxDEV2(Card, {
175
+ children: /* @__PURE__ */ jsxDEV2(CardContent, {
176
+ className: "p-6",
177
+ children: /* @__PURE__ */ jsxDEV2("div", {
178
+ className: "relative",
179
+ children: [
180
+ /* @__PURE__ */ jsxDEV2("div", {
181
+ className: "bg-border absolute top-0 left-5 h-full w-0.5"
182
+ }, undefined, false, undefined, this),
183
+ /* @__PURE__ */ jsxDEV2("div", {
184
+ className: "space-y-6",
185
+ children: track.steps.map((step, index) => {
186
+ const isCompleted = progress.completedStepIds.includes(step.id);
187
+ const isCurrent = !isCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
188
+ return /* @__PURE__ */ jsxDEV2("div", {
189
+ className: "relative flex gap-4 pl-2",
190
+ children: [
191
+ /* @__PURE__ */ jsxDEV2("div", {
192
+ 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"}`,
193
+ children: isCompleted ? "\u2713" : index + 1
194
+ }, undefined, false, undefined, this),
195
+ /* @__PURE__ */ jsxDEV2("div", {
196
+ className: "flex-1 pb-4",
197
+ children: /* @__PURE__ */ jsxDEV2("div", {
198
+ className: "flex items-start justify-between gap-2",
199
+ children: [
200
+ /* @__PURE__ */ jsxDEV2("div", {
201
+ children: [
202
+ /* @__PURE__ */ jsxDEV2("h4", {
203
+ className: `font-semibold ${isCompleted ? "text-foreground" : isCurrent ? "text-violet-500" : "text-muted-foreground"}`,
204
+ children: step.title
205
+ }, undefined, false, undefined, this),
206
+ /* @__PURE__ */ jsxDEV2("p", {
207
+ className: "text-muted-foreground mt-1 text-sm",
208
+ children: step.description
209
+ }, undefined, false, undefined, this)
210
+ ]
211
+ }, undefined, true, undefined, this),
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"}`,
214
+ children: [
215
+ "+",
216
+ step.xpReward,
217
+ " XP"
218
+ ]
219
+ }, undefined, true, undefined, this)
220
+ ]
221
+ }, undefined, true, undefined, this)
222
+ }, undefined, false, undefined, this)
223
+ ]
224
+ }, step.id, true, undefined, this);
225
+ })
226
+ }, undefined, false, undefined, this)
227
+ ]
228
+ }, undefined, true, undefined, this)
229
+ }, undefined, false, undefined, this)
230
+ }, undefined, false, undefined, this)
231
+ ]
232
+ }, undefined, true, undefined, this);
129
233
  }
130
-
131
- //#endregion
132
- export { Timeline };
133
- //# sourceMappingURL=Timeline.js.map
234
+ export {
235
+ Timeline
236
+ };
@@ -1,5 +1,5 @@
1
- import { Overview } from "./Overview.js";
2
- import { Steps } from "./Steps.js";
3
- import { Progress } from "./Progress.js";
4
- import { Timeline } from "./Timeline.js";
5
- export { Overview, Progress, Steps, Timeline };
1
+ export { Overview } from './Overview';
2
+ export { Steps } from './Steps';
3
+ export { Progress } from './Progress';
4
+ export { Timeline } from './Timeline';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}