@contractspec/example.learning-journey-ui-onboarding 3.7.5 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +3 -3
- package/AGENTS.md +50 -24
- package/CHANGELOG.md +15 -0
- package/README.md +66 -26
- package/dist/OnboardingMiniApp.js +280 -280
- package/dist/browser/OnboardingMiniApp.js +280 -280
- package/dist/browser/components/CodeSnippet.js +4 -4
- package/dist/browser/components/JourneyMap.js +1 -1
- package/dist/browser/components/StepChecklist.js +6 -6
- package/dist/browser/components/index.js +11 -11
- package/dist/browser/index.js +285 -284
- package/dist/browser/views/Overview.js +14 -14
- package/dist/browser/views/Progress.js +9 -9
- package/dist/browser/views/Steps.js +8 -8
- package/dist/browser/views/Timeline.js +6 -6
- package/dist/browser/views/index.js +276 -276
- package/dist/components/CodeSnippet.js +4 -4
- package/dist/components/JourneyMap.js +1 -1
- package/dist/components/StepChecklist.js +6 -6
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +11 -11
- package/dist/index.d.ts +4 -4
- package/dist/index.js +285 -284
- package/dist/node/OnboardingMiniApp.js +280 -280
- package/dist/node/components/CodeSnippet.js +4 -4
- package/dist/node/components/JourneyMap.js +1 -1
- package/dist/node/components/StepChecklist.js +6 -6
- package/dist/node/components/index.js +11 -11
- package/dist/node/index.js +285 -284
- package/dist/node/views/Overview.js +14 -14
- package/dist/node/views/Progress.js +9 -9
- package/dist/node/views/Steps.js +8 -8
- package/dist/node/views/Timeline.js +6 -6
- package/dist/node/views/index.js +276 -276
- package/dist/views/Overview.js +14 -14
- package/dist/views/Progress.js +9 -9
- package/dist/views/Steps.js +8 -8
- package/dist/views/Timeline.js +6 -6
- package/dist/views/index.d.ts +1 -1
- package/dist/views/index.js +276 -276
- package/package.json +13 -13
- package/src/OnboardingMiniApp.tsx +70 -70
- package/src/components/CodeSnippet.tsx +43 -43
- package/src/components/JourneyMap.tsx +70 -70
- package/src/components/StepChecklist.tsx +118 -118
- package/src/components/index.ts +1 -1
- package/src/docs/learning-journey-ui-onboarding.docblock.ts +11 -11
- package/src/example.ts +25 -25
- package/src/index.ts +5 -6
- package/src/learning-journey-ui-onboarding.feature.ts +12 -12
- package/src/views/Overview.tsx +182 -182
- package/src/views/Progress.tsx +167 -167
- package/src/views/Steps.tsx +79 -79
- package/src/views/Timeline.tsx +126 -126
- package/src/views/index.ts +1 -1
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/views/Overview.tsx
|
|
2
|
+
import { XpBar } from "@contractspec/example.learning-journey-ui-shared";
|
|
2
3
|
import { Button } from "@contractspec/lib.design-system";
|
|
3
4
|
import {
|
|
4
5
|
Card,
|
|
@@ -7,7 +8,6 @@ import {
|
|
|
7
8
|
CardTitle
|
|
8
9
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
9
10
|
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
10
|
-
import { XpBar } from "@contractspec/example.learning-journey-ui-shared";
|
|
11
11
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
12
12
|
"use client";
|
|
13
13
|
function Overview({
|
|
@@ -40,15 +40,15 @@ function Overview({
|
|
|
40
40
|
className: "flex-1",
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ jsxDEV("h1", {
|
|
43
|
-
className: "text-2xl
|
|
43
|
+
className: "font-bold text-2xl",
|
|
44
44
|
children: track.name
|
|
45
45
|
}, undefined, false, undefined, this),
|
|
46
46
|
/* @__PURE__ */ jsxDEV("p", {
|
|
47
|
-
className: "
|
|
47
|
+
className: "mt-1 max-w-2xl text-muted-foreground",
|
|
48
48
|
children: track.description
|
|
49
49
|
}, undefined, false, undefined, this),
|
|
50
50
|
!isComplete && /* @__PURE__ */ jsxDEV("p", {
|
|
51
|
-
className: "text-muted-foreground
|
|
51
|
+
className: "mt-3 text-muted-foreground text-sm",
|
|
52
52
|
children: [
|
|
53
53
|
"⏱️ Estimated time:",
|
|
54
54
|
" ",
|
|
@@ -74,14 +74,14 @@ function Overview({
|
|
|
74
74
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
75
75
|
className: "pb-2",
|
|
76
76
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
77
|
-
className: "text-muted-foreground text-sm
|
|
77
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
78
78
|
children: "Progress"
|
|
79
79
|
}, undefined, false, undefined, this)
|
|
80
80
|
}, undefined, false, undefined, this),
|
|
81
81
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
82
82
|
children: [
|
|
83
83
|
/* @__PURE__ */ jsxDEV("div", {
|
|
84
|
-
className: "text-3xl
|
|
84
|
+
className: "font-bold text-3xl",
|
|
85
85
|
children: [
|
|
86
86
|
Math.round(percentComplete),
|
|
87
87
|
"%"
|
|
@@ -92,7 +92,7 @@ function Overview({
|
|
|
92
92
|
className: "mt-2 h-2"
|
|
93
93
|
}, undefined, false, undefined, this),
|
|
94
94
|
/* @__PURE__ */ jsxDEV("p", {
|
|
95
|
-
className: "text-muted-foreground
|
|
95
|
+
className: "mt-2 text-muted-foreground text-sm",
|
|
96
96
|
children: [
|
|
97
97
|
completedSteps,
|
|
98
98
|
" of ",
|
|
@@ -109,14 +109,14 @@ function Overview({
|
|
|
109
109
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
110
110
|
className: "pb-2",
|
|
111
111
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
112
|
-
className: "text-muted-foreground text-sm
|
|
112
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
113
113
|
children: "XP Earned"
|
|
114
114
|
}, undefined, false, undefined, this)
|
|
115
115
|
}, undefined, false, undefined, this),
|
|
116
116
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
117
117
|
children: [
|
|
118
118
|
/* @__PURE__ */ jsxDEV("div", {
|
|
119
|
-
className: "
|
|
119
|
+
className: "font-bold text-3xl text-blue-500",
|
|
120
120
|
children: progress.xpEarned
|
|
121
121
|
}, undefined, false, undefined, this),
|
|
122
122
|
/* @__PURE__ */ jsxDEV(XpBar, {
|
|
@@ -134,18 +134,18 @@ function Overview({
|
|
|
134
134
|
/* @__PURE__ */ jsxDEV(CardHeader, {
|
|
135
135
|
className: "pb-2",
|
|
136
136
|
children: /* @__PURE__ */ jsxDEV(CardTitle, {
|
|
137
|
-
className: "text-muted-foreground text-sm
|
|
137
|
+
className: "font-medium text-muted-foreground text-sm",
|
|
138
138
|
children: "Time Remaining"
|
|
139
139
|
}, undefined, false, undefined, this)
|
|
140
140
|
}, undefined, false, undefined, this),
|
|
141
141
|
/* @__PURE__ */ jsxDEV(CardContent, {
|
|
142
142
|
children: [
|
|
143
143
|
/* @__PURE__ */ jsxDEV("div", {
|
|
144
|
-
className: "text-3xl
|
|
144
|
+
className: "font-bold text-3xl",
|
|
145
145
|
children: isComplete ? "✓" : `~${estimatedMinutes}m`
|
|
146
146
|
}, undefined, false, undefined, this),
|
|
147
147
|
/* @__PURE__ */ jsxDEV("p", {
|
|
148
|
-
className: "text-muted-foreground
|
|
148
|
+
className: "mt-2 text-muted-foreground text-sm",
|
|
149
149
|
children: isComplete ? "All done!" : `${remainingSteps} steps to go`
|
|
150
150
|
}, undefined, false, undefined, this)
|
|
151
151
|
]
|
|
@@ -179,7 +179,7 @@ function Overview({
|
|
|
179
179
|
className: "flex items-center gap-4 rounded-lg border p-3",
|
|
180
180
|
children: [
|
|
181
181
|
/* @__PURE__ */ jsxDEV("div", {
|
|
182
|
-
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm
|
|
182
|
+
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-full font-semibold text-sm ${isStepCompleted ? "bg-green-500 text-white" : isCurrent ? "bg-blue-500 text-white" : "bg-muted text-muted-foreground"}`,
|
|
183
183
|
children: isStepCompleted ? "✓" : index + 1
|
|
184
184
|
}, undefined, false, undefined, this),
|
|
185
185
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -216,7 +216,7 @@ function Overview({
|
|
|
216
216
|
/* @__PURE__ */ jsxDEV("div", {
|
|
217
217
|
children: [
|
|
218
218
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
219
|
-
className: "
|
|
219
|
+
className: "font-semibold text-green-500 text-lg",
|
|
220
220
|
children: "Onboarding Complete!"
|
|
221
221
|
}, undefined, false, undefined, this),
|
|
222
222
|
/* @__PURE__ */ jsxDEV("p", {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
// src/views/Progress.tsx
|
|
2
|
+
import {
|
|
3
|
+
BadgeDisplay,
|
|
4
|
+
XpBar
|
|
5
|
+
} from "@contractspec/example.learning-journey-ui-shared";
|
|
2
6
|
import {
|
|
3
7
|
Card,
|
|
4
8
|
CardContent,
|
|
@@ -6,10 +10,6 @@ import {
|
|
|
6
10
|
CardTitle
|
|
7
11
|
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
8
12
|
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
9
|
-
import {
|
|
10
|
-
XpBar,
|
|
11
|
-
BadgeDisplay
|
|
12
|
-
} from "@contractspec/example.learning-journey-ui-shared";
|
|
13
13
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
14
14
|
"use client";
|
|
15
15
|
function ProgressView({ track, progress }) {
|
|
@@ -73,7 +73,7 @@ function ProgressView({ track, progress }) {
|
|
|
73
73
|
className: "text-center",
|
|
74
74
|
children: [
|
|
75
75
|
/* @__PURE__ */ jsxDEV("div", {
|
|
76
|
-
className: "text-3xl
|
|
76
|
+
className: "font-bold text-3xl",
|
|
77
77
|
children: [
|
|
78
78
|
Math.round(percentComplete),
|
|
79
79
|
"%"
|
|
@@ -94,7 +94,7 @@ function ProgressView({ track, progress }) {
|
|
|
94
94
|
/* @__PURE__ */ jsxDEV("div", {
|
|
95
95
|
children: [
|
|
96
96
|
/* @__PURE__ */ jsxDEV("div", {
|
|
97
|
-
className: "
|
|
97
|
+
className: "font-bold text-2xl text-green-500",
|
|
98
98
|
children: completedSteps
|
|
99
99
|
}, undefined, false, undefined, this),
|
|
100
100
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -106,7 +106,7 @@ function ProgressView({ track, progress }) {
|
|
|
106
106
|
/* @__PURE__ */ jsxDEV("div", {
|
|
107
107
|
children: [
|
|
108
108
|
/* @__PURE__ */ jsxDEV("div", {
|
|
109
|
-
className: "
|
|
109
|
+
className: "font-bold text-2xl text-orange-500",
|
|
110
110
|
children: remainingSteps
|
|
111
111
|
}, undefined, false, undefined, this),
|
|
112
112
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -118,7 +118,7 @@ function ProgressView({ track, progress }) {
|
|
|
118
118
|
/* @__PURE__ */ jsxDEV("div", {
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ jsxDEV("div", {
|
|
121
|
-
className: "text-2xl
|
|
121
|
+
className: "font-bold text-2xl",
|
|
122
122
|
children: [
|
|
123
123
|
estimatedMinutes,
|
|
124
124
|
"m"
|
|
@@ -158,7 +158,7 @@ function ProgressView({ track, progress }) {
|
|
|
158
158
|
className: "flex items-baseline gap-2",
|
|
159
159
|
children: [
|
|
160
160
|
/* @__PURE__ */ jsxDEV("span", {
|
|
161
|
-
className: "
|
|
161
|
+
className: "font-bold text-3xl text-blue-500",
|
|
162
162
|
children: progress.xpEarned
|
|
163
163
|
}, undefined, false, undefined, this),
|
|
164
164
|
/* @__PURE__ */ jsxDEV("span", {
|
|
@@ -21,7 +21,7 @@ function StepChecklist({
|
|
|
21
21
|
onClick: onToggle,
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ jsxDEV("div", {
|
|
24
|
-
className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-sm
|
|
24
|
+
className: cn("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm 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"),
|
|
25
25
|
children: isCompleted ? "✓" : stepNumber
|
|
26
26
|
}, undefined, false, undefined, this),
|
|
27
27
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -32,13 +32,13 @@ function StepChecklist({
|
|
|
32
32
|
children: step.title
|
|
33
33
|
}, undefined, false, undefined, this),
|
|
34
34
|
!isExpanded && step.description && /* @__PURE__ */ jsxDEV("p", {
|
|
35
|
-
className: "text-muted-foreground
|
|
35
|
+
className: "truncate text-muted-foreground text-sm",
|
|
36
36
|
children: step.description
|
|
37
37
|
}, undefined, false, undefined, this)
|
|
38
38
|
]
|
|
39
39
|
}, undefined, true, undefined, this),
|
|
40
40
|
step.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
41
|
-
className: cn("shrink-0 rounded-full px-2 py-1 text-xs
|
|
41
|
+
className: cn("shrink-0 rounded-full px-2 py-1 font-semibold text-xs", isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"),
|
|
42
42
|
children: [
|
|
43
43
|
"+",
|
|
44
44
|
step.xpReward,
|
|
@@ -55,14 +55,14 @@ function StepChecklist({
|
|
|
55
55
|
className: "border-t px-4 py-4",
|
|
56
56
|
children: [
|
|
57
57
|
step.description && /* @__PURE__ */ jsxDEV("p", {
|
|
58
|
-
className: "text-muted-foreground
|
|
58
|
+
className: "mb-4 text-muted-foreground",
|
|
59
59
|
children: step.description
|
|
60
60
|
}, undefined, false, undefined, this),
|
|
61
61
|
step.instructions && /* @__PURE__ */ jsxDEV("div", {
|
|
62
|
-
className: "
|
|
62
|
+
className: "mb-4 rounded-lg bg-muted p-4",
|
|
63
63
|
children: [
|
|
64
64
|
/* @__PURE__ */ jsxDEV("p", {
|
|
65
|
-
className: "mb-2 text-sm
|
|
65
|
+
className: "mb-2 font-medium text-sm",
|
|
66
66
|
children: "Instructions:"
|
|
67
67
|
}, undefined, false, undefined, this),
|
|
68
68
|
/* @__PURE__ */ jsxDEV("p", {
|
|
@@ -94,8 +94,8 @@ function StepChecklist({
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// src/views/Steps.tsx
|
|
97
|
-
import { useState } from "react";
|
|
98
97
|
import { Progress } from "@contractspec/lib.ui-kit-web/ui/progress";
|
|
98
|
+
import { useState } from "react";
|
|
99
99
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
100
100
|
"use client";
|
|
101
101
|
function Steps({ track, progress, onStepComplete }) {
|
|
@@ -117,7 +117,7 @@ function Steps({ track, progress, onStepComplete }) {
|
|
|
117
117
|
className: "flex items-center justify-between",
|
|
118
118
|
children: [
|
|
119
119
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
120
|
-
className: "text-xl
|
|
120
|
+
className: "font-bold text-xl",
|
|
121
121
|
children: "Complete Each Step"
|
|
122
122
|
}, undefined, false, undefined, this),
|
|
123
123
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
@@ -39,7 +39,7 @@ function JourneyMap({
|
|
|
39
39
|
/* @__PURE__ */ jsxDEV("div", {
|
|
40
40
|
className: "text-center",
|
|
41
41
|
children: /* @__PURE__ */ jsxDEV("p", {
|
|
42
|
-
className: cn("max-w-[100px] truncate text-xs
|
|
42
|
+
className: cn("max-w-[100px] truncate font-medium text-xs", isCompleted && "text-green-500", isCurrent && !isCompleted && "text-violet-500", !isCompleted && !isCurrent && "text-muted-foreground"),
|
|
43
43
|
children: step.title
|
|
44
44
|
}, undefined, false, undefined, this)
|
|
45
45
|
}, undefined, false, undefined, this)
|
|
@@ -73,7 +73,7 @@ function Timeline({ track, progress }) {
|
|
|
73
73
|
className: "text-center",
|
|
74
74
|
children: [
|
|
75
75
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
76
|
-
className: "text-xl
|
|
76
|
+
className: "font-bold text-xl",
|
|
77
77
|
children: "Your Learning Journey"
|
|
78
78
|
}, undefined, false, undefined, this),
|
|
79
79
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -126,7 +126,7 @@ function Timeline({ track, progress }) {
|
|
|
126
126
|
className: "relative",
|
|
127
127
|
children: [
|
|
128
128
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
129
|
-
className: "
|
|
129
|
+
className: "absolute top-0 left-4 h-full w-0.5 bg-border"
|
|
130
130
|
}, undefined, false, undefined, this),
|
|
131
131
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
132
132
|
className: "space-y-6",
|
|
@@ -159,19 +159,19 @@ function Timeline({ track, progress }) {
|
|
|
159
159
|
children: step.title
|
|
160
160
|
}, undefined, false, undefined, this),
|
|
161
161
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
162
|
-
className: "bg-muted
|
|
162
|
+
className: "rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs",
|
|
163
163
|
children: surface
|
|
164
164
|
}, undefined, false, undefined, this)
|
|
165
165
|
]
|
|
166
166
|
}, undefined, true, undefined, this),
|
|
167
167
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
168
|
-
className: "text-muted-foreground
|
|
168
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
169
169
|
children: step.description
|
|
170
170
|
}, undefined, false, undefined, this)
|
|
171
171
|
]
|
|
172
172
|
}, undefined, true, undefined, this),
|
|
173
173
|
step.xpReward && /* @__PURE__ */ jsxDEV2("span", {
|
|
174
|
-
className: `shrink-0 rounded-full px-2 py-1 text-xs
|
|
174
|
+
className: `shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${isCompleted ? "bg-green-500/10 text-green-500" : "bg-muted text-muted-foreground"}`,
|
|
175
175
|
children: [
|
|
176
176
|
"+",
|
|
177
177
|
step.xpReward,
|