@lssm/example.learning-journey-ui-gamified 0.0.0-canary-20251217073102 → 0.0.0-canary-20251217083314

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 (126) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +395 -14
  2. package/CHANGELOG.md +9 -9
  3. package/dist/GamifiedMiniApp.d.ts +16 -0
  4. package/dist/GamifiedMiniApp.js +64 -0
  5. package/dist/components/DayCalendar.d.ts +15 -0
  6. package/dist/components/DayCalendar.js +32 -0
  7. package/dist/components/FlashCard.d.ts +18 -0
  8. package/dist/components/FlashCard.js +79 -0
  9. package/dist/components/MasteryRing.d.ts +17 -0
  10. package/dist/components/MasteryRing.js +81 -0
  11. package/dist/components/index.d.ts +4 -0
  12. package/dist/components/index.js +5 -0
  13. package/dist/docs/index.d.ts +1 -0
  14. package/dist/docs/index.js +1 -0
  15. package/dist/docs/learning-journey-ui-gamified.docblock.d.ts +1 -0
  16. package/dist/docs/learning-journey-ui-gamified.docblock.js +20 -0
  17. package/dist/{index.d.mts → example.d.ts} +1 -18
  18. package/dist/example.js +34 -0
  19. package/dist/examples/learning-journey-ui-shared/dist/components/BadgeDisplay.js +44 -0
  20. package/dist/examples/learning-journey-ui-shared/dist/components/StreakCounter.js +45 -0
  21. package/dist/examples/learning-journey-ui-shared/dist/components/ViewTabs.js +48 -0
  22. package/dist/examples/learning-journey-ui-shared/dist/components/XpBar.js +46 -0
  23. package/dist/examples/learning-journey-ui-shared/dist/components/index.js +4 -0
  24. package/dist/examples/learning-journey-ui-shared/dist/docs/index.js +1 -0
  25. package/dist/examples/learning-journey-ui-shared/dist/docs/learning-journey-ui-shared.docblock.js +20 -0
  26. package/dist/examples/learning-journey-ui-shared/dist/hooks/index.js +1 -0
  27. package/dist/examples/learning-journey-ui-shared/dist/hooks/useLearningProgress.js +73 -0
  28. package/dist/examples/learning-journey-ui-shared/dist/index.js +8 -0
  29. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +15 -0
  30. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +15 -0
  31. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/index.js +28 -0
  32. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/presentations.js +71 -0
  33. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/registry.js +44 -0
  34. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +15 -0
  35. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +15 -0
  36. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +15 -0
  37. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +15 -0
  38. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +15 -0
  39. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +79 -0
  40. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +56 -0
  41. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +15 -0
  42. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +356 -0
  43. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +36 -0
  44. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +15 -0
  45. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +19 -0
  46. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +47 -0
  47. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +78 -0
  48. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +83 -0
  49. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +44 -0
  50. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +66 -0
  51. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +39 -0
  52. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +68 -0
  53. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +46 -0
  54. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +61 -0
  55. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +154 -0
  56. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +19 -0
  57. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +100 -0
  58. package/dist/examples/learning-journey-ui-shared/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +19 -0
  59. package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
  60. package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
  61. package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
  62. package/dist/examples/learning-journey-ui-shared/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
  63. package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/progress.js +23 -0
  64. package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
  65. package/dist/examples/learning-journey-ui-shared/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
  66. package/dist/index.d.ts +12 -0
  67. package/dist/index.js +14 -0
  68. package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
  69. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
  70. package/dist/libs/contracts/dist/docs/index.js +29 -0
  71. package/dist/libs/contracts/dist/docs/presentations.js +71 -0
  72. package/dist/libs/contracts/dist/docs/registry.js +44 -0
  73. package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
  74. package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
  75. package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
  76. package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
  77. package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
  78. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
  79. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
  80. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
  81. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
  82. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
  83. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
  84. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
  85. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
  86. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
  87. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
  88. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
  89. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
  90. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
  91. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
  92. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
  93. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
  94. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
  95. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
  96. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
  97. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
  98. package/dist/libs/design-system/dist/_virtual/rolldown_runtime.js +5 -0
  99. package/dist/libs/design-system/dist/components/atoms/Button.js +33 -0
  100. package/dist/libs/design-system/dist/ui-kit-web/dist/ui/button.js +55 -0
  101. package/dist/libs/design-system/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
  102. package/dist/libs/ui-kit-web/dist/ui/card.js +36 -0
  103. package/dist/libs/ui-kit-web/dist/ui/utils.js +10 -0
  104. package/dist/libs/ui-kit-web/dist/ui-kit-core/dist/utils.js +10 -0
  105. package/dist/views/Overview.d.ts +14 -0
  106. package/dist/views/Overview.js +163 -0
  107. package/dist/views/Progress.d.ts +10 -0
  108. package/dist/views/Progress.js +144 -0
  109. package/dist/views/Steps.d.ts +11 -0
  110. package/dist/views/Steps.js +55 -0
  111. package/dist/views/Timeline.d.ts +10 -0
  112. package/dist/views/Timeline.js +132 -0
  113. package/dist/views/index.d.ts +5 -0
  114. package/dist/views/index.js +6 -0
  115. package/package.json +25 -16
  116. package/tsdown.config.js +14 -10
  117. package/dist/DayCalendar-Cha869Bi.mjs +0 -178
  118. package/dist/components/index.d.mts +0 -2
  119. package/dist/components/index.mjs +0 -4
  120. package/dist/components-kh0CpIG2.mjs +0 -1
  121. package/dist/index-C7CBKOil.d.mts +0 -44
  122. package/dist/index-DiAD2ivN.d.mts +0 -33
  123. package/dist/index.mjs +0 -110
  124. package/dist/views/index.d.mts +0 -2
  125. package/dist/views/index.mjs +0 -4
  126. package/dist/views-B-DapxWu.mjs +0 -467
