@contractspec/example.learning-journey-ui-onboarding 1.57.0 → 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 +58 -62
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +19 -0
  4. package/dist/OnboardingMiniApp.d.ts +4 -14
  5. package/dist/OnboardingMiniApp.d.ts.map +1 -1
  6. package/dist/OnboardingMiniApp.js +991 -59
  7. package/dist/browser/OnboardingMiniApp.js +994 -0
  8. package/dist/browser/components/CodeSnippet.js +65 -0
  9. package/dist/browser/components/JourneyMap.js +59 -0
  10. package/dist/browser/components/StepChecklist.js +97 -0
  11. package/dist/browser/components/index.js +219 -0
  12. package/dist/browser/docs/index.js +22 -0
  13. package/dist/browser/docs/learning-journey-ui-onboarding.docblock.js +22 -0
  14. package/dist/browser/example.js +32 -0
  15. package/dist/browser/index.js +1116 -0
  16. package/dist/browser/views/Overview.js +240 -0
  17. package/dist/browser/views/Progress.js +275 -0
  18. package/dist/browser/views/Steps.js +192 -0
  19. package/dist/browser/views/Timeline.js +213 -0
  20. package/dist/browser/views/index.js +915 -0
  21. package/dist/components/CodeSnippet.d.ts +5 -13
  22. package/dist/components/CodeSnippet.d.ts.map +1 -1
  23. package/dist/components/CodeSnippet.js +63 -47
  24. package/dist/components/JourneyMap.d.ts +6 -14
  25. package/dist/components/JourneyMap.d.ts.map +1 -1
  26. package/dist/components/JourneyMap.js +57 -46
  27. package/dist/components/StepChecklist.d.ts +10 -22
  28. package/dist/components/StepChecklist.d.ts.map +1 -1
  29. package/dist/components/StepChecklist.js +95 -77
  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 +219 -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-onboarding.docblock.d.ts +2 -1
  37. package/dist/docs/learning-journey-ui-onboarding.docblock.d.ts.map +1 -0
  38. package/dist/docs/learning-journey-ui-onboarding.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 +31 -39
  42. package/dist/index.d.ts +6 -12
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +1117 -14
  45. package/dist/node/OnboardingMiniApp.js +994 -0
  46. package/dist/node/components/CodeSnippet.js +65 -0
  47. package/dist/node/components/JourneyMap.js +59 -0
  48. package/dist/node/components/StepChecklist.js +97 -0
  49. package/dist/node/components/index.js +219 -0
  50. package/dist/node/docs/index.js +22 -0
  51. package/dist/node/docs/learning-journey-ui-onboarding.docblock.js +22 -0
  52. package/dist/node/example.js +32 -0
  53. package/dist/node/index.js +1116 -0
  54. package/dist/node/views/Overview.js +240 -0
  55. package/dist/node/views/Progress.js +275 -0
  56. package/dist/node/views/Steps.js +192 -0
  57. package/dist/node/views/Timeline.js +213 -0
  58. package/dist/node/views/index.js +915 -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 +238 -177
  62. package/dist/views/Progress.d.ts +3 -10
  63. package/dist/views/Progress.d.ts.map +1 -1
  64. package/dist/views/Progress.js +273 -158
  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 +188 -87
  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 +211 -95
  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 +915 -5
  74. package/package.json +155 -39
  75. package/tsdown.config.js +1 -2
  76. package/.turbo/turbo-build$colon$bundle.log +0 -59
  77. package/dist/OnboardingMiniApp.js.map +0 -1
  78. package/dist/components/CodeSnippet.js.map +0 -1
  79. package/dist/components/JourneyMap.js.map +0 -1
  80. package/dist/components/StepChecklist.js.map +0 -1
  81. package/dist/docs/learning-journey-ui-onboarding.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,92 +1,193 @@
