@contractspec/example.learning-journey-ui-coaching 3.7.17 → 3.7.19
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 +48 -48
- package/CHANGELOG.md +30 -0
- package/dist/CoachingMiniApp.js +1 -1059
- package/dist/browser/CoachingMiniApp.js +1 -1059
- package/dist/browser/components/EngagementMeter.js +1 -143
- package/dist/browser/components/TipCard.js +1 -89
- package/dist/browser/components/TipFeed.js +1 -90
- package/dist/browser/components/index.js +1 -320
- package/dist/browser/docs/index.js +2 -16
- package/dist/browser/docs/learning-journey-ui-coaching.docblock.js +2 -16
- package/dist/browser/example.js +1 -32
- package/dist/browser/index.js +2 -1129
- package/dist/browser/learning-journey-ui-coaching.feature.js +1 -18
- package/dist/browser/views/Overview.js +1 -303
- package/dist/browser/views/Progress.js +1 -344
- package/dist/browser/views/Steps.js +1 -159
- package/dist/browser/views/Timeline.js +1 -266
- package/dist/browser/views/index.js +1 -980
- package/dist/components/EngagementMeter.js +1 -143
- package/dist/components/TipCard.js +1 -89
- package/dist/components/TipFeed.js +1 -90
- package/dist/components/index.js +1 -320
- package/dist/docs/index.js +2 -16
- package/dist/docs/learning-journey-ui-coaching.docblock.js +2 -16
- package/dist/example.js +1 -32
- package/dist/index.js +2 -1129
- package/dist/learning-journey-ui-coaching.feature.js +1 -18
- package/dist/node/CoachingMiniApp.js +1 -1059
- package/dist/node/components/EngagementMeter.js +1 -143
- package/dist/node/components/TipCard.js +1 -89
- package/dist/node/components/TipFeed.js +1 -90
- package/dist/node/components/index.js +1 -320
- package/dist/node/docs/index.js +2 -16
- package/dist/node/docs/learning-journey-ui-coaching.docblock.js +2 -16
- package/dist/node/example.js +1 -32
- package/dist/node/index.js +2 -1129
- package/dist/node/learning-journey-ui-coaching.feature.js +1 -18
- package/dist/node/views/Overview.js +1 -303
- package/dist/node/views/Progress.js +1 -344
- package/dist/node/views/Steps.js +1 -159
- package/dist/node/views/Timeline.js +1 -266
- package/dist/node/views/index.js +1 -980
- package/dist/views/Overview.js +1 -303
- package/dist/views/Progress.js +1 -344
- package/dist/views/Steps.js +1 -159
- package/dist/views/Timeline.js +1 -266
- package/dist/views/index.js +1 -980
- package/package.json +11 -11
|
@@ -1,266 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
|
|
3
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
4
|
-
"use client";
|
|
5
|
-
var TIP_ICONS = {
|
|
6
|
-
cash_buffer_too_high: "\uD83D\uDCB0",
|
|
7
|
-
no_savings_goal: "\uD83C\uDFAF",
|
|
8
|
-
irregular_savings: "\uD83D\uDCC5",
|
|
9
|
-
noise_late_evening: "\uD83D\uDD07",
|
|
10
|
-
guest_frequency_high: "\uD83D\uDC65",
|
|
11
|
-
shared_space_conflicts: "\uD83C\uDFE0",
|
|
12
|
-
default: "\uD83D\uDCA1"
|
|
13
|
-
};
|
|
14
|
-
function TipFeed({ items }) {
|
|
15
|
-
if (items.length === 0) {
|
|
16
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
17
|
-
className: "py-8 text-center text-muted-foreground",
|
|
18
|
-
children: "No tips yet. Start engaging with coaching tips!"
|
|
19
|
-
}, undefined, false, undefined, this);
|
|
20
|
-
}
|
|
21
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
22
|
-
className: "relative",
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
25
|
-
className: "absolute top-0 left-4 h-full w-0.5 bg-border"
|
|
26
|
-
}, undefined, false, undefined, this),
|
|
27
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
28
|
-
className: "space-y-4",
|
|
29
|
-
children: items.map((item) => {
|
|
30
|
-
const tipId = item.step.metadata?.tipId ?? "default";
|
|
31
|
-
const icon = TIP_ICONS[tipId] ?? TIP_ICONS.default;
|
|
32
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
33
|
-
className: "relative flex gap-4 pl-2",
|
|
34
|
-
children: [
|
|
35
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
36
|
-
className: cn("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm", item.isCompleted ? "bg-green-500 text-white" : "bg-muted text-muted-foreground"),
|
|
37
|
-
children: item.isCompleted ? "✓" : icon
|
|
38
|
-
}, undefined, false, undefined, this),
|
|
39
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
40
|
-
className: "flex-1 rounded-lg border bg-card p-3",
|
|
41
|
-
children: [
|
|
42
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
43
|
-
className: "flex items-start justify-between gap-2",
|
|
44
|
-
children: [
|
|
45
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
46
|
-
children: [
|
|
47
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
48
|
-
className: "font-medium",
|
|
49
|
-
children: item.step.title
|
|
50
|
-
}, undefined, false, undefined, this),
|
|
51
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
52
|
-
className: "mt-0.5 text-muted-foreground text-sm",
|
|
53
|
-
children: item.step.description
|
|
54
|
-
}, undefined, false, undefined, this)
|
|
55
|
-
]
|
|
56
|
-
}, undefined, true, undefined, this),
|
|
57
|
-
item.step.xpReward && /* @__PURE__ */ jsxDEV("span", {
|
|
58
|
-
className: cn("shrink-0 font-medium text-xs", item.isCompleted ? "text-green-500" : "text-muted-foreground"),
|
|
59
|
-
children: [
|
|
60
|
-
"+",
|
|
61
|
-
item.step.xpReward,
|
|
62
|
-
" XP"
|
|
63
|
-
]
|
|
64
|
-
}, undefined, true, undefined, this)
|
|
65
|
-
]
|
|
66
|
-
}, undefined, true, undefined, this),
|
|
67
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
68
|
-
className: "mt-2 flex items-center gap-2 text-muted-foreground text-xs",
|
|
69
|
-
children: item.isCompleted ? /* @__PURE__ */ jsxDEV("span", {
|
|
70
|
-
className: "text-green-500",
|
|
71
|
-
children: [
|
|
72
|
-
"✓ Completed",
|
|
73
|
-
item.completedAt && ` • ${item.completedAt}`
|
|
74
|
-
]
|
|
75
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */ jsxDEV("span", {
|
|
76
|
-
children: "Pending action"
|
|
77
|
-
}, undefined, false, undefined, this)
|
|
78
|
-
}, undefined, false, undefined, this)
|
|
79
|
-
]
|
|
80
|
-
}, undefined, true, undefined, this)
|
|
81
|
-
]
|
|
82
|
-
}, item.step.id, true, undefined, this);
|
|
83
|
-
})
|
|
84
|
-
}, undefined, false, undefined, this)
|
|
85
|
-
]
|
|
86
|
-
}, undefined, true, undefined, this);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/views/Timeline.tsx
|
|
90
|
-
import {
|
|
91
|
-
Card,
|
|
92
|
-
CardContent,
|
|
93
|
-
CardHeader,
|
|
94
|
-
CardTitle
|
|
95
|
-
} from "@contractspec/lib.ui-kit-web/ui/card";
|
|
96
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
97
|
-
"use client";
|
|
98
|
-
function Timeline({ track, progress }) {
|
|
99
|
-
const feedItems = track.steps.map((step) => ({
|
|
100
|
-
step,
|
|
101
|
-
isCompleted: progress.completedStepIds.includes(step.id),
|
|
102
|
-
completedAt: progress.completedStepIds.includes(step.id) ? "Recently" : undefined
|
|
103
|
-
})).sort((a, b) => {
|
|
104
|
-
if (a.isCompleted && !b.isCompleted)
|
|
105
|
-
return -1;
|
|
106
|
-
if (!a.isCompleted && b.isCompleted)
|
|
107
|
-
return 1;
|
|
108
|
-
return 0;
|
|
109
|
-
});
|
|
110
|
-
const completedCount = feedItems.filter((f) => f.isCompleted).length;
|
|
111
|
-
const pendingCount = feedItems.length - completedCount;
|
|
112
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
113
|
-
className: "space-y-6",
|
|
114
|
-
children: [
|
|
115
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
116
|
-
className: "text-center",
|
|
117
|
-
children: [
|
|
118
|
-
/* @__PURE__ */ jsxDEV2("h2", {
|
|
119
|
-
className: "font-bold text-xl",
|
|
120
|
-
children: "Activity Timeline"
|
|
121
|
-
}, undefined, false, undefined, this),
|
|
122
|
-
/* @__PURE__ */ jsxDEV2("p", {
|
|
123
|
-
className: "text-muted-foreground",
|
|
124
|
-
children: "Your coaching journey and tip history"
|
|
125
|
-
}, undefined, false, undefined, this)
|
|
126
|
-
]
|
|
127
|
-
}, undefined, true, undefined, this),
|
|
128
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
129
|
-
className: "grid grid-cols-2 gap-4",
|
|
130
|
-
children: [
|
|
131
|
-
/* @__PURE__ */ jsxDEV2(Card, {
|
|
132
|
-
children: /* @__PURE__ */ jsxDEV2(CardContent, {
|
|
133
|
-
className: "p-4 text-center",
|
|
134
|
-
children: [
|
|
135
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
136
|
-
className: "font-bold text-2xl text-green-500",
|
|
137
|
-
children: completedCount
|
|
138
|
-
}, undefined, false, undefined, this),
|
|
139
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
140
|
-
className: "text-muted-foreground text-sm",
|
|
141
|
-
children: "Tips Actioned"
|
|
142
|
-
}, undefined, false, undefined, this)
|
|
143
|
-
]
|
|
144
|
-
}, undefined, true, undefined, this)
|
|
145
|
-
}, undefined, false, undefined, this),
|
|
146
|
-
/* @__PURE__ */ jsxDEV2(Card, {
|
|
147
|
-
children: /* @__PURE__ */ jsxDEV2(CardContent, {
|
|
148
|
-
className: "p-4 text-center",
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
151
|
-
className: "font-bold text-2xl text-amber-500",
|
|
152
|
-
children: pendingCount
|
|
153
|
-
}, undefined, false, undefined, this),
|
|
154
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
155
|
-
className: "text-muted-foreground text-sm",
|
|
156
|
-
children: "Tips Pending"
|
|
157
|
-
}, undefined, false, undefined, this)
|
|
158
|
-
]
|
|
159
|
-
}, undefined, true, undefined, this)
|
|
160
|
-
}, undefined, false, undefined, this)
|
|
161
|
-
]
|
|
162
|
-
}, undefined, true, undefined, this),
|
|
163
|
-
/* @__PURE__ */ jsxDEV2(Card, {
|
|
164
|
-
children: [
|
|
165
|
-
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
166
|
-
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
167
|
-
className: "flex items-center gap-2",
|
|
168
|
-
children: [
|
|
169
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
170
|
-
children: "\uD83D\uDCDD"
|
|
171
|
-
}, undefined, false, undefined, this),
|
|
172
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
173
|
-
children: "Coaching Feed"
|
|
174
|
-
}, undefined, false, undefined, this)
|
|
175
|
-
]
|
|
176
|
-
}, undefined, true, undefined, this)
|
|
177
|
-
}, undefined, false, undefined, this),
|
|
178
|
-
/* @__PURE__ */ jsxDEV2(CardContent, {
|
|
179
|
-
children: /* @__PURE__ */ jsxDEV2(TipFeed, {
|
|
180
|
-
items: feedItems
|
|
181
|
-
}, undefined, false, undefined, this)
|
|
182
|
-
}, undefined, false, undefined, this)
|
|
183
|
-
]
|
|
184
|
-
}, undefined, true, undefined, this),
|
|
185
|
-
/* @__PURE__ */ jsxDEV2(Card, {
|
|
186
|
-
children: [
|
|
187
|
-
/* @__PURE__ */ jsxDEV2(CardHeader, {
|
|
188
|
-
children: /* @__PURE__ */ jsxDEV2(CardTitle, {
|
|
189
|
-
className: "flex items-center gap-2",
|
|
190
|
-
children: [
|
|
191
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
192
|
-
children: "\uD83D\uDCC8"
|
|
193
|
-
}, undefined, false, undefined, this),
|
|
194
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
195
|
-
children: "Journey Stats"
|
|
196
|
-
}, undefined, false, undefined, this)
|
|
197
|
-
]
|
|
198
|
-
}, undefined, true, undefined, this)
|
|
199
|
-
}, undefined, false, undefined, this),
|
|
200
|
-
/* @__PURE__ */ jsxDEV2(CardContent, {
|
|
201
|
-
children: /* @__PURE__ */ jsxDEV2("div", {
|
|
202
|
-
className: "space-y-4",
|
|
203
|
-
children: [
|
|
204
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
205
|
-
className: "flex items-center justify-between",
|
|
206
|
-
children: [
|
|
207
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
208
|
-
className: "text-muted-foreground",
|
|
209
|
-
children: "Total Tips"
|
|
210
|
-
}, undefined, false, undefined, this),
|
|
211
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
212
|
-
className: "font-semibold",
|
|
213
|
-
children: track.steps.length
|
|
214
|
-
}, undefined, false, undefined, this)
|
|
215
|
-
]
|
|
216
|
-
}, undefined, true, undefined, this),
|
|
217
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
218
|
-
className: "flex items-center justify-between",
|
|
219
|
-
children: [
|
|
220
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
221
|
-
className: "text-muted-foreground",
|
|
222
|
-
children: "Completed"
|
|
223
|
-
}, undefined, false, undefined, this),
|
|
224
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
225
|
-
className: "font-semibold text-green-500",
|
|
226
|
-
children: completedCount
|
|
227
|
-
}, undefined, false, undefined, this)
|
|
228
|
-
]
|
|
229
|
-
}, undefined, true, undefined, this),
|
|
230
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
231
|
-
className: "flex items-center justify-between",
|
|
232
|
-
children: [
|
|
233
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
234
|
-
className: "text-muted-foreground",
|
|
235
|
-
children: "XP Earned"
|
|
236
|
-
}, undefined, false, undefined, this),
|
|
237
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
238
|
-
className: "font-semibold text-orange-500",
|
|
239
|
-
children: progress.xpEarned
|
|
240
|
-
}, undefined, false, undefined, this)
|
|
241
|
-
]
|
|
242
|
-
}, undefined, true, undefined, this),
|
|
243
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
244
|
-
className: "flex items-center justify-between",
|
|
245
|
-
children: [
|
|
246
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
247
|
-
className: "text-muted-foreground",
|
|
248
|
-
children: "Current Streak"
|
|
249
|
-
}, undefined, false, undefined, this),
|
|
250
|
-
/* @__PURE__ */ jsxDEV2("span", {
|
|
251
|
-
className: "font-semibold",
|
|
252
|
-
children: progress.streakDays > 0 ? `\uD83D\uDD25 ${progress.streakDays} days` : "Start today!"
|
|
253
|
-
}, undefined, false, undefined, this)
|
|
254
|
-
]
|
|
255
|
-
}, undefined, true, undefined, this)
|
|
256
|
-
]
|
|
257
|
-
}, undefined, true, undefined, this)
|
|
258
|
-
}, undefined, false, undefined, this)
|
|
259
|
-
]
|
|
260
|
-
}, undefined, true, undefined, this)
|
|
261
|
-
]
|
|
262
|
-
}, undefined, true, undefined, this);
|
|
263
|
-
}
|
|
264
|
-
export {
|
|
265
|
-
Timeline
|
|
266
|
-
};
|
|
1
|
+
import{cn as L}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as z,jsxs as A}from"react/jsx-runtime";var M={cash_buffer_too_high:"\uD83D\uDCB0",no_savings_goal:"\uD83C\uDFAF",irregular_savings:"\uD83D\uDCC5",noise_late_evening:"\uD83D\uDD07",guest_frequency_high:"\uD83D\uDC65",shared_space_conflicts:"\uD83C\uDFE0",default:"\uD83D\uDCA1"};function Q({items:B}){if(B.length===0)return z("div",{className:"py-8 text-center text-muted-foreground",children:"No tips yet. Start engaging with coaching tips!"});return A("div",{className:"relative",children:[z("div",{className:"absolute top-0 left-4 h-full w-0.5 bg-border"}),z("div",{className:"space-y-4",children:B.map((q)=>{let D=q.step.metadata?.tipId??"default",E=M[D]??M.default;return A("div",{className:"relative flex gap-4 pl-2",children:[z("div",{className:L("relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-sm",q.isCompleted?"bg-green-500 text-white":"bg-muted text-muted-foreground"),children:q.isCompleted?"✓":E}),A("div",{className:"flex-1 rounded-lg border bg-card p-3",children:[A("div",{className:"flex items-start justify-between gap-2",children:[A("div",{children:[z("p",{className:"font-medium",children:q.step.title}),z("p",{className:"mt-0.5 text-muted-foreground text-sm",children:q.step.description})]}),q.step.xpReward&&A("span",{className:L("shrink-0 font-medium text-xs",q.isCompleted?"text-green-500":"text-muted-foreground"),children:["+",q.step.xpReward," XP"]})]}),z("div",{className:"mt-2 flex items-center gap-2 text-muted-foreground text-xs",children:q.isCompleted?A("span",{className:"text-green-500",children:["✓ Completed",q.completedAt&&` • ${q.completedAt}`]}):z("span",{children:"Pending action"})})]})]},q.step.id)})})]})}import{Card as G,CardContent as J,CardHeader as R,CardTitle as U}from"@contractspec/lib.ui-kit-web/ui/card";import{jsx as h,jsxs as v}from"react/jsx-runtime";function w({track:B,progress:q}){let D=B.steps.map((y)=>({step:y,isCompleted:q.completedStepIds.includes(y.id),completedAt:q.completedStepIds.includes(y.id)?"Recently":void 0})).sort((y,K)=>{if(y.isCompleted&&!K.isCompleted)return-1;if(!y.isCompleted&&K.isCompleted)return 1;return 0}),E=D.filter((y)=>y.isCompleted).length,V=D.length-E;return v("div",{className:"space-y-6",children:[v("div",{className:"text-center",children:[h("h2",{className:"font-bold text-xl",children:"Activity Timeline"}),h("p",{className:"text-muted-foreground",children:"Your coaching journey and tip history"})]}),v("div",{className:"grid grid-cols-2 gap-4",children:[h(G,{children:v(J,{className:"p-4 text-center",children:[h("div",{className:"font-bold text-2xl text-green-500",children:E}),h("div",{className:"text-muted-foreground text-sm",children:"Tips Actioned"})]})}),h(G,{children:v(J,{className:"p-4 text-center",children:[h("div",{className:"font-bold text-2xl text-amber-500",children:V}),h("div",{className:"text-muted-foreground text-sm",children:"Tips Pending"})]})})]}),v(G,{children:[h(R,{children:v(U,{className:"flex items-center gap-2",children:[h("span",{children:"\uD83D\uDCDD"}),h("span",{children:"Coaching Feed"})]})}),h(J,{children:h(Q,{items:D})})]}),v(G,{children:[h(R,{children:v(U,{className:"flex items-center gap-2",children:[h("span",{children:"\uD83D\uDCC8"}),h("span",{children:"Journey Stats"})]})}),h(J,{children:v("div",{className:"space-y-4",children:[v("div",{className:"flex items-center justify-between",children:[h("span",{className:"text-muted-foreground",children:"Total Tips"}),h("span",{className:"font-semibold",children:B.steps.length})]}),v("div",{className:"flex items-center justify-between",children:[h("span",{className:"text-muted-foreground",children:"Completed"}),h("span",{className:"font-semibold text-green-500",children:E})]}),v("div",{className:"flex items-center justify-between",children:[h("span",{className:"text-muted-foreground",children:"XP Earned"}),h("span",{className:"font-semibold text-orange-500",children:q.xpEarned})]}),v("div",{className:"flex items-center justify-between",children:[h("span",{className:"text-muted-foreground",children:"Current Streak"}),h("span",{className:"font-semibold",children:q.streakDays>0?`\uD83D\uDD25 ${q.streakDays} days`:"Start today!"})]})]})})]})]})}export{w as Timeline};
|