@@ -1,44 +0,0 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { LearningJourneyStepSpec } from "@lssm/module.learning-journey/track-spec";
3
-
4
- //#region src/components/FlashCard.d.ts
5
- interface FlashCardProps {
6
- step: LearningJourneyStepSpec;
7
- isCompleted: boolean;
8
- isCurrent: boolean;
9
- onComplete?: () => void;
10
- }
11
- declare function FlashCard({
12
- step,
13
- isCompleted,
14
- isCurrent,
15
- onComplete
16
- }: FlashCardProps): react_jsx_runtime0.JSX.Element;
17
- //#endregion
18
- //#region src/components/MasteryRing.d.ts
19
- interface MasteryRingProps {
20
- label: string;
21
- percentage: number;
22
- size?: 'sm' | 'md' | 'lg';
23
- color?: 'green' | 'blue' | 'violet' | 'orange';
24
- }
25
- declare function MasteryRing({
26
- label,
27
- percentage,
28
- size,
29
- color
30
- }: MasteryRingProps): react_jsx_runtime0.JSX.Element;
31
- //#endregion
32
- //#region src/components/DayCalendar.d.ts
33
- interface DayCalendarProps {
34
- totalDays: number;
35
- currentDay: number;
36
- completedDays: number[];
37
- }
38
- declare function DayCalendar({
39
- totalDays,
40
- currentDay,
41
- completedDays
42
- }: DayCalendarProps): react_jsx_runtime0.JSX.Element;
43
- //#endregion
44
- export { MasteryRing as n, FlashCard as r, DayCalendar as t };
@@ -1,33 +0,0 @@
1
- import { LearningViewProps } from "@lssm/example.learning-journey-ui-shared";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
3
-
4
- //#region src/views/Overview.d.ts
5
- interface GamifiedOverviewProps extends LearningViewProps {
6
- onStart?: () => void;
7
- }
8
- declare function Overview({
9
- track,
10
- progress,
11
- onStart
12
- }: GamifiedOverviewProps): react_jsx_runtime4.JSX.Element;
13
- //#endregion
14
- //#region src/views/Steps.d.ts
15
- declare function Steps({
16
- track,
17
- progress,
18
- onStepComplete
19
- }: LearningViewProps): react_jsx_runtime4.JSX.Element;
20
- //#endregion
21
- //#region src/views/Progress.d.ts
22
- declare function Progress({
23
- track,
24
- progress
25
- }: LearningViewProps): react_jsx_runtime4.JSX.Element;
26
- //#endregion
27
- //#region src/views/Timeline.d.ts
28
- declare function Timeline({
29
- track,
30
- progress
31
- }: LearningViewProps): react_jsx_runtime4.JSX.Element;
32
- //#endregion
33
- export { Overview as i, Progress as n, Steps as r, Timeline as t };
package/dist/index.mjs DELETED
@@ -1,110 +0,0 @@
1
- import { i as Overview, n as Progress, r as Steps, t as Timeline } from "./views-B-DapxWu.mjs";
2
- import { n as MasteryRing, r as FlashCard, t as DayCalendar } from "./DayCalendar-Cha869Bi.mjs";
3
- import "./components-kh0CpIG2.mjs";
4
- import { useCallback, useState } from "react";
5
- import { Card, CardContent } from "@lssm/lib.ui-kit-web/ui/card";
6
- import { ViewTabs, useLearningProgress } from "@lssm/example.learning-journey-ui-shared";
7
- import { jsx, jsxs } from "react/jsx-runtime";
8
- import { registerDocBlocks } from "@lssm/lib.contracts/docs";
9
-
10
- //#region src/GamifiedMiniApp.tsx
11
- function GamifiedMiniApp({ track, progress: externalProgress, onStepComplete: externalOnStepComplete, onViewChange, initialView = "overview" }) {
12
- const [currentView, setCurrentView] = useState(initialView);
13
- const { progress: internalProgress, completeStep: internalCompleteStep } = useLearningProgress(track);
14
- const progress = externalProgress ?? internalProgress;
15
- const handleViewChange = useCallback((view) => {
16
- setCurrentView(view);
17
- onViewChange?.(view);
18
- }, [onViewChange]);
19
- const handleStepComplete = useCallback((stepId) => {
20
- if (externalOnStepComplete) externalOnStepComplete(stepId);
21
- else internalCompleteStep(stepId);
22
- }, [externalOnStepComplete, internalCompleteStep]);
23
- const handleStartFromOverview = useCallback(() => {
24
- setCurrentView("steps");
25
- onViewChange?.("steps");
26
- }, [onViewChange]);
27
- const renderView = () => {
28
- const viewProps = {
29
- track,
30
- progress,
31
- onStepComplete: handleStepComplete
32
- };
33
- switch (currentView) {
34
- case "overview": return /* @__PURE__ */ jsx(Overview, {
35
- ...viewProps,
36
- onStart: handleStartFromOverview
37
- });
38
- case "steps": return /* @__PURE__ */ jsx(Steps, { ...viewProps });
39
- case "progress": return /* @__PURE__ */ jsx(Progress, { ...viewProps });
40
- case "timeline": return /* @__PURE__ */ jsx(Timeline, { ...viewProps });
41
- default: return /* @__PURE__ */ jsx(Overview, {
42
- ...viewProps,
43
- onStart: handleStartFromOverview
44
- });
45
- }
46
- };
47
- return /* @__PURE__ */ jsxs("div", {
48
- className: "space-y-6",
49
- children: [/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
50
- className: "p-4",
51
- children: /* @__PURE__ */ jsx(ViewTabs, {
52
- currentView,
53
- onViewChange: handleViewChange
54
- })
55
- }) }), renderView()]
56
- });
57
- }
58
-
59
- //#endregion
60
- //#region src/example.ts
61
- const example = {
62
- id: "learning-journey-ui-gamified",
63
- title: "Learning Journey UI — Gamified",
64
- summary: "UI mini-app for gamified learning: flashcards, mastery ring, calendar.",
65
- tags: [
66
- "learning",
67
- "ui",
68
- "gamified"
69
- ],
70
- kind: "ui",
71
- visibility: "public",
72
- docs: { rootDocId: "docs.examples.learning-journey-ui-gamified" },
73
- entrypoints: {
74
- packageName: "@lssm/example.learning-journey-ui-gamified",
75
- docs: "./docs"
76
- },
77
- surfaces: {
78
- templates: true,
79
- sandbox: {
80
- enabled: true,
81
- modes: ["playground", "markdown"]
82
- },
83
- studio: {
84
- enabled: true,
85
- installable: true
86
- },
87
- mcp: { enabled: true }
88
- }
89
- };
90
- var example_default = example;
91
-
92
- //#endregion
93
- //#region src/docs/learning-journey-ui-gamified.docblock.ts
94
- registerDocBlocks([{
95
- id: "docs.examples.learning-journey-ui-gamified",
96
- title: "Learning Journey UI — Gamified",
97
- summary: "UI mini-app components for gamified learning: flashcards, mastery, streak/calendar.",
98
- kind: "reference",
99
- visibility: "public",
100
- route: "/docs/examples/learning-journey-ui-gamified",
101
- tags: [
102
- "learning",
103
- "ui",
104
- "gamified"
105
- ],
106
- body: `## Includes\n- Gamified mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: flash card, mastery ring, day calendar\n\n## Notes\n- Compose with design system components.\n- Respect prefers-reduced-motion; keep tap targets large.`
107
- }]);
108
-
109
- //#endregion
110
- export { DayCalendar, FlashCard, GamifiedMiniApp, MasteryRing, Overview, Progress, Steps, Timeline, example_default as example };
@@ -1,2 +0,0 @@
1
- import { i as Overview, n as Progress, r as Steps, t as Timeline } from "../index-DiAD2ivN.mjs";
2
- export { Overview, Progress, Steps, Timeline };
@@ -1,4 +0,0 @@
1
- import { i as Overview, n as Progress, r as Steps, t as Timeline } from "../views-B-DapxWu.mjs";
2
- import "../DayCalendar-Cha869Bi.mjs";
3
-
4
- export { Overview, Progress, Steps, Timeline };
@@ -1,467 +0,0 @@
1
- import { n as MasteryRing, r as FlashCard, t as DayCalendar } from "./DayCalendar-Cha869Bi.mjs";
2
- import { Card, CardContent, CardHeader, CardTitle } from "@lssm/lib.ui-kit-web/ui/card";
3
- import { BadgeDisplay, StreakCounter, XpBar } from "@lssm/example.learning-journey-ui-shared";
4
- import { Button } from "@lssm/lib.design-system";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
-
7
- //#region src/views/Overview.tsx
8
- function Overview({ track, progress, onStart }) {
9
- const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
10
- const completedSteps = progress.completedStepIds.length;
11
- const totalSteps = track.steps.length;
12
- const isComplete = completedSteps === totalSteps;
13
- return /* @__PURE__ */ jsxs("div", {
14
- className: "space-y-6",
15
- children: [
16
- /* @__PURE__ */ jsx(Card, {
17
- className: "overflow-hidden bg-gradient-to-br from-violet-500/10 via-purple-500/10 to-fuchsia-500/10",
18
- children: /* @__PURE__ */ jsx(CardContent, {
19
- className: "p-6",
20
- children: /* @__PURE__ */ jsxs("div", {
21
- className: "flex flex-col items-center gap-4 text-center md:flex-row md:text-left",
22
- children: [
23
- /* @__PURE__ */ jsx("div", {
24
- 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",
25
- children: isComplete ? "🏆" : "🎯"
26
- }),
27
- /* @__PURE__ */ jsxs("div", {
28
- className: "flex-1",
29
- children: [/* @__PURE__ */ jsx("h1", {
30
- className: "text-2xl font-bold",
31
- children: track.name
32
- }), /* @__PURE__ */ jsx("p", {
33
- className: "text-muted-foreground mt-1",
34
- children: track.description
35
- })]
36
- }),
37
- /* @__PURE__ */ jsx("div", {
38
- className: "flex items-center gap-3",
39
- children: /* @__PURE__ */ jsx(StreakCounter, {
40
- days: progress.streakDays,
41
- size: "lg"
42
- })
43
- })
44
- ]
45
- })
46
- })
47
- }),
48
- /* @__PURE__ */ jsxs("div", {
49
- className: "grid gap-4 md:grid-cols-3",
50
- children: [
51
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
52
- className: "pb-2",
53
- children: /* @__PURE__ */ jsx(CardTitle, {
54
- className: "text-muted-foreground text-sm font-medium",
55
- children: "XP Progress"
56
- })
57
- }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx("div", {
58
- className: "text-3xl font-bold text-violet-500",
59
- children: progress.xpEarned.toLocaleString()
60
- }), /* @__PURE__ */ jsx(XpBar, {
61
- current: progress.xpEarned,
62
- max: totalXp,
63
- showLabel: false,
64
- size: "sm"
65
- })] })] }),
66
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
67
- className: "pb-2",
68
- children: /* @__PURE__ */ jsx(CardTitle, {
69
- className: "text-muted-foreground text-sm font-medium",
70
- children: "Steps Completed"
71
- })
72
- }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsxs("div", {
73
- className: "text-3xl font-bold",
74
- children: [
75
- completedSteps,
76
- " ",
77
- /* @__PURE__ */ jsxs("span", {
78
- className: "text-muted-foreground text-lg",
79
- children: ["/ ", totalSteps]
80
- })
81
- ]
82
- }), /* @__PURE__ */ jsx("div", {
83
- className: "bg-muted mt-2 h-2 w-full overflow-hidden rounded-full",
84
- children: /* @__PURE__ */ jsx("div", {
85
- className: "h-full bg-green-500 transition-all duration-500",
86
- style: { width: `${completedSteps / totalSteps * 100}%` }
87
- })
88
- })] })] }),
89
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, {
90
- className: "pb-2",
91
- children: /* @__PURE__ */ jsx(CardTitle, {
92
- className: "text-muted-foreground text-sm font-medium",
93
- children: "Badges Earned"
94
- })
95
- }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(BadgeDisplay, {
96
- badges: progress.badges,
97
- size: "lg"
98
- }) })] })
99
- ]
100
- }),
101
- !isComplete && /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
102
- className: "flex items-center gap-2",
103
- children: [/* @__PURE__ */ jsx("span", { children: "🎯" }), /* @__PURE__ */ jsx("span", { children: "Next Challenge" })]
104
- }) }), /* @__PURE__ */ jsx(CardContent, { children: (() => {
105
- const nextStep = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
106
- if (!nextStep) return null;
107
- return /* @__PURE__ */ jsxs("div", {
108
- className: "flex items-center justify-between gap-4",
109
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
110
- className: "font-semibold",
111
- children: nextStep.title
112
- }), /* @__PURE__ */ jsx("p", {
113
- className: "text-muted-foreground text-sm",
114
- children: nextStep.description
115
- })] }), /* @__PURE__ */ jsxs("div", {
116
- className: "flex items-center gap-3",
117
- children: [nextStep.xpReward && /* @__PURE__ */ jsxs("span", {
118
- className: "rounded-full bg-green-500/10 px-3 py-1 text-sm font-semibold text-green-500",
119
- children: [
120
- "+",
121
- nextStep.xpReward,
122
- " XP"
123
- ]
124
- }), /* @__PURE__ */ jsx(Button, {
125
- onClick: onStart,
126
- children: "Start"
127
- })]
128
- })]
129
- });
130
- })() })] }),
131
- isComplete && /* @__PURE__ */ jsx(Card, {
132
- className: "border-green-500/50 bg-green-500/5",
133
- children: /* @__PURE__ */ jsxs(CardContent, {
134
- className: "flex items-center gap-4 p-6",
135
- children: [/* @__PURE__ */ jsx("div", {
136
- className: "text-4xl",
137
- children: "🎉"
138
- }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
139
- className: "text-lg font-semibold text-green-500",
140
- children: "Track Complete!"
141
- }), /* @__PURE__ */ jsxs("p", {
142
- className: "text-muted-foreground",
143
- children: [
144
- "You've mastered all ",
145
- totalSteps,
146
- " challenges and earned",
147
- " ",
148
- progress.xpEarned,
149
- " XP."
150
- ]
151
- })] })]
152
- })
153
- })
154
- ]
155
- });
156
- }
157
-
158
- //#endregion
159
- //#region src/views/Steps.tsx
160
- function Steps({ track, progress, onStepComplete }) {
161
- const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
162
- return /* @__PURE__ */ jsxs("div", {
163
- className: "space-y-6",
164
- children: [
165
- /* @__PURE__ */ jsxs("div", {
166
- className: "text-center",
167
- children: [/* @__PURE__ */ jsx("h2", {
168
- className: "text-xl font-bold",
169
- children: "Complete Your Challenges"
170
- }), /* @__PURE__ */ jsx("p", {
171
- className: "text-muted-foreground",
172
- children: "Tap each card to reveal the action, then mark as complete"
173
- })]
174
- }),
175
- /* @__PURE__ */ jsx("div", {
176
- className: "grid gap-4 md:grid-cols-2",
177
- children: track.steps.map((step, index) => {
178
- return /* @__PURE__ */ jsx(FlashCard, {
179
- step,
180
- isCompleted: progress.completedStepIds.includes(step.id),
181
- isCurrent: index === currentStepIndex,
182
- onComplete: () => onStepComplete?.(step.id)
183
- }, step.id);
184
- })
185
- }),
186
- /* @__PURE__ */ jsxs("div", {
187
- className: "text-muted-foreground text-center text-sm",
188
- children: [
189
- progress.completedStepIds.length,
190
- " of ",
191
- track.steps.length,
192
- " completed",
193
- track.completionRewards?.xpBonus && /* @__PURE__ */ jsxs("span", {
194
- className: "ml-2 text-green-500",
195
- children: [
196
- "(+",
197
- track.completionRewards.xpBonus,
198
- " XP bonus on completion)"
199
- ]
200
- })
201
- ]
202
- })
203
- ]
204
- });
205
- }
206
-
207
- //#endregion
208
- //#region src/views/Progress.tsx
209
- function Progress({ track, progress }) {
210
- const totalXp = track.totalXp ?? track.steps.reduce((sum, s) => sum + (s.xpReward ?? 0), 0) + (track.completionRewards?.xpBonus ?? 0);
211
- const completedSteps = progress.completedStepIds.length;
212
- const totalSteps = track.steps.length;
213
- const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
214
- const surfaces = /* @__PURE__ */ new Map();
215
- track.steps.forEach((step) => {
216
- const surface = step.metadata?.surface ?? "general";
217
- const current = surfaces.get(surface) ?? {
218
- total: 0,
219
- completed: 0
220
- };
221
- surfaces.set(surface, {
222
- total: current.total + 1,
223
- completed: current.completed + (progress.completedStepIds.includes(step.id) ? 1 : 0)
224
- });
225
- });
226
- const surfaceColors = [
227
- "green",
228
- "blue",
229
- "violet",
230
- "orange"
231
- ];
232
- return /* @__PURE__ */ jsxs("div", {
233
- className: "space-y-6",
234
- children: [
235
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
236
- className: "flex items-center gap-2",
237
- children: [/* @__PURE__ */ jsx("span", { children: "⚡" }), /* @__PURE__ */ jsx("span", { children: "Experience Points" })]
238
- }) }), /* @__PURE__ */ jsxs(CardContent, {
239
- className: "space-y-4",
240
- children: [
241
- /* @__PURE__ */ jsxs("div", {
242
- className: "flex items-baseline gap-2",
243
- children: [/* @__PURE__ */ jsx("span", {
244
- className: "text-4xl font-bold text-violet-500",
245
- children: progress.xpEarned.toLocaleString()
246
- }), /* @__PURE__ */ jsxs("span", {
247
- className: "text-muted-foreground",
248
- children: [
249
- "/ ",
250
- totalXp.toLocaleString(),
251
- " XP"
252
- ]
253
- })]
254
- }),
255
- /* @__PURE__ */ jsx(XpBar, {
256
- current: progress.xpEarned,
257
- max: totalXp,
258
- showLabel: false,
259
- size: "lg"
260
- }),
261
- track.completionRewards?.xpBonus && percentComplete < 100 && /* @__PURE__ */ jsxs("p", {
262
- className: "text-muted-foreground text-sm",
263
- children: [
264
- "🎁 Complete all steps for a",
265
- " ",
266
- /* @__PURE__ */ jsxs("span", {
267
- className: "font-semibold text-green-500",
268
- children: [
269
- "+",
270
- track.completionRewards.xpBonus,
271
- " XP"
272
- ]
273
- }),
274
- " ",
275
- "bonus!"
276
- ]
277
- })
278
- ]
279
- })] }),
280
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
281
- className: "flex items-center gap-2",
282
- children: [/* @__PURE__ */ jsx("span", { children: "🎯" }), /* @__PURE__ */ jsx("span", { children: "Skill Mastery" })]
283
- }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", {
284
- className: "flex flex-wrap justify-center gap-6",
285
- children: [Array.from(surfaces.entries()).map(([surface, data], index) => /* @__PURE__ */ jsx(MasteryRing, {
286
- label: surface.charAt(0).toUpperCase() + surface.slice(1),
287
- percentage: data.completed / data.total * 100,
288
- color: surfaceColors[index % surfaceColors.length],
289
- size: "lg"
290
- }, surface)), /* @__PURE__ */ jsx(MasteryRing, {
291
- label: "Overall",
292
- percentage: percentComplete,
293
- color: "violet",
294
- size: "lg"
295
- })]
296
- }) })] }),
297
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
298
- className: "flex items-center gap-2",
299
- children: [/* @__PURE__ */ jsx("span", { children: "🏅" }), /* @__PURE__ */ jsx("span", { children: "Badges Earned" })]
300
- }) }), /* @__PURE__ */ jsxs(CardContent, { children: [/* @__PURE__ */ jsx(BadgeDisplay, {
301
- badges: progress.badges,
302
- size: "lg",
303
- maxVisible: 10
304
- }), progress.badges.length === 0 && /* @__PURE__ */ jsx("p", {
305
- className: "text-muted-foreground text-sm",
306
- children: "Complete the track to earn your first badge!"
307
- })] })] }),
308
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
309
- className: "flex items-center gap-2",
310
- children: [/* @__PURE__ */ jsx("span", { children: "📊" }), /* @__PURE__ */ jsx("span", { children: "Step Breakdown" })]
311
- }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
312
- className: "space-y-2",
313
- children: track.steps.map((step) => {
314
- const isCompleted = progress.completedStepIds.includes(step.id);
315
- return /* @__PURE__ */ jsxs("div", {
316
- className: "flex items-center justify-between rounded-lg border p-3",
317
- children: [/* @__PURE__ */ jsxs("div", {
318
- className: "flex items-center gap-3",
319
- children: [/* @__PURE__ */ jsx("span", {
320
- className: isCompleted ? "text-green-500" : "text-muted-foreground",
321
- children: isCompleted ? "✓" : "○"
322
- }), /* @__PURE__ */ jsx("span", {
323
- className: isCompleted ? "text-foreground" : "text-muted-foreground",
324
- children: step.title
325
- })]
326
- }), step.xpReward && /* @__PURE__ */ jsxs("span", {
327
- className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
328
- children: [
329
- isCompleted ? "+" : "",
330
- step.xpReward,
331
- " XP"
332
- ]
333
- })]
334
- }, step.id);
335
- })
336
- }) })] })
337
- ]
338
- });
339
- }
340
-
341
- //#endregion
342
- //#region src/views/Timeline.tsx
343
- function Timeline({ track, progress }) {
344
- if (track.steps.some((s) => s.availability?.unlockOnDay !== void 0)) {
345
- const totalDays = Math.max(...track.steps.map((s) => s.availability?.unlockOnDay ?? 1), 7);
346
- const completedDays = track.steps.filter((s) => progress.completedStepIds.includes(s.id)).map((s) => s.availability?.unlockOnDay ?? 1);
347
- const currentDay = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.availability?.unlockOnDay ?? 1;
348
- return /* @__PURE__ */ jsxs("div", {
349
- className: "space-y-6",
350
- children: [
351
- /* @__PURE__ */ jsxs("div", {
352
- className: "text-center",
353
- children: [/* @__PURE__ */ jsx("h2", {
354
- className: "text-xl font-bold",
355
- children: track.name
356
- }), /* @__PURE__ */ jsx("p", {
357
- className: "text-muted-foreground",
358
- children: "Complete each day's challenge to progress"
359
- })]
360
- }),
361
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
362
- className: "flex items-center gap-2",
363
- children: [/* @__PURE__ */ jsx("span", { children: "📅" }), /* @__PURE__ */ jsx("span", { children: "Your Journey" })]
364
- }) }), /* @__PURE__ */ jsx(CardContent, {
365
- className: "flex justify-center",
366
- children: /* @__PURE__ */ jsx(DayCalendar, {
367
- totalDays,
368
- currentDay,
369
- completedDays
370
- })
371
- })] }),
372
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
373
- className: "flex items-center gap-2",
374
- children: [/* @__PURE__ */ jsx("span", { children: "📝" }), /* @__PURE__ */ jsx("span", { children: "Daily Challenges" })]
375
- }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx("div", {
376
- className: "space-y-3",
377
- children: track.steps.map((step) => {
378
- const day = step.availability?.unlockOnDay ?? 1;
379
- const isCompleted = progress.completedStepIds.includes(step.id);
380
- const isLocked = day > currentDay;
381
- return /* @__PURE__ */ jsxs("div", {
382
- className: `flex items-start gap-4 rounded-lg border p-4 ${isLocked ? "opacity-50" : ""}`,
383
- children: [
384
- /* @__PURE__ */ jsx("div", {
385
- className: "bg-muted flex h-10 w-10 shrink-0 items-center justify-center rounded-lg font-semibold",
386
- children: isCompleted ? "✓" : isLocked ? "🔒" : day
387
- }),
388
- /* @__PURE__ */ jsxs("div", {
389
- className: "flex-1",
390
- children: [/* @__PURE__ */ jsx("h4", {
391
- className: "font-semibold",
392
- children: step.title
393
- }), /* @__PURE__ */ jsx("p", {
394
- className: "text-muted-foreground text-sm",
395
- children: step.description
396
- })]
397
- }),
398
- step.xpReward && /* @__PURE__ */ jsxs("span", {
399
- className: `text-sm font-medium ${isCompleted ? "text-green-500" : "text-muted-foreground"}`,
400
- children: [
401
- "+",
402
- step.xpReward,
403
- " XP"
404
- ]
405
- })
406
- ]
407
- }, step.id);
408
- })
409
- }) })] })
410
- ]
411
- });
412
- }
413
- return /* @__PURE__ */ jsxs("div", {
414
- className: "space-y-6",
415
- children: [/* @__PURE__ */ jsxs("div", {
416
- className: "text-center",
417
- children: [/* @__PURE__ */ jsx("h2", {
418
- className: "text-xl font-bold",
419
- children: "Learning Path"
420
- }), /* @__PURE__ */ jsx("p", {
421
- className: "text-muted-foreground",
422
- children: "Follow the steps to master this skill"
423
- })]
424
- }), /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsx(CardContent, {
425
- className: "p-6",
426
- children: /* @__PURE__ */ jsxs("div", {
427
- className: "relative",
428
- children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 left-5 h-full w-0.5" }), /* @__PURE__ */ jsx("div", {
429
- className: "space-y-6",
430
- children: track.steps.map((step, index) => {
431
- const isCompleted = progress.completedStepIds.includes(step.id);
432
- const isCurrent = !isCompleted && track.steps.slice(0, index).every((s) => progress.completedStepIds.includes(s.id));
433
- return /* @__PURE__ */ jsxs("div", {
434
- className: "relative flex gap-4 pl-2",
435
- children: [/* @__PURE__ */ jsx("div", {
436
- 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"}`,
437
- children: isCompleted ? "✓" : index + 1
438
- }), /* @__PURE__ */ jsx("div", {
439
- className: "flex-1 pb-4",
440
- children: /* @__PURE__ */ jsxs("div", {
441
- className: "flex items-start justify-between gap-2",
442
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h4", {
443
- className: `font-semibold ${isCompleted ? "text-foreground" : isCurrent ? "text-violet-500" : "text-muted-foreground"}`,
444
- children: step.title
445
- }), /* @__PURE__ */ jsx("p", {
446
- className: "text-muted-foreground mt-1 text-sm",
447
- children: step.description
448
- })] }), step.xpReward && /* @__PURE__ */ jsxs("span", {
449
- 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"}`,
450
- children: [
451
- "+",
452
- step.xpReward,
453
- " XP"
454
- ]
455
- })]
456
- })
457
- })]
458
- }, step.id);
459
- })
460
- })]
461
- })
462
- }) })]
463
- });
464
- }
465
-
466
- //#endregion
467
- export { Overview as i, Progress as n, Steps as r, Timeline as t };