@lssm/example.learning-journey-ui-coaching 0.0.0-canary-20251212210835

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.
@@ -0,0 +1,115 @@
1
+ 'use client';
2
+
3
+ import {
4
+ Card,
5
+ CardContent,
6
+ CardHeader,
7
+ CardTitle,
8
+ } from '@lssm/lib.ui-kit-web/ui/card';
9
+ import { TipFeed } from '../components/TipFeed';
10
+ import type { LearningViewProps } from '@lssm/example.learning-journey-ui-shared';
11
+
12
+ export function Timeline({ track, progress }: LearningViewProps) {
13
+ // Create feed items sorted by completion status (completed first for "recent activity")
14
+ const feedItems = track.steps
15
+ .map((step) => ({
16
+ step,
17
+ isCompleted: progress.completedStepIds.includes(step.id),
18
+ completedAt: progress.completedStepIds.includes(step.id)
19
+ ? 'Recently'
20
+ : undefined,
21
+ }))
22
+ .sort((a, b) => {
23
+ // Completed items first (as recent activity)
24
+ if (a.isCompleted && !b.isCompleted) return -1;
25
+ if (!a.isCompleted && b.isCompleted) return 1;
26
+ return 0;
27
+ });
28
+
29
+ const completedCount = feedItems.filter((f) => f.isCompleted).length;
30
+ const pendingCount = feedItems.length - completedCount;
31
+
32
+ return (
33
+ <div className="space-y-6">
34
+ {/* Header */}
35
+ <div className="text-center">
36
+ <h2 className="text-xl font-bold">Activity Timeline</h2>
37
+ <p className="text-muted-foreground">
38
+ Your coaching journey and tip history
39
+ </p>
40
+ </div>
41
+
42
+ {/* Summary */}
43
+ <div className="grid grid-cols-2 gap-4">
44
+ <Card>
45
+ <CardContent className="p-4 text-center">
46
+ <div className="text-2xl font-bold text-green-500">
47
+ {completedCount}
48
+ </div>
49
+ <div className="text-muted-foreground text-sm">Tips Actioned</div>
50
+ </CardContent>
51
+ </Card>
52
+ <Card>
53
+ <CardContent className="p-4 text-center">
54
+ <div className="text-2xl font-bold text-amber-500">
55
+ {pendingCount}
56
+ </div>
57
+ <div className="text-muted-foreground text-sm">Tips Pending</div>
58
+ </CardContent>
59
+ </Card>
60
+ </div>
61
+
62
+ {/* Activity Feed */}
63
+ <Card>
64
+ <CardHeader>
65
+ <CardTitle className="flex items-center gap-2">
66
+ <span>📝</span>
67
+ <span>Coaching Feed</span>
68
+ </CardTitle>
69
+ </CardHeader>
70
+ <CardContent>
71
+ <TipFeed items={feedItems} />
72
+ </CardContent>
73
+ </Card>
74
+
75
+ {/* Journey Stats */}
76
+ <Card>
77
+ <CardHeader>
78
+ <CardTitle className="flex items-center gap-2">
79
+ <span>📈</span>
80
+ <span>Journey Stats</span>
81
+ </CardTitle>
82
+ </CardHeader>
83
+ <CardContent>
84
+ <div className="space-y-4">
85
+ <div className="flex items-center justify-between">
86
+ <span className="text-muted-foreground">Total Tips</span>
87
+ <span className="font-semibold">{track.steps.length}</span>
88
+ </div>
89
+ <div className="flex items-center justify-between">
90
+ <span className="text-muted-foreground">Completed</span>
91
+ <span className="font-semibold text-green-500">
92
+ {completedCount}
93
+ </span>
94
+ </div>
95
+ <div className="flex items-center justify-between">
96
+ <span className="text-muted-foreground">XP Earned</span>
97
+ <span className="font-semibold text-orange-500">
98
+ {progress.xpEarned}
99
+ </span>
100
+ </div>
101
+ <div className="flex items-center justify-between">
102
+ <span className="text-muted-foreground">Current Streak</span>
103
+ <span className="font-semibold">
104
+ {progress.streakDays > 0
105
+ ? `🔥 ${progress.streakDays} days`
106
+ : 'Start today!'}
107
+ </span>
108
+ </div>
109
+ </div>
110
+ </CardContent>
111
+ </Card>
112
+ </div>
113
+ );
114
+ }
115
+
@@ -0,0 +1,5 @@
1
+ export { Overview } from './Overview';
2
+ export { Steps } from './Steps';
3
+ export { Progress } from './Progress';
4
+ export { Timeline } from './Timeline';
5
+
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@lssm/tool.typescript/react-library.json",
3
+ "include": ["src"],
4
+ "exclude": ["node_modules"],
5
+ "compilerOptions": {
6
+ "rootDir": "src",
7
+ "outDir": "dist"
8
+ }
9
+ }
10
+