1
- 'use client';
1
+ // @bun
2
+ // src/components/StepChecklist.tsx
3
+ import { Button } from "@contractspec/lib.design-system";
4
+ import { cn } from "@contractspec/lib.ui-kit-core";
5
+ import { jsxDEV } from "react/jsx-dev-runtime";
6
+ "use client";
7
+ function StepChecklist({
8
+ step,
9
+ stepNumber,
10
+ isCompleted,
11
+ isCurrent,
12
+ isExpanded,
13
+ onToggle,
14
+ onComplete
15
+ }) {
16
+ return /* @__PURE__ */ jsxDEV("div", {
17
+ className: cn("rounded-xl border transition-all", isCompleted && "border-green-500/50 bg-green-500/5", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/5", !isCompleted && !isCurrent && "border-border"),
18
+ children: [
19
+ /* @__PURE__ */ jsxDEV("button", {
20
+ type: "button",
21
+ className: "flex w-full items-center gap-4 p-4 text-left",
22
+ onClick: onToggle,
23
+ children: [
24
+ /* @__PURE__ */ jsxDEV("div", {
25
+ className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors", isCompleted && "border-green-500 bg-green-500 text-white", isCurrent && !isCompleted && "border-violet-500 text-violet-500", !isCompleted && !isCurrent && "border-muted-foreground text-muted-foreground"),
26
+ children: isCompleted ? "\u2713" : stepNumber
27
+ }, undefined, false, undefined, this),
28
+ /* @__PURE__ */ jsxDEV("div", {
29
+ className: "min-w-0 flex-1",
30
+ children: [
31
+ /* @__PURE__ */ jsxDEV("h4", {
32
+ className: cn("font-semibold", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-foreground", !isCompleted && !isCurrent && "text-muted-foreground"),
33
+ children: step.title
34
+ }, undefined, false, undefined, this),
35
+ !isExpanded && step.description && /* @__PURE__ */ jsxDEV("p", {
36
+ className: "text-muted-foreground truncate 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: cn("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"),
43
+ children: [
44
+ "+",
45
+ step.xpReward,
46
+ " XP"
47
+ ]
48
+ }, undefined, true, undefined, this),
49
+ /* @__PURE__ */ jsxDEV("span", {
50
+ className: cn("shrink-0 transition-transform", isExpanded && "rotate-180"),
51
+ children: "\u25BC"
52
+ }, undefined, false, undefined, this)
53
+ ]
54
+ }, undefined, true, undefined, this),
55
+ isExpanded && /* @__PURE__ */ jsxDEV("div", {
56
+ className: "border-t px-4 py-4",
57
+ children: [
58
+ step.description && /* @__PURE__ */ jsxDEV("p", {
59
+ className: "text-muted-foreground mb-4",
60
+ children: step.description
61
+ }, undefined, false, undefined, this),
62
+ step.instructions && /* @__PURE__ */ jsxDEV("div", {
63
+ className: "bg-muted mb-4 rounded-lg p-4",
64
+ children: [
65
+ /* @__PURE__ */ jsxDEV("p", {
66
+ className: "mb-2 text-sm font-medium",
67
+ children: "Instructions:"
68
+ }, undefined, false, undefined, this),
69
+ /* @__PURE__ */ jsxDEV("p", {
70
+ className: "text-muted-foreground text-sm",
71
+ children: step.instructions
72
+ }, undefined, false, undefined, this)
73
+ ]
74
+ }, undefined, true, undefined, this),
75
+ /* @__PURE__ */ jsxDEV("div", {
76
+ className: "flex flex-wrap gap-2",
77
+ children: [
78
+ step.actionUrl && /* @__PURE__ */ jsxDEV(Button, {
79
+ variant: "outline",
80
+ size: "sm",
81
+ onClick: () => window.open(step.actionUrl, "_blank"),
82
+ children: step.actionLabel ?? "Try it"
83
+ }, undefined, false, undefined, this),
84
+ !isCompleted && /* @__PURE__ */ jsxDEV(Button, {
85
+ size: "sm",
86
+ onClick: onComplete,
87
+ children: "Mark as Complete"
88
+ }, undefined, false, undefined, this)
89
+ ]
90
+ }, undefined, true, undefined, this)
91
+ ]
92
+ }, undefined, true, undefined, this)
93
+ ]
94
+ }, undefined, true, undefined, this);
95
+ }
2
96
 
3
- import { StepChecklist } from "../components/StepChecklist.js";
97
+ // src/views/Steps.tsx
4
98
  import { useState } from "react";
5
99
  import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
6
- import { jsx, jsxs } from "react/jsx-runtime";
7
-
8
- //#region src/views/Steps.tsx
100
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
101
+ "use client";
9
102
  function Steps({ track, progress, onStepComplete }) {
10
- const [expandedStepId, setExpandedStepId] = useState(() => {
11
- return track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
12
- });
13
- const completedSteps = progress.completedStepIds.length;
14
- const totalSteps = track.steps.length;
15
- const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
16
- const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
17
- return /* @__PURE__ */ jsxs("div", {
18
- className: "space-y-6",
19
- children: [
20
- /* @__PURE__ */ jsxs("div", {
21
- className: "space-y-2",
22
- children: [/* @__PURE__ */ jsxs("div", {
23
- className: "flex items-center justify-between",
24
- children: [/* @__PURE__ */ jsx("h2", {
25
- className: "text-xl font-bold",
26
- children: "Complete Each Step"
27
- }), /* @__PURE__ */ jsxs("span", {
28
- className: "text-muted-foreground text-sm",
29
- children: [
30
- completedSteps,
31
- " / ",
32
- totalSteps,
33
- " completed"
34
- ]
35
- })]
36
- }), /* @__PURE__ */ jsx(Progress, {
37
- value: percentComplete,
38
- className: "h-2"
39
- })]
40
- }),
41
- /* @__PURE__ */ jsx("div", {
42
- className: "space-y-3",
43
- children: track.steps.map((step, index) => {
44
- const isCompleted = progress.completedStepIds.includes(step.id);
45
- const isCurrent = index === currentStepIndex;
46
- return /* @__PURE__ */ jsx(StepChecklist, {
47
- step,
48
- stepNumber: index + 1,
49
- isCompleted,
50
- isCurrent,
51
- isExpanded: expandedStepId === step.id,
52
- onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
53
- onComplete: () => {
54
- onStepComplete?.(step.id);
55
- const nextStep = track.steps[index + 1];
56
- if (nextStep && !progress.completedStepIds.includes(nextStep.id)) setExpandedStepId(nextStep.id);
57
- }
58
- }, step.id);
59
- })
60
- }),
61
- track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsx("div", {
62
- className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
63
- children: /* @__PURE__ */ jsxs("p", {
64
- className: "text-sm",
65
- children: [
66
- "🎁 Complete all steps to unlock:",
67
- track.completionRewards.xpBonus && /* @__PURE__ */ jsxs("span", {
68
- className: "ml-2 font-semibold text-blue-500",
69
- children: [
70
- "+",
71
- track.completionRewards.xpBonus,
72
- " XP bonus"
73
- ]
74
- }),
75
- track.completionRewards.badgeKey && /* @__PURE__ */ jsxs("span", {
76
- className: "ml-2 font-semibold text-amber-500",
77
- children: [
78
- "+ \"",
79
- track.completionRewards.badgeKey,
80
- "\" badge"
81
- ]
82
- })
83
- ]
84
- })
85
- })
86
- ]
87
- });
103
+ const [expandedStepId, setExpandedStepId] = useState(() => {
104
+ const firstIncomplete = track.steps.find((s) => !progress.completedStepIds.includes(s.id));
105
+ return firstIncomplete?.id ?? null;
106
+ });
107
+ const completedSteps = progress.completedStepIds.length;
108
+ const totalSteps = track.steps.length;
109
+ const percentComplete = totalSteps > 0 ? completedSteps / totalSteps * 100 : 0;
110
+ const currentStepIndex = track.steps.findIndex((s) => !progress.completedStepIds.includes(s.id));
111
+ return /* @__PURE__ */ jsxDEV2("div", {
112
+ className: "space-y-6",
113
+ children: [
114
+ /* @__PURE__ */ jsxDEV2("div", {
115
+ className: "space-y-2",
116
+ children: [
117
+ /* @__PURE__ */ jsxDEV2("div", {
118
+ className: "flex items-center justify-between",
119
+ children: [
120
+ /* @__PURE__ */ jsxDEV2("h2", {
121
+ className: "text-xl font-bold",
122
+ children: "Complete Each Step"
123
+ }, undefined, false, undefined, this),
124
+ /* @__PURE__ */ jsxDEV2("span", {
125
+ className: "text-muted-foreground text-sm",
126
+ children: [
127
+ completedSteps,
128
+ " / ",
129
+ totalSteps,
130
+ " completed"
131
+ ]
132
+ }, undefined, true, undefined, this)
133
+ ]
134
+ }, undefined, true, undefined, this),
135
+ /* @__PURE__ */ jsxDEV2(Progress, {
136
+ value: percentComplete,
137
+ className: "h-2"
138
+ }, undefined, false, undefined, this)
139
+ ]
140
+ }, undefined, true, undefined, this),
141
+ /* @__PURE__ */ jsxDEV2("div", {
142
+ className: "space-y-3",
143
+ children: track.steps.map((step, index) => {
144
+ const isCompleted = progress.completedStepIds.includes(step.id);
145
+ const isCurrent = index === currentStepIndex;
146
+ return /* @__PURE__ */ jsxDEV2(StepChecklist, {
147
+ step,
148
+ stepNumber: index + 1,
149
+ isCompleted,
150
+ isCurrent,
151
+ isExpanded: expandedStepId === step.id,
152
+ onToggle: () => setExpandedStepId(expandedStepId === step.id ? null : step.id),
153
+ onComplete: () => {
154
+ onStepComplete?.(step.id);
155
+ const nextStep = track.steps[index + 1];
156
+ if (nextStep && !progress.completedStepIds.includes(nextStep.id)) {
157
+ setExpandedStepId(nextStep.id);
158
+ }
159
+ }
160
+ }, step.id, false, undefined, this);
161
+ })
162
+ }, undefined, false, undefined, this),
163
+ track.completionRewards && percentComplete < 100 && /* @__PURE__ */ jsxDEV2("div", {
164
+ className: "rounded-lg border border-blue-500/30 bg-blue-500/5 p-4",
165
+ children: /* @__PURE__ */ jsxDEV2("p", {
166
+ className: "text-sm",
167
+ children: [
168
+ "\uD83C\uDF81 Complete all steps to unlock:",
169
+ track.completionRewards.xpBonus && /* @__PURE__ */ jsxDEV2("span", {
170
+ className: "ml-2 font-semibold text-blue-500",
171
+ children: [
172
+ "+",
173
+ track.completionRewards.xpBonus,
174
+ " XP bonus"
175
+ ]
176
+ }, undefined, true, undefined, this),
177
+ track.completionRewards.badgeKey && /* @__PURE__ */ jsxDEV2("span", {
178
+ className: "ml-2 font-semibold text-amber-500",
179
+ children: [
180
+ '+ "',
181
+ track.completionRewards.badgeKey,
182
+ '" badge'
183
+ ]
184
+ }, undefined, true, undefined, this)
185
+ ]
186
+ }, undefined, true, undefined, this)
187
+ }, undefined, false, undefined, this)
188
+ ]
189
+ }, undefined, true, undefined, this);
88
190
  }
89
-
90
- //#endregion
91
- export { Steps };
92
- //# sourceMappingURL=Steps.js.map
191
+ export {
192
+ Steps
193
+ };
@@ -1,11 +1,3 @@
1
- import { LearningViewProps } from "@contractspec/example.learning-journey-ui-shared";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
-
4
- //#region src/views/Timeline.d.ts
5
- declare function Timeline({
6
- track,
7
- progress
8
- }: LearningViewProps): react_jsx_runtime0.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"],"mappings":";;;;iBAWgB,QAAA,CAAA;EAAW,KAAA;EAAO;AAAA,GAAY,iBAAA,GAAiB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
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,2CAiI9D"}
@@ -1,98 +1,214 @@
1
- 'use client';
2
-
3
- import { JourneyMap } from "../components/JourneyMap.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/JourneyMap.tsx
3
+ import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
4
+ import { jsxDEV } from "react/jsx-dev-runtime";
5
+ "use client";
6
+ var SURFACE_ICONS = {
7
+ templates: "\uD83D\uDCCB",
8
+ "spec-editor": "\u270F\uFE0F",
9
+ regenerator: "\uD83D\uDD04",
10
+ playground: "\uD83C\uDFAE",
11
+ evolution: "\uD83E\uDD16",
12
+ dashboard: "\uD83D\uDCCA",
13
+ settings: "\u2699\uFE0F",
14
+ default: "\uD83D\uDCCD"
15
+ };
16
+ function JourneyMap({
17
+ steps,
18
+ completedStepIds,
19
+ currentStepId
20
+ }) {
21
+ return /* @__PURE__ */ jsxDEV("div", {
22
+ className: "relative overflow-x-auto pb-4",
23
+ children: /* @__PURE__ */ jsxDEV("div", {
24
+ className: "flex min-w-max items-center gap-2",
25
+ children: steps.map((step, index) => {
26
+ const isCompleted = completedStepIds.includes(step.id);
27
+ const isCurrent = step.id === currentStepId;
28
+ const surface = step.metadata?.surface ?? "default";
29
+ const icon = SURFACE_ICONS[surface] ?? SURFACE_ICONS.default;
30
+ return /* @__PURE__ */ jsxDEV("div", {
31
+ className: "flex items-center",
32
+ children: [
33
+ /* @__PURE__ */ jsxDEV("div", {
34
+ className: "flex flex-col items-center gap-2",
35
+ children: [
36
+ /* @__PURE__ */ jsxDEV("div", {
37
+ className: cn("flex h-14 w-14 items-center justify-center rounded-2xl border-2 text-2xl transition-all", isCompleted && "border-green-500 bg-green-500/10", isCurrent && !isCompleted && "border-violet-500 bg-violet-500/10 ring-4 ring-violet-500/20", !isCompleted && !isCurrent && "border-muted bg-muted/50"),
38
+ children: isCompleted ? "\u2713" : icon
39
+ }, undefined, false, undefined, this),
40
+ /* @__PURE__ */ jsxDEV("div", {
41
+ className: "text-center",
42
+ children: /* @__PURE__ */ jsxDEV("p", {
43
+ className: cn("max-w-[100px] truncate text-xs font-medium", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
44
+ children: step.title
45
+ }, undefined, false, undefined, this)
46
+ }, undefined, false, undefined, this)
47
+ ]
48
+ }, undefined, true, undefined, this),
49
+ index < steps.length - 1 && /* @__PURE__ */ jsxDEV("div", {
50
+ className: cn("mx-2 h-1 w-8 rounded-full transition-colors", completedStepIds.includes(steps[index + 1]?.id ?? "") ? "bg-green-500" : isCompleted ? "bg-green-500/50" : "bg-muted")
51
+ }, undefined, false, undefined, this)
52
+ ]
53
+ }, step.id, true, undefined, this);
54
+ })
55
+ }, undefined, false, undefined, this)
56
+ }, undefined, false, undefined, this);
57
+ }
6
58
 
7
- //#region src/views/Timeline.tsx
59
+ // src/views/Timeline.tsx
60
+ import {
61
+ Card,
62
+ CardContent,
63
+ CardHeader,
64
+ CardTitle
65
+ } from "@contractspec/lib.ui-kit-web/ui/card";
66
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
67
+ "use client";
8
68
  function Timeline({ track, progress }) {
9
- const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
10
- return /* @__PURE__ */ jsxs("div", {
11
- className: "space-y-6",
12
- children: [
13
- /* @__PURE__ */ jsxs("div", {
14
- className: "text-center",
15
- children: [/* @__PURE__ */ jsx("h2", {
16
- className: "text-xl font-bold",
17
- children: "Your Learning Journey"
18
- }), /* @__PURE__ */ jsx("p", {
19
- className: "text-muted-foreground",
20
- children: "Follow the path through each surface and feature"
21
- })]
22
- }),
23
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
24
- className: "flex items-center gap-2",
25
- children: [/* @__PURE__ */ jsx("span", { children: "🗺️" }), /* @__PURE__ */ jsx("span", { children: "Journey Map" })]
26
- }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(JourneyMap, {
27
- steps: track.steps,
28
- completedStepIds: progress.completedStepIds,
29
- currentStepId
30
- }) })] }),
31
- /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsxs(CardTitle, {
32
- className: "flex items-center gap-2",
33
- children: [/* @__PURE__ */ jsx("span", { children: "📍" }), /* @__PURE__ */ jsx("span", { children: "Step by Step" })]
34
- }) }), /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsxs("div", {
35
- className: "relative",
36
- children: [/* @__PURE__ */ jsx("div", { className: "bg-border absolute top-0 left-4 h-full w-0.5" }), /* @__PURE__ */ jsx("div", {
37
- className: "space-y-6",
38
- children: track.steps.map((step, index) => {
39
- const isCompleted = progress.completedStepIds.includes(step.id);
40
- const isCurrent = step.id === currentStepId;
41
- const surface = step.metadata?.surface ?? "general";
42
- return /* @__PURE__ */ jsxs("div", {
43
- className: "relative flex gap-4 pl-2",
44
- children: [/* @__PURE__ */ jsx("div", {
45
- className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20" : "border-border bg-background text-muted-foreground"}`,
46
- children: isCompleted ? "✓" : index + 1
47
- }), /* @__PURE__ */ jsx("div", {
48
- className: "flex-1 pb-2",
49
- children: /* @__PURE__ */ jsxs("div", {
50
- className: "rounded-lg border p-4",
51
- children: [/* @__PURE__ */ jsxs("div", {
52
- className: "flex items-start justify-between gap-2",
53
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
54
- className: "flex items-center gap-2",
55
- children: [/* @__PURE__ */ jsx("h4", {
56
- className: `font-semibold ${isCompleted ? "text-green-500" : isCurrent ? "text-blue-500" : "text-foreground"}`,
57
- children: step.title
58
- }), /* @__PURE__ */ jsx("span", {
59
- className: "bg-muted text-muted-foreground rounded px-2 py-0.5 text-xs",
60
- children: surface
61
- })]
62
- }), /* @__PURE__ */ jsx("p", {
63
- className: "text-muted-foreground mt-1 text-sm",
64
- children: step.description
65
- })] }), step.xpReward && /* @__PURE__ */ jsxs("span", {
66
- 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"}`,
67
- children: [
68
- "+",
69
- step.xpReward,
70
- " XP"
71
- ]
72
- })]
73
- }), /* @__PURE__ */ jsx("div", {
74
- className: "mt-3 text-xs",
75
- children: isCompleted ? /* @__PURE__ */ jsx("span", {
76
- className: "text-green-500",
77
- children: "✓ Completed"
78
- }) : isCurrent ? /* @__PURE__ */ jsx("span", {
79
- className: "text-blue-500",
80
- children: "→ In Progress"
81
- }) : /* @__PURE__ */ jsx("span", {
82
- className: "text-muted-foreground",
83
- children: " Not Started"
84
- })
85
- })]
86
- })
87
- })]
88
- }, step.id);
89
- })
90
- })]
91
- }) })] })
92
- ]
93
- });
69
+ const currentStepId = track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ?? null;
70
+ return /* @__PURE__ */ jsxDEV2("div", {
71
+ className: "space-y-6",
72
+ children: [
73
+ /* @__PURE__ */ jsxDEV2("div", {
74
+ className: "text-center",
75
+ children: [
76
+ /* @__PURE__ */ jsxDEV2("h2", {
77
+ className: "text-xl font-bold",
78
+ children: "Your Learning Journey"
79
+ }, undefined, false, undefined, this),
80
+ /* @__PURE__ */ jsxDEV2("p", {
81
+ className: "text-muted-foreground",
82
+ children: "Follow the path through each surface and feature"
83
+ }, undefined, false, undefined, this)
84
+ ]
85
+ }, undefined, true, undefined, this),
86
+ /* @__PURE__ */ jsxDEV2(Card, {
87
+ children: [
88
+ /* @__PURE__ */ jsxDEV2(CardHeader, {
89
+ children: /* @__PURE__ */ jsxDEV2(CardTitle, {
90
+ className: "flex items-center gap-2",
91
+ children: [
92
+ /* @__PURE__ */ jsxDEV2("span", {
93
+ children: "\uD83D\uDDFA\uFE0F"
94
+ }, undefined, false, undefined, this),
95
+ /* @__PURE__ */ jsxDEV2("span", {
96
+ children: "Journey Map"
97
+ }, undefined, false, undefined, this)
98
+ ]
99
+ }, undefined, true, undefined, this)
100
+ }, undefined, false, undefined, this),
101
+ /* @__PURE__ */ jsxDEV2(CardContent, {
102
+ children: /* @__PURE__ */ jsxDEV2(JourneyMap, {
103
+ steps: track.steps,
104
+ completedStepIds: progress.completedStepIds,
105
+ currentStepId
106
+ }, undefined, false, undefined, this)
107
+ }, undefined, false, undefined, this)
108
+ ]
109
+ }, undefined, true, undefined, this),
110
+ /* @__PURE__ */ jsxDEV2(Card, {
111
+ children: [
112
+ /* @__PURE__ */ jsxDEV2(CardHeader, {
113
+ children: /* @__PURE__ */ jsxDEV2(CardTitle, {
114
+ className: "flex items-center gap-2",
115
+ children: [
116
+ /* @__PURE__ */ jsxDEV2("span", {
117
+ children: "\uD83D\uDCCD"
118
+ }, undefined, false, undefined, this),
119
+ /* @__PURE__ */ jsxDEV2("span", {
120
+ children: "Step by Step"
121
+ }, undefined, false, undefined, this)
122
+ ]
123
+ }, undefined, true, undefined, this)
124
+ }, undefined, false, undefined, this),
125
+ /* @__PURE__ */ jsxDEV2(CardContent, {
126
+ children: /* @__PURE__ */ jsxDEV2("div", {
127
+ className: "relative",
128
+ children: [
129
+ /* @__PURE__ */ jsxDEV2("div", {
130
+ className: "bg-border absolute top-0 left-4 h-full w-0.5"
131
+ }, undefined, false, undefined, this),
132
+ /* @__PURE__ */ jsxDEV2("div", {
133
+ className: "space-y-6",
134
+ children: track.steps.map((step, index) => {
135
+ const isCompleted = progress.completedStepIds.includes(step.id);
136
+ const isCurrent = step.id === currentStepId;
137
+ const surface = step.metadata?.surface ?? "general";
138
+ return /* @__PURE__ */ jsxDEV2("div", {
139
+ className: "relative flex gap-4 pl-2",
140
+ children: [
141
+ /* @__PURE__ */ jsxDEV2("div", {
142
+ className: `relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${isCompleted ? "border-green-500 bg-green-500 text-white" : isCurrent ? "border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20" : "border-border bg-background text-muted-foreground"}`,
143
+ children: isCompleted ? "\u2713" : index + 1
144
+ }, undefined, false, undefined, this),
145
+ /* @__PURE__ */ jsxDEV2("div", {
146
+ className: "flex-1 pb-2",
147
+ children: /* @__PURE__ */ jsxDEV2("div", {
148
+ className: "rounded-lg border p-4",
149
+ children: [
150
+ /* @__PURE__ */ jsxDEV2("div", {
151
+ className: "flex items-start justify-between gap-2",
152
+ children: [
153
+ /* @__PURE__ */ jsxDEV2("div", {
154
+ children: [
155
+ /* @__PURE__ */ jsxDEV2("div", {
156
+ className: "flex items-center gap-2",
157
+ children: [
158
+ /* @__PURE__ */ jsxDEV2("h4", {
159
+ className: `font-semibold ${isCompleted ? "text-green-500" : isCurrent ? "text-blue-500" : "text-foreground"}`,
160
+ children: step.title
161
+ }, undefined, false, undefined, this),
162
+ /* @__PURE__ */ jsxDEV2("span", {
163
+ className: "bg-muted text-muted-foreground rounded px-2 py-0.5 text-xs",
164
+ children: surface
165
+ }, undefined, false, undefined, this)
166
+ ]
167
+ }, undefined, true, undefined, this),
168
+ /* @__PURE__ */ jsxDEV2("p", {
169
+ className: "text-muted-foreground mt-1 text-sm",
170
+ children: step.description
171
+ }, undefined, false, undefined, this)
172
+ ]
173
+ }, undefined, true, undefined, this),
174
+ step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
175
+ 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"}`,
176
+ children: [
177
+ "+",
178
+ step.xpReward,
179
+ " XP"
180
+ ]
181
+ }, undefined, true, undefined, this)
182
+ ]
183
+ }, undefined, true, undefined, this),
184
+ /* @__PURE__ */ jsxDEV2("div", {
185
+ className: "mt-3 text-xs",
186
+ children: isCompleted ? /* @__PURE__ */ jsxDEV2("span", {
187
+ className: "text-green-500",
188
+ children: "\u2713 Completed"
189
+ }, undefined, false, undefined, this) : isCurrent ? /* @__PURE__ */ jsxDEV2("span", {
190
+ className: "text-blue-500",
191
+ children: "\u2192 In Progress"
192
+ }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV2("span", {
193
+ className: "text-muted-foreground",
194
+ children: "\u25CB Not Started"
195
+ }, undefined, false, undefined, this)
196
+ }, undefined, false, undefined, this)
197
+ ]
198
+ }, undefined, true, undefined, this)
199
+ }, undefined, false, undefined, this)
200
+ ]
201
+ }, step.id, true, undefined, this);
202
+ })
203
+ }, undefined, false, undefined, this)
204
+ ]
205
+ }, undefined, true, undefined, this)
206
+ }, undefined, false, undefined, this)
207
+ ]
208
+ }, undefined, true, undefined, this)
209
+ ]
210
+ }, undefined, true, undefined, this);
94
211
  }
95
-
96
- //#endregion
97
- export { Timeline };
98
- //# sourceMappingURL=Timeline.js.map
212
+ export {
213
+ Timeline
214
+ };
@@ -1,5 +1,5 @@
1
- import { Overview } from "./Overview.js";
2
- import { Steps } from "./Steps.js";
3
- import { Progress as ProgressView } from "./Progress.js";
4
- import { Timeline } from "./Timeline.js";
5
- export { Overview, ProgressView as 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"}