@contractspec/example.learning-journey-ui-onboarding 3.7.6 → 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/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 +10 -10
- 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
package/src/views/Timeline.tsx
CHANGED
|
@@ -1,141 +1,141 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared';
|
|
3
4
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Card,
|
|
6
|
+
CardContent,
|
|
7
|
+
CardHeader,
|
|
8
|
+
CardTitle,
|
|
8
9
|
} from '@contractspec/lib.ui-kit-web/ui/card';
|
|
9
10
|
import { JourneyMap } from '../components/JourneyMap';
|
|
10
|
-
import type { LearningViewProps } from '@contractspec/example.learning-journey-ui-shared';
|
|
11
11
|
|
|
12
12
|
export function Timeline({ track, progress }: LearningViewProps) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
// Find current step
|
|
14
|
+
const currentStepId =
|
|
15
|
+
track.steps.find((s) => !progress.completedStepIds.includes(s.id))?.id ??
|
|
16
|
+
null;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
return (
|
|
19
|
+
<div className="space-y-6">
|
|
20
|
+
{/* Header */}
|
|
21
|
+
<div className="text-center">
|
|
22
|
+
<h2 className="font-bold text-xl">Your Learning Journey</h2>
|
|
23
|
+
<p className="text-muted-foreground">
|
|
24
|
+
Follow the path through each surface and feature
|
|
25
|
+
</p>
|
|
26
|
+
</div>
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
{/* Journey Map */}
|
|
29
|
+
<Card>
|
|
30
|
+
<CardHeader>
|
|
31
|
+
<CardTitle className="flex items-center gap-2">
|
|
32
|
+
<span>🗺️</span>
|
|
33
|
+
<span>Journey Map</span>
|
|
34
|
+
</CardTitle>
|
|
35
|
+
</CardHeader>
|
|
36
|
+
<CardContent>
|
|
37
|
+
<JourneyMap
|
|
38
|
+
steps={track.steps}
|
|
39
|
+
completedStepIds={progress.completedStepIds}
|
|
40
|
+
currentStepId={currentStepId}
|
|
41
|
+
/>
|
|
42
|
+
</CardContent>
|
|
43
|
+
</Card>
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
{/* Detailed Timeline */}
|
|
46
|
+
<Card>
|
|
47
|
+
<CardHeader>
|
|
48
|
+
<CardTitle className="flex items-center gap-2">
|
|
49
|
+
<span>📍</span>
|
|
50
|
+
<span>Step by Step</span>
|
|
51
|
+
</CardTitle>
|
|
52
|
+
</CardHeader>
|
|
53
|
+
<CardContent>
|
|
54
|
+
<div className="relative">
|
|
55
|
+
{/* Vertical line */}
|
|
56
|
+
<div className="absolute top-0 left-4 h-full w-0.5 bg-border" />
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
{/* Steps */}
|
|
59
|
+
<div className="space-y-6">
|
|
60
|
+
{track.steps.map((step, index) => {
|
|
61
|
+
const isCompleted = progress.completedStepIds.includes(step.id);
|
|
62
|
+
const isCurrent = step.id === currentStepId;
|
|
63
|
+
const surface = (step.metadata?.surface as string) ?? 'general';
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
return (
|
|
66
|
+
<div key={step.id} className="relative flex gap-4 pl-2">
|
|
67
|
+
{/* Node */}
|
|
68
|
+
<div
|
|
69
|
+
className={`relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 transition-all ${
|
|
70
|
+
isCompleted
|
|
71
|
+
? 'border-green-500 bg-green-500 text-white'
|
|
72
|
+
: isCurrent
|
|
73
|
+
? 'border-blue-500 bg-blue-500 text-white ring-4 ring-blue-500/20'
|
|
74
|
+
: 'border-border bg-background text-muted-foreground'
|
|
75
|
+
}`}
|
|
76
|
+
>
|
|
77
|
+
{isCompleted ? '✓' : index + 1}
|
|
78
|
+
</div>
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
80
|
+
{/* Content */}
|
|
81
|
+
<div className="flex-1 pb-2">
|
|
82
|
+
<div className="rounded-lg border p-4">
|
|
83
|
+
<div className="flex items-start justify-between gap-2">
|
|
84
|
+
<div>
|
|
85
|
+
<div className="flex items-center gap-2">
|
|
86
|
+
<h4
|
|
87
|
+
className={`font-semibold ${
|
|
88
|
+
isCompleted
|
|
89
|
+
? 'text-green-500'
|
|
90
|
+
: isCurrent
|
|
91
|
+
? 'text-blue-500'
|
|
92
|
+
: 'text-foreground'
|
|
93
|
+
}`}
|
|
94
|
+
>
|
|
95
|
+
{step.title}
|
|
96
|
+
</h4>
|
|
97
|
+
<span className="rounded bg-muted px-2 py-0.5 text-muted-foreground text-xs">
|
|
98
|
+
{surface}
|
|
99
|
+
</span>
|
|
100
|
+
</div>
|
|
101
|
+
<p className="mt-1 text-muted-foreground text-sm">
|
|
102
|
+
{step.description}
|
|
103
|
+
</p>
|
|
104
|
+
</div>
|
|
105
|
+
{step.xpReward && (
|
|
106
|
+
<span
|
|
107
|
+
className={`shrink-0 rounded-full px-2 py-1 font-semibold text-xs ${
|
|
108
|
+
isCompleted
|
|
109
|
+
? 'bg-green-500/10 text-green-500'
|
|
110
|
+
: 'bg-muted text-muted-foreground'
|
|
111
|
+
}`}
|
|
112
|
+
>
|
|
113
|
+
+{step.xpReward} XP
|
|
114
|
+
</span>
|
|
115
|
+
)}
|
|
116
|
+
</div>
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
118
|
+
{/* Status */}
|
|
119
|
+
<div className="mt-3 text-xs">
|
|
120
|
+
{isCompleted ? (
|
|
121
|
+
<span className="text-green-500">✓ Completed</span>
|
|
122
|
+
) : isCurrent ? (
|
|
123
|
+
<span className="text-blue-500">→ In Progress</span>
|
|
124
|
+
) : (
|
|
125
|
+
<span className="text-muted-foreground">
|
|
126
|
+
○ Not Started
|
|
127
|
+
</span>
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
})}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</CardContent>
|
|
138
|
+
</Card>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
141
|
}
|
package/src/views/index.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"extends": "@contractspec/tool.typescript/react-library.json",
|
|
3
|
+
"include": ["src"],
|
|
4
|
+
"exclude": ["node_modules"],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"rootDir": "src",
|
|
7
|
+
"outDir": "dist"
|
|
8
|
+
}
|
|
9
9
|
}
|
|
10
|
-
|
package/tsdown.config.js
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
defineConfig,
|
|
3
|
+
moduleLibrary,
|
|
4
|
+
withDevExports,
|
|
5
|
+
} from '@contractspec/tool.bun';
|
|
2
6
|
|
|
3
7
|
export default defineConfig(() => ({
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
...moduleLibrary,
|
|
9
|
+
...withDevExports,
|
|
6
10
|
}));
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|