@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
|
@@ -5,132 +5,132 @@ import { cn } from '@contractspec/lib.ui-kit-core';
|
|
|
5
5
|
import type { LearningJourneyStepSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
6
6
|
|
|
7
7
|
interface StepChecklistProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
step: LearningJourneyStepSpec;
|
|
9
|
+
stepNumber: number;
|
|
10
|
+
isCompleted: boolean;
|
|
11
|
+
isCurrent: boolean;
|
|
12
|
+
isExpanded: boolean;
|
|
13
|
+
onToggle: () => void;
|
|
14
|
+
onComplete?: () => void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export function StepChecklist({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
step,
|
|
19
|
+
stepNumber,
|
|
20
|
+
isCompleted,
|
|
21
|
+
isCurrent,
|
|
22
|
+
isExpanded,
|
|
23
|
+
onToggle,
|
|
24
|
+
onComplete,
|
|
25
25
|
}: StepChecklistProps) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
className={cn(
|
|
29
|
+
'rounded-xl border transition-all',
|
|
30
|
+
isCompleted && 'border-green-500/50 bg-green-500/5',
|
|
31
|
+
isCurrent && !isCompleted && 'border-violet-500 bg-violet-500/5',
|
|
32
|
+
!isCompleted && !isCurrent && 'border-border'
|
|
33
|
+
)}
|
|
34
|
+
>
|
|
35
|
+
{/* Header */}
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
className="flex w-full items-center gap-4 p-4 text-left"
|
|
39
|
+
onClick={onToggle}
|
|
40
|
+
>
|
|
41
|
+
{/* Checkbox/Number */}
|
|
42
|
+
<div
|
|
43
|
+
className={cn(
|
|
44
|
+
'flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 font-semibold text-sm transition-colors',
|
|
45
|
+
isCompleted && 'border-green-500 bg-green-500 text-white',
|
|
46
|
+
isCurrent && !isCompleted && 'border-violet-500 text-violet-500',
|
|
47
|
+
!isCompleted &&
|
|
48
|
+
!isCurrent &&
|
|
49
|
+
'border-muted-foreground text-muted-foreground'
|
|
50
|
+
)}
|
|
51
|
+
>
|
|
52
|
+
{isCompleted ? '✓' : stepNumber}
|
|
53
|
+
</div>
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
{/* Title & Description */}
|
|
56
|
+
<div className="min-w-0 flex-1">
|
|
57
|
+
<h4
|
|
58
|
+
className={cn(
|
|
59
|
+
'font-semibold',
|
|
60
|
+
isCompleted && 'text-green-500',
|
|
61
|
+
isCurrent && !isCompleted && 'text-foreground',
|
|
62
|
+
!isCompleted && !isCurrent && 'text-muted-foreground'
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
65
|
+
{step.title}
|
|
66
|
+
</h4>
|
|
67
|
+
{!isExpanded && step.description && (
|
|
68
|
+
<p className="truncate text-muted-foreground text-sm">
|
|
69
|
+
{step.description}
|
|
70
|
+
</p>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
74
|
+
{/* XP Badge */}
|
|
75
|
+
{step.xpReward && (
|
|
76
|
+
<span
|
|
77
|
+
className={cn(
|
|
78
|
+
'shrink-0 rounded-full px-2 py-1 font-semibold text-xs',
|
|
79
|
+
isCompleted
|
|
80
|
+
? 'bg-green-500/10 text-green-500'
|
|
81
|
+
: 'bg-muted text-muted-foreground'
|
|
82
|
+
)}
|
|
83
|
+
>
|
|
84
|
+
+{step.xpReward} XP
|
|
85
|
+
</span>
|
|
86
|
+
)}
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
{/* Expand indicator */}
|
|
89
|
+
<span
|
|
90
|
+
className={cn(
|
|
91
|
+
'shrink-0 transition-transform',
|
|
92
|
+
isExpanded && 'rotate-180'
|
|
93
|
+
)}
|
|
94
|
+
>
|
|
95
|
+
▼
|
|
96
|
+
</span>
|
|
97
|
+
</button>
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
{/* Expanded Content */}
|
|
100
|
+
{isExpanded && (
|
|
101
|
+
<div className="border-t px-4 py-4">
|
|
102
|
+
{step.description && (
|
|
103
|
+
<p className="mb-4 text-muted-foreground">{step.description}</p>
|
|
104
|
+
)}
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
{step.instructions && (
|
|
107
|
+
<div className="mb-4 rounded-lg bg-muted p-4">
|
|
108
|
+
<p className="mb-2 font-medium text-sm">Instructions:</p>
|
|
109
|
+
<p className="text-muted-foreground text-sm">
|
|
110
|
+
{step.instructions}
|
|
111
|
+
</p>
|
|
112
|
+
</div>
|
|
113
|
+
)}
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
115
|
+
{/* Action buttons */}
|
|
116
|
+
<div className="flex flex-wrap gap-2">
|
|
117
|
+
{step.actionUrl && (
|
|
118
|
+
<Button
|
|
119
|
+
variant="outline"
|
|
120
|
+
size="sm"
|
|
121
|
+
onClick={() => window.open(step.actionUrl, '_blank')}
|
|
122
|
+
>
|
|
123
|
+
{step.actionLabel ?? 'Try it'}
|
|
124
|
+
</Button>
|
|
125
|
+
)}
|
|
126
|
+
{!isCompleted && (
|
|
127
|
+
<Button size="sm" onClick={onComplete}>
|
|
128
|
+
Mark as Complete
|
|
129
|
+
</Button>
|
|
130
|
+
)}
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
)}
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
136
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,17 +2,17 @@ import type { DocBlock } from '@contractspec/lib.contracts-spec/docs';
|
|
|
2
2
|
import { registerDocBlocks } from '@contractspec/lib.contracts-spec/docs';
|
|
3
3
|
|
|
4
4
|
const blocks: DocBlock[] = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.examples.learning-journey-ui-onboarding',
|
|
7
|
+
title: 'Learning Journey UI — Onboarding',
|
|
8
|
+
summary:
|
|
9
|
+
'UI mini-app components for onboarding: checklists, snippets, and journey mapping.',
|
|
10
|
+
kind: 'reference',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
route: '/docs/examples/learning-journey-ui-onboarding',
|
|
13
|
+
tags: ['learning', 'ui', 'onboarding'],
|
|
14
|
+
body: `## Includes\n- Onboarding mini-app shell\n- Views: overview, steps, progress, timeline\n- Components: step checklist, code snippet, journey map\n\n## Notes\n- Compose with design system components.\n- Ensure accessible labels and keyboard navigation.`,
|
|
15
|
+
},
|
|
16
16
|
];
|
|
17
17
|
|
|
18
18
|
registerDocBlocks(blocks);
|
package/src/example.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { defineExample } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
const example = defineExample({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'learning-journey-ui-onboarding',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Learning Journey UI — Onboarding',
|
|
8
|
+
description:
|
|
9
|
+
'UI mini-app for onboarding patterns: checklists, code snippets, journey map.',
|
|
10
|
+
kind: 'ui',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
stability: 'experimental',
|
|
13
|
+
owners: ['@platform.core'],
|
|
14
|
+
tags: ['learning', 'ui', 'onboarding'],
|
|
15
|
+
},
|
|
16
|
+
docs: {
|
|
17
|
+
rootDocId: 'docs.examples.learning-journey-ui-onboarding',
|
|
18
|
+
},
|
|
19
|
+
entrypoints: {
|
|
20
|
+
packageName: '@contractspec/example.learning-journey-ui-onboarding',
|
|
21
|
+
docs: './docs',
|
|
22
|
+
},
|
|
23
|
+
surfaces: {
|
|
24
|
+
templates: true,
|
|
25
|
+
sandbox: { enabled: true, modes: ['playground', 'markdown'] },
|
|
26
|
+
studio: { enabled: true, installable: true },
|
|
27
|
+
mcp: { enabled: true },
|
|
28
|
+
},
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
export default example;
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Main mini-app
|
|
2
|
-
export { OnboardingMiniApp } from './OnboardingMiniApp';
|
|
3
|
-
|
|
4
|
-
// Views
|
|
5
|
-
export { Overview, Steps, Progress, Timeline } from './views';
|
|
6
2
|
|
|
7
3
|
// Components
|
|
8
|
-
export {
|
|
9
|
-
export * from './learning-journey-ui-onboarding.feature';
|
|
4
|
+
export { CodeSnippet, JourneyMap, StepChecklist } from './components';
|
|
10
5
|
export { default as example } from './example';
|
|
6
|
+
export * from './learning-journey-ui-onboarding.feature';
|
|
7
|
+
export { OnboardingMiniApp } from './OnboardingMiniApp';
|
|
8
|
+
// Views
|
|
9
|
+
export { Overview, Progress, Steps, Timeline } from './views';
|
|
11
10
|
import './docs';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineFeature } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
|
|
3
3
|
export const LearningJourneyUiOnboardingFeature = defineFeature({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
meta: {
|
|
5
|
+
key: 'learning-journey-ui-onboarding',
|
|
6
|
+
version: '1.0.0',
|
|
7
|
+
title: 'Learning Journey UI: Onboarding',
|
|
8
|
+
description:
|
|
9
|
+
'Developer onboarding UI with checklists, journey maps, and step-by-step progress',
|
|
10
|
+
domain: 'learning-journey',
|
|
11
|
+
owners: ['@examples'],
|
|
12
|
+
tags: ['learning', 'ui', 'onboarding', 'checklists'],
|
|
13
|
+
stability: 'experimental',
|
|
14
|
+
},
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
docs: ['docs.examples.learning-journey-ui-onboarding'],
|
|
17
17
|
});